From f02d781ae20fe098d34d91e1a7145430e31a9fc4 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 11 Jan 2023 23:40:08 +1100 Subject: [PATCH] Fixes for payment amount on statements. --- app/Services/PdfMaker/Design.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index df0d16ebae..ea3b403815 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -58,6 +58,8 @@ class Design extends BaseDesign public $company; + public float $payment_amount_total = 0; + /** @var array */ public $aging = []; @@ -512,6 +514,7 @@ class Design extends BaseDesign $tbody[] = $element; + $this->payment_amount_total += $payment->pivot->amount; } } @@ -534,7 +537,8 @@ class Design extends BaseDesign $payment = $this->payments->first(); 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))], ]; }