5 include ('includes/session.inc');
6 $title = _('Identify Allocation Stuff Ups');
7 include ('includes/header.inc');
9 $sql = 'SELECT debtortrans.type,
13 SUM(custallocns.amt) AS totallocfrom
16 WHERE transid_allocfrom=debtortrans.id
17 GROUP BY debtortrans.type,
21 HAVING SUM(custallocns.amt) < -alloc';
23 $result =DB_query($sql,$db);
25 if (DB_num_rows($result)>0){
27 <TD>' . _('Type') . '</TD>
28 <TD>' . _('Trans No') . '</TD>
29 <TD>' . _('Ov Amt') . '</TD>
30 <TD>' . _('Allocated') . '</TD>
31 <TD>' . _('Tot Allcns') . '</TD></TR>';
34 while ($myrow=DB_fetch_array($result)){
39 <TD>%s<TD ALIGN=RIGHT>%f.2</TD>
40 <TD ALIGN=RIGHT>%f.2</TD>
41 <TD ALIGN=RIGHT>%f.2</TD>
47 $myrow['totallocfrom']);
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>';
60 prnMsg(_('There are no inconsistent allocations') . ' - ' . _('all is well'),'info');
63 include('includes/footer.inc');