Update Modern

This commit is contained in:
Benjamin Beganović 2021-08-24 16:35:58 +02:00
parent f106f92065
commit 4c254e7da8

View File

@ -77,9 +77,7 @@
margin: 3rem 2rem; margin: 3rem 2rem;
} }
#product-table, [data-ref="table"] {
#delivery-note-table,
#task-table {
min-width: 100%; min-width: 100%;
table-layout: fixed; table-layout: fixed;
overflow-wrap: break-word; overflow-wrap: break-word;
@ -91,49 +89,35 @@
color: grey; color: grey;
} }
#product-table > thead, [data-ref="table"] > thead {
#delivery-note-table > thead,
#task-table > thead {
text-align: left; text-align: left;
width: 100%; width: 100%;
} }
#product-table th + th, [data-ref="table"] th + th {
#delivery-note-table th + th,
#task-table th + th {
border-left: 2px solid white; border-left: 2px solid white;
} }
#product-table > thead > tr > th, [data-ref="table"] > thead > tr > th {
#delivery-note-table > thead > tr > th,
#task-table > thead > tr > th {
padding: 0.8rem; padding: 0.8rem;
background-color: var(--secondary-color); background-color: var(--secondary-color);
color: white; color: white;
} }
#product-table > thead > tr > th:last-child, [data-ref="table"] > thead > tr > th:last-child {
#delivery-note-table > thead > tr > th:last-child,
#task-table > thead > tr > th:last-child {
text-align: right; text-align: right;
} }
#product-table > tbody > tr > td, [data-ref="table"] > tbody > tr > td {
#delivery-note-table > tbody > tr > td,
#task-table > tbody > tr > td {
border-bottom: 1px solid var(--secondary-color); border-bottom: 1px solid var(--secondary-color);
padding: 1rem; padding: 1rem;
} }
#product-table > tbody > tr > td:first-child, [data-ref="table"] > tbody > tr > td:first-child {
#delivery-note-table > tbody > tr > td:first-child,
#task-table > tbody > tr > td:first-child {
font-weight: bold; font-weight: bold;
} }
#product-table > tbody > tr > td:last-child, [data-ref="table"] > tbody > tr > td:last-child {
#delivery-note-table > tbody > tr > td:last-child,
#task-table > tbody > tr > td:last-child {
text-align: right; text-align: right;
} }
@ -282,6 +266,13 @@
width: 23%; width: 23%;
} }
[data-ref="statement-totals"] {
margin-top: 1rem;
margin-bottom: 1rem;
text-align: right;
margin-right: .75rem;
}
/** Useful snippets, uncomment to enable. **/ /** Useful snippets, uncomment to enable. **/
/** Hide company logo **/ /** Hide company logo **/
@ -339,9 +330,20 @@
<!-- Start Print Content --> <!-- Start Print Content -->
<div class="table-wrapper"> <div class="table-wrapper">
<table id="product-table" cellspacing="0" class="print-content"></table> <table id="product-table" cellspacing="0" class="print-content" data-ref="table"></table>
<table id="task-table" cellspacing="0" class="print-content"></table>
<table id="delivery-note-table" cellspacing="0" class="print-content"></table> <table id="task-table" cellspacing="0" class="print-content" data-ref="table"></table>
<table id="delivery-note-table" cellspacing="0" class="print-content" data-ref="table"></table>
<table id="statement-invoice-table" cellspacing="0" class="print-content" data-ref="table"></table>
<div id="statement-invoice-table-totals" data-ref="statement-totals"></div>
<table id="statement-payment-table" cellspacing="0" class="print-content" data-ref="table"></table>
<div id="statement-payment-table-totals" data-ref="statement-totals"></div>
<table id="statement-aging-table" cellspacing="0" class="print-content" data-ref="table"></table>
<div id="statement-aging-table-totals" data-ref="statement-totals"></div>
</div> </div>
<!-- End Print Content --> <!-- End Print Content -->
</td> </td>
@ -371,7 +373,12 @@
<script> <script>
// Clear up space a bit, if [product-table, tasks-table, delivery-note-table] isn't present. // Clear up space a bit, if [product-table, tasks-table, delivery-note-table] isn't present.
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
['product-table', 'task-table', 'delivery-note-table'].forEach((tableIdentifier) => { 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).childElementCount === 0
? document.getElementById(tableIdentifier).style.display = 'none' ? document.getElementById(tableIdentifier).style.display = 'none'
: ''; : '';