Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- --- simpleinvoices-2010.2-upadate1.orig/include/class/biller_index.php 1970-01-01 01:00:00.000000000 +0100
- +++ simpleinvoices-2010.2-upadate1/include/class/biller_index.php 2010-12-29 21:57:24.000000000 +0100
- @@ -0,0 +1,91 @@
- +<?php
- +
- +/*
- +
- +Lagt til av Oystein
- +
- +Class: BillerIndex
- +
- +Purpose: Make it possible to have a different invoice number for each operator
- +
- +Details:
- +$node = this is the module in question - ie 'invoice', 'products' etc..
- +$sub_node = the sub set of the node - ie. this is the 'invoice preference' if node = 'invoice'
- +$sub_node_2 = 2nd sub set of the node - ir. this is the 'biller' if node = 'invoice'
- +
- +*/
- +
- +class biller_index
- +{
- +
- + public static function next($biller_id)
- + {
- + global $db;
- +
- + $sql = "select
- + invoice_number
- + from
- + si_biller_index
- + where
- + biller_id = :biller_id";
- +
- + $sth = $db->query($sql, ':biller_id', $biller_id) or die(htmlsafe(end($dbh->errorInfo())));
- + $index = $sth->fetch();
- +
- + if($index['invoice_number'] == "")
- + {
- + $invoice_number = "1";
- + } else {
- + $invoice_number = $index['invoice_number'] + 1;
- + }
- + return $invoice_number;
- + }
- +
- + public static function increment($biller_id)
- + {
- + $invoice_number = biller_index::next($biller_id);
- + global $db;
- +
- + if ($invoice_number == 1)
- + {
- +
- + $sql = "insert into si_biller_index (biller_id, invoice_number) VALUES (:biller_id, :invoice_number);";
- +
- + } else {
- + $sql ="update
- + si_biller_index
- + set
- + invoice_number = :invoice_number
- + where
- + biller_id = :biller_id";
- + }
- +
- + $sth = $db->query($sql,':biller_id',$biller_id,':invoice_number',$invoice_number) or die(htmlsafe(end($dbh->errorInfo())));
- + return $invoice_number;
- + }
- +
- +
- + public static function rewind()
- + {
- + global $db;
- + global $auth_session;
- +
- + if ($sub_node !="")
- + {
- + $subnode = "and sub_node = ".$sub_node;
- + }
- +
- + $sql ="update
- + si_index
- + set
- + id = (id - 1)
- + where
- + node = :node
- + and
- + domain_id = :domain_id
- + ".$subnode;
- +
- + $sth = $db->query($sql,':node',$node,':domain_id',$auth_session->domain_id) or die(htmlsafe(end($dbh->errorInfo())));
- + return $sth;
- + }
- +}
- 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
- --- simpleinvoices-2010.2-upadate1.orig/include/class/invoice.php 2010-06-08 03:38:40.000000000 +0200
- +++ simpleinvoices-2010.2-upadate1/include/class/invoice.php 2010-12-29 21:57:24.000000000 +0100
- @@ -197,6 +197,7 @@
- function select_all($type='', $dir='DESC', $rp='25', $page='1', $having='')
- {
- + global $logger;
- global $config;
- global $auth_session;
- @@ -226,7 +227,8 @@
- /*Check that the sort field is OK*/
- - $validFields = array('index_name','iv.id', 'biller', 'customer', 'invoice_total','owing','date','aging','type','preference','type_id');
- +// $validFields = array('index_name','iv.id', 'biller', 'customer', 'invoice_total','owing','date','aging','type','preference','type_id');
- + $validFields = array('index_name','iv.id', 'biller', 'customer', 'invoice_total','owing','date','aging','type','preference','type_id','invoice_number');
- if (in_array($sort, $validFields)) {
- $sort = $sort;
- @@ -355,10 +357,11 @@
- WHEN Age <= 60 THEN '31-60'
- WHEN Age <= 90 THEN '61-90'
- ELSE '90+' END)) AS aging,
- - iv.type_id As type_id,
- + iv.type_id AS type_id,
- pf.pref_description AS preference,
- pf.status AS status,
- - (SELECT CONCAT(pf.pref_inv_wording,' ',iv.index_id)) as index_name
- + (SELECT CONCAT(pf.pref_inv_wording,' ',iv.index_id)) as index_name,
- + iv.invoice_number AS invoice_number
- FROM " . TB_PREFIX . "invoices iv
- LEFT JOIN " . TB_PREFIX . "biller b ON b.id = iv.biller_id
- LEFT JOIN " . TB_PREFIX . "customers c ON c.id = iv.customer_id
- @@ -373,6 +376,8 @@
- break;
- }
- + $logger->log("sql: ".$sql, ZEND_Log::INFO);
- +
- $result = dbQuery($sql,':domain_id', $auth_session->domain_id) or die(end($dbh->errorInfo()));
- return $result;
- }
- diff -x tmp -x lang -x config -Naur simpleinvoices-2010.2-upadate1.orig/include/init.php simpleinvoices-2010.2-upadate1/include/init.php
- --- simpleinvoices-2010.2-upadate1.orig/include/init.php 2010-06-05 02:54:29.000000000 +0200
- +++ simpleinvoices-2010.2-upadate1/include/init.php 2010-12-29 21:54:00.000000000 +0100
- @@ -148,6 +148,7 @@
- include_once("./include/class/db.php");
- include_once("./include/class/index.php");
- +include_once("./include/class/biller_index.php"); // Added by oystein
- $db = db::getInstance();
- include_once("./include/sql_queries.php");
- 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
- --- simpleinvoices-2010.2-upadate1.orig/include/sql_queries.php 2010-07-09 07:11:32.000000000 +0200
- +++ simpleinvoices-2010.2-upadate1/include/sql_queries.php 2010-12-29 21:58:02.000000000 +0100
- @@ -97,6 +97,10 @@
- function dbQuery($sqlQuery) {
- global $dbh;
- + global $logger;
- +
- +
- +
- $argc = func_num_args();
- $binds = func_get_args();
- $sth = false;
- @@ -108,6 +112,11 @@
- $sth->bindValue($binds[$i], $binds[++$i]);
- }
- }
- +
- +// lagt til av Oystein
- +// $logger->log("TESTING: sqlQuery: ".$sth->queryString." ".$binds[0]." ".$binds[1],
- +// ZEND_Log::INFO);
- +
- /*
- // PDO Execution
- if($sth && $sth->execute()) {
- @@ -1833,6 +1842,7 @@
- global $dbh;
- global $db_server;
- global $auth_session;
- + global $logger;
- if ($db_server == 'mysql' && !_invoice_check_fk(
- $_POST['biller_id'], $_POST['customer_id'],
- @@ -1854,7 +1864,8 @@
- custom_field1,
- custom_field2,
- custom_field3,
- - custom_field4
- + custom_field4,
- + invoice_number
- )
- VALUES
- (
- @@ -1870,7 +1881,8 @@
- :customField1,
- :customField2,
- :customField3,
- - :customField4
- + :customField4,
- + :invoice_number
- )";
- if ($db_server == 'pgsql') {
- @@ -1888,7 +1900,8 @@
- custom_field1,
- custom_field2,
- custom_field3,
- - custom_field4
- + custom_field4,
- + invoice_number
- )
- VALUES
- (
- @@ -1903,12 +1916,28 @@
- :customField1,
- :customField2,
- :customField3,
- - :customField4
- + :customField4,
- + :invoice_number
- )";
- }
- //echo $sql;
- $pref_group=getPreference($_POST[preference_id]);
- +// lagt til av oystein
- +// $logger->log("TESTING: sql query: ".$sql, ZEND_Log::INFO);
- +// $logger->log(':index_id: '.index::next('invoice',$pref_group[index_group]), ZEND_Log::INFO);
- +// $logger->log(':domain_id: '.$auth_session->domain_id, ZEND_Log::INFO);
- +// $logger->log(':biller_id: '.$_POST[biller_id], ZEND_Log::INFO);
- +// $logger->log(':customer_id: '.$_POST[customer_id], ZEND_Log::INFO);
- +// $logger->log(':type: '.$type, ZEND_Log::INFO);
- +// $logger->log(':preference_id: '.$_POST[preference_id], ZEND_Log::INFO);
- +// $logger->log(':date: '.$_POST[date], ZEND_Log::INFO);
- +// $logger->log(':note: '.$_POST[note], ZEND_Log::INFO);
- +// $logger->log(':customField1: '.$_POST[customField1], ZEND_Log::INFO);
- +// $logger->log(':customField2: '.$_POST[customField2], ZEND_Log::INFO);
- +// $logger->log(':customField3: '.$_POST[customField3], ZEND_Log::INFO);
- +// $logger->log(':customField4:'.$_POST[customField4], ZEND_Log::INFO);
- +
- $sth= dbQuery($sql,
- #':index_id', index::next('invoice',$pref_group[index_group],$_POST[biller_id]),
- ':index_id', index::next('invoice',$pref_group[index_group]),
- @@ -1922,11 +1951,13 @@
- ':customField1', $_POST[customField1],
- ':customField2', $_POST[customField2],
- ':customField3', $_POST[customField3],
- - ':customField4', $_POST[customField4]
- + ':customField4', $_POST[customField4],
- + ':invoice_number', biller_index::next($_POST[biller_id])
- );
- #index::increment('invoice',$pref_group[index_group],$_POST[biller_id]);
- index::increment('invoice',$pref_group[index_group]);
- + biller_index::increment($_POST[biller_id]);
- return $sth;
- }
- 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
- --- simpleinvoices-2010.2-upadate1.orig/modules/invoices/manage.js.php 2010-03-22 11:55:10.000000000 +0100
- +++ simpleinvoices-2010.2-upadate1/modules/invoices/manage.js.php 2010-12-29 22:09:03.000000000 +0100
- @@ -1,6 +1,7 @@
- <script type="text/javascript">
- {literal}
- - var columns = 8;
- +// var columns = 8;
- + var columns = 9;
- var padding = 12;
- var action_menu = 140;
- var grid_width = $('.col').width();
- @@ -29,14 +30,16 @@
- dataType: 'xml',
- colModel : [
- {display: '{/literal}{$LANG.actions}{literal}', name : 'actions', width : action_menu, sortable : false, align: 'center'},
- - {display: '{/literal}{$LANG.id}{literal}', name : 'index_name', width :15 * percentage_width, sortable : true, align: 'left'},
- +// {display: '{/literal}{$LANG.id}{literal}', name : 'index_name', width :15 * percentage_width, sortable : true, align: 'left'},
- + {display: '{/literal}{$LANG.id}{literal}', name : 'index_name', width :10 * percentage_width, sortable : true, align: 'left'},
- + {display: '{/literal}{$LANG.invoice_number}{literal}', name : 'invoice_number', width :13 * percentage_width, sortable : true, align: 'left'},
- {display: '{/literal}{$LANG.biller}{literal}', name : 'biller', width :20 * percentage_width, sortable : true, align: 'left'},
- {display: '{/literal}{$LANG.customer}{literal}', name : 'customer', width :20 * percentage_width, sortable : true, align: 'left'},
- - {display: '{/literal}{$LANG.date_upper}{literal}', name : 'date', width : 15 * percentage_width, sortable : true, align: 'left'},
- - {display: '{/literal}{$LANG.total}{literal}', name : 'invoice_total', width : 10 * percentage_width, sortable : true, align: 'left'},
- - {display: '{/literal}{$LANG.owing}{literal}', name : 'owing', width : 10 * percentage_width, sortable : true, align: 'left'},
- - {display: '{/literal}{$LANG.aging}{literal}', name : 'aging', width : 10 * percentage_width, sortable : true, align: 'left'}
- -
- + {display: '{/literal}{$LANG.date_upper}{literal}', name : 'date', width : 13 * percentage_width, sortable : true, align: 'left'},
- + {display: '{/literal}{$LANG.total}{literal}', name : 'invoice_total', width : 9 * percentage_width, sortable : true, align: 'left'},
- + {display: '{/literal}{$LANG.owing}{literal}', name : 'owing', width : 9 * percentage_width, sortable : true, align: 'left'},
- +// {display: '{/literal}{$LANG.aging}{literal}', name : 'aging', width : 10 * percentage_width, sortable : true, align: 'left'}
- + {display: '{/literal}{$LANG.aging}{literal}', name : 'aging', width : 5 * percentage_width, sortable : true, align: 'left'}
- ],
- /*
- buttons : [
- 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
- --- simpleinvoices-2010.2-upadate1.orig/modules/invoices/xml.php 2010-03-22 11:55:10.000000000 +0100
- +++ simpleinvoices-2010.2-upadate1/modules/invoices/xml.php 2010-12-29 22:09:03.000000000 +0100
- @@ -49,17 +49,18 @@
- <!--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>
- ]]>
- </cell>";
- - $xml .= "<cell><![CDATA[".$row['index_name']."]]></cell>";
- + $xml .= "<cell><![CDATA[".$row['index_name']."]]></cell>";
- + $xml .= "<cell><![CDATA[".$row['invoice_number']."]]></cell>";
- $xml .= "<cell><![CDATA[".$row['biller']."]]></cell>";
- $xml .= "<cell><![CDATA[".$row['customer']."]]></cell>";
- $xml .= "<cell><![CDATA[".siLocal::date($row['date'])."]]></cell>";
- $xml .= "<cell><![CDATA[".siLocal::number_trim($row['invoice_total'])."]]></cell>";
- $xml .= "<cell><![CDATA[".siLocal::number_trim($row['owing'])."]]></cell>";
- $xml .= "<cell><![CDATA[".$row['aging']."]]></cell>";
- - $xml .= "<cell><![CDATA[".$row['preference']."]]></cell>";
- - $xml .= "</row>";
- + $xml .= "<cell><![CDATA[".$row['preference']."]]></cell>";
- + $xml .= "</row>";
- }
- $xml .= "</rows>";
- echo $xml;
- -?>
- +?>
- 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
- --- simpleinvoices-2010.2-upadate1.orig/templates/invoices/default/style.css 2009-01-12 04:07:31.000000000 +0100
- +++ simpleinvoices-2010.2-upadate1/templates/invoices/default/style.css 2010-12-29 22:13:06.000000000 +0100
- @@ -1,7 +1,15 @@
- -body { background: white; color: #444444; font-style: normal; font-size: 12pt; font-family: Arial , Veranda, San-Serif; }
- -
- -hr {color: #444444;}
- +body {
- + width: 180mm;
- + background: white;
- + color: black;
- + font-style: normal;
- + font-size: 10pt;
- + font-family: Arial, Veranda, San-Serif;
- + margin-bottom: 0mm;
- + background-color: Gainsboro;
- +}
- +
- table {
- border-spacing: 0;
- border-collapse: collapse;
- @@ -12,17 +20,17 @@
- .col1 { background-color: #EFEFEF; }
- -.font1 { font-family: Arial; font-size: 14pt; }
- +.font1 { font-family: Arial; font-size: 12pt; }
- -.font2 { color: #990000; font-size: 12pt; font-weight: bold; }
- +.font2 { color: #990000; font-size: 10pt; font-weight: bold; }
- .font3 { font-family: Arial; font-size: 8pt; }
- -.tbl1 { border: #A0A0A0 1px solid; border-collapse:collapse; }
- -.tbl1-left { border-left: #A0A0A0 1px solid; border-collapse:collapse; }
- -.tbl1-right { border-right: #A0A0A0 1px solid; border-collapse:collapse; }
- -.tbl1-bottom { border-bottom: #A0A0A0 1px solid; border-collapse:collapse; }
- -.tbl1-top { border-top: #A0A0A0 1px solid; border-collapse:collapse; }
- +.tbl1 { border: #33628D 1px solid; border-collapse:collapse; }
- +.tbl1-left { border-left: #33628D 1px solid; border-collapse:collapse; }
- +.tbl1-right { border-right: #33628D 1px solid; border-collapse:collapse; }
- +.tbl1-bottom { border-bottom: #33628D 1px solid; border-collapse:collapse; }
- +.tbl1-top { border-top: #33628D 1px solid; border-collapse:collapse; }
- .left {
- clear: left;
- @@ -30,9 +38,42 @@
- .right {
- float: right;
- -}
- -
- -.double_underline
- -{
- - border-bottom: 3px double #555;
- +}
- +
- +#billerDetails {
- + float: right;
- + margin-top: 40px;
- + margin-bottom: 40px;
- +}
- +
- +div#details {
- + height: 165mm;
- + background-color: AliceBlue;
- +}
- +
- +div#receipt {
- + height: 20mm;
- + background-color: #faff65;
- +}
- +
- +div#receipt table#payinfo {
- + margin-top: 10mm;
- +}
- +
- +div#giro {
- + background-color: AliceBlue;
- + padding-top: 36mm;
- +}
- +
- +div#giro table#customer {
- + background-color: white;
- + width: 180mm;
- + height: 22mm;
- +}
- +
- +div#giro table#sumaccount {
- + background-color: white;
- + margin-top: 22mm;
- + margin-left: 60mm;
- + width: 120mm;
- }
- 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
- --- simpleinvoices-2010.2-upadate1.orig/templates/invoices/default/template.tpl 2010-06-08 03:49:08.000000000 +0200
- +++ simpleinvoices-2010.2-upadate1/templates/invoices/default/template.tpl 2010-12-29 22:13:06.000000000 +0100
- @@ -1,462 +1,264 @@
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- -<link rel="stylesheet" type="text/css" href="{$css|urlsafe}" media="all">
- -<title>{$preference.pref_inv_wording|htmlsafe} {$LANG.number_short}: {$invoice.index_id|htmlsafe}</title>
- +<link rel="stylesheet" type="text/css" href="{$css}">
- +<title>{$preference.pref_inv_wording} {$LANG.number_short}: {$invoice.id}</title>
- </head>
- <body>
- -<br />
- -<div id="container">
- - <div id="header">
- - </div>
- -
- - <table width="100%" align="center">
- - <tr>
- - <td colspan="5"><img src="{$logo|urlsafe}" border="0" hspace="0" align="left"></td>
- - <th align="right"><span class="font1">{$preference.pref_inv_heading|htmlsafe}</span></th>
- - </tr>
- - <tr>
- - <td colspan="6" class="tbl1-top"> </td>
- - </tr>
- - </table>
- -
- - <!-- Summary - start -->
- -
- - <table class="right">
- - <tr>
- - <td class="col1 tbl1-bottom" colspan="4" ><b>{$preference.pref_inv_wording|htmlsafe} {$LANG.summary}</b></td>
- - </tr>
- - <tr>
- - <td class="">{$preference.pref_inv_wording|htmlsafe} {$LANG.number_short}:</td>
- - <td class="" align="right" colspan="3">{$invoice.index_id}</td>
- - </tr>
- - <tr>
- - <td nowrap class="">{$preference.pref_inv_wording|htmlsafe} {$LANG.date}:</td>
- - <td class="" align="right" colspan="3">{$invoice.date}</td>
- - </tr>
- - <!-- Show the Invoice Custom Fields if valid -->
- - { if $invoice.custom_field1 != null}
- - <tr>
- - <td nowrap class="">{$customFieldLabels.invoice_cf1|htmlsafe}:</td>
- - <td class="" align="right" colspan="3">{$invoice.custom_field1|htmlsafe}</td>
- - </tr>
- - {/if}
- - { if $invoice.custom_field2 != null}
- - <tr>
- - <td nowrap class="">{$customFieldLabels.invoice_cf2|htmlsafe}:</td>
- - <td class="" align="right" colspan="3">{$invoice.custom_field2|htmlsafe}</td>
- - </tr>
- - {/if}
- - { if $invoice.custom_field3 != null}
- - <tr>
- - <td nowrap class="">{$customFieldLabels.invoice_cf3|htmlsafe}:</td>
- - <td class="" align="right" colspan="3">{$invoice.custom_field3|htmlsafe}</td>
- - </tr>
- - {/if}
- - { if $invoice.custom_field4 != null}
- - <tr>
- - <td nowrap class="">{$customFieldLabels.invoice_cf4|htmlsafe}:</td>
- - <td class="" align="right" colspan="3">{$invoice.custom_field4|htmlsafe}</td>
- - </tr>
- - {/if}
- -
- - <tr>
- - <td class="" >{$LANG.total}: </td>
- - <td class="" align="right" colspan="3">{$preference.pref_currency_sign|htmlsafe}{$invoice.total|siLocal_number}</td>
- - </tr>
- - <tr>
- - <td class="">{$LANG.paid}:</td>
- - <td class="" align="right" colspan="3" >{$preference.pref_currency_sign|htmlsafe}{$invoice.paid|siLocal_number}</td>
- - </tr>
- - <tr>
- - <td nowrap class="">{$LANG.owing}:</td>
- - <td class="" align="right" colspan="3" >{$preference.pref_currency_sign|htmlsafe}{$invoice.owing|siLocal_number}</td>
- - </tr>
- -
- - </table>
- - <!-- Summary - end -->
- -
- -
- - <table class="left">
- -
- - <!-- Biller section - start -->
- - <tr>
- - <td class="tbl1-bottom col1" border=1 cellpadding=2 cellspacing=1><b>{$LANG.biller}:</b></td>
- - <td class="col1 tbl1-bottom" border=1 cellpadding=2 cellspacing=1 colspan="3">{$biller.name|htmlsafe}</td>
- - </tr>
- +<div id="details">
- + <h1>{$preference.pref_inv_heading}</h1>
- +
- + <!-- Biller address section - start -->
- + <table class="right">
- + <tr><td>{$biller.name}</td></tr>
- +
- {if $biller.street_address != null}
- - <tr>
- - <td class=''>{$LANG.address}:</td>
- - <td class='' align=left colspan="3">{$biller.street_address|htmlsafe}</td>
- - </tr>
- + <tr><td>{$biller.street_address}</td></tr>
- {/if}
- - {if $biller.street_address2 != null }
- - {if $biller.street_address == null }
- - <tr>
- - <td class=''>{$LANG.address}:</td>
- - <td class='' align=left colspan="3">{$biller.street_address2|htmlsafe}</td>
- - </tr>
- - {/if}
- - {if $biller.street_address != null }
- - <tr>
- - <td class=''></td>
- - <td class='' align=left colspan="3">{$biller.street_address2|htmlsafe}</td>
- - </tr>
- - {/if}
- - {/if}
- -
- - {merge_address field1=$biller.city field2=$biller.state field3=$biller.zip_code street1=$biller.street_address street2=$biller.street_address2 class1="" class2="" colspan="3"}
- -
- - {if $biller.country != null }
- - <tr>
- - <td class=''></td>
- - <td class='' colspan="3">{$biller.country|htmlsafe}</td>
- - </tr>
- - {/if}
- -
- - {print_if_not_null label=$LANG.phone_short field=$biller.phone class1='' class2='' colspan="3"}
- - {print_if_not_null label=$LANG.fax field=$biller.fax class1='' class2='' colspan="3"}
- - {print_if_not_null label=$LANG.mobile_short field=$biller.mobile_phone class1='' class2='' colspan="3"}
- - {print_if_not_null label=$LANG.email field=$biller.email class1='' class2='' colspan="3"}
- -
- - {print_if_not_null label=$customFieldLabels.biller_cf1 field=$biller.custom_field1 class1='' class2='' colspan="3"}
- - {print_if_not_null label=$customFieldLabels.biller_cf2 field=$biller.custom_field2 class1='' class2='' colspan="3"}
- - {print_if_not_null label=$customFieldLabels.biller_cf3 field=$biller.custom_field3 class1='' class2='' colspan="3"}
- - {print_if_not_null label=$customFieldLabels.biller_cf4 field=$biller.custom_field4 class1='' class2='' colspan="3"}
- -
- - <tr>
- - <td class="" colspan="4"> </td>
- - </tr>
- -
- - <!-- Biller section - end -->
- -
- - <tr>
- - <td colspan="4"><br /></td>
- - </tr>
- -
- - <!-- Customer section - start -->
- - <tr>
- - <td class="tbl1-bottom col1" ><b>{$LANG.customer}:</b></td>
- - <td class="tbl1-bottom col1" colspan="3">{$customer.name|htmlsafe}</td>
- - </tr>
- -
- +
- + {if $biller.zip_code && $biller.city}
- + <tr><td>{$biller.zip_code} {$biller.city}</td></tr>
- + {/if}
- + </table>
- + <!-- Biller address section - end -->
- +
- + <!-- Customer address section - start -->
- + <table>
- + <tr><td>{$customer.name}</td></tr>
- +
- + <!-- Responsible person -->
- {if $customer.attention != null }
- - <tr>
- - <td class=''>{$LANG.attention_short}:</td>
- - <td align=left class='' colspan="3" >{$customer.attention|htmlsafe}</td>
- - </tr>
- - {/if}
- + <tr><td>{$customer.attention}</td><td></td> </tr>
- + {/if}
- +
- + <tr>
- {if $customer.street_address != null }
- - <tr >
- - <td class=''>{$LANG.address}:</td>
- - <td class='' align=left colspan="3">{$customer.street_address|htmlsafe}</td>
- - </tr>
- + <td>{$customer.street_address}</td>
- {/if}
- - {if $customer.street_address2 != null}
- - {if $customer.street_address == null}
- - <tr>
- - <td class=''>{$LANG.address}:</td>
- - <td class='' align=left colspan="3">{$customer.street_address2|htmlsafe}</td>
- - </tr>
- - {/if}
- - {if $customer.street_address != null}
- - <tr>
- - <td class=''></td>
- - <td class='' align=left colspan="3">{$customer.street_address2|htmlsafe}</td>
- - </tr>
- - {/if}
- + </tr>
- +
- + <tr><td>{$customer.zip_code} {$customer.city}</td></tr>
- + </table>
- + <!-- Customer address section - stop -->
- +
- + <!-- Biller details - start -->
- + <table class="right" id="billerDetails">
- + <tr>
- + <td>{$preference.pref_inv_wording} {$LANG.number_short}:</td>
- +<!-- <td>{$invoice.id}</td> -->
- + <td>{$invoice.invoice_number}</td>
- + </tr>
- + <tr>
- + <td>{$preference.pref_inv_wording} {$LANG.date}:</td>
- + <td>{$invoice.date}</td>
- + </tr>
- +
- + { if $biller.custom_field1 != null }
- + <tr>
- + <td>{$customFieldLabels.biller_cf1}:</td>
- + <td>{$biller.custom_field1}</td>
- + </tr>
- {/if}
- -
- - {merge_address field1=$customer.city field2=$customer.state field3=$customer.zip_code street1=$customer.street_address street2=$customer.street_addtess2 class1="" class2="" colspan="3"}
- -
- - {if $customer.country != null}
- +
- + {print_if_not_null label=$LANG.phone_short field=$biller.phone}
- + {print_if_not_null label=$LANG.mobile_short field=$biller.mobile_phone}
- + {print_if_not_null label=$LANG.email field=$biller.email}
- + </table>
- + <!-- Biller details - stop -->
- +
- +
- + <!-- Invoice items -->
- + <table class="left" width="100%">
- +
- + <!-- Type 2 start -->
- + {if $invoice.type_id == 2 }
- + <tr class="tbl1-bottom">
- + <td><b>{$LANG.description}</b></td>
- + <td><b>{$LANG.quantity_short}</b></td>
- + <td><b>{$LANG.unit_price}</b></td>
- + <td align="right"><b>{$LANG.total_uppercase}</b></td>
- + </tr>
- + {foreach from=$invoiceItems item=invoiceItem}
- <tr>
- - <td class=''></td>
- - <td class='' colspan="3">{$customer.country|htmlsafe}</td>
- + <td>{$invoiceItem.product.description}</td>
- + <td>{$invoiceItem.quantity|number_format:2}</td>
- + <td>{$invoiceItem.unit_price|number_format:2} {$preference.pref_currency_sign}</td>
- + <td align="right">{$invoiceItem.total|number_format:2} {$preference.pref_currency_sign}</td>
- </tr>
- - {/if}
- -
- - {print_if_not_null label=$LANG.phone_short field=$customer.phone class1='' class2='t' colspan="3"}
- - {print_if_not_null label=$LANG.fax field=$customer.fax class1='' class2='' colspan="3"}
- - {print_if_not_null label=$LANG.mobile_short field=$customer.mobile_phone class1='' class2='' colspan="3"}
- - {print_if_not_null label=$LANG.email field=$customer.email class1='' class2='' colspan="3"}
- -
- - {print_if_not_null label=$customFieldLabels.customer_cf1 field=$customer.custom_field1 class1='' class2='' colspan="3"}
- - {print_if_not_null label=$customFieldLabels.customer_cf2 field=$customer.custom_field2 class1='' class2='' colspan="3"}
- - {print_if_not_null label=$customFieldLabels.customer_cf3 field=$customer.custom_field3 class1='' class2='' colspan="3"}
- - {print_if_not_null label=$customFieldLabels.customer_cf4 field=$customer.custom_field4 class1='' class2='' colspan="3"}
- -
- - <tr>
- - <td class="" colspan="4"></td>
- - </tr>
- - </table>
- -
- - <!-- Customer section - end -->
- -
- - <table class="left" width="100%">
- - <tr>
- - <td colspan="6"><br /></td>
- - </tr>
- -
- - {if $invoice.type_id == 2 }
- - <tr>
- - <td class="tbl1-bottom col1"><b>{$LANG.quantity_short}</b></td>
- - <td class="tbl1-bottom col1" colspan="3"><b>{$LANG.item}</b></td>
- - <td class="tbl1-bottom col1" align="right"><b>{$LANG.Unit_Cost}</b></td>
- - <td class="tbl1-bottom col1" align="right"><b>{$LANG.Price}</b></td>
- - </tr>
- -
- - {foreach from=$invoiceItems item=invoiceItem}
- -
- - <tr class="" >
- - <td class="">{$invoiceItem.quantity|siLocal_number_trim}</td>
- - <td class="" colspan="3">{$invoiceItem.product.description|htmlsafe}</td>
- - <td class="" align="right">{$preference.pref_currency_sign|htmlsafe}{$invoiceItem.unit_price|siLocal_number}</td>
- - <td class="" align="right">{$preference.pref_currency_sign|htmlsafe}{$invoiceItem.gross_total|siLocal_number}</td>
- - </tr>
- - {if $invoiceItem.description != null}
- - <tr class="">
- - <td class=""></td>
- - <td class="" colspan="5">{$LANG.description}: {$invoiceItem.description|htmlsafe}</td>
- - </tr>
- - {/if}
- -
- - <tr class="tbl1-bottom">
- - <td class=""></td>
- - <td class="" colspan="5">
- - <table width="100%">
- - <tr>
- -
- - {inv_itemised_cf label=$customFieldLabels.product_cf1 field=$invoiceItem.product.custom_field1}
- - {do_tr number=1 class="blank-class"}
- - {inv_itemised_cf label=$customFieldLabels.product_cf2 field=$invoiceItem.product.custom_field2}
- - {do_tr number=2 class="blank-class"}
- - {inv_itemised_cf label=$customFieldLabels.product_cf3 field=$invoiceItem.product.custom_field3}
- - {do_tr number=3 class="blank-class"}
- - {inv_itemised_cf label=$customFieldLabels.product_cf4 field=$invoiceItem.product.custom_field4}
- - {do_tr number=4 class="blank-class"}
- -
- - </tr>
- - </table>
- - </td>
- - </tr>
- - {/foreach}
- - {/if}
- -
- - {if $invoice.type_id == 3 }
- - <tr class="tbl1-bottom col1">
- - <td class="tbl1-bottom "><b>{$LANG.quantity_short}</b></td>
- - <td colspan="3" class=" tbl1-bottom"><b>{$LANG.item}</b></td>
- - <td align="right" class=" tbl1-bottom"><b>{$LANG.Unit_Cost}</b></td>
- - <td align="right" class=" tbl1-bottom "><b>{$LANG.Price}</b></td>
- - </tr>
- -
- - {foreach from=$invoiceItems item=invoiceItem}
- -
- - <tr class=" ">
- - <td class="" >{$invoiceItem.quantity|siLocal_number}</td>
- - <td>{$invoiceItem.product.description|htmlsafe}</td>
- - <td class="" colspan="4"></td>
- - </tr>
- -
- -
- - <tr>
- - <td class=""></td>
- - <td class="" colspan="5">
- - <table width="100%">
- - <tr>
- -
- - {inv_itemised_cf label=$customFieldLabels.product_cf1 field=$invoiceItem.product.custom_field1}
- - {do_tr number=1 class="blank-class"}
- - {inv_itemised_cf label=$customFieldLabels.product_cf2 field=$invoiceItem.product.custom_field2}
- - {do_tr number=2 class="blank-class"}
- - {inv_itemised_cf label=$customFieldLabels.product_cf3 field=$invoiceItem.product.custom_field3}
- - {do_tr number=3 class="blank-class"}
- - {inv_itemised_cf label=$customFieldLabels.product_cf4 field=$invoiceItem.product.custom_field4}
- - {do_tr number=4 class="blank-class"}
- -
- - </tr>
- - </table>
- - </td>
- - </tr>
- -
- - <tr class="">
- - <td class=""></td>
- - <td class="" colspan="5"><i>{$LANG.description}: </i>{$invoiceItem.description|htmlsafe}</td>
- - </tr>
- - <tr class="">
- - <td class="" ></td>
- - <td class=""></td>
- - <td class=""></td>
- - <td class=""></td>
- - <td align="right" class="">{$preference.pref_currency_sign}{$invoiceItem.unit_price|siLocal_number}</td>
- - <td align="right" class="">{$preference.pref_currency_sign}{$invoiceItem.total|siLocal_number}</td>
- - </tr>
- - {/foreach}
- - {/if}
- -
- - {if $invoice.type_id == 1 }
- - <table class="left" width="100%">
- -
- - <tr class="col1" >
- - <td class="tbl1-bottom col1" colspan="6"><b>{$LANG.description}</b></td>
- - </tr>
- -
- - {foreach from=$invoiceItems item= invoiceItem}
- + {/foreach}
- + {/if}
- + <!-- Type 2 stop -->
- - <tr class="">
- - <td class="t" colspan="6">{$invoiceItem.description|outhtml}</td>
- + <!-- TYPE 3 START -->
- + {if $invoice.type_id == 3 }
- + <tr class="tbl1 col1">
- + <td class="tbl1"><b>{$LANG.quantity_short}</b></td>
- + <td class="tbl1"><b>{$LANG.item}</b></td>
- + <td class="tbl1"><b>{$LANG.unit_price}</b></td>
- + <td class="tbl1"><b>{$LANG.gross_total}</b></td>
- + <td class="tbl1"><b>{$LANG.tax}</b></td>
- + <td align="right" class="tbl1"><b>{$LANG.total_uppercase}</b></td>
- + </tr>
- +
- + {foreach from=$invoiceItems item=invoiceItem}
- +
- + <tr class="tbl1-left tbl1-right">
- + <td class="tbl1-left" >{$invoiceItem.quantity|number_format:2}</td>
- + <td>{$invoiceItem.product.description}</td>
- + <td class="tbl1-right" colspan="4"></td>
- + </tr>
- +
- + <tr>
- + <td class="tbl1-left"></td>
- + <td class="tbl1-right" colspan="5">
- + <table width="100%">
- + <tr>
- + {inv_itemised_cf label=$customFieldLabels.product_cf1 field=$invoiceItem.product.custom_field1}
- + {do_tr number=1 class="blank-class"}
- + {inv_itemised_cf label=$customFieldLabels.product_cf2 field=$invoiceItem.product.custom_field2}
- + {do_tr number=2 class="blank-class"}
- + {inv_itemised_cf label=$customFieldLabels.product_cf3 field=$invoiceItem.product.custom_field3}
- + {do_tr number=3 class="blank-class"}
- + {inv_itemised_cf label=$customFieldLabels.product_cf4 field=$invoiceItem.product.custom_field4}
- + {do_tr number=4 class="blank-class"}
- </tr>
- + </table>
- + </td>
- + </tr>
- +
- + <tr class="tbl1-left tbl1-right">
- + <td class="tbl1-left"></td>
- + <td class="tbl1-right" colspan="5"><i>{$LANG.description}: </i>{$invoiceItem.description}</td>
- + </tr>
- + <tr class="tbl1-left tbl1-right tbl1-bottom">
- + <td class="tbl1-left tbl1-bottom" ></td>
- + <td class="tbl1-bottom"></td>
- + <td class="tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.unit_price|number_format:2}</td>
- + <td class="tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.gross_total|number_format:2}</td>
- + <td class="tbl1-bottom ">{$preference.pref_currency_sign}{$invoiceItem.tax_amount|number_format:2}</td>
- + <td align="right" class="tbl1-right tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.total|number_format:2}</td>
- + </tr>
- + {/foreach}
- + {/if}
- + <!-- TYPE 3 STOP -->
- +
- + <!-- TYPE 1 START -->
- + {if $invoice.type_id == 1 }
- + <table class="left" width="100%">
- +
- + <tr class="tbl1 col1" ><td class="tbl1 col1 tbl1-right" colspan="6"><b>{$LANG.description}</b></td></tr>
- +
- + {foreach from=$invoiceItems item= invoiceItem}
- + <tr class="tbl1-left tbl1-right"><td class="tbl1-left tbl1-right" colspan="6">{$invoiceItem.description}</td></tr>
- + <tr class="tbl1-left tbl1-right"><td colspan="6" class="tbl1-left tbl1-right"><br></td></tr>
- + {/foreach}
- + </table>
- + {/if}
- + <!-- Type 1 stop -->
- - {/foreach}
- - {/if}
- -{if ($invoice.type_id == 2 && $invoice.note != "") || ($invoice.type_id == 3 && $invoice.note != "" ) }
- + {if ($invoice.type_id == 2 && $invoice.note != "") || ($invoice.type_id == 3 && $invoice.note != "" ) }
- +<!-- <tr><td colspan="4"><br></td></tr> -->
- +<!-- <tr><td colspan="4" align="left"><b>{$LANG.notes}:</b></td></tr> -->
- + <tr><td colspan="4">{$invoice.note}</td></tr>
- + {/if}
- - <tr>
- - <td class="" colspan="6"><br /></td>
- - </tr>
- - <tr>
- - <td class="" colspan="6" align="left"><b>{$LANG.notes}:</b></td>
- - </tr>
- - <tr>
- - <td class="" colspan="6">{$invoice.note|outhtml}</td>
- - </tr>
- -
- -{/if}
- -
- - <tr class="">
- - <td class="" colspan="6" ><br /></td>
- - </tr>
- -
- - {* tax section - start *}
- - {if $invoice_number_of_taxes > 0}
- - <tr>
- - <td colspan="2"></td>
- - <td colspan="3" align="right">{$LANG.sub_total} </td>
- - <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>
- + <tr class="tbl1-top">
- + <td colspan="4" ><br></td>
- </tr>
- +
- + <tr>
- + <td align="right" colspan="3">{$LANG.gross_total}</td>
- + {php} global $invoice; $this->assign('invoice_gross_total', $invoice[total] - $invoice[total_tax]); {/php}
- + {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-->
- + <td align="right" colspan="2">{$invoiceItems.0.gross_total|number_format:2} {$preference.pref_currency_sign}</td>
- + {else}
- + <td align="right" colspan="2">{$invoice_gross_total|number_format:2} {$preference.pref_currency_sign}</td>
- {/if}
- - {if $invoice_number_of_taxes > 1 }
- - <tr>
- - <td colspan="6"><br /></td>
- - </tr>
- - {/if}
- - {section name=line start=0 loop=$invoice.tax_grouped step=1}
- - {if ($invoice.tax_grouped[line].tax_amount != "0") }
- -
- - <tr>
- - <td colspan="2"></td>
- - <td colspan="3" align="right">{$invoice.tax_grouped[line].tax_name|htmlsafe} </td>
- - <td colspan="1" align="right">{$preference.pref_currency_sign|htmlsafe}{$invoice.tax_grouped[line].tax_amount|siLocal_number}</td>
- - </tr>
- - {/if}
- -
- - {/section}
- - {if $invoice_number_of_taxes > 1}
- - <tr>
- - <td colspan="2"></td>
- - <td colspan="3" align="right">{$LANG.tax_total} </td>
- - <td colspan="1" align="right"><u>{$preference.pref_currency_sign|htmlsafe}{$invoice.total_tax|siLocal_number}</u></td>
- + </tr>
- +
- + <tr>
- + <td></td>
- + <td align="right" colspan="2">{$LANG.tax_total}</td>
- + <td align="right" colspan="2">{$invoice.total_tax|number_format:2} {$preference.pref_currency_sign}</td>
- </tr>
- - {/if}
- - {if $invoice_number_of_taxes > 1}
- - <tr>
- - <td colspan="6"><br /></td>
- - </tr>
- - {/if}
- +
- <tr>
- - <td colspan="2"></td>
- - <td colspan="3" align="right"><b>{$preference.pref_inv_wording|htmlsafe} {$LANG.amount} </b></td>
- - <td colspan="1" align="right"><span class="double_underline"><u>{$preference.pref_currency_sign|htmlsafe}{$invoice.total|siLocal_number}</u></span></td>
- + <td colspan="4" class="tbl1-bottom"><br></td>
- </tr>
- - {* tax section - end *}
- -{*
- - <tr>
- - <td class="" colspan="2"></td>
- - <td align="right" colspan="3">{$LANG.sub_total}</td>
- - <td align="right" class="">{$preference.pref_currency_sign|htmlsafe}{$invoice.gross|siLocal_number}</td>
- - </tr>
- -
- -
- - {section name=line start=0 loop=$invoice.tax_grouped step=1}
- -
- - {if ($invoice.tax_grouped[line].tax_amount != "0") }
- -
- - <tr class=''>
- - <td colspan="2"></td>
- - <td colspan="3" align="right">{$invoice.tax_grouped[line].tax_name|htmlsafe}</td>
- - <td colspan="1" align="right">{$preference.pref_currency_sign|htmlsafe}{$invoice.tax_grouped[line].tax_amount|siLocal_number}</td>
- - </tr>
- -
- - {/if}
- -
- - {/section}
- -
- - <tr class=''>
- - <td colspan="2"></td>
- - <td colspan="3" align="right">{$LANG.tax_total}</td>
- - <td colspan="1" align="right"><u>{$preference.pref_currency_sign|htmlsafe}{$invoice.total_tax|siLocal_number}</u></td>
- +
- + <trtbl1-bottom">
- + <td class="tbl1-bottom"></td>
- + <td class="tbl1-bottom" align="right" colspan="2"><b>{$preference.pref_inv_wording} {$LANG.amount}</b></td>
- + <td class="tbl1-bottom" align="right" colspan="2"><u>{$invoice.total|number_format:2} {$preference.pref_currency_sign}</u></td>
- </tr>
- -
- -
- - <tr class="">
- - <td class="" colspan="6" ><br /></td>
- - </tr>
- - <tr class="">
- - <td class="" colspan="2"></td>
- - <td class="" align="right" colspan="3"><b>{$preference.pref_inv_wording|htmlsafe} {$LANG.amount}</b></td>
- - <td class="" align="right"><span class="double_underline" >{$preference.pref_currency_sign|htmlsafe}{$invoice.total|siLocal_number}</span></td>
- - </tr>
- -*}
- - <tr>
- - <td colspan="6"><br /><br /></td>
- - </tr>
- -
- - <!-- invoice details section - start -->
- -
- - <tr>
- - <td class="tbl1-bottom col1" colspan="6"><b>{$preference.pref_inv_detail_heading|htmlsafe}</b></td>
- - </tr>
- - <tr>
- - <td class="" colspan="6"><i>{$preference.pref_inv_detail_line|outhtml}</i></td>
- - </tr>
- - <tr>
- - <td class="" colspan="6">{$preference.pref_inv_payment_method|htmlsafe}</td>
- - </tr>
- - <tr>
- - <td class="" colspan="6">{$preference.pref_inv_payment_line1_name|htmlsafe} {$preference.pref_inv_payment_line1_value|htmlsafe}</td>
- - </tr>
- - <tr>
- - <td class="" colspan="6">{$preference.pref_inv_payment_line2_name|htmlsafe} {$preference.pref_inv_payment_line2_value|htmlsafe}</td>
- - </tr>
- - <tr>
- - <td><br /></td>
- - </tr>
- - <tr>
- - <td colspan="6"><div style="font-size:8pt;" align="center">{$biller.footer|outhtml}</div></td>
- - </tr>
- - <tr>
- - <td>
- - {online_payment_link
- - type=$preference.include_online_payment business=$biller.paypal_business_name
- - item_name=$invoice.index_name invoice=$invoice.id
- - amount=$invoice.total currency_code=$preference.currency_code
- - link_wording=$LANG.paypal_link
- - notify_url=$biller.paypal_notify_url return_url=$biller.paypal_return_url
- - domain_id = $invoice.domain_id include_image=true
- - }
- - </td>
- - </tr>
- + </table>
- +</div>
- - <!-- invoice details section - end -->
- +<div id="receipt">
- + <table id="payinfo">
- + <tr>
- +<!-- <td>{$preference.pref_inv_payment_line1_name} {$preference.pref_inv_payment_line1_value}</td> -->
- + <td>{$customFieldLabels.biller_cf2} {$biller.custom_field2}</td>
- + </tr>
- + </table>
- +</div>
- -</table>
- +<div id="giro">
- -<div id="footer"></div>
- + <!-- Customer section - start -->
- + <table id="customer">
- + <tr>
- + <td>{$customer.name}</td>
- + <td>{$biller.name}</td>
- + </tr>
- + {if $customer.attention != null }
- + <tr><td>{$customer.attention}</td><td></td> </tr>
- + {/if}
- +
- + <tr>
- + <td>
- + {if $customer.street_address != null }
- + {$customer.street_address}
- + {/if}
- + </td>
- + <td>
- + {if $biller.street_address != null}
- + {$biller.street_address}
- + {/if}
- + </td>
- + </tr>
- +
- + <tr>
- + <td>
- + {if $customer.street_address2 != null}
- + {$customer.street_address2}
- + {/if}
- + </td>
- + <td>
- + {if $biller.street_address2 != null }
- + {$biller.street_address2}
- + {/if}
- + </td>
- + </tr>
- +
- + <tr>
- + <td>{$customer.zip_code} {$customer.city}</td>
- + <td>{$biller.zip_code} {$biller.city}</td>
- + </tr>
- + </table>
- + <!-- Customer section - end -->
- +
- + <table id="sumaccount">
- + <tr>
- + <td>{$invoice.total|number_format:2}</td>
- + <td>{$biller.custom_field2}</td>
- + </tr>
- + </table>
- +
- </div>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement