From: <ex...@us...> - 2014-04-05 11:30:29
|
Revision: 6664 http://sourceforge.net/p/web-erp/reponame/6664 Author: exsonqu Date: 2014-04-05 11:30:25 +0000 (Sat, 05 Apr 2014) Log Message: ----------- 05/04/14 Exson: Add a decimal places check in StockAdjustments.php to prevent from wrong decimal places input. Modified Paths: -------------- trunk/PDFQuotationPortrait.php trunk/StockAdjustments.php Modified: trunk/PDFQuotationPortrait.php =================================================================== --- trunk/PDFQuotationPortrait.php 2014-04-04 08:02:36 UTC (rev 6663) +++ trunk/PDFQuotationPortrait.php 2014-04-05 11:30:25 UTC (rev 6664) @@ -274,7 +274,7 @@ include('includes/footer.inc'); exit; } else { - $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf'); + $pdf->OutputD($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf'); $pdf->__destruct(); } ?> Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2014-04-04 08:02:36 UTC (rev 6663) +++ trunk/StockAdjustments.php 2014-04-05 11:30:25 UTC (rev 6664) @@ -158,6 +158,9 @@ } elseif (!is_numeric($_SESSION['Adjustment' . $identifier]->Quantity)){ prnMsg( _('The quantity entered must be numeric'),'error'); $InputError = true; + } elseif(strlen(substr(strrchr($_SESSION['Adjustment'.$identifier]->Quantity, "."), 1))>$_SESSION['Adjustment' . $identifier]->DecimalPlaces){ + prnMsg(_('The decimal places input is more than the decimals of this item defined,the defined decimal places is ').' '.$_SESSION['Adjustment' . $identifier]->DecimalPlaces.' '._('and the input decimal places is ').' '.strlen(substr(strrchr($_SESSION['Adjustment'.$identifier]->Quantity, "."), 1)),'error'); + $InputError = true; } elseif ($_SESSION['Adjustment' . $identifier]->Quantity==0){ prnMsg( _('The quantity entered cannot be zero') . '. ' . _('There would be no adjustment to make'),'error'); $InputError = true; @@ -527,4 +530,4 @@ </div> </form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> |