diff --git a/erpnext/templates/includes/order/order_macros.html b/erpnext/templates/includes/order/order_macros.html new file mode 100644 index 0000000000000000000000000000000000000000..21fb489e2def9ebd986252c2c251b4e7f82f5768 --- /dev/null +++ b/erpnext/templates/includes/order/order_macros.html @@ -0,0 +1,27 @@ +{# Legacy macros without Item Booking #} +{% from "erpnext/templates/includes/macros.html" import product_image %} + +{% macro item_name_and_description(d) %} +
+
+
+ {% if d.thumbnail or d.image %} + {{ product_image(d.thumbnail or d.image, no_border=True) }} + {% else %} +
+ {{ frappe.utils.get_abbr(d.item_name) or "NA" }} +
+ {% endif %} +
+
+
+ {{ d.item_code }} +
+ {{ html2text(d.description) | truncate(140) }} +
+ + {{ _("Qty ") }}({{ d.get_formatted("qty") }}) + +
+
+{% endmacro %} diff --git a/erpnext/templates/includes/order/order_taxes.html b/erpnext/templates/includes/order/order_taxes.html new file mode 100644 index 0000000000000000000000000000000000000000..62dc6532524a934400fbb811c5d4d8f19f0b3043 --- /dev/null +++ b/erpnext/templates/includes/order/order_taxes.html @@ -0,0 +1,112 @@ +{% 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 %} +
+
+
+ {{ _("Savings") }} +
+
+ {% 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 %} + +
+
+
+
+
+
+ {{ _("Savings") }} +
+
+ + {% 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") }} +
+
+
diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index 038a72f271191441583d531ab3aab803ae762ee9..b3af2bc9e4379be751680093bf2a91453137cac1 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -1,5 +1,6 @@ {% extends "templates/web.html" %} {% from "erpnext/templates/includes/macros.html" import product_image %} +{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %} {% block breadcrumbs %} {% include "templates/includes/breadcrumbs.html" %} @@ -144,28 +145,3 @@ {% endif %} {% endblock %} - -{% macro item_name_and_description(d) %} -
-
-
- {% if d.thumbnail or d.image %} - {{ product_image(d.thumbnail or d.image, no_border=True) }} - {% else %} -
- {{ frappe.utils.get_abbr(d.item_name) or "NA" }} -
- {% endif %} -
-
-
- {{ d.item_code }} -
- {{ html2text(d.description) | truncate(140) }} -
- - {{ _("Qty ") }}({{ d.get_formatted("qty") }}) - -
-
-{% endmacro %} \ No newline at end of file