Merge pull request #5507 from neilLasrado/develop
Added Minimum Inventory level to Item Master
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index fd7a31b..fde0165 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -981,6 +981,31 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "safety_stock",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Safety Stock",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"depends_on": "",
"description": "Average time taken by the supplier to deliver",
"fieldname": "lead_time_days",
@@ -2204,7 +2229,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 1,
- "modified": "2016-06-23 14:44:31.115557",
+ "modified": "2016-06-27 17:41:38.336900",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py
index eb202b1..fdf4442 100644
--- a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py
+++ b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py
@@ -27,9 +27,9 @@
total_outgoing = consumed_item_map.get(item.name, 0)+delivered_item_map.get(item.name,0)
avg_daily_outgoing = flt(total_outgoing/diff, float_preceision)
- reorder_level = (avg_daily_outgoing * flt(item.lead_time_days)) + flt(item.min_order_qty)
+ reorder_level = (avg_daily_outgoing * flt(item.lead_time_days)) + flt(item.safety_stock)
- data.append([item.name, item.item_name, item.description, item.min_order_qty, item.lead_time_days,
+ data.append([item.name, item.item_name, item.description, item.safety_stock, item.lead_time_days,
consumed_item_map.get(item.name, 0), delivered_item_map.get(item.name,0), total_outgoing,
avg_daily_outgoing, reorder_level])
@@ -38,13 +38,13 @@
def get_columns():
return[
_("Item") + ":Link/Item:120", _("Item Name") + ":Data:120", _("Description") + "::160",
- _("Minimum Inventory Level") + ":Float:160", _("Lead Time Days") + ":Float:120", _("Consumed") + ":Float:120",
+ _("Safety Stock") + ":Float:160", _("Lead Time Days") + ":Float:120", _("Consumed") + ":Float:120",
_("Delivered") + ":Float:120", _("Total Outgoing") + ":Float:120", _("Avg Daily Outgoing") + ":Float:160",
_("Reorder Level") + ":Float:120"
]
def get_item_info():
- return frappe.db.sql("""select name, item_name, description, min_order_qty,
+ return frappe.db.sql("""select name, item_name, description, safety_stock,
lead_time_days from tabItem""", as_dict=1)
def get_consumed_items(condition):