Total price list rate in print format

Hi,
I’m trying to easily compare the retail price vs the reseller pricing so the reseller can see what is his marging on the quote or sales order.

The way I did that is I display in the item column, the price list rate, discount on price list (the reseller marging which is not the same on all the products) and the real item price (retail is 200, discount is 10, itemp price is 180.

The total now display the total of the item price but I would like to also display the price list total.
Is it possible. I didnt find any fields in the custom print format builder.

You will need to write custom script to make it work. For example, please check this post.

Thanks again. I have an other question:

Let say in this example:

frappe.ui.form.on(“Sales Invoice”, {
validate: function(frm) {
total_qty = 0;
$.each(frm.doc.items || , function(i, d) {
total_qty += flt(d.qty);
});
frm.set_value(“net_weight”, total_qty);
}
});

How do I know which fields or values are available like “net_weight”. Examples are great but I dont know where to find any of these values so it’s hard to do something…

Net Weight is added as a Custom Field in the Sales Order Item table. As per your requirement, you should write a custom script around Price List Rate field. Hope other technical expert can assist you better on this.

This is what I did and it worked!!!
I added a new field in the sales order with the customize form tool.
Then I added a custom script.

frappe.ui.form.on(“Sales Order”, {
validate: function(frm) {
total_pricelist = 0;
$.each(frm.doc.items || , function(i, d) {
total_pricelist += flt(d.price_list_rate);
});
frm.doc.price_list_rate_total = total_pricelist;
}
});