From: <dai...@us...> - 2013-11-20 07:27:59
|
Revision: 6422 http://sourceforge.net/p/web-erp/reponame/6422 Author: daintree Date: 2013-11-20 07:27:56 +0000 (Wed, 20 Nov 2013) Log Message: ----------- Phil: Payments.php FunctionalExchangeRate was not defaulted appropriately when entering a supplier payment in FX from a bank account of the same currency selected and the transaction was posted immediately without update first. Fixed Modified Paths: -------------- trunk/Payments.php trunk/doc/Change.log Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2013-11-19 07:21:24 UTC (rev 6421) +++ trunk/Payments.php 2013-11-20 07:27:56 UTC (rev 6422) @@ -142,15 +142,22 @@ $ErrMsg); $myrow = DB_fetch_array($result); - $_SESSION['PaymentDetail' . $identifier]->AccountCurrency=$myrow['currcode']; - $_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces=$myrow['decimalplaces']; + if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency != $myrow['currcode']) { + //then we'd better update the functional exchange rate + $DefaultFunctionalRate = true; + $_SESSION['PaymentDetail' . $identifier]->AccountCurrency = $myrow['currcode']; + $_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces = $myrow['decimalplaces']; + } else { + $DefaultFunctionalRate = false; + } +} else { + + $_SESSION['PaymentDetail' . $identifier]->AccountCurrency = $_SESSION['CompanyRecord']['currencydefault']; + $_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces = $_SESSION['CompanyRecord']['decimalplaces']; -} else { - $_SESSION['PaymentDetail' . $identifier]->AccountCurrency =$_SESSION['CompanyRecord']['currencydefault']; - $_SESSION['PaymentDetail' . $identifier]->CurrDecimalPlaces=$_SESSION['CompanyRecord']['decimalplaces']; } if (isset($_POST['DatePaid']) AND $_POST['DatePaid']!='' AND Is_Date($_POST['DatePaid'])){ - $_SESSION['PaymentDetail' . $identifier]->DatePaid=$_POST['DatePaid']; + $_SESSION['PaymentDetail' . $identifier]->DatePaid = $_POST['DatePaid']; } if (isset($_POST['ExRate']) AND $_POST['ExRate']!=''){ $_SESSION['PaymentDetail' . $identifier]->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency @@ -166,7 +173,6 @@ /* Payment currency is the currency that is being paid */ $_SESSION['PaymentDetail' . $identifier]->Currency=$_POST['Currency']; // Payment currency - if ($_SESSION['PaymentDetail' . $identifier]->AccountCurrency==$_SESSION['CompanyRecord']['currencydefault']){ $_POST['FunctionalExRate']=1; $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate=1; @@ -186,10 +192,11 @@ $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail' . $identifier]->AccountCurrency . "'",$db); $myrow = DB_fetch_row($result); $SuggestedFunctionalExRate = $myrow[0]; - + if ($DefaultFunctionalRate) { + $_SESSION['PaymentDetail' . $identifier]->FunctionalExRate = $SuggestedFunctionalExRate; + } } - if ($_POST['Currency']==$_SESSION['PaymentDetail' . $identifier]->AccountCurrency){ /* if the currency being paid is the same as the bank account currency then default ex rate to 1 */ $_POST['ExRate']=1; @@ -203,7 +210,6 @@ /*Calculate cross rate to suggest appropriate exchange rate between payment currency and account currency */ $SuggestedExRate = $TableExRate/$SuggestedFunctionalExRate; } - } if (isset($_POST['BankTransRef']) AND $_POST['BankTransRef']!=''){ // Reference on Bank Transactions Inquiry Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2013-11-19 07:21:24 UTC (rev 6421) +++ trunk/doc/Change.log 2013-11-20 07:27:56 UTC (rev 6422) @@ -1,10 +1,12 @@ webERP Change Log -2013/11/19 Thumb/CQZ: Add webERP Chinese country sql including Chinese COA, currency, role,tax, transaction type etc which should be localized. -2013/11/19 Thumb: Add '-' to telephone no pattern in CustomerBranches.php and WWW_Users.php. -2013/11/19 Thumb: Correct translation of customer text and customer code in CustomerReceipt.php of locale file. -2013/11/19 Thumb: Text 'settled transaction' position adjusted to proper position in PrintCustStatements.php. -2013/11/18 Exson: Make inventory it as default to show inventory serial no in ConfirmDispatchControlled_Invoice.php. -2013/11/18 Exson Make company name client side requirements consistent with server side in CompanyPreferences.php. + +20/11/13 Phil: Payments.php FunctionalExchangeRate was not defaulted appropriately when entering a supplier payment in FX from a bank account of the same currency selected and the transaction was posted immediately without update first. Fixed +19/11/13 Thumb/CQZ: Add webERP Chinese country sql including Chinese COA, currency, role,tax, transaction type etc which should be localized. +19/11/13 Thumb: Add '-' to telephone no pattern in CustomerBranches.php and WWW_Users.php. +19/11/13 Thumb: Correct translation of customer text and customer code in CustomerReceipt.php of locale file. +19/11/13 Thumb: Text 'settled transaction' position adjusted to proper position in PrintCustStatements.php. +18/11/13 Exson: Make inventory it as default to show inventory serial no in ConfirmDispatchControlled_Invoice.php. +18/11/13 Exson Make company name client side requirements consistent with server side in CompanyPreferences.php. 16/11/13 rchacon: Improves translation and format in PaymentMethods.php. 16/11/13 Phil: MacPhotoBiker reported shipment charges html5 type=number removed to use the class=number javascript' 12/11/13 rchacon: Allow translation of the subkey name in FormDesigner.php. |