1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Fixes for payment amount on statements.

This commit is contained in:
David Bomba 2023-01-11 23:40:08 +11:00
parent 2e24fc34c7
commit f02d781ae2

View File

@ -58,6 +58,8 @@ class Design extends BaseDesign
public $company; public $company;
public float $payment_amount_total = 0;
/** @var array */ /** @var array */
public $aging = []; public $aging = [];
@ -512,6 +514,7 @@ class Design extends BaseDesign
$tbody[] = $element; $tbody[] = $element;
$this->payment_amount_total += $payment->pivot->amount;
} }
} }
@ -534,7 +537,8 @@ class Design extends BaseDesign
$payment = $this->payments->first(); $payment = $this->payments->first();
return [ return [
['element' => 'p', 'content' => \sprintf('%s: %s', ctrans('texts.amount_paid'), Number::formatMoney($this->payments->sum('amount'), $this->client))], // ['element' => 'p', 'content' => \sprintf('%s: %s', ctrans('texts.amount_paid'), Number::formatMoney($this->payments->sum('amount'), $this->client))],
['element' => 'p', 'content' => \sprintf('%s: %s', ctrans('texts.amount_paid'), Number::formatMoney($this->payment_amount_total, $this->client))],
]; ];
} }