Sales -> Reports -> Taxable Sales
with From = 1/1/2012 and To 31/3/2012
gives the following error
Error!
*
SELECT gl.transdate, gl.id, gl.invnumber, e.name, e.id as entity_id,
eca.id as credit_id, eca.meta_number, gl.netamount,
sum(CASE WHEN a.id IS NOT NULL then ac.amount ELSE 0 END) as tax,
gl.invoice, gl.netamount
+ sum(CASE WHEN a.id IS NOT NULL then ac.amount ELSE 0 END) as total
FROM (select id, transdate, amount, netamount, entity_credit_account,
invnumber, invoice
from ar where ? = 2
UNION
select id, transdate, amount, netamount, entity_credit_account,
invnumber, invoice
from ap where ? = 1) gl
JOIN entity_credit_account eca ON eca.id = gl.entity_credit_account
JOIN entity e ON eca.entity_id = e.id
JOIN acc_trans ac ON ac.trans_id = gl.id
LEFT JOIN (select * from account where tax is true and accno = ?
UNION
SELECT * from account where tax is true and ? is null
) a on a.id = ac.chart_id
LEFT JOIN dpt_trans dpt ON (gl.id = dpt.trans_id)
WHERE (? is null or dpt.department_id = ?)
AND (gl.transdate >= ? or ? is null)
AND (gl.transdate <= ? or ? is null)
GROUP BY gl.transdate, gl.id, gl.invnumber, e.name, e.id, eca.id,
eca.meta_number, gl.amount, gl.netamount, gl.invoice
HAVING (sum(CASE WHEN a.id is not null then ac.amount else 0 end)
<> 0 AND ? IS NOT NULL)
OR (? IS NULL and sum(CASE WHEN a.id is not null then ac.amount
ELSE 0 END) = 0)
ERROR: date/time field value out of range: "31/3/2012"
LINE 25: AND (gl.transdate <= '31/3/2012' or '31/3/2012' is...
^
HINT: Perhaps you need a different "datestyle" setting.*
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ledger-smb-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel