Skip to content

Commit

Permalink
fix: uptdate amount when qty changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sunhoww committed Oct 28, 2021
1 parent 5135715 commit 894317c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gg_custom/public/js/scripts/booking_order.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ function set_freight_amount(frm, cdt, cdn) {
function set_total(field) {
return function (frm, cdt, cdn) {
frm.set_value(field, sumBy(frm.doc.freight, field));
const { based_on } = frappe.get_doc(cdt, cdn);
if (
(field === 'no_of_packages' && based_on === 'Packages') ||
(field === 'weight_charged' && based_on === 'Weight')
) {
set_freight_amount(frm, cdt, cdn);
}
};
}

Expand Down

0 comments on commit 894317c

Please sign in to comment.