"statement":"select sum(amount), category from account_statement_v where fiscal_year = %(year)s group by category",
"params":{
'year':year
}
}
)
sum_related=dbGetOne(
dbh,
{
"statement":"select coalesce(sum(amount), 0::numeric(10,2)) as sum from account_statement_v where fiscal_year = %(year)s and category != 'nicht abrechenbare Positionen'",
"params":{
'year':year
}
}
)
sum_unrelated=dbGetOne(
dbh,
{
"statement":"select coalesce(sum(amount), 0::numeric(10,2)) as sum from account_statement_v where fiscal_year = %(year)s and category = 'nicht abrechenbare Positionen'",
"statement":"select sum(amount) as sum from account_statement_v where fiscal_year = %(year)s",
"params":{
'year':year
}
}
)
sum_error=dbGetMany(
dbh,
{
"statement":"""
selectcoalesce(sum(amount),0::numeric(10,2))assum,1aserror,'booked in %(year1)s, accounted in %(year0)s'asremarkfromaccount_statement_vwherefiscal_year=%(year0)sandextract(yearfromcreated_at)=%(year1)s
union
selectcoalesce(sum(amount),0::numeric(10,2))assum,2aserror,'booked in %(year0)s, accounted in %(year1)s'asremarkfromaccount_statement_vwherefiscal_year=%(year1)sandextract(yearfromcreated_at)=%(year0)s
union
selectcoalesce(sum(amount),0::numeric(10,2))assum,3aserror,'booked in %(year2)s, accounted in %(year1)s'asremarkfromaccount_statement_vwherefiscal_year=%(year1)sandextract(yearfromcreated_at)=%(year2)s
union
selectcoalesce(sum(amount),0::numeric(10,2))assum,4aserror,'booked in %(year1)s, accounted in %(year2)s'asremarkfromaccount_statement_vwherefiscal_year=%(year2)sandextract(yearfromcreated_at)=%(year1)s