mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-23 05:04:52 +01:00
fix: update delivery date in line items (#53331)
This commit is contained in:
@@ -769,10 +769,6 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends (
|
||||
items_on_form_rendered() {
|
||||
set_schedule_date(this.frm);
|
||||
}
|
||||
|
||||
schedule_date() {
|
||||
set_schedule_date(this.frm);
|
||||
}
|
||||
};
|
||||
|
||||
// for backward compatibility: combine new and previous states
|
||||
|
||||
@@ -140,6 +140,7 @@ erpnext.buying = {
|
||||
|
||||
this.toggle_subcontracting_fields();
|
||||
super.refresh();
|
||||
this.prevent_past_schedule_dates(this.frm);
|
||||
}
|
||||
|
||||
toggle_subcontracting_fields() {
|
||||
@@ -183,6 +184,28 @@ erpnext.buying = {
|
||||
erpnext.utils.set_letter_head(this.frm)
|
||||
}
|
||||
|
||||
schedule_date(doc, cdt, cdn) {
|
||||
if (doc.schedule_date && !cdt.endsWith(" Item")) {
|
||||
doc.items.forEach((d) => {
|
||||
frappe.model.set_value(d.doctype, d.name, "schedule_date", doc.schedule_date);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
transaction_date() {
|
||||
super.transaction_date();
|
||||
this.frm.set_value("schedule_date", "");
|
||||
this.prevent_past_schedule_dates(this.frm);
|
||||
}
|
||||
|
||||
prevent_past_schedule_dates(frm) {
|
||||
if (frm.doc.transaction_date && frm.fields_dict["schedule_date"]) {
|
||||
frm.fields_dict["schedule_date"].datepicker?.update({
|
||||
minDate: new Date(frm.doc.transaction_date),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
supplier_address() {
|
||||
erpnext.utils.get_address_display(this.frm);
|
||||
erpnext.utils.set_taxes_from_address(this.frm, "supplier_address", "supplier_address", "supplier_address");
|
||||
|
||||
@@ -642,10 +642,6 @@ erpnext.buying.MaterialRequestController = class MaterialRequestController exten
|
||||
set_schedule_date(this.frm);
|
||||
}
|
||||
|
||||
schedule_date() {
|
||||
set_schedule_date(this.frm);
|
||||
}
|
||||
|
||||
qty(doc, cdt, cdn) {
|
||||
var row = frappe.get_doc(cdt, cdn);
|
||||
row.amount = flt(row.qty) * flt(row.rate);
|
||||
|
||||
Reference in New Issue
Block a user