mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-15 12:55:10 +00:00
Co-authored-by: Pandiyan P <pandiyanpalani37@gmail.com> fix: update child item schedule_date and prevent past dates (#53298)
This commit is contained in:
@@ -67,7 +67,7 @@ frappe.ui.form.on("Purchase Order", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
transaction_date(frm) {
|
transaction_date(frm) {
|
||||||
prevent_past_schedule_dates(frm);
|
erpnext.buying.prevent_past_schedule_dates(frm);
|
||||||
frm.set_value("schedule_date", "");
|
frm.set_value("schedule_date", "");
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ frappe.ui.form.on("Purchase Order", {
|
|||||||
if (frm.doc.docstatus == 0) {
|
if (frm.doc.docstatus == 0) {
|
||||||
erpnext.set_unit_price_items_note(frm);
|
erpnext.set_unit_price_items_note(frm);
|
||||||
}
|
}
|
||||||
prevent_past_schedule_dates(frm);
|
erpnext.buying.prevent_past_schedule_dates(frm);
|
||||||
},
|
},
|
||||||
|
|
||||||
get_materials_from_supplier: function (frm) {
|
get_materials_from_supplier: function (frm) {
|
||||||
@@ -779,11 +779,3 @@ frappe.ui.form.on("Purchase Order", "is_subcontracted", function (frm) {
|
|||||||
erpnext.buying.get_default_bom(frm);
|
erpnext.buying.get_default_bom(frm);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function prevent_past_schedule_dates(frm) {
|
|
||||||
if (frm.doc.transaction_date) {
|
|
||||||
frm.fields_dict["schedule_date"].datepicker?.update({
|
|
||||||
minDate: new Date(frm.doc.transaction_date),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -682,3 +682,10 @@ erpnext.buying.get_items_from_product_bundle = function (frm) {
|
|||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
};
|
};
|
||||||
|
erpnext.buying.prevent_past_schedule_dates = function (frm) {
|
||||||
|
if (frm.doc.transaction_date) {
|
||||||
|
frm.fields_dict["schedule_date"].datepicker?.update({
|
||||||
|
minDate: new Date(frm.doc.transaction_date),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
@@ -116,12 +116,12 @@ frappe.ui.form.on("Material Request", {
|
|||||||
refresh: function (frm) {
|
refresh: function (frm) {
|
||||||
frm.events.make_custom_buttons(frm);
|
frm.events.make_custom_buttons(frm);
|
||||||
frm.toggle_reqd("customer", frm.doc.material_request_type == "Customer Provided");
|
frm.toggle_reqd("customer", frm.doc.material_request_type == "Customer Provided");
|
||||||
prevent_past_schedule_dates(frm);
|
erpnext.buying.prevent_past_schedule_dates(frm);
|
||||||
frm.trigger("set_warehouse_label");
|
frm.trigger("set_warehouse_label");
|
||||||
},
|
},
|
||||||
|
|
||||||
transaction_date(frm) {
|
transaction_date(frm) {
|
||||||
prevent_past_schedule_dates(frm);
|
erpnext.buying.prevent_past_schedule_dates(frm);
|
||||||
frm.set_value("schedule_date", "");
|
frm.set_value("schedule_date", "");
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -681,11 +681,3 @@ function set_schedule_date(frm) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function prevent_past_schedule_dates(frm) {
|
|
||||||
if (frm.doc.transaction_date) {
|
|
||||||
frm.fields_dict["schedule_date"].datepicker.update({
|
|
||||||
minDate: new Date(frm.doc.transaction_date),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user