Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
- <style>
- @page {
- margin: 9cm 1.5cm 3cm 1.5cm;
- size: A4;
- font-size: 9pt;
- font-family: Arial;
- @top-center {
- content: element(header);
- vertical-align: bottom;
- }
- @bottom-left {
- content: element(footer);
- }
- @bottom-right {
- content: "Page "counter(page) " of "counter(pages);
- width: 3cm;
- font-size: 8pt;
- }
- }
- #page_header {
- position: running(header);
- }
- body {}
- table {
- border-collapse: collapse;
- }
- table * {
- font-weight: normal;
- font-size: 9pt;
- vertical-align: top;
- }
- #paper {
- font-size: 9pt;
- }
- #company_header {
- text-align: center;
- margin-bottom: 1em;
- }
- #company_header h1 {
- margin-bottom: 0.2em;
- }
- #document_title {
- text-align: center;
- font-weight: bold;
- font-size: 12pt;
- margin-bottom: 1em;
- }
- #page_header_invoice_info,
- #invoice_info {
- margin-bottom: 1em;
- }
- #account-info {
- text-align: left;
- }
- pre.pre-no-padding {
- margin-top: 0px;
- margin-bottom: 5px;
- }
- div.two-column {
- display: grid;
- grid-template:
- "left right"1fr / 50% 50%;
- align-items: stretch;
- }
- div.two-column-1 {
- grid-area: left;
- }
- div.two-column-2 {
- grid-area: right;
- }
- div.field {
- display: grid;
- grid-template:
- "name value"1fr / 3.2cm auto;
- text-align: left;
- }
- div.field_name {
- margin-right: 8px;
- }
- div.field_name::after {
- content: ':';
- float: right;
- }
- div#voucher-items table {
- margin-bottom: 1em;
- }
- div#voucher-items table thead tr {
- --pagedjs-repeat-header: all;
- }
- div#voucher-items table thead tr th {
- border-top: solid 1px black;
- border-bottom: solid 1px black;
- }
- div#voucher-items table tbody tr,
- div#voucher-items table tbody tr td {
- break-inside: avoid;
- }
- div#voucher-items table .table-col-index,
- div#voucher-items table .table-col-description {
- text-align: left;
- vertical-align: top;
- }
- div#voucher-items table .table-col-quantity,
- div#voucher-items table .table-col-unitprice,
- div#voucher-items table .table-col-excltax,
- div#voucher-items table .table-col-sst,
- div#voucher-items table .table-col-amount {
- text-align: right;
- vertical-align: top;
- padding-left: 0.2cm;
- }
- div#voucher-items table .table-last-row .table-col-excltax,
- div#voucher-items table .table-last-row .table-col-sst,
- div#voucher-items table .table-last-row .table-col-amount {
- font-weight: bold;
- }
- div#voucher-items table .table-last-row td {
- border-top: solid 1px black;
- border-bottom: solid 1px black;
- }
- div#toucher-table-footer table {
- font-weight: bold;
- width: 100%;
- border-top: solid 1px black;
- border-bottom: solid 1px black;
- }
- div#tax table {
- border-top: solid 1px black;
- border-bottom: solid 1px black;
- }
- div#tax table thead tr th {
- font-weight: bold;
- border-bottom: solid 1px black;
- }
- div#tax table .cell-summary {
- text-align: left;
- }
- div#tax table .cell-amount,
- div#tax table .cell-tax {
- text-align: right;
- padding-left: 0.2cm;
- }
- div.bank {
- margin-bottom: 1em;
- }
- div.invoice_footer {
- height: 100%;
- }
- div#page_footer {
- position: running(footer);
- font-size: 6pt;
- text-align: left;
- margin-bottom: 1cm;
- }
- div#page_foooter_first {
- font-size: 8pt;
- width: 50%
- }
- @media print {
- .last_page_footer {
- position: static; /* <-- Key line */
- bottom: 0px;
- left: 0px;
- width: 50%;
- vertical-align: bottom;
- }
- }
- </style>
- </head>
- <body>
- <div id="paper">
- <div id="page_header">
- <div id="company_header">
- <h1>{{ companyName }}</h1>
- <span>({{ companyRegistrationNumber }})</span><br />
- <span>{{ companyAddressLine1 }}</span><br />
- <span>{{ companyAddressLine2 }}</span><br />
- <span>{{ companyAddressLine3 }}</span><br />
- <span>Tel: {{ companyPhone }}</span> <span>Fax: {{ companyFax }}</span><br />
- </div>
- <div id="document_title">
- {{ title }}
- </div>
- <div id="page_header_invoice_info">
- <div class="two-column">
- <div class="two-column-1">
- <div id="account-info">
- A/C No: <b>{{ accToDebtorCode }}</b><br />
- <b>{{ accToName }}</b><br />
- {{ accToAddress }}<br />
- </div>
- </div>
- <div class="two-column-2">
- <div class="field">
- <div class="field_name">
- {{ invoiceNumberTitle }}
- </div>
- <div class="field_value">
- {{ invoiceNumber }}<br />
- </div>
- </div>
- <div class="field">
- <div class="field_name">
- DATE
- </div>
- <div class="field_value">
- {{ issueDate }}<br />
- </div>
- </div>
- <div class="field">
- <div class="field_name">
- TERM
- </div>
- <div class="field_value">
- {{ term }}<br />
- </div>
- </div>
- <div class="field">
- <div class="field_name">
- JOB NO.
- </div>
- <div class="field_value">
- {{ jobNumber }}<br />
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="voucher-items">
- <table width="100%">
- <thead>
- <tr>
- <th class="table-col-index">NO.</th>
- <th class="table-col-description">DESCRIPTION</th>
- <th class="table-col-quantity">QTY</th>
- <th class="table-col-unitprice">UNIT PRICE</th>
- <th class="table-col-amount">AMOUNT ({{ currency }})</th>
- </tr>
- </thead>
- <tbody>
- {{#each voucherItems}}
- <tr>
- <td class="table-col-index">
- {{ math @index "+" 1 }}
- </td>
- <td class="table-col-description">
- {{ chargeItemDescription }}<br />
- <pre class='pre-no-padding'>{{ bookingNo }}{{ reference1 }}{{ description }}</pre>
- </td>
- <td class="table-col-quantity">
- {{ quantity }}
- </td>
- <td class="table-col-unitprice">
- {{ unit }}
- </td>
- <td class="table-col-amount">
- {{ total }}
- </td>
- </tr>
- {{/each }}
- </tbody>
- </table>
- </div>
- <div id="invoice_footer">
- <div id="toucher-table-footer">
- <table>
- <tr class="table-last-row">
- <td class="table-col-description" colspan="2">
- {{ currency }}: {{ totalText }} ONLY
- </td>
- <td class="table-col-amount" colspan="2">
- TOTAL: ({{ currency }})
- </td>
- <td class="table-col-amount">
- {{ total }}
- </td>
- </tr>
- </table>
- </div>
- <div class="two-column">
- <div class="two-column-1">
- NOTE:<br />
- Punter we have to leverage up the messaging for tbrand terrorists. I just wanted to give you a heads-up get six alpha pups in here for a focus group high touch client so we've got to manage that low hanging fruit yet (let's not try to) boil the ocean (here/there/everywhere). Meeting assassin throughput. We’re all in this together, even if our businesses function differently accountable talk or deploy, so drill down pushback, nor let's unpack that later. High
- </div>
- <div class="two-column-2">
- <div id="tax">
- {{ companyName }}<br />
- <br />
- <br />
- <br />
- <br />
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
- AUTHORIZED SIGNATURE
- </div>
- </div>
- </div>
- <div id="page_footer">
- E. & O. E.<br />
- TERMS & CONDITIONS:<br />
- 1) Punter we have to leverage up the messaging for tbrand terrorists. I just wanted to give you a heads-up get six alpha pups in here for a focus group high touch client so we've got to manage that low hanging fruit yet (let's not try to) boil the ocean (here/there/everywhere). Meeting assassin throughput. We’re all in this together, even if our businesses function differently accountable talk or deploy, so drill down pushback, nor let's unpack that later. High
- </div>
- </div>
- </div>
- <script>
- class RepeatingTableHeaders extends Paged.Handler {
- constructor(chunker, polisher, caller) {
- super(chunker, polisher, caller);
- }
- afterPageLayout(pageElement, page, breakToken, chunker) {
- // Find all split table elements
- let tables = pageElement.querySelectorAll("table[data-split-from]");
- tables.forEach((table) => {
- // Get the reference UUID of the node
- let ref = table.dataset.ref;
- // Find the node in the original source
- let sourceTable = chunker.source.querySelector("[data-ref='" + ref + "']");
- // Find if there is a header
- let header = sourceTable.querySelector("thead");
- if (header) {
- // Clone the header element
- let clonedHeader = header.cloneNode(true);
- // Insert the header at the start of the split table
- table.insertBefore(clonedHeader, table.firstChild);
- }
- });
- }
- }
- Paged.registerHandlers(RepeatingTableHeaders);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement