Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [%- USE date -%]
- [% FILTER collapse %]
- [%- SET invoice = target -%]
- <style type="text/css">
- #content {
- font-size: .8em;
- font-family: Tahoma, Geneva, sans-serif;
- margin:30px;
- page-break-after: always;
- }
- h1 {
- color: green;
- font-size: 3em;
- margin: 0px;
- padding:0px;
- }
- table {
- width:100%;
- padding:0px;
- margin:0px;
- }
- td {
- vertical-align:top;
- }
- #titleblock {
- float:right;
- width: 48%;
- }
- #titleblock table {
- border: 2px solid #000;
- margin: 0px;
- width: 100%;
- }
- #titleblock table tr td {
- padding: 5px;
- margin: 0px;
- font-weight: bold;
- font-size: .8em;
- }
- #vendor-table {
- border: 0px;
- padding: 0px;
- margin: 0px;
- }
- #vendor-table th {
- font-weight:bold;
- padding:5px;
- text-align:left;
- margin: 0px;
- font-size: 1em;
- }
- #vendor-table td {
- margin: 0px;
- font-size: .8em;
- }
- .box {
- padding: 10px;
- margin: 0px;
- border: 2px solid #000;
- font-size: .8em;
- }
- #vendor-notes {
- display:none;
- }
- #order-table-title, #fund-table-title {
- font-size: 1.2em;
- font-weight:bold;
- padding: 5px;
- margin: 20px 0px 0px 0px;
- }
- #order-table, #fund-table {
- border: 2px solid #000;
- margin:0px;
- padding: 0px;
- border-collapse: collapse;
- }
- .dist-table {
- border: 1px solid #666;
- border-collapse: collapse;
- padding: 0px;
- width: 100%;
- }
- #order-table thead, #fund-table thead {
- border-bottom: 2px solid #000;
- }
- .dist-table thead {
- border-bottom: 1px solid #666;
- }
- #order-table th, #fund-table th {
- font-weight:bold;
- padding:5px;
- font-size: .8em;
- vertical-align:bottom;
- }
- .dist-table th {
- font-weight:bold;
- padding:3px;
- font-size: .7em;
- vertical-align:bottom;
- text-align:left;
- }
- #order-table tr, #fund-table tr {
- border-bottom: 1px dashed #ccc;
- }
- .dist-table tr {
- border-bottom: 1px solid #666;
- }
- #order-table tr td, #fund-table tr td {
- padding: 5px;
- font-size: .8em;
- }
- .dist-table tr td {
- padding: 3px;
- font-size: .7em;
- }
- #subtotals {
- border-top:2px solid #000;
- }
- #subtotals td {
- font-weight:bold;
- padding: 5px;
- font-size: .8em;
- }
- </style>
- <div id="content">
- <div id="titleblock">
- <h1>Invoice</h1>
- <table>
- <tr><td>Invoice:</td><td>[% invoice.inv_ident %]</td></tr>
- [% IF invoice.inv_type %]
- <tr><td>Invoice Type:</td><td>[% invoice.inv_type %]</td></tr>
- [% END %]
- [% IF invoice.recv_date %]
- <tr><td>Invoice Date:</td>
- <td>[% invoice.recv_date.substr(0,10) %]</td>
- </tr>
- [% END %]
- <tr><td width=30%>Received By:</td>
- <td>[% invoice.receiver.name %] ([% invoice.receiver.shortname %])</td>
- </tr>
- [% IF invoice.recv_method %]
- <tr><td>Method:</td>
- <td>[% invoice.recv_method %]</td></tr>
- [% END %]
- </td></tr>
- [% IF invoice.note %]
- <tr><td>Note:</td><td>[% invoice.note %]</td></tr>
- [% END %]
- </table>
- </div>
- <div style="clear:both;"> </div>
- [% BLOCK ent_with_address %]
- [% ent.name %] ([% ent.code %])</div>
- [% IF ent.addresses.0 %]
- [% SET addr = ent.addresses.0 %]
- <div>[% addr.street1 %]</div>
- <div>[% addr.street2 %]</div>
- <div>[% addr.city %], [% addr.state %] [% addr.post_code %]</div>
- [% IF addr.country %]<div>[% addr.country %]</div>[% END %]
- [% END %]
- [% IF ent.phone %]<div>Phone: [% ent.phone %]</div>[% END %]
- [% IF ent.fax_phone %]<div>Fax: [% ent.fax_phone %]</div>[% END %]
- [% IF ent.url %]<div>URL: [% ent.url %]</div>[% END %]
- [% IF ent.email %]<div>E-mail: [% ent.email %]</div>[% END %]
- [% END %]
- <table id='vendor-table'>
- <thead>
- <tr>
- <th width="48%">Provider</th>
- <td width="4%"> </td>
- <th width="48%">Shipper</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="box">
- [% INCLUDE ent_with_address ent = invoice.provider %]
- </td>
- <td> </td>
- <td class="box">
- [% INCLUDE ent_with_address ent = invoice.shipper %]
- </td>
- </tr>
- </tbody>
- </table>
- <div id="order-table-title">Invoice Details</div>
- <table id="order-table">
- <thead>
- <tr>
- <th> </th>
- <th style="text-align:left;">Line ID</th>
- <th style="text-align:left;">PO</th>
- <th style="text-align:left;">ISBN/UPC
- <th style="text-align:left;">Title/Description</th>
- <th style="text-align:center;;">Quantity</th>
- <th style="text-align:right;">Unit Price</th>
- <th style="text-align:right;">Line Total</th>
- </tr>
- </thead>
- <tbody>
- [% subtotal = 0 %]
- [% qitotal = 0 %]
- [% lineno = 0 %]
- [% FOR entry IN invoice.entries %]
- [% lineno = lineno + 1 %]
- [% subtotal = subtotal + entry.cost_billed %]
- [% qitotal = qitotal + entry.inv_item_count %]
- [% percopy = entry.cost_billed / entry.inv_item_count %]
- <tr>
- <td>[% lineno %].</td>
- <td>
- [% entry.lineitem.id %]
- </td>
- <td>[% IF entry.purchase_order %]
- [% entry.purchase_order.name %]
- [% END %]
- </td>
- <td>
- [% IF entry.lineitem.attributes.isbn %]
- [% helpers.get_li_attr("isbn", "", entry.lineitem.attributes) %]
- [% ELSE %]
- [% helpers.get_li_attr("upc", "", entry.lineitem.attributes) %]
- [% END %]
- </td>
- <td>
- [% IF entry.lineitem %]
- [% helpers.get_li_attr("title", "", entry.lineitem.attributes
- ) %]
- [% IF helpers.get_li_attr(
- "author", "", entry.lineitem.attributes) %]
- <br />
- Author: [% helpers.get_li_attr(
- "author", "", entry.lineitem.attributes) %]
- [% END %]
- [% END %]
- [% IF entry.note %]<br/>Note: [% entry.note %][% END %]
- </td>
- <td style="text-align:center;">
- [% entry.inv_item_count %]
- </td>
- <td style="text-align:right;">$[% percopy | format('%.2f') %]</td>
- <td style="text-align:right;">
- $[% entry.cost_billed %]
- </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="6">
- <table class="dist-table">
- <thead>
- <tr>
- <th>Branch</th>
- <th>Fund</th>
- <th style="text-align:center;">Quantity</th>
- <th style="text-align:right;">Unit Price</th>
- </tr>
- </thead>
- <tbody>
- [% FOREACH lid IN entry.lineitem.lineitem_details %]
- <tr>
- <td>[% lid.owning_lib.shortname %]</td>
- <td>[% lid.fund.code %]</td>
- <td style="text-align:center;">1</td>
- <td style="text-align:right;">$[% percopy | format('%.2f') %]</td>
- </tr>
- [% END %]
- </tbody>
- </table>
- </td>
- <td> </td>
- </tr>
- [% END %]
- [% FOR item IN invoice.items %]
- [% lineno = lineno + 1 %]
- [% subtotal = subtotal + item.cost_billed %]
- <tr>
- <td>[% lineno %].</td>
- <td>
- [% IF item.inv_item_type %]
- [% item.inv_item_type %]<br />
- [% END %]
- [% IF item.purchase_order %]
- PO: [% item.purchase_order %]
- [% END %]
- </td>
- <td colspan="3">
- [% IF item.title %]
- [% item.title %]
- [% END %]
- [% IF item.author %]<br />
- Author: [% item.author %]<br />
- [% END %]
- [% IF item.note %]<br/>
- Note: [% item.note %]
- [% END %]
- </td>
- <td style="text-align:center;">n/a</td>
- <td style="text-align:right;">n/a</td>
- <td style="text-align:right;">$[% item.cost_billed | format('%.2f') %] </td>
- </tr>
- [% END %]
- <tr id="subtotals">
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td align='right'>Total:</td>
- <td align='center'>[% qitotal %]</td>
- <td> </td>
- <td align='right'>$[% subtotal | format('%.2f') %]</td>
- </tr>
- </tbody>
- </table>
- <div style="font-weight:bold;font-style:italic;">Total Line Item Count: [% lineno %]</div>
- <div id="fund-table-title">Amount Spent Per Fund</div>
- <table id="fund-table">
- <thead>
- <th style="text-align:left;">Fund</th>
- <th style="text-align:right;">Amount</th>
- </thead>
- <tbody>
- [% fundsubtotal = 0 %]
- [% FOR blob IN user_data %]
- [% fundsubtotal = fundsubtotal + blob.total %]
- <tr>
- <td>[% blob.fund.code %] ([% blob.fund.year %])</td>
- <td style="text-align:right;">$[% blob.total | format('%.2f') %]</td>
- </tr>
- [% END %]
- [% IF subtotal != fundsubtotal %]
- [% othersubtotal = subtotal - fundsubtotal %]
- <tr>
- <td>Other direct charges, taxes, fees, etc.</td>
- <td style="text-align:right;">$[% othersubtotal | format('%.2f') %]</td>
- </tr>
- [% END %]
- <tr id="subtotals">
- <td style="text-align:right;"> </td>
- <td style="text-align:right;">$[% subtotal | format('%.2f') %]</td>
- </tr>
- </tbody>
- </table>
- </div>
- [% END %]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement