- "html": "{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead, footer, print_settings=None, print_heading_template=None) -%}\n\n{% if letter_head and not no_letterhead %}\n<div class=\"letter-head\">{{ letter_head }}</div>\n{% endif %}\n{% if print_heading_template %}\n{{ frappe.render_template(print_heading_template, {\"doc\":doc}) }}\n{% endif %}\n{%- endmacro -%}\n\n{% for page in layout %}\n<div class=\"page-break invoice-page\">\n\t<div {% if print_settings.repeat_header_footer %} id=\"header-html\" class=\"hidden-pdf\" {% endif %}>\n\t\t{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead, footer, print_settings) }}\n\t</div>\n\t{%- if doc.meta.is_submittable and doc.docstatus==2-%}\n\t\t<div class=\"text-center\" document-status=\"cancelled\">\n\t\t\t<h4 style=\"margin-top: 20px;\">{{ _(\"CANCELLED\") }}</h4>\n\t\t</div>\n\t{%- endif -%}\n\t{%- if doc.meta.is_submittable and doc.docstatus==0 and (print_settings==None or print_settings.add_draft_heading) -%}\n\t\t<div class=\"text-center\" document-status=\"draft\">\n\t\t\t<h4 style=\"margin-top: 20px !important;\">{{ _(\"DRAFT\") }}</h4>\n\t\t</div>\n\t{%- endif -%}\n\n\t<style>\n\t\t.letter-head {\n\t\t\tpadding-top: 12px !important;\n\t\t\tpadding-bottom: 12px !important;\n\t\t}\n\t\t.invoice-page {\n\t\t\tfont-family: Inter, sans-serif;\n\t\t\tcolor: #171717;\n\t\t}\n\n\t\t.print-format-body {\n\t\t\tpadding: 30px 12px 12px 12px !important;\n\t\t}\n\n\t\t.title {\n\t\t\tcolor: #7c7c7c !important;\n\t\t}\n\t\t.text-muted {\n\t\t\tcolor: #7c7c7c !important;\n\t\t}\n\t\t.text-dark {\n\t\t\tcolor: #171717 !important;\n\t\t}\n\t\t.small-text {\n\t\t\tfont-size: 11px;\n\t\t\tcolor: #666;\n\t\t}\n\n\t\t.text-left {\n\t\t\ttext-align: left;\n\t\t}\n\t\t.text-center {\n\t\t\ttext-align: center;\n\t\t}\n\t\t.text-right {\n\t\t\ttext-align: right;\n\t\t}\n\t\t.text-bold {\n\t\t\tfont-weight: 700;\n\t\t}\n\n\t\t.mt-15 {\n\t\t\tmargin-top: 15px;\n\t\t}\n\t\t.mt-16 {\n\t\t\tmargin-top: 16px;\n\t\t}\n\t\t.mt-40 {\n\t\t\tmargin-top: 40px;\n\t\t}\n\t\t.mw-400 {\n\t\t\tmax-width: 400px;\n\t\t}\n\n\t\t.items-table,\n\t\t.tax-table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: separate;\n\t\t\tborder-spacing: 0;\n\t\t\tborder-radius: 10px;\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\t.items-table td,\n\t\t.tax-table td {\n\t\t\tborder-bottom: 1px solid #ededed;\n\t\t\tpadding: 8px;\n\t\t}\n\n\t\t.items-table thead td,\n\t\t.tax-table thead td {\n\t\t\tcolor: #7c7c7c !important;\n\t\t}\n\t\t.items-table thead tr:first-of-type td,\n\t\t.tax-table thead tr:first-of-type td {\n\t\t\tborder-bottom: none;\n\t\t}\n\n\t\t.items-table thead tr:first-child td:first-child,\n\t\t.tax-table thead tr:first-child td:first-child {\n\t\t\tborder-top-left-radius: 10px;\n\t\t\tborder-bottom-left-radius: 10px;\n\t\t}\n\t\t.items-table thead tr:first-child td:last-child,\n\t\t.tax-table thead tr:first-child td:last-child {\n\t\t\tborder-top-right-radius: 10px;\n\t\t\tborder-bottom-right-radius: 10px;\n\t\t}\n\n\t\t.in-words {\n\t\t\tcolor: #171717 !important;\n\t\t\tmax-width: 400px;\n\t\t\tword-wrap: break-word;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 12px;\n\t\t}\n\n\t\t.row-divider {\n\t\t\tborder-bottom: 1px solid #e9e9e9;\n\t\t}\n\n\t\t.highlight-bg {\n\t\t\tbackground: #f8f8f8;\n\t\t}\n\n\t\t.info-card {\n\t\t\tmargin-top: 40px;\n\t\t\tcolor: #7c7c7c;\n\t\t}\n\n\t\t.info-text {\n\t\t\tmargin-bottom: 12px;\n\t\t}\n\n\t\t.print-format {\n\t\t\tcolor: #171717;\n\t\t\tfont-size: 14px;\n\t\t\tfont-style: normal;\n\t\t\tfont-weight: 420;\n\t\t\tline-height: 21px;\n\t\t\tpadding: 0px !important;\n\t\t\tmargin-left: 0mm !important;\n\t\t\tmargin-right: 0mm !important;\n\t\t}\n\n\t\t.letter-head-footer {\n\t\t\tmargin-top: 0px !important;\n\t\t}\n\n\t\t.print-format-body td {\n\t\t\tpadding: 8px 8px !important;\n\t\t}\n\n\t\t.tax-table td,\n\t\t.items-table td {\n\t\t\theight: auto !important;\n\t\t}\n\n\t\t.tax-table thead td,\n\t\t.items-table thead td {\n\t\t\theight: 32px;\n\t\t}\n\n\t\t.item-img td {\n\t\t\tborder: none !important;\n\t\t\tpadding: 0px !important;\n\t\t}\n\t</style>\n\n\t<div class=\"print-format-body\">\n\t\t<table class=\"info-table col-xs-12\" style=\"width: 100%; margin-left: 12px\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"col-xs-6\" style=\"padding: 0 !important\">\n\t\t\t\t\t<div class=\"title col-xs-5 p-0\">\n\t\t\t\t\t\t<div class=\"info-text\">{{ _(\"Supplier Name:\") }}</div>\n\t\t\t\t\t\t<div class=\"info-text\">{{ _(\"Shipping Address:\") }}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t<div class=\"info-text\">{{ doc.suppliers[0].supplier }}</div>\n\t\t\t\t\t\t<div class=\"info-text\">\n \t\t\t\t\t{% if doc.shipping_address %}\n \t\t\t\t\t\t{% set shipping_address = frappe.db.get_value(\"Address\", doc.shipping_address, [\"address_line1\", \"address_line2\", \"city\", \"state\", \"pincode\", \"country\"], as_dict=True) %}\n {{ doc.shipping_address }}<br>\n \t\t\t\t\t\t{{ shipping_address.address_line1 or \"\" }}<br>\n \t\t\t\t\t\t{% if shipping_address.address_line2 %}{{ shipping_address.address_line2 }}<br>{% endif %}\n \t\t\t\t\t\t{{ shipping_address.city or \"\" }} {{ shipping_address.state or \"\" }} {{ shipping_address.pincode or \"\" }} {{ shipping_address.country or \"\" }}<br>\n \t\t\t\t\t{% endif %}\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\n\t\t\t\t<td class=\"col-xs-6\" style=\"padding: 0 !important\">\n\t\t\t\t\t<div class=\"title col-xs-5 p-0\">\n\t\t\t\t\t\t<div class=\"info-text\">{{ _(\"Order Date:\") }}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t<div class=\"info-text\">{{ frappe.utils.format_date(doc.transaction_date) }}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"title col-xs-5 p-0\">\n\t\t\t\t\t\t<div class=\"info-text\">{{ _(\"Required By:\") }}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t<div class=\"info-text\">{{ frappe.utils.format_date(doc.schedule_date) }}</div>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\n\t\t<!-- Items Table -->\n\t\t{% set item_naming_by = frappe.db.get_single_value(\"Stock Settings\", \"item_naming_by\") %}\n\t\t<table class=\"items-table mt-15\">\n\t\t\t<thead class=\"highlight-bg\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"\ttext-center\">{{ _(\"No\") }}</td>\n\t\t\t\t\t<td class=\"text-left\">{{ _(\"Item\") }}</td>\n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t<td class=\"text-left\">{{ _(\"Item Code\") }}</td>\n\t\t\t\t\t{% endif %}\n\t\t\t\t\t<td class=\"text-right\">{{ _(\"Quantity\") }}</td>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t{% for item in doc.items %}\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"text-center\">{{ loop.index }}</td>\n\t\t\t\t\t<td class=\"text-left\">\n\t\t\t\t\t\t<table class=\"item-img\" style=\"border-collapse: collapse\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t{% if item.image %}\n\t\t\t\t\t\t\t\t<td class=\"no-style\" style=\"border-radius: 6px; vertical-align: middle\">\n\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\tsrc=\"{{ item.image }}\"\n\t\t\t\t\t\t\t\t\t\talt=\"{{ item.item_name }}\"\n\t\t\t\t\t\t\t\t\t\tstyle=\"\n\t\t\t\t\t\t\t\t\t\t\tborder-radius: 6px;\n\t\t\t\t\t\t\t\t\t\t\theight: 24px;\n\t\t\t\t\t\t\t\t\t\t\twidth: 24px !important;\n\t\t\t\t\t\t\t\t\t\t\tmargin-right: 8px;\n vertical-align: middle;\n\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t{% endif %}\n\t\t\t\t\t\t\t\t<td\n\t\t\t\t\t\t\t\t\tclass=\"no-style\"\n\t\t\t\t\t\t\t\t\tstyle=\"vertical-align: middle !important; padding: 0 !important\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{{ item.item_name }}\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t\t{% if item_naming_by != \"Item Code\" %}\n\t\t\t\t\t\t<td class=\"text-left\">{{ item.item_code }}</td>\n\t\t\t\t\t{% endif %}\n\n\t\t\t\t\t<td class=\"text-right\">{{ item.get_formatted(\"qty\", 0) }} {{ item.uom }}</td>\n\t\t\t\t</tr>\n\t\t\t\t{% endfor %}\n\t\t\t</tbody>\n\t\t</table>\n\n\n\t\t<!-- Terms -->\n\t\t{% if doc.terms %}\n\t\t<div class=\"info-card\">\n\t\t\t<div class=\"title\">{{ _(\"Terms and Conditions\") }}</div>\n\t\t\t{{ doc.terms}}\n\t\t</div>\n\t\t{% endif %}\n\t</div>\n</div>\n{% endfor %}\n",
0 commit comments