Merge pull request #19618 from nextchamp-saqib/pos_fix
fix: stock qty not displayed in pos
This commit is contained in:
commit
26c46282e8
@ -357,14 +357,11 @@ def get_customer_wise_price_list():
|
|||||||
|
|
||||||
def get_bin_data(pos_profile):
|
def get_bin_data(pos_profile):
|
||||||
itemwise_bin_data = {}
|
itemwise_bin_data = {}
|
||||||
cond = "1=1"
|
filters = { 'actual_qty': ['>', 0] }
|
||||||
if pos_profile.get('warehouse'):
|
if pos_profile.get('warehouse'):
|
||||||
cond = "warehouse = %(warehouse)s"
|
filters.update({ 'warehouse': pos_profile.get('warehouse') })
|
||||||
|
|
||||||
bin_data = frappe.db.sql(""" select item_code, warehouse, actual_qty from `tabBin`
|
bin_data = frappe.db.get_all('Bin', fields = ['item_code', 'warehouse', 'actual_qty'], filters=filters)
|
||||||
where actual_qty > 0 and {cond}""".format(cond=cond), {
|
|
||||||
'warehouse': frappe.db.escape(pos_profile.get('warehouse'))
|
|
||||||
}, as_dict=1)
|
|
||||||
|
|
||||||
for bins in bin_data:
|
for bins in bin_data:
|
||||||
if bins.item_code not in itemwise_bin_data:
|
if bins.item_code not in itemwise_bin_data:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user