mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Mark free invoices as paid when plan change
This commit is contained in:
parent
17ad4678fb
commit
0806a15624
@ -959,11 +959,17 @@ class SubscriptionService
|
|||||||
'date' => now()->format('Y-m-d'),
|
'date' => now()->format('Y-m-d'),
|
||||||
];
|
];
|
||||||
|
|
||||||
return $invoice_repo->save($data, $invoice)
|
$invoice_repo->save($data, $invoice)
|
||||||
->service()
|
->service()
|
||||||
->markSent()
|
->markSent()
|
||||||
->fillDefaults()
|
->fillDefaults()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
|
if($invoice->fresh()->balance == 0){
|
||||||
|
$invoice->service()->markPaid()->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $invoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user