mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-25 07:23:59 +00:00
-complete supplier bill group when oustanding is 0
-create refund and supplier refund if the request refund order is in white form
This commit is contained in:
+6
@@ -85,6 +85,8 @@ class UpdateRefundTransactionStatusLogic extends AbstractControllerLogic
|
||||
|
||||
$paymentTransaction = $refundTransaction->owner;
|
||||
|
||||
$supplierRefundTransaction = $paymentTransaction->transactions()->supplierRefunds()->where('status', [ApprovalStatus::PENDING_VERIFICATION])->first();
|
||||
|
||||
$booking = $paymentTransaction->owner;
|
||||
|
||||
$reference = $refundTransaction->amount == $paymentTransaction->amount ? 'Fully Refund for Ref. ' . $booking->marking : 'Partially Refund for Ref. ' . $booking->marking;
|
||||
@@ -93,6 +95,10 @@ class UpdateRefundTransactionStatusLogic extends AbstractControllerLogic
|
||||
$this->creditWalletProcessor->execute($booking->company, $refundTransaction->type, $refundTransaction->amount, $reference);
|
||||
}
|
||||
|
||||
if ($supplierRefundTransaction) {
|
||||
$this->updatesTransactionStatus->execute($supplierRefundTransaction, $request->route('status'));
|
||||
}
|
||||
|
||||
$paidAmount = $paymentTransaction->original_amount - $this->calculatesBookingRefundAmount->calculateRefundAmount($paymentTransaction, $booking->fix_currency_id);
|
||||
if (!$paidAmount > 0) {
|
||||
$this->updatesTransactionStatus->execute($paymentTransaction, ApprovalStatus::REFUNDED);
|
||||
|
||||
Reference in New Issue
Block a user