1
0
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:
David Bomba 2024-10-28 18:32:28 +11:00
parent 582c5b27cc
commit 23126820fe

View File

@ -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();