mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Remove refund from payment balance calculations
This commit is contained in:
parent
582c5b27cc
commit
23126820fe
@ -168,7 +168,7 @@ class ClientService
|
||||
->where('client_id', $this->client->id)
|
||||
->where('is_deleted', 0)
|
||||
->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PENDING, Payment::STATUS_PARTIALLY_REFUNDED, Payment::STATUS_REFUNDED])
|
||||
->selectRaw('SUM(payments.amount - payments.applied - payments.refunded) as amount')->first()->amount ?? 0;
|
||||
->selectRaw('SUM(payments.amount - payments.applied) as amount')->first()->amount ?? 0;
|
||||
|
||||
DB::connection(config('database.default'))->transaction(function () use ($amount) {
|
||||
$this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first();
|
||||
|
Loading…
Reference in New Issue
Block a user