asv-hlps 1.3.46 → 1.3.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/auth/models/AuthTag.d.ts +1 -1
- package/lib/cjs/auth/models/AuthTagCat.d.ts +1 -1
- package/lib/cjs/estates/models/EstateCat.d.ts +1 -1
- package/lib/cjs/estates/models/EstateElt.d.ts +1 -1
- package/lib/cjs/estates/models/EstateLevel.d.ts +1 -1
- package/lib/cjs/estates/models/EstatePor.d.ts +1 -1
- package/lib/cjs/index.d.ts +7 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/products/index.d.ts +1 -0
- package/lib/cjs/products/index.js +1 -0
- package/lib/cjs/products/models/ProductMvt.d.ts +1 -1
- package/lib/cjs/products/product.d.ts +4 -0
- package/lib/cjs/products/product.js +23 -0
- package/lib/cjs/query-builder/hlpQbuilder.d.ts +1 -1
- package/lib/cjs/sales/index.d.ts +2 -0
- package/lib/cjs/sales/index.js +18 -0
- package/lib/cjs/sales/sale.js +1 -1
- package/lib/cjs/shared/index.d.ts +1 -6
- package/lib/cjs/shared/index.js +14 -5
- package/lib/cjs/shared/models/EDate.d.ts +8 -0
- package/lib/cjs/shared/models/EDate.js +11 -0
- package/lib/cjs/shared/models/EInOutMotive.d.ts +13 -0
- package/lib/cjs/shared/models/EInOutMotive.js +16 -0
- package/lib/cjs/shared/models/EPayMethod.d.ts +6 -0
- package/lib/cjs/shared/models/EPayMethod.js +9 -0
- package/lib/cjs/shared/models/IParam.d.ts +26 -0
- package/lib/cjs/shared/models/IParam.js +2 -0
- package/lib/cjs/shared/models/IPath.d.ts +14 -0
- package/lib/cjs/shared/models/IPath.js +11 -0
- package/lib/cjs/shared/models/NaAc.d.ts +6 -0
- package/lib/cjs/shared/models/NaAc.js +2 -0
- package/lib/cjs/shared/models/NaCoAc.d.ts +4 -0
- package/lib/cjs/shared/models/NaCoAc.js +2 -0
- package/lib/cjs/shared/models/NaCoShortAc.d.ts +4 -0
- package/lib/cjs/shared/models/NaCoShortAc.js +2 -0
- package/lib/cjs/shared/models/index.d.ts +6 -0
- package/lib/cjs/shared/models/index.js +8 -0
- package/lib/cjs/users/index.d.ts +1 -0
- package/lib/cjs/users/index.js +1 -0
- package/lib/cjs/users/models/UserGrp.d.ts +1 -1
- package/lib/cjs/users/models/UserRole.d.ts +1 -1
- package/lib/esm/auth/models/AuthTag.d.ts +1 -1
- package/lib/esm/auth/models/AuthTagCat.d.ts +1 -1
- package/lib/esm/estates/models/EstateCat.d.ts +1 -1
- package/lib/esm/estates/models/EstateElt.d.ts +1 -1
- package/lib/esm/estates/models/EstateLevel.d.ts +1 -1
- package/lib/esm/estates/models/EstatePor.d.ts +1 -1
- package/lib/esm/index.d.ts +7 -0
- package/lib/esm/index.js +7 -0
- package/lib/esm/products/index.d.ts +1 -0
- package/lib/esm/products/index.js +1 -0
- package/lib/esm/products/models/ProductMvt.d.ts +1 -1
- package/lib/esm/products/product.d.ts +4 -0
- package/lib/esm/products/product.js +18 -0
- package/lib/esm/query-builder/hlpQbuilder.d.ts +1 -1
- package/lib/esm/sales/index.d.ts +2 -0
- package/lib/esm/sales/index.js +2 -0
- package/lib/esm/sales/sale.js +1 -1
- package/lib/esm/shared/index.d.ts +1 -6
- package/lib/esm/shared/index.js +1 -1
- package/lib/esm/shared/models/EDate.d.ts +8 -0
- package/lib/esm/shared/models/EDate.js +9 -0
- package/lib/esm/shared/models/EInOutMotive.d.ts +13 -0
- package/lib/esm/shared/models/EInOutMotive.js +14 -0
- package/lib/esm/shared/models/EPayMethod.d.ts +6 -0
- package/lib/esm/shared/models/EPayMethod.js +7 -0
- package/lib/esm/shared/models/IParam.d.ts +26 -0
- package/lib/esm/shared/models/IParam.js +1 -0
- package/lib/esm/shared/models/IPath.d.ts +14 -0
- package/lib/esm/shared/models/IPath.js +10 -0
- package/lib/esm/shared/models/NaAc.d.ts +6 -0
- package/lib/esm/shared/models/NaAc.js +1 -0
- package/lib/esm/shared/models/NaCoAc.d.ts +4 -0
- package/lib/esm/shared/models/NaCoAc.js +1 -0
- package/lib/esm/shared/models/NaCoShortAc.d.ts +4 -0
- package/lib/esm/shared/models/NaCoShortAc.js +1 -0
- package/lib/esm/shared/models/index.d.ts +6 -0
- package/lib/esm/shared/models/index.js +1 -0
- package/lib/esm/users/index.d.ts +1 -0
- package/lib/esm/users/index.js +1 -0
- package/lib/esm/users/models/UserGrp.d.ts +1 -1
- package/lib/esm/users/models/UserRole.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/index.d.ts
CHANGED
|
@@ -9,4 +9,11 @@ export * from "./estates";
|
|
|
9
9
|
export * from "./mails/models";
|
|
10
10
|
export * from "./npms/typeorm";
|
|
11
11
|
export * from "./npms/yup";
|
|
12
|
+
export * from "./salaries";
|
|
13
|
+
export * from "./sales";
|
|
14
|
+
export * from "./shared";
|
|
15
|
+
export * from "./storage";
|
|
16
|
+
export * from "./users";
|
|
17
|
+
export * from "./utilities";
|
|
12
18
|
export * from "./utils";
|
|
19
|
+
export * from "./world";
|
package/lib/cjs/index.js
CHANGED
|
@@ -94,4 +94,11 @@ __exportStar(require("./estates"), exports);
|
|
|
94
94
|
__exportStar(require("./mails/models"), exports);
|
|
95
95
|
__exportStar(require("./npms/typeorm"), exports);
|
|
96
96
|
__exportStar(require("./npms/yup"), exports);
|
|
97
|
+
__exportStar(require("./salaries"), exports);
|
|
98
|
+
__exportStar(require("./sales"), exports);
|
|
99
|
+
__exportStar(require("./shared"), exports);
|
|
100
|
+
__exportStar(require("./storage"), exports);
|
|
101
|
+
__exportStar(require("./users"), exports);
|
|
102
|
+
__exportStar(require("./utilities"), exports);
|
|
97
103
|
__exportStar(require("./utils"), exports);
|
|
104
|
+
__exportStar(require("./world"), exports);
|
|
@@ -21,3 +21,4 @@ exports.HlpProduct = void 0;
|
|
|
21
21
|
var hlpProduct_1 = require("./hlpProduct");
|
|
22
22
|
Object.defineProperty(exports, "HlpProduct", { enumerable: true, get: function () { return __importDefault(hlpProduct_1).default; } });
|
|
23
23
|
__exportStar(require("./models"), exports);
|
|
24
|
+
__exportStar(require("./product"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Currency from "../../cashs/models/Currency";
|
|
2
|
-
import EInOutMotive from "../../shared/EInOutMotive";
|
|
2
|
+
import EInOutMotive from "../../shared/models/EInOutMotive";
|
|
3
3
|
import Ste from "../../users/models/Ste";
|
|
4
4
|
import User from "../../users/models/User";
|
|
5
5
|
export default interface ProductMvt {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import Product from "./models/Product";
|
|
2
|
+
import User from "../users/models/User";
|
|
3
|
+
export declare const unitPriceByClientCat: (product: Product, client: User, speUnitPrice?: number, addDiscount?: boolean) => number;
|
|
4
|
+
export declare const productCatCode: (product: Product, catCodes: string[]) => boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.productCatCode = exports.unitPriceByClientCat = void 0;
|
|
4
|
+
const user_1 = require("../users/user");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const unitPriceByClientCat = (product, client, speUnitPrice = 0, addDiscount = false) => {
|
|
7
|
+
if (speUnitPrice > 0) {
|
|
8
|
+
return speUnitPrice;
|
|
9
|
+
}
|
|
10
|
+
// const store = await getCustomRepository(ProductStoreRepository).getOneStoreByParams({storeName: 'cpa', productId: product.id})
|
|
11
|
+
if (product.stores[0].discountRate && addDiscount) {
|
|
12
|
+
return Math.ceil(product.stores[0].salePrice) - Math.ceil((0, utils_1.calculPercent)(product.stores[0].salePrice, product.stores[0].discountRate));
|
|
13
|
+
}
|
|
14
|
+
const clientCoef = !client ? 1 : (0, user_1.userCoef)(client);
|
|
15
|
+
return (0, exports.productCatCode)(product, ["spe", "para"])
|
|
16
|
+
? Math.ceil(product.stores[0].salePrice)
|
|
17
|
+
: Math.ceil(product.stores[0].salePrice * clientCoef);
|
|
18
|
+
};
|
|
19
|
+
exports.unitPriceByClientCat = unitPriceByClientCat;
|
|
20
|
+
const productCatCode = (product, catCodes) => {
|
|
21
|
+
return catCodes.includes(product.cat.code && product.cat.code.toLowerCase());
|
|
22
|
+
};
|
|
23
|
+
exports.productCatCode = productCatCode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./models"), exports);
|
|
18
|
+
__exportStar(require("./sale"), exports);
|
package/lib/cjs/sales/sale.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.refSaleGenerator = exports.tabLabel = exports.getTotalQtityOdrOrDlvrOnSale = exports.getTotalQtityFreeOnSale = exports.getTotalQtityOnSale = exports.getTotalAmountDiscountOnSale = exports.getTotalShippingOnSale = exports.getTotalAmountAllIncludedOnSale = exports.getTotalAmountBackOnSale = exports.getTotalAmountOnSale = exports.getTotalTvaBackOnSale = exports.getTotalTvaOnSaleOnSale = exports.getTotalAmountWithoutTvaBackOnSale = exports.getTotalAmountWithoutTvaOnSale = exports.getSubTotalAmountBackOnSale = exports.getSubTotalAmountOnSale = exports.getTotalTvaOnSale = exports.getNbProductsOnSale = void 0;
|
|
4
|
-
const product_1 = require("../product");
|
|
4
|
+
const product_1 = require("../products/product");
|
|
5
5
|
const user_1 = require("../users/user");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const getNbProductsOnSale = (sale) => {
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { default as IParam } from "./IParam";
|
|
3
|
-
export { default as IPath } from "./IPath";
|
|
4
|
-
export { default as NaAc } from "./NaAc";
|
|
5
|
-
export { default as NaCoAc } from "./NaCoAc";
|
|
6
|
-
export { default as NaCoShortAc } from "./NaCoShortAc";
|
|
1
|
+
export * from "./models";
|
package/lib/cjs/shared/index.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports
|
|
7
|
-
var EInOutMotive_1 = require("./EInOutMotive");
|
|
8
|
-
Object.defineProperty(exports, "EInOutMotive", { enumerable: true, get: function () { return __importDefault(EInOutMotive_1).default; } });
|
|
17
|
+
__exportStar(require("./models"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var EDate;
|
|
4
|
+
(function (EDate) {
|
|
5
|
+
EDate["CURRENT_DATE"] = "currentDate";
|
|
6
|
+
EDate["CURRENT_MONTH"] = "currentMonth";
|
|
7
|
+
EDate["SUB_CURRENT_MONTH"] = "subCurrentMonth";
|
|
8
|
+
EDate["CURRENT_YEAR"] = "currentYear";
|
|
9
|
+
EDate["SUB_CURRENT_YEAR"] = "subCurrentYear";
|
|
10
|
+
})(EDate || (EDate = {}));
|
|
11
|
+
exports.default = EDate;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare enum EInOutMotive {
|
|
2
|
+
SALE = "vente",
|
|
3
|
+
BUY = "achat",
|
|
4
|
+
OUT = "outs",
|
|
5
|
+
IN = "ins",
|
|
6
|
+
INVENTORY = "inventory",
|
|
7
|
+
BEFORE_INVENTORY = "before_inventory",
|
|
8
|
+
ADJUSTMENT = "adjustment",
|
|
9
|
+
TRANSFERT = "transfert",
|
|
10
|
+
ON_EDIT = "modif stock",
|
|
11
|
+
GHOST = "Fantome"
|
|
12
|
+
}
|
|
13
|
+
export default EInOutMotive;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var EInOutMotive;
|
|
4
|
+
(function (EInOutMotive) {
|
|
5
|
+
EInOutMotive["SALE"] = "vente";
|
|
6
|
+
EInOutMotive["BUY"] = "achat";
|
|
7
|
+
EInOutMotive["OUT"] = "outs";
|
|
8
|
+
EInOutMotive["IN"] = "ins";
|
|
9
|
+
EInOutMotive["INVENTORY"] = "inventory";
|
|
10
|
+
EInOutMotive["BEFORE_INVENTORY"] = "before_inventory";
|
|
11
|
+
EInOutMotive["ADJUSTMENT"] = "adjustment";
|
|
12
|
+
EInOutMotive["TRANSFERT"] = "transfert";
|
|
13
|
+
EInOutMotive["ON_EDIT"] = "modif stock";
|
|
14
|
+
EInOutMotive["GHOST"] = "Fantome";
|
|
15
|
+
})(EInOutMotive || (EInOutMotive = {}));
|
|
16
|
+
exports.default = EInOutMotive;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var EPayMethod;
|
|
4
|
+
(function (EPayMethod) {
|
|
5
|
+
EPayMethod["CASH"] = "esp\u00E8ces";
|
|
6
|
+
EPayMethod["TRANSFER"] = "virement";
|
|
7
|
+
EPayMethod["BANKCHECK"] = "ch\u00E8que";
|
|
8
|
+
})(EPayMethod || (EPayMethod = {}));
|
|
9
|
+
exports.default = EPayMethod;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import EDate from "./EDate";
|
|
2
|
+
export default interface IInOrNot {
|
|
3
|
+
ins?: string[];
|
|
4
|
+
notIns?: string[];
|
|
5
|
+
steId?: number;
|
|
6
|
+
steName?: string;
|
|
7
|
+
}
|
|
8
|
+
export default interface IParam {
|
|
9
|
+
steId?: number;
|
|
10
|
+
userId?: number;
|
|
11
|
+
clientId?: number;
|
|
12
|
+
code?: string;
|
|
13
|
+
role?: string;
|
|
14
|
+
steName?: string;
|
|
15
|
+
steNames?: string[];
|
|
16
|
+
steGrpCodes?: IInOrNot;
|
|
17
|
+
grpCodes?: IInOrNot;
|
|
18
|
+
roleCodes?: IInOrNot;
|
|
19
|
+
roleCode?: string;
|
|
20
|
+
opDate?: EDate;
|
|
21
|
+
store?: string;
|
|
22
|
+
dates?: any;
|
|
23
|
+
storeName?: string;
|
|
24
|
+
grpByYear?: boolean;
|
|
25
|
+
grpByYearMonth?: boolean;
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default interface IPath {
|
|
2
|
+
id: number | string;
|
|
3
|
+
key?: string | number;
|
|
4
|
+
title: any;
|
|
5
|
+
link?: string;
|
|
6
|
+
default?: boolean;
|
|
7
|
+
icon?: string;
|
|
8
|
+
param?: any;
|
|
9
|
+
auth?: boolean;
|
|
10
|
+
ms?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
state?: any;
|
|
13
|
+
Content?: any;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as EInOutMotive } from "./EInOutMotive";
|
|
2
|
+
export { default as IParam } from "./IParam";
|
|
3
|
+
export { default as IPath } from "./IPath";
|
|
4
|
+
export { default as NaAc } from "./NaAc";
|
|
5
|
+
export { default as NaCoAc } from "./NaCoAc";
|
|
6
|
+
export { default as NaCoShortAc } from "./NaCoShortAc";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EInOutMotive = void 0;
|
|
7
|
+
var EInOutMotive_1 = require("./EInOutMotive");
|
|
8
|
+
Object.defineProperty(exports, "EInOutMotive", { enumerable: true, get: function () { return __importDefault(EInOutMotive_1).default; } });
|
package/lib/cjs/users/index.d.ts
CHANGED
package/lib/cjs/users/index.js
CHANGED
package/lib/esm/index.d.ts
CHANGED
|
@@ -9,4 +9,11 @@ export * from "./estates";
|
|
|
9
9
|
export * from "./mails/models";
|
|
10
10
|
export * from "./npms/typeorm";
|
|
11
11
|
export * from "./npms/yup";
|
|
12
|
+
export * from "./salaries";
|
|
13
|
+
export * from "./sales";
|
|
14
|
+
export * from "./shared";
|
|
15
|
+
export * from "./storage";
|
|
16
|
+
export * from "./users";
|
|
17
|
+
export * from "./utilities";
|
|
12
18
|
export * from "./utils";
|
|
19
|
+
export * from "./world";
|
package/lib/esm/index.js
CHANGED
|
@@ -78,4 +78,11 @@ export * from "./estates";
|
|
|
78
78
|
export * from "./mails/models";
|
|
79
79
|
export * from "./npms/typeorm";
|
|
80
80
|
export * from "./npms/yup";
|
|
81
|
+
export * from "./salaries";
|
|
82
|
+
export * from "./sales";
|
|
83
|
+
export * from "./shared";
|
|
84
|
+
export * from "./storage";
|
|
85
|
+
export * from "./users";
|
|
86
|
+
export * from "./utilities";
|
|
81
87
|
export * from "./utils";
|
|
88
|
+
export * from "./world";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Currency from "../../cashs/models/Currency";
|
|
2
|
-
import EInOutMotive from "../../shared/EInOutMotive";
|
|
2
|
+
import EInOutMotive from "../../shared/models/EInOutMotive";
|
|
3
3
|
import Ste from "../../users/models/Ste";
|
|
4
4
|
import User from "../../users/models/User";
|
|
5
5
|
export default interface ProductMvt {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import Product from "./models/Product";
|
|
2
|
+
import User from "../users/models/User";
|
|
3
|
+
export declare const unitPriceByClientCat: (product: Product, client: User, speUnitPrice?: number, addDiscount?: boolean) => number;
|
|
4
|
+
export declare const productCatCode: (product: Product, catCodes: string[]) => boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { userCoef } from "../users/user";
|
|
2
|
+
import { calculPercent } from "../utils";
|
|
3
|
+
export const unitPriceByClientCat = (product, client, speUnitPrice = 0, addDiscount = false) => {
|
|
4
|
+
if (speUnitPrice > 0) {
|
|
5
|
+
return speUnitPrice;
|
|
6
|
+
}
|
|
7
|
+
// const store = await getCustomRepository(ProductStoreRepository).getOneStoreByParams({storeName: 'cpa', productId: product.id})
|
|
8
|
+
if (product.stores[0].discountRate && addDiscount) {
|
|
9
|
+
return Math.ceil(product.stores[0].salePrice) - Math.ceil(calculPercent(product.stores[0].salePrice, product.stores[0].discountRate));
|
|
10
|
+
}
|
|
11
|
+
const clientCoef = !client ? 1 : userCoef(client);
|
|
12
|
+
return productCatCode(product, ["spe", "para"])
|
|
13
|
+
? Math.ceil(product.stores[0].salePrice)
|
|
14
|
+
: Math.ceil(product.stores[0].salePrice * clientCoef);
|
|
15
|
+
};
|
|
16
|
+
export const productCatCode = (product, catCodes) => {
|
|
17
|
+
return catCodes.includes(product.cat.code && product.cat.code.toLowerCase());
|
|
18
|
+
};
|
package/lib/esm/sales/sale.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unitPriceByClientCat } from "../product";
|
|
1
|
+
import { unitPriceByClientCat } from "../products/product";
|
|
2
2
|
import { labelSteName } from "../users/user";
|
|
3
3
|
import { dateFormatter, formatToStringCfa, removeBackSlashOccurences } from "../utils";
|
|
4
4
|
export const getNbProductsOnSale = (sale) => {
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { default as IParam } from "./IParam";
|
|
3
|
-
export { default as IPath } from "./IPath";
|
|
4
|
-
export { default as NaAc } from "./NaAc";
|
|
5
|
-
export { default as NaCoAc } from "./NaCoAc";
|
|
6
|
-
export { default as NaCoShortAc } from "./NaCoShortAc";
|
|
1
|
+
export * from "./models";
|
package/lib/esm/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./models";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var EDate;
|
|
2
|
+
(function (EDate) {
|
|
3
|
+
EDate["CURRENT_DATE"] = "currentDate";
|
|
4
|
+
EDate["CURRENT_MONTH"] = "currentMonth";
|
|
5
|
+
EDate["SUB_CURRENT_MONTH"] = "subCurrentMonth";
|
|
6
|
+
EDate["CURRENT_YEAR"] = "currentYear";
|
|
7
|
+
EDate["SUB_CURRENT_YEAR"] = "subCurrentYear";
|
|
8
|
+
})(EDate || (EDate = {}));
|
|
9
|
+
export default EDate;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare enum EInOutMotive {
|
|
2
|
+
SALE = "vente",
|
|
3
|
+
BUY = "achat",
|
|
4
|
+
OUT = "outs",
|
|
5
|
+
IN = "ins",
|
|
6
|
+
INVENTORY = "inventory",
|
|
7
|
+
BEFORE_INVENTORY = "before_inventory",
|
|
8
|
+
ADJUSTMENT = "adjustment",
|
|
9
|
+
TRANSFERT = "transfert",
|
|
10
|
+
ON_EDIT = "modif stock",
|
|
11
|
+
GHOST = "Fantome"
|
|
12
|
+
}
|
|
13
|
+
export default EInOutMotive;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var EInOutMotive;
|
|
2
|
+
(function (EInOutMotive) {
|
|
3
|
+
EInOutMotive["SALE"] = "vente";
|
|
4
|
+
EInOutMotive["BUY"] = "achat";
|
|
5
|
+
EInOutMotive["OUT"] = "outs";
|
|
6
|
+
EInOutMotive["IN"] = "ins";
|
|
7
|
+
EInOutMotive["INVENTORY"] = "inventory";
|
|
8
|
+
EInOutMotive["BEFORE_INVENTORY"] = "before_inventory";
|
|
9
|
+
EInOutMotive["ADJUSTMENT"] = "adjustment";
|
|
10
|
+
EInOutMotive["TRANSFERT"] = "transfert";
|
|
11
|
+
EInOutMotive["ON_EDIT"] = "modif stock";
|
|
12
|
+
EInOutMotive["GHOST"] = "Fantome";
|
|
13
|
+
})(EInOutMotive || (EInOutMotive = {}));
|
|
14
|
+
export default EInOutMotive;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import EDate from "./EDate";
|
|
2
|
+
export default interface IInOrNot {
|
|
3
|
+
ins?: string[];
|
|
4
|
+
notIns?: string[];
|
|
5
|
+
steId?: number;
|
|
6
|
+
steName?: string;
|
|
7
|
+
}
|
|
8
|
+
export default interface IParam {
|
|
9
|
+
steId?: number;
|
|
10
|
+
userId?: number;
|
|
11
|
+
clientId?: number;
|
|
12
|
+
code?: string;
|
|
13
|
+
role?: string;
|
|
14
|
+
steName?: string;
|
|
15
|
+
steNames?: string[];
|
|
16
|
+
steGrpCodes?: IInOrNot;
|
|
17
|
+
grpCodes?: IInOrNot;
|
|
18
|
+
roleCodes?: IInOrNot;
|
|
19
|
+
roleCode?: string;
|
|
20
|
+
opDate?: EDate;
|
|
21
|
+
store?: string;
|
|
22
|
+
dates?: any;
|
|
23
|
+
storeName?: string;
|
|
24
|
+
grpByYear?: boolean;
|
|
25
|
+
grpByYearMonth?: boolean;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default interface IPath {
|
|
2
|
+
id: number | string;
|
|
3
|
+
key?: string | number;
|
|
4
|
+
title: any;
|
|
5
|
+
link?: string;
|
|
6
|
+
default?: boolean;
|
|
7
|
+
icon?: string;
|
|
8
|
+
param?: any;
|
|
9
|
+
auth?: boolean;
|
|
10
|
+
ms?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
state?: any;
|
|
13
|
+
Content?: any;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as EInOutMotive } from "./EInOutMotive";
|
|
2
|
+
export { default as IParam } from "./IParam";
|
|
3
|
+
export { default as IPath } from "./IPath";
|
|
4
|
+
export { default as NaAc } from "./NaAc";
|
|
5
|
+
export { default as NaCoAc } from "./NaCoAc";
|
|
6
|
+
export { default as NaCoShortAc } from "./NaCoShortAc";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as EInOutMotive } from "./EInOutMotive";
|
package/lib/esm/users/index.d.ts
CHANGED
package/lib/esm/users/index.js
CHANGED