Created
January 1, 2018 16:59
-
-
Save sharoonthomas/7163e890176c668d3e55ace54adc1641 to your computer and use it in GitHub Desktop.
Jinja2 template for rendering PO lines as a CSV file on fulfil.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Po number","Ship to Name","Ship to address","Ship to phone number","Product name","Our SKU","Your SKU","Quantity","Amount" | |
{% for record in records -%} | |
{% for line in record.lines %}"{{ [ | |
line.purchase.number, | |
line.purchase.customer and line.purchase.customer.name, | |
line.purchase.customer and line.purchase.delivery_address.full_address.replace('\r\n', ','), | |
line.purchase.customer and line.purchase.customer.phone, | |
line.supplier_product_name or line.description, | |
line.product and line.product.code, | |
line.supplier_product_code or '', | |
line.quantity, | |
line.amount | |
]|join('","') }}" | |
{% endfor %} | |
{%- endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment