for each="statement in records"
choose
when test="statement.state == 'draft'"
Draft Statement
/when
when test="statement.state == 'cancelled'"
Cancelled Statement
/when
otherwise
Statement
/otherwise
/choose
Date: format_date(statement.date, user.language)
Journal: statement.journal.rec_name
Number	Date	Party	Description	Amount
for each="line in statement.grouped_lines"
line.number	format_date(line.date, user.language)	line.party.rec_name if line.party else ''	for each="description in line.descriptions" description /for	format_currency(line.amount, user.language, statement.journal.currency)
/for
# format_number(len(list(statement.grouped_lines)), user.language, digits=0)	Total			format_currency(sum(l.amount for l in statement.lines), user.language, statement.journal.currency)
/for
if test="company and company.header"
for each="line in company.header_used.split('\n')"
line
/for
/if
company.rec_name if company else ''
if test="company and company.footer"
for each="line in company.footer_used.split('\n')"