mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
Merge pull request #48611 from rohitwaghchaure/fixed-job-card-stock-entry
fix: confirmation dialog for submitting the stock entry
This commit is contained in:
@@ -48,24 +48,37 @@ frappe.ui.form.on("Job Card", {
|
|||||||
frm.doc.track_semi_finished_goods &&
|
frm.doc.track_semi_finished_goods &&
|
||||||
frm.doc.docstatus === 1 &&
|
frm.doc.docstatus === 1 &&
|
||||||
!frm.doc.is_subcontracted &&
|
!frm.doc.is_subcontracted &&
|
||||||
|
(frm.doc.skip_material_transfer || frm.doc.transferred_qty > 0) &&
|
||||||
flt(frm.doc.for_quantity) + flt(frm.doc.process_loss_qty) > flt(frm.doc.manufactured_qty)
|
flt(frm.doc.for_quantity) + flt(frm.doc.process_loss_qty) > flt(frm.doc.manufactured_qty)
|
||||||
) {
|
) {
|
||||||
frm.add_custom_button(__("Make Stock Entry"), () => {
|
frm.add_custom_button(__("Make Stock Entry"), () => {
|
||||||
frm.call({
|
frappe.confirm(
|
||||||
method: "make_stock_entry_for_semi_fg_item",
|
__("Do you want to submit the stock entry?"),
|
||||||
args: {
|
() => {
|
||||||
auto_submit: 1,
|
frm.events.make_manufacture_stock_entry(frm, 1);
|
||||||
},
|
},
|
||||||
doc: frm.doc,
|
() => {
|
||||||
freeze: true,
|
frm.events.make_manufacture_stock_entry(frm, 0);
|
||||||
callback() {
|
}
|
||||||
frm.reload_doc();
|
);
|
||||||
},
|
|
||||||
});
|
|
||||||
}).addClass("btn-primary");
|
}).addClass("btn-primary");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
make_manufacture_stock_entry(frm, submit_entry) {
|
||||||
|
frm.call({
|
||||||
|
method: "make_stock_entry_for_semi_fg_item",
|
||||||
|
args: {
|
||||||
|
auto_submit: submit_entry,
|
||||||
|
},
|
||||||
|
doc: frm.doc,
|
||||||
|
freeze: true,
|
||||||
|
callback() {
|
||||||
|
frm.reload_doc();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
refresh: function (frm) {
|
refresh: function (frm) {
|
||||||
frm.trigger("setup_stock_entry");
|
frm.trigger("setup_stock_entry");
|
||||||
|
|
||||||
|
|||||||
@@ -440,6 +440,9 @@ class WorkOrder(Document):
|
|||||||
"""Update **Manufactured Qty** and **Material Transferred for Qty** in Work Order
|
"""Update **Manufactured Qty** and **Material Transferred for Qty** in Work Order
|
||||||
based on Stock Entry"""
|
based on Stock Entry"""
|
||||||
|
|
||||||
|
if self.track_semi_finished_goods:
|
||||||
|
return
|
||||||
|
|
||||||
allowance_percentage = flt(
|
allowance_percentage = flt(
|
||||||
frappe.db.get_single_value("Manufacturing Settings", "overproduction_percentage_for_work_order")
|
frappe.db.get_single_value("Manufacturing Settings", "overproduction_percentage_for_work_order")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1727,9 +1727,6 @@ class StockEntry(StockController):
|
|||||||
else:
|
else:
|
||||||
job_doc.set_manufactured_qty()
|
job_doc.set_manufactured_qty()
|
||||||
|
|
||||||
if self.job_card and frappe.get_cached_value("Job Card", self.job_card, "finished_good"):
|
|
||||||
return
|
|
||||||
|
|
||||||
if self.work_order:
|
if self.work_order:
|
||||||
pro_doc = frappe.get_doc("Work Order", self.work_order)
|
pro_doc = frappe.get_doc("Work Order", self.work_order)
|
||||||
_validate_work_order(pro_doc)
|
_validate_work_order(pro_doc)
|
||||||
|
|||||||
Reference in New Issue
Block a user