From a811bee7ad7cdda1e01ea7cf7a47093e20b45fb9 Mon Sep 17 00:00:00 2001 From: lubshad Date: Fri, 12 Jun 2026 23:00:42 +0530 Subject: [PATCH 1/2] allow_promotional_offers and allow_coupons added into settings --- POS/src/components/sale/InvoiceCart.vue | 4 ++- POS/src/components/sale/PaymentDialog.vue | 4 ++- POS/src/components/settings/POSSettings.vue | 12 ++++++++ POS/src/stores/posSettings.js | 12 ++++++++ .../doctype/pos_settings/pos_settings.json | 28 ++++++++++++++----- 5 files changed, 51 insertions(+), 9 deletions(-) diff --git a/POS/src/components/sale/InvoiceCart.vue b/POS/src/components/sale/InvoiceCart.vue index d91835154..b632cbaca 100644 --- a/POS/src/components/sale/InvoiceCart.vue +++ b/POS/src/components/sale/InvoiceCart.vue @@ -464,9 +464,10 @@ -
+
@@ -617,6 +627,8 @@ const settings = ref({ silent_print: 0, allow_negative_stock: 0, tax_inclusive: 0, + allow_promotional_offers: 1, + allow_coupons: 1, }) // Stock Sync Settings (localStorage persisted) diff --git a/POS/src/stores/posSettings.js b/POS/src/stores/posSettings.js index 9278faf4e..205df3730 100644 --- a/POS/src/stores/posSettings.js +++ b/POS/src/stores/posSettings.js @@ -48,6 +48,8 @@ export const usePOSSettingsStore = defineStore("posSettings", () => { allow_customer_purchase_order: 0, allow_duplicate_customer_names: 0, fetch_coupon: 0, + allow_promotional_offers: 1, + allow_coupons: 1, // Printing allow_print_last_invoice: 0, silent_print: 0, @@ -183,6 +185,12 @@ export const usePOSSettingsStore = defineStore("posSettings", () => { Boolean(settings.value.allow_duplicate_customer_names), ) const fetchCoupon = computed(() => Boolean(settings.value.fetch_coupon)) + const allowPromotionalOffers = computed(() => { + return settings.value.allow_promotional_offers !== undefined ? Boolean(settings.value.allow_promotional_offers) : true + }) + const allowCoupons = computed(() => { + return settings.value.allow_coupons !== undefined ? Boolean(settings.value.allow_coupons) : true + }) // Computed - Printing const allowPrintLastInvoice = computed(() => @@ -330,6 +338,8 @@ export const usePOSSettingsStore = defineStore("posSettings", () => { allow_customer_purchase_order: 0, allow_duplicate_customer_names: 0, fetch_coupon: 0, + allow_promotional_offers: 1, + allow_coupons: 1, allow_print_last_invoice: 0, silent_print: 0, use_delivery_charges: 0, @@ -451,6 +461,8 @@ export const usePOSSettingsStore = defineStore("posSettings", () => { allowCustomerPurchaseOrder, allowDuplicateCustomerNames, fetchCoupon, + allowPromotionalOffers, + allowCoupons, // Computed - Printing allowPrintLastInvoice, diff --git a/pos_next/pos_next/doctype/pos_settings/pos_settings.json b/pos_next/pos_next/doctype/pos_settings/pos_settings.json index 5aa983bbe..f4ae3155b 100644 --- a/pos_next/pos_next/doctype/pos_settings/pos_settings.json +++ b/pos_next/pos_next/doctype/pos_settings/pos_settings.json @@ -403,13 +403,27 @@ "fieldtype": "Check", "label": "Allow Duplicate Customer Names" }, - { - "default": "0", - "description": "Automatically apply eligible coupons", - "fieldname": "fetch_coupon", - "fieldtype": "Check", - "label": "Auto Fetch Coupon Gifts" - }, + { + "default": "0", + "description": "Automatically apply eligible coupons", + "fieldname": "fetch_coupon", + "fieldtype": "Check", + "label": "Auto Fetch Coupon Gifts" + }, + { + "default": "1", + "description": "Allow applying promotional offers on the cart", + "fieldname": "allow_promotional_offers", + "fieldtype": "Check", + "label": "Allow Promotional Offers" + }, + { + "default": "1", + "description": "Allow applying coupons on the cart", + "fieldname": "allow_coupons", + "fieldtype": "Check", + "label": "Allow Coupons" + }, { "collapsible": 1, "fieldname": "section_break_printing", From f54dd93d827ece94ff3faea68d80617ae4dfd888 Mon Sep 17 00:00:00 2001 From: lubshad Date: Sat, 13 Jun 2026 23:48:17 +0530 Subject: [PATCH 2/2] conflict fix --- POS/src/stores/posSettings.js | 12 ++++++------ pos_next/api/constants.py | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/POS/src/stores/posSettings.js b/POS/src/stores/posSettings.js index 205df3730..0b49303bd 100644 --- a/POS/src/stores/posSettings.js +++ b/POS/src/stores/posSettings.js @@ -48,8 +48,8 @@ export const usePOSSettingsStore = defineStore("posSettings", () => { allow_customer_purchase_order: 0, allow_duplicate_customer_names: 0, fetch_coupon: 0, - allow_promotional_offers: 1, - allow_coupons: 1, + allow_promotional_offers: 0, + allow_coupons: 0, // Printing allow_print_last_invoice: 0, silent_print: 0, @@ -186,10 +186,10 @@ export const usePOSSettingsStore = defineStore("posSettings", () => { ) const fetchCoupon = computed(() => Boolean(settings.value.fetch_coupon)) const allowPromotionalOffers = computed(() => { - return settings.value.allow_promotional_offers !== undefined ? Boolean(settings.value.allow_promotional_offers) : true + return Number(settings.value.allow_promotional_offers) === 1 }) const allowCoupons = computed(() => { - return settings.value.allow_coupons !== undefined ? Boolean(settings.value.allow_coupons) : true + return Number(settings.value.allow_coupons) === 1 }) // Computed - Printing @@ -338,8 +338,8 @@ export const usePOSSettingsStore = defineStore("posSettings", () => { allow_customer_purchase_order: 0, allow_duplicate_customer_names: 0, fetch_coupon: 0, - allow_promotional_offers: 1, - allow_coupons: 1, + allow_promotional_offers: 0, + allow_coupons: 0, allow_print_last_invoice: 0, silent_print: 0, use_delivery_charges: 0, diff --git a/pos_next/api/constants.py b/pos_next/api/constants.py index 059c04ea0..abd63789a 100644 --- a/pos_next/api/constants.py +++ b/pos_next/api/constants.py @@ -37,6 +37,8 @@ "allow_sales_order", "allow_select_sales_order", "create_only_sales_order", + "allow_promotional_offers", + "allow_coupons", "enable_session_lock", "session_lock_timeout", "show_variants_as_items", @@ -67,6 +69,8 @@ "allow_sales_order": 0, "allow_select_sales_order": 0, "create_only_sales_order": 0, + "allow_promotional_offers": 1, + "allow_coupons": 1, "enable_session_lock": 0, "session_lock_timeout": 5, "show_variants_as_items": 0,