mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 23:49:19 +00:00
fix: don't reset rates in Timesheet Detail when Activity Type is cleared (#28056)
* fix: don't reset rates when activity type is cleared * refactor: suggestions from review Co-authored-by: Sagar Vora <sagar@resilient.tech> * refactor: suggestions from review (fix) * style: fix sider * fix: sider issue Co-authored-by: Sagar Vora <sagar@resilient.tech>
This commit is contained in:
@@ -283,7 +283,9 @@ frappe.ui.form.on("Timesheet Detail", {
|
|||||||
calculate_time_and_amount(frm);
|
calculate_time_and_amount(frm);
|
||||||
},
|
},
|
||||||
|
|
||||||
activity_type: function(frm, cdt, cdn) {
|
activity_type: function (frm, cdt, cdn) {
|
||||||
|
if (!frappe.get_doc(cdt, cdn).activity_type) return;
|
||||||
|
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.projects.doctype.timesheet.timesheet.get_activity_cost",
|
method: "erpnext.projects.doctype.timesheet.timesheet.get_activity_cost",
|
||||||
args: {
|
args: {
|
||||||
@@ -291,10 +293,10 @@ frappe.ui.form.on("Timesheet Detail", {
|
|||||||
activity_type: frm.selected_doc.activity_type,
|
activity_type: frm.selected_doc.activity_type,
|
||||||
currency: frm.doc.currency
|
currency: frm.doc.currency
|
||||||
},
|
},
|
||||||
callback: function(r){
|
callback: function (r) {
|
||||||
if(r.message){
|
if (r.message) {
|
||||||
frappe.model.set_value(cdt, cdn, 'billing_rate', r.message['billing_rate']);
|
frappe.model.set_value(cdt, cdn, "billing_rate", r.message["billing_rate"]);
|
||||||
frappe.model.set_value(cdt, cdn, 'costing_rate', r.message['costing_rate']);
|
frappe.model.set_value(cdt, cdn, "costing_rate", r.message["costing_rate"]);
|
||||||
calculate_billing_costing_amount(frm, cdt, cdn);
|
calculate_billing_costing_amount(frm, cdt, cdn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user