mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 05:32:46 +01:00
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) {
|
||||
prevent_past_schedule_dates(frm);
|
||||
erpnext.buying.prevent_past_schedule_dates(frm);
|
||||
frm.set_value("schedule_date", "");
|
||||
},
|
||||
|
||||
@@ -87,7 +87,7 @@ frappe.ui.form.on("Purchase Order", {
|
||||
if (frm.doc.docstatus == 0) {
|
||||
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) {
|
||||
@@ -779,11 +779,3 @@ frappe.ui.form.on("Purchase Order", "is_subcontracted", function (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();
|
||||
};
|
||||
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) {
|
||||
frm.events.make_custom_buttons(frm);
|
||||
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");
|
||||
},
|
||||
|
||||
transaction_date(frm) {
|
||||
prevent_past_schedule_dates(frm);
|
||||
erpnext.buying.prevent_past_schedule_dates(frm);
|
||||
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