fix status

This commit is contained in:
cnohall 2025-10-17 15:00:42 +09:00
parent caa025b502
commit 42f8881231
1 changed files with 3 additions and 0 deletions

View File

@ -145,6 +145,9 @@ class BlockonomicsPaymentDriver extends BaseDriver
// Do I need to loop through each payment for the invoice? // Do I need to loop through each payment for the invoice?
if ($invoice) { if ($invoice) {
$invoice->balance = $invoice->amount - $payment->amount; $invoice->balance = $invoice->amount - $payment->amount;
$invoice->status_id = $invoice->balance <= 0
? Invoice::STATUS_PAID
: Invoice::STATUS_PARTIAL;
$invoice->save(); $invoice->save();
} }
} }