Advertisement
chrissharp123

Untitled

Oct 12th, 2018
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.36 KB | None | 0 0
  1. [%- USE date -%]
  2. [% FILTER collapse %]
  3. [%- SET invoice = target -%]
  4. <style type="text/css">
  5. #content {
  6. font-size: .8em;
  7. font-family: Tahoma, Geneva, sans-serif;
  8. margin:30px;
  9. page-break-after: always;
  10. }
  11. h1 {
  12. color: green;
  13. font-size: 3em;
  14. margin: 0px;
  15. padding:0px;
  16. }
  17. table {
  18. width:100%;
  19. padding:0px;
  20. margin:0px;
  21. }
  22. td {
  23. vertical-align:top;
  24. }
  25. #titleblock {
  26. float:right;
  27. width: 48%;
  28. }
  29. #titleblock table {
  30. border: 2px solid #000;
  31. margin: 0px;
  32. width: 100%;
  33. }
  34. #titleblock table tr td {
  35. padding: 5px;
  36. margin: 0px;
  37. font-weight: bold;
  38. font-size: .8em;
  39. }
  40. #vendor-table {
  41. border: 0px;
  42. padding: 0px;
  43. margin: 0px;
  44. }
  45. #vendor-table th {
  46. font-weight:bold;
  47. padding:5px;
  48. text-align:left;
  49. margin: 0px;
  50. font-size: 1em;
  51. }
  52. #vendor-table td {
  53. margin: 0px;
  54. font-size: .8em;
  55. }
  56. .box {
  57. padding: 10px;
  58. margin: 0px;
  59. border: 2px solid #000;
  60. font-size: .8em;
  61. }
  62. #vendor-notes {
  63. display:none;
  64. }
  65. #order-table-title, #fund-table-title {
  66. font-size: 1.2em;
  67. font-weight:bold;
  68. padding: 5px;
  69. margin: 20px 0px 0px 0px;
  70. }
  71. #order-table, #fund-table {
  72. border: 2px solid #000;
  73. margin:0px;
  74. padding: 0px;
  75. border-collapse: collapse;
  76. }
  77. .dist-table {
  78. border: 1px solid #666;
  79. border-collapse: collapse;
  80. padding: 0px;
  81. width: 100%;
  82. }
  83. #order-table thead, #fund-table thead {
  84. border-bottom: 2px solid #000;
  85. }
  86. .dist-table thead {
  87. border-bottom: 1px solid #666;
  88. }
  89. #order-table th, #fund-table th {
  90. font-weight:bold;
  91. padding:5px;
  92. font-size: .8em;
  93. vertical-align:bottom;
  94. }
  95. .dist-table th {
  96. font-weight:bold;
  97. padding:3px;
  98. font-size: .7em;
  99. vertical-align:bottom;
  100. text-align:left;
  101. }
  102.  
  103. #order-table tr, #fund-table tr {
  104. border-bottom: 1px dashed #ccc;
  105. }
  106. .dist-table tr {
  107. border-bottom: 1px solid #666;
  108. }
  109. #order-table tr td, #fund-table tr td {
  110. padding: 5px;
  111. font-size: .8em;
  112. }
  113. .dist-table tr td {
  114. padding: 3px;
  115. font-size: .7em;
  116. }
  117. #subtotals {
  118. border-top:2px solid #000;
  119. }
  120. #subtotals td {
  121. font-weight:bold;
  122. padding: 5px;
  123. font-size: .8em;
  124. }
  125.  
  126. </style>
  127. <div id="content">
  128. <div id="titleblock">
  129. <h1>Invoice</h1>
  130. <table>
  131. <tr><td>Invoice:</td><td>[% invoice.inv_ident %]</td></tr>
  132. [% IF invoice.inv_type %]
  133. <tr><td>Invoice Type:</td><td>[% invoice.inv_type %]</td></tr>
  134. [% END %]
  135. [% IF invoice.recv_date %]
  136. <tr><td>Invoice Date:</td>
  137. <td>[% invoice.recv_date.substr(0,10) %]</td>
  138. </tr>
  139. [% END %]
  140. <tr><td width=30%>Received By:</td>
  141. <td>[% invoice.receiver.name %] ([% invoice.receiver.shortname %])</td>
  142. </tr>
  143.  
  144. [% IF invoice.recv_method %]
  145. <tr><td>Method:</td>
  146. <td>[% invoice.recv_method %]</td></tr>
  147. [% END %]
  148. </td></tr>
  149. [% IF invoice.note %]
  150. <tr><td>Note:</td><td>[% invoice.note %]</td></tr>
  151. [% END %]
  152. </table>
  153. </div>
  154. <div style="clear:both;">&nbsp;</div>
  155.  
  156.  
  157. [% BLOCK ent_with_address %]
  158. [% ent.name %] ([% ent.code %])</div>
  159. [% IF ent.addresses.0 %]
  160. [% SET addr = ent.addresses.0 %]
  161. <div>[% addr.street1 %]</div>
  162. <div>[% addr.street2 %]</div>
  163. <div>[% addr.city %], [% addr.state %] &nbsp; [% addr.post_code %]</div>
  164. [% IF addr.country %]<div>[% addr.country %]</div>[% END %]
  165. [% END %]
  166. [% IF ent.phone %]<div>Phone: [% ent.phone %]</div>[% END %]
  167. [% IF ent.fax_phone %]<div>Fax: [% ent.fax_phone %]</div>[% END %]
  168. [% IF ent.url %]<div>URL: [% ent.url %]</div>[% END %]
  169. [% IF ent.email %]<div>E-mail: [% ent.email %]</div>[% END %]
  170. [% END %]
  171.  
  172.  
  173. <table id='vendor-table'>
  174. <thead>
  175. <tr>
  176. <th width="48%">Provider</th>
  177. <td width="4%">&nbsp; </td>
  178. <th width="48%">Shipper</th>
  179. </tr>
  180. </thead>
  181. <tbody>
  182. <tr>
  183. <td class="box">
  184. [% INCLUDE ent_with_address ent = invoice.provider %]
  185. </td>
  186. <td>&nbsp; </td>
  187. <td class="box">
  188. [% INCLUDE ent_with_address ent = invoice.shipper %]
  189. </td>
  190. </tr>
  191. </tbody>
  192. </table>
  193.  
  194. <div id="order-table-title">Invoice Details</div>
  195. <table id="order-table">
  196. <thead>
  197. <tr>
  198. <th>&nbsp;</th>
  199. <th style="text-align:left;">Line ID</th>
  200. <th style="text-align:left;">PO</th>
  201. <th style="text-align:left;">ISBN/UPC
  202. <th style="text-align:left;">Title/Description</th>
  203. <th style="text-align:center;;">Quantity</th>
  204. <th style="text-align:right;">Unit Price</th>
  205. <th style="text-align:right;">Line Total</th>
  206. </tr>
  207. </thead>
  208. <tbody>
  209.  
  210. [% subtotal = 0 %]
  211. [% qitotal = 0 %]
  212. [% lineno = 0 %]
  213.  
  214. [% FOR entry IN invoice.entries %]
  215.  
  216. [% lineno = lineno + 1 %]
  217. [% subtotal = subtotal + entry.cost_billed %]
  218. [% qitotal = qitotal + entry.inv_item_count %]
  219. [% percopy = entry.cost_billed / entry.inv_item_count %]
  220.  
  221. <tr>
  222. <td>[% lineno %].</td>
  223. <td>
  224. [% entry.lineitem.id %]
  225. </td>
  226. <td>[% IF entry.purchase_order %]
  227. [% entry.purchase_order.name %]
  228. [% END %]
  229. </td>
  230. <td>
  231. [% IF entry.lineitem.attributes.isbn %]
  232. [% helpers.get_li_attr("isbn", "", entry.lineitem.attributes) %]
  233. [% ELSE %]
  234. [% helpers.get_li_attr("upc", "", entry.lineitem.attributes) %]
  235. [% END %]
  236. </td>
  237. <td>
  238. [% IF entry.lineitem %]
  239. [% helpers.get_li_attr("title", "", entry.lineitem.attributes
  240. ) %]
  241. [% IF helpers.get_li_attr(
  242. "author", "", entry.lineitem.attributes) %]
  243. <br />
  244. Author: [% helpers.get_li_attr(
  245. "author", "", entry.lineitem.attributes) %]
  246. [% END %]
  247. [% END %]
  248. [% IF entry.note %]<br/>Note: [% entry.note %][% END %]
  249. </td>
  250. <td style="text-align:center;">
  251. [% entry.inv_item_count %]
  252. </td>
  253. <td style="text-align:right;">$[% percopy | format('%.2f') %]</td>
  254. <td style="text-align:right;">
  255. $[% entry.cost_billed %]
  256. </td>
  257. </tr>
  258. <tr>
  259. <td>&nbsp;</td>
  260. <td colspan="6">
  261. <table class="dist-table">
  262. <thead>
  263. <tr>
  264. <th>Branch</th>
  265. <th>Fund</th>
  266. <th style="text-align:center;">Quantity</th>
  267. <th style="text-align:right;">Unit Price</th>
  268. </tr>
  269. </thead>
  270. <tbody>
  271. [% FOREACH lid IN entry.lineitem.lineitem_details %]
  272. <tr>
  273. <td>[% lid.owning_lib.shortname %]</td>
  274. <td>[% lid.fund.code %]</td>
  275. <td style="text-align:center;">1</td>
  276. <td style="text-align:right;">$[% percopy | format('%.2f') %]</td>
  277. </tr>
  278. [% END %]
  279. </tbody>
  280. </table>
  281. </td>
  282. <td>&nbsp;</td>
  283. </tr>
  284. [% END %]
  285.  
  286. [% FOR item IN invoice.items %]
  287. [% lineno = lineno + 1 %]
  288. [% subtotal = subtotal + item.cost_billed %]
  289. <tr>
  290. <td>[% lineno %].</td>
  291. <td>
  292. [% IF item.inv_item_type %]
  293. [% item.inv_item_type %]<br />
  294. [% END %]
  295. [% IF item.purchase_order %]
  296. PO: [% item.purchase_order %]
  297. [% END %]
  298. </td>
  299. <td colspan="3">
  300. [% IF item.title %]
  301. [% item.title %]
  302. [% END %]
  303. [% IF item.author %]<br />
  304. Author: [% item.author %]<br />
  305. [% END %]
  306. [% IF item.note %]<br/>
  307. Note: [% item.note %]
  308. [% END %]
  309. </td>
  310. <td style="text-align:center;">n/a</td>
  311. <td style="text-align:right;">n/a</td>
  312. <td style="text-align:right;">$[% item.cost_billed | format('%.2f') %] </td>
  313. </tr>
  314. [% END %]
  315. <tr id="subtotals">
  316. <td>&nbsp;</td>
  317. <td>&nbsp;</td>
  318. <td>&nbsp;</td>
  319. <td>&nbsp;</td>
  320. <td align='right'>Total:</td>
  321. <td align='center'>[% qitotal %]</td>
  322. <td>&nbsp;</td>
  323. <td align='right'>$[% subtotal | format('%.2f') %]</td>
  324. </tr>
  325. </tbody>
  326. </table>
  327.  
  328. <div style="font-weight:bold;font-style:italic;">Total Line Item Count: [% lineno %]</div>
  329.  
  330. <div id="fund-table-title">Amount Spent Per Fund</div>
  331. <table id="fund-table">
  332. <thead>
  333. <th style="text-align:left;">Fund</th>
  334. <th style="text-align:right;">Amount</th>
  335. </thead>
  336. <tbody>
  337. [% fundsubtotal = 0 %]
  338. [% FOR blob IN user_data %]
  339. [% fundsubtotal = fundsubtotal + blob.total %]
  340. <tr>
  341. <td>[% blob.fund.code %] ([% blob.fund.year %])</td>
  342. <td style="text-align:right;">$[% blob.total | format('%.2f') %]</td>
  343. </tr>
  344. [% END %]
  345. [% IF subtotal != fundsubtotal %]
  346. [% othersubtotal = subtotal - fundsubtotal %]
  347. <tr>
  348. <td>Other direct charges, taxes, fees, etc.</td>
  349. <td style="text-align:right;">$[% othersubtotal | format('%.2f') %]</td>
  350. </tr>
  351. [% END %]
  352. <tr id="subtotals">
  353. <td style="text-align:right;">&nbsp;</td>
  354. <td style="text-align:right;">$[% subtotal | format('%.2f') %]</td>
  355. </tr>
  356. </tbody>
  357. </table>
  358. </div>
  359.  
  360. [% END %]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement