mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Minor fixes for tax currencies - vendor vs client
This commit is contained in:
parent
2244da8947
commit
e34cb0a585
@ -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')) {
|
||||
|
@ -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'])) {
|
||||
|
Loading…
Reference in New Issue
Block a user