Skip to content

Commit

Permalink
Merge pull request #970 from kyob/printindex-fix-for-extended-and-pdf…
Browse files Browse the repository at this point in the history
…-version

add print adjustments for extendend and pdf version
  • Loading branch information
chilek authored Oct 14, 2016
2 parents 532d965 + 07c66f9 commit ebfdd61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 6 additions & 0 deletions modules/invoicereport.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,20 @@ function set_taxes($taxid)
$SMARTY->assign('pagescount', sizeof($pages));
$SMARTY->assign('reccount', $reccount);
if (strtolower(ConfigHelper::getConfig('phpui.report_type')) == 'pdf') {
$SMARTY->assign('printcustomerid', $_POST['printcustomerid']);
$SMARTY->assign('printonlysummary', $_POST['printonlysummary']);
$output = $SMARTY->fetch('invoice/invoicereport-ext.html');
html2pdf($output, trans('Reports'), $layout['pagetitle'], NULL, NULL, 'L', array(5, 5, 5, 5), ($_GET['save'] == 1) ? true : false);
} else {
$SMARTY->assign('printcustomerid', $_POST['printcustomerid']);
$SMARTY->assign('printonlysummary', $_POST['printonlysummary']);
$SMARTY->display('invoice/invoicereport-ext.html');
}
}
else {
if (strtolower(ConfigHelper::getConfig('phpui.report_type')) == 'pdf') {
$SMARTY->assign('printcustomerid', $_POST['printcustomerid']);
$SMARTY->assign('printonlysummary', $_POST['printonlysummary']);
$output = $SMARTY->fetch('invoice/invoicereport.html');
html2pdf($output, trans('Reports'), $layout['pagetitle'], NULL, NULL, 'L', array(5, 5, 5, 5), ($_GET['save'] == 1) ? true : false);
} else {
Expand Down
18 changes: 10 additions & 8 deletions templates/default/invoice/invoicereport-ext.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{include file="clearheader.html" landscape=true}
<!--// $Id$ //-->
{$report_type = ConfigHelper::getConfig('phpui.report_type')}
{foreach from=$pages item=item}{assign var=previtem value=$item-1}
{foreach $pages as $item}{assign var=previtem value=$item-1}
{if $report_type == 'pdf'}
{if $item > 1}<page>{/if}
{else}
Expand Down Expand Up @@ -37,7 +37,7 @@
{trans("Contractor")}
</TD>
{if $doctype == 'invoices'}
{foreach item=tax from=$taxes}
{foreach $taxes as $tax}
<TD WIDTH="50" CLASS="HEAD" ALIGN="CENTER">
{trans("Net value")} {$tax.label}
</TD>
Expand All @@ -57,6 +57,7 @@
</TD>
{/if}
</TR>
{if !isset($printonlysummary)}
{cycle values="grey,white" print=false}
{math assign=start equation="(x-1)*y" x=$item y=$rows}
{section name=invoicelist loop=$invoicelist start=$start max=$rows}
Expand All @@ -73,11 +74,11 @@
{$invoicelist[invoicelist].pdate|date_format:"%d.%m.%Y"}
</TD>
<TD>
<B>{$invoicelist[invoicelist].custname}</B> ({$invoicelist[invoicelist].customerid|string_format:"%04d"}){if $invoicelist[invoicelist].ten}, {$invoicelist[invoicelist].ten}{/if}<BR>
<B>{$invoicelist[invoicelist].custname}</B> {if !isset($printcustomerid)}({$invoicelist[invoicelist].customerid|string_format:"%04d"}){/if}{if $invoicelist[invoicelist].ten}, {$invoicelist[invoicelist].ten}{/if}<BR>
{$invoicelist[invoicelist].custaddress}
</TD>
{if $doctype == 'invoices'}
{foreach item=tax from=$taxes}
{foreach $taxes as $tax}
{assign var=taxid value=$tax.id}
<TD ALIGN="RIGHT">
{$invoicelist[invoicelist].$taxid.val|string_format:"%01.2f"}
Expand All @@ -99,12 +100,13 @@
{/if}
</TR>
{/section}
{/if}
<TR>
<TD COLSPAN="4" ALIGN="RIGHT" class="HEADGREY">
<B>{trans("Page total:")}</B>
</TD>
{if $doctype == 'invoices'}
{foreach item=tax from=$taxes}
{foreach $taxes as $tax}
{assign var=taxid value=$tax.id}
<TD ALIGN="RIGHT" class="HEADGREY">
<B>{$totals.$item.val.$taxid|string_format:"%01.2f"}</B>
Expand All @@ -130,7 +132,7 @@
<B>{trans("Transfered from previous page:")}</B>
</TD>
{if $doctype == 'invoices'}
{foreach item=tax from=$taxes}
{foreach $taxes as $tax}
{assign var=taxid value=$tax.id}
<TD ALIGN="RIGHT" class="HEADGREY">
<B>{$totals.$previtem.allval.$taxid|string_format:"%01.2f"}</B>
Expand All @@ -156,7 +158,7 @@
<B>{trans("Total from start of period:")}</B>
</TD>
{if $doctype == 'invoices'}
{foreach item=tax from=$taxes}
{foreach $taxes as $tax}
{assign var=taxid value=$tax.id}
<TD ALIGN="RIGHT" class="HEADGREY">
<B>{$totals.$item.allval.$taxid|string_format:"%01.2f"}</B>
Expand Down Expand Up @@ -214,7 +216,7 @@
{trans("Contractor")}
</TD>
{if $doctype == 'invoices'}
{foreach item=tax from=$taxes}
{foreach $taxes as $tax}
<TD WIDTH="50" CLASS="HEAD" ALIGN="CENTER">
{trans("Net value")}
</TD>
Expand Down

0 comments on commit ebfdd61

Please sign in to comment.