asv-hlps 1.3.46 → 1.3.48
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/bills/index.d.ts +1 -0
- package/lib/cjs/bills/index.js +1 -0
- package/lib/cjs/bills/pipes/index.d.ts +3 -0
- package/lib/cjs/bills/pipes/index.js +12 -0
- 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/pdfs/amountInvoice.d.ts +66 -0
- package/lib/cjs/pdfs/amountInvoice.js +152 -0
- package/lib/cjs/pdfs/index.d.ts +3 -0
- package/lib/cjs/pdfs/index.js +19 -0
- package/lib/cjs/pdfs/infoInvoice.d.ts +32 -0
- package/lib/cjs/pdfs/infoInvoice.js +79 -0
- package/lib/cjs/pdfs/tools.d.ts +41 -0
- package/lib/cjs/pdfs/tools.js +54 -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/bills/index.d.ts +1 -0
- package/lib/esm/bills/index.js +1 -0
- package/lib/esm/bills/pipes/index.d.ts +3 -0
- package/lib/esm/bills/pipes/index.js +3 -0
- 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/pdfs/amountInvoice.d.ts +66 -0
- package/lib/esm/pdfs/amountInvoice.js +145 -0
- package/lib/esm/pdfs/index.d.ts +3 -0
- package/lib/esm/pdfs/index.js +3 -0
- package/lib/esm/pdfs/infoInvoice.d.ts +32 -0
- package/lib/esm/pdfs/infoInvoice.js +74 -0
- package/lib/esm/pdfs/tools.d.ts +41 -0
- package/lib/esm/pdfs/tools.js +48 -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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Ste } from "../users";
|
|
2
|
+
export declare const displayPdfDate: (label: string, fromDate: string, toDate: string) => string;
|
|
3
|
+
export declare const displayTitle: (title: string) => {
|
|
4
|
+
width: string;
|
|
5
|
+
alignment: string;
|
|
6
|
+
text: string;
|
|
7
|
+
bold: boolean;
|
|
8
|
+
margin: number[];
|
|
9
|
+
fontSize: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const displayClient: <T extends {
|
|
12
|
+
ste: Ste;
|
|
13
|
+
fullname: string;
|
|
14
|
+
cp: string;
|
|
15
|
+
city: string;
|
|
16
|
+
address: string;
|
|
17
|
+
username: string;
|
|
18
|
+
}>(user: T) => {
|
|
19
|
+
absolutePosition: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
text: ({
|
|
24
|
+
text: string;
|
|
25
|
+
fontSize: number;
|
|
26
|
+
bold?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
text: string;
|
|
29
|
+
bold: boolean;
|
|
30
|
+
fontSize: number;
|
|
31
|
+
} | {
|
|
32
|
+
text: string;
|
|
33
|
+
fontSize?: undefined;
|
|
34
|
+
bold?: undefined;
|
|
35
|
+
})[];
|
|
36
|
+
color: string;
|
|
37
|
+
width: string;
|
|
38
|
+
fontSize: number;
|
|
39
|
+
bold: boolean;
|
|
40
|
+
alignment: string;
|
|
41
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getSteShortname } from "../users/user";
|
|
2
|
+
import { dateFormatter } from "../utils";
|
|
3
|
+
export const displayPdfDate = (label, fromDate, toDate) => {
|
|
4
|
+
fromDate = !fromDate ? dateFormatter(new Date(), "ymd", "-") : fromDate;
|
|
5
|
+
toDate = !toDate ? fromDate : toDate;
|
|
6
|
+
return label + " du " + dateFormatter(fromDate) + " au " + dateFormatter(toDate);
|
|
7
|
+
};
|
|
8
|
+
export const displayTitle = (title) => {
|
|
9
|
+
return {
|
|
10
|
+
width: "100%",
|
|
11
|
+
alignment: "center",
|
|
12
|
+
text: title,
|
|
13
|
+
bold: true,
|
|
14
|
+
margin: [0, 10, 0, 10],
|
|
15
|
+
fontSize: 15,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export const displayClient = (user) => {
|
|
19
|
+
// const clientSte = user.ste ? HlpUser.getSteShortname(user.ste) : '';
|
|
20
|
+
const clientSte = user.ste ? getSteShortname(user.ste, ["pharmacie", "clinique", "hopital"]) : "";
|
|
21
|
+
/* const clientLastname = (user.lastname) ? user.lastname : '';
|
|
22
|
+
const clientFirstname = (user.firstname) ? user.firstname : '';
|
|
23
|
+
const clientGender = (user.gender) ? user.gender.abr : ''; */
|
|
24
|
+
const clientName = user.ste ? clientSte : user.fullname;
|
|
25
|
+
const cp = user.cp ? user.cp : "";
|
|
26
|
+
const city = user.city ? user.city : "";
|
|
27
|
+
const nif = user.ste.nif ? user.ste.nif : "";
|
|
28
|
+
const address = user.address ? user.address : "";
|
|
29
|
+
const client = {
|
|
30
|
+
absolutePosition: { x: 310, y: 30 },
|
|
31
|
+
text: [
|
|
32
|
+
{ text: "CLIENT: ", fontSize: 8 },
|
|
33
|
+
{ text: user.username + "\n", bold: true, fontSize: 10 },
|
|
34
|
+
{ text: clientName + "\n" },
|
|
35
|
+
{ text: address + " " },
|
|
36
|
+
{ text: cp + "\n" },
|
|
37
|
+
{ text: city + "\n" },
|
|
38
|
+
// {text: nif + '\n'}
|
|
39
|
+
],
|
|
40
|
+
color: "#000",
|
|
41
|
+
width: "auto",
|
|
42
|
+
fontSize: 12,
|
|
43
|
+
bold: true,
|
|
44
|
+
alignment: "left",
|
|
45
|
+
// margin: [100, 0, 0, 0],
|
|
46
|
+
};
|
|
47
|
+
return client;
|
|
48
|
+
};
|
|
@@ -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 User from "../users/models/User";
|
|
2
|
+
import Product from "./models/Product";
|
|
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