Merge branch 'dillon/34.6-jenkins-vapor' into vapor/development

This commit is contained in:
Dillon Ngo
2024-08-14 02:22:35 +08:00
226 changed files with 4085 additions and 466 deletions
@@ -19,9 +19,20 @@ class PaymentTransactionResource extends JsonResource
*/
public function toArray($request)
{
$booking = in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND])? $this->owner->owner : $this->owner;
$current_running_balance = $request['running_balance'];
$booking = null; //cief todo: 66
$bank = null;
//Check if Transaction of type PAYMENT has an override for recipient bank - starts
if(in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND])){
$booking = $this->owner->owner;
$bank = $this->owner->bank ?? $booking->bank;
}
else{
$booking = $this->owner;
$bank = $this->bank ?? $booking->bank;
}
//Check if Transaction of type PAYMENT has an override for recipient bank - ends
$booking_marking = '';
switch((int) $this->type){
@@ -55,7 +66,7 @@ class PaymentTransactionResource extends JsonResource
'bill_no' => $this->bill_no,
'payment_reference' => $this->payment_reference,
'payment_method' => (float) $this->payment_method,
'recipient_bank_account' => new BankResource($booking->bank),
'recipient_bank_account' => new BankResource($bank),
'issuer_name' => $this->issuerCompany->name,
'issuer_id' => $this->issuerCompany->id,
'amount' => (double) $this->amount,