E-Invoice - Minor syntax update, sync code from Shipping Portal

This commit is contained in:
Dillon Ngo
2025-08-08 21:40:02 +08:00
parent 9c05773a9c
commit 36ed332e5f
2 changed files with 18 additions and 18 deletions
+2 -2
View File
@@ -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'
];
}
}