Add allow_negative_stock toggle for sales, remissions, quotes, layaways and service orders
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled

This commit is contained in:
2026-07-15 18:02:43 +00:00
parent 116d4452da
commit c90012ca37
7 changed files with 76 additions and 44 deletions

View File

@@ -33,6 +33,7 @@ const POS = (() => {
let canCreateRemission = false;
let counterRemissionEnabled = false;
let allowZeroPriceSales = true;
let allowNegativeStock = false;
let currentPerms = [];
let receiptConfig = {};
let couriers = [];
@@ -143,12 +144,14 @@ const POS = (() => {
} catch (e) {
counterRemissionEnabled = false;
}
// Sales settings (zero-price sales toggle)
// Sales settings (zero-price and negative-stock toggles)
try {
const ssCfg = await api('/pos/api/config/sales-settings');
allowZeroPriceSales = ssCfg.allow_zero_price_sales !== false;
allowNegativeStock = ssCfg.allow_negative_stock === true;
} catch (e) {
allowZeroPriceSales = true;
allowNegativeStock = false;
}
// Counter remission workflow applies only to the counter role.
canCreateRemission = counterRemissionEnabled && employeeRole === 'counter' && perms.includes('pos.remission');