Skip to content

Commit 73ae435

Browse files
authored
Merge pull request #38 from ury-erp/menu-fetch
fix: fetch room-wise menu correctly and correct variable reference in…
2 parents c702d3a + dec88cd commit 73ae435

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

ury/ury/doctype/ury_order/ury_order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def sync_order(
261261
)
262262

263263
if not item_prices:
264-
frappe.throw(_("No item price found for Item: {0} in Price List: {1}. Please check the price list settings.").format(item.item_code, price_list))
264+
frappe.throw(_("No item price found for Item: {0} in Price List: {1}. Please check the price list settings.").format(d.get("item"), price_list))
265265

266266
else:
267267
invoice.append(

ury/ury_pos/api.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,7 @@ def getRestaurantMenu(pos_profile, room=None, order_type=None):
3030
branch_name = getBranch()
3131
restaurant = frappe.db.get_value("URY Restaurant", {"branch": branch_name}, "name")
3232

33-
if cashier and order_type:
34-
order_type_wise_menu = frappe.db.get_value(
35-
"URY Restaurant", restaurant, "order_type_wise_menu"
36-
)
37-
38-
if order_type_wise_menu:
39-
menu = frappe.db.get_value(
40-
"Order Type Menu",
41-
{"parent": restaurant, "order_type": order_type},
42-
"menu"
43-
)
44-
if not menu:
45-
menu = frappe.db.get_value("URY Restaurant", restaurant, "active_menu")
46-
47-
else:
48-
menu = frappe.db.get_value("URY Restaurant", restaurant, "active_menu")
49-
50-
elif room:
33+
if room:
5134

5235
room_wise_menu = frappe.db.get_value(
5336
"URY Restaurant", restaurant, "room_wise_menu"
@@ -63,7 +46,24 @@ def getRestaurantMenu(pos_profile, room=None, order_type=None):
6346
menu = frappe.db.get_value("URY Restaurant", restaurant, "active_menu")
6447
else:
6548
menu = frappe.db.get_value("URY Restaurant", restaurant, "active_menu")
49+
50+
elif cashier and order_type:
51+
order_type_wise_menu = frappe.db.get_value(
52+
"URY Restaurant", restaurant, "order_type_wise_menu"
53+
)
54+
55+
if order_type_wise_menu:
56+
menu = frappe.db.get_value(
57+
"Order Type Menu",
58+
{"parent": restaurant, "order_type": order_type},
59+
"menu"
60+
)
61+
if not menu:
62+
menu = frappe.db.get_value("URY Restaurant", restaurant, "active_menu")
6663

64+
else:
65+
menu = frappe.db.get_value("URY Restaurant", restaurant, "active_menu")
66+
6767
# Default menu if nothing is selected
6868
else:
6969
menu = frappe.db.get_value("URY Restaurant", restaurant, "active_menu")

0 commit comments

Comments
 (0)