From 123c3f4f8532accd12cad4c5ff761fc4cf93f32a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 12 Jun 2025 11:40:09 +1000 Subject: [PATCH] Fixes for client credit balance --- app/Utils/HtmlEngine.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 2cbca0a4db..327e9fdc2f 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -401,8 +401,10 @@ class HtmlEngine $data['$credit.valid_until'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.valid_until')]; $data['$balance'] = ['value' => Number::formatMoney($this->getBalance(), $this->client) ?: ' ', 'label' => ctrans('texts.balance')]; + $data['$credit.balance'] = ['value' => Number::formatMoney($this->entity_calc->getBalance(), $this->client) ?: ' ', 'label' => ctrans('texts.credit_balance')]; - $data['$client.credit_balance'] = &$data['$credit.balance']; + $data['$client.credit_balance'] = ['value' => Number::formatMoney($this->entity->client->credit_balance, $this->client) ?: ' ', 'label' => ctrans('texts.credit_balance')]; + // $data['$client.credit_balance'] = &$data['$credit.balance']; $data['$invoice.balance'] = &$data['$balance']; $data['$taxes'] = ['value' => Number::formatMoney($this->entity_calc->getItemTotalTaxes(), $this->client) ?: ' ', 'label' => ctrans('texts.taxes')];