i wanted to add some discount rules on POS … but i cant manage how i can do it…
i see from standard pricing rules there is sciprt like :
this.frm.call({
method: “addons.addons.doctype.on_total_pricing_rule.on_total_pricing_rule.calculate_discount”,
args: { args: this },
callback: function(r) {
if (!r.exc && r.message) {
me.discount_amount=r.message;
refresh_field(“discount_amount”);
}
}
});
**that my version of code
but i confused where should i put those codes
i cant use hooks because there is no save state in POS… so i cant update the value on validate… i should do it on change…