update to bill refund for 1688 supplier

This commit is contained in:
JiaSheng
2024-02-25 20:43:01 +08:00
parent 25de31ea2e
commit 767d6c84fe
3 changed files with 27 additions and 7 deletions
@@ -150,7 +150,9 @@ class CreateSupplierBillGroupLogic extends AbstractControllerLogic
}
//create bill refund
foreach ($supplierRefunds as $supplierRefund) {
$amount += $service_charges;
foreach ($supplierRefunds as $supplierRefund) {
$refund = Transaction::find($supplierRefund['id']);
$deductedRefunds = $refund->transactions()->where('type', TransactionType::BILL_REFUND)->where('status', ApprovalStatus::APPROVED)->get();
$refundDeductableAmount = $refund->amount - $deductedRefunds->sum('amount');