From: <ex...@us...> - 2014-10-06 11:14:26
|
Revision: 6909 http://sourceforge.net/p/web-erp/reponame/6909 Author: exsonqu Date: 2014-10-06 11:14:18 +0000 (Mon, 06 Oct 2014) Log Message: ----------- 06/10/14 Exson: Fixed the prices or line total variance in invoice for foreign currencies. Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/sql/mysql/upgrade4.11-4.12.sql Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2014-10-06 05:13:27 UTC (rev 6908) +++ trunk/ConfirmDispatch_Invoice.php 2014-10-06 11:14:18 UTC (rev 6909) @@ -1071,7 +1071,8 @@ } /* end of its an assembly */ // Insert stock movements - with unit cost - $LocalCurrencyPrice = round(($OrderLine->Price / $_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']); + //$LocalCurrencyPrice = round(($OrderLine->Price / $_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']); change decimalplaces to 5 to avoid price or lines total variance on invoice. And the decimal places should not be over 5 since the stockmoves table defined it as decimal(21,5) now. + $LocalCurrencyPrice = round(($OrderLine->Price / $_SESSION['CurrencyRate']),5); if (empty($OrderLine->StandardCost)) { $OrderLine->StandardCost=0; Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-10-06 05:13:27 UTC (rev 6908) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-10-06 11:14:18 UTC (rev 6909) @@ -83,6 +83,7 @@ ALTER TABLE `locations` ADD `usedforwo` TINYINT( 4 ) NOT NULL DEFAULT '1' AFTER `internalrequest`; ALTER TABLE `bankaccounts` ADD `importformat` VARCHAR( 10 ) NOT NULL DEFAULT ''; ALTER TABLE `audittrail` ADD INDEX ( `transactiondate` ); +ALTER TABLE stockmoves MODIFY price DECIMAL(21,5) NOT NULL DEFAULT '0.00000'; UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber'; |