mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 19:35:09 +00: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() {
|
items_on_form_rendered() {
|
||||||
set_schedule_date(this.frm);
|
set_schedule_date(this.frm);
|
||||||
}
|
}
|
||||||
|
|
||||||
schedule_date() {
|
|
||||||
set_schedule_date(this.frm);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// for backward compatibility: combine new and previous states
|
// for backward compatibility: combine new and previous states
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ erpnext.buying = {
|
|||||||
|
|
||||||
this.toggle_subcontracting_fields();
|
this.toggle_subcontracting_fields();
|
||||||
super.refresh();
|
super.refresh();
|
||||||
|
this.prevent_past_schedule_dates(this.frm);
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle_subcontracting_fields() {
|
toggle_subcontracting_fields() {
|
||||||
@@ -183,6 +184,28 @@ erpnext.buying = {
|
|||||||
erpnext.utils.set_letter_head(this.frm)
|
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() {
|
supplier_address() {
|
||||||
erpnext.utils.get_address_display(this.frm);
|
erpnext.utils.get_address_display(this.frm);
|
||||||
erpnext.utils.set_taxes_from_address(this.frm, "supplier_address", "supplier_address", "supplier_address");
|
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);
|
set_schedule_date(this.frm);
|
||||||
}
|
}
|
||||||
|
|
||||||
schedule_date() {
|
|
||||||
set_schedule_date(this.frm);
|
|
||||||
}
|
|
||||||
|
|
||||||
qty(doc, cdt, cdn) {
|
qty(doc, cdt, cdn) {
|
||||||
var row = frappe.get_doc(cdt, cdn);
|
var row = frappe.get_doc(cdt, cdn);
|
||||||
row.amount = flt(row.qty) * flt(row.rate);
|
row.amount = flt(row.qty) * flt(row.rate);
|
||||||
|
|||||||
Reference in New Issue
Block a user