mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
change posting date to invoice date for shipping portal when export invoice to autocount
This commit is contained in:
@@ -33,10 +33,12 @@ class MappableTransactionWithDetailsResource extends JsonResource
|
||||
$order = $this->owner->owner->owner;
|
||||
$data['order_reference'] = $order->reference;
|
||||
$data['debtor_code'] = $order->companyModule->company->debtor;
|
||||
$data['created_at'] = $this->owner->created_at; // invoice date
|
||||
} elseif (in_array($this->type, [TransactionType::GROUP_PAYMENT, TransactionType::TOP_UP])) {
|
||||
$connection = $this->owner->owner->inviters()->withPivot('invitee_reference')->first();
|
||||
$data['marking'] = $connection ? $connection->pivot->invitee_reference : '';
|
||||
$data['bill_no'] = $this->bill_no;
|
||||
$data['created_at'] = $this->created_at;
|
||||
} else {
|
||||
$payments = $this->transactions()
|
||||
->payments()->where('status', ApprovalStatus::APPROVED)
|
||||
@@ -54,6 +56,7 @@ class MappableTransactionWithDetailsResource extends JsonResource
|
||||
'type' => $payment->type,
|
||||
'marking' => null,
|
||||
'amount' => $payment->amount,
|
||||
'created_at' => $this->created_at
|
||||
];
|
||||
})->toArray();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user