From e34cb0a585c221501b3e26f8a565c9e093995b90 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 18 Dec 2022 18:09:39 +1100 Subject: [PATCH] Minor fixes for tax currencies - vendor vs client --- app/Services/PdfMaker/Design.php | 6 ++---- app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index b47884b63a..df0d16ebae 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -58,8 +58,6 @@ class Design extends BaseDesign public $company; - public $client_or_vendor_entity; - /** @var array */ public $aging = []; @@ -803,7 +801,7 @@ class Design extends BaseDesign foreach ($taxes as $i => $tax) { $elements[1]['elements'][] = ['element' => 'div', 'elements' => [ ['element' => 'span', 'content', 'content' => $tax['name'], 'properties' => ['data-ref' => 'totals-table-total_tax_' . $i . '-label']], - ['element' => 'span', 'content', 'content' => Number::formatMoney($tax['total'], $this->entity instanceof \App\Models\PurchaseOrder ? $this->company : $this->client_or_vendor_entity), 'properties' => ['data-ref' => 'totals-table-total_tax_' . $i]], + ['element' => 'span', 'content', 'content' => Number::formatMoney($tax['total'], $this->entity instanceof \App\Models\PurchaseOrder ? $this->vendor : $this->client), 'properties' => ['data-ref' => 'totals-table-total_tax_' . $i]], ]]; } } elseif ($variable == '$line_taxes') { @@ -816,7 +814,7 @@ class Design extends BaseDesign foreach ($taxes as $i => $tax) { $elements[1]['elements'][] = ['element' => 'div', 'elements' => [ ['element' => 'span', 'content', 'content' => $tax['name'], 'properties' => ['data-ref' => 'totals-table-line_tax_' . $i . '-label']], - ['element' => 'span', 'content', 'content' => Number::formatMoney($tax['total'], $this->entity instanceof \App\Models\PurchaseOrder ? $this->company : $this->client_or_vendor_entity), 'properties' => ['data-ref' => 'totals-table-line_tax_' . $i]], + ['element' => 'span', 'content', 'content' => Number::formatMoney($tax['total'], $this->entity instanceof \App\Models\PurchaseOrder ? $this->vendor : $this->client), 'properties' => ['data-ref' => 'totals-table-line_tax_' . $i]], ]]; } } elseif (Str::startsWith($variable, '$custom_surcharge')) { diff --git a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php index 94607c9de9..fd1603c71d 100644 --- a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php +++ b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php @@ -32,12 +32,10 @@ trait DesignHelpers if (isset($this->context['vendor'])) { $this->vendor = $this->context['vendor']; - $this->client_or_vendor_entity = $this->context['vendor']; } if (isset($this->context['client'])) { $this->client = $this->context['client']; - $this->client_or_vendor_entity = $this->context['client']; } if (isset($this->context['entity'])) {