AND ac.trans_id IN
(
SELECT trans_id
- FROM acc_trans
- JOIN chart ON (chart_id = id)
+ FROM acc_trans a
+ JOIN chart c ON (a.chart_id = c.id)
WHERE (link LIKE '%AR_paid%')
$subwhere
)
AND ac.trans_id IN
(
SELECT trans_id
- FROM acc_trans
- JOIN chart ON (chart_id = id)
+ FROM acc_trans a
+ JOIN chart c ON (a.chart_id = c.id)
WHERE (link LIKE '%AP_paid%')
$subwhere
)
AND ac.trans_id IN
(
SELECT trans_id
- FROM acc_trans
- JOIN chart ON (chart_id = id)
+ FROM acc_trans a
+ JOIN chart c ON (a.chart_id = c.id)
WHERE (link LIKE '%AR_paid%')
$subwhere
)
AND ac.trans_id IN
(
SELECT trans_id
- FROM acc_trans
- JOIN chart ON (chart_id = id)
+ FROM acc_trans a
+ JOIN chart c ON (a.chart_id = c.id)
WHERE link LIKE '%AP_paid%'
$subwhere
)
JOIN ar a ON (a.id = ac.trans_id)
$dpt_join
WHERE $where $dpt_where
- AND ac.trans_id IN ( SELECT trans_id FROM acc_trans JOIN chart ON (chart_id = id) WHERE (link LIKE '%AR_paid%') $subwhere)
+ AND ac.trans_id IN ( SELECT trans_id FROM acc_trans a JOIN chart c ON (a.chart_id = c.id) WHERE (link LIKE '%AR_paid%') $subwhere)
$project
GROUP BY c.$category
*/
JOIN ap a ON (a.id = ac.trans_id)
$dpt_join
WHERE $where $dpt_where
- AND ac.trans_id IN ( SELECT trans_id FROM acc_trans JOIN chart ON (chart_id = id) WHERE (link LIKE '%AP_paid%') $subwhere)
+ AND ac.trans_id IN ( SELECT trans_id FROM acc_trans a JOIN chart c ON (a.chart_id = c.id) WHERE (link LIKE '%AP_paid%') $subwhere)
$project
GROUP BY c.$category
JOIN chart c on (p.income_accno_id = c.id)
$dpt_join
WHERE (c.category = 'I') $prwhere $dpt_where
- AND ac.trans_id IN ( SELECT trans_id FROM acc_trans JOIN chart ON (chart_id = id) WHERE (link LIKE '%AR_paid%') $subwhere)
+ AND ac.trans_id IN ( SELECT trans_id FROM acc_trans a JOIN chart c ON (a.chart_id = c.id) WHERE (link LIKE '%AR_paid%') $subwhere)
$project
GROUP BY c.$category
JOIN chart c on (p.expense_accno_id = c.id)
$dpt_join
WHERE (c.category = 'E') $prwhere $dpt_where
- AND ac.trans_id IN ( SELECT trans_id FROM acc_trans JOIN chart ON (chart_id = id) WHERE (link LIKE '%AP_paid%') $subwhere)
+ AND ac.trans_id IN ( SELECT trans_id FROM acc_trans a JOIN chart c ON (a.chart_id = c.id) WHERE (link LIKE '%AP_paid%') $subwhere)
$project
GROUP BY c.$category
|;
AND ac.trans_id IN
(
SELECT trans_id
- FROM acc_trans
- JOIN chart ON (chart_id = id)
+ FROM acc_trans a
+ JOIN chart c ON (a.chart_id = c.id)
WHERE (link LIKE '%${ARAP}_paid%')
AND (transdate <= $todate)
)