changes in account statement output
This commit is contained in:
parent
06e8a2f4bf
commit
18cd0eeebc
@ -79,6 +79,16 @@ order by error
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
count_entries = dbGetMany(
|
||||||
|
dbh,
|
||||||
|
{
|
||||||
|
"statement": "select extract(month from created_at) as month, count(*) as count from account_statement_v where extract(year from created_at) = %(year)s group by month",
|
||||||
|
"params": {
|
||||||
|
"year": year
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
raw_total = sum_total['sum']
|
raw_total = sum_total['sum']
|
||||||
logger.info(f"{raw_total=}")
|
logger.info(f"{raw_total=}")
|
||||||
err1 = sum_error[0]['sum']
|
err1 = sum_error[0]['sum']
|
||||||
@ -89,10 +99,10 @@ order by error
|
|||||||
logger.info(f"{err3=}")
|
logger.info(f"{err3=}")
|
||||||
err4 = sum_error[3]['sum']
|
err4 = sum_error[3]['sum']
|
||||||
logger.info(f"{err4=}")
|
logger.info(f"{err4=}")
|
||||||
adjusted_total = raw_total - err1 + err2 - err3 + err4
|
adjusted_total = raw_total + err1 - err2 - err3 + err4
|
||||||
logger.info(f"{adjusted_total=}")
|
logger.info(f"{adjusted_total=}")
|
||||||
|
|
||||||
template = getParam(params, 'template', 'accountStatement.tmpl')
|
template = getParam(params, 'template', 'accountStatement.tmpl')
|
||||||
input = { 'year': year, 'entries': accountEntries, 'overview': overview, 'related': sum_related, 'unrelated': sum_unrelated, 'total': sum_total, 'errors': sum_error, 'adjusted_total' :adjusted_total }
|
input = { 'year': year, 'entries': accountEntries, 'overview': overview, 'related': sum_related, 'unrelated': sum_unrelated, 'total': sum_total, 'errors': sum_error, 'adjusted_total' :adjusted_total, 'count_entries': count_entries }
|
||||||
tmpl = Template(file=template, searchList=[ input ])
|
tmpl = Template(file=template, searchList=[ input ])
|
||||||
print(tmpl)
|
print(tmpl)
|
||||||
|
@ -69,5 +69,15 @@
|
|||||||
\hline \hline
|
\hline \hline
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
|
|
||||||
|
\pagebreak
|
||||||
|
\subsection*{Counts}
|
||||||
|
|
||||||
|
\begin{tabular}{|r|r|} \hline
|
||||||
|
\hline \textcolor{blue}{\bf{Month}} & \textcolor{blue}{\bf{Count}} \\
|
||||||
|
#for $entry in $count_entries
|
||||||
|
\hline \tt{$entry['month']} & \tt{$entry['count']} \\
|
||||||
|
#end for
|
||||||
|
\hline \hline
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user