mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
E-Invoice - Minor syntax update, sync code from Shipping Portal
This commit is contained in:
@@ -87,7 +87,7 @@ class Helper
|
||||
return strtoupper('ringgit ' . $ringgitWords . ' and ' . $centsWords . ' cents only');
|
||||
}
|
||||
|
||||
public static function getStateCodeByName($name)
|
||||
public static function getLHDNStateCodeByName($name)
|
||||
{
|
||||
$path = resource_path('data/lhdn/StateCodes.json');
|
||||
|
||||
@@ -127,7 +127,7 @@ class Helper
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function getMsicDescriptionByCode($code)
|
||||
public static function getLHDNMsicDescriptionByCode($code)
|
||||
{
|
||||
$path = resource_path('data/lhdn/MSICSubCategoryCodes.json');
|
||||
|
||||
|
||||
@@ -81,22 +81,22 @@ class ExportsCompanies implements FromQuery, WithHeadings, WithHeadingRow, WithM
|
||||
}
|
||||
|
||||
return [
|
||||
$company->tin, // 'TIN',
|
||||
$identityReference, // 'IdentityNo',
|
||||
$company->name, // 'Name',
|
||||
$identityType === DocumentType::IDENTITY_CARD ? 'MyKAD' : '', // 'IdentityType',
|
||||
$company->type !== null ? (string) $company->type : '0', // 'TaxClassification',
|
||||
$company->msic_code, // 'MSICCode',
|
||||
$company->msic_code ? Helper::getMsicDescriptionByCode($company->msic_code) : '', // 'BusinessActivityDesc',
|
||||
$company->debtor, // 'DebtorCode',
|
||||
$company->name, // 'TradeName',
|
||||
$address ? $address->street_one . ',' . $address->street_two : '',// 'Address',
|
||||
$address ? $address->postcode : '', // 'PostCode',
|
||||
$company->contacts()->first() ? $company->contacts()->first()->phone : '', // 'Phone',
|
||||
$employee ? $employee->email : '', // 'EmailAddress',
|
||||
$address ? $address->district()->first()->name : '', // 'City',
|
||||
'MYS', // 'CountryCode',
|
||||
$address ? Helper::getStateCodeByName($address->state()->first()->name) : '', // 'StateCode'
|
||||
$company->tin, // 'TIN',
|
||||
$identityReference, // 'IdentityNo',
|
||||
$company->name, // 'Name',
|
||||
$identityType === DocumentType::IDENTITY_CARD ? 'MyKAD' : '', // 'IdentityType',
|
||||
$company->type !== null ? (string) $company->type : '0', // 'TaxClassification',
|
||||
$company->msic_code, // 'MSICCode',
|
||||
$company->msic_code ? Helper::getLHDNMsicDescriptionByCode($company->msic_code) : '', // 'BusinessActivityDesc',
|
||||
$company->debtor, // 'DebtorCode',
|
||||
$company->name, // 'TradeName',
|
||||
$address ? $address->street_one . ',' . $address->street_two : '', // 'Address',
|
||||
$address ? $address->postcode : '', // 'PostCode',
|
||||
$company->contacts()->first() ? $company->contacts()->first()->phone : '', // 'Phone',
|
||||
$employee ? $employee->email : '', // 'EmailAddress',
|
||||
$address ? $address->district()->first()->name : '', // 'City',
|
||||
'MYS', // 'CountryCode',
|
||||
$address ? Helper::getLHDNStateCodeByName($address->state()->first()->name) : '', // 'StateCode'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user