mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #6732 from beganovich/v5-704
Statement improvements & fixes
This commit is contained in:
commit
01b65cfc8e
@ -605,6 +605,16 @@ class Design extends BaseDesign
|
||||
|
||||
public function tableTotals(): array
|
||||
{
|
||||
if ($this->type === self::STATEMENT) {
|
||||
return [
|
||||
['element' => 'div', 'properties' => ['style' => 'display: flex; flex-direction: column;'], 'elements' => [
|
||||
['element' => 'div', 'properties' => ['style' => 'margin-top: 1.5rem; display: flex; align-items: flex-start;'], 'elements' => [
|
||||
['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'height: 2.5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false', 'id' => 'invoiceninja-whitelabel-logo']],
|
||||
]],
|
||||
]],
|
||||
];
|
||||
}
|
||||
|
||||
$_variables = array_key_exists('variables', $this->context)
|
||||
? $this->context['variables']
|
||||
: ['values' => ['$entity.public_notes' => $this->entity->public_notes, '$entity.terms' => $this->entity->terms, '$entity_footer' => $this->entity->footer], 'labels' => []];
|
||||
@ -626,7 +636,7 @@ class Design extends BaseDesign
|
||||
['element' => 'div', 'properties' => ['class' => 'totals-table-right-side', 'dir' => '$dir'], 'elements' => []],
|
||||
];
|
||||
|
||||
if ($this->type == self::DELIVERY_NOTE || $this->type == self::STATEMENT) {
|
||||
if ($this->type == self::DELIVERY_NOTE) {
|
||||
return $elements;
|
||||
}
|
||||
|
||||
|
@ -217,6 +217,13 @@ trait DesignHelpers
|
||||
|
||||
public function sharedFooterElements()
|
||||
{
|
||||
// We want to show headers for statements, no exceptions.
|
||||
$statements = "
|
||||
document.querySelectorAll('#statement-invoice-table > thead > tr > th, #statement-payment-table > thead > tr > th, #statement-aging-table > thead > tr > th').forEach(t => {
|
||||
t.hidden = false;
|
||||
});
|
||||
";
|
||||
|
||||
// Unminified version, just for the reference.
|
||||
// By default all table headers are hidden with HTML `hidden` property.
|
||||
// This will check for table data values & if they're not empty it will remove hidden from the column itself.
|
||||
@ -259,6 +266,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
$html_decode = 'document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(`[data-state="encoded-html"]`).forEach(e=>e.innerHTML=e.innerText)},!1);';
|
||||
|
||||
return ['element' => 'div', 'elements' => [
|
||||
['element' => 'script', 'content' => $statements],
|
||||
['element' => 'script', 'content' => $javascript],
|
||||
['element' => 'script', 'content' => $html_decode],
|
||||
]];
|
||||
|
Loading…
x
Reference in New Issue
Block a user