- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / weberp / Z_CheckAllocationsFrom.php
blob40c5228e1ec2f11bb3547167e263b78585f02610
1 <?php
2 /* $Revision: 1.5 $ */
4 $PageSecurity = 15;
5 include ('includes/session.inc');
6 $title = _('Identify Allocation Stuff Ups');
7 include ('includes/header.inc');
9 $sql = 'SELECT debtortrans.type,
10 debtortrans.transno,
11 debtortrans.ovamount,
12 debtortrans.alloc,
13 SUM(custallocns.amt) AS totallocfrom
14 FROM debtortrans,
15 custallocns
16 WHERE transid_allocfrom=debtortrans.id
17 GROUP BY debtortrans.type,
18 debtortrans.transno,
19 debtortrans.ovamount,
20 debtortrans.alloc
21 HAVING SUM(custallocns.amt) < -alloc';
23 $result =DB_query($sql,$db);
25 if (DB_num_rows($result)>0){
26 echo '<TABLE><TR>
27 <TD>' . _('Type') . '</TD>
28 <TD>' . _('Trans No') . '</TD>
29 <TD>' . _('Ov Amt') . '</TD>
30 <TD>' . _('Allocated') . '</TD>
31 <TD>' . _('Tot Allcns') . '</TD></TR>';
33 $RowCounter =0;
34 while ($myrow=DB_fetch_array($result)){
37 printf ('<TR>
38 <TD>%s</TD>
39 <TD>%s<TD ALIGN=RIGHT>%f.2</TD>
40 <TD ALIGN=RIGHT>%f.2</TD>
41 <TD ALIGN=RIGHT>%f.2</TD>
42 </TR>',
43 $myrow['type'],
44 $myrow['transno'],
45 $myrow['ovamount'],
46 $myrow['alloc'],
47 $myrow['totallocfrom']);
48 $RowCounter++;
49 if ($RowCounter==20){
50 echo '<TR><TD>' . _('Type') . '</TD>
51 <TD>' . _('Trans No') . '</TD>
52 <TD>' . _('Ov Amt') . '</TD>
53 <TD>' . _('Allocated') . '</TD>
54 <TD>' . _('Tot Allcns') . '</TD></TR>';
55 $RowCounter=0;
58 echo '</TABLE>';
59 } else {
60 prnMsg(_('There are no inconsistent allocations') . ' - ' . _('all is well'),'info');
63 include('includes/footer.inc');