Fixed Max value for update FG Item in Production Order
This commit is contained in:
parent
8ea2f45713
commit
b44f26d1ba
@ -162,7 +162,7 @@ $.extend(cur_frm.cscript, {
|
|||||||
make_se: function(purpose) {
|
make_se: function(purpose) {
|
||||||
var me = this;
|
var me = this;
|
||||||
var max = (purpose === "Manufacture") ?
|
var max = (purpose === "Manufacture") ?
|
||||||
flt(this.frm.doc.qty) - flt(this.frm.doc.produced_qty) :
|
flt(this.frm.doc.material_transferred_for_manufacturing) - flt(this.frm.doc.produced_qty) :
|
||||||
flt(this.frm.doc.qty) - flt(this.frm.doc.material_transferred_for_manufacturing);
|
flt(this.frm.doc.qty) - flt(this.frm.doc.material_transferred_for_manufacturing);
|
||||||
|
|
||||||
frappe.prompt({fieldtype:"Int", label: __("Qty for {0}", [purpose]), fieldname:"qty",
|
frappe.prompt({fieldtype:"Int", label: __("Qty for {0}", [purpose]), fieldname:"qty",
|
||||||
|
|||||||
@ -611,16 +611,16 @@ class StockEntry(StockController):
|
|||||||
return item_dict
|
return item_dict
|
||||||
|
|
||||||
def get_transfered_raw_materials(self):
|
def get_transfered_raw_materials(self):
|
||||||
items_dict = frappe.db.sql("""select item_name, item_code, sum(qty) as qty, to_warehouse, from_warehouse,
|
items_dict = frappe.db.sql("""select item_name, item_code, sum(qty) as qty, sed.s_warehouse as s_warehouse, sed.t_warehouse
|
||||||
description, stock_uom, expense_account, cost_center from `tabStock Entry` se,`tabStock Entry Detail` sed
|
as t_warehouse, description, stock_uom, expense_account, cost_center from `tabStock Entry` se,`tabStock Entry Detail` sed
|
||||||
where se.name = sed.parent and se.docstatus=1 and se.purpose='Material Transfer for Manufacture' and
|
where se.name = sed.parent and se.docstatus=1 and se.purpose='Material Transfer for Manufacture' and
|
||||||
se.production_order= %s and se.to_warehouse= %s group by sed.item_code""",
|
se.production_order= %s and ifnull(sed.s_warehouse, '') != '' group by sed.item_code, sed.s_warehouse, sed.t_warehouse""",
|
||||||
(self.production_order, self.from_warehouse), as_dict=1)
|
self.production_order, as_dict=1)
|
||||||
|
|
||||||
transfered_materials = frappe.db.sql("""select item_code, sum(qty) as qty from `tabStock Entry` se,
|
transfered_materials = frappe.db.sql("""select item_code, sum(qty) as qty from `tabStock Entry` se,
|
||||||
`tabStock Entry Detail` sed where se.name = sed.parent and se.docstatus=1 and
|
`tabStock Entry Detail` sed where se.name = sed.parent and se.docstatus=1 and
|
||||||
se.purpose='Manufacture' and se.production_order= %s and se.from_warehouse= %s
|
se.purpose='Manufacture' and se.production_order= %s and ifnull(sed.s_warehouse, '') != ''
|
||||||
group by sed.item_code""", (self.production_order, self.from_warehouse), as_dict=1)
|
group by sed.item_code, sed.s_warehouse, sed.t_warehouse""", self.production_order, as_dict=1)
|
||||||
|
|
||||||
transfered_qty= {}
|
transfered_qty= {}
|
||||||
for d in transfered_materials:
|
for d in transfered_materials:
|
||||||
@ -644,8 +644,8 @@ class StockEntry(StockController):
|
|||||||
if qty > 0:
|
if qty > 0:
|
||||||
self.add_to_stock_entry_detail({
|
self.add_to_stock_entry_detail({
|
||||||
item.item_code: {
|
item.item_code: {
|
||||||
"to_warehouse": item.to_warehouse,
|
"to_warehouse": item.t_warehouse,
|
||||||
"from_warehouse": item.from_warehouse,
|
"from_warehouse": item.s_warehouse,
|
||||||
"qty": qty,
|
"qty": qty,
|
||||||
"item_name": item.item_name,
|
"item_name": item.item_name,
|
||||||
"description": item.description,
|
"description": item.description,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user