Moved Sales BOM & Sales BOM Item to Selling module, completed 'Available Stock for packing Items' report
diff --git a/stock/doctype/sales_bom/__init__.py b/selling/doctype/sales_bom/__init__.py
similarity index 100%
rename from stock/doctype/sales_bom/__init__.py
rename to selling/doctype/sales_bom/__init__.py
diff --git a/stock/doctype/sales_bom/locale/_messages_doc.json b/selling/doctype/sales_bom/locale/_messages_doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/_messages_doc.json
rename to selling/doctype/sales_bom/locale/_messages_doc.json
diff --git a/stock/doctype/sales_bom/locale/ar-doc.json b/selling/doctype/sales_bom/locale/ar-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/ar-doc.json
rename to selling/doctype/sales_bom/locale/ar-doc.json
diff --git a/stock/doctype/sales_bom/locale/de-doc.json b/selling/doctype/sales_bom/locale/de-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/de-doc.json
rename to selling/doctype/sales_bom/locale/de-doc.json
diff --git a/stock/doctype/sales_bom/locale/es-doc.json b/selling/doctype/sales_bom/locale/es-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/es-doc.json
rename to selling/doctype/sales_bom/locale/es-doc.json
diff --git a/stock/doctype/sales_bom/locale/fr-doc.json b/selling/doctype/sales_bom/locale/fr-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/fr-doc.json
rename to selling/doctype/sales_bom/locale/fr-doc.json
diff --git a/stock/doctype/sales_bom/locale/hi-doc.json b/selling/doctype/sales_bom/locale/hi-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/hi-doc.json
rename to selling/doctype/sales_bom/locale/hi-doc.json
diff --git a/stock/doctype/sales_bom/locale/hr-doc.json b/selling/doctype/sales_bom/locale/hr-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/hr-doc.json
rename to selling/doctype/sales_bom/locale/hr-doc.json
diff --git a/stock/doctype/sales_bom/locale/nl-doc.json b/selling/doctype/sales_bom/locale/nl-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/nl-doc.json
rename to selling/doctype/sales_bom/locale/nl-doc.json
diff --git a/stock/doctype/sales_bom/locale/pt-BR-doc.json b/selling/doctype/sales_bom/locale/pt-BR-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/pt-BR-doc.json
rename to selling/doctype/sales_bom/locale/pt-BR-doc.json
diff --git a/stock/doctype/sales_bom/locale/pt-doc.json b/selling/doctype/sales_bom/locale/pt-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/pt-doc.json
rename to selling/doctype/sales_bom/locale/pt-doc.json
diff --git a/stock/doctype/sales_bom/locale/sr-doc.json b/selling/doctype/sales_bom/locale/sr-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/sr-doc.json
rename to selling/doctype/sales_bom/locale/sr-doc.json
diff --git a/stock/doctype/sales_bom/locale/ta-doc.json b/selling/doctype/sales_bom/locale/ta-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/ta-doc.json
rename to selling/doctype/sales_bom/locale/ta-doc.json
diff --git a/stock/doctype/sales_bom/locale/th-doc.json b/selling/doctype/sales_bom/locale/th-doc.json
similarity index 100%
rename from stock/doctype/sales_bom/locale/th-doc.json
rename to selling/doctype/sales_bom/locale/th-doc.json
diff --git a/stock/doctype/sales_bom/sales_bom.js b/selling/doctype/sales_bom/sales_bom.js
similarity index 100%
rename from stock/doctype/sales_bom/sales_bom.js
rename to selling/doctype/sales_bom/sales_bom.js
diff --git a/stock/doctype/sales_bom/sales_bom.py b/selling/doctype/sales_bom/sales_bom.py
similarity index 100%
rename from stock/doctype/sales_bom/sales_bom.py
rename to selling/doctype/sales_bom/sales_bom.py
diff --git a/stock/doctype/sales_bom/sales_bom.txt b/selling/doctype/sales_bom/sales_bom.txt
similarity index 100%
rename from stock/doctype/sales_bom/sales_bom.txt
rename to selling/doctype/sales_bom/sales_bom.txt
diff --git a/stock/doctype/sales_bom/test_sales_bom.py b/selling/doctype/sales_bom/test_sales_bom.py
similarity index 100%
rename from stock/doctype/sales_bom/test_sales_bom.py
rename to selling/doctype/sales_bom/test_sales_bom.py
diff --git a/stock/doctype/sales_bom_item/__init__.py b/selling/doctype/sales_bom_item/__init__.py
similarity index 100%
rename from stock/doctype/sales_bom_item/__init__.py
rename to selling/doctype/sales_bom_item/__init__.py
diff --git a/stock/doctype/sales_bom_item/locale/_messages_doc.json b/selling/doctype/sales_bom_item/locale/_messages_doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/_messages_doc.json
rename to selling/doctype/sales_bom_item/locale/_messages_doc.json
diff --git a/stock/doctype/sales_bom_item/locale/ar-doc.json b/selling/doctype/sales_bom_item/locale/ar-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/ar-doc.json
rename to selling/doctype/sales_bom_item/locale/ar-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/de-doc.json b/selling/doctype/sales_bom_item/locale/de-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/de-doc.json
rename to selling/doctype/sales_bom_item/locale/de-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/es-doc.json b/selling/doctype/sales_bom_item/locale/es-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/es-doc.json
rename to selling/doctype/sales_bom_item/locale/es-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/fr-doc.json b/selling/doctype/sales_bom_item/locale/fr-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/fr-doc.json
rename to selling/doctype/sales_bom_item/locale/fr-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/hi-doc.json b/selling/doctype/sales_bom_item/locale/hi-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/hi-doc.json
rename to selling/doctype/sales_bom_item/locale/hi-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/hr-doc.json b/selling/doctype/sales_bom_item/locale/hr-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/hr-doc.json
rename to selling/doctype/sales_bom_item/locale/hr-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/nl-doc.json b/selling/doctype/sales_bom_item/locale/nl-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/nl-doc.json
rename to selling/doctype/sales_bom_item/locale/nl-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/pt-BR-doc.json b/selling/doctype/sales_bom_item/locale/pt-BR-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/pt-BR-doc.json
rename to selling/doctype/sales_bom_item/locale/pt-BR-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/pt-doc.json b/selling/doctype/sales_bom_item/locale/pt-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/pt-doc.json
rename to selling/doctype/sales_bom_item/locale/pt-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/sr-doc.json b/selling/doctype/sales_bom_item/locale/sr-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/sr-doc.json
rename to selling/doctype/sales_bom_item/locale/sr-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/ta-doc.json b/selling/doctype/sales_bom_item/locale/ta-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/ta-doc.json
rename to selling/doctype/sales_bom_item/locale/ta-doc.json
diff --git a/stock/doctype/sales_bom_item/locale/th-doc.json b/selling/doctype/sales_bom_item/locale/th-doc.json
similarity index 100%
rename from stock/doctype/sales_bom_item/locale/th-doc.json
rename to selling/doctype/sales_bom_item/locale/th-doc.json
diff --git a/stock/doctype/sales_bom_item/sales_bom_item.py b/selling/doctype/sales_bom_item/sales_bom_item.py
similarity index 100%
rename from stock/doctype/sales_bom_item/sales_bom_item.py
rename to selling/doctype/sales_bom_item/sales_bom_item.py
diff --git a/stock/doctype/sales_bom_item/sales_bom_item.txt b/selling/doctype/sales_bom_item/sales_bom_item.txt
similarity index 100%
rename from stock/doctype/sales_bom_item/sales_bom_item.txt
rename to selling/doctype/sales_bom_item/sales_bom_item.txt
diff --git a/selling/locale/_messages_js.json b/selling/locale/_messages_js.json
new file mode 100644
index 0000000..0637a08
--- /dev/null
+++ b/selling/locale/_messages_js.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/selling/locale/_messages_py.json b/selling/locale/_messages_py.json
new file mode 100644
index 0000000..f5b4a01
--- /dev/null
+++ b/selling/locale/_messages_py.json
@@ -0,0 +1,7 @@
+[
+ "is not a Stock Item", 
+ "Item", 
+ "Please check", 
+ "reached its end of life on", 
+ "is a cancelled Item"
+]
\ No newline at end of file
diff --git a/selling/locale/ar-py.json b/selling/locale/ar-py.json
new file mode 100644
index 0000000..b8dd151
--- /dev/null
+++ b/selling/locale/ar-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "\u0628\u0646\u062f", 
+ "Please check": "\u064a\u0631\u062c\u0649 \u0645\u0631\u0627\u062c\u0639\u0629", 
+ "is a cancelled Item": "\u0647\u0648 \u0628\u0646\u062f \u0625\u0644\u063a\u0627\u0621", 
+ "is not a Stock Item": "\u0644\u064a\u0633 \u0627\u0644\u0625\u063a\u0644\u0627\u0642 \u0644\u0644\u0633\u0647\u0645", 
+ "reached its end of life on": "\u0648\u0635\u0644 \u0625\u0644\u0649 \u0646\u0647\u0627\u064a\u062a\u0647 \u0645\u0646 \u0627\u0644\u062d\u064a\u0627\u0629 \u0639\u0644\u0649"
+}
\ No newline at end of file
diff --git a/selling/locale/de-py.json b/selling/locale/de-py.json
new file mode 100644
index 0000000..68b58d7
--- /dev/null
+++ b/selling/locale/de-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "Artikel", 
+ "Please check": "Bitte \u00fcberpr\u00fcfen Sie", 
+ "is a cancelled Item": "ist ein gestempeltes", 
+ "is not a Stock Item": "ist kein Lagerartikel", 
+ "reached its end of life on": "erreichte Ende des Lebens auf"
+}
\ No newline at end of file
diff --git a/selling/locale/es-py.json b/selling/locale/es-py.json
new file mode 100644
index 0000000..7d145d1
--- /dev/null
+++ b/selling/locale/es-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "Art\u00edculo", 
+ "Please check": "Por favor, compruebe", 
+ "is a cancelled Item": "Es un Tema cancelado", 
+ "is not a Stock Item": "no es un elemento de serie", 
+ "reached its end of life on": "llegado al final de su vida en la"
+}
\ No newline at end of file
diff --git a/selling/locale/fr-py.json b/selling/locale/fr-py.json
new file mode 100644
index 0000000..c466df4
--- /dev/null
+++ b/selling/locale/fr-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "Article", 
+ "Please check": "S'il vous pla\u00eet v\u00e9rifier", 
+ "is a cancelled Item": "est un \u00e9l\u00e9ment annul\u00e9e", 
+ "is not a Stock Item": "n'est pas un \u00e9l\u00e9ment de Stock", 
+ "reached its end of life on": "atteint la fin de sa vie sur"
+}
\ No newline at end of file
diff --git a/selling/locale/hi-py.json b/selling/locale/hi-py.json
new file mode 100644
index 0000000..58d4e65
--- /dev/null
+++ b/selling/locale/hi-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "\u092e\u0926", 
+ "Please check": "\u0915\u0943\u092a\u092f\u093e \u091c\u093e\u0901\u091a \u0915\u0930\u0947\u0902", 
+ "is a cancelled Item": "\u0930\u0926\u094d\u0926 \u0906\u0907\u091f\u092e", 
+ "is not a Stock Item": "\u0938\u094d\u091f\u0949\u0915 \u0906\u0907\u091f\u092e \u0928\u0939\u0940\u0902 \u0939\u0948", 
+ "reached its end of life on": "\u092a\u0930 \u0905\u092a\u0928\u0947 \u091c\u0940\u0935\u0928 \u0915\u0947 \u0905\u0902\u0924 \u0924\u0915 \u092a\u0939\u0941\u0901\u091a"
+}
\ No newline at end of file
diff --git a/selling/locale/hr-py.json b/selling/locale/hr-py.json
new file mode 100644
index 0000000..24f60bb
--- /dev/null
+++ b/selling/locale/hr-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "Stavka", 
+ "Please check": "Molimo provjerite", 
+ "is a cancelled Item": "je otkazan artikla", 
+ "is not a Stock Item": "nije katalo\u0161ki artikla", 
+ "reached its end of life on": "dosegla svoj kraj \u017eivota na"
+}
\ No newline at end of file
diff --git a/selling/locale/nl-py.json b/selling/locale/nl-py.json
new file mode 100644
index 0000000..7964d37
--- /dev/null
+++ b/selling/locale/nl-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "Item", 
+ "Please check": "Controleer", 
+ "is a cancelled Item": "is een geannuleerde artikel", 
+ "is not a Stock Item": "is niet een Stock Item", 
+ "reached its end of life on": "het einde van zijn leven op"
+}
\ No newline at end of file
diff --git a/selling/locale/pt-BR-py.json b/selling/locale/pt-BR-py.json
new file mode 100644
index 0000000..0bf350c
--- /dev/null
+++ b/selling/locale/pt-BR-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "Item", 
+ "Please check": "Por favor, verifique", 
+ "is a cancelled Item": "\u00e9 um Item cancelado", 
+ "is not a Stock Item": "n\u00e3o \u00e9 um Item de Estoque", 
+ "reached its end of life on": "chegou ao fim de vida em"
+}
\ No newline at end of file
diff --git a/selling/locale/pt-py.json b/selling/locale/pt-py.json
new file mode 100644
index 0000000..cfcbcec
--- /dev/null
+++ b/selling/locale/pt-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "Item", 
+ "Please check": "Por favor, verifique", 
+ "is a cancelled Item": "\u00e9 um item cancelado", 
+ "is not a Stock Item": "n\u00e3o \u00e9 um item de estoque", 
+ "reached its end of life on": "chegou ao fim da vida na"
+}
\ No newline at end of file
diff --git a/selling/locale/sr-py.json b/selling/locale/sr-py.json
new file mode 100644
index 0000000..ed1672f
--- /dev/null
+++ b/selling/locale/sr-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "\u0421\u0442\u0430\u0432\u043a\u0430", 
+ "Please check": "\u041c\u043e\u043b\u0438\u043c\u043e \u0432\u0430\u0441 \u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u0435", 
+ "is a cancelled Item": "\u0458\u0435 \u043e\u0442\u043a\u0430\u0437\u0430\u043d\u0430 \u0448\u0438\u0444\u0440\u0430", 
+ "is not a Stock Item": "\u043d\u0438\u0458\u0435 \u0431\u0435\u0440\u0437\u0430 \u0448\u0438\u0444\u0440\u0430", 
+ "reached its end of life on": "\u0434\u043e\u0441\u0442\u0438\u0433\u0430\u043e \u0441\u0432\u043e\u0458 \u043a\u0440\u0430\u0458 \u0436\u0438\u0432\u043e\u0442\u0430 \u043d\u0430"
+}
\ No newline at end of file
diff --git a/selling/locale/ta-py.json b/selling/locale/ta-py.json
new file mode 100644
index 0000000..355cc0e
--- /dev/null
+++ b/selling/locale/ta-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "\u0b89\u0bb0\u0bc1\u0baa\u0bcd\u0baa\u0b9f\u0bbf", 
+ "Please check": "\u0b9a\u0bb0\u0bbf\u0baa\u0bbe\u0bb0\u0bcd\u0b95\u0bcd\u0b95\u0bb5\u0bc1\u0bae\u0bcd", 
+ "is a cancelled Item": "\u0b92\u0bb0\u0bc1 \u0bb0\u0ba4\u0bcd\u0ba4\u0bc1 \u0b89\u0bb0\u0bc1\u0baa\u0bcd\u0baa\u0b9f\u0bbf \u0b89\u0bb3\u0bcd\u0bb3\u0ba4\u0bc1", 
+ "is not a Stock Item": "\u0b92\u0bb0\u0bc1 \u0baa\u0b99\u0bcd\u0b95\u0bc1 \u0baa\u0bc6\u0bbe\u0bb0\u0bc1\u0bb3\u0bcd \u0b85\u0bb2\u0bcd\u0bb2", 
+ "reached its end of life on": "\u0bb5\u0bbe\u0bb4\u0bcd\u0b95\u0bcd\u0b95\u0bc8 \u0b85\u0ba4\u0ba9\u0bcd \u0b87\u0bb1\u0bc1\u0ba4\u0bbf\u0baf\u0bbf\u0bb2\u0bcd \u0b85\u0b9f\u0bc8\u0ba8\u0bcd\u0ba4\u0ba4\u0bc1"
+}
\ No newline at end of file
diff --git a/selling/locale/th-py.json b/selling/locale/th-py.json
new file mode 100644
index 0000000..5f31a59
--- /dev/null
+++ b/selling/locale/th-py.json
@@ -0,0 +1,7 @@
+{
+ "Item": "\u0e0a\u0e34\u0e49\u0e19", 
+ "Please check": "\u0e01\u0e23\u0e38\u0e13\u0e32\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a", 
+ "is a cancelled Item": "\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01\u0e40\u0e1b\u0e47\u0e19", 
+ "is not a Stock Item": "\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e2a\u0e15\u0e47\u0e2d\u0e01", 
+ "reached its end of life on": "\u0e16\u0e36\u0e07\u0e08\u0e38\u0e14\u0e2a\u0e34\u0e49\u0e19\u0e2a\u0e38\u0e14\u0e02\u0e2d\u0e07\u0e0a\u0e35\u0e27\u0e34\u0e15\u0e40\u0e21\u0e37\u0e48\u0e2d"
+}
\ No newline at end of file
diff --git a/selling/page/selling_home/selling_home.js b/selling/page/selling_home/selling_home.js
index 7a0848e..4157bbb 100644
--- a/selling/page/selling_home/selling_home.js
+++ b/selling/page/selling_home/selling_home.js
@@ -167,13 +167,11 @@
 			},
 			{
 				"label":wn._("Territory Target Variance (Item Group-Wise)"),
-				route: "query-report/Territory Target Variance Item Group-Wise",
-				doctype: "Sales Order"
+				route: "query-report/Territory Target Variance Item Group-Wise"
 			},
 			{
 				"label":wn._("Sales Person Target Variance (Item Group-Wise)"),
-				route: "query-report/Sales Person Target Variance Item Group-Wise",
-				doctype: "Sales Order"
+				route: "query-report/Sales Person Target Variance Item Group-Wise"
 			},
 			{
 				"label":wn._("Customers Not Buying Since Long Time"),
@@ -190,6 +188,11 @@
 				route: "query-report/Sales Order Trends",
 				doctype: "Sales Order"
 			},
+			{
+				"label":wn._("Available Stock for Packing Items"),
+				route: "query-report/Available Stock for Packing Items",
+
+			},
 		]
 	}
 ]
diff --git a/selling/report/available_stock_for_packing_items/__init__.py b/selling/report/available_stock_for_packing_items/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/selling/report/available_stock_for_packing_items/__init__.py
diff --git a/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py b/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py
new file mode 100644
index 0000000..d766c44
--- /dev/null
+++ b/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py
@@ -0,0 +1,89 @@
+# ERPNext - web based ERP (http://erpnext.com)
+# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+import webnotes
+from webnotes.utils import cint
+
+def execute(filters=None):
+	if not filters: filters = {}
+	
+	columns = get_columns()
+	item_warehouse_quantity_map = get_item_warehouse_quantity_map()
+
+	data = []
+	for item, warehouse in item_warehouse_quantity_map.items():
+		item_details = get_item_details(item)[0]
+		total = 0
+		total_qty = 0
+		for wh, item_qty in warehouse.items():
+			total += 1
+			row = [item, item_details.item_name, item_details.description, \
+			item_details.stock_uom, wh]
+			for quantity in item_qty.items():
+				max_qty = []
+				max_qty.append(quantity[1])
+			max_qty = min(max_qty)
+			total_qty += cint(max_qty.qty)
+			row += [max_qty.qty]
+			data.append(row)
+			if (total == len(warehouse)):
+				row = ["", "", "Total", "", "", total_qty]
+				data.append(row)
+
+	return columns, data
+	
+def get_columns():
+	columns = ["Item Code:Link/Item:100", "Item Name::100", "Description::120", \
+			"UOM:Link/UOM:80", "Warehouse:Link/Warehouse:100", "Quantity::100"]
+
+	return columns
+
+def get_sales_bom():
+	return webnotes.conn.sql("""select name from `tabSales BOM`""",	as_dict=1)
+
+def get_sales_bom_items(item):
+	return webnotes.conn.sql("""select parent, item_code, qty from `tabSales BOM Item` 
+		where parent=%s""", (item), as_dict=1)
+
+def get_item_details(item):
+	return webnotes.conn.sql("""select name, item_name, description, stock_uom 
+		from `tabItem` where name=%s""", (item), as_dict=1)
+
+def get_item_warehouse_quantity(item):
+	return webnotes.conn.sql("""select item_code, warehouse, actual_qty from `tabBin` 
+		where item_code=%s""", (item), as_dict=1)
+
+def get_item_warehouse_quantity_map():
+	iwq_map = {}
+
+	sales_bom = get_sales_bom()
+
+	for item in sales_bom:
+		child_item = get_sales_bom_items(item.name)
+		for child in child_item:
+			item_warehouse_quantity = get_item_warehouse_quantity(child.item_code)
+			for iwq in item_warehouse_quantity:
+				iwq_map.setdefault(item.name, {}).setdefault(iwq.warehouse, {}).\
+				setdefault(child.item_code, webnotes._dict({
+					"qty" : 0
+				}))
+
+				q_dict = iwq_map[item.name][iwq.warehouse][child.item_code]
+				
+				q_dict.qty = cint(iwq.actual_qty / child.qty)
+
+	return iwq_map
\ No newline at end of file
diff --git a/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt b/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt
new file mode 100644
index 0000000..5cf4133
--- /dev/null
+++ b/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt
@@ -0,0 +1,21 @@
+[
+ {
+  "creation": "2013-06-21 13:40:05", 
+  "docstatus": 0, 
+  "modified": "2013-06-21 15:06:40", 
+  "modified_by": "Administrator", 
+  "owner": "Administrator"
+ }, 
+ {
+  "doctype": "Report", 
+  "is_standard": "Yes", 
+  "name": "__common__", 
+  "ref_doctype": "Sales BOM", 
+  "report_name": "Available Stock for Packing Items", 
+  "report_type": "Script Report"
+ }, 
+ {
+  "doctype": "Report", 
+  "name": "Available Stock for Packing Items"
+ }
+]
\ No newline at end of file