Additional Discount amount based on percentage
diff --git a/erpnext/public/js/pos/pos.js b/erpnext/public/js/pos/pos.js
index 02eeab0..a348138 100644
--- a/erpnext/public/js/pos/pos.js
+++ b/erpnext/public/js/pos/pos.js
@@ -7,7 +7,7 @@
init: function(wrapper, frm) {
this.wrapper = wrapper;
this.frm = frm;
- this.wrapper.html(frappe.render_template("pos", {}));
+ this.wrapper.html(frappe.render_template("pos", {currency: this.frm.currency}));
this.check_transaction_type();
this.make();
@@ -16,6 +16,11 @@
$(this.frm.wrapper).on("refresh-fields", function() {
me.refresh();
});
+
+ this.wrapper.find('input.discount-percentage').on("change", function() {
+ frappe.model.set_value(me.frm.doctype, me.frm.docname,
+ "additional_discount_percentage", flt(this.value));
+ });
this.wrapper.find('input.discount-amount').on("change", function() {
frappe.model.set_value(me.frm.doctype, me.frm.docname, "discount_amount", flt(this.value));
@@ -230,6 +235,7 @@
},
refresh_fields: function() {
this.party_field.set_input(this.frm.doc[this.party.toLowerCase()]);
+ this.wrapper.find('input.discount-percentage').val(this.frm.doc.additional_discount_percentage);
this.wrapper.find('input.discount-amount').val(this.frm.doc.discount_amount);
this.show_items_in_item_cart();