From: <te...@us...> - 2013-11-29 12:32:11
|
Revision: 6456 http://sourceforge.net/p/web-erp/reponame/6456 Author: tehonu Date: 2013-11-29 12:32:08 +0000 (Fri, 29 Nov 2013) Log Message: ----------- Restriction by userid Modified Paths: -------------- trunk/DailyBankTransactions.php Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2013-11-29 07:30:02 UTC (rev 6455) +++ trunk/DailyBankTransactions.php 2013-11-29 12:32:08 UTC (rev 6456) @@ -26,8 +26,11 @@ bankaccounts.accountcode, bankaccounts.currcode FROM bankaccounts, - chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode"; + chartmaster, + bankaccountusers + WHERE bankaccounts.accountcode=chartmaster.accountcode + AND bankaccounts.accountcode=bankaccountusers.accountcode + AND bankaccountusers.userid = '" . $_SESSION['UserID'] ."'"; $ErrMsg = _('The bank accounts could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the bank accounts was'); |
From: <ex...@us...> - 2015-10-29 13:04:01
|
Revision: 7371 http://sourceforge.net/p/web-erp/reponame/7371 Author: exsonqu Date: 2015-10-29 13:03:58 +0000 (Thu, 29 Oct 2015) Log Message: ----------- 29/10/15 Exson: Add gl narrative and account balance information to DailyBankTransactions.php. Modified Paths: -------------- trunk/DailyBankTransactions.php Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2015-10-28 09:29:43 UTC (rev 7370) +++ trunk/DailyBankTransactions.php 2015-10-29 13:03:58 UTC (rev 7371) @@ -91,7 +91,11 @@ WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'"; $BankResult = DB_query($SQL,_('Could not retrieve the bank account details')); - $sql="SELECT banktrans.currcode, + + $sql="SELECT (SELECT sum(banktrans.amount) FROM banktrans + WHERE transdate < '" . FormatDateForSQL($_POST['FromTransDate']) . "' + AND bankact='" . $_POST['BankAccount'] ."') AS prebalance, + banktrans.currcode, banktrans.amount, banktrans.amountcleared, banktrans.functionalexrate, @@ -114,14 +118,26 @@ ORDER BY banktrans.transdate ASC, banktrans.banktransid ASC"; $result = DB_query($sql); + $BankDetailRow = DB_fetch_array($BankResult); if (DB_num_rows($result)==0) { echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. - '/images/bank.png" title="' .// Icon image. - _('Bank Transactions Inquiry') . '" /> ' .// Icon title. - _('Bank Transactions Inquiry') . '</p>';// Page title. + '/images/bank.png" title="' .// Icon image. + _('Bank Transactions Inquiry') . '" /> ' .// Icon title. + _('Bank Transactions Inquiry') . '</p>';// Page title. prnMsg(_('There are no transactions for this account in the date range selected'), 'info'); + + $sql = "SELECT sum(banktrans.amount) FROM banktrans WHERE bankact='" . $_POST['BankAccount'] . "'"; + $ErrMsg = _('Failed to retrive balance data'); + $balresult = DB_query($sql,$ErrMsg); + if (DB_num_rows($balresult)>0) { + $Balance = DB_fetch_row($balresult); + $Balance = $Balance[0]; + if (ABS($Balance)>0.001){ + echo '<p class="page_title_text">' . _('The Bank Account Balance Is in') . ' ' . $BankDetailRow['currcode'] . ' <span style="font-weight:bold">' . locale_number_format($Balance,$BankDetailRow['decimalplaces']) . '</span></p>'; + } + } + } else { - $BankDetailRow = DB_fetch_array($BankResult); echo '<div id="Report">';// Division to identify the report block. echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/bank.png" title="' .// Icon image. @@ -136,42 +152,91 @@ <th class="number">' . _('Number') . '</th> <th class="text">' . _('Type') . '</th> <th class="text">' . _('Reference') . '</th> - <th class="number">' . _('Amount in').' '.$BankDetailRow['currcode'] . '</th> + <th class="number">' . _('Amount in org').' '.$BankDetailRow['currcode'] . '</th> + <th class="number">' . _('Balance in') . ' ' . $BankDetailRow['currcode'] . '</th> <th class="number">' . _('Running Total').' '.$BankDetailRow['currcode'] . '</th> <th class="number">' . _('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'] . '</th> <th class="number">' . _('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'] . '</th> - <th class="number">' . _('Cleared') . '</th> + <th class="text">' . _('Cleared') . '</th> + <th class="text">' . _('GL Narrative') . '</th> </tr> </thead><tbody>'; $AccountCurrTotal=0; $LocalCurrTotal =0; - + $Balance = 0; + $j = 0; + $k = 0; while ($myrow = DB_fetch_array($result)){ + + if ($j == 0) { + if (ABS($myrow['prebalance'])>0.0001) { + if ($k == 0) { + echo '<tr class="OddTableRows">'; + $k = 1; + } else { + echo '<tr class="EvenTableRows">'; + $k = 0; + } + $Balance += $myrow['prebalance']; + echo '<td colspan="6" style="font-weight:bold">' . _('Previous Balance') . '</td> + <td class="number">' . locale_number_format($myrow['prebalance'],$BankDetailRow['decimalplaces']) . '</td> + <td colspan="5"></td></tr>'; + $j++; + } + } + if ($k == 0) { + echo '<tr class="OddTableRows">'; + $k = 1; + } else { + echo '<tr class="EvenTableRows">'; + $k = 0; + } + //check the GL narrative + $sql = "SELECT narrative FROM gltrans WHERE type='" . $myrow['typeid'] . "' AND typeno='" . $myrow['transno'] . "'"; + $ErrMsg = _('Failed to retrieve gl narrative'); + $glresult = DB_query($sql,$ErrMsg); + if (DB_num_rows($glresult)>0) { + $GLNarrative = DB_fetch_array($glresult); + $GLNarrative = $GLNarrative[0]; + } else { + $GLNarrative = 'NA'; + } + $Balance += $myrow['amount']; + $AccountCurrTotal += $myrow['amount']; $LocalCurrTotal += $myrow['amount']/$myrow['functionalexrate']/$myrow['exrate']; - + if ($myrow['amount']==$myrow['amountcleared']) { $Matched=_('Yes'); } else { $Matched=_('No'); } - echo '<tr> + echo ' <td class="centre">' . ConvertSQLDate($myrow['transdate']) . '</td> <td>' . _($myrow['typename']) . '</td> <td class="number"><a href="' . $RootPath . '/GLTransInquiry.php?TypeID=' . $myrow['typeid'] . '&TransNo=' . $myrow['transno'] . '">' . $myrow['transno'] . '</a></td> <td>' . $myrow['banktranstype'] . '</td> <td>' . $myrow['ref'] . '</td> <td class="number">' . locale_number_format($myrow['amount'],$BankDetailRow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($Balance,$BankDetailRow['decimalplaces']) . '</td> <td class="number">' . locale_number_format($AccountCurrTotal,$BankDetailRow['decimalplaces']) . '</td> <td class="number">' . locale_number_format($myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($LocalCurrTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . $Matched . '</td> + <td>' . $GLNarrative . '</td> </tr>'; } - echo '</tbody></table>'; + if ($k == 0 ) { + echo '<tr class="OddTableRows">'; + } else { + echo '<tr class="EvenTableRows">'; + } + + echo '<td colspan="6" style="font-weight:bold;">' . _('Account Balance') . '</td><td class="number" style="font-weight:bold;">' .locale_number_format($Balance,$BankDetailRow['decimalplaces']) . '</td><td colspan="5"></td></tr> + </tbody></table>'; echo '</div>';// div id="Report". } //end if no bank trans in the range to show @@ -192,4 +257,4 @@ </form>'; } include('includes/footer.inc'); -?> \ No newline at end of file +?> |
From: <ex...@us...> - 2016-06-29 05:35:25
|
Revision: 7561 http://sourceforge.net/p/web-erp/reponame/7561 Author: exsonqu Date: 2016-06-29 05:35:22 +0000 (Wed, 29 Jun 2016) Log Message: ----------- 29/06/16 Exson: Fixed bug of wrong balance in account currency and display original currency code with amount in DailyBankTransactions.php. Modified Paths: -------------- trunk/DailyBankTransactions.php Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2016-06-20 06:56:54 UTC (rev 7560) +++ trunk/DailyBankTransactions.php 2016-06-29 05:35:22 UTC (rev 7561) @@ -152,7 +152,7 @@ <th class="number">' . _('Number') . '</th> <th class="text">' . _('Type') . '</th> <th class="text">' . _('Reference') . '</th> - <th class="number">' . _('Amount in org').' '.$BankDetailRow['currcode'] . '</th> + <th class="number">' . _('Amount in org currency') . '</th> <th class="number">' . _('Balance in') . ' ' . $BankDetailRow['currcode'] . '</th> <th class="number">' . _('Running Total').' '.$BankDetailRow['currcode'] . '</th> <th class="number">' . _('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'] . '</th> @@ -203,9 +203,8 @@ } else { $GLNarrative = 'NA'; } - $Balance += $myrow['amount']; - - $AccountCurrTotal += $myrow['amount']; + $Balance += $myrow['amount']/$myrow['exrate']; + $AccountCurrTotal += $myrow['amount']/$myrow['exrate']; $LocalCurrTotal += $myrow['amount']/$myrow['functionalexrate']/$myrow['exrate']; if ($myrow['amount']==$myrow['amountcleared']) { @@ -220,7 +219,7 @@ <td class="number"><a href="' . $RootPath . '/GLTransInquiry.php?TypeID=' . $myrow['typeid'] . '&TransNo=' . $myrow['transno'] . '">' . $myrow['transno'] . '</a></td> <td>' . $myrow['banktranstype'] . '</td> <td>' . $myrow['ref'] . '</td> - <td class="number">' . locale_number_format($myrow['amount'],$BankDetailRow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($myrow['amount'],$BankDetailRow['decimalplaces']) . ' ' . $myrow['currcode'] . '</td> <td class="number">' . locale_number_format($Balance,$BankDetailRow['decimalplaces']) . '</td> <td class="number">' . locale_number_format($AccountCurrTotal,$BankDetailRow['decimalplaces']) . '</td> <td class="number">' . locale_number_format($myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> |