1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
This commit is contained in:
Benjamin Beganović 2021-10-29 17:25:14 +02:00
parent 8e9afeae60
commit 3ca48a7c0b

View File

@ -227,6 +227,21 @@
white-space: nowrap;
}
/** .repeating-header,
.repeating-header-space, **/
.repeating-footer,
.repeating-footer-space {
height: 160px;
}
.repeating-header {
position: fixed;
top: 0;
}
.repeating-footer {
position: fixed;
bottom: 0;
}
/** Useful snippets, uncomment to enable. **/
/** Hide company logo **/
@ -257,102 +272,110 @@
/** To find out selectors on your own: https://invoiceninja.github.io/docs/custom-fields/#snippets **/
</style>
<div id="header"></div>
<div id="body">
<div class="header-wrapper">
<div class="header-left-side-wrapper">
<p class="header-text-label">$from_label:</p>
<div id="company-details"></div>
<div id="company-address"></div>
</div>
<div class="header-right-side-wrapper">
<div class="header-right-side-wrapper-left">
<p class="header-text-label">$to_label:</p>
<div id="client-details"></div>
<table>
<thead>
<tr>
<td>
<div class="repeating-header-space">&nbsp;</div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<div id="body">
<div class="header-wrapper">
<div class="header-left-side-wrapper">
<p class="header-text-label">$from_label:</p>
<div id="company-details"></div>
<div id="company-address"></div>
</div>
<div class="header-right-side-wrapper">
<div class="header-right-side-wrapper-left">
<p class="header-text-label">$to_label:</p>
<div id="client-details"></div>
</div>
<div class="header-right-side-wrapper-right">
<img
class="company-logo"
src="$company.logo"
alt="$company.name logo"
/>
</div>
</div>
</div>
<h1 class="entity-label">$entity_label</h1>
<div class="entity-details-wrapper">
<div>
<span class="entity-property-label" data-element="entity-details-wrapper-invoice-number-label">
$entity_number_label:
</span>
<span class="entity-property-value">$entity_number</span>
</div>
<div>
<span class="entity-property-label">$date_label:</span>
<span class="entity-property-value">$date</span>
</div>
<div>
<span class="entity-property-label">$payment_due_label:</span>
<span class="entity-property-value">$payment_due</span>
</div>
<div>
<span class="entity-property-label">$amount_due_label:</span>
<span
class="entity-property-value"
data-element="entity-details-wrapper-amount-due"
>$amount_due</span
>
</div>
</div>
<table id="product-table" cellspacing="0" data-ref="table"></table>
<table id="task-table" cellspacing="0" data-ref="table"></table>
<table id="delivery-note-table" cellspacing="0" data-ref="table"></table>
<table id="statement-invoice-table" cellspacing="0" data-ref="table"></table>
<div id="statement-invoice-table-totals" data-ref="statement-totals"></div>
<table id="statement-payment-table" cellspacing="0" data-ref="table"></table>
<div id="statement-payment-table-totals" data-ref="statement-totals"></div>
<table id="statement-aging-table" cellspacing="0" data-ref="table"></table>
<div id="statement-aging-table-totals" data-ref="statement-totals"></div>
<div id="table-totals" cellspacing="0"></div>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>
<div class="repeating-footer-space">&nbsp;</div>
</td>
</tr>
</tfoot>
</table>
<div class="header-right-side-wrapper-right">
<img
class="company-logo"
src="$company.logo"
alt="$company.name logo"
/>
</div>
</div>
</div>
<div class="repeating-header" id="header"></div>
<h1 class="entity-label">$entity_label</h1>
<div class="entity-details-wrapper">
<div>
<span class="entity-property-label" data-element="entity-details-wrapper-invoice-number-label">
$entity_number_label:
</span>
<span class="entity-property-value">$entity_number</span>
</div>
<div>
<span class="entity-property-label">$date_label:</span>
<span class="entity-property-value">$date</span>
</div>
<div>
<span class="entity-property-label">$payment_due_label:</span>
<span class="entity-property-value">$payment_due</span>
</div>
<div>
<span class="entity-property-label">$amount_due_label:</span>
<span
class="entity-property-value"
data-element="entity-details-wrapper-amount-due"
>$amount_due</span
>
</div>
</div>
<table id="product-table" cellspacing="0" data-ref="table"></table>
<table id="task-table" cellspacing="0" data-ref="table"></table>
<table id="delivery-note-table" cellspacing="0" data-ref="table"></table>
<table id="statement-invoice-table" cellspacing="0" data-ref="table"></table>
<div id="statement-invoice-table-totals" data-ref="statement-totals"></div>
<table id="statement-payment-table" cellspacing="0" data-ref="table"></table>
<div id="statement-payment-table-totals" data-ref="statement-totals"></div>
<table id="statement-aging-table" cellspacing="0" data-ref="table"></table>
<div id="statement-aging-table-totals" data-ref="statement-totals"></div>
<div id="table-totals" cellspacing="0"></div>
<div class="repeating-footer" id="footer">
<p data-ref="total_table-footer">$entity_footer</p>
</div>
<div id="footer">
<p data-ref="total_table-footer">$entity_footer</p>
<script>
// Clear up space a bit, if [product-table, tasks-table, delivery-note-table] isn't present.
document.addEventListener('DOMContentLoaded', () => {
let tables = [
'product-table', 'task-table', 'delivery-note-table',
'statement-invoice-table', 'statement-payment-table', 'statement-aging-table-totals',
];
<script>
// Clear up space a bit, if [product-table, tasks-table, delivery-note-table] isn't present.
document.addEventListener('DOMContentLoaded', () => {
let tables = [
'product-table', 'task-table', 'delivery-note-table',
'statement-invoice-table', 'statement-payment-table', 'statement-aging-table-totals',
];
tables.forEach((tableIdentifier) => {
document.getElementById(tableIdentifier).childElementCount === 0
? 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';
}
tables.forEach((tableIdentifier) => {
document.getElementById(tableIdentifier).childElementCount === 0
? document.getElementById(tableIdentifier).style.display = 'none'
: '';
});
</script>
</div>
// 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>