Skip to content

Commit 3793c3f

Browse files
committed
updated promotion api
1 parent 7408164 commit 3793c3f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

gpos/gpos/pos.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,8 +1257,6 @@ def create_invoice_unsynced(date_time, invoice_number, clearing_status,type="Sal
12571257
return Response(json.dumps({"status": "error", "message": str(e)}), status=500, mimetype="application/json")
12581258

12591259

1260-
1261-
12621260
@frappe.whitelist(allow_guest=True)
12631261
def parse_json_field(field):
12641262
try:
@@ -2349,7 +2347,10 @@ def get_promotion_list(pos_profile):
23492347
if uom_row.uom == item.uom:
23502348
matched_uom_row = uom_row
23512349
break
2352-
2350+
price_after_discount = (
2351+
float(item.price_after_discount)
2352+
if item.price_after_discount is not None
2353+
else None)
23532354
item_table.append(
23542355
{
23552356
"id": item.name,
@@ -2375,6 +2376,7 @@ def get_promotion_list(pos_profile):
23752376
"discount_percentage": item.discount_percentage,
23762377
"discount_price": item.discount__amount,
23772378
"price_after_discount":float(item.price_after_discount) if item.price_after_discount is not None else None,
2379+
"is_free": True if price_after_discount == 0 else False,
23782380
"uom_id": matched_uom_row.name if matched_uom_row else None,
23792381
"uom": item.uom,
23802382
}

0 commit comments

Comments
 (0)