for each="shipment in records"
replace text:p="set_lang(shipment.company.party.lang)"
replace text:p="shipment.set_lang(shipment.company.party.lang)"
Commercial Invoice No: shipment.number
Sender
shipment.company.rec_name
if test="shipment.customs_from_address"
for each="line in shipment.customs_from_address.full_address.splitlines()"
line
/for
/if
if test="shipment.tax_identifier"
shipment.tax_identifier.type_string: shipment.tax_identifier.code
/if
Phone: get_phone(shipment.customs_from_address)
Reference: shipment.reference or ''
Date: format_date(shipment.effective_date or shipment.planned_date) if (shipment.effective_date or shipment.planned_date) else ''
Terms of Trade: shipment.incoterm.name if shipment.incoterm else ''
Reason for Export: get_reason(shipment)
Carrier: shipment.carrier.rec_name if getattr(shipment, 'carrier', None) else ''
Shipping reference: shipment.shipping_reference
Ship to
shipment.shipping_to.full_name
for each="line in shipment.shipping_to_address.full_address.splitlines()"
line
/for
Phone: get_phone(shipment.shipping_to_address) or ''
Sold to
if test="shipment.customs_agent"
shipment.customs_agent.rec_name
for each="line in shipment.customs_agent.address.full_address.splitlines()"
line
/for
shipment.customs_agent.tax_identifier.type_string: shipment.customs_agent.tax_identifier.code
Phone: get_phone(shipment.customs_agent.address)
/if
Description: shipment.shipping_description or ''
Description	Harmonized Code	Country of Origin	Quantity	Weight	Unit Value	Total Value
for each="line in lines(shipment)"
line.product.name	get_tariff_code(shipment, line.product)	line.product.country_of_origin.name if line.product.country_of_origin else ''	format_number_symbol(line.quantity, None, line.unit)	format_number_symbol(*get_weight(line.product, line.weight))	format_currency(line.price, None, line.currency)	format_currency(get_value(line.quantity, line.price, line.currency), None, line.currency)
/for
Total			format_number_symbol(*get_total_weight(shipment))		format_currency(*get_total_value(shipment))
/for