|
From: <te...@us...> - 2016-01-04 00:16:57
|
Revision: 7436
http://sourceforge.net/p/web-erp/reponame/7436
Author: tehonu
Date: 2016-01-04 00:16:55 +0000 (Mon, 04 Jan 2016)
Log Message:
-----------
Changed pow(1, to pow(10, everywhere as: pow(1,X) = 1 for any X. Made no sense.
Modified Paths:
--------------
trunk/StockCostUpdate.php
trunk/Z_UpdateItemCosts.php
trunk/includes/SQL_CommonFunctions.inc
Modified: trunk/StockCostUpdate.php
===================================================================
--- trunk/StockCostUpdate.php 2015-12-29 18:39:08 UTC (rev 7435)
+++ trunk/StockCostUpdate.php 2016-01-04 00:16:55 UTC (rev 7436)
@@ -62,7 +62,7 @@
$myrow = DB_fetch_row($result);
if (DB_num_rows($result)==0) {
prnMsg (_('The entered item code does not exist'),'error',_('Non-existent Item'));
- } elseif (abs($NewCost - $OldCost) > pow(1,-($_SESSION['StandardCostDecimalPlaces']+1))){
+ } elseif (abs($NewCost - $OldCost) > pow(10,-($_SESSION['StandardCostDecimalPlaces']+1))){
$Result = DB_Txn_Begin();
ItemCostUpdateGL($db, $StockID, $NewCost, $OldCost, $_POST['QOH']);
Modified: trunk/Z_UpdateItemCosts.php
===================================================================
--- trunk/Z_UpdateItemCosts.php 2015-12-29 18:39:08 UTC (rev 7435)
+++ trunk/Z_UpdateItemCosts.php 2016-01-04 00:16:55 UTC (rev 7436)
@@ -75,7 +75,7 @@
$OldCost = $OldRow['materialcost'] + $OldRow['labourcost'] + $OldRow['overheadcost'];
//dont update costs for assembly or kit-sets or ghost items!!
- if ((abs($NewCost - $OldCost) > pow(1,-($_SESSION['StandardCostDecimalPlaces']+1)))
+ if ((abs($NewCost - $OldCost) > pow(10,-($_SESSION['StandardCostDecimalPlaces']+1)))
AND $OldRow['mbflag']!='K'
AND $OldRow['mbflag']!='A'
AND $OldRow['mbflag']!='G'){
Modified: trunk/includes/SQL_CommonFunctions.inc
===================================================================
--- trunk/includes/SQL_CommonFunctions.inc 2015-12-29 18:39:08 UTC (rev 7435)
+++ trunk/includes/SQL_CommonFunctions.inc 2016-01-04 00:16:55 UTC (rev 7436)
@@ -160,7 +160,7 @@
function ItemCostUpdateGL($db, $StockID, $NewCost, $OldCost, $QOH) {
if ($_SESSION['CompanyRecord']['gllink_stock']==1
AND $QOH!=0
- AND (abs($NewCost - $OldCost) > pow(1,-($_SESSION['StandardCostDecimalPlaces']+1)))){
+ AND (abs($NewCost - $OldCost) > pow(10,-($_SESSION['StandardCostDecimalPlaces']+1)))){
$CostUpdateNo = GetNextTransNo(35, $db);
$PeriodNo = GetPeriod(date($_SESSION['DefaultDateFormat']), $db);
|