Fixed rounding issue in subcontracting (#11802)

This commit is contained in:
Nabin Hait 2017-11-30 15:59:56 +05:30 committed by GitHub
parent e34ef60e3e
commit 1b89be0c66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 9 deletions

View File

@ -202,7 +202,8 @@ class BuyingController(StockController):
if not exists:
rm = self.append(raw_material_table, {})
required_qty = flt(bom_item.qty_consumed_per_unit) * flt(item.qty) * flt(item.conversion_factor)
required_qty = flt(flt(bom_item.qty_consumed_per_unit) * flt(item.qty) *
flt(item.conversion_factor), rm.precision("required_qty"))
rm.reference_name = item.name
rm.bom_detail_no = bom_item.name
rm.main_item_code = item.item_code

View File

@ -9,9 +9,6 @@ data = {
'Task',
'ToDo'
],
'properties': [
{'doctype': 'Item', 'fieldname': 'manufacturing', 'property': 'hidden', 'value': 1}
],
'set_value': [
['Stock Settings', None, 'show_barcode_field', 1]
],

View File

@ -356,7 +356,7 @@ class StockEntry(StockController):
if not total_allowed:
frappe.throw(_("Item {0} not found in 'Raw Materials Supplied' table in Purchase Order {1}")
.format(se_item.item_code, self.purchase_order))
total_supplied = frappe.db.sql("""select sum(qty)
total_supplied = frappe.db.sql("""select sum(transfer_qty)
from `tabStock Entry Detail`, `tabStock Entry`
where `tabStock Entry`.purchase_order = %s
and `tabStock Entry`.docstatus = 1
@ -365,8 +365,8 @@ class StockEntry(StockController):
(self.purchase_order, se_item.item_code))[0][0]
if total_supplied > total_allowed:
frappe.throw(_("Not allowed to tranfer more {0} than {1} against Purchase Order {2}").format(se_item.item_code,
total_allowed, self.purchase_order))
frappe.throw(_("Row {0}# Item {1} cannot be transferred more than {2} against Purchase Order {3}")
.format(se_item.idx, se_item.item_code, total_allowed, self.purchase_order))
def validate_bom(self):
for d in self.get('items'):
@ -767,7 +767,7 @@ class StockEntry(StockController):
se_child.description = item_dict[d]["description"]
se_child.uom = stock_uom
se_child.stock_uom = stock_uom
se_child.qty = flt(item_dict[d]["qty"])
se_child.qty = flt(item_dict[d]["qty"], se_child.precision("qty"))
se_child.expense_account = item_dict[d].get("expense_account") or expense_account
se_child.cost_center = item_dict[d].get("cost_center") or cost_center
@ -777,7 +777,7 @@ class StockEntry(StockController):
se_child.t_warehouse = self.to_warehouse
# in stock uom
se_child.transfer_qty = flt(item_dict[d]["qty"])
se_child.transfer_qty = flt(item_dict[d]["qty"], se_child.precision("qty"))
se_child.conversion_factor = 1.00
# to be assigned for finished item