mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
E-Invoice - Project 27: Import Tax Entity, Customers Data Report
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user