From: <dai...@us...> - 2012-02-07 07:27:38
|
Revision: 4883 http://web-erp.svn.sourceforge.net/web-erp/?rev=4883&view=rev Author: daintree Date: 2012-02-07 07:27:32 +0000 (Tue, 07 Feb 2012) Log Message: ----------- Ricards new parameter for StandardCostDecimalPlaces Modified Paths: -------------- trunk/SelectProduct.php trunk/StockCostUpdate.php trunk/SystemParameters.php trunk/doc/Change.log trunk/sql/mysql/upgrade4.06-4.07.sql Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2012-02-07 06:56:18 UTC (rev 4882) +++ trunk/SelectProduct.php 2012-02-07 07:27:32 UTC (rev 4883) @@ -195,7 +195,7 @@ $Cost = $myrow['cost']; } echo '<th class="number">' . _('Cost') . '</th> - <td class="select">' . locale_number_format($Cost, $_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; + <td class="select">' . locale_number_format($Cost, $_SESSION['StandardCostDecimalPlaces']) . '</td>'; } //end of if PricesSecuirty allows viewing of prices echo '</table>'; //end of first nested table // Item Category Property mod: display the item properties Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2012-02-07 06:56:18 UTC (rev 4882) +++ trunk/StockCostUpdate.php 2012-02-07 07:27:32 UTC (rev 4883) @@ -149,10 +149,10 @@ echo '<input type="hidden" name="QOH" value="' . $myrow['totalqoh'] .'" />'; echo '<tr><td>' . _('Last Cost') .':</td> - <td class="number">' . locale_number_format($myrow['lastcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td class="number">' . locale_number_format($myrow['lastcost'],$_SESSION['StandardCostDecimalPlaces']) . '</td></tr>'; if (! in_array($UpdateSecurity,$_SESSION['AllowedPageSecurityTokens'])){ echo '<tr><td>' . _('Cost') . ':</td> - <td class="number">' . locale_number_format($myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost'],$_SESSION['StandardCostDecimalPlaces']) . '</td> </tr> </table>'; } else { @@ -160,20 +160,20 @@ if ($myrow['mbflag']=='M'){ echo '<input type="hidden" name="MaterialCost" value="' . $myrow['materialcost'] . '" />'; echo '<tr><td>' . _('Standard Material Cost Per Unit') .':</td> - <td class="number">' . locale_number_format($myrow['materialcost'],4) . '</td> + <td class="number">' . locale_number_format($myrow['materialcost'],$_SESSION['StandardCostDecimalPlaces']) . '</td> </tr>'; echo '<tr> <td>' . _('Standard Labour Cost Per Unit') . ':</td> - <td class="number"><input type="text" class="number" name="LabourCost" value="' . locale_number_format($myrow['labourcost'],4) . '" /></td> + <td class="number"><input type="text" class="number" name="LabourCost" value="' . locale_number_format($myrow['labourcost'],$_SESSION['StandardCostDecimalPlaces']) . '" /></td> </tr>'; echo '<tr> <td>' . _('Standard Overhead Cost Per Unit') . ':</td> - <td class="number"><input type="text" class="number" name="OverheadCost" value="' . locale_number_format($myrow['overheadcost'],4) . '" /></td> + <td class="number"><input type="text" class="number" name="OverheadCost" value="' . locale_number_format($myrow['overheadcost'],$_SESSION['StandardCostDecimalPlaces']) . '" /></td> </tr>'; } elseif ($myrow['mbflag']=='B' OR $myrow['mbflag']=='D') { echo '<tr> <td>' . _('Standard Cost') .':</td> - <td class="number"><input type="text" class="number" name="MaterialCost" value="' . locale_number_format($myrow['materialcost'],4) . '" /></td> + <td class="number"><input type="text" class="number" name="MaterialCost" value="' . locale_number_format($myrow['materialcost'],$_SESSION['StandardCostDecimalPlaces']) . '" /></td> </tr>'; } else { echo '<input type="hidden" name="LabourCost" value="0" />'; Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2012-02-07 06:56:18 UTC (rev 4882) +++ trunk/SystemParameters.php 2012-02-07 07:27:32 UTC (rev 4883) @@ -43,6 +43,10 @@ } elseif (mb_strlen($_POST['X_FreightChargeAppliesIfLessThan']) > 12 || !is_numeric($_POST['X_FreightChargeAppliesIfLessThan']) ) { $InputError = 1; prnMsg(_('Freight Charge Applies If Less Than must be a number'),'error'); + } elseif ( !is_numeric($_POST['X_StandardCostDecimalPlaces']) || + $_POST['X_StandardCostDecimalPlaces'] < 0 || $_POST['X_StandardCostDecimalPlaces'] > 4 ) { + $InputError = 1; + prnMsg(_('Standard Cost Decimal Places must be a number between 0 and 4'),'error'); } elseif (mb_strlen($_POST['X_NumberOfPeriodsOfStockUsage']) > 2 || !is_numeric($_POST['X_NumberOfPeriodsOfStockUsage']) || $_POST['X_NumberOfPeriodsOfStockUsage'] < 1 || $_POST['X_NumberOfPeriodsOfStockUsage'] > 12 ) { $InputError = 1; @@ -153,6 +157,9 @@ if ($_SESSION['CountryOfOperation'] != $_POST['X_CountryOfOperation'] ) { $sql[] = "UPDATE config SET confvalue = '". $_POST['X_CountryOfOperation'] ."' WHERE confname = 'CountryOfOperation'"; } + if ($_SESSION['StandardCostDecimalPlaces'] != $_POST['X_StandardCostDecimalPlaces'] ) { + $sql[] = "UPDATE config SET confvalue = '".$_POST['X_StandardCostDecimalPlaces']."' WHERE confname = 'StandardCostDecimalPlaces'"; + } if ($_SESSION['NumberOfPeriodsOfStockUsage'] != $_POST['X_NumberOfPeriodsOfStockUsage'] ) { $sql[] = "UPDATE config SET confvalue = '".$_POST['X_NumberOfPeriodsOfStockUsage']."' WHERE confname = 'NumberOfPeriodsOfStockUsage'"; } @@ -599,6 +606,13 @@ echo '</select></td> <td>' . _('This parameter is only effective if Do Freight Calculation is set to Yes. Country names come from the currencies table.') .'</td></tr>'; +// StandardCostDecimalPlaces +echo '<tr style="outline: 1px solid"><td>' . _('Standard Cost Decimal Places') . ':</td> + <td><select name="X_StandardCostDecimalPlaces">'; +for ($i=0; $i <= 4; $i++ ) + echo '<option '.($_SESSION['StandardCostDecimalPlaces'] == $i?'selected ':'').'value="'.$i.'">'.$i; +echo '</select></td><td>' . _('Decimal Places to be used in Standard Cost') .'</td></tr>'; + // NumberOfPeriodsOfStockUsage echo '<tr style="outline: 1px solid"><td>' . _('Number Of Periods Of StockUsage') . ':</td> <td><select name="X_NumberOfPeriodsOfStockUsage">'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-02-07 06:56:18 UTC (rev 4882) +++ trunk/doc/Change.log 2012-02-07 07:27:32 UTC (rev 4883) @@ -1,5 +1,6 @@ webERP Change Log +7/2/12 Ricard: Made new system parameter for StandardCostDecimalPlaces - reworked SelectProduct.php and StockCostUpdate.php to use the new parameter. Modified SystemParameters.php to allow the parameter to be a number between 0 and 4 inclusive. 7/2/12 Phil: Reworked ReorderLevelLocation.php 7/2/12 Phil: StockTransfers.php if SESSION['Transfer'][0] not set then now initiate a new transfer 7/2/12 Exson: Sent NewTransfer with call from SelectProduct.php to ensure new transfer initiated Modified: trunk/sql/mysql/upgrade4.06-4.07.sql =================================================================== --- trunk/sql/mysql/upgrade4.06-4.07.sql 2012-02-07 06:56:18 UTC (rev 4882) +++ trunk/sql/mysql/upgrade4.06-4.07.sql 2012-02-07 07:27:32 UTC (rev 4883) @@ -33,4 +33,6 @@ ALTER TABLE `www_users` ADD `cancreatetender` tinyint(1) NOT NULL DEFAULT 0 AFTER `fullaccess`; INSERT INTO `systypes` (`typeid`, `typename`, `typeno`) VALUES (37, 'Tenders', 0); +INSERT INTO `config` VALUES ('StandardCostDecimalPlaces','2'); + UPDATE config SET confvalue='4.07.0' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |