From: <dai...@us...> - 2013-12-07 05:39:16
|
Revision: 6481 http://sourceforge.net/p/web-erp/reponame/6481 Author: daintree Date: 2013-12-07 05:39:13 +0000 (Sat, 07 Dec 2013) Log Message: ----------- Phil: Fixed htmlMimeEmail.inc following Tims submission - removed & value by reference errors Modified Paths: -------------- trunk/PDFStockCheckComparison.php trunk/doc/Change.log trunk/includes/PDFStockComparisonPageHeader.inc trunk/includes/htmlMimeMail.php Modified: trunk/PDFStockCheckComparison.php =================================================================== --- trunk/PDFStockCheckComparison.php 2013-12-06 17:09:39 UTC (rev 6480) +++ trunk/PDFStockCheckComparison.php 2013-12-07 05:39:13 UTC (rev 6481) @@ -210,7 +210,10 @@ include('includes/footer.inc'); exit; } - + $FirstRow = DB_fetch_array($CheckedItems); + $LocationName = $FirstRow['locationname']; + DB_data_seek($CheckedItems,0); + include ('includes/PDFStockComparisonPageHeader.inc'); $Location = ''; @@ -245,13 +248,7 @@ $YPos -=$line_height; } - $YPos -=$line_height; - $FontSize=8; - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize,$CheckItemRow['stockid'], 'left'); - $LeftOvers = $pdf->addTextWrap(135,$YPos,180,$FontSize,$CheckItemRow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap(315,$YPos,60,$FontSize,locale_number_format($CheckItemRow['qoh'],$CheckItemRow['decimalplaces']), 'right'); - + $SQL = "SELECT qtycounted, reference FROM stockcounts @@ -272,17 +269,22 @@ include('includes/footer.inc'); exit; } + if ($CheckItemRow['qoh']!=0 OR DB_num_rows($Counts)>0) { + $YPos -=$line_height; + $FontSize=8; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize,$CheckItemRow['stockid'], 'left'); + $LeftOvers = $pdf->addTextWrap(135,$YPos,180,$FontSize,$CheckItemRow['description'], 'left'); + $LeftOvers = $pdf->addTextWrap(315,$YPos,60,$FontSize,locale_number_format($CheckItemRow['qoh'],$CheckItemRow['decimalplaces']), 'right'); + } - - if (DB_num_rows($Counts)==0){ + if (DB_num_rows($Counts)==0 AND $CheckItemRow['qoh']!=0){ $LeftOvers = $pdf->addTextWrap(380, $YPos,160, $FontSize, _('No counts entered'), 'left'); if ($_POST['ZeroCounts']=='Adjust'){ $LeftOvers = $pdf->addTextWrap(485, $YPos, 60, $FontSize, locale_number_format(-($CheckItemRow['qoh']),$CheckItemRow['decimalplaces']), 'right'); } - } else { + } elseif (DB_num_rows($Counts)>0) { $TotalCount =0; while ($CountRow=DB_fetch_array($Counts,$db)){ - $LeftOvers = $pdf->addTextWrap(375, $YPos, 60, $FontSize, locale_number_format(($CountRow['qtycounted']),$CheckItemRow['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap(440, $YPos, 100, $FontSize, $CountRow['reference'], 'left'); $TotalCount += $CountRow['qtycounted']; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2013-12-06 17:09:39 UTC (rev 6480) +++ trunk/doc/Change.log 2013-12-07 05:39:13 UTC (rev 6481) @@ -1,7 +1,9 @@ webERP Change Log -4/12/2013 Exson: Alter table stockmoves reference to varchar(100) to make it can meet mysql strict mode requirements when data is more than original 40. -2/12/2013 Exson: Fixed the typo in WWW_Users.php. Reported by Thumb. -1/12/2013 Exson: Fixed country Chinese sql for installation failure. + +7/12/13 Phil: Fixed htmlMimeEmail.inc following Tim's submission - removed & value by reference errors +4/12/13 Exson: Alter table stockmoves reference to varchar(100) to make it can meet mysql strict mode requirements when data is more than original 40. +2/12/13 Exson: Fixed the typo in WWW_Users.php. Reported by Thumb. +1/12/13 Exson: Fixed country Chinese sql for installation failure. 1/12/13 CQZ: Correct Chinese translation error dispatch cut_off time. 1/12/13 Release 4.11.2 Modified: trunk/includes/PDFStockComparisonPageHeader.inc =================================================================== --- trunk/includes/PDFStockComparisonPageHeader.inc 2013-12-06 17:09:39 UTC (rev 6480) +++ trunk/includes/PDFStockComparisonPageHeader.inc 2013-12-07 05:39:13 UTC (rev 6481) @@ -13,7 +13,7 @@ $YPos -=15; -$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,550,$FontSize, _('Stock Check Comparison') ); +$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,550,$FontSize, _('Stock Check Comparison at') . ' ' . $LocationName ); $YPos -=15; @@ -38,4 +38,4 @@ $FontSize=10; $YPos -=(2*$line_height); -?> \ No newline at end of file +?> Modified: trunk/includes/htmlMimeMail.php =================================================================== --- trunk/includes/htmlMimeMail.php 2013-12-06 17:09:39 UTC (rev 6480) +++ trunk/includes/htmlMimeMail.php 2013-12-07 05:39:13 UTC (rev 6481) @@ -396,7 +396,7 @@ /** * Adds a text subpart to a mime_part object */ - function _addTextPart(&$obj, $text) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE + function _addTextPart($obj, $text) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE { $params['content_type'] = 'text/plain'; $params['encoding'] = $this->build_params['text_encoding']; @@ -411,7 +411,7 @@ /** * Adds a html subpart to a mime_part object */ - function _addHtmlPart(&$obj) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE + function _addHtmlPart($obj) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE { $params['content_type'] = 'text/html'; $params['encoding'] = $this->build_params['html_encoding']; @@ -435,7 +435,7 @@ /** * Adds an alternative part to a mime_part object */ - function _addAlternativePart(&$obj) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE + function _addAlternativePart($obj) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE { $params['content_type'] = 'multipart/alternative'; if (is_object($obj)) { @@ -448,7 +448,7 @@ /** * Adds a html subpart to a mime_part object */ - function _addRelatedPart(&$obj) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE + function _addRelatedPart($obj) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE { $params['content_type'] = 'multipart/related'; if (is_object($obj)) { @@ -461,7 +461,7 @@ /** * Adds an html image subpart to a mime_part object */ - function _addHtmlImagePart(&$obj, $value) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE + function _addHtmlImagePart($obj, $value) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE { $params['content_type'] = $value['c_type']; $params['encoding'] = 'base64'; @@ -474,7 +474,7 @@ /** * Adds an attachment subpart to a mime_part object */ - function _addAttachmentPart(&$obj, $value) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE + function _addAttachmentPart($obj, $value) // // FIXED PHP & PEAR LIBRARY ERROR - ONLY VARIABLE REFERENCES SHOULD BE RETURNED BY REFERENCE { $params['content_type'] = $value['c_type']; $params['encoding'] = $value['encoding']; @@ -526,11 +526,11 @@ switch (true) { case $text AND !$attachments: - $message = &$this->_addTextPart($null, $this->text); + $message = $this->_addTextPart($null, $this->text); break; case !$text AND $attachments AND !$html: - $message = &$this->_addMixedPart(); + $message = $this->_addMixedPart(); for ($i=0; $i<count($this->attachments); $i++) { $this->_addAttachmentPart($message, $this->attachments[$i]); @@ -538,7 +538,7 @@ break; case $text AND $attachments: - $message = &$this->_addMixedPart(); + $message = $this->_addMixedPart(); $this->_addTextPart($message, $this->text); for ($i=0; $i<count($this->attachments); $i++) { @@ -548,22 +548,22 @@ case $html AND !$attachments AND !$html_images: if (!is_null($this->html_text)) { - $message = &$this->_addAlternativePart($null); + $message = $this->_addAlternativePart($null); $this->_addTextPart($message, $this->html_text); $this->_addHtmlPart($message); } else { - $message = &$this->_addHtmlPart($null); + $message = $this->_addHtmlPart($null); } break; case $html AND !$attachments AND $html_images: if (!is_null($this->html_text)) { - $message = &$this->_addAlternativePart($null); + $message = $this->_addAlternativePart($null); $this->_addTextPart($message, $this->html_text); - $related = &$this->_addRelatedPart($message); + $related = $this->_addRelatedPart($message); } else { - $message = &$this->_addRelatedPart($null); - $related = &$message; + $message = $this->_addRelatedPart($null); + $related = $message; } $this->_addHtmlPart($related); for ($i=0; $i<count($this->html_images); $i++) { @@ -572,9 +572,9 @@ break; case $html AND $attachments AND !$html_images: - $message = &$this->_addMixedPart(); + $message = $this->_addMixedPart(); if (!is_null($this->html_text)) { - $alt = &$this->_addAlternativePart($message); + $alt = $this->_addAlternativePart($message); $this->_addTextPart($alt, $this->html_text); $this->_addHtmlPart($alt); } else { @@ -586,13 +586,13 @@ break; case $html AND $attachments AND $html_images: - $message = &$this->_addMixedPart(); + $message = $this->_addMixedPart(); if (!is_null($this->html_text)) { - $alt = &$this->_addAlternativePart($message); + $alt = $this->_addAlternativePart($message); $this->_addTextPart($alt, $this->html_text); - $rel = &$this->_addRelatedPart($alt); + $rel = $this->_addRelatedPart($alt); } else { - $rel = &$this->_addRelatedPart($message); + $rel = $this->_addRelatedPart($message); } $this->_addHtmlPart($rel); for ($i=0; $i<count($this->html_images); $i++) { @@ -688,7 +688,7 @@ case 'smtp': require_once(dirname(__FILE__) . '/smtp.php'); require_once(dirname(__FILE__) . '/RFC822.php'); - $smtp = &smtp::connect($this->smtp_params); + $smtp = smtp::connect($this->smtp_params); // Parse recipients argument for internet addresses foreach ($recipients as $recipient) { |