for each="purchase in records"
	choose test="" when test="purchase.state == 'draft'" COMPRA EN ESTADO BORRADOR /when when test="purchase.state == 'quotation'" COMPRA N°: purchase.full_number /when otherwise test="" ORDEN DE COMPRA N°: purchase.full_number /otherwise /choose
Fecha: format_date(purchase.purchase_date or today, purchase.party.lang) NIT: 901091201-1 Regimen Común Actividad Economica 4690 CARRERA 16 No 52-85 PISO 4 Tel: 7163487-3000931 BOGOTA	replace text:p="set_lang(purchase.party.lang)" replace text:p="purchase.set_lang(purchase.party.lang)" for each="line in purchase.report_address.splitlines()" line /for if test="purchase.party.tax_identifier" purchase.party.tax_identifier.type_string: purchase.party.tax_identifier.code /if
Descripción: purchase.description
Descripción	Cantidad	Precio u/n	Impuestos	Total
for each="line in purchase.lines"
choose test=""
when test="line.type == 'line'"
choose when test="line.product_supplier" line.product_supplier.rec_name /when when test="line.product" line.product.rec_name /when /choose if test="line.description" for each="description in line.description.split('\n')" description /for /if	format_number_symbol(line.quantity, purchase.party.lang, line.unit, digits=line.unit.digits) if line.unit else format_number(line.quantity, purchase.party.lang)	format_currency(line.unit_price, purchase.party.lang, purchase.currency, digits=line.__class__.unit_price.digits[1])	for each="tax in line.taxes" tax.description /for	format_currency(line.amount, purchase.party.lang, purchase.currency)
/when
when test="line.type == 'subtotal'"
for each="description in (line.description or '').split('\n')" description /for				format_currency(line.amount, purchase.party.lang, purchase.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
	Total (Sin impuesto): format_currency(purchase.untaxed_amount, purchase.party.lang, purchase.currency) Impuestos: format_currency(purchase.tax_amount, purchase.party.lang, purchase.currency) Total: format_currency(purchase.total_amount, purchase.party.lang, purchase.currency)
for each="comment in (purchase.comment or '').split('\n')"
comment
/for
/for
if test="company and company.header"
for each="line in company.header.split('\n')"
line
/for
/if
if test="company and company.footer"
for each="line in company.footer.split('\n')"