update accounting mapping

This commit is contained in:
edmondlang
2023-07-19 13:32:09 +08:00
parent dfd870b590
commit c6ffc89773
3 changed files with 5 additions and 9 deletions
@@ -93,9 +93,9 @@ class UpdateBankStatementDetailLogic extends AbstractControllerLogic
if (in_array($systemReference, ['exchange', 'izyim'])) {
$transaction = $this->checksBillNumber->execute($transactionReference, $systemReference);
if (!count($transaction)) {
if (is_array($transaction) && empty($transaction)) {
throw new MalformedRequestException('Transaction Not Found.');
}
}
if($systemReference === 'exchange') {
$owner_type = Transaction::class;
@@ -116,7 +116,7 @@ class UpdateBankStatementDetailLogic extends AbstractControllerLogic
$transactionType = $transaction['type'];
if (($payFor === 'sales' && !in_array($transactionType, [ShippingTransactionType::PAYMENT, ShippingTransactionType::GROUP_PAYMENT]))
|| ($payFor === 'top_up' && !in_array($transactionType, [ShippingTransactionType::TOP_UP]))) {
|| ($payFor === 'top_up' && !in_array($transactionType, [ShippingTransactionType::TOP_UP, ShippingTransactionType::GROUP_PAYMENT]))) {
throw new MalformedRequestException('Transaction Type does not match.');
}
@@ -20,11 +20,7 @@ class ChecksBillNumber
$payload = $data['payload'];
return $payload['data'];
} catch (\Exception $exception) {
dd($exception->getMessage());
// preg_match('/\{.*\}/s', $exception->getMessage(), $matches);
// $jsonError = json_decode($matches[0]);
// Retrieved Transactions failed
// throw new MalformedRequestException($jsonError->title);
throw new MalformedRequestException($exception->getMessage());
}
}
@@ -127,7 +127,7 @@ class ExportsInvoiceTransactions implements FromQuery, WithHeadings, WithHeading
return [
'<<New>>',
$row['updated_at'],
Carbon::parse($row['updated_at'])->format('m/d/Y H:m'),
$row['debtor_code'],
$row['type'] === ShippingTransactionType::PAYMENT ? $row['order_reference'] : $row['marking'],
'',