Merge branch 'develop' into se-add-to-transit
This commit is contained in:
commit
9d830255c1
@ -5,7 +5,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import unittest
|
import unittest
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.utils import cstr
|
from frappe.utils import cstr, flt
|
||||||
from frappe.test_runner import make_test_records
|
from frappe.test_runner import make_test_records
|
||||||
from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import create_stock_reconciliation
|
from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import create_stock_reconciliation
|
||||||
from erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool import update_cost
|
from erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool import update_cost
|
||||||
@ -81,15 +81,27 @@ class TestBOM(unittest.TestCase):
|
|||||||
bom = frappe.copy_doc(test_records[2])
|
bom = frappe.copy_doc(test_records[2])
|
||||||
bom.insert()
|
bom.insert()
|
||||||
|
|
||||||
# test amounts in selected currency
|
raw_material_cost = 0.0
|
||||||
self.assertEqual(bom.operating_cost, 100)
|
op_cost = 0.0
|
||||||
self.assertEqual(bom.raw_material_cost, 351.68)
|
|
||||||
self.assertEqual(bom.total_cost, 451.68)
|
for op_row in bom.operations:
|
||||||
|
op_cost += op_row.operating_cost
|
||||||
|
|
||||||
|
for row in bom.items:
|
||||||
|
raw_material_cost += row.amount
|
||||||
|
|
||||||
|
base_raw_material_cost = raw_material_cost * flt(bom.conversion_rate, bom.precision("conversion_rate"))
|
||||||
|
base_op_cost = op_cost * flt(bom.conversion_rate, bom.precision("conversion_rate"))
|
||||||
|
|
||||||
# test amounts in selected currency
|
# test amounts in selected currency
|
||||||
self.assertEqual(bom.base_operating_cost, 6000)
|
self.assertEqual(bom.operating_cost, op_cost)
|
||||||
self.assertEqual(bom.base_raw_material_cost, 21100.80)
|
self.assertEqual(bom.raw_material_cost, raw_material_cost)
|
||||||
self.assertEqual(bom.base_total_cost, 27100.80)
|
self.assertEqual(bom.total_cost, raw_material_cost + op_cost)
|
||||||
|
|
||||||
|
# test amounts in selected currency
|
||||||
|
self.assertEqual(bom.base_operating_cost, base_op_cost)
|
||||||
|
self.assertEqual(bom.base_raw_material_cost, base_raw_material_cost)
|
||||||
|
self.assertEqual(bom.base_total_cost, base_raw_material_cost + base_op_cost)
|
||||||
|
|
||||||
def test_bom_cost_multi_uom_multi_currency_based_on_price_list(self):
|
def test_bom_cost_multi_uom_multi_currency_based_on_price_list(self):
|
||||||
frappe.db.set_value("Price List", "_Test Price List", "price_not_uom_dependent", 1)
|
frappe.db.set_value("Price List", "_Test Price List", "price_not_uom_dependent", 1)
|
||||||
|
@ -47,6 +47,8 @@ class JobCard(Document):
|
|||||||
if d.completed_qty:
|
if d.completed_qty:
|
||||||
self.total_completed_qty += d.completed_qty
|
self.total_completed_qty += d.completed_qty
|
||||||
|
|
||||||
|
self.total_completed_qty = flt(self.total_completed_qty, self.precision("total_completed_qty"))
|
||||||
|
|
||||||
def get_overlap_for(self, args, check_next_available_slot=False):
|
def get_overlap_for(self, args, check_next_available_slot=False):
|
||||||
production_capacity = 1
|
production_capacity = 1
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ frappe.ui.form.on('Global Defaults', {
|
|||||||
method: "frappe.client.get_list",
|
method: "frappe.client.get_list",
|
||||||
args: {
|
args: {
|
||||||
doctype: "UOM Conversion Factor",
|
doctype: "UOM Conversion Factor",
|
||||||
filters: { "category": "Length" },
|
filters: { "category": __("Length") },
|
||||||
fields: ["to_uom"],
|
fields: ["to_uom"],
|
||||||
limit_page_length: 500
|
limit_page_length: 500
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user