replace text:p="set_lang(invoice.party.lang)"
replace text:p="invoice.set_lang(invoice.party.lang)"
for each="line in invoice.invoice_address.full_address.split('\n')"
line
/for
if test="invoice.party_tax_identifier"
invoice.party_tax_identifier.type_string: invoice.party_tax_identifier.code
/if
if test="invoice.type == 'in'"
Prepayment N°:invoice.number and ' ' + invoice.number or ''
/if
if test="invoice.type == 'out'"
choose test=""
when test="invoice.state == 'draft'"
Draft Prepayment
/when
when test="invoice.state == 'validated'"
Pro forma Prepayment
/when
otherwise test=""
Invoice N°:invoice.number and ' ' + invoice.number or ''
/otherwise
/choose
/if
Description: invoice.description or ''
Reference: invoice.origins or ''', ' if (invoice.reference and invoice.origins) else ''invoice.reference or ''
Date: format_date(invoice.invoice_date or today, invoice.party.lang)
if test="invoice.tax_identifier"
invoice.tax_identifier.type_string: invoice.tax_identifier.code
/if
Description	Quantity	Unit Price	Taxes	Amount
for each="line in invoice.lines"
choose test=""
when test="line.type == 'line'"
if test="line.product_name" line.product_name /if if test="line.description" for each="description in line.description.split('\n')" description /for /if	format_number_symbol(line.quantity, invoice.party.lang, line.unit, digits=line.unit.digits) if line.unit else format_number(line.quantity, invoice.party.lang)	format_currency(line.unit_price, invoice.party.lang, invoice.currency, digits=line.__class__.unit_price.digits[1])	','.join('[' + '%s' % x.sequence_number + ']' for x in line.invoice_taxes)	format_currency(line.amount, invoice.party.lang, invoice.currency)
/when
when test="line.type == 'subtotal'"
for each="description in (line.description or '').split('\n')" description /for				format_currency(line.amount, invoice.party.lang, invoice.currency)
/when
when test="line.type == 'title'"
for each="description in (line.description or '').split('\n')" description /for
/when
otherwise test=""
for each="description in (line.description or '').split('\n')" description /for
/otherwise
/choose
/for
Tax Base Amount for each="tax in invoice.taxes" '[' + '%s' % tax.sequence_number + ']' tax.description or '' format_currency(tax.base, invoice.party.lang, invoice.currency) format_currency(tax.amount, invoice.party.lang, invoice.currency) if test="tax.legal_notice" for each="line in tax.legal_notice.split('\n')" line /for /if /for	Total (excl. taxes): format_currency(invoice.untaxed_amount, invoice.party.lang, invoice.currency) Taxes: format_currency(invoice.tax_amount, invoice.party.lang, invoice.currency) Total: format_currency(invoice.total_amount, invoice.party.lang, invoice.currency)
if test="invoice.lines_to_pay"
Payment Term if test="invoice.payment_term and invoice.payment_term.description" for each="description in (invoice.payment_term.description or '').split('\n')" description /for /if
Date	Amount
for each="line in invoice.lines_to_pay"
if test="not line.reconciliation"
format_date(line.maturity_date, invoice.party.lang) if line.maturity_date else ''	line.amount_second_currency and format_currency(line.amount_second_currency, invoice.party.lang, invoice.currency) or format_currency(line.debit - line.credit, invoice.party.lang, invoice.currency)
/if
/for
/if
for each="comment in (invoice.comment or '').split('\n')"
comment
/for
if test="invoice.company.header"
for each="line in invoice.company.header_used.split('\n')"
line
/for
/if
invoice.company.rec_name
if test="invoice.company.footer"
for each="line in invoice.company.footer_used.split('\n')"