fix bug unmapped invoice

This commit is contained in:
Steve Ng
2023-11-04 10:45:41 +08:00
parent 4bf32ac285
commit db88edabfe
3 changed files with 20 additions and 17 deletions
@@ -127,7 +127,24 @@ class ExportsInvoiceTransactions implements FromQuery, WithHeadings, WithHeading
Log::info('Error in Exports Invoice Transactions ' . $this->counter);
return [];
return [
'Transaction Not Found',
$transaction->posting_date->format('m/d/Y H:m'),
$transaction->transaction_description.' - '.$transaction->transaction_description_2,
$statementTransactionOwner->system,
'',
'',
'',
'',
'',
'',
0,
$transaction->amount,
'',
'',
'',
''
];
}
$row = $row[0];
@@ -55,7 +55,7 @@ class ImportStatementInvoiceController
foreach ($excelRows as $row) {
$row['mapped_result_reference'] = null;
$row['mapped_status'] = 'failed';
$row['date'] = $this->changeExcelDate($row['date']);
$row['date'] = date('Y-m-d', strtotime($row['date']));
// Shipping Info
// TOPUP -> map with transaction.bill_no
@@ -162,11 +162,4 @@ class ImportStatementInvoiceController
}
return false;
}
public function changeExcelDate($date)
{
$unixTime = (($date - 25569) * 86400);
$date = new DateTime("@$unixTime");
return $date->format('Y-m-d'); // Change the format to 'Y-m-d'
}
}
@@ -53,7 +53,7 @@ class ImportStatementReceiptsController
foreach ($excelRows as $row) {
$row['mapped_result_reference'] = null;
$row['mapped_status'] = 'failed';
$row['date'] = $this->changeExcelDate($row['doc_date']);
$row['date'] = date('Y-m-d', strtotime($row['doc_date']));
$returnReference = $this->mappingExchange($row);
if ($returnReference) {
@@ -104,11 +104,4 @@ class ImportStatementReceiptsController
}
return false;
}
public function changeExcelDate($date)
{
$unixTime = (($date - 25569) * 86400);
$date = new DateTime("@$unixTime");
return $date->format('Y-m-d'); // Change the format to 'Y-m-d'
}
}