mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-30 09:53:58 +00:00
New button to allow admin to switch e-credit note to normal credit note for customer otped in for e-invoice
This commit is contained in:
@@ -40,6 +40,8 @@ class TransactionResource extends JsonResource
|
||||
//Check if Transaction of type PAYMENT has an override for recipient bank - ends
|
||||
|
||||
$eInvoice = false;
|
||||
$manualOptInNormalCreditNote = false;
|
||||
|
||||
if($booking && $this->type === TransactionType::REFUND){
|
||||
$kvp = $this->attributesKVP()->where('key', KVPKey::TRANSACTION_MODEL_CLASS)->first();
|
||||
if($kvp){
|
||||
@@ -51,6 +53,12 @@ class TransactionResource extends JsonResource
|
||||
}
|
||||
}
|
||||
}
|
||||
$kvp = $this->attributesKVP()->where('key', KVPKey::CREDIT_NOTE_NORMAL_OPT_IN_OVERRIDE)->first();
|
||||
if($kvp){
|
||||
if($kvp->value == 1){
|
||||
$manualOptInNormalCreditNote = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1);
|
||||
@@ -90,6 +98,7 @@ class TransactionResource extends JsonResource
|
||||
'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,
|
||||
'e_invoice' => $this->when($this->type === TransactionType::REFUND, $eInvoice),
|
||||
'manual_opt_in_normal_credit_note' => $this->when($this->type === TransactionType::REFUND, $manualOptInNormalCreditNote),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user