1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #4698 from beganovich/v5-data-refs-for-totals-table

(v5) Add data-refs to totals table for PDFs
This commit is contained in:
Benjamin Beganović 2021-01-15 12:57:07 +01:00 committed by GitHub
commit c46fc2f97b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -448,11 +448,11 @@ class Design extends BaseDesign
continue;
}
foreach ($taxes as $tax) {
foreach ($taxes as $i => $tax) {
$elements[] = ['element' => 'div', 'elements' => [
['element' => 'span', 'content' => 'This is placeholder for the 3rd fraction of element.', 'properties' => ['style' => 'opacity: 0%']], // Placeholder for fraction of element (3fr)
['element' => 'span', 'content', 'content' => $tax['name']],
['element' => 'span', 'content', 'content' => Number::formatMoney($tax['total'], $this->context['client'])],
['element' => 'span', 'content', 'content' => $tax['name'], 'properties' => ['data-ref' => 'totals-table-total_tax_' . $i . '-label']],
['element' => 'span', 'content', 'content' => Number::formatMoney($tax['total'], $this->context['client']), 'properties' => ['data-ref' => 'totals-table-total_tax_' . $i]],
]];
}
} elseif ($variable == '$line_taxes') {
@ -462,18 +462,18 @@ class Design extends BaseDesign
continue;
}
foreach ($taxes as $tax) {
foreach ($taxes as $i => $tax) {
$elements[] = ['element' => 'div', 'elements' => [
['element' => 'span', 'content' => 'This is placeholder for the 3rd fraction of element.', 'properties' => ['style' => 'opacity: 0%']], // Placeholder for fraction of element (3fr)
['element' => 'span', 'content', 'content' => $tax['name']],
['element' => 'span', 'content', 'content' => Number::formatMoney($tax['total'], $this->context['client'])],
['element' => 'span', 'content', 'content' => $tax['name'], 'properties' => ['data-ref' => 'totals-table-line_tax_' . $i . '-label']],
['element' => 'span', 'content', 'content' => Number::formatMoney($tax['total'], $this->context['client']), 'properties' => ['data-ref' => 'totals-table-line_tax_' . $i]],
]];
}
} else {
$elements[] = ['element' => 'div', 'elements' => [
['element' => 'span', 'content' => 'This is placeholder for the 3rd fraction of element.', 'properties' => ['style' => 'opacity: 0%']], // Placeholder for fraction of element (3fr)
['element' => 'span', 'content' => $variable . '_label', 'properties' => ['data-ref' => 'totals_table-' . substr($variable, 1)]],
['element' => 'span', 'content' => $variable],
['element' => 'span', 'content' => $variable . '_label', 'properties' => ['data-ref' => 'totals_table-' . substr($variable, 1) . '-label']],
['element' => 'span', 'content' => $variable, 'properties' => ['data-ref' => 'totals_table-' . substr($variable, 1)]],
]];
}
}