asv-hlps 1.3.64 → 1.3.66
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/products/models/IProductParams.d.ts +18 -0
- package/lib/cjs/products/models/IProductParams.js +2 -0
- package/lib/cjs/products/product.d.ts +1 -0
- package/lib/cjs/products/product.js +15 -1
- package/lib/cjs/query-builder/hlpQbuilder.d.ts +1 -1
- package/lib/cjs/shared/models/IParam.d.ts +12 -2
- package/lib/cjs/shared/models/index.d.ts +2 -1
- package/lib/esm/products/models/IProductParams.d.ts +18 -0
- package/lib/esm/products/models/IProductParams.js +1 -0
- package/lib/esm/products/product.d.ts +1 -0
- package/lib/esm/products/product.js +13 -0
- package/lib/esm/query-builder/hlpQbuilder.d.ts +1 -1
- package/lib/esm/shared/models/IParam.d.ts +12 -2
- package/lib/esm/shared/models/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IParam } from "../../shared/models/IParam";
|
|
2
|
+
export interface IProductParams extends IParam {
|
|
3
|
+
pdtId?: number;
|
|
4
|
+
agcyId?: number;
|
|
5
|
+
pvdId?: number;
|
|
6
|
+
laboId?: number;
|
|
7
|
+
catCode?: string;
|
|
8
|
+
isActive?: boolean;
|
|
9
|
+
isAvailable?: boolean;
|
|
10
|
+
isPublished?: boolean;
|
|
11
|
+
withLabo?: boolean;
|
|
12
|
+
inEqeer?: boolean;
|
|
13
|
+
dciId?: number;
|
|
14
|
+
fgId?: number;
|
|
15
|
+
sofId?: number;
|
|
16
|
+
dosId?: number;
|
|
17
|
+
grpByPdt?: boolean;
|
|
18
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import User from "../users/models/User";
|
|
2
2
|
import Product from "./models/Product";
|
|
3
3
|
export declare const unitPriceByClientCat: (product: Product, client: User, speUnitPrice?: number, addDiscount?: boolean) => number;
|
|
4
|
+
export declare const unitPriceByClientCatInPhcy: (product: Product, client: User, speUnitPrice?: number, addDiscount?: boolean) => number;
|
|
4
5
|
export declare const productCatCode: (product: Product, catCodes: string[]) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.productCatCode = exports.unitPriceByClientCat = void 0;
|
|
3
|
+
exports.productCatCode = exports.unitPriceByClientCatInPhcy = exports.unitPriceByClientCat = void 0;
|
|
4
4
|
const user_1 = require("../users/user");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const unitPriceByClientCat = (product, client, speUnitPrice = 0, addDiscount = false) => {
|
|
@@ -17,6 +17,20 @@ const unitPriceByClientCat = (product, client, speUnitPrice = 0, addDiscount = f
|
|
|
17
17
|
: Math.ceil(product.stores[0].salePrice * clientCoef);
|
|
18
18
|
};
|
|
19
19
|
exports.unitPriceByClientCat = unitPriceByClientCat;
|
|
20
|
+
const unitPriceByClientCatInPhcy = (product, client, speUnitPrice = 0, addDiscount = false) => {
|
|
21
|
+
if (speUnitPrice > 0) {
|
|
22
|
+
return speUnitPrice;
|
|
23
|
+
}
|
|
24
|
+
// const store = await getCustomRepository(ProductStoreRepository).getOneStoreByParams({storeName: 'cpa', productId: product.id})
|
|
25
|
+
if (product.store.discountRate && addDiscount) {
|
|
26
|
+
return Math.ceil(product.store.publicPrice) - Math.ceil((0, utils_1.calculPercent)(product.store.publicPrice, product.store.discountRate));
|
|
27
|
+
}
|
|
28
|
+
const clientCoef = !client ? 1 : (0, user_1.userCoef)(client);
|
|
29
|
+
return (0, exports.productCatCode)(product, ["spe", "para"])
|
|
30
|
+
? Math.ceil(product.store.publicPrice)
|
|
31
|
+
: Math.ceil(product.store.publicPrice * clientCoef);
|
|
32
|
+
};
|
|
33
|
+
exports.unitPriceByClientCatInPhcy = unitPriceByClientCatInPhcy;
|
|
20
34
|
const productCatCode = (product, catCodes) => {
|
|
21
35
|
return catCodes.includes(product.cat.code && product.cat.code.toLowerCase());
|
|
22
36
|
};
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import EDate from "./EDate";
|
|
2
|
-
export
|
|
2
|
+
export interface IInOrNot {
|
|
3
3
|
ins?: string[];
|
|
4
4
|
notIns?: string[];
|
|
5
|
+
orIns?: string[];
|
|
5
6
|
steId?: number;
|
|
6
7
|
steName?: string;
|
|
7
8
|
}
|
|
8
|
-
export
|
|
9
|
+
export interface InOrNotStaff {
|
|
10
|
+
orInSteNames?: string[];
|
|
11
|
+
orNotInSteNames?: string[];
|
|
12
|
+
inSteNames?: string[];
|
|
13
|
+
notInSteNames?: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface IParam {
|
|
9
16
|
steId?: number;
|
|
10
17
|
userId?: number;
|
|
11
18
|
clientId?: number;
|
|
@@ -13,9 +20,12 @@ export default interface IParam {
|
|
|
13
20
|
role?: string;
|
|
14
21
|
steName?: string;
|
|
15
22
|
steNames?: string[];
|
|
23
|
+
staffSteNames?: string[];
|
|
24
|
+
isActive?: boolean;
|
|
16
25
|
steGrpCodes?: IInOrNot;
|
|
17
26
|
grpCodes?: IInOrNot;
|
|
18
27
|
roleCodes?: IInOrNot;
|
|
28
|
+
staff?: InOrNotStaff;
|
|
19
29
|
roleCode?: string;
|
|
20
30
|
opDate?: EDate;
|
|
21
31
|
store?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { IParam } from "./IParam";
|
|
1
2
|
export { default as EInOutMotive } from "./EInOutMotive";
|
|
2
|
-
export { default as IParam } from "./IParam";
|
|
3
3
|
export { default as IPath } from "./IPath";
|
|
4
4
|
export { default as NaAc } from "./NaAc";
|
|
5
5
|
export { default as NaCoAc } from "./NaCoAc";
|
|
6
6
|
export { default as NaCoShortAc } from "./NaCoShortAc";
|
|
7
7
|
export { default as OpDate } from "./OpDate";
|
|
8
|
+
export { IParam };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IParam } from "../../shared/models/IParam";
|
|
2
|
+
export interface IProductParams extends IParam {
|
|
3
|
+
pdtId?: number;
|
|
4
|
+
agcyId?: number;
|
|
5
|
+
pvdId?: number;
|
|
6
|
+
laboId?: number;
|
|
7
|
+
catCode?: string;
|
|
8
|
+
isActive?: boolean;
|
|
9
|
+
isAvailable?: boolean;
|
|
10
|
+
isPublished?: boolean;
|
|
11
|
+
withLabo?: boolean;
|
|
12
|
+
inEqeer?: boolean;
|
|
13
|
+
dciId?: number;
|
|
14
|
+
fgId?: number;
|
|
15
|
+
sofId?: number;
|
|
16
|
+
dosId?: number;
|
|
17
|
+
grpByPdt?: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import User from "../users/models/User";
|
|
2
2
|
import Product from "./models/Product";
|
|
3
3
|
export declare const unitPriceByClientCat: (product: Product, client: User, speUnitPrice?: number, addDiscount?: boolean) => number;
|
|
4
|
+
export declare const unitPriceByClientCatInPhcy: (product: Product, client: User, speUnitPrice?: number, addDiscount?: boolean) => number;
|
|
4
5
|
export declare const productCatCode: (product: Product, catCodes: string[]) => boolean;
|
|
@@ -13,6 +13,19 @@ export const unitPriceByClientCat = (product, client, speUnitPrice = 0, addDisco
|
|
|
13
13
|
? Math.ceil(product.stores[0].salePrice)
|
|
14
14
|
: Math.ceil(product.stores[0].salePrice * clientCoef);
|
|
15
15
|
};
|
|
16
|
+
export const unitPriceByClientCatInPhcy = (product, client, speUnitPrice = 0, addDiscount = false) => {
|
|
17
|
+
if (speUnitPrice > 0) {
|
|
18
|
+
return speUnitPrice;
|
|
19
|
+
}
|
|
20
|
+
// const store = await getCustomRepository(ProductStoreRepository).getOneStoreByParams({storeName: 'cpa', productId: product.id})
|
|
21
|
+
if (product.store.discountRate && addDiscount) {
|
|
22
|
+
return Math.ceil(product.store.publicPrice) - Math.ceil(calculPercent(product.store.publicPrice, product.store.discountRate));
|
|
23
|
+
}
|
|
24
|
+
const clientCoef = !client ? 1 : userCoef(client);
|
|
25
|
+
return productCatCode(product, ["spe", "para"])
|
|
26
|
+
? Math.ceil(product.store.publicPrice)
|
|
27
|
+
: Math.ceil(product.store.publicPrice * clientCoef);
|
|
28
|
+
};
|
|
16
29
|
export const productCatCode = (product, catCodes) => {
|
|
17
30
|
return catCodes.includes(product.cat.code && product.cat.code.toLowerCase());
|
|
18
31
|
};
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import EDate from "./EDate";
|
|
2
|
-
export
|
|
2
|
+
export interface IInOrNot {
|
|
3
3
|
ins?: string[];
|
|
4
4
|
notIns?: string[];
|
|
5
|
+
orIns?: string[];
|
|
5
6
|
steId?: number;
|
|
6
7
|
steName?: string;
|
|
7
8
|
}
|
|
8
|
-
export
|
|
9
|
+
export interface InOrNotStaff {
|
|
10
|
+
orInSteNames?: string[];
|
|
11
|
+
orNotInSteNames?: string[];
|
|
12
|
+
inSteNames?: string[];
|
|
13
|
+
notInSteNames?: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface IParam {
|
|
9
16
|
steId?: number;
|
|
10
17
|
userId?: number;
|
|
11
18
|
clientId?: number;
|
|
@@ -13,9 +20,12 @@ export default interface IParam {
|
|
|
13
20
|
role?: string;
|
|
14
21
|
steName?: string;
|
|
15
22
|
steNames?: string[];
|
|
23
|
+
staffSteNames?: string[];
|
|
24
|
+
isActive?: boolean;
|
|
16
25
|
steGrpCodes?: IInOrNot;
|
|
17
26
|
grpCodes?: IInOrNot;
|
|
18
27
|
roleCodes?: IInOrNot;
|
|
28
|
+
staff?: InOrNotStaff;
|
|
19
29
|
roleCode?: string;
|
|
20
30
|
opDate?: EDate;
|
|
21
31
|
store?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { IParam } from "./IParam";
|
|
1
2
|
export { default as EInOutMotive } from "./EInOutMotive";
|
|
2
|
-
export { default as IParam } from "./IParam";
|
|
3
3
|
export { default as IPath } from "./IPath";
|
|
4
4
|
export { default as NaAc } from "./NaAc";
|
|
5
5
|
export { default as NaCoAc } from "./NaCoAc";
|
|
6
6
|
export { default as NaCoShortAc } from "./NaCoShortAc";
|
|
7
7
|
export { default as OpDate } from "./OpDate";
|
|
8
|
+
export { IParam };
|