mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
add further description to export payments
This commit is contained in:
@@ -32,16 +32,14 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
|
||||
'DocNo',
|
||||
'DocDate',
|
||||
'DebtorCode',
|
||||
'DebtorName',
|
||||
'CurrencyCode',
|
||||
'ShipInfo',
|
||||
'ItemCode',
|
||||
'AccNo',
|
||||
'DetailDescription',
|
||||
'FurtherDescription',
|
||||
'ProjNo',
|
||||
'DeptNo',
|
||||
'Qty',
|
||||
'UnitPrice',
|
||||
'AccNo',
|
||||
'DeptNo'
|
||||
'UnitPrice'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -85,21 +83,69 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
|
||||
$container = $transaction->owner->containers()->first();
|
||||
$order = $transaction->owner->owner;
|
||||
$company = $order->companyModule->company;
|
||||
$shippingTransactionDetails = $transaction->transactionDetails()->where('reference', 'SHIPPING_FEE')->first();
|
||||
|
||||
$invoice = [
|
||||
'<<New>>',
|
||||
$transaction->updated_at->format('m/d/Y H:m'),
|
||||
$company->debtor,
|
||||
'X1',
|
||||
$container->reference,
|
||||
'500-0000',
|
||||
'X1 Freight Service Charge',
|
||||
'FurtherDescription',
|
||||
$container->reference,
|
||||
'M3',
|
||||
'CIEF',
|
||||
$shippingTransactionDetails->quantity,
|
||||
$shippingTransactionDetails->price,
|
||||
$shippingTransactionDetails->amount,
|
||||
'****If there are any charges such as overweight & add-on services might be billed separately',
|
||||
];
|
||||
|
||||
$furtherDescription = '';
|
||||
|
||||
foreach ($transaction->transactionDetails() as $item){
|
||||
switch($item->reference){
|
||||
case 'SHIPPING_FEE':
|
||||
$furtherDescription .= str_replace($item->name, 'X1 Freight Service Charge<br>', '').'\r\n';
|
||||
case 'MIN_CBM_CHARGES':
|
||||
$furtherDescription .= $item->name.' '.$item->quantity.' CBM'.'\r\n';
|
||||
case 'OVER_WEIGHT_CHARGES':
|
||||
$furtherDescription .= $item->name.' '.$item->quantity.' CBM'.'\r\n';
|
||||
default:
|
||||
$furtherDescription .= $item->name.' '.$item->quantity.' X '.$item->price.'\r\n';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'<<New>>',
|
||||
$transaction->updated_at->format('m/d/Y H:m'),
|
||||
$company->debtor,
|
||||
'',
|
||||
'MYR',
|
||||
$order->reference,
|
||||
'500-0000',
|
||||
'X1 Freight Service Charge',
|
||||
$furtherDescription,
|
||||
$container->reference,
|
||||
'',
|
||||
'PLEASE REFER TO THE ATTACHED APPENDIX REF ' . $order->reference,
|
||||
'',
|
||||
1,
|
||||
round($transaction->amount, 2),
|
||||
'UNKNOWN',
|
||||
'CIEF'
|
||||
'CIEF',
|
||||
$shippingTransactionDetails->quantity,
|
||||
$shippingTransactionDetails->price
|
||||
];
|
||||
return [
|
||||
'<<New>>',
|
||||
$transaction->updated_at->format('m/d/Y H:m'),
|
||||
$company->debtor,
|
||||
$container->reference,
|
||||
'500-0000',
|
||||
'X1 Freight Service Charge',
|
||||
'FurtherDescription',
|
||||
$container->reference,
|
||||
'M3',
|
||||
'CIEF',
|
||||
$shippingTransactionDetails->quantity,
|
||||
$shippingTransactionDetails->price,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user