1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Merge pull request #8089 from turbo124/v5-develop

Minor fixes for tax currencies - vendor vs client
This commit is contained in:
David Bomba 2022-12-18 18:10:00 +11:00 committed by GitHub
commit c753aaecd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -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')) {

View File

@ -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'])) {