mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
E-Invoice - Automapping Issues, Sales Invoice Report (Import) with batch processing for E-Invoices
This commit is contained in:
@@ -74,12 +74,21 @@ class ImportExcelLogic extends AbstractControllerLogic
|
||||
'businessactivitydesc', 'debtorcode', 'tradename', 'address', 'postcode',
|
||||
'phone', 'emailaddress', 'city', 'countrycode', 'statecode'
|
||||
];
|
||||
if (
|
||||
($reportType === 'Sales Invoice Report' && $normalizedHeader !== $salesInvoiceHeader) ||
|
||||
($reportType === 'Customers Report' && $normalizedHeader !== $customersReportHeader)
|
||||
) {
|
||||
|
||||
if ($reportType === 'Sales Invoice Report') {
|
||||
$optionalColumn = 'einvoicevalidationlink';
|
||||
|
||||
if (
|
||||
$normalizedHeader !== $salesInvoiceHeader &&
|
||||
$normalizedHeader !== [...$salesInvoiceHeader, $optionalColumn]
|
||||
) {
|
||||
throw new MalformedRequestException('Uploaded Excel file format is incorrect. Column headers do not match expected format.');
|
||||
}
|
||||
|
||||
} elseif ($reportType === 'Customers Report' && $normalizedHeader !== $customersReportHeader) {
|
||||
throw new MalformedRequestException('Uploaded Excel file format is incorrect. Column headers do not match expected format.');
|
||||
}
|
||||
|
||||
$rows = $sheet->skip(1);
|
||||
|
||||
foreach ($rows as $index => $details) {
|
||||
|
||||
Reference in New Issue
Block a user