- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / weberp / Z_CurrencyDebtorsBalances.php
blob342a817a5cae59c73a23068d7c8c4ab76fd5852e
1 <?php
2 /* $Revision: 1.5 $ */
3 $PageSecurity=15;
5 include('includes/session.inc');
6 $title=_('Currency Debtor Balances');
7 include('includes/header.inc');
9 echo '<FONT SIZE=4><B>' . _('Debtors Balances By Currency Totals') . '</B></FONT>';
11 $sql = 'SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight-alloc) AS currencybalance,
12 currcode,
13 SUM((ovamount+ovgst+ovdiscount+ovfreight-alloc)/rate) AS localbalance
14 FROM debtortrans INNER JOIN debtorsmaster
15 ON debtortrans.debtorno=debtorsmaster.debtorno
16 WHERE (ovamount+ovgst+ovdiscount+ovfreight-alloc)<>0 GROUP BY currcode';
18 $result = DB_query($sql,$db);
21 $LocalTotal =0;
23 echo '<TABLE>';
25 while ($myrow=DB_fetch_array($result)){
27 echo '<TR><TD><FONT SIZE=4>' . _('Total Debtor Balances in') . ' </FONT></TD>
28 <TD><FONT SIZE=4>' . $myrow['currcode'] . '</FONT></TD>
29 <TD ALIGN=RIGHT><FONT SIZE=4>' . number_format($myrow['currencybalance'],2) . '</FONT></TD>
30 <TD><FONT SIZE=4> in ' . $_SESSION['CompanyRecord']['currencydefault'] . '</FONT></TD>
31 <TD ALIGN=RIGHT><FONT SIZE=4>' . number_format($myrow['localbalance'],2) . '</FONT></TD></TR>';
32 $LocalTotal += $myrow['localbalance'];
35 echo '<TR><TD COLSPAN=4><FONT SIZE=4>' . _('Total Balances in local currency') . ':</FONT></TD>
36 <TD ALIGN=RIGHT><FONT SIZE=4>' . number_format($LocalTotal,2) . '</FONT></TD></TR>';
38 echo '</TABLE>';
40 include('includes/footer.inc');