From: <tim...@us...> - 2009-11-23 10:20:37
|
Revision: 3084 http://web-erp.svn.sourceforge.net/web-erp/?rev=3084&view=rev Author: tim_schofield Date: 2009-11-23 10:20:29 +0000 (Mon, 23 Nov 2009) Log Message: ----------- Correctly print the invoice lines, and add the invoice number to the file name Modified Paths: -------------- trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/doc/Change.log.html Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2009-11-23 08:55:13 UTC (rev 3083) +++ trunk/PrintCustTrans.php 2009-11-23 10:20:29 UTC (rev 3084) @@ -293,11 +293,15 @@ if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; - $DisplayNet=number_format(($myrow3['unitprice'] * $myrow2['Quantity']),2); + $DisplayNet=number_format(($myrow3['unitprice'] * $myrow2['quantity']),2); + $DisplayPrice=$myrow3['unitprice']; + $DisplayQty=$myrow2['quantity']; } else { $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; $DiscountPrice=$myrow2['discountpercent'] * $myrow3['unitprice']; - $DisplayNet=number_format((($myrow3['unitprice'] - $DiscountPrice) * $myrow2['Quantity']),2); + $DisplayPrice=$myrow3['unitprice']; + $DisplayQty=$myrow2['quantity']; + $DisplayNet=number_format((($myrow3['unitprice'] - $DiscountPrice) * $myrow2['quantity']),2); } $LeftOvers = $pdf->addTextWrap($Left_Margin+3,$YPos,95,$FontSize,$myrow2['stockid']); @@ -311,7 +315,7 @@ $YPos -= ($line_height); - $lines=explode('\r\n',$Narrative); + $lines=explode('\r\n',$myrow2['narrative']); for ($i=0;$i<sizeOf($lines);$i++) { while (strlen($lines[$i])>1){ if ($YPos-$line_height <= $Bottom_Margin){ @@ -445,7 +449,7 @@ $FromTransNo++; } /* end loop to print invoices */ - $pdfcode = $pdf->output($_SESSION['reports_dir'] . '/Invoice.pdf', "F"); + $pdfcode = $pdf->Output('SalesInvoice'.($FromTransNo-1).'.pdf', "I"); $len = strlen($pdfcode); Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2009-11-23 08:55:13 UTC (rev 3083) +++ trunk/PrintCustTransPortrait.php 2009-11-23 10:20:29 UTC (rev 3084) @@ -84,6 +84,9 @@ $myrow = DB_fetch_array($result); $DefaultBankAccountNumber = _('Account:') .' ' .$myrow['bankaccountnumber']; $DefaultBankAccountCode = _('Bank Code:') .' ' .$myrow['bankaccountcode']; + } else { + $DefaultBankAccountNumber = ''; + $DefaultBankAccountCode = ''; } } // gather the invoice data @@ -496,7 +499,7 @@ } /* end loop to print invoices */ // $pdfcode = $pdf->stream(); - $pdfcode = $pdf->Output('Invoice.pdf', "I"); + $pdfcode = $pdf->Output('SalesInvoice'.($FromTransNo-1).'.pdf', "I"); $len = strlen($pdfcode); // Start FPDI concatination to append PDF files conditionally to the invoice // This part taken from FPDI example page Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2009-11-23 08:55:13 UTC (rev 3083) +++ trunk/doc/Change.log.html 2009-11-23 10:20:29 UTC (rev 3084) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>23/11/09 Tim: PrintCustTrans.php and PrintCustTransPortrait.php - Correctly print the invoice lines, and add the invoice number to the file name <p>22/11/09 Tim: MiscFunctions.php - Correction for case of LogPath not being set <p>22/11/09 Tim: PurchData.php - Improve the working of adding and editing purchasing data <p>22/11/09 Tim: PO_PDFOrderPageHeader.php - Correct variable name to show order lines correctly This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |