mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
supplier bill payment refund module
This commit is contained in:
@@ -151,6 +151,22 @@ class ExpiredRefundedBookingCommand extends Command
|
||||
|
||||
$transaction = $this->createsTransaction->execute($bookingPayment, $object);
|
||||
}
|
||||
|
||||
if ($bookingInWhiteForm) {
|
||||
$refund = $bookingPayment->transactions()->supplierRefunds()->where('amount', $transaction->amount)->where('status', ApprovalStatus::APPROVED)->first();
|
||||
|
||||
if (!$refund) {
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('SRFD-');
|
||||
|
||||
$object = new TransactionObject($billNumber, TransactionType::SUPPLIER_REFUND, 1, $booking->company->id,
|
||||
1, PaymentMethodType::CASH,
|
||||
$transaction->amount, $transaction->amount * $bookingPayment->currency_rate, 1,
|
||||
$bookingPayment->original_currency_id, $bookingPayment->currency_rate,
|
||||
0, 0, null, ApprovalStatus::APPROVED, [], $bookingPayment->bill_no);
|
||||
|
||||
$transaction = $this->createsTransaction->execute($bookingPayment, $object);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log::info("Credit note transaction id: {$transaction->id}, booking marking not found, the payment reference is: {$transaction->payment_reference}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user