[fixes] pulling available qty on selection of item in case of pos
diff --git a/selling/doctype/sales_common/sales_common.py b/selling/doctype/sales_common/sales_common.py
index 78f8422..549128f 100644
--- a/selling/doctype/sales_common/sales_common.py
+++ b/selling/doctype/sales_common/sales_common.py
@@ -132,6 +132,7 @@
where name = %s and (ifnull(end_of_life,'')='' or end_of_life > now()
or end_of_life = '0000-00-00') and (is_sales_item = 'Yes'
or is_service_item = 'Yes')""", args['item_code'], as_dict=1)
+
tax = webnotes.conn.sql("""select tax_type, tax_rate from `tabItem Tax`
where parent = %s""", args['item_code'])
t = {}
@@ -167,8 +168,9 @@
ret['export_rate'] = flt(base_ref_rate)/flt(obj.doc.conversion_rate)
ret['base_ref_rate'] = flt(base_ref_rate)
ret['basic_rate'] = flt(base_ref_rate)
-
+
if ret['warehouse'] or ret['reserved_warehouse']:
+
av_qty = self.get_available_qty({'item_code': args['item_code'], 'warehouse': ret['warehouse'] or ret['reserved_warehouse']})
ret.update(av_qty)
@@ -179,7 +181,7 @@
(args['item_code'], obj.doc.customer))
if customer_item_code_row and customer_item_code_row[0][0]:
ret['customer_item_code'] = customer_item_code_row[0][0]
-
+
return ret