[Weberp-svn] SF.net SVN: weberp:[8103] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-09-06 09:13:48
|
Revision: 8103 http://weberp.svn.sourceforge.net/weberp/?rev=8103&view=rev Author: tim_schofield Date: 2011-09-06 09:13:42 +0000 (Tue, 06 Sep 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/StockAdjustments.php trunk/includes/DefineStockAdjustment.php Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-09-06 09:13:31 UTC (rev 8102) +++ trunk/StockAdjustments.php 2011-09-06 09:13:42 UTC (rev 8103) @@ -45,9 +45,12 @@ $_SESSION['Adjustment']->tag = $_POST['tag']; $_SESSION['Adjustment']->Narrative = $_POST['Narrative']; $_SESSION['Adjustment']->StockLocation = $_POST['StockLocation']; - if ($_POST['Quantity']=='' or !is_numeric($_POST['Quantity'])){ + if ($_POST['Quantity']==''){ $_POST['Quantity']=0; + } else { + $_POST['Quantity'] = filter_number_input($_POST['Quantity']); } +echo $_POST['Quantity']; $_SESSION['Adjustment']->Quantity = $_POST['Quantity']; } @@ -382,12 +385,12 @@ if ($_SESSION['Adjustment']->StockLocation == ''){ $_SESSION['Adjustment']->StockLocation = $_SESSION['UserStockLocation']; } - echo '<input type="HIDDEN" name="Quantity" value="' . $_SESSION['Adjustment']->Quantity . '" /> - '.$_SESSION['Adjustment']->Quantity.' + echo '<input type="hidden" name="Quantity" value="' . stock_number_format($_SESSION['Adjustment']->Quantity , $_SESSION['Adjustment']->DecimalPlaces). '" /> + '.stock_number_format($_SESSION['Adjustment']->Quantity, $_SESSION['Adjustment']->DecimalPlaces).' [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE">'._('Remove').'</a>] [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD">'._('Add').'</a>]'; } else { - echo '<input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . $Quantity . '" />'; + echo '<input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . stock_number_format($Quantity, $_SESSION['Adjustment']->DecimalPlaces) . '" />'; } echo '</td></tr>'; //Select the tag Modified: trunk/includes/DefineStockAdjustment.php =================================================================== --- trunk/includes/DefineStockAdjustment.php 2011-09-06 09:13:31 UTC (rev 8102) +++ trunk/includes/DefineStockAdjustment.php 2011-09-06 09:13:42 UTC (rev 8103) @@ -2,31 +2,31 @@ /* $Id$*/ class StockAdjustment { - var $StockID; - Var $StockLocation; - var $Controlled; - var $Serialised; - var $ItemDescription; - Var $PartUnit; - Var $StandardCost; - Var $DecimalPlaces; - Var $Quantity; - var $tag; - var $SerialItems; /*array to hold controlled items*/ + var $StockID; + var $StockLocation; + var $Controlled; + var $Serialised; + var $ItemDescription; + var $PartUnit; + var $StandardCost; + var $DecimalPlaces; + var $Quantity; + var $tag; + var $SerialItems; /*array to hold controlled items*/ - //Constructor - function StockAdjustment(){ - $this->StockID = ''; - $this->StockLocation = ''; - $this->Controlled = ''; - $this->Serialised = ''; - $this->ItemDescription = ''; - $this->PartUnit = ''; - $this->StandardCost = 0; - $this->DecimalPlaces = 0; - $this->SerialItems = array(); - $Quantity =0; - $this->tag=0; - } + //Constructor + function StockAdjustment(){ + $this->StockID = ''; + $this->StockLocation = ''; + $this->Controlled = ''; + $this->Serialised = ''; + $this->ItemDescription = ''; + $this->PartUnit = ''; + $this->StandardCost = 0; + $this->DecimalPlaces = 0; + $this->SerialItems = array(); + $Quantity =0; + $this->tag=0; + } } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |