Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.91 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="<?php _trans('cldr'); ?>">
  3. <head>
  4. <meta charset="utf-8">
  5. <title><?php _trans('invoice'); ?></title>
  6. <link rel="stylesheet"
  7. href="<?php echo base_url(); ?>assets/<?php echo get_setting('system_theme', 'invoiceplane'); ?>/css/templates.css">
  8. <link rel="stylesheet" href="<?php echo base_url(); ?>assets/core/css/custom-pdf.css">
  9. </head>
  10. <body>
  11. <header class="clearfix">
  12.  
  13. <div id="logo">
  14. <?php echo invoice_logo_pdf(); ?>
  15. </div>
  16.  
  17. <div id="client">
  18. <div>
  19. <b><?php _htmlsc(format_client($invoice)); ?></b>
  20. </div>
  21. <?php if ($invoice->client_vat_id) {
  22. echo '<div>' . trans('vat_id_short') . ': ' . $invoice->client_vat_id . '</div>';
  23. }
  24. if ($invoice->client_tax_code) {
  25. echo '<div>' . trans('tax_code_short') . ': ' . $invoice->client_tax_code . '</div>';
  26. }
  27. if ($invoice->client_address_1) {
  28. echo '<div>' . htmlsc($invoice->client_address_1) . '</div>';
  29. }
  30. if ($invoice->client_address_2) {
  31. echo '<div>' . htmlsc($invoice->client_address_2) . '</div>';
  32. }
  33. if ($invoice->client_city || $invoice->client_state || $invoice->client_zip) {
  34. echo '<div>';
  35. if ($invoice->client_city) {
  36. echo htmlsc($invoice->client_city) . ' ';
  37. }
  38. if ($invoice->client_state) {
  39. echo htmlsc($invoice->client_state) . ' ';
  40. }
  41. if ($invoice->client_zip) {
  42. echo htmlsc($invoice->client_zip);
  43. }
  44. echo '</div>';
  45. }
  46. if ($invoice->client_country) {
  47. echo '<div>' . get_country_name(trans('cldr'), $invoice->client_country) . '</div>';
  48. }
  49.  
  50. echo '<br/>';
  51.  
  52. if ($invoice->client_phone) {
  53. echo '<div>' . trans('phone_abbr') . ': ' . htmlsc($invoice->client_phone) . '</div>';
  54. } ?>
  55.  
  56. </div>
  57. <div id="company">
  58. <div><b><?php _htmlsc($invoice->user_name); ?></b></div>
  59. <?php if ($invoice->user_vat_id) {
  60. echo '<div>' . trans('vat_id_short') . ': ' . $invoice->user_vat_id . '</div>';
  61. }
  62. if ($invoice->user_tax_code) {
  63. echo '<div>' . trans('tax_code_short') . ': ' . $invoice->user_tax_code . '</div>';
  64. }
  65. if ($invoice->user_address_1) {
  66. echo '<div>' . htmlsc($invoice->user_address_1) . '</div>';
  67. }
  68. if ($invoice->user_address_2) {
  69. echo '<div>' . htmlsc($invoice->user_address_2) . '</div>';
  70. }
  71. if ($invoice->user_city || $invoice->user_state || $invoice->user_zip) {
  72. echo '<div>';
  73. if ($invoice->user_city) {
  74. echo htmlsc($invoice->user_city) . ' ';
  75. }
  76. if ($invoice->user_state) {
  77. echo htmlsc($invoice->user_state) . ' ';
  78. }
  79. if ($invoice->user_zip) {
  80. echo htmlsc($invoice->user_zip);
  81. }
  82. echo '</div>';
  83. }
  84. if ($invoice->user_country) {
  85. echo '<div>' . get_country_name(trans('cldr'), $invoice->user_country) . '</div>';
  86. }
  87.  
  88. echo '<br/>';
  89.  
  90. if ($invoice->user_phone) {
  91. echo '<div>' . trans('phone_abbr') . ': ' . htmlsc($invoice->user_phone) . '</div>';
  92. }
  93. if ($invoice->user_fax) {
  94. echo '<div>' . trans('fax_abbr') . ': ' . htmlsc($invoice->user_fax) . '</div>';
  95. }
  96. ?>
  97. </div>
  98.  
  99. </header>
  100.  
  101. <main>
  102.  
  103. <div class="invoice-details clearfix">
  104. <table>
  105. <tr>
  106. <td><?php echo trans('invoice_date') . ':'; ?></td>
  107. <td><?php echo date_from_mysql($invoice->invoice_date_created, true); ?></td>
  108. </tr>
  109. <tr>
  110. <td><?php echo trans('due_date') . ': '; ?></td>
  111. <td><?php echo date_from_mysql($invoice->invoice_date_due, true); ?></td>
  112. </tr>
  113. <tr>
  114. <td><?php echo trans('amount_due') . ': '; ?></td>
  115. <td><?php echo format_currency($invoice->invoice_balance); ?></td>
  116. </tr>
  117. <?php if ($payment_method): ?>
  118. <tr>
  119. <td><?php echo trans('payment_method') . ': '; ?></td>
  120. <td><?php _htmlsc($payment_method->payment_method_name); ?></td>
  121. </tr>
  122. <?php endif; ?>
  123. </table>
  124. </div>
  125.  
  126. <h1 class="invoice-title"><?php echo trans('invoice') . ' ' . $invoice->invoice_number; ?></h1>
  127.  
  128. <table class="item-table">
  129. <thead>
  130. <tr>
  131. <th class="item-name"><?php _trans('item'); ?></th>
  132. <th class="item-desc"><?php _trans('description'); ?></th>
  133. <th class="item-amount text-right"><?php _trans('qty'); ?></th>
  134. <th class="item-price text-right"><?php _trans('price'); ?></th>
  135. <?php if ($show_item_discounts) : ?>
  136. <th class="item-discount text-right"><?php _trans('discount'); ?></th>
  137. <?php endif; ?>
  138. <th class="item-total text-right"><?php _trans('total'); ?></th>
  139. </tr>
  140. </thead>
  141. <tbody>
  142.  
  143. <?php
  144. foreach ($items as $item) { ?>
  145. <tr>
  146. <td><?php _htmlsc($item->item_name); ?></td>
  147. <td><?php echo nl2br(htmlsc($item->item_description)); ?></td>
  148. <td class="text-right">
  149. <?php echo format_amount($item->item_quantity); ?>
  150. <?php if ($item->item_product_unit) : ?>
  151. <br>
  152. <small><?php _htmlsc($item->item_product_unit); ?></small>
  153. <?php endif; ?>
  154. </td>
  155. <td class="text-right">
  156. <?php echo format_currency($item->item_price); ?>
  157. </td>
  158. <?php if ($show_item_discounts) : ?>
  159. <td class="text-right">
  160. <?php echo format_currency($item->item_discount); ?>
  161. </td>
  162. <?php endif; ?>
  163. <td class="text-right">
  164. <?php echo format_currency($item->item_total); ?>
  165. </td>
  166. </tr>
  167. <?php } ?>
  168.  
  169. </tbody>
  170. <tbody class="invoice-sums">
  171.  
  172. <tr>
  173. <td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
  174. <?php _trans('subtotal'); ?>
  175. </td>
  176. <td class="text-right"><?php echo format_currency($invoice->invoice_item_subtotal); ?></td>
  177. </tr>
  178.  
  179. <?php if ($invoice->invoice_item_tax_total > 0) { ?>
  180. <tr>
  181. <td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
  182. <?php _trans('item_tax'); ?>
  183. </td>
  184. <td class="text-right">
  185. <?php echo format_currency($invoice->invoice_item_tax_total); ?>
  186. </td>
  187. </tr>
  188. <?php } ?>
  189.  
  190. <?php foreach ($invoice_tax_rates as $invoice_tax_rate) : ?>
  191. <tr>
  192. <td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
  193. <?php echo htmlsc($invoice_tax_rate->invoice_tax_rate_name) . ' (' . format_amount($invoice_tax_rate->invoice_tax_rate_percent) . '%)'; ?>
  194. </td>
  195. <td class="text-right">
  196. <?php echo format_currency($invoice_tax_rate->invoice_tax_rate_amount); ?>
  197. </td>
  198. </tr>
  199. <?php endforeach ?>
  200.  
  201. <?php if ($invoice->invoice_discount_percent != '0.00') : ?>
  202. <tr>
  203. <td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
  204. <?php _trans('discount'); ?>
  205. </td>
  206. <td class="text-right">
  207. <?php echo format_amount($invoice->invoice_discount_percent); ?>%
  208. </td>
  209. </tr>
  210. <?php endif; ?>
  211. <?php if ($invoice->invoice_discount_amount != '0.00') : ?>
  212. <tr>
  213. <td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
  214. <?php _trans('discount'); ?>
  215. </td>
  216. <td class="text-right">
  217. <?php echo format_currency($invoice->invoice_discount_amount); ?>
  218. </td>
  219. </tr>
  220. <?php endif; ?>
  221.  
  222. <tr>
  223. <td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
  224. <b><?php _trans('total'); ?></b>
  225. </td>
  226. <td class="text-right">
  227. <b><?php echo format_currency($invoice->invoice_total); ?></b>
  228. </td>
  229. </tr>
  230. <tr>
  231. <td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
  232. <?php _trans('paid'); ?>
  233. </td>
  234. <td class="text-right">
  235. <?php echo format_currency($invoice->invoice_paid); ?>
  236. </td>
  237. </tr>
  238. <tr>
  239. <td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
  240. <b><?php _trans('balance'); ?></b>
  241. </td>
  242. <td class="text-right">
  243. <b><?php echo format_currency($invoice->invoice_balance); ?></b>
  244. </td>
  245. </tr>
  246. </tbody>
  247. </table>
  248.  
  249. </main>
  250.  
  251. <footer>
  252. <?php if ($invoice->invoice_terms) : ?>
  253. <div class="notes">
  254. <b><?php _trans('terms'); ?></b><br/>
  255. <?php echo nl2br(htmlsc($invoice->invoice_terms)); ?>
  256. </div>
  257. <?php endif; ?>
  258. </footer>
  259.  
  260. </body>
  261. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement