E-Invoice - Project 27: Import Tax Entity, Customers Data Report

This commit is contained in:
Dillon Ngo
2025-07-25 12:40:57 +08:00
parent 755961b23d
commit 3379952ec2
@@ -71,6 +71,10 @@ class ExportsCompanies implements FromQuery, WithHeadings, WithHeadingRow, WithM
$identityNo = $company->documents->where('document_type', DocumentType::SSM_REGISTRATION)->first();
$identityType = DocumentType::SSM_REGISTRATION;
}
$identityReference = "";
if($identityNo){
$identityReference = preg_replace('/\s*\(.*?\)/', '', $identityNo->reference);
}
$address = $company->addresses()->where('e_invoice', '=', true)->latest()->first();
if(!$address){
$address = $company->addresses()->where('billing', '=', true)->first();
@@ -78,7 +82,7 @@ class ExportsCompanies implements FromQuery, WithHeadings, WithHeadingRow, WithM
return [
$company->tin, // 'TIN',
$identityNo ? $identityNo->reference: '', // 'IdentityNo',
$identityReference, // 'IdentityNo',
$company->name, // 'Name',
$identityType === DocumentType::IDENTITY_CARD ? 'MyKAD' : '', // 'IdentityType',
$company->type !== null ? (string) $company->type : '0', // 'TaxClassification',