error fixed in cost center wise expense report

This commit is contained in:
Nabin Hait 2012-06-22 14:32:56 +05:30
parent 1f5a58eed7
commit bceec1cbef

View File

@ -1,12 +1,20 @@
SELECT `tabGL Entry`.`cost_center`,`tabAccount`.`parent_account`,sum(`tabGL Entry`.`debit`),sum(`tabGL Entry`.`credit`),sum(`tabGL Entry`.`debit`)-sum(`tabGL Entry`.`credit`) SELECT
FROM `tabGL Entry`,`tabAccount` `tabGL Entry`.`cost_center`,
WHERE `tabGL Entry`.`account`=`tabAccount`.`name` `tabAccount`.`parent_account`,
AND ifnull(`tabGL Entry`.`is_cancelled`,'No')='No' sum(ifnull(`tabGL Entry`.`debit`, 0)),
AND `tabAccount`.is_pl_account='Yes' sum(ifnull(`tabGL Entry`.`credit`, 0)),
AND `tabAccount`.debit_or_credit='Debit' sum(ifnull(`tabGL Entry`.`debit`,0))-sum(ifnull(`tabGL Entry`.`credit`, 0))
AND `tabGL Entry`.`posting_date`>='%(posting_date)s' FROM
AND `tabGL Entry`.`posting_date`<='%(posting_date1)s' `tabGL Entry`,`tabAccount`
AND `tabGL Entry`.`company` LIKE '%(company)s%%' WHERE
AND `tabAccount`.`parent_account` LIKE '%(account)s%%' `tabGL Entry`.`account`=`tabAccount`.`name`
AND `tabGL Entry`.`cost_center` LIKE '%(cost_center)s%%' AND ifnull(`tabGL Entry`.`is_cancelled`,'No')='No'
GROUP BY `tabGL Entry`.`cost_center` , `tabAccount`.`parent_account` AND `tabAccount`.is_pl_account='Yes'
AND `tabAccount`.debit_or_credit='Debit'
AND `tabGL Entry`.`posting_date`>='%(posting_date)s'
AND `tabGL Entry`.`posting_date`<='%(posting_date1)s'
AND `tabGL Entry`.`company` LIKE '%(company)s%%'
AND `tabAccount`.`parent_account` LIKE '%(account)s%%'
AND `tabGL Entry`.`cost_center` LIKE '%(cost_center)s%%'
GROUP BY
`tabGL Entry`.`cost_center` , `tabAccount`.`parent_account`