Add allow_negative_stock toggle for sales, remissions, quotes, layaways and service orders
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user