forked from webERP-team/webERP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Z_CheckGLTransBalance.php
61 lines (49 loc) · 1.52 KB
/
Z_CheckGLTransBalance.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
include('includes/session.php');
$Title=_('Check Period Sales Ledger Control Account');
include('includes/header.php');
echo '<table>';
$Header = '<tr>
<th>' . _('Date') . '</th>
<th>' . _('Type') . '</th>
<th>' . _('Number') . '</th>
<th>' . _('Period') . '</th>
<th>' . _('Difference') . '</th>
</tr>';
echo $Header;
$sql = "SELECT gltrans.type,
gltrans.trandate,
systypes.typename,
gltrans.typeno,
periodno,
SUM(amount) AS nettot
FROM gltrans
INNER JOIN chartmaster ON
gltrans.account=chartmaster.accountcode
INNER JOIN systypes ON gltrans.type = systypes.typeid
GROUP BY gltrans.type,
systypes.typename,
typeno,
periodno
HAVING ABS(SUM(amount))>= " . 1/pow(10,$_SESSION['CompanyRecord']['decimalplaces']) . "
ORDER BY gltrans.counterindex";
$OutOfWackResult = DB_query($sql);
$RowCounter =0;
while ($OutOfWackRow = DB_fetch_array($OutOfWackResult)){
if ($RowCounter==18){
$RowCounter=0;
echo $Header;
} else {
$RowCounter++;
}
echo '<tr>
<td>' . ConvertSQLDate($OutOfWackRow['trandate']) . '</td>
<td><a href="' . $RootPath . '/GLTransInquiry.php?TypeID=' . $OutOfWackRow['type'] . '&TransNo=' . $OutOfWackRow['typeno'] . '">' . $OutOfWackRow['typename'] . '</a></td>
<td class="number">' . $OutOfWackRow['typeno'] . '</td>
<td class="number">' . $OutOfWackRow['periodno'] . '</td>
<td class="number">' . locale_number_format($OutOfWackRow['nettot'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
}
echo '</table>';
include('includes/footer.php');
?>