mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Fresh client prior to updating
This commit is contained in:
parent
6bd300a49b
commit
fee7d2c697
@ -88,6 +88,7 @@ class ApplyPayment extends AbstractService
|
||||
|
||||
$this->invoice
|
||||
->client
|
||||
->fresh()
|
||||
->service()
|
||||
->updateBalance($amount_paid)
|
||||
->save();
|
||||
|
@ -17,6 +17,7 @@ use App\Factory\PaymentFactory;
|
||||
use App\Jobs\Invoice\InvoiceWorkflowSettings;
|
||||
use App\Jobs\Payment\EmailPayment;
|
||||
use App\Libraries\Currency\Conversion\CurrencyApi;
|
||||
use App\Models\Client;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Services\AbstractService;
|
||||
@ -87,11 +88,13 @@ class ApplyPaymentAmount extends AbstractService
|
||||
|
||||
$this->invoice
|
||||
->client
|
||||
->fresh()
|
||||
->service()
|
||||
->updateBalance($payment->amount * -1)
|
||||
->updatePaidToDate($payment->amount)
|
||||
->save();
|
||||
|
||||
|
||||
if ($this->invoice->client->getSetting('client_manual_payment_notification')) {
|
||||
$payment->service()->sendEmail();
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ class MarkSent extends AbstractService
|
||||
$client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first();
|
||||
$client->balance += $adjustment;
|
||||
$client->save();
|
||||
|
||||
}, 1);
|
||||
|
||||
$this->invoice->markInvitationsSent();
|
||||
|
Loading…
Reference in New Issue
Block a user