From: <ex...@us...> - 2015-11-26 07:13:51
|
Revision: 7400 http://sourceforge.net/p/web-erp/reponame/7400 Author: exsonqu Date: 2015-11-26 07:13:48 +0000 (Thu, 26 Nov 2015) Log Message: ----------- 26/11/15 Exson: Fixed the rounding error caused extra lines on WO pdf file and 2 number display without locale format in PDFWOPrint.php. Modified Paths: -------------- trunk/PDFWOPrint.php Modified: trunk/PDFWOPrint.php =================================================================== --- trunk/PDFWOPrint.php 2015-11-26 01:03:48 UTC (rev 7399) +++ trunk/PDFWOPrint.php 2015-11-26 07:13:48 UTC (rev 7400) @@ -340,7 +340,7 @@ $WOLine[$i]['issued'] = 9999999.99; $WOLine[$i]['decimalplaces'] = 2; } - if ($WOLine['decimalplaces'] != NULL) { + if ($WOLine[$i]['decimalplaces'] != NULL) { $DecimalPlaces = $WOLine[$i]['decimalplaces']; } else { @@ -407,13 +407,15 @@ while ($ToIssue = DB_fetch_array($AvailQty)){ if ($WOLine[$i]['controlled']) { $CurLot=$ToIssue['serialno']; - $CurQty=$ToIssue['qty']; + $CurQty=locale_number_format($ToIssue['qty'],$DecimalPlaces); } else { $CurLot=substr($WOHeader['locationname'] . ' ' . $ToIssue['bin'],0,34); - $CurQty=$ToIssue['quantity']; + $CurQty=locale_number_format($ToIssue['quantity'],$DecimalPlaces); } - if ($CurQty > 0) { + //remove display of very small number raised due to rounding error + $MinalQtyAllowed = 1/pow(10,$DecimalPlaces)/10; + if ($CurQty > $MinalQtyAllowed) { $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x, $YPos, $FormDesign->Data->Column3->Length, $FormDesign->Data->Column3->FontSize, $CurLot, 'left'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x, $YPos, $FormDesign->Data->Column3->Length, $FormDesign->Data->Column3->FontSize, $CurQty, 'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x, $YPos, $FormDesign->Data->Column5->Length, $FormDesign->Data->Column5->FontSize, '________', 'right'); |