mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-09-01 19:04:00 +00:00
Laravel Vapor - Fix a front end display inaccurate on user UI when editing recipient bank details
This commit is contained in:
@@ -22,13 +22,16 @@ class TransactionResource extends JsonResource
|
||||
$booking = null; //cief todo: 66
|
||||
$bank = null;
|
||||
//Check if Transaction of type PAYMENT has an override for recipient bank - starts
|
||||
$isEditedBankRecipient = false;
|
||||
if(in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND, TransactionType::SUPPLIER_REFUND])){
|
||||
$booking = $this->owner->owner;
|
||||
$bank = $this->owner->bank ?? $booking->bank;
|
||||
$isEditedBankRecipient = $this->owner->bank ? true : false;
|
||||
}
|
||||
else{
|
||||
$booking = $this->owner;
|
||||
$bank = $this->bank ?? $booking->bank;
|
||||
$isEditedBankRecipient = $this->bank ? true : false;
|
||||
}
|
||||
//Check if Transaction of type PAYMENT has an override for recipient bank - ends
|
||||
$days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1);
|
||||
@@ -66,6 +69,7 @@ class TransactionResource extends JsonResource
|
||||
'remarks' => RemarkResource::collection($this->remarks),
|
||||
'redemption' => new VoucherRedemptionResource($this->voucherRedemption),
|
||||
'bank' => ((int) $this->type === TransactionType::PAYMENT) ? new BankResource($bank) : null, //When a transaction (of type payment) has an override recipient bank details on booking, this is NOT null
|
||||
'bank_recipient_edited' => $isEditedBankRecipient
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user