{% if doc.taxes %} {{ _("Net Total") }} {{ doc.get_formatted("net_total") }} {% endif %} {% for d in doc.taxes %} {% if d.base_tax_amount %} {{ d.description }} {{ d.get_formatted("base_tax_amount") }} {% endif %} {% endfor %} {% if doc.doctype == 'Quotation' %} {% if doc.coupon_code %} {{ _("Discount") }} {% set tot_quotation_discount = [] %} {%- for item in doc.items -%} {% if tot_quotation_discount.append((((item.price_list_rate * item.qty) * item.discount_percentage) / 100)) %}{% endif %} {% endfor %} {{ frappe.utils.fmt_money((tot_quotation_discount | sum),currency=doc.currency) }} {% endif %} {% endif %} {% if doc.doctype == 'Sales Order' %} {% if doc.coupon_code %} {{ _("Total Amount") }} {% set total_amount = [] %} {%- for item in doc.items -%} {% if total_amount.append((item.price_list_rate * item.qty)) %}{% endif %} {% endfor %} {{ frappe.utils.fmt_money((total_amount | sum),currency=doc.currency) }} {{ _("Applied Coupon Code") }} {%- for row in frappe.get_all(doctype="Coupon Code", fields=["coupon_code"], filters={ "name":doc.coupon_code}) -%} {{ row.coupon_code }} {% endfor %} {{ _("Discount") }} {% set tot_SO_discount = [] %} {%- for item in doc.items -%} {% if tot_SO_discount.append((((item.price_list_rate * item.qty) * item.discount_percentage) / 100)) %}{% endif %} {% endfor %} {{ frappe.utils.fmt_money((tot_SO_discount | sum),currency=doc.currency) }} {% endif %} {% endif %} {{ _("Grand Total") }} {{ doc.get_formatted("grand_total") }}