merge branch develop
diff --git a/erpnext/buying/report/requested_items_to_order/__init__.py b/erpnext/buying/report/requested_items_to_order_and_receive/__init__.py
similarity index 100%
rename from erpnext/buying/report/requested_items_to_order/__init__.py
rename to erpnext/buying/report/requested_items_to_order_and_receive/__init__.py
diff --git a/erpnext/buying/report/requested_items_to_order/requested_items_to_order.js b/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.js
similarity index 95%
rename from erpnext/buying/report/requested_items_to_order/requested_items_to_order.js
rename to erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.js
index 9555e82..d727584 100644
--- a/erpnext/buying/report/requested_items_to_order/requested_items_to_order.js
+++ b/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.js
@@ -2,7 +2,7 @@
// For license information, please see license.txt
/* eslint-disable */
-frappe.query_reports["Requested Items to Order"] = {
+frappe.query_reports["Requested Items to Order and Receive"] = {
"filters": [
{
"fieldname": "company",
diff --git a/erpnext/buying/report/requested_items_to_order/requested_items_to_order.json b/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.json
similarity index 71%
rename from erpnext/buying/report/requested_items_to_order/requested_items_to_order.json
rename to erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.json
index 4a0578b..cb158f5 100644
--- a/erpnext/buying/report/requested_items_to_order/requested_items_to_order.json
+++ b/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.json
@@ -1,21 +1,21 @@
{
"add_total_row": 1,
- "creation": "2020-05-04 20:23:57.750719",
+ "creation": "2020-07-10 14:28:21.041310",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
- "modified": "2020-05-05 13:05:51.723951",
+ "modified": "2020-07-10 14:28:21.041310",
"modified_by": "Administrator",
"module": "Buying",
- "name": "Requested Items to Order",
+ "name": "Requested Items to Order and Receive",
"owner": "Administrator",
"prepared_report": 0,
"query": "",
"ref_doctype": "Material Request",
- "report_name": "Requested Items to Order",
+ "report_name": "Requested Items to Order and Receive",
"report_type": "Script Report",
"roles": [
{
diff --git a/erpnext/buying/report/requested_items_to_order/requested_items_to_order.py b/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.py
similarity index 80%
rename from erpnext/buying/report/requested_items_to_order/requested_items_to_order.py
rename to erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.py
index cca01b1..faf67c9 100644
--- a/erpnext/buying/report/requested_items_to_order/requested_items_to_order.py
+++ b/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.py
@@ -59,8 +59,11 @@
sum(ifnull(mr_item.stock_qty, 0)) as qty,
ifnull(mr_item.stock_uom, '') as uom,
sum(ifnull(mr_item.ordered_qty, 0)) as ordered_qty,
- (sum(mr_item.stock_qty) - sum(ifnull(mr_item.ordered_qty, 0))) as qty_to_order,
+ sum(ifnull(mr_item.received_qty, 0)) as received_qty,
+ (sum(ifnull(mr_item.stock_qty, 0)) - sum(ifnull(mr_item.received_qty, 0))) as qty_to_receive,
+ (sum(ifnull(mr_item.stock_qty, 0)) - sum(ifnull(mr_item.ordered_qty, 0))) as qty_to_order,
mr_item.item_name as item_name,
+ mr_item.description as "description",
mr.company as company
from
`tabMaterial Request` mr, `tabMaterial Request Item` mr_item
@@ -78,7 +81,7 @@
return data
def update_qty_columns(row_to_update, data_row):
- fields = ["qty", "ordered_qty", "qty_to_order"]
+ fields = ["qty", "ordered_qty", "received_qty", "qty_to_receive", "qty_to_order"]
for field in fields:
row_to_update[field] += flt(data_row[field])
@@ -92,7 +95,9 @@
item_qty_map[row["item_code"]] = {
"qty" : row["qty"],
"ordered_qty" : row["ordered_qty"],
- "qty_to_order" : row["qty_to_order"]
+ "received_qty": row["received_qty"],
+ "qty_to_receive": row["qty_to_receive"],
+ "qty_to_order" : row["qty_to_order"],
}
else:
item_entry = item_qty_map[row["item_code"]]
@@ -122,7 +127,7 @@
return data, chart_data
def prepare_chart_data(item_data):
- labels, qty_to_order, ordered_qty = [], [], []
+ labels, qty_to_order, ordered_qty, received_qty, qty_to_receive = [], [], [], [], []
if len(item_data) > 30:
item_data = dict(list(item_data.items())[:30])
@@ -132,6 +137,8 @@
labels.append(row)
qty_to_order.append(mr_row["qty_to_order"])
ordered_qty.append(mr_row["ordered_qty"])
+ received_qty.append(mr_row["received_qty"])
+ qty_to_receive.append(mr_row["qty_to_receive"])
chart_data = {
"data" : {
@@ -144,6 +151,14 @@
{
'name': _('Ordered Qty'),
'values': ordered_qty
+ },
+ {
+ 'name': _('Received Qty'),
+ 'values': received_qty
+ },
+ {
+ 'name': _('Qty to Receive'),
+ 'values': qty_to_receive
}
]
},
@@ -193,7 +208,13 @@
"width": 100
},
{
- "label": _("UOM"),
+ "label": _("Description"),
+ "fieldname": "description",
+ "fieldtype": "Data",
+ "width": 200
+ },
+ {
+ "label": _("Stock UOM"),
"fieldname": "uom",
"fieldtype": "Data",
"width": 100,
@@ -201,7 +222,7 @@
columns.extend([
{
- "label": _("Qty"),
+ "label": _("Stock Qty"),
"fieldname": "qty",
"fieldtype": "Float",
"width": 120,
@@ -215,6 +236,20 @@
"convertible": "qty"
},
{
+ "label": _("Received Qty"),
+ "fieldname": "received_qty",
+ "fieldtype": "Float",
+ "width": 120,
+ "convertible": "qty"
+ },
+ {
+ "label": _("Qty to Receive"),
+ "fieldname": "qty_to_receive",
+ "fieldtype": "Float",
+ "width": 120,
+ "convertible": "qty"
+ },
+ {
"label": _("Qty to Order"),
"fieldname": "qty_to_order",
"fieldtype": "Float",
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index cd4a221..537fc46 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -707,4 +707,5 @@
erpnext.patches.v13_0.move_payroll_setting_separately_from_hr_settings #22-06-2020
erpnext.patches.v13_0.check_is_income_tax_component #22-06-2020
erpnext.patches.v12_0.add_taxjar_integration_field
+erpnext.patches.v12_0.delete_report_requested_items_to_order
erpnext.patches.v12_0.update_item_tax_template_company
diff --git a/erpnext/patches/v12_0/delete_report_requested_items_to_order.py b/erpnext/patches/v12_0/delete_report_requested_items_to_order.py
new file mode 100644
index 0000000..0296d47
--- /dev/null
+++ b/erpnext/patches/v12_0/delete_report_requested_items_to_order.py
@@ -0,0 +1,7 @@
+import frappe
+
+def execute():
+ frappe.db.sql("""
+ DELETE FROM `tabReport`
+ WHERE name = 'Requested Items to Order'
+ """)
\ No newline at end of file