From: <rc...@us...> - 2014-08-15 20:25:06
|
Revision: 6822 http://sourceforge.net/p/web-erp/reponame/6822 Author: rchacon Date: 2014-08-15 20:24:57 +0000 (Fri, 15 Aug 2014) Log Message: ----------- Fixes double line feed in PDFQuotationPortrait.php reported by Arwan Galaya. Uniforms code between PDFQuotation.php and PDFQuotationPortrait.php. Modified Paths: -------------- trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/doc/Change.log trunk/includes/PDFQuotationPageHeader.inc trunk/includes/PDFQuotationPortraitPageHeader.inc trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2014-08-15 00:58:02 UTC (rev 6821) +++ trunk/PDFQuotation.php 2014-08-15 20:24:57 UTC (rev 6822) @@ -1,6 +1,8 @@ <?php +/* $Id$*/ -/* $Id$*/ +/* Please note that addTextWrap prints a font-size-height further down than + addText and other functions.*/ include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -112,10 +114,9 @@ include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Customer Quotation') ); $pdf->addInfo('Subject', _('Quotation') . ' ' . $_GET['QuotationNo']); -$FontSize=12; -$line_height=15; +$FontSize = 12; +$line_height = 12;// Recommended: $line_height = $x * $FontSize. - /* Now ... Has the order got any line items still outstanding to be invoiced */ $ErrMsg = _('There was a problem retrieving the quotation line details for quotation Number') . ' ' . @@ -142,20 +143,21 @@ /*Yes there are line items to start the ball rolling with a page header */ include('includes/PDFQuotationPageHeader.inc'); - $QuotationTotal =0; - $QuotationTotalEx=0; - $TaxTotal=0; + $QuotationTotal = 0; + $QuotationTotalEx = 0; + $TaxTotal = 0; while ($myrow2=DB_fetch_array($result)){ $ListCount ++; + $YPos -= $line_height;// Increment a line down for the next line item. + if ((mb_strlen($myrow2['narrative']) >200 AND $YPos-$line_height <= 75) OR (mb_strlen($myrow2['narrative']) >1 AND $YPos-$line_height <= 62) OR $YPos-$line_height <= 50){ /* We reached the end of the page so finsih off the page and start a newy */ include ('includes/PDFQuotationPageHeader.inc'); - } //end if need a new page headed up $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); @@ -191,40 +193,41 @@ $LineTotal = $SubTot + $TaxAmount; $DisplayTotal = locale_number_format($LineTotal,$myrow['currdecimalplaces']); - $FontSize=10; + $FontSize = 10;// Font size for the line item. - $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,100,$FontSize,$myrow2['stkcode']); - $LeftOvers = $pdf->addTextWrap(145,$YPos,295,$FontSize,$myrow2['description']); - $LeftOvers = $pdf->addTextWrap(420,$YPos,85,$FontSize,$DisplayQty,'right'); - $LeftOvers = $pdf->addTextWrap(485,$YPos,85,$FontSize,$DisplayPrice,'right'); + $LeftOvers = $pdf->addText($Left_Margin, $YPos+$FontSize, $FontSize, $myrow2['stkcode']); + $LeftOvers = $pdf->addText(145, $YPos+$FontSize, $FontSize, $myrow2['description']); + $LeftOvers = $pdf->addTextWrap(420, $YPos,85,$FontSize,$DisplayQty,'right'); + $LeftOvers = $pdf->addTextWrap(485, $YPos,85,$FontSize,$DisplayPrice,'right'); if ($DisplayDiscount > 0) { - $LeftOvers = $pdf->addTextWrap(535,$YPos,85,$FontSize,$DisplayDiscount,'right'); + $LeftOvers = $pdf->addTextWrap(535, $YPos,85,$FontSize,$DisplayDiscount,'right'); } - $LeftOvers = $pdf->addTextWrap(585,$YPos,85,$FontSize,$DisplayTaxClass,'right'); - $LeftOvers = $pdf->addTextWrap(650,$YPos,85,$FontSize,$DisplayTaxAmount,'right'); + $LeftOvers = $pdf->addTextWrap(585, $YPos,85,$FontSize,$DisplayTaxClass,'right'); + $LeftOvers = $pdf->addTextWrap(650, $YPos,85,$FontSize,$DisplayTaxAmount,'right'); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, $DisplayTotal,'right'); - // Print salesorderdetails.narrative - $line_height = 10;// Line height to print salesorderdetails.narrative - $LeftOvers = str_replace('\n', ' ', $myrow2['narrative']);// Get salesorders.comments and replace line feed character. '<br />' works? + // Prints salesorderdetails.narrative: + $FontSize2 = $FontSize*0.8;// Font size to print salesorderdetails.narrative. + $Width2 = $Page_Width-$Right_Margin-145;// Width to print salesorderdetails.narrative. + $LeftOvers = trim($myrow2['narrative']); + //********** + $LeftOvers = str_replace('\n', ' ', $LeftOvers);// Replaces line feed character. $LeftOvers = str_replace('\r', '', $LeftOvers);// Delete carriage return character $LeftOvers = str_replace('\t', '', $LeftOvers);// Delete tabulator character - while (mb_strlen($LeftOvers) > 0) { - $YPos -= $line_height;// Suggestion: $line_height = $FontSize; - if ($YPos < ($Bottom_Margin)) {// Begin new page + //********** + while (mb_strlen($LeftOvers) > 1) { + $YPos -= $FontSize2; + if ($YPos < ($Bottom_Margin)) {// Begins new page. include ('includes/PDFQuotationPageHeader.inc'); } - $LeftOvers = $pdf->addTextWrap(40, $YPos, 772, $FontSize, $LeftOvers, 'left'); + $LeftOvers = $pdf->addTextWrap(145, $YPos, $Width2, $FontSize2, $LeftOvers); } - $line_height = 15;// Back to the default line height - $QuotationTotal +=$LineTotal; - $QuotationTotalEx +=$SubTot; - $TaxTotal +=$TaxAmount; + $QuotationTotal += $LineTotal; + $QuotationTotalEx += $SubTot; + $TaxTotal += $TaxAmount; - /*increment a line down for the next line item */ - $YPos -= $line_height; - } //end while there are line items to print out + }// Ends while there are line items to print out. if ((mb_strlen($myrow['comments']) >200 AND $YPos-$line_height <= 75) OR (mb_strlen($myrow['comments']) >1 AND $YPos-$line_height <= 62) @@ -233,31 +236,34 @@ include ('includes/PDFQuotationPageHeader.inc'); } //end if need a new page headed up - $YPos -= $line_height; + $FontSize = 10; + $YPos -= $line_height; $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90-655, $YPos, 655, $FontSize, _('Quotation Excluding Tax'),'right'); - $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, locale_number_format($QuotationTotalEx,$myrow['currdecimalplaces']), 'right'); - $YPos -= 12; + $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, locale_number_format($QuotationTotalEx,$myrow['currdecimalplaces']), 'right'); + $YPos -= $FontSize; $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90-655, $YPos, 655, $FontSize, _('Total Tax'), 'right'); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, locale_number_format($TaxTotal,$myrow['currdecimalplaces']), 'right'); - $YPos -= 12; + $YPos -= $FontSize; $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90-655, $YPos, 655, $FontSize, _('Quotation Including Tax'),'right'); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, locale_number_format($QuotationTotal,$myrow['currdecimalplaces']), 'right'); - // Print salesorders.comments - $line_height = 10;// Line height to print salesorders.comments - $YPos -= $line_height; - $pdf->addText($XPos, $YPos+10, $FontSize, _('Notes').':');// Comment: addText Y-Coordinate is to top left corner (add a FontSize mesure to equal addTextWrap Y-Coordinate) - $LeftOvers = str_replace('\n', ' ', $myrow['comments']);// Get salesorders.comments and replace line feed character. '<br />' works? + // Print salesorders.comments: + $YPos -= $FontSize*2; + $pdf->addText($XPos, $YPos+$FontSize, $FontSize, _('Notes').':'); + $Width2 = $Page_Width-$Right_Margin-120;// Width to print salesorders.comments. + $LeftOvers = trim($myrow['comments']); + //********** + $LeftOvers = str_replace('\n', ' ', $LeftOvers);// Replaces line feed character. $LeftOvers = str_replace('\r', '', $LeftOvers);// Delete carriage return character $LeftOvers = str_replace('\t', '', $LeftOvers);// Delete tabulator character - while (mb_strlen($LeftOvers) > 0) { - $YPos -= $line_height;// Suggestion: $line_height = $FontSize; - if ($YPos < ($Bottom_Margin)) {// Begin new page + //********** + while(mb_strlen($LeftOvers) > 1) { + $YPos -= $FontSize; + if ($YPos < ($Bottom_Margin)) {// Begins new page. include ('includes/PDFQuotationPageHeader.inc'); } - $LeftOvers = $pdf->addTextWrap(40, $YPos, 772, $FontSize, $LeftOvers, 'left'); + $LeftOvers = $pdf->addTextWrap(40, $YPos, $Width2, $FontSize, $LeftOvers); } - $line_height = 15;// Back to the default line height } /*end if there are line details to show on the quotation*/ Modified: trunk/PDFQuotationPortrait.php =================================================================== --- trunk/PDFQuotationPortrait.php 2014-08-15 00:58:02 UTC (rev 6821) +++ trunk/PDFQuotationPortrait.php 2014-08-15 20:24:57 UTC (rev 6822) @@ -1,6 +1,8 @@ <?php +/* $Id: PDFQuotationPortrait.php 4491 2011-02-15 06:31:08Z daintree $ */ -/* $Id: PDFQuotationPortrait.php 4491 2011-02-15 06:31:08Z daintree $ */ +/* Please note that addTextWrap prints a font-size-height further down than + addText and other functions.*/ include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -111,11 +113,11 @@ LETS GO */ $PaperSize = 'A4'; include('includes/PDFStarter.php'); +/*$PageNumber = 1;// RChacon: PDFStarter.php sets $PageNumber = 0.*/ $pdf->addInfo('Title', _('Customer Quotation') ); $pdf->addInfo('Subject', _('Quotation') . ' ' . $_GET['QuotationNo']); -$FontSize=12; -$PageNumber = 1; -$line_height=24; +$FontSize = 12; +$line_height = 12;// Recommended: $line_height = $x * $FontSize. /* Now ... Has the order got any line items still outstanding to be invoiced */ @@ -143,21 +145,21 @@ /*Yes there are line items to start the ball rolling with a page header */ include('includes/PDFQuotationPortraitPageHeader.inc'); - $QuotationTotal =0; - $QuotationTotalEx=0; - $TaxTotal=0; + $QuotationTotal = 0; + $QuotationTotalEx = 0; + $TaxTotal = 0; while ($myrow2=DB_fetch_array($result)){ $ListCount ++; + $YPos -= $line_height;// Increment a line down for the next line item. + if ((mb_strlen($myrow2['narrative']) >200 AND $YPos-$line_height <= 75) OR (mb_strlen($myrow2['narrative']) >1 AND $YPos-$line_height <= 62) OR $YPos-$line_height <= 50){ /* We reached the end of the page so finsih off the page and start a newy */ - $PageNumber++; - include ('includes/PDFQuotationPageHeader.inc'); - + include('includes/PDFQuotationPortraitPageHeader.inc'); } //end if need a new page headed up $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); @@ -186,83 +188,75 @@ $TaxClass = 100 * $myrow4['taxrate']; } - $DisplayTaxClass = $TaxClass . "%"; + $DisplayTaxClass = $TaxClass . '%'; $TaxAmount = (($SubTot/100)*(100+$TaxClass))-$SubTot; $DisplayTaxAmount = locale_number_format($TaxAmount,$myrow['currdecimalplaces']); $LineTotal = $SubTot + $TaxAmount; $DisplayTotal = locale_number_format($LineTotal,$myrow['currdecimalplaces']); - $FontSize=10; + $FontSize = 10;// Font size for the line item. - $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,100,$FontSize,$myrow2['stkcode']); - $LeftOvers = $pdf->addTextWrap(120,$YPos,295,$FontSize,$myrow2['description']); - $LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize,$DisplayQty,'right'); - $LeftOvers = $pdf->addTextWrap(230,$YPos,85,$FontSize,$DisplayPrice,'right'); + $LeftOvers = $pdf->addText($Left_Margin, $YPos+$FontSize, $FontSize, $myrow2['stkcode']); + $LeftOvers = $pdf->addText(120, $YPos+$FontSize, $FontSize, $myrow2['description']); + $LeftOvers = $pdf->addTextWrap(180, $YPos,85,$FontSize,$DisplayQty,'right'); + $LeftOvers = $pdf->addTextWrap(230, $YPos,85,$FontSize,$DisplayPrice,'right'); if ($DisplayDiscount > 0){ - $LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize,$DisplayDiscount,'right'); + $LeftOvers = $pdf->addTextWrap(280, $YPos,85,$FontSize,$DisplayDiscount,'right'); } - $LeftOvers = $pdf->addTextWrap(330,$YPos,85,$FontSize,$DisplayTaxClass,'right'); - $LeftOvers = $pdf->addTextWrap(410,$YPos,85,$FontSize,$DisplayTaxAmount,'center'); + $LeftOvers = $pdf->addTextWrap(330, $YPos,85,$FontSize,$DisplayTaxClass,'right'); + $LeftOvers = $pdf->addTextWrap(410, $YPos,85,$FontSize,$DisplayTaxAmount,'center');// RChacon: To review align to right.********** $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, $DisplayTotal,'right'); - // Prints salesorderdetails.narrative - $Split = explode("\r\n", wordwrap($myrow2['narrative'], 130, "\r\n")); - foreach ($Split as $TextLine) { - $YPos -= $line_height; // rchacon's suggestion: $YPos -= $FontSize; - if ($YPos < ($Bottom_Margin + $line_height)){ // Begins new page - $PageNumber++; - include ('includes/PDFQuotationPageHeader.inc'); + // Prints salesorderdetails.narrative: + $FontSize2 = $FontSize*0.8;// Font size to print salesorderdetails.narrative. + $Width2 = $Page_Width-$Right_Margin-120;// Width to print salesorderdetails.narrative. + $LeftOvers = trim($myrow2['narrative']); + while(mb_strlen($LeftOvers) > 1) { + $YPos -= $FontSize2; + if ($YPos < ($Bottom_Margin)) {// Begins new page. + include('includes/PDFQuotationPortraitPageHeader.inc'); } - $LeftOvers = $pdf->addTextWrap($XPos+1, $YPos, 750, 10, $TextLine); + $LeftOvers = $pdf->addTextWrap(120, $YPos, $Width2, $FontSize2, $LeftOvers); } - $YPos -= $line_height; - $QuotationTotal +=$LineTotal; - $QuotationTotalEx +=$SubTot; - $TaxTotal +=$TaxAmount; + $QuotationTotal += $LineTotal; + $QuotationTotalEx += $SubTot; + $TaxTotal += $TaxAmount; - /*increment a line down for the next line item */ - $YPos -= ($line_height); + }// Ends while there are line items to print out. - } //end while there are line items to print out if ((mb_strlen($myrow['comments']) >200 AND $YPos-$line_height <= 75) OR (mb_strlen($myrow['comments']) >1 AND $YPos-$line_height <= 62) OR $YPos-$line_height <= 50){ /* We reached the end of the page so finsih off the page and start a newy */ - $PageNumber++; - include ('includes/PDFQuotationPageHeader.inc'); + include('includes/PDFQuotationPortraitPageHeader.inc'); } //end if need a new page headed up - $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,30,10,_('Notes:')); - $LeftOvers = $pdf->addText($XPos,$YPos-95,10,$myrow['comments']); - - if (mb_strlen($LeftOvers)>1){ - $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); - if (mb_strlen($LeftOvers)>1){ - $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); - if (mb_strlen($LeftOvers)>1){ - $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); - if (mb_strlen($LeftOvers)>1){ - $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,10,$FontSize,$LeftOvers); - } - } - } - } - $YPos -= ($line_height); + $FontSize = 10; + $YPos -= $line_height; $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90-655, $YPos, 655, $FontSize, _('Quotation Excluding Tax'),'right'); - $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, locale_number_format($QuotationTotalEx,$myrow['currdecimalplaces']), 'right'); - $YPos -= 12; + $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, locale_number_format($QuotationTotalEx,$myrow['currdecimalplaces']), 'right'); + $YPos -= $FontSize; $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90-655, $YPos, 655, $FontSize, _('Total Tax'), 'right'); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, locale_number_format($TaxTotal,$myrow['currdecimalplaces']), 'right'); - $YPos -= 12; + $YPos -= $FontSize; $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90-655, $YPos, 655, $FontSize, _('Quotation Including Tax'),'right'); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, locale_number_format($QuotationTotal,$myrow['currdecimalplaces']), 'right'); + // Print salesorders.comments: + $YPos -= $FontSize*2; + $pdf->addText($XPos, $YPos+$FontSize, $FontSize, _('Notes').':'); + $Width2 = $Page_Width-$Right_Margin-120;// Width to print salesorders.comments. + $LeftOvers = trim($myrow['comments']); + while(mb_strlen($LeftOvers) > 1) { + $YPos -= $FontSize; + if ($YPos < ($Bottom_Margin)) {// Begins new page. + include ('includes/PDFQuotationPageHeader.inc'); + } + $LeftOvers = $pdf->addTextWrap(40, $YPos, $Width2, $FontSize, $LeftOvers); + } + } /*end if there are line details to show on the quotation*/ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-08-15 00:58:02 UTC (rev 6821) +++ trunk/doc/Change.log 2014-08-15 20:24:57 UTC (rev 6822) @@ -1,5 +1,6 @@ webERP Change Log +15/08/14 RChacon: Fixes double line feed in PDFQuotationPortrait.php reported by Arwan Galaya. Uniforms code between PDFQuotation.php and PDFQuotationPortrait.php. 14/08/14 RChacon: In CustomerInquiry.php and SupplierInquiry.php makes translatable the systypes.typename. 14/08/14 RChacon: In SupplierInquiry.php: Reorganizes columns Date, Type, Number, Reference and Comments, and regroups table-datacel format-strings as in CustomerInquiry.php code. 13/08/14 kelo: SupplierBalsAtPeriodEnd.php fix calculation to take into account fx differences on after date transactions Modified: trunk/includes/PDFQuotationPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPageHeader.inc 2014-08-15 00:58:02 UTC (rev 6821) +++ trunk/includes/PDFQuotationPageHeader.inc 2014-08-15 20:24:57 UTC (rev 6822) @@ -1,12 +1,13 @@ <?php -/* $Id$*/ +/* $Id$*/ /* pdf-php by R&OS code to set up a new sales order page */ -// The $PageNumber variable is initialised in 0 by PDFStarter.php -// This page header increments variable $PageNumber before printing it. -$PageNumber++; -// Inserts a page break if it is not the first page -if ($PageNumber>1) { +/* Please note that addTextWrap prints a font-size-height further down than + addText and other functions.*/ + +// $PageNumber is initialised in 0 by includes/PDFStarter.php. +$PageNumber ++;// Increments $PageNumber before printing. +if ($PageNumber>1) {// Inserts a page break if it is not the first page. $pdf->newPage(); } @@ -62,14 +63,16 @@ $YPos -= 82; $pdf->RoundRectangle($XPos-10, $YPos+60+10, 225+10+10, 60+10+10, 10, 10);// Function RoundRectangle from includes/class.pdf.php -// Print the currency name -include($PathPrefix . 'includes/CurrenciesArray.php'); // To get the currency name from the currency code. -$pdf->addText($Page_Width/2-60, $YPos-5, $FontSize, _('All amounts stated in') . ' - ' . $myrow['currcode'] . ' ' . $CurrencyName[$myrow['currcode']]); +$FontSize=10; -// Print table header +// Prints the currency name: +require_once('includes/CurrenciesArray.php');// To get the currency name from the currency code. +$pdf->addText($Page_Width/2-60, $YPos-5, $FontSize, + _('All amounts stated in') . ' ' . $myrow['currcode'] . ' - ' . $CurrencyName[$myrow['currcode']]); + +// Prints table header: $XPos = 40; $YPos -= 37; -$FontSize=10; $LeftOvers = $pdf->addTextWrap( 42, $YPos,103, $FontSize, _('Item Code'),'left'); if (strlen($LeftOvers) > 0) { // If translated text is greater than 103, prints remainder $LeftOvers = $pdf->addTextWrap(585,$YPos-$FontSize,65, $FontSize, $LeftOvers,'left'); @@ -88,28 +91,19 @@ } $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, _('Total'),'right'); -/*draw a box with nice round corner for entering line items */ -/*90 degree arc at top right of box 0 degrees starts a bottom */ -$pdf->partEllipse($Page_Width-$Right_Margin-10, $Bottom_Margin+350,0,90,10,10); -/*line to the top left */ -$pdf->line($Page_Width-$Right_Margin-10, $Bottom_Margin+360,$Left_Margin+10, $Bottom_Margin+360); +// Draws a box with round corners around line items: +$pdf->RoundRectangle( + $Left_Margin,// RoundRectangle $XPos. + $YPos+$FontSize+5,// RoundRectangle $YPos. + $Page_Width-$Left_Margin-$Right_Margin,// RoundRectangle $Width. + $YPos+$FontSize-$Bottom_Margin+5,// RoundRectangle $Height. + 10,// RoundRectangle $RadiusX. + 10);// RoundRectangle $RadiusY. -/*line under headings to top left */ -$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin+335,$Left_Margin, $Bottom_Margin+335); +// Line under table headings: +$LineYPos = $YPos - $FontSize -1; +$pdf->line($Page_Width-$Right_Margin, $LineYPos, $Left_Margin, $LineYPos); +$YPos -= $FontSize;// This is to use addTextWrap's $YPos instead of normal $YPos. -/*Dow top left corner */ -$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+350,90,180,10,10); -/*Do a line to the bottom left corner */ -$pdf->line($Left_Margin, $Bottom_Margin+350,$Left_Margin, $Bottom_Margin+10); -/*Now do the bottom left corner 180 - 270 coming back west*/ -$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+10,180,270,10,10); -/*Now a line to the bottom right */ -$pdf->line($Left_Margin+10, $Bottom_Margin,$Page_Width-$Right_Margin-10, $Bottom_Margin); -/*Now do the bottom right corner */ -$pdf->partEllipse($Page_Width-$Right_Margin-10, $Bottom_Margin+10,270,350,10,10); -/*Finally join up to the top right corner where started */ -$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin+10,$Page_Width-$Right_Margin, $Bottom_Margin+350); - -$YPos -= (2*$line_height); ?> Modified: trunk/includes/PDFQuotationPortraitPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPortraitPageHeader.inc 2014-08-15 00:58:02 UTC (rev 6821) +++ trunk/includes/PDFQuotationPortraitPageHeader.inc 2014-08-15 20:24:57 UTC (rev 6822) @@ -1,7 +1,12 @@ <?php -/* $Id: PDFQuotationPortraitPageHeader.inc 4491 2011-02-15 06:31:08Z daintree $ */ +/* $Id: PDFQuotationPortraitPageHeader.inc 4491 2011-02-15 06:31:08Z daintree $ */ -if ($PageNumber>1){ +/* Please note that addTextWrap prints a font-size-height further down than + addText and other functions.*/ + +// $PageNumber is initialised in 0 by includes/PDFStarter.php. +$PageNumber ++;// Increments $PageNumber before printing. +if ($PageNumber>1) {// Inserts a page break if it is not the first page. $pdf->newPage(); } @@ -88,12 +93,16 @@ $pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*3, 200, $FontSize, _('Date'). ': '.ConvertSQLDate($myrow['quotedate']), 'right'); $pdf->addTextWrap($Page_Width-$Right_Margin-200, $Page_Height-$Top_Margin-$FontSize*4, 200, $FontSize, _('Page').': '.$PageNumber, 'right'); -$pdf->addText($Page_Width/2-10, $YPos+15, $FontSize, _('All amounts stated in') . ' - ' . $myrow['currcode']); +$FontSize=10; +// Prints the currency name: +require_once('includes/CurrenciesArray.php');// To get the currency name from the currency code. +$pdf->addText($Page_Width/2-10, $YPos+5, $FontSize, + _('All amounts stated in') . ' ' . $myrow['currcode'] . ' - ' . $CurrencyName[$myrow['currcode']]); + +// Prints table header: $YPos -= 45; $XPos = 40; - -$FontSize=10; $LeftOvers = $pdf->addTextWrap($XPos+2,$YPos,100,$FontSize, _('Item Code'),'left'); $LeftOvers = $pdf->addTextWrap(120,$YPos,235,$FontSize, _('Item Description'),'left'); $LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize, _('Quantity'),'right'); @@ -103,32 +112,19 @@ $LeftOvers = $pdf->addTextWrap(400,$YPos,85,$FontSize, _('Tax Amount'),'right'); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-90, $YPos, 90, $FontSize, _('Total'),'right'); +// Draws a box with round corners around line items: +$pdf->RoundRectangle( + $Left_Margin,// RoundRectangle $XPos. + $YPos+$FontSize+5,// RoundRectangle $YPos. + $Page_Width-$Left_Margin-$Right_Margin,// RoundRectangle $Width. + $YPos+$FontSize-$Bottom_Margin+5,// RoundRectangle $Height. + 10,// RoundRectangle $RadiusX. + 10);// RoundRectangle $RadiusY. -/*draw a box with nice round corner for entering line items */ -/*90 degree arc at top right of box 0 degrees starts a bottom */ -$pdf->partEllipse($Page_Width-$Right_Margin-0, $Bottom_Margin+560,0,90,10,10); -/*line to the top left */ -$pdf->line($Page_Width-$Right_Margin-0, $Bottom_Margin+570,$Left_Margin+10, $Bottom_Margin+570); +// Line under table headings: +$LineYPos = $YPos - $FontSize -1; +$pdf->line($Page_Width-$Right_Margin, $LineYPos, $Left_Margin, $LineYPos); -/*line under headings to top left */ -$pdf->line($Page_Width-$Right_Margin+10, $Bottom_Margin+538,$Left_Margin, $Bottom_Margin+538); +$YPos -= $FontSize;// This is to use addTextWrap's $YPos instead of normal $YPos. - -/*Dow top left corner */ -$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+560,90,180,10,10); -/*Do a line to the bottom left corner */ -$pdf->line($Left_Margin, $Bottom_Margin+560,$Left_Margin, $Bottom_Margin+10); -/*Now do the bottom left corner 180 - 270 coming back west*/ -$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+10,180,270,10,10); -/*Now a line to the bottom right */ -$pdf->line($Left_Margin+10, $Bottom_Margin,$Page_Width-$Right_Margin-0, $Bottom_Margin); -/*Now do the bottom right corner */ -$pdf->partEllipse($Page_Width-$Right_Margin-0, $Bottom_Margin+10,270,360,10,10); -/*Finally join up to the top right corner where started */ -$pdf->line($Page_Width-$Right_Margin+10, $Bottom_Margin+10,$Page_Width-$Right_Margin+10, $Bottom_Margin+560); - -$YPos -= $line_height; - -$FontSize =12; - ?> Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-08-15 00:58:02 UTC (rev 6821) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-08-15 20:24:57 UTC (rev 6822) @@ -8,7 +8,7 @@ "Project-Id-Version: webERP 4.11.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-08-14 18:43-0600\n" -"PO-Revision-Date: 2014-08-14 08:28-0600\n" +"PO-Revision-Date: 2014-08-15 14:04-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -726,7 +726,7 @@ #: PcReportTab.php:336 SelectCustomer.php:613 ShopParameters.php:198 #: SystemParameters.php:363 WOSerialNos.php:298 WOSerialNos.php:304 msgid "Notes" -msgstr "Descripción" +msgstr "Notas" #: AddCustomerContacts.php:149 SupplierContacts.php:166 #, php-format |