mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
Test case fixed for multiple uom in selling
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"qty": 1.0,
|
"qty": 1.0,
|
||||||
"rate": 500.0,
|
"rate": 500.0,
|
||||||
|
"uom": "_Test UOM",
|
||||||
|
"conversion_factor": 1,
|
||||||
"stock_uom": "_Test UOM"
|
"stock_uom": "_Test UOM"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -91,6 +93,8 @@
|
|||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"price_list_rate": 500.0,
|
"price_list_rate": 500.0,
|
||||||
"qty": 1.0,
|
"qty": 1.0,
|
||||||
|
"uom": "_Test UOM",
|
||||||
|
"conversion_factor": 1,
|
||||||
"stock_uom": "_Test UOM"
|
"stock_uom": "_Test UOM"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -143,6 +147,8 @@
|
|||||||
"price_list_rate": 50,
|
"price_list_rate": 50,
|
||||||
"qty": 10,
|
"qty": 10,
|
||||||
"rate": 50,
|
"rate": 50,
|
||||||
|
"uom": "_Test UOM",
|
||||||
|
"conversion_factor": 1,
|
||||||
"stock_uom": "_Test UOM"
|
"stock_uom": "_Test UOM"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -155,6 +161,8 @@
|
|||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"price_list_rate": 150,
|
"price_list_rate": 150,
|
||||||
"qty": 5,
|
"qty": 5,
|
||||||
|
"uom": "_Test UOM",
|
||||||
|
"conversion_factor": 1,
|
||||||
"rate": 150,
|
"rate": 150,
|
||||||
"stock_uom": "_Test UOM"
|
"stock_uom": "_Test UOM"
|
||||||
}
|
}
|
||||||
@@ -265,6 +273,8 @@
|
|||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"price_list_rate": 62.5,
|
"price_list_rate": 62.5,
|
||||||
"qty": 10,
|
"qty": 10,
|
||||||
|
"uom": "_Test UOM",
|
||||||
|
"conversion_factor": 1,
|
||||||
"stock_uom": "_Test UOM"
|
"stock_uom": "_Test UOM"
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -278,6 +288,8 @@
|
|||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"price_list_rate": 190.66,
|
"price_list_rate": 190.66,
|
||||||
"qty": 5,
|
"qty": 5,
|
||||||
|
"uom": "_Test UOM",
|
||||||
|
"conversion_factor": 1,
|
||||||
"stock_uom": "_Test UOM"
|
"stock_uom": "_Test UOM"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"qty": 10.0,
|
"qty": 10.0,
|
||||||
"rate": 100.0,
|
"rate": 100.0,
|
||||||
|
"uom": "_Test UOM",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"conversion_factor": 1.0
|
"conversion_factor": 1.0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,8 @@
|
|||||||
"rate": 100.0,
|
"rate": 100.0,
|
||||||
"warehouse": "_Test Warehouse - _TC",
|
"warehouse": "_Test Warehouse - _TC",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"conversion_factor": 1.0
|
"conversion_factor": 1.0,
|
||||||
|
"uom": "_Test UOM"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"selling_price_list": "_Test Price List",
|
"selling_price_list": "_Test Price List",
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"qty": 1.0,
|
"qty": 1.0,
|
||||||
"rate": 100.0,
|
"rate": 100.0,
|
||||||
|
"uom": "_Test UOM",
|
||||||
|
"conversion_factor": 1,
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"warehouse": "_Test Warehouse - _TC"
|
"warehouse": "_Test Warehouse - _TC"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ def get_valuation_rate(item_code, warehouse=None):
|
|||||||
["valuation_rate"], as_dict=True) or {"valuation_rate": 0}
|
["valuation_rate"], as_dict=True) or {"valuation_rate": 0}
|
||||||
|
|
||||||
elif not item.is_stock_item:
|
elif not item.is_stock_item:
|
||||||
valuation_rate =frappe.db.sql("""select sum(base_net_amount) / sum(stock_qty)
|
valuation_rate =frappe.db.sql("""select sum(base_net_amount) / sum(qty*conversion_factor)
|
||||||
from `tabPurchase Invoice Item`
|
from `tabPurchase Invoice Item`
|
||||||
where item_code = %s and docstatus=1""", item_code)
|
where item_code = %s and docstatus=1""", item_code)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user