From: <dai...@us...> - 2010-05-16 06:18:40
|
Revision: 3463 http://web-erp.svn.sourceforge.net/web-erp/?rev=3463&view=rev Author: daintree Date: 2010-05-16 06:18:34 +0000 (Sun, 16 May 2010) Log Message: ----------- 6/5/10 Phil: reworked PDFRemittanceAdvices.php - somehow missed from tcpdf work to print utf-8 pdfs Modified Paths: -------------- trunk/PDFRemittanceAdvice.php trunk/doc/Change.log.html Modified: trunk/PDFRemittanceAdvice.php =================================================================== --- trunk/PDFRemittanceAdvice.php 2010-05-16 06:11:39 UTC (rev 3462) +++ trunk/PDFRemittanceAdvice.php 2010-05-16 06:18:34 UTC (rev 3463) @@ -10,17 +10,8 @@ AND strlen($_POST['FromCriteria'])>=1 AND isset($_POST['ToCriteria']) AND strlen($_POST['ToCriteria'])>=1) { - -/*then print the report */ + /*Now figure out the invoice less credits due for the Supplier range under review */ - include('includes/PDFStarter.php'); - $pdf->addInfo('Title',_('Remmitance Advice')); - $pdf->addInfo('Subject',_('Remittance Advice') . ' - ' . _('suppliers from') . ' ' . $_POST['FromCriteria'] . ' to ' . $_POST['ToCriteria'] . ' ' . _('and Paid On') . ' ' . $_POST['PaymentDate']); - - $line_height=12; - - /*Now figure out the invoice less credits due for the Supplier range under review */ - $sql = "SELECT suppliers.supplierid, suppliers.suppname, suppliers.address1, @@ -41,7 +32,24 @@ ORDER BY supplierno"; $SuppliersResult = DB_query($sql,$db); + if (DB_num_rows($SuppliersResult)==0){ + //then there aint awt to print + $title = _('Print Remittance Advices Error'); + include('includes/header.inc'); + prnMsg(_('There were no remittance advices to print out for the supplier range and payment date specified'),'warn'); + echo '<br><a href="'.$_SERVER['PHP_SELF'] .'?' . SID . '">'. _('Back').'</a>'; + include('includes/footer.inc'); + exit; + } +/*then print the report */ + include('includes/PDFStarter.php'); + $pdf->addInfo('Title',_('Remmitance Advice')); + $pdf->addInfo('Subject',_('Remittance Advice') . ' - ' . _('suppliers from') . ' ' . $_POST['FromCriteria'] . ' to ' . $_POST['ToCriteria'] . ' ' . _('and Paid On') . ' ' . $_POST['PaymentDate']); + + $line_height=12; + + $SupplierID =''; $RemittanceAdviceCounter =0; while ($SuppliersPaid = DB_fetch_array($SuppliersResult)){ @@ -102,21 +110,11 @@ PaymentFooter(); } /* end while there are supplier payments to retrieve allocations for */ - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=RemittanceAdvice.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); + + $FileName=$_SESSION['DatabaseName']. '_' . _('Remittance_Advices') . '_' . date('Y-m-d').'.pdf'; + $pdf->OutputD($FileName); + $pdf->__destruct(); - $pdf->stream(); - - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - } else { /*The option to print PDF was not hit */ $title=_('Remittance Advices'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-16 06:11:39 UTC (rev 3462) +++ trunk/doc/Change.log.html 2010-05-16 06:18:34 UTC (rev 3463) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<P>16/5/10 Phil: reworked PDFRemittanceAdvices.php - somehow missed from tcpdf work to print utf-8 pdfs</p> <p>16/5/10 Phil: reworked PDFPriceList to use the new effective dates fields and print out effective prices as at a specified date - showing effective dates on the report - also ditched includes/PDFPriceListPageHeader.php in favour of a PageHeader() function inside PDFPriceList.php. Also made the script work with tcpdf - not sure how it was missed before?</p> <p>16/5/10 Phil: reworked PricesBasedOnMarkUp.php to insert new prices with effectivity dates and update the prices where effectivity dates specified.</p> <p>16/5/10 Phil: reworked PricesByCost.php this was bit of a dodgy script - well I found it hard to follow - in the words of Frank Sinatra - I did it my way! Also built in effectivity dates to display and ensure correct prices updated now the primary key of prices is changed.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |