Hi i am new to script i want to calculate total packing charges if the quantity is less than 1 or negative(eg: -2,-4,-5)
frappe.ui.form.on(“Sales Invoice Item”, {
qty: function(frm,cdt,cdn) {
var d = locals[cdt][cdn];
if (row.qty < 0)
{
frappe.model.set_value(cdt, cdn, ‘total_packing_charges’, (d.qty * d.packing_charges*-1));
console.log(“message”);
frm.refresh_field(‘Sales Invoice Item’);
}
}
});
this is my code to calculate it when the value is positive.
Please help