fixes in packing slip
diff --git a/stock/DocType Mapper/Delivery Note-Packing Slip/Delivery Note-Packing Slip.txt b/stock/DocType Mapper/Delivery Note-Packing Slip/Delivery Note-Packing Slip.txt
index 79b17c2..fc88bba 100644
--- a/stock/DocType Mapper/Delivery Note-Packing Slip/Delivery Note-Packing Slip.txt
+++ b/stock/DocType Mapper/Delivery Note-Packing Slip/Delivery Note-Packing Slip.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2012-02-02 11:50:33", 
   "docstatus": 0, 
-  "modified": "2013-04-05 16:08:22", 
+  "modified": "2013-04-16 12:26:28", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -61,6 +61,13 @@
   "to_field": "dn_detail"
  }, 
  {
+  "doctype": "Field Mapper Detail", 
+  "from_field": "eval: flt(obj.qty) - flt(obj.packed_qty)", 
+  "map": "Yes", 
+  "match_id": 1, 
+  "to_field": "qty"
+ }, 
+ {
   "doctype": "Table Mapper Detail", 
   "from_table": "Delivery Note", 
   "match_id": 0, 
diff --git a/stock/doctype/packing_slip/packing_slip.py b/stock/doctype/packing_slip/packing_slip.py
index 161c9bd..2632199 100644
--- a/stock/doctype/packing_slip/packing_slip.py
+++ b/stock/doctype/packing_slip/packing_slip.py
@@ -185,17 +185,6 @@
 
 
 	def set_item_details(self, row):
-		res = webnotes.conn.sql("""SELECT item_name, SUM(IFNULL(qty, 0)) as total_qty,
-			IFNULL(packed_qty,	0) as packed_qty, stock_uom
-			FROM `tabDelivery Note Item`
-			WHERE parent=%s AND item_code=%s GROUP BY item_code""",
-			(self.doc.delivery_note, row.item_code), as_dict=1)
-
-		if res and len(res)>0:
-			qty = res[0]['total_qty'] - res[0]['packed_qty']
-			if not row.qty:
-				row.qty = qty >= 0 and qty or 0
-
 		res = webnotes.conn.sql("""SELECT net_weight, weight_uom FROM `tabItem`
 			WHERE name=%s""", row.item_code, as_dict=1)