supplier bill payment refund module

This commit is contained in:
Sai0224
2024-02-24 12:15:26 +08:00
parent ec0ebe3812
commit 25de31ea2e
18 changed files with 403 additions and 18 deletions
@@ -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}");
}