I have a code here to calculate each item lead time based on the item delivery date and the transaction date. This script I wrote for the child table form in Sales Order Item, and it is not working. how to fetch the transaction date from Sales Order master? I input the result into duration field.
frappe.ui.form.on('Sales Order Item', "refresh", function(frm, cdt, cdn){
var d = locals[cdt][cdn];
frm.set_value("custom_item_lead_time", frappe.datetime.get_day_diff( d.delivery_date , d.transaction_date * 86400));
refresh_field("custom_item_lead_time");
});