In my quotation child table a have a column of CBM, I want another column named as Total CBM (CBM X quantity).
Just like there a column of rate and amount.
Kindly assist!
In my quotation child table a have a column of CBM, I want another column named as Total CBM (CBM X quantity).
Just like there a column of rate and amount.
Kindly assist!
@Anjalijangid
go to customization of quotation item table and add new field total bdm
frappe.ui.form.on(âQuotation Itemâ, { // Replace âQuotation Itemâ with your child table Doctype name
cbm: function (frm, cdt, cdn) {
let row = locals[cdt][cdn];
row.total_cbm = row.cbm * row.qty; // Calculate Total CBM
frm.refresh_field(âitemsâ); // Replace âitemsâ with the name of your child table field
},
qty: function (frm, cdt, cdn) {
let row = locals[cdt][cdn];
row.total_cbm = row.cbm * row.qty; // Calculate Total CBM
frm.refresh_field(âitemsâ); // Replace âitemsâ with the name of your child table field
}
});
create client script
Thanks for the reply @Jeel
But i dont have any knowledge of code.
Is there any other way?
Like I have seen, for total they have used Float field-type here, is this information useful ?
@Anjalijangid Please First Add the custom field on your child table then add the client script in quotation doctype and the write this code and test your testcase
frappe.ui.form.on('Quotation', {
validate: function(frm) {
let row = locals[cdt][cdn];
row.total_cbm = row.cbm * row.qty;
frm.refresh_field("items");
}
})
@Anjalijangid try this code frappe.ui.form.on(âQuotationâ, {
validate: function(frm) {
let row = locals[cdt][cdn];
row.total_cbm = row.cbm * row.qty;
frm.refresh_field(âitemsâ);
}
})
@Anjalijangid try this code frappe.ui.form.on(âQuotationâ, {
validate: function(frm,cdt,cdn) {
let row = locals[cdt][cdn];
row.total_cbm = row.cbm * row.qty;
frm.refresh_field(âitemsâ);
}
})
you are making changes in the cbm field and in refresh field you have written items�?