Advertisement
Guest User

Oystein/Per operator invoice number simpleinvoices patch

a guest
Dec 29th, 2010
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.38 KB | None | 0 0
  1. diff -x tmp -x lang -x config -Naur simpleinvoices-2010.2-upadate1.orig/include/class/biller_index.php simpleinvoices-2010.2-upadate1/include/class/biller_index.php
  2. --- simpleinvoices-2010.2-upadate1.orig/include/class/biller_index.php 1970-01-01 01:00:00.000000000 +0100
  3. +++ simpleinvoices-2010.2-upadate1/include/class/biller_index.php 2010-12-29 21:57:24.000000000 +0100
  4. @@ -0,0 +1,91 @@
  5. +<?php
  6. +
  7. +/*
  8. +
  9. +Lagt til av Oystein
  10. +
  11. +Class: BillerIndex
  12. +
  13. +Purpose: Make it possible to have a different invoice number for each operator
  14. +
  15. +Details:
  16. +$node = this is the module in question - ie 'invoice', 'products' etc..
  17. +$sub_node = the sub set of the node - ie. this is the 'invoice preference' if node = 'invoice'
  18. +$sub_node_2 = 2nd sub set of the node - ir. this is the 'biller' if node = 'invoice'
  19. +
  20. +*/
  21. +
  22. +class biller_index
  23. +{
  24. +
  25. + public static function next($biller_id)
  26. + {
  27. + global $db;
  28. +
  29. + $sql = "select
  30. + invoice_number
  31. + from
  32. + si_biller_index
  33. + where
  34. + biller_id = :biller_id";
  35. +
  36. + $sth = $db->query($sql, ':biller_id', $biller_id) or die(htmlsafe(end($dbh->errorInfo())));
  37. + $index = $sth->fetch();
  38. +
  39. + if($index['invoice_number'] == "")
  40. + {
  41. + $invoice_number = "1";
  42. + } else {
  43. + $invoice_number = $index['invoice_number'] + 1;
  44. + }
  45. + return $invoice_number;
  46. + }
  47. +
  48. + public static function increment($biller_id)
  49. + {
  50. + $invoice_number = biller_index::next($biller_id);
  51. + global $db;
  52. +
  53. + if ($invoice_number == 1)
  54. + {
  55. +
  56. + $sql = "insert into si_biller_index (biller_id, invoice_number) VALUES (:biller_id, :invoice_number);";
  57. +
  58. + } else {
  59. + $sql ="update
  60. + si_biller_index
  61. + set
  62. + invoice_number = :invoice_number
  63. + where
  64. + biller_id = :biller_id";
  65. + }
  66. +
  67. + $sth = $db->query($sql,':biller_id',$biller_id,':invoice_number',$invoice_number) or die(htmlsafe(end($dbh->errorInfo())));
  68. + return $invoice_number;
  69. + }
  70. +
  71. +
  72. + public static function rewind()
  73. + {
  74. + global $db;
  75. + global $auth_session;
  76. +
  77. + if ($sub_node !="")
  78. + {
  79. + $subnode = "and sub_node = ".$sub_node;
  80. + }
  81. +
  82. + $sql ="update
  83. + si_index
  84. + set
  85. + id = (id - 1)
  86. + where
  87. + node = :node
  88. + and
  89. + domain_id = :domain_id
  90. + ".$subnode;
  91. +
  92. + $sth = $db->query($sql,':node',$node,':domain_id',$auth_session->domain_id) or die(htmlsafe(end($dbh->errorInfo())));
  93. + return $sth;
  94. + }
  95. +}
  96. diff -x tmp -x lang -x config -Naur simpleinvoices-2010.2-upadate1.orig/include/class/invoice.php simpleinvoices-2010.2-upadate1/include/class/invoice.php
  97. --- simpleinvoices-2010.2-upadate1.orig/include/class/invoice.php 2010-06-08 03:38:40.000000000 +0200
  98. +++ simpleinvoices-2010.2-upadate1/include/class/invoice.php 2010-12-29 21:57:24.000000000 +0100
  99. @@ -197,6 +197,7 @@
  100.  
  101. function select_all($type='', $dir='DESC', $rp='25', $page='1', $having='')
  102. {
  103. + global $logger;
  104. global $config;
  105. global $auth_session;
  106.  
  107. @@ -226,7 +227,8 @@
  108.  
  109.  
  110. /*Check that the sort field is OK*/
  111. - $validFields = array('index_name','iv.id', 'biller', 'customer', 'invoice_total','owing','date','aging','type','preference','type_id');
  112. +// $validFields = array('index_name','iv.id', 'biller', 'customer', 'invoice_total','owing','date','aging','type','preference','type_id');
  113. + $validFields = array('index_name','iv.id', 'biller', 'customer', 'invoice_total','owing','date','aging','type','preference','type_id','invoice_number');
  114.  
  115. if (in_array($sort, $validFields)) {
  116. $sort = $sort;
  117. @@ -355,10 +357,11 @@
  118. WHEN Age <= 60 THEN '31-60'
  119. WHEN Age <= 90 THEN '61-90'
  120. ELSE '90+' END)) AS aging,
  121. - iv.type_id As type_id,
  122. + iv.type_id AS type_id,
  123. pf.pref_description AS preference,
  124. pf.status AS status,
  125. - (SELECT CONCAT(pf.pref_inv_wording,' ',iv.index_id)) as index_name
  126. + (SELECT CONCAT(pf.pref_inv_wording,' ',iv.index_id)) as index_name,
  127. + iv.invoice_number AS invoice_number
  128. FROM " . TB_PREFIX . "invoices iv
  129. LEFT JOIN " . TB_PREFIX . "biller b ON b.id = iv.biller_id
  130. LEFT JOIN " . TB_PREFIX . "customers c ON c.id = iv.customer_id
  131. @@ -373,6 +376,8 @@
  132. break;
  133. }
  134.  
  135. + $logger->log("sql: ".$sql, ZEND_Log::INFO);
  136. +
  137. $result = dbQuery($sql,':domain_id', $auth_session->domain_id) or die(end($dbh->errorInfo()));
  138. return $result;
  139. }
  140. diff -x tmp -x lang -x config -Naur simpleinvoices-2010.2-upadate1.orig/include/init.php simpleinvoices-2010.2-upadate1/include/init.php
  141. --- simpleinvoices-2010.2-upadate1.orig/include/init.php 2010-06-05 02:54:29.000000000 +0200
  142. +++ simpleinvoices-2010.2-upadate1/include/init.php 2010-12-29 21:54:00.000000000 +0100
  143. @@ -148,6 +148,7 @@
  144.  
  145. include_once("./include/class/db.php");
  146. include_once("./include/class/index.php");
  147. +include_once("./include/class/biller_index.php"); // Added by oystein
  148. $db = db::getInstance();
  149.  
  150. include_once("./include/sql_queries.php");
  151. diff -x tmp -x lang -x config -Naur simpleinvoices-2010.2-upadate1.orig/include/sql_queries.php simpleinvoices-2010.2-upadate1/include/sql_queries.php
  152. --- simpleinvoices-2010.2-upadate1.orig/include/sql_queries.php 2010-07-09 07:11:32.000000000 +0200
  153. +++ simpleinvoices-2010.2-upadate1/include/sql_queries.php 2010-12-29 21:58:02.000000000 +0100
  154. @@ -97,6 +97,10 @@
  155.  
  156. function dbQuery($sqlQuery) {
  157. global $dbh;
  158. + global $logger;
  159. +
  160. +
  161. +
  162. $argc = func_num_args();
  163. $binds = func_get_args();
  164. $sth = false;
  165. @@ -108,6 +112,11 @@
  166. $sth->bindValue($binds[$i], $binds[++$i]);
  167. }
  168. }
  169. +
  170. +// lagt til av Oystein
  171. +// $logger->log("TESTING: sqlQuery: ".$sth->queryString." ".$binds[0]." ".$binds[1],
  172. +// ZEND_Log::INFO);
  173. +
  174. /*
  175. // PDO Execution
  176. if($sth && $sth->execute()) {
  177. @@ -1833,6 +1842,7 @@
  178. global $dbh;
  179. global $db_server;
  180. global $auth_session;
  181. + global $logger;
  182.  
  183. if ($db_server == 'mysql' && !_invoice_check_fk(
  184. $_POST['biller_id'], $_POST['customer_id'],
  185. @@ -1854,7 +1864,8 @@
  186. custom_field1,
  187. custom_field2,
  188. custom_field3,
  189. - custom_field4
  190. + custom_field4,
  191. + invoice_number
  192. )
  193. VALUES
  194. (
  195. @@ -1870,7 +1881,8 @@
  196. :customField1,
  197. :customField2,
  198. :customField3,
  199. - :customField4
  200. + :customField4,
  201. + :invoice_number
  202. )";
  203.  
  204. if ($db_server == 'pgsql') {
  205. @@ -1888,7 +1900,8 @@
  206. custom_field1,
  207. custom_field2,
  208. custom_field3,
  209. - custom_field4
  210. + custom_field4,
  211. + invoice_number
  212. )
  213. VALUES
  214. (
  215. @@ -1903,12 +1916,28 @@
  216. :customField1,
  217. :customField2,
  218. :customField3,
  219. - :customField4
  220. + :customField4,
  221. + :invoice_number
  222. )";
  223. }
  224. //echo $sql;
  225. $pref_group=getPreference($_POST[preference_id]);
  226.  
  227. +// lagt til av oystein
  228. +// $logger->log("TESTING: sql query: ".$sql, ZEND_Log::INFO);
  229. +// $logger->log(':index_id: '.index::next('invoice',$pref_group[index_group]), ZEND_Log::INFO);
  230. +// $logger->log(':domain_id: '.$auth_session->domain_id, ZEND_Log::INFO);
  231. +// $logger->log(':biller_id: '.$_POST[biller_id], ZEND_Log::INFO);
  232. +// $logger->log(':customer_id: '.$_POST[customer_id], ZEND_Log::INFO);
  233. +// $logger->log(':type: '.$type, ZEND_Log::INFO);
  234. +// $logger->log(':preference_id: '.$_POST[preference_id], ZEND_Log::INFO);
  235. +// $logger->log(':date: '.$_POST[date], ZEND_Log::INFO);
  236. +// $logger->log(':note: '.$_POST[note], ZEND_Log::INFO);
  237. +// $logger->log(':customField1: '.$_POST[customField1], ZEND_Log::INFO);
  238. +// $logger->log(':customField2: '.$_POST[customField2], ZEND_Log::INFO);
  239. +// $logger->log(':customField3: '.$_POST[customField3], ZEND_Log::INFO);
  240. +// $logger->log(':customField4:'.$_POST[customField4], ZEND_Log::INFO);
  241. +
  242. $sth= dbQuery($sql,
  243. #':index_id', index::next('invoice',$pref_group[index_group],$_POST[biller_id]),
  244. ':index_id', index::next('invoice',$pref_group[index_group]),
  245. @@ -1922,11 +1951,13 @@
  246. ':customField1', $_POST[customField1],
  247. ':customField2', $_POST[customField2],
  248. ':customField3', $_POST[customField3],
  249. - ':customField4', $_POST[customField4]
  250. + ':customField4', $_POST[customField4],
  251. + ':invoice_number', biller_index::next($_POST[biller_id])
  252. );
  253.  
  254. #index::increment('invoice',$pref_group[index_group],$_POST[biller_id]);
  255. index::increment('invoice',$pref_group[index_group]);
  256. + biller_index::increment($_POST[biller_id]);
  257.  
  258. return $sth;
  259. }
  260. diff -x tmp -x lang -x config -Naur simpleinvoices-2010.2-upadate1.orig/modules/invoices/manage.js.php simpleinvoices-2010.2-upadate1/modules/invoices/manage.js.php
  261. --- simpleinvoices-2010.2-upadate1.orig/modules/invoices/manage.js.php 2010-03-22 11:55:10.000000000 +0100
  262. +++ simpleinvoices-2010.2-upadate1/modules/invoices/manage.js.php 2010-12-29 22:09:03.000000000 +0100
  263. @@ -1,6 +1,7 @@
  264. <script type="text/javascript">
  265. {literal}
  266. - var columns = 8;
  267. +// var columns = 8;
  268. + var columns = 9;
  269. var padding = 12;
  270. var action_menu = 140;
  271. var grid_width = $('.col').width();
  272. @@ -29,14 +30,16 @@
  273. dataType: 'xml',
  274. colModel : [
  275. {display: '{/literal}{$LANG.actions}{literal}', name : 'actions', width : action_menu, sortable : false, align: 'center'},
  276. - {display: '{/literal}{$LANG.id}{literal}', name : 'index_name', width :15 * percentage_width, sortable : true, align: 'left'},
  277. +// {display: '{/literal}{$LANG.id}{literal}', name : 'index_name', width :15 * percentage_width, sortable : true, align: 'left'},
  278. + {display: '{/literal}{$LANG.id}{literal}', name : 'index_name', width :10 * percentage_width, sortable : true, align: 'left'},
  279. + {display: '{/literal}{$LANG.invoice_number}{literal}', name : 'invoice_number', width :13 * percentage_width, sortable : true, align: 'left'},
  280. {display: '{/literal}{$LANG.biller}{literal}', name : 'biller', width :20 * percentage_width, sortable : true, align: 'left'},
  281. {display: '{/literal}{$LANG.customer}{literal}', name : 'customer', width :20 * percentage_width, sortable : true, align: 'left'},
  282. - {display: '{/literal}{$LANG.date_upper}{literal}', name : 'date', width : 15 * percentage_width, sortable : true, align: 'left'},
  283. - {display: '{/literal}{$LANG.total}{literal}', name : 'invoice_total', width : 10 * percentage_width, sortable : true, align: 'left'},
  284. - {display: '{/literal}{$LANG.owing}{literal}', name : 'owing', width : 10 * percentage_width, sortable : true, align: 'left'},
  285. - {display: '{/literal}{$LANG.aging}{literal}', name : 'aging', width : 10 * percentage_width, sortable : true, align: 'left'}
  286. -
  287. + {display: '{/literal}{$LANG.date_upper}{literal}', name : 'date', width : 13 * percentage_width, sortable : true, align: 'left'},
  288. + {display: '{/literal}{$LANG.total}{literal}', name : 'invoice_total', width : 9 * percentage_width, sortable : true, align: 'left'},
  289. + {display: '{/literal}{$LANG.owing}{literal}', name : 'owing', width : 9 * percentage_width, sortable : true, align: 'left'},
  290. +// {display: '{/literal}{$LANG.aging}{literal}', name : 'aging', width : 10 * percentage_width, sortable : true, align: 'left'}
  291. + {display: '{/literal}{$LANG.aging}{literal}', name : 'aging', width : 5 * percentage_width, sortable : true, align: 'left'}
  292. ],
  293. /*
  294. buttons : [
  295. diff -x tmp -x lang -x config -Naur simpleinvoices-2010.2-upadate1.orig/modules/invoices/xml.php simpleinvoices-2010.2-upadate1/modules/invoices/xml.php
  296. --- simpleinvoices-2010.2-upadate1.orig/modules/invoices/xml.php 2010-03-22 11:55:10.000000000 +0100
  297. +++ simpleinvoices-2010.2-upadate1/modules/invoices/xml.php 2010-12-29 22:09:03.000000000 +0100
  298. @@ -49,17 +49,18 @@
  299. <!--7 Email --><a title='".$LANG['email']." ".$row['preference']." ".$row['id']."' class='index_table' href='index.php?module=invoices&view=email&stage=1&id=".$row['id']."'><img src='images/common/mail-message-new.png' class='action' /></a>
  300. ]]>
  301. </cell>";
  302. - $xml .= "<cell><![CDATA[".$row['index_name']."]]></cell>";
  303. + $xml .= "<cell><![CDATA[".$row['index_name']."]]></cell>";
  304. + $xml .= "<cell><![CDATA[".$row['invoice_number']."]]></cell>";
  305. $xml .= "<cell><![CDATA[".$row['biller']."]]></cell>";
  306. $xml .= "<cell><![CDATA[".$row['customer']."]]></cell>";
  307. $xml .= "<cell><![CDATA[".siLocal::date($row['date'])."]]></cell>";
  308. $xml .= "<cell><![CDATA[".siLocal::number_trim($row['invoice_total'])."]]></cell>";
  309. $xml .= "<cell><![CDATA[".siLocal::number_trim($row['owing'])."]]></cell>";
  310. $xml .= "<cell><![CDATA[".$row['aging']."]]></cell>";
  311. - $xml .= "<cell><![CDATA[".$row['preference']."]]></cell>";
  312. - $xml .= "</row>";
  313. + $xml .= "<cell><![CDATA[".$row['preference']."]]></cell>";
  314. + $xml .= "</row>";
  315. }
  316. $xml .= "</rows>";
  317.  
  318. echo $xml;
  319. -?>
  320. +?>
  321. diff -x tmp -x lang -x config -Naur simpleinvoices-2010.2-upadate1.orig/templates/invoices/default/style.css simpleinvoices-2010.2-upadate1/templates/invoices/default/style.css
  322. --- simpleinvoices-2010.2-upadate1.orig/templates/invoices/default/style.css 2009-01-12 04:07:31.000000000 +0100
  323. +++ simpleinvoices-2010.2-upadate1/templates/invoices/default/style.css 2010-12-29 22:13:06.000000000 +0100
  324. @@ -1,7 +1,15 @@
  325.  
  326. -body { background: white; color: #444444; font-style: normal; font-size: 12pt; font-family: Arial , Veranda, San-Serif; }
  327. -
  328. -hr {color: #444444;}
  329. +body {
  330. + width: 180mm;
  331. + background: white;
  332. + color: black;
  333. + font-style: normal;
  334. + font-size: 10pt;
  335. + font-family: Arial, Veranda, San-Serif;
  336. + margin-bottom: 0mm;
  337. + background-color: Gainsboro;
  338. +}
  339. +
  340. table {
  341. border-spacing: 0;
  342. border-collapse: collapse;
  343. @@ -12,17 +20,17 @@
  344.  
  345. .col1 { background-color: #EFEFEF; }
  346.  
  347. -.font1 { font-family: Arial; font-size: 14pt; }
  348. +.font1 { font-family: Arial; font-size: 12pt; }
  349.  
  350. -.font2 { color: #990000; font-size: 12pt; font-weight: bold; }
  351. +.font2 { color: #990000; font-size: 10pt; font-weight: bold; }
  352.  
  353. .font3 { font-family: Arial; font-size: 8pt; }
  354.  
  355. -.tbl1 { border: #A0A0A0 1px solid; border-collapse:collapse; }
  356. -.tbl1-left { border-left: #A0A0A0 1px solid; border-collapse:collapse; }
  357. -.tbl1-right { border-right: #A0A0A0 1px solid; border-collapse:collapse; }
  358. -.tbl1-bottom { border-bottom: #A0A0A0 1px solid; border-collapse:collapse; }
  359. -.tbl1-top { border-top: #A0A0A0 1px solid; border-collapse:collapse; }
  360. +.tbl1 { border: #33628D 1px solid; border-collapse:collapse; }
  361. +.tbl1-left { border-left: #33628D 1px solid; border-collapse:collapse; }
  362. +.tbl1-right { border-right: #33628D 1px solid; border-collapse:collapse; }
  363. +.tbl1-bottom { border-bottom: #33628D 1px solid; border-collapse:collapse; }
  364. +.tbl1-top { border-top: #33628D 1px solid; border-collapse:collapse; }
  365.  
  366. .left {
  367. clear: left;
  368. @@ -30,9 +38,42 @@
  369.  
  370. .right {
  371. float: right;
  372. -}
  373. -
  374. -.double_underline
  375. -{
  376. - border-bottom: 3px double #555;
  377. +}
  378. +
  379. +#billerDetails {
  380. + float: right;
  381. + margin-top: 40px;
  382. + margin-bottom: 40px;
  383. +}
  384. +
  385. +div#details {
  386. + height: 165mm;
  387. + background-color: AliceBlue;
  388. +}
  389. +
  390. +div#receipt {
  391. + height: 20mm;
  392. + background-color: #faff65;
  393. +}
  394. +
  395. +div#receipt table#payinfo {
  396. + margin-top: 10mm;
  397. +}
  398. +
  399. +div#giro {
  400. + background-color: AliceBlue;
  401. + padding-top: 36mm;
  402. +}
  403. +
  404. +div#giro table#customer {
  405. + background-color: white;
  406. + width: 180mm;
  407. + height: 22mm;
  408. +}
  409. +
  410. +div#giro table#sumaccount {
  411. + background-color: white;
  412. + margin-top: 22mm;
  413. + margin-left: 60mm;
  414. + width: 120mm;
  415. }
  416. diff -x tmp -x lang -x config -Naur simpleinvoices-2010.2-upadate1.orig/templates/invoices/default/template.tpl simpleinvoices-2010.2-upadate1/templates/invoices/default/template.tpl
  417. --- simpleinvoices-2010.2-upadate1.orig/templates/invoices/default/template.tpl 2010-06-08 03:49:08.000000000 +0200
  418. +++ simpleinvoices-2010.2-upadate1/templates/invoices/default/template.tpl 2010-12-29 22:13:06.000000000 +0100
  419. @@ -1,462 +1,264 @@
  420. <html>
  421. <head>
  422. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  423. -<link rel="stylesheet" type="text/css" href="{$css|urlsafe}" media="all">
  424. -<title>{$preference.pref_inv_wording|htmlsafe} {$LANG.number_short}: {$invoice.index_id|htmlsafe}</title>
  425. +<link rel="stylesheet" type="text/css" href="{$css}">
  426. +<title>{$preference.pref_inv_wording} {$LANG.number_short}: {$invoice.id}</title>
  427. </head>
  428. <body>
  429. -<br />
  430. -<div id="container">
  431. - <div id="header">
  432. - </div>
  433. -
  434. - <table width="100%" align="center">
  435. - <tr>
  436. - <td colspan="5"><img src="{$logo|urlsafe}" border="0" hspace="0" align="left"></td>
  437. - <th align="right"><span class="font1">{$preference.pref_inv_heading|htmlsafe}</span></th>
  438. - </tr>
  439. - <tr>
  440. - <td colspan="6" class="tbl1-top">&nbsp;</td>
  441. - </tr>
  442. - </table>
  443. -
  444. - <!-- Summary - start -->
  445. -
  446. - <table class="right">
  447. - <tr>
  448. - <td class="col1 tbl1-bottom" colspan="4" ><b>{$preference.pref_inv_wording|htmlsafe} {$LANG.summary}</b></td>
  449. - </tr>
  450. - <tr>
  451. - <td class="">{$preference.pref_inv_wording|htmlsafe} {$LANG.number_short}:</td>
  452. - <td class="" align="right" colspan="3">{$invoice.index_id}</td>
  453. - </tr>
  454. - <tr>
  455. - <td nowrap class="">{$preference.pref_inv_wording|htmlsafe} {$LANG.date}:</td>
  456. - <td class="" align="right" colspan="3">{$invoice.date}</td>
  457. - </tr>
  458. - <!-- Show the Invoice Custom Fields if valid -->
  459. - { if $invoice.custom_field1 != null}
  460. - <tr>
  461. - <td nowrap class="">{$customFieldLabels.invoice_cf1|htmlsafe}:</td>
  462. - <td class="" align="right" colspan="3">{$invoice.custom_field1|htmlsafe}</td>
  463. - </tr>
  464. - {/if}
  465. - { if $invoice.custom_field2 != null}
  466. - <tr>
  467. - <td nowrap class="">{$customFieldLabels.invoice_cf2|htmlsafe}:</td>
  468. - <td class="" align="right" colspan="3">{$invoice.custom_field2|htmlsafe}</td>
  469. - </tr>
  470. - {/if}
  471. - { if $invoice.custom_field3 != null}
  472. - <tr>
  473. - <td nowrap class="">{$customFieldLabels.invoice_cf3|htmlsafe}:</td>
  474. - <td class="" align="right" colspan="3">{$invoice.custom_field3|htmlsafe}</td>
  475. - </tr>
  476. - {/if}
  477. - { if $invoice.custom_field4 != null}
  478. - <tr>
  479. - <td nowrap class="">{$customFieldLabels.invoice_cf4|htmlsafe}:</td>
  480. - <td class="" align="right" colspan="3">{$invoice.custom_field4|htmlsafe}</td>
  481. - </tr>
  482. - {/if}
  483. -
  484. - <tr>
  485. - <td class="" >{$LANG.total}: </td>
  486. - <td class="" align="right" colspan="3">{$preference.pref_currency_sign|htmlsafe}{$invoice.total|siLocal_number}</td>
  487. - </tr>
  488. - <tr>
  489. - <td class="">{$LANG.paid}:</td>
  490. - <td class="" align="right" colspan="3" >{$preference.pref_currency_sign|htmlsafe}{$invoice.paid|siLocal_number}</td>
  491. - </tr>
  492. - <tr>
  493. - <td nowrap class="">{$LANG.owing}:</td>
  494. - <td class="" align="right" colspan="3" >{$preference.pref_currency_sign|htmlsafe}{$invoice.owing|siLocal_number}</td>
  495. - </tr>
  496. -
  497. - </table>
  498. - <!-- Summary - end -->
  499. -
  500. -
  501. - <table class="left">
  502. -
  503. - <!-- Biller section - start -->
  504. - <tr>
  505. - <td class="tbl1-bottom col1" border=1 cellpadding=2 cellspacing=1><b>{$LANG.biller}:</b></td>
  506. - <td class="col1 tbl1-bottom" border=1 cellpadding=2 cellspacing=1 colspan="3">{$biller.name|htmlsafe}</td>
  507. - </tr>
  508.  
  509. +<div id="details">
  510. + <h1>{$preference.pref_inv_heading}</h1>
  511. +
  512. + <!-- Biller address section - start -->
  513. + <table class="right">
  514. + <tr><td>{$biller.name}</td></tr>
  515. +
  516. {if $biller.street_address != null}
  517. - <tr>
  518. - <td class=''>{$LANG.address}:</td>
  519. - <td class='' align=left colspan="3">{$biller.street_address|htmlsafe}</td>
  520. - </tr>
  521. + <tr><td>{$biller.street_address}</td></tr>
  522. {/if}
  523. - {if $biller.street_address2 != null }
  524. - {if $biller.street_address == null }
  525. - <tr>
  526. - <td class=''>{$LANG.address}:</td>
  527. - <td class='' align=left colspan="3">{$biller.street_address2|htmlsafe}</td>
  528. - </tr>
  529. - {/if}
  530. - {if $biller.street_address != null }
  531. - <tr>
  532. - <td class=''></td>
  533. - <td class='' align=left colspan="3">{$biller.street_address2|htmlsafe}</td>
  534. - </tr>
  535. - {/if}
  536. - {/if}
  537. -
  538. - {merge_address field1=$biller.city field2=$biller.state field3=$biller.zip_code street1=$biller.street_address street2=$biller.street_address2 class1="" class2="" colspan="3"}
  539. -
  540. - {if $biller.country != null }
  541. - <tr>
  542. - <td class=''></td>
  543. - <td class='' colspan="3">{$biller.country|htmlsafe}</td>
  544. - </tr>
  545. - {/if}
  546. -
  547. - {print_if_not_null label=$LANG.phone_short field=$biller.phone class1='' class2='' colspan="3"}
  548. - {print_if_not_null label=$LANG.fax field=$biller.fax class1='' class2='' colspan="3"}
  549. - {print_if_not_null label=$LANG.mobile_short field=$biller.mobile_phone class1='' class2='' colspan="3"}
  550. - {print_if_not_null label=$LANG.email field=$biller.email class1='' class2='' colspan="3"}
  551. -
  552. - {print_if_not_null label=$customFieldLabels.biller_cf1 field=$biller.custom_field1 class1='' class2='' colspan="3"}
  553. - {print_if_not_null label=$customFieldLabels.biller_cf2 field=$biller.custom_field2 class1='' class2='' colspan="3"}
  554. - {print_if_not_null label=$customFieldLabels.biller_cf3 field=$biller.custom_field3 class1='' class2='' colspan="3"}
  555. - {print_if_not_null label=$customFieldLabels.biller_cf4 field=$biller.custom_field4 class1='' class2='' colspan="3"}
  556. -
  557. - <tr>
  558. - <td class="" colspan="4"> </td>
  559. - </tr>
  560. -
  561. - <!-- Biller section - end -->
  562. -
  563. - <tr>
  564. - <td colspan="4"><br /></td>
  565. - </tr>
  566. -
  567. - <!-- Customer section - start -->
  568. - <tr>
  569. - <td class="tbl1-bottom col1" ><b>{$LANG.customer}:</b></td>
  570. - <td class="tbl1-bottom col1" colspan="3">{$customer.name|htmlsafe}</td>
  571. - </tr>
  572. -
  573. +
  574. + {if $biller.zip_code && $biller.city}
  575. + <tr><td>{$biller.zip_code} {$biller.city}</td></tr>
  576. + {/if}
  577. + </table>
  578. + <!-- Biller address section - end -->
  579. +
  580. + <!-- Customer address section - start -->
  581. + <table>
  582. + <tr><td>{$customer.name}</td></tr>
  583. +
  584. + <!-- Responsible person -->
  585. {if $customer.attention != null }
  586. - <tr>
  587. - <td class=''>{$LANG.attention_short}:</td>
  588. - <td align=left class='' colspan="3" >{$customer.attention|htmlsafe}</td>
  589. - </tr>
  590. - {/if}
  591. + <tr><td>{$customer.attention}</td><td></td> </tr>
  592. + {/if}
  593. +
  594. + <tr>
  595. {if $customer.street_address != null }
  596. - <tr >
  597. - <td class=''>{$LANG.address}:</td>
  598. - <td class='' align=left colspan="3">{$customer.street_address|htmlsafe}</td>
  599. - </tr>
  600. + <td>{$customer.street_address}</td>
  601. {/if}
  602. - {if $customer.street_address2 != null}
  603. - {if $customer.street_address == null}
  604. - <tr>
  605. - <td class=''>{$LANG.address}:</td>
  606. - <td class='' align=left colspan="3">{$customer.street_address2|htmlsafe}</td>
  607. - </tr>
  608. - {/if}
  609. - {if $customer.street_address != null}
  610. - <tr>
  611. - <td class=''></td>
  612. - <td class='' align=left colspan="3">{$customer.street_address2|htmlsafe}</td>
  613. - </tr>
  614. - {/if}
  615. + </tr>
  616. +
  617. + <tr><td>{$customer.zip_code} {$customer.city}</td></tr>
  618. + </table>
  619. + <!-- Customer address section - stop -->
  620. +
  621. + <!-- Biller details - start -->
  622. + <table class="right" id="billerDetails">
  623. + <tr>
  624. + <td>{$preference.pref_inv_wording} {$LANG.number_short}:</td>
  625. +<!-- <td>{$invoice.id}</td> -->
  626. + <td>{$invoice.invoice_number}</td>
  627. + </tr>
  628. + <tr>
  629. + <td>{$preference.pref_inv_wording} {$LANG.date}:</td>
  630. + <td>{$invoice.date}</td>
  631. + </tr>
  632. +
  633. + { if $biller.custom_field1 != null }
  634. + <tr>
  635. + <td>{$customFieldLabels.biller_cf1}:</td>
  636. + <td>{$biller.custom_field1}</td>
  637. + </tr>
  638. {/if}
  639. -
  640. - {merge_address field1=$customer.city field2=$customer.state field3=$customer.zip_code street1=$customer.street_address street2=$customer.street_addtess2 class1="" class2="" colspan="3"}
  641. -
  642. - {if $customer.country != null}
  643. +
  644. + {print_if_not_null label=$LANG.phone_short field=$biller.phone}
  645. + {print_if_not_null label=$LANG.mobile_short field=$biller.mobile_phone}
  646. + {print_if_not_null label=$LANG.email field=$biller.email}
  647. + </table>
  648. + <!-- Biller details - stop -->
  649. +
  650. +
  651. + <!-- Invoice items -->
  652. + <table class="left" width="100%">
  653. +
  654. + <!-- Type 2 start -->
  655. + {if $invoice.type_id == 2 }
  656. + <tr class="tbl1-bottom">
  657. + <td><b>{$LANG.description}</b></td>
  658. + <td><b>{$LANG.quantity_short}</b></td>
  659. + <td><b>{$LANG.unit_price}</b></td>
  660. + <td align="right"><b>{$LANG.total_uppercase}</b></td>
  661. + </tr>
  662. + {foreach from=$invoiceItems item=invoiceItem}
  663. <tr>
  664. - <td class=''></td>
  665. - <td class='' colspan="3">{$customer.country|htmlsafe}</td>
  666. + <td>{$invoiceItem.product.description}</td>
  667. + <td>{$invoiceItem.quantity|number_format:2}</td>
  668. + <td>{$invoiceItem.unit_price|number_format:2} {$preference.pref_currency_sign}</td>
  669. + <td align="right">{$invoiceItem.total|number_format:2} {$preference.pref_currency_sign}</td>
  670. </tr>
  671. - {/if}
  672. -
  673. - {print_if_not_null label=$LANG.phone_short field=$customer.phone class1='' class2='t' colspan="3"}
  674. - {print_if_not_null label=$LANG.fax field=$customer.fax class1='' class2='' colspan="3"}
  675. - {print_if_not_null label=$LANG.mobile_short field=$customer.mobile_phone class1='' class2='' colspan="3"}
  676. - {print_if_not_null label=$LANG.email field=$customer.email class1='' class2='' colspan="3"}
  677. -
  678. - {print_if_not_null label=$customFieldLabels.customer_cf1 field=$customer.custom_field1 class1='' class2='' colspan="3"}
  679. - {print_if_not_null label=$customFieldLabels.customer_cf2 field=$customer.custom_field2 class1='' class2='' colspan="3"}
  680. - {print_if_not_null label=$customFieldLabels.customer_cf3 field=$customer.custom_field3 class1='' class2='' colspan="3"}
  681. - {print_if_not_null label=$customFieldLabels.customer_cf4 field=$customer.custom_field4 class1='' class2='' colspan="3"}
  682. -
  683. - <tr>
  684. - <td class="" colspan="4"></td>
  685. - </tr>
  686. - </table>
  687. -
  688. - <!-- Customer section - end -->
  689. -
  690. - <table class="left" width="100%">
  691. - <tr>
  692. - <td colspan="6"><br /></td>
  693. - </tr>
  694. -
  695. - {if $invoice.type_id == 2 }
  696. - <tr>
  697. - <td class="tbl1-bottom col1"><b>{$LANG.quantity_short}</b></td>
  698. - <td class="tbl1-bottom col1" colspan="3"><b>{$LANG.item}</b></td>
  699. - <td class="tbl1-bottom col1" align="right"><b>{$LANG.Unit_Cost}</b></td>
  700. - <td class="tbl1-bottom col1" align="right"><b>{$LANG.Price}</b></td>
  701. - </tr>
  702. -
  703. - {foreach from=$invoiceItems item=invoiceItem}
  704. -
  705. - <tr class="" >
  706. - <td class="">{$invoiceItem.quantity|siLocal_number_trim}</td>
  707. - <td class="" colspan="3">{$invoiceItem.product.description|htmlsafe}</td>
  708. - <td class="" align="right">{$preference.pref_currency_sign|htmlsafe}{$invoiceItem.unit_price|siLocal_number}</td>
  709. - <td class="" align="right">{$preference.pref_currency_sign|htmlsafe}{$invoiceItem.gross_total|siLocal_number}</td>
  710. - </tr>
  711. - {if $invoiceItem.description != null}
  712. - <tr class="">
  713. - <td class=""></td>
  714. - <td class="" colspan="5">{$LANG.description}: {$invoiceItem.description|htmlsafe}</td>
  715. - </tr>
  716. - {/if}
  717. -
  718. - <tr class="tbl1-bottom">
  719. - <td class=""></td>
  720. - <td class="" colspan="5">
  721. - <table width="100%">
  722. - <tr>
  723. -
  724. - {inv_itemised_cf label=$customFieldLabels.product_cf1 field=$invoiceItem.product.custom_field1}
  725. - {do_tr number=1 class="blank-class"}
  726. - {inv_itemised_cf label=$customFieldLabels.product_cf2 field=$invoiceItem.product.custom_field2}
  727. - {do_tr number=2 class="blank-class"}
  728. - {inv_itemised_cf label=$customFieldLabels.product_cf3 field=$invoiceItem.product.custom_field3}
  729. - {do_tr number=3 class="blank-class"}
  730. - {inv_itemised_cf label=$customFieldLabels.product_cf4 field=$invoiceItem.product.custom_field4}
  731. - {do_tr number=4 class="blank-class"}
  732. -
  733. - </tr>
  734. - </table>
  735. - </td>
  736. - </tr>
  737. - {/foreach}
  738. - {/if}
  739. -
  740. - {if $invoice.type_id == 3 }
  741. - <tr class="tbl1-bottom col1">
  742. - <td class="tbl1-bottom "><b>{$LANG.quantity_short}</b></td>
  743. - <td colspan="3" class=" tbl1-bottom"><b>{$LANG.item}</b></td>
  744. - <td align="right" class=" tbl1-bottom"><b>{$LANG.Unit_Cost}</b></td>
  745. - <td align="right" class=" tbl1-bottom "><b>{$LANG.Price}</b></td>
  746. - </tr>
  747. -
  748. - {foreach from=$invoiceItems item=invoiceItem}
  749. -
  750. - <tr class=" ">
  751. - <td class="" >{$invoiceItem.quantity|siLocal_number}</td>
  752. - <td>{$invoiceItem.product.description|htmlsafe}</td>
  753. - <td class="" colspan="4"></td>
  754. - </tr>
  755. -
  756. -
  757. - <tr>
  758. - <td class=""></td>
  759. - <td class="" colspan="5">
  760. - <table width="100%">
  761. - <tr>
  762. -
  763. - {inv_itemised_cf label=$customFieldLabels.product_cf1 field=$invoiceItem.product.custom_field1}
  764. - {do_tr number=1 class="blank-class"}
  765. - {inv_itemised_cf label=$customFieldLabels.product_cf2 field=$invoiceItem.product.custom_field2}
  766. - {do_tr number=2 class="blank-class"}
  767. - {inv_itemised_cf label=$customFieldLabels.product_cf3 field=$invoiceItem.product.custom_field3}
  768. - {do_tr number=3 class="blank-class"}
  769. - {inv_itemised_cf label=$customFieldLabels.product_cf4 field=$invoiceItem.product.custom_field4}
  770. - {do_tr number=4 class="blank-class"}
  771. -
  772. - </tr>
  773. - </table>
  774. - </td>
  775. - </tr>
  776. -
  777. - <tr class="">
  778. - <td class=""></td>
  779. - <td class="" colspan="5"><i>{$LANG.description}: </i>{$invoiceItem.description|htmlsafe}</td>
  780. - </tr>
  781. - <tr class="">
  782. - <td class="" ></td>
  783. - <td class=""></td>
  784. - <td class=""></td>
  785. - <td class=""></td>
  786. - <td align="right" class="">{$preference.pref_currency_sign}{$invoiceItem.unit_price|siLocal_number}</td>
  787. - <td align="right" class="">{$preference.pref_currency_sign}{$invoiceItem.total|siLocal_number}</td>
  788. - </tr>
  789. - {/foreach}
  790. - {/if}
  791. -
  792. - {if $invoice.type_id == 1 }
  793. - <table class="left" width="100%">
  794. -
  795. - <tr class="col1" >
  796. - <td class="tbl1-bottom col1" colspan="6"><b>{$LANG.description}</b></td>
  797. - </tr>
  798. -
  799. - {foreach from=$invoiceItems item= invoiceItem}
  800. + {/foreach}
  801. + {/if}
  802. + <!-- Type 2 stop -->
  803.  
  804. - <tr class="">
  805. - <td class="t" colspan="6">{$invoiceItem.description|outhtml}</td>
  806. + <!-- TYPE 3 START -->
  807. + {if $invoice.type_id == 3 }
  808. + <tr class="tbl1 col1">
  809. + <td class="tbl1"><b>{$LANG.quantity_short}</b></td>
  810. + <td class="tbl1"><b>{$LANG.item}</b></td>
  811. + <td class="tbl1"><b>{$LANG.unit_price}</b></td>
  812. + <td class="tbl1"><b>{$LANG.gross_total}</b></td>
  813. + <td class="tbl1"><b>{$LANG.tax}</b></td>
  814. + <td align="right" class="tbl1"><b>{$LANG.total_uppercase}</b></td>
  815. + </tr>
  816. +
  817. + {foreach from=$invoiceItems item=invoiceItem}
  818. +
  819. + <tr class="tbl1-left tbl1-right">
  820. + <td class="tbl1-left" >{$invoiceItem.quantity|number_format:2}</td>
  821. + <td>{$invoiceItem.product.description}</td>
  822. + <td class="tbl1-right" colspan="4"></td>
  823. + </tr>
  824. +
  825. + <tr>
  826. + <td class="tbl1-left"></td>
  827. + <td class="tbl1-right" colspan="5">
  828. + <table width="100%">
  829. + <tr>
  830. + {inv_itemised_cf label=$customFieldLabels.product_cf1 field=$invoiceItem.product.custom_field1}
  831. + {do_tr number=1 class="blank-class"}
  832. + {inv_itemised_cf label=$customFieldLabels.product_cf2 field=$invoiceItem.product.custom_field2}
  833. + {do_tr number=2 class="blank-class"}
  834. + {inv_itemised_cf label=$customFieldLabels.product_cf3 field=$invoiceItem.product.custom_field3}
  835. + {do_tr number=3 class="blank-class"}
  836. + {inv_itemised_cf label=$customFieldLabels.product_cf4 field=$invoiceItem.product.custom_field4}
  837. + {do_tr number=4 class="blank-class"}
  838. </tr>
  839. + </table>
  840. + </td>
  841. + </tr>
  842. +
  843. + <tr class="tbl1-left tbl1-right">
  844. + <td class="tbl1-left"></td>
  845. + <td class="tbl1-right" colspan="5"><i>{$LANG.description}: </i>{$invoiceItem.description}</td>
  846. + </tr>
  847. + <tr class="tbl1-left tbl1-right tbl1-bottom">
  848. + <td class="tbl1-left tbl1-bottom" ></td>
  849. + <td class="tbl1-bottom"></td>
  850. + <td class="tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.unit_price|number_format:2}</td>
  851. + <td class="tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.gross_total|number_format:2}</td>
  852. + <td class="tbl1-bottom ">{$preference.pref_currency_sign}{$invoiceItem.tax_amount|number_format:2}</td>
  853. + <td align="right" class="tbl1-right tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.total|number_format:2}</td>
  854. + </tr>
  855. + {/foreach}
  856. + {/if}
  857. + <!-- TYPE 3 STOP -->
  858. +
  859. + <!-- TYPE 1 START -->
  860. + {if $invoice.type_id == 1 }
  861. + <table class="left" width="100%">
  862. +
  863. + <tr class="tbl1 col1" ><td class="tbl1 col1 tbl1-right" colspan="6"><b>{$LANG.description}</b></td></tr>
  864. +
  865. + {foreach from=$invoiceItems item= invoiceItem}
  866. + <tr class="tbl1-left tbl1-right"><td class="tbl1-left tbl1-right" colspan="6">{$invoiceItem.description}</td></tr>
  867. + <tr class="tbl1-left tbl1-right"><td colspan="6" class="tbl1-left tbl1-right"><br></td></tr>
  868. + {/foreach}
  869. + </table>
  870. + {/if}
  871. + <!-- Type 1 stop -->
  872.  
  873. - {/foreach}
  874. - {/if}
  875.  
  876. -{if ($invoice.type_id == 2 && $invoice.note != "") || ($invoice.type_id == 3 && $invoice.note != "" ) }
  877. + {if ($invoice.type_id == 2 && $invoice.note != "") || ($invoice.type_id == 3 && $invoice.note != "" ) }
  878. +<!-- <tr><td colspan="4"><br></td></tr> -->
  879. +<!-- <tr><td colspan="4" align="left"><b>{$LANG.notes}:</b></td></tr> -->
  880. + <tr><td colspan="4">{$invoice.note}</td></tr>
  881. + {/if}
  882.  
  883. - <tr>
  884. - <td class="" colspan="6"><br /></td>
  885. - </tr>
  886. - <tr>
  887. - <td class="" colspan="6" align="left"><b>{$LANG.notes}:</b></td>
  888. - </tr>
  889. - <tr>
  890. - <td class="" colspan="6">{$invoice.note|outhtml}</td>
  891. - </tr>
  892. -
  893. -{/if}
  894. -
  895. - <tr class="">
  896. - <td class="" colspan="6" ><br /></td>
  897. - </tr>
  898. -
  899. - {* tax section - start *}
  900. - {if $invoice_number_of_taxes > 0}
  901. - <tr>
  902. - <td colspan="2"></td>
  903. - <td colspan="3" align="right">{$LANG.sub_total}&nbsp;</td>
  904. - <td colspan="1" align="right">{if $invoice_number_of_taxes > 1}<u>{/if}{$preference.pref_currency_sign|htmlsafe}{$invoice.gross|siLocal_number}{if $invoice_number_of_taxes > 1}</u>{/if}</td>
  905. + <tr class="tbl1-top">
  906. + <td colspan="4" ><br></td>
  907. </tr>
  908. +
  909. + <tr>
  910. + <td align="right" colspan="3">{$LANG.gross_total}</td>
  911. + {php} global $invoice; $this->assign('invoice_gross_total', $invoice[total] - $invoice[total_tax]); {/php}
  912. + {if $invoice.type_id == 1} <!-- Only Type 1 is a single entry - hence last row gross is valid as gross_total - see Invoice 2 in sample data-->
  913. + <td align="right" colspan="2">{$invoiceItems.0.gross_total|number_format:2} {$preference.pref_currency_sign}</td>
  914. + {else}
  915. + <td align="right" colspan="2">{$invoice_gross_total|number_format:2} {$preference.pref_currency_sign}</td>
  916. {/if}
  917. - {if $invoice_number_of_taxes > 1 }
  918. - <tr>
  919. - <td colspan="6"><br /></td>
  920. - </tr>
  921. - {/if}
  922. - {section name=line start=0 loop=$invoice.tax_grouped step=1}
  923. - {if ($invoice.tax_grouped[line].tax_amount != "0") }
  924. -
  925. - <tr>
  926. - <td colspan="2"></td>
  927. - <td colspan="3" align="right">{$invoice.tax_grouped[line].tax_name|htmlsafe}&nbsp;</td>
  928. - <td colspan="1" align="right">{$preference.pref_currency_sign|htmlsafe}{$invoice.tax_grouped[line].tax_amount|siLocal_number}</td>
  929. - </tr>
  930. - {/if}
  931. -
  932. - {/section}
  933. - {if $invoice_number_of_taxes > 1}
  934. - <tr>
  935. - <td colspan="2"></td>
  936. - <td colspan="3" align="right">{$LANG.tax_total}&nbsp;</td>
  937. - <td colspan="1" align="right"><u>{$preference.pref_currency_sign|htmlsafe}{$invoice.total_tax|siLocal_number}</u></td>
  938. + </tr>
  939. +
  940. + <tr>
  941. + <td></td>
  942. + <td align="right" colspan="2">{$LANG.tax_total}</td>
  943. + <td align="right" colspan="2">{$invoice.total_tax|number_format:2} {$preference.pref_currency_sign}</td>
  944. </tr>
  945. - {/if}
  946. - {if $invoice_number_of_taxes > 1}
  947. - <tr>
  948. - <td colspan="6"><br /></td>
  949. - </tr>
  950. - {/if}
  951. +
  952. <tr>
  953. - <td colspan="2"></td>
  954. - <td colspan="3" align="right"><b>{$preference.pref_inv_wording|htmlsafe} {$LANG.amount}&nbsp;</b></td>
  955. - <td colspan="1" align="right"><span class="double_underline"><u>{$preference.pref_currency_sign|htmlsafe}{$invoice.total|siLocal_number}</u></span></td>
  956. + <td colspan="4" class="tbl1-bottom"><br></td>
  957. </tr>
  958. - {* tax section - end *}
  959. -{*
  960. - <tr>
  961. - <td class="" colspan="2"></td>
  962. - <td align="right" colspan="3">{$LANG.sub_total}</td>
  963. - <td align="right" class="">{$preference.pref_currency_sign|htmlsafe}{$invoice.gross|siLocal_number}</td>
  964. - </tr>
  965. -
  966. -
  967. - {section name=line start=0 loop=$invoice.tax_grouped step=1}
  968. -
  969. - {if ($invoice.tax_grouped[line].tax_amount != "0") }
  970. -
  971. - <tr class=''>
  972. - <td colspan="2"></td>
  973. - <td colspan="3" align="right">{$invoice.tax_grouped[line].tax_name|htmlsafe}</td>
  974. - <td colspan="1" align="right">{$preference.pref_currency_sign|htmlsafe}{$invoice.tax_grouped[line].tax_amount|siLocal_number}</td>
  975. - </tr>
  976. -
  977. - {/if}
  978. -
  979. - {/section}
  980. -
  981. - <tr class=''>
  982. - <td colspan="2"></td>
  983. - <td colspan="3" align="right">{$LANG.tax_total}</td>
  984. - <td colspan="1" align="right"><u>{$preference.pref_currency_sign|htmlsafe}{$invoice.total_tax|siLocal_number}</u></td>
  985. +
  986. + <trtbl1-bottom">
  987. + <td class="tbl1-bottom"></td>
  988. + <td class="tbl1-bottom" align="right" colspan="2"><b>{$preference.pref_inv_wording} {$LANG.amount}</b></td>
  989. + <td class="tbl1-bottom" align="right" colspan="2"><u>{$invoice.total|number_format:2} {$preference.pref_currency_sign}</u></td>
  990. </tr>
  991. -
  992. -
  993. - <tr class="">
  994. - <td class="" colspan="6" ><br /></td>
  995. - </tr>
  996. - <tr class="">
  997. - <td class="" colspan="2"></td>
  998. - <td class="" align="right" colspan="3"><b>{$preference.pref_inv_wording|htmlsafe} {$LANG.amount}</b></td>
  999. - <td class="" align="right"><span class="double_underline" >{$preference.pref_currency_sign|htmlsafe}{$invoice.total|siLocal_number}</span></td>
  1000. - </tr>
  1001. -*}
  1002. - <tr>
  1003. - <td colspan="6"><br /><br /></td>
  1004. - </tr>
  1005. -
  1006. - <!-- invoice details section - start -->
  1007. -
  1008. - <tr>
  1009. - <td class="tbl1-bottom col1" colspan="6"><b>{$preference.pref_inv_detail_heading|htmlsafe}</b></td>
  1010. - </tr>
  1011. - <tr>
  1012. - <td class="" colspan="6"><i>{$preference.pref_inv_detail_line|outhtml}</i></td>
  1013. - </tr>
  1014. - <tr>
  1015. - <td class="" colspan="6">{$preference.pref_inv_payment_method|htmlsafe}</td>
  1016. - </tr>
  1017. - <tr>
  1018. - <td class="" colspan="6">{$preference.pref_inv_payment_line1_name|htmlsafe} {$preference.pref_inv_payment_line1_value|htmlsafe}</td>
  1019. - </tr>
  1020. - <tr>
  1021. - <td class="" colspan="6">{$preference.pref_inv_payment_line2_name|htmlsafe} {$preference.pref_inv_payment_line2_value|htmlsafe}</td>
  1022. - </tr>
  1023. - <tr>
  1024. - <td><br /></td>
  1025. - </tr>
  1026. - <tr>
  1027. - <td colspan="6"><div style="font-size:8pt;" align="center">{$biller.footer|outhtml}</div></td>
  1028. - </tr>
  1029. - <tr>
  1030. - <td>
  1031. - {online_payment_link
  1032. - type=$preference.include_online_payment business=$biller.paypal_business_name
  1033. - item_name=$invoice.index_name invoice=$invoice.id
  1034. - amount=$invoice.total currency_code=$preference.currency_code
  1035. - link_wording=$LANG.paypal_link
  1036. - notify_url=$biller.paypal_notify_url return_url=$biller.paypal_return_url
  1037. - domain_id = $invoice.domain_id include_image=true
  1038. - }
  1039.  
  1040. - </td>
  1041. - </tr>
  1042. + </table>
  1043. +</div>
  1044.  
  1045. - <!-- invoice details section - end -->
  1046. +<div id="receipt">
  1047. + <table id="payinfo">
  1048. + <tr>
  1049. +<!-- <td>{$preference.pref_inv_payment_line1_name} {$preference.pref_inv_payment_line1_value}</td> -->
  1050. + <td>{$customFieldLabels.biller_cf2} {$biller.custom_field2}</td>
  1051. + </tr>
  1052. + </table>
  1053. +</div>
  1054.  
  1055. -</table>
  1056. +<div id="giro">
  1057.  
  1058. -<div id="footer"></div>
  1059. + <!-- Customer section - start -->
  1060. + <table id="customer">
  1061. + <tr>
  1062. + <td>{$customer.name}</td>
  1063. + <td>{$biller.name}</td>
  1064. + </tr>
  1065.  
  1066. + {if $customer.attention != null }
  1067. + <tr><td>{$customer.attention}</td><td></td> </tr>
  1068. + {/if}
  1069. +
  1070. + <tr>
  1071. + <td>
  1072. + {if $customer.street_address != null }
  1073. + {$customer.street_address}
  1074. + {/if}
  1075. + </td>
  1076. + <td>
  1077. + {if $biller.street_address != null}
  1078. + {$biller.street_address}
  1079. + {/if}
  1080. + </td>
  1081. + </tr>
  1082. +
  1083. + <tr>
  1084. + <td>
  1085. + {if $customer.street_address2 != null}
  1086. + {$customer.street_address2}
  1087. + {/if}
  1088. + </td>
  1089. + <td>
  1090. + {if $biller.street_address2 != null }
  1091. + {$biller.street_address2}
  1092. + {/if}
  1093. + </td>
  1094. + </tr>
  1095. +
  1096. + <tr>
  1097. + <td>{$customer.zip_code} {$customer.city}</td>
  1098. + <td>{$biller.zip_code} {$biller.city}</td>
  1099. + </tr>
  1100. + </table>
  1101. + <!-- Customer section - end -->
  1102. +
  1103. + <table id="sumaccount">
  1104. + <tr>
  1105. + <td>{$invoice.total|number_format:2}</td>
  1106. + <td>{$biller.custom_field2}</td>
  1107. + </tr>
  1108. + </table>
  1109. +
  1110. </div>
  1111.  
  1112. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement