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
package/lib/cjs/bills/index.d.ts
CHANGED
package/lib/cjs/bills/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./bill"), exports);
|
|
18
18
|
__exportStar(require("./models"), exports);
|
|
19
|
+
__exportStar(require("./pipes"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
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.StockPipe = exports.AmountOnListBillPipe = exports.AmountOnBillPipe = void 0;
|
|
7
|
+
var amount_on_bill_pipe_1 = require("./amount-on-bill-pipe");
|
|
8
|
+
Object.defineProperty(exports, "AmountOnBillPipe", { enumerable: true, get: function () { return __importDefault(amount_on_bill_pipe_1).default; } });
|
|
9
|
+
var amount_on_list_bill_pipe_1 = require("./amount-on-list-bill-pipe");
|
|
10
|
+
Object.defineProperty(exports, "AmountOnListBillPipe", { enumerable: true, get: function () { return __importDefault(amount_on_list_bill_pipe_1).default; } });
|
|
11
|
+
var stock_pipe_1 = require("./stock-pipe");
|
|
12
|
+
Object.defineProperty(exports, "StockPipe", { enumerable: true, get: function () { return __importDefault(stock_pipe_1).default; } });
|
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);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import Bill from "../bills/models/Bill";
|
|
2
|
+
import Sale from "../sales/models/Sale";
|
|
3
|
+
export declare const infoAmountOnBl: (tob: Sale) => {
|
|
4
|
+
width: string;
|
|
5
|
+
table: {
|
|
6
|
+
headerRows: number;
|
|
7
|
+
widths: string[];
|
|
8
|
+
heights: number[];
|
|
9
|
+
body: ({
|
|
10
|
+
text: string;
|
|
11
|
+
style: string;
|
|
12
|
+
}[] | {
|
|
13
|
+
text: string | number;
|
|
14
|
+
style: string;
|
|
15
|
+
alignment: string;
|
|
16
|
+
}[])[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const infoAmountOnProforma: (tob: Sale) => {
|
|
20
|
+
width: string;
|
|
21
|
+
table: {
|
|
22
|
+
headerRows: number;
|
|
23
|
+
widths: string[];
|
|
24
|
+
heights: number[];
|
|
25
|
+
body: ({
|
|
26
|
+
text: string;
|
|
27
|
+
style: string;
|
|
28
|
+
}[] | {
|
|
29
|
+
text: string | number;
|
|
30
|
+
style: string;
|
|
31
|
+
alignment: string;
|
|
32
|
+
}[])[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const infoAmounOntSale: (tob: Sale) => {
|
|
36
|
+
width: string;
|
|
37
|
+
table: {
|
|
38
|
+
headerRows: number;
|
|
39
|
+
widths: string[];
|
|
40
|
+
heights: number[];
|
|
41
|
+
body: ({
|
|
42
|
+
text: string;
|
|
43
|
+
style: string;
|
|
44
|
+
}[] | {
|
|
45
|
+
text: string | number;
|
|
46
|
+
style: string;
|
|
47
|
+
alignment: string;
|
|
48
|
+
}[])[];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare const infoAmountOnBill: (tob: Bill) => {
|
|
52
|
+
width: string;
|
|
53
|
+
table: {
|
|
54
|
+
headerRows: number;
|
|
55
|
+
widths: string[];
|
|
56
|
+
heights: number[];
|
|
57
|
+
body: ({
|
|
58
|
+
text: string;
|
|
59
|
+
style: string;
|
|
60
|
+
}[] | {
|
|
61
|
+
text: string;
|
|
62
|
+
style: string;
|
|
63
|
+
alignment: string;
|
|
64
|
+
}[])[];
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.infoAmountOnBill = exports.infoAmounOntSale = exports.infoAmountOnProforma = exports.infoAmountOnBl = void 0;
|
|
4
|
+
const bill_1 = require("../bills/bill");
|
|
5
|
+
const sale_1 = require("../sales/sale");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
const infoAmountOnBl = (tob) => {
|
|
8
|
+
const totalAmountWithoutTva = tob.isBack && (tob.backChoice.toLowerCase() === "autre" || tob.rejectedReason)
|
|
9
|
+
? 0
|
|
10
|
+
: (0, utils_1.formatToStringCfa)((0, sale_1.getTotalAmountWithoutTvaOnSale)(tob, true));
|
|
11
|
+
// const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
|
|
12
|
+
const totalTva = (0, utils_1.formatToStringCfa)((0, sale_1.getTotalTvaOnSale)(tob, true));
|
|
13
|
+
const totalAmountAllIncluded = tob.isBack && (tob.backChoice.toLowerCase() === "autre" || tob.rejectedReason)
|
|
14
|
+
? 0
|
|
15
|
+
: (0, utils_1.formatToStringCfa)((0, sale_1.getTotalAmountAllIncludedOnSale)(tob, true));
|
|
16
|
+
const tabFooter = {
|
|
17
|
+
width: "50%",
|
|
18
|
+
table: {
|
|
19
|
+
headerRows: 1,
|
|
20
|
+
// widths: [ 100, 100, 100, 100 ],
|
|
21
|
+
widths: ["*", "*", "*", "*"],
|
|
22
|
+
heights: [6],
|
|
23
|
+
body: [
|
|
24
|
+
[
|
|
25
|
+
{ text: "TOTAL HT", style: "headerText" },
|
|
26
|
+
// {text: 'PORT HT', style: 'headerText'},
|
|
27
|
+
{ text: "TOTAL TVA", style: "headerText" },
|
|
28
|
+
{ text: "TOTAL TTC", style: "headerText" },
|
|
29
|
+
{ text: "NET A PAYER", style: "headerText" },
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
{ text: totalAmountWithoutTva, style: "rowText", alignment: "center" },
|
|
33
|
+
// { text: totalPort, style: 'rowText', alignment: 'center' },
|
|
34
|
+
{ text: totalTva, style: "rowText", alignment: "center" },
|
|
35
|
+
{ text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
|
|
36
|
+
{ text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
|
|
37
|
+
],
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
return tabFooter;
|
|
42
|
+
};
|
|
43
|
+
exports.infoAmountOnBl = infoAmountOnBl;
|
|
44
|
+
const infoAmountOnProforma = (tob) => {
|
|
45
|
+
const totalAmountWithoutTva = tob.isBack && tob.backChoice.toLowerCase() === "autre" ? 0 : (0, utils_1.formatToStringCfa)((0, sale_1.getTotalAmountWithoutTvaOnSale)(tob));
|
|
46
|
+
// const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
|
|
47
|
+
const totalTva = (0, utils_1.formatToStringCfa)((0, sale_1.getTotalTvaOnSale)(tob));
|
|
48
|
+
const totalAmountAllIncluded = tob.isBack && tob.backChoice.toLowerCase() === "autre" ? 0 : (0, utils_1.formatToStringCfa)((0, sale_1.getTotalAmountAllIncludedOnSale)(tob));
|
|
49
|
+
const tabFooter = {
|
|
50
|
+
width: "50%",
|
|
51
|
+
table: {
|
|
52
|
+
headerRows: 1,
|
|
53
|
+
// widths: [ 100, 100, 100, 100 ],
|
|
54
|
+
widths: ["*", "*", "*", "*"],
|
|
55
|
+
heights: [6],
|
|
56
|
+
body: [
|
|
57
|
+
[
|
|
58
|
+
{ text: "TOTAL HT", style: "headerText" },
|
|
59
|
+
// {text: 'PORT HT', style: 'headerText'},
|
|
60
|
+
{ text: "TOTAL TVA", style: "headerText" },
|
|
61
|
+
{ text: "TOTAL TTC", style: "headerText" },
|
|
62
|
+
{ text: "NET A PAYER", style: "headerText" },
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
{ text: totalAmountWithoutTva, style: "rowText", alignment: "center" },
|
|
66
|
+
// { text: totalPort, style: 'rowText', alignment: 'center' },
|
|
67
|
+
{ text: totalTva, style: "rowText", alignment: "center" },
|
|
68
|
+
{ text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
|
|
69
|
+
{ text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
|
|
70
|
+
],
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
return tabFooter;
|
|
75
|
+
};
|
|
76
|
+
exports.infoAmountOnProforma = infoAmountOnProforma;
|
|
77
|
+
const infoAmounOntSale = (tob) => {
|
|
78
|
+
const totalAmountWithoutTva = tob.isBack && (tob.backChoice.toLowerCase() === "autre" || tob.rejectedReason)
|
|
79
|
+
? 0
|
|
80
|
+
: (0, utils_1.formatToStringCfa)((0, sale_1.getTotalAmountWithoutTvaOnSale)(tob, true));
|
|
81
|
+
const totalPort = (0, utils_1.formatToStringCfa)((0, sale_1.getTotalShippingOnSale)(tob));
|
|
82
|
+
const totalTva = (0, utils_1.formatToStringCfa)((0, sale_1.getTotalTvaOnSale)(tob, true));
|
|
83
|
+
const totalAmountAllIncluded = tob.isBack && (tob.backChoice.toLowerCase() === "autre" || tob.rejectedReason)
|
|
84
|
+
? 0
|
|
85
|
+
: (0, utils_1.formatToStringCfa)((0, sale_1.getTotalAmountAllIncludedOnSale)(tob, true));
|
|
86
|
+
const tabFooter = {
|
|
87
|
+
width: "50%",
|
|
88
|
+
table: {
|
|
89
|
+
headerRows: 1,
|
|
90
|
+
// widths: [ 100, 100, 100, 100 ],
|
|
91
|
+
widths: ["*", "*", "*", "*", "*"],
|
|
92
|
+
heights: [6],
|
|
93
|
+
body: [
|
|
94
|
+
[
|
|
95
|
+
{ text: "TOTAL HT", style: "headerText" },
|
|
96
|
+
{ text: "PORT HT", style: "headerText" },
|
|
97
|
+
{ text: "TOTAL TVA", style: "headerText" },
|
|
98
|
+
{ text: "TOTAL TTC", style: "headerText" },
|
|
99
|
+
{ text: "NET A PAYER", style: "headerText" },
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
{ text: totalAmountWithoutTva, style: "rowText", alignment: "center" },
|
|
103
|
+
{ text: totalPort, style: "rowText", alignment: "center" },
|
|
104
|
+
{ text: totalTva, style: "rowText", alignment: "center" },
|
|
105
|
+
{ text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
|
|
106
|
+
{ text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
|
|
107
|
+
],
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
return tabFooter;
|
|
112
|
+
};
|
|
113
|
+
exports.infoAmounOntSale = infoAmounOntSale;
|
|
114
|
+
const infoAmountOnBill = (tob) => {
|
|
115
|
+
const totalAmountAllAndBackInclused = (0, bill_1.getTotalAmountAllIncludedOnBill)(tob.sales);
|
|
116
|
+
const totalAmountWithoutTvaAllAndBack = (0, bill_1.getTotalAmountWithoutTvaOnBill)(tob.sales);
|
|
117
|
+
const totalAmountTvaAllAndBack = (0, bill_1.getTotalAmountTvaOnBill)(tob.sales);
|
|
118
|
+
// const totalAmountWithoutTva = formatToStringCfa(HlpSale.getTotalAmountWithoutTvaOnBill(tob.sales));
|
|
119
|
+
const totalAmountWithoutTva = (0, utils_1.formatToStringCfa)(totalAmountWithoutTvaAllAndBack);
|
|
120
|
+
// const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
|
|
121
|
+
const totalTva = (0, utils_1.formatToStringCfa)(totalAmountTvaAllAndBack);
|
|
122
|
+
// const totalTva = formatToStringCfa(HlpSale.getTotalAmountTvaOnBill(tob.sales));
|
|
123
|
+
// const totalAmountAllIncluded = formatToStringCfa(HlpSale.getTotalAmountOnBill(tob.sales));
|
|
124
|
+
const totalAmountAllIncluded = (0, utils_1.formatToStringCfa)(totalAmountAllAndBackInclused);
|
|
125
|
+
const tabFooter = {
|
|
126
|
+
width: "50%",
|
|
127
|
+
table: {
|
|
128
|
+
headerRows: 1,
|
|
129
|
+
// widths: [ 100, 100, 100, 100 ],
|
|
130
|
+
widths: ["*", "*", "*", "*"],
|
|
131
|
+
heights: [6],
|
|
132
|
+
body: [
|
|
133
|
+
[
|
|
134
|
+
{ text: "TOTAL HT", style: "headerText" },
|
|
135
|
+
// {text: 'PORT HT', style: 'headerText'},
|
|
136
|
+
{ text: "TOTAL TVA", style: "headerText" },
|
|
137
|
+
{ text: "TOTAL TTC", style: "headerText" },
|
|
138
|
+
{ text: "NET A PAYER", style: "headerText" },
|
|
139
|
+
],
|
|
140
|
+
[
|
|
141
|
+
{ text: totalAmountWithoutTva, style: "rowText", alignment: "center" },
|
|
142
|
+
// { text: totalPort, style: 'rowText', alignment: 'center' },
|
|
143
|
+
{ text: totalTva, style: "rowText", alignment: "center" },
|
|
144
|
+
{ text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
|
|
145
|
+
{ text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
|
|
146
|
+
],
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
return tabFooter;
|
|
151
|
+
};
|
|
152
|
+
exports.infoAmountOnBill = infoAmountOnBill;
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./amountInvoice"), exports);
|
|
18
|
+
__exportStar(require("./infoInvoice"), exports);
|
|
19
|
+
__exportStar(require("./tools"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Bill from "../bills/models/Bill";
|
|
2
|
+
import Sale from "../sales/models/Sale";
|
|
3
|
+
export declare const infoSale: (tob: Sale) => {
|
|
4
|
+
width: string;
|
|
5
|
+
table: {
|
|
6
|
+
headerRows: number;
|
|
7
|
+
widths: (string | number)[];
|
|
8
|
+
heights: number[];
|
|
9
|
+
body: ({
|
|
10
|
+
text: string;
|
|
11
|
+
style: string;
|
|
12
|
+
} | {
|
|
13
|
+
text: number;
|
|
14
|
+
style: string;
|
|
15
|
+
})[][];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const infoBill: (tob: Bill) => {
|
|
19
|
+
width: string;
|
|
20
|
+
table: {
|
|
21
|
+
headerRows: number;
|
|
22
|
+
widths: (string | number)[];
|
|
23
|
+
heights: number[];
|
|
24
|
+
body: ({
|
|
25
|
+
text: string;
|
|
26
|
+
style: string;
|
|
27
|
+
} | {
|
|
28
|
+
text: number;
|
|
29
|
+
style: string;
|
|
30
|
+
})[][];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.infoBill = exports.infoSale = void 0;
|
|
4
|
+
const bill_1 = require("../bills/bill");
|
|
5
|
+
const sale_1 = require("../sales/sale");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
const infoSale = (tob) => {
|
|
8
|
+
const totalQtity = (0, sale_1.getTotalQtityOnSale)(tob);
|
|
9
|
+
const nbProducts = (0, sale_1.getNbProductsOnSale)(tob);
|
|
10
|
+
const nbColis = tob.nbPackages;
|
|
11
|
+
const nbFreeze = tob.nbFreeze;
|
|
12
|
+
// const oWidth = [ '*', '*', 75, 75, 75, 75];
|
|
13
|
+
const tabTop = {
|
|
14
|
+
width: "50%",
|
|
15
|
+
table: {
|
|
16
|
+
headerRows: 1,
|
|
17
|
+
widths: ["*", "*", 75, 75, 75, 75],
|
|
18
|
+
heights: [6],
|
|
19
|
+
body: [
|
|
20
|
+
[
|
|
21
|
+
{ text: "FACTURE N°", style: "headerText" },
|
|
22
|
+
{ text: "DATE", style: "headerText" },
|
|
23
|
+
{ text: "NBRE DE PDTS", style: "headerText" },
|
|
24
|
+
{ text: "QUANTITE TOTALE", style: "headerText" },
|
|
25
|
+
{ text: "NBRE COLIS", style: "headerText" },
|
|
26
|
+
{ text: "NBRE FROID", style: "headerText" },
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
{ text: tob.ref, style: "rowText" },
|
|
30
|
+
{ text: (0, utils_1.dateFormatter)(tob.createdAt, "dmy", "/"), style: "rowText" },
|
|
31
|
+
{ text: nbProducts, style: "rowText" },
|
|
32
|
+
{ text: totalQtity, style: "rowText" },
|
|
33
|
+
{ text: nbColis, style: "rowText" },
|
|
34
|
+
{ text: nbFreeze, style: "rowText" },
|
|
35
|
+
],
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
return tabTop;
|
|
40
|
+
};
|
|
41
|
+
exports.infoSale = infoSale;
|
|
42
|
+
const infoBill = (tob) => {
|
|
43
|
+
const totalQtity = (0, bill_1.getTotalQtityOnBill)(tob.sales);
|
|
44
|
+
const nbProducts = (0, bill_1.getNbProductsOnBill)(tob.sales);
|
|
45
|
+
const nbColis = (0, bill_1.getNbPackagesOnBill)(tob.sales);
|
|
46
|
+
const nbFreeze = (0, bill_1.getNbFreezeOnBill)(tob.sales);
|
|
47
|
+
const oWidth = ["*", "*", 75, 75, 75, 75];
|
|
48
|
+
const tabTop = {
|
|
49
|
+
width: "50%",
|
|
50
|
+
table: {
|
|
51
|
+
headerRows: 1,
|
|
52
|
+
// widths: [ 125, 125, 125, '*' ],
|
|
53
|
+
widths: oWidth,
|
|
54
|
+
heights: [6],
|
|
55
|
+
// widths: [ '16%', '16%', '16%', '16%' ],
|
|
56
|
+
body: [
|
|
57
|
+
[
|
|
58
|
+
{ text: "FACTURE N°", style: "headerText" },
|
|
59
|
+
{ text: "DATE", style: "headerText" },
|
|
60
|
+
{ text: "NBRE DE PDTS", style: "headerText" },
|
|
61
|
+
{ text: "QUANTITE TOTALE", style: "headerText" },
|
|
62
|
+
{ text: "NBRE COLIS", style: "headerText" },
|
|
63
|
+
{ text: "NBRE FROID", style: "headerText" },
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
{ text: tob.ref, style: "rowText" },
|
|
67
|
+
// { text: moment(tob.createdAt ).format('DD/MM/YYYY'), style: 'rowText'},
|
|
68
|
+
{ text: (0, utils_1.dateFormatter)(tob.createdAt, "dmy", "/"), style: "rowText" },
|
|
69
|
+
{ text: nbProducts, style: "rowText" },
|
|
70
|
+
{ text: totalQtity, style: "rowText" },
|
|
71
|
+
{ text: nbColis, style: "rowText" },
|
|
72
|
+
{ text: nbFreeze, style: "rowText" },
|
|
73
|
+
],
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
return tabTop;
|
|
78
|
+
};
|
|
79
|
+
exports.infoBill = infoBill;
|
|
@@ -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,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.displayClient = exports.displayTitle = exports.displayPdfDate = void 0;
|
|
4
|
+
const user_1 = require("../users/user");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const displayPdfDate = (label, fromDate, toDate) => {
|
|
7
|
+
fromDate = !fromDate ? (0, utils_1.dateFormatter)(new Date(), "ymd", "-") : fromDate;
|
|
8
|
+
toDate = !toDate ? fromDate : toDate;
|
|
9
|
+
return label + " du " + (0, utils_1.dateFormatter)(fromDate) + " au " + (0, utils_1.dateFormatter)(toDate);
|
|
10
|
+
};
|
|
11
|
+
exports.displayPdfDate = displayPdfDate;
|
|
12
|
+
const displayTitle = (title) => {
|
|
13
|
+
return {
|
|
14
|
+
width: "100%",
|
|
15
|
+
alignment: "center",
|
|
16
|
+
text: title,
|
|
17
|
+
bold: true,
|
|
18
|
+
margin: [0, 10, 0, 10],
|
|
19
|
+
fontSize: 15,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
exports.displayTitle = displayTitle;
|
|
23
|
+
const displayClient = (user) => {
|
|
24
|
+
// const clientSte = user.ste ? HlpUser.getSteShortname(user.ste) : '';
|
|
25
|
+
const clientSte = user.ste ? (0, user_1.getSteShortname)(user.ste, ["pharmacie", "clinique", "hopital"]) : "";
|
|
26
|
+
/* const clientLastname = (user.lastname) ? user.lastname : '';
|
|
27
|
+
const clientFirstname = (user.firstname) ? user.firstname : '';
|
|
28
|
+
const clientGender = (user.gender) ? user.gender.abr : ''; */
|
|
29
|
+
const clientName = user.ste ? clientSte : user.fullname;
|
|
30
|
+
const cp = user.cp ? user.cp : "";
|
|
31
|
+
const city = user.city ? user.city : "";
|
|
32
|
+
const nif = user.ste.nif ? user.ste.nif : "";
|
|
33
|
+
const address = user.address ? user.address : "";
|
|
34
|
+
const client = {
|
|
35
|
+
absolutePosition: { x: 310, y: 30 },
|
|
36
|
+
text: [
|
|
37
|
+
{ text: "CLIENT: ", fontSize: 8 },
|
|
38
|
+
{ text: user.username + "\n", bold: true, fontSize: 10 },
|
|
39
|
+
{ text: clientName + "\n" },
|
|
40
|
+
{ text: address + " " },
|
|
41
|
+
{ text: cp + "\n" },
|
|
42
|
+
{ text: city + "\n" },
|
|
43
|
+
// {text: nif + '\n'}
|
|
44
|
+
],
|
|
45
|
+
color: "#000",
|
|
46
|
+
width: "auto",
|
|
47
|
+
fontSize: 12,
|
|
48
|
+
bold: true,
|
|
49
|
+
alignment: "left",
|
|
50
|
+
// margin: [100, 0, 0, 0],
|
|
51
|
+
};
|
|
52
|
+
return client;
|
|
53
|
+
};
|
|
54
|
+
exports.displayClient = displayClient;
|
|
@@ -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 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,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";
|