From: <tim...@us...> - 2012-02-28 11:00:05
|
Revision: 4988 http://web-erp.svn.sourceforge.net/web-erp/?rev=4988&view=rev Author: tim_schofield Date: 2012-02-28 10:59:54 +0000 (Tue, 28 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/BankReconciliation.php Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2012-02-28 10:59:09 UTC (rev 4987) +++ trunk/BankReconciliation.php 2012-02-28 10:59:54 UTC (rev 4988) @@ -25,11 +25,11 @@ if (!is_numeric($_POST['BankStatementBalance'])){ prnMsg(_('The entry in the bank statement balance is not numeric. The balance on the bank statement should be entered. The exchange difference has not been calculated and no general ledger journal has been created'),'warn'); - echo '<p>' . $_POST['BankStatementBalance']; + echo '<br />' . $_POST['BankStatementBalance']; } else { /* Now need to get the currency of the account and the current table ex rate */ - $SQL = "SELECT rate, + $SQL = "SELECT rate, bankaccountname, decimalplaces AS currdecimalplaces FROM bankaccounts INNER JOIN currencies @@ -39,7 +39,7 @@ $ErrMsg = _('Could not retrieve the exchange rate for the selected bank account'); $CurrencyResult = DB_query($SQL,$db); $CurrencyRow = DB_fetch_array($CurrencyResult); - + $CalculatedBalance = filter_number_format($_POST['DoExchangeDifference']); $ExchangeDifference = ($CalculatedBalance - filter_number_format($_POST['BankStatementBalance']))/$CurrencyRow['rate']; @@ -141,16 +141,16 @@ /*Get the balance of the bank account concerned */ - $sql = "SELECT MAX(period) - FROM chartdetails + $sql = "SELECT MAX(period) + FROM chartdetails WHERE accountcode='" . $_POST['BankAccount']."'"; $PrdResult = DB_query($sql, $db); $myrow = DB_fetch_row($PrdResult); $LastPeriod = $myrow[0]; $SQL = "SELECT bfwd+actual AS balance - FROM chartdetails - WHERE period='" . $LastPeriod . "' + FROM chartdetails + WHERE period='" . $LastPeriod . "' AND accountcode='" . $_POST['BankAccount']."'"; $ErrMsg = _('The bank account balance could not be returned by the SQL because'); @@ -175,7 +175,7 @@ echo '<table class="selection"> <tr class="EvenTableRows"> <td colspan="6"><b>' . $CurrencyRow['bankaccountname'] . ' ' . _('Balance as at') . ' ' . Date($_SESSION['DefaultDateFormat']); - + if ($_SESSION['CompanyRecord']['currencydefault']!=$CurrencyRow['currcode']){ echo ' (' . $CurrencyRow['currcode'] . ' @ ' . $CurrencyRow['rate'] .')'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-28 11:00:05
|
Revision: 4988 http://web-erp.svn.sourceforge.net/web-erp/?rev=4988&view=rev Author: tim_schofield Date: 2012-02-28 10:59:54 +0000 (Tue, 28 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/BankReconciliation.php Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2012-02-28 10:59:09 UTC (rev 4987) +++ trunk/BankReconciliation.php 2012-02-28 10:59:54 UTC (rev 4988) @@ -25,11 +25,11 @@ if (!is_numeric($_POST['BankStatementBalance'])){ prnMsg(_('The entry in the bank statement balance is not numeric. The balance on the bank statement should be entered. The exchange difference has not been calculated and no general ledger journal has been created'),'warn'); - echo '<p>' . $_POST['BankStatementBalance']; + echo '<br />' . $_POST['BankStatementBalance']; } else { /* Now need to get the currency of the account and the current table ex rate */ - $SQL = "SELECT rate, + $SQL = "SELECT rate, bankaccountname, decimalplaces AS currdecimalplaces FROM bankaccounts INNER JOIN currencies @@ -39,7 +39,7 @@ $ErrMsg = _('Could not retrieve the exchange rate for the selected bank account'); $CurrencyResult = DB_query($SQL,$db); $CurrencyRow = DB_fetch_array($CurrencyResult); - + $CalculatedBalance = filter_number_format($_POST['DoExchangeDifference']); $ExchangeDifference = ($CalculatedBalance - filter_number_format($_POST['BankStatementBalance']))/$CurrencyRow['rate']; @@ -141,16 +141,16 @@ /*Get the balance of the bank account concerned */ - $sql = "SELECT MAX(period) - FROM chartdetails + $sql = "SELECT MAX(period) + FROM chartdetails WHERE accountcode='" . $_POST['BankAccount']."'"; $PrdResult = DB_query($sql, $db); $myrow = DB_fetch_row($PrdResult); $LastPeriod = $myrow[0]; $SQL = "SELECT bfwd+actual AS balance - FROM chartdetails - WHERE period='" . $LastPeriod . "' + FROM chartdetails + WHERE period='" . $LastPeriod . "' AND accountcode='" . $_POST['BankAccount']."'"; $ErrMsg = _('The bank account balance could not be returned by the SQL because'); @@ -175,7 +175,7 @@ echo '<table class="selection"> <tr class="EvenTableRows"> <td colspan="6"><b>' . $CurrencyRow['bankaccountname'] . ' ' . _('Balance as at') . ' ' . Date($_SESSION['DefaultDateFormat']); - + if ($_SESSION['CompanyRecord']['currencydefault']!=$CurrencyRow['currcode']){ echo ' (' . $CurrencyRow['currcode'] . ' @ ' . $CurrencyRow['rate'] .')'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2015-04-03 15:41:25
|
Revision: 7258 http://sourceforge.net/p/web-erp/reponame/7258 Author: vvs2012 Date: 2015-04-03 15:41:23 +0000 (Fri, 03 Apr 2015) Log Message: ----------- Show bank reconciliation balance for the current period. Modified Paths: -------------- trunk/BankReconciliation.php Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2015-04-01 11:25:51 UTC (rev 7257) +++ trunk/BankReconciliation.php 2015-04-03 15:41:23 UTC (rev 7258) @@ -149,16 +149,11 @@ /*Get the balance of the bank account concerned */ - $sql = "SELECT MAX(period) - FROM chartdetails - WHERE accountcode='" . $_POST['BankAccount']."'"; - $PrdResult = DB_query($sql); - $myrow = DB_fetch_row($PrdResult); - $LastPeriod = $myrow[0]; + $PeriodNo = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); $SQL = "SELECT bfwd+actual AS balance FROM chartdetails - WHERE period='" . $LastPeriod . "' + WHERE period='" . $PeriodNo . "' AND accountcode='" . $_POST['BankAccount']."'"; $ErrMsg = _('The bank account balance could not be returned by the SQL because'); |