Hipster: Show statement label

This commit is contained in:
Benjamin Beganović 2021-09-17 20:06:41 +02:00
parent 926a599e8d
commit 672c832b9b
3 changed files with 13 additions and 0 deletions

View File

@ -82,6 +82,12 @@ class PdfMaker
return $this; return $this;
} }
/**
* Final method to get compiled HTML.
*
* @param bool $final @deprecated
* @return mixed
*/
public function getCompiledHTML($final = false) public function getCompiledHTML($final = false)
{ {
$html = $this->document->saveHTML(); $html = $this->document->saveHTML();

View File

@ -454,6 +454,7 @@ class HtmlEngine
$data['$method'] = ['value' => ' ', 'label' => ctrans('texts.method')]; $data['$method'] = ['value' => ' ', 'label' => ctrans('texts.method')];
$data['$amount'] = ['value' => '', 'label' => ctrans('texts.amount')]; $data['$amount'] = ['value' => '', 'label' => ctrans('texts.amount')];
$data['$statement'] = ['value' => '', 'label' => ctrans('texts.statement')];
$arrKeysLength = array_map('strlen', array_keys($data)); $arrKeysLength = array_map('strlen', array_keys($data));
array_multisort($arrKeysLength, SORT_DESC, $data); array_multisort($arrKeysLength, SORT_DESC, $data);

View File

@ -345,6 +345,12 @@
? document.getElementById(tableIdentifier).style.display = 'none' ? document.getElementById(tableIdentifier).style.display = 'none'
: ''; : '';
}); });
// If we have elements in these tables, we can change label to "Statement" & hide entity details.
if (document.querySelectorAll('#statement-payment-table > tbody, #statement-payment-table > tbody, #statement-aging-table-totals > tbody').length > 0) {
document.querySelector('.entity-label').innerText = '$statement_label';
document.querySelector('.entity-details-wrapper').style.display = 'none';
}
}); });
</script> </script>
</div> </div>