Skip to content

Commit

Permalink
26/11/15 Exson: Fixed the rounding error caused extra lines on WO pdf…
Browse files Browse the repository at this point in the history
… file and 2 number display without locale format in PDFWOPrint.php.

git-svn-id: http://svn.code.sf.net/p/web-erp/code/trunk@7400 09516a42-71f9-43be-811f-9b821cf0d246
  • Loading branch information
exsonqu committed Nov 26, 2015
1 parent 23573d9 commit ee36b95
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions PDFWOPrint.php
Expand Up @@ -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 {
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit ee36b95

Please sign in to comment.