mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-18 09:05:00 +00:00
chore: fix conflicts
This commit is contained in:
@@ -195,8 +195,6 @@ frappe.ui.form.on("Production Plan", {
|
||||
set_field_options("projected_qty_formula", projected_qty_formula);
|
||||
},
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
get_items_for_work_order(frm) {
|
||||
let items = frm.doc.po_items;
|
||||
if (frm.doc.sub_assembly_items?.length) {
|
||||
@@ -215,73 +213,6 @@ frappe.ui.form.on("Production Plan", {
|
||||
return has_items;
|
||||
},
|
||||
|
||||
has_unreserved_stock(frm, table, qty_field = "required_qty") {
|
||||
let has_unreserved_stock = frm.doc[table].some(
|
||||
(item) => flt(item[qty_field]) > flt(item.stock_reserved_qty)
|
||||
);
|
||||
|
||||
return has_unreserved_stock;
|
||||
},
|
||||
|
||||
has_reserved_stock(frm, table) {
|
||||
let has_reserved_stock = frm.doc[table].some((item) => flt(item.stock_reserved_qty) > 0);
|
||||
|
||||
return has_reserved_stock;
|
||||
},
|
||||
|
||||
setup_stock_reservation_for_sub_assembly(frm) {
|
||||
if (frm.doc.docstatus === 1 && frm.doc.reserve_stock) {
|
||||
if (frm.events.has_unreserved_stock(frm, "sub_assembly_items")) {
|
||||
frm.add_custom_button(
|
||||
__("Reserve for Sub-assembly"),
|
||||
() => erpnext.stock_reservation.make_entries(frm, "sub_assembly_items"),
|
||||
__("Stock Reservation")
|
||||
);
|
||||
}
|
||||
|
||||
if (frm.events.has_reserved_stock(frm, "sub_assembly_items")) {
|
||||
frm.add_custom_button(
|
||||
__("Unreserve for Sub-assembly"),
|
||||
() => erpnext.stock_reservation.unreserve_stock(frm),
|
||||
__("Stock Reservation")
|
||||
);
|
||||
|
||||
frm.add_custom_button(
|
||||
__("Reserved Stock for Sub-assembly"),
|
||||
() => erpnext.stock_reservation.show_reserved_stock(frm, "sub_assembly_items"),
|
||||
__("Stock Reservation")
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setup_stock_reservation_for_raw_materials(frm) {
|
||||
if (frm.doc.docstatus === 1 && frm.doc.reserve_stock) {
|
||||
if (frm.events.has_unreserved_stock(frm, "mr_items", "required_bom_qty")) {
|
||||
frm.add_custom_button(
|
||||
__("Reserve for Raw Materials"),
|
||||
() => erpnext.stock_reservation.make_entries(frm, "mr_items"),
|
||||
__("Stock Reservation")
|
||||
);
|
||||
}
|
||||
|
||||
if (frm.events.has_reserved_stock(frm, "mr_items")) {
|
||||
frm.add_custom_button(
|
||||
__("Unreserve for Raw Materials"),
|
||||
() => erpnext.stock_reservation.unreserve_stock(frm),
|
||||
__("Stock Reservation")
|
||||
);
|
||||
|
||||
frm.add_custom_button(
|
||||
__("Reserved Stock for Raw Materials"),
|
||||
() => erpnext.stock_reservation.show_reserved_stock(frm, "mr_items"),
|
||||
__("Stock Reservation")
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
>>>>>>> 384f4e120a (fix: do not create repeat work orders)
|
||||
close_open_production_plan(frm, close = false) {
|
||||
frappe.call({
|
||||
method: "set_status",
|
||||
|
||||
Reference in New Issue
Block a user