Skip to content

Commit

Permalink
fix pos taking price list from user (now taking normal prices)
Browse files Browse the repository at this point in the history
  • Loading branch information
bvisible committed Sep 25, 2023
1 parent 3c86726 commit 15d4ff6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion erpnext/selling/page/point_of_sale/point_of_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def get_items(start, page_length, price_list, item_group, pos_profile, search_te
for d in item_prices_data:
item_prices[d.item_code] = d
#////
promo = get_price(d.item_code, price_list, '', company)
promo = get_price(d.item_code, price_list, '', company, from_pos=True)
if promo:
item_promos[d.item_code] = float(promo.get('price_list_rate')) if promo.get('formatted_mrp') else '-1'
#////
Expand Down
10 changes: 6 additions & 4 deletions erpnext/utilities/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def qty_from_all_warehouses(batch_info):
return qty


def get_price(item_code, price_list, customer_group, company, qty=1):
def get_price(item_code, price_list, customer_group, company, qty=1, from_pos=False): #//// added from_pos=False
from erpnext.e_commerce.shopping_cart.cart import get_party

template_item_code = frappe.db.get_value("Item", item_code, "variant_of")
Expand All @@ -98,7 +98,7 @@ def get_price(item_code, price_list, customer_group, company, qty=1):
)

if price:
party = get_party()
#////party = get_party()
pricing_rule_dict = frappe._dict(
{
"item_code": item_code,
Expand All @@ -115,8 +115,10 @@ def get_price(item_code, price_list, customer_group, company, qty=1):
}
)

if party and party.doctype == "Customer":
pricing_rule_dict.update({"customer": party.name})
if not from_pos: #////
party = get_party() #//// moved here
if party and party.doctype == "Customer":
pricing_rule_dict.update({"customer": party.name})

pricing_rule = get_pricing_rule_for_item(pricing_rule_dict)
price_obj = price[0]
Expand Down

0 comments on commit 15d4ff6

Please sign in to comment.