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.
Files changed (107) hide show
  1. package/lib/cjs/auth/models/AuthTag.d.ts +1 -1
  2. package/lib/cjs/auth/models/AuthTagCat.d.ts +1 -1
  3. package/lib/cjs/bills/index.d.ts +1 -0
  4. package/lib/cjs/bills/index.js +1 -0
  5. package/lib/cjs/bills/pipes/index.d.ts +3 -0
  6. package/lib/cjs/bills/pipes/index.js +12 -0
  7. package/lib/cjs/estates/models/EstateCat.d.ts +1 -1
  8. package/lib/cjs/estates/models/EstateElt.d.ts +1 -1
  9. package/lib/cjs/estates/models/EstateLevel.d.ts +1 -1
  10. package/lib/cjs/estates/models/EstatePor.d.ts +1 -1
  11. package/lib/cjs/index.d.ts +7 -0
  12. package/lib/cjs/index.js +7 -0
  13. package/lib/cjs/pdfs/amountInvoice.d.ts +66 -0
  14. package/lib/cjs/pdfs/amountInvoice.js +152 -0
  15. package/lib/cjs/pdfs/index.d.ts +3 -0
  16. package/lib/cjs/pdfs/index.js +19 -0
  17. package/lib/cjs/pdfs/infoInvoice.d.ts +32 -0
  18. package/lib/cjs/pdfs/infoInvoice.js +79 -0
  19. package/lib/cjs/pdfs/tools.d.ts +41 -0
  20. package/lib/cjs/pdfs/tools.js +54 -0
  21. package/lib/cjs/products/index.d.ts +1 -0
  22. package/lib/cjs/products/index.js +1 -0
  23. package/lib/cjs/products/models/ProductMvt.d.ts +1 -1
  24. package/lib/cjs/products/product.d.ts +4 -0
  25. package/lib/cjs/products/product.js +23 -0
  26. package/lib/cjs/query-builder/hlpQbuilder.d.ts +1 -1
  27. package/lib/cjs/sales/index.d.ts +2 -0
  28. package/lib/cjs/sales/index.js +18 -0
  29. package/lib/cjs/sales/sale.js +1 -1
  30. package/lib/cjs/shared/index.d.ts +1 -6
  31. package/lib/cjs/shared/index.js +14 -5
  32. package/lib/cjs/shared/models/EDate.d.ts +8 -0
  33. package/lib/cjs/shared/models/EDate.js +11 -0
  34. package/lib/cjs/shared/models/EInOutMotive.d.ts +13 -0
  35. package/lib/cjs/shared/models/EInOutMotive.js +16 -0
  36. package/lib/cjs/shared/models/EPayMethod.d.ts +6 -0
  37. package/lib/cjs/shared/models/EPayMethod.js +9 -0
  38. package/lib/cjs/shared/models/IParam.d.ts +26 -0
  39. package/lib/cjs/shared/models/IParam.js +2 -0
  40. package/lib/cjs/shared/models/IPath.d.ts +14 -0
  41. package/lib/cjs/shared/models/IPath.js +11 -0
  42. package/lib/cjs/shared/models/NaAc.d.ts +6 -0
  43. package/lib/cjs/shared/models/NaAc.js +2 -0
  44. package/lib/cjs/shared/models/NaCoAc.d.ts +4 -0
  45. package/lib/cjs/shared/models/NaCoAc.js +2 -0
  46. package/lib/cjs/shared/models/NaCoShortAc.d.ts +4 -0
  47. package/lib/cjs/shared/models/NaCoShortAc.js +2 -0
  48. package/lib/cjs/shared/models/index.d.ts +6 -0
  49. package/lib/cjs/shared/models/index.js +8 -0
  50. package/lib/cjs/users/index.d.ts +1 -0
  51. package/lib/cjs/users/index.js +1 -0
  52. package/lib/cjs/users/models/UserGrp.d.ts +1 -1
  53. package/lib/cjs/users/models/UserRole.d.ts +1 -1
  54. package/lib/esm/auth/models/AuthTag.d.ts +1 -1
  55. package/lib/esm/auth/models/AuthTagCat.d.ts +1 -1
  56. package/lib/esm/bills/index.d.ts +1 -0
  57. package/lib/esm/bills/index.js +1 -0
  58. package/lib/esm/bills/pipes/index.d.ts +3 -0
  59. package/lib/esm/bills/pipes/index.js +3 -0
  60. package/lib/esm/estates/models/EstateCat.d.ts +1 -1
  61. package/lib/esm/estates/models/EstateElt.d.ts +1 -1
  62. package/lib/esm/estates/models/EstateLevel.d.ts +1 -1
  63. package/lib/esm/estates/models/EstatePor.d.ts +1 -1
  64. package/lib/esm/index.d.ts +7 -0
  65. package/lib/esm/index.js +7 -0
  66. package/lib/esm/pdfs/amountInvoice.d.ts +66 -0
  67. package/lib/esm/pdfs/amountInvoice.js +145 -0
  68. package/lib/esm/pdfs/index.d.ts +3 -0
  69. package/lib/esm/pdfs/index.js +3 -0
  70. package/lib/esm/pdfs/infoInvoice.d.ts +32 -0
  71. package/lib/esm/pdfs/infoInvoice.js +74 -0
  72. package/lib/esm/pdfs/tools.d.ts +41 -0
  73. package/lib/esm/pdfs/tools.js +48 -0
  74. package/lib/esm/products/index.d.ts +1 -0
  75. package/lib/esm/products/index.js +1 -0
  76. package/lib/esm/products/models/ProductMvt.d.ts +1 -1
  77. package/lib/esm/products/product.d.ts +4 -0
  78. package/lib/esm/products/product.js +18 -0
  79. package/lib/esm/query-builder/hlpQbuilder.d.ts +1 -1
  80. package/lib/esm/sales/index.d.ts +2 -0
  81. package/lib/esm/sales/index.js +2 -0
  82. package/lib/esm/sales/sale.js +1 -1
  83. package/lib/esm/shared/index.d.ts +1 -6
  84. package/lib/esm/shared/index.js +1 -1
  85. package/lib/esm/shared/models/EDate.d.ts +8 -0
  86. package/lib/esm/shared/models/EDate.js +9 -0
  87. package/lib/esm/shared/models/EInOutMotive.d.ts +13 -0
  88. package/lib/esm/shared/models/EInOutMotive.js +14 -0
  89. package/lib/esm/shared/models/EPayMethod.d.ts +6 -0
  90. package/lib/esm/shared/models/EPayMethod.js +7 -0
  91. package/lib/esm/shared/models/IParam.d.ts +26 -0
  92. package/lib/esm/shared/models/IParam.js +1 -0
  93. package/lib/esm/shared/models/IPath.d.ts +14 -0
  94. package/lib/esm/shared/models/IPath.js +10 -0
  95. package/lib/esm/shared/models/NaAc.d.ts +6 -0
  96. package/lib/esm/shared/models/NaAc.js +1 -0
  97. package/lib/esm/shared/models/NaCoAc.d.ts +4 -0
  98. package/lib/esm/shared/models/NaCoAc.js +1 -0
  99. package/lib/esm/shared/models/NaCoShortAc.d.ts +4 -0
  100. package/lib/esm/shared/models/NaCoShortAc.js +1 -0
  101. package/lib/esm/shared/models/index.d.ts +6 -0
  102. package/lib/esm/shared/models/index.js +1 -0
  103. package/lib/esm/users/index.d.ts +1 -0
  104. package/lib/esm/users/index.js +1 -0
  105. package/lib/esm/users/models/UserGrp.d.ts +1 -1
  106. package/lib/esm/users/models/UserRole.d.ts +1 -1
  107. package/package.json +1 -1
@@ -1,8 +1,17 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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.EInOutMotive = void 0;
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,8 @@
1
+ declare enum EDate {
2
+ CURRENT_DATE = "currentDate",
3
+ CURRENT_MONTH = "currentMonth",
4
+ SUB_CURRENT_MONTH = "subCurrentMonth",
5
+ CURRENT_YEAR = "currentYear",
6
+ SUB_CURRENT_YEAR = "subCurrentYear"
7
+ }
8
+ export default EDate;
@@ -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,6 @@
1
+ declare enum EPayMethod {
2
+ CASH = "esp\u00E8ces",
3
+ TRANSFER = "virement",
4
+ BANKCHECK = "ch\u00E8que"
5
+ }
6
+ export default EPayMethod;
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /* export type HeaderTableColumnType = {
4
+ thLabel: any;
5
+ content?: any;
6
+ accessor?: any;
7
+ style?: any;
8
+ auth?: AuthParam;
9
+ tooltipH?: any;
10
+ tooltipB?: any;
11
+ }; */
@@ -0,0 +1,6 @@
1
+ export default interface NaAc {
2
+ id?: number;
3
+ name?: string;
4
+ isActive?: boolean;
5
+ disabled?: boolean;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import NaAc from "./NaAc";
2
+ export default interface NaCoAc extends NaAc {
3
+ code?: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import NaCoAc from "./NaCoAc";
2
+ export default interface NaCoShortAc extends NaCoAc {
3
+ shortname?: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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; } });
@@ -1 +1,2 @@
1
1
  export * from "./models";
2
+ export * from "./user";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./models"), exports);
18
+ __exportStar(require("./user"), exports);
@@ -1,4 +1,4 @@
1
- import NaCoShortAc from "../../shared/NaCoShortAc";
1
+ import NaCoShortAc from "../../shared/models/NaCoShortAc";
2
2
  export default interface UserGrp extends NaCoShortAc {
3
3
  coef?: number;
4
4
  }
@@ -1,4 +1,4 @@
1
- import NaCoShortAc from "../../shared/NaCoShortAc";
1
+ import NaCoShortAc from "../../shared/models/NaCoShortAc";
2
2
  export default interface UserRole extends NaCoShortAc {
3
3
  extern?: boolean;
4
4
  intern?: boolean;
@@ -1,4 +1,4 @@
1
- import NaCoAc from "../../shared/NaCoAc";
1
+ import NaCoAc from "../../shared/models/NaCoAc";
2
2
  import AuthTagCat from "./AuthTagCat";
3
3
  export default interface AuthTag extends NaCoAc {
4
4
  cat?: AuthTagCat;
@@ -1,4 +1,4 @@
1
- import NaAc from "../../shared/NaAc";
1
+ import NaAc from "../../shared/models/NaAc";
2
2
  import AuthTag from "./AuthTag";
3
3
  export default interface AuthTagCat extends NaAc {
4
4
  tags: AuthTag[];
@@ -1,2 +1,3 @@
1
1
  export * from "./bill";
2
2
  export * from "./models";
3
+ export * from "./pipes";
@@ -1,2 +1,3 @@
1
1
  export * from "./bill";
2
2
  export * from "./models";
3
+ export * from "./pipes";
@@ -0,0 +1,3 @@
1
+ export { default as AmountOnBillPipe } from "./amount-on-bill-pipe";
2
+ export { default as AmountOnListBillPipe } from "./amount-on-list-bill-pipe";
3
+ export { default as StockPipe } from "./stock-pipe";
@@ -0,0 +1,3 @@
1
+ export { default as AmountOnBillPipe } from "./amount-on-bill-pipe";
2
+ export { default as AmountOnListBillPipe } from "./amount-on-list-bill-pipe";
3
+ export { default as StockPipe } from "./stock-pipe";
@@ -1,3 +1,3 @@
1
- import NaCoAc from "../../shared/NaCoAc";
1
+ import NaCoAc from "../../shared/models/NaCoAc";
2
2
  export default interface EstateCat extends NaCoAc {
3
3
  }
@@ -1,3 +1,3 @@
1
- import NaCoAc from "../../shared/NaCoAc";
1
+ import NaCoAc from "../../shared/models/NaCoAc";
2
2
  export default interface EstateElt extends NaCoAc {
3
3
  }
@@ -1,3 +1,3 @@
1
- import NaCoAc from "../../shared/NaCoAc";
1
+ import NaCoAc from "../../shared/models/NaCoAc";
2
2
  export default interface EstateLevel extends NaCoAc {
3
3
  }
@@ -1,3 +1,3 @@
1
- import NaCoAc from "../../shared/NaCoAc";
1
+ import NaCoAc from "../../shared/models/NaCoAc";
2
2
  export default interface EstatePor extends NaCoAc {
3
3
  }
@@ -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";
@@ -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,145 @@
1
+ import { getTotalAmountAllIncludedOnBill, getTotalAmountTvaOnBill, getTotalAmountWithoutTvaOnBill } from "../bills/bill";
2
+ import { getTotalAmountAllIncludedOnSale, getTotalAmountWithoutTvaOnSale, getTotalShippingOnSale, getTotalTvaOnSale } from "../sales/sale";
3
+ import { formatToStringCfa } from "../utils";
4
+ export const infoAmountOnBl = (tob) => {
5
+ const totalAmountWithoutTva = tob.isBack && (tob.backChoice.toLowerCase() === "autre" || tob.rejectedReason)
6
+ ? 0
7
+ : formatToStringCfa(getTotalAmountWithoutTvaOnSale(tob, true));
8
+ // const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
9
+ const totalTva = formatToStringCfa(getTotalTvaOnSale(tob, true));
10
+ const totalAmountAllIncluded = tob.isBack && (tob.backChoice.toLowerCase() === "autre" || tob.rejectedReason)
11
+ ? 0
12
+ : formatToStringCfa(getTotalAmountAllIncludedOnSale(tob, true));
13
+ const tabFooter = {
14
+ width: "50%",
15
+ table: {
16
+ headerRows: 1,
17
+ // widths: [ 100, 100, 100, 100 ],
18
+ widths: ["*", "*", "*", "*"],
19
+ heights: [6],
20
+ body: [
21
+ [
22
+ { text: "TOTAL HT", style: "headerText" },
23
+ // {text: 'PORT HT', style: 'headerText'},
24
+ { text: "TOTAL TVA", style: "headerText" },
25
+ { text: "TOTAL TTC", style: "headerText" },
26
+ { text: "NET A PAYER", style: "headerText" },
27
+ ],
28
+ [
29
+ { text: totalAmountWithoutTva, style: "rowText", alignment: "center" },
30
+ // { text: totalPort, style: 'rowText', alignment: 'center' },
31
+ { text: totalTva, style: "rowText", alignment: "center" },
32
+ { text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
33
+ { text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
34
+ ],
35
+ ],
36
+ },
37
+ };
38
+ return tabFooter;
39
+ };
40
+ export const infoAmountOnProforma = (tob) => {
41
+ const totalAmountWithoutTva = tob.isBack && tob.backChoice.toLowerCase() === "autre" ? 0 : formatToStringCfa(getTotalAmountWithoutTvaOnSale(tob));
42
+ // const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
43
+ const totalTva = formatToStringCfa(getTotalTvaOnSale(tob));
44
+ const totalAmountAllIncluded = tob.isBack && tob.backChoice.toLowerCase() === "autre" ? 0 : formatToStringCfa(getTotalAmountAllIncludedOnSale(tob));
45
+ const tabFooter = {
46
+ width: "50%",
47
+ table: {
48
+ headerRows: 1,
49
+ // widths: [ 100, 100, 100, 100 ],
50
+ widths: ["*", "*", "*", "*"],
51
+ heights: [6],
52
+ body: [
53
+ [
54
+ { text: "TOTAL HT", style: "headerText" },
55
+ // {text: 'PORT HT', style: 'headerText'},
56
+ { text: "TOTAL TVA", style: "headerText" },
57
+ { text: "TOTAL TTC", style: "headerText" },
58
+ { text: "NET A PAYER", style: "headerText" },
59
+ ],
60
+ [
61
+ { text: totalAmountWithoutTva, style: "rowText", alignment: "center" },
62
+ // { text: totalPort, style: 'rowText', alignment: 'center' },
63
+ { text: totalTva, style: "rowText", alignment: "center" },
64
+ { text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
65
+ { text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
66
+ ],
67
+ ],
68
+ },
69
+ };
70
+ return tabFooter;
71
+ };
72
+ export const infoAmounOntSale = (tob) => {
73
+ const totalAmountWithoutTva = tob.isBack && (tob.backChoice.toLowerCase() === "autre" || tob.rejectedReason)
74
+ ? 0
75
+ : formatToStringCfa(getTotalAmountWithoutTvaOnSale(tob, true));
76
+ const totalPort = formatToStringCfa(getTotalShippingOnSale(tob));
77
+ const totalTva = formatToStringCfa(getTotalTvaOnSale(tob, true));
78
+ const totalAmountAllIncluded = tob.isBack && (tob.backChoice.toLowerCase() === "autre" || tob.rejectedReason)
79
+ ? 0
80
+ : formatToStringCfa(getTotalAmountAllIncludedOnSale(tob, true));
81
+ const tabFooter = {
82
+ width: "50%",
83
+ table: {
84
+ headerRows: 1,
85
+ // widths: [ 100, 100, 100, 100 ],
86
+ widths: ["*", "*", "*", "*", "*"],
87
+ heights: [6],
88
+ body: [
89
+ [
90
+ { text: "TOTAL HT", style: "headerText" },
91
+ { text: "PORT HT", style: "headerText" },
92
+ { text: "TOTAL TVA", style: "headerText" },
93
+ { text: "TOTAL TTC", style: "headerText" },
94
+ { text: "NET A PAYER", style: "headerText" },
95
+ ],
96
+ [
97
+ { text: totalAmountWithoutTva, style: "rowText", alignment: "center" },
98
+ { text: totalPort, style: "rowText", alignment: "center" },
99
+ { text: totalTva, style: "rowText", alignment: "center" },
100
+ { text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
101
+ { text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
102
+ ],
103
+ ],
104
+ },
105
+ };
106
+ return tabFooter;
107
+ };
108
+ export const infoAmountOnBill = (tob) => {
109
+ const totalAmountAllAndBackInclused = getTotalAmountAllIncludedOnBill(tob.sales);
110
+ const totalAmountWithoutTvaAllAndBack = getTotalAmountWithoutTvaOnBill(tob.sales);
111
+ const totalAmountTvaAllAndBack = getTotalAmountTvaOnBill(tob.sales);
112
+ // const totalAmountWithoutTva = formatToStringCfa(HlpSale.getTotalAmountWithoutTvaOnBill(tob.sales));
113
+ const totalAmountWithoutTva = formatToStringCfa(totalAmountWithoutTvaAllAndBack);
114
+ // const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
115
+ const totalTva = formatToStringCfa(totalAmountTvaAllAndBack);
116
+ // const totalTva = formatToStringCfa(HlpSale.getTotalAmountTvaOnBill(tob.sales));
117
+ // const totalAmountAllIncluded = formatToStringCfa(HlpSale.getTotalAmountOnBill(tob.sales));
118
+ const totalAmountAllIncluded = formatToStringCfa(totalAmountAllAndBackInclused);
119
+ const tabFooter = {
120
+ width: "50%",
121
+ table: {
122
+ headerRows: 1,
123
+ // widths: [ 100, 100, 100, 100 ],
124
+ widths: ["*", "*", "*", "*"],
125
+ heights: [6],
126
+ body: [
127
+ [
128
+ { text: "TOTAL HT", style: "headerText" },
129
+ // {text: 'PORT HT', style: 'headerText'},
130
+ { text: "TOTAL TVA", style: "headerText" },
131
+ { text: "TOTAL TTC", style: "headerText" },
132
+ { text: "NET A PAYER", style: "headerText" },
133
+ ],
134
+ [
135
+ { text: totalAmountWithoutTva, style: "rowText", alignment: "center" },
136
+ // { text: totalPort, style: 'rowText', alignment: 'center' },
137
+ { text: totalTva, style: "rowText", alignment: "center" },
138
+ { text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
139
+ { text: totalAmountAllIncluded, style: "rowText", alignment: "center" },
140
+ ],
141
+ ],
142
+ },
143
+ };
144
+ return tabFooter;
145
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./amountInvoice";
2
+ export * from "./infoInvoice";
3
+ export * from "./tools";
@@ -0,0 +1,3 @@
1
+ export * from "./amountInvoice";
2
+ export * from "./infoInvoice";
3
+ export * from "./tools";
@@ -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,74 @@
1
+ import { getNbFreezeOnBill, getNbPackagesOnBill, getNbProductsOnBill, getTotalQtityOnBill } from "../bills/bill";
2
+ import { getNbProductsOnSale, getTotalQtityOnSale } from "../sales/sale";
3
+ import { dateFormatter } from "../utils";
4
+ export const infoSale = (tob) => {
5
+ const totalQtity = getTotalQtityOnSale(tob);
6
+ const nbProducts = getNbProductsOnSale(tob);
7
+ const nbColis = tob.nbPackages;
8
+ const nbFreeze = tob.nbFreeze;
9
+ // const oWidth = [ '*', '*', 75, 75, 75, 75];
10
+ const tabTop = {
11
+ width: "50%",
12
+ table: {
13
+ headerRows: 1,
14
+ widths: ["*", "*", 75, 75, 75, 75],
15
+ heights: [6],
16
+ body: [
17
+ [
18
+ { text: "FACTURE N°", style: "headerText" },
19
+ { text: "DATE", style: "headerText" },
20
+ { text: "NBRE DE PDTS", style: "headerText" },
21
+ { text: "QUANTITE TOTALE", style: "headerText" },
22
+ { text: "NBRE COLIS", style: "headerText" },
23
+ { text: "NBRE FROID", style: "headerText" },
24
+ ],
25
+ [
26
+ { text: tob.ref, style: "rowText" },
27
+ { text: dateFormatter(tob.createdAt, "dmy", "/"), style: "rowText" },
28
+ { text: nbProducts, style: "rowText" },
29
+ { text: totalQtity, style: "rowText" },
30
+ { text: nbColis, style: "rowText" },
31
+ { text: nbFreeze, style: "rowText" },
32
+ ],
33
+ ],
34
+ },
35
+ };
36
+ return tabTop;
37
+ };
38
+ export const infoBill = (tob) => {
39
+ const totalQtity = getTotalQtityOnBill(tob.sales);
40
+ const nbProducts = getNbProductsOnBill(tob.sales);
41
+ const nbColis = getNbPackagesOnBill(tob.sales);
42
+ const nbFreeze = getNbFreezeOnBill(tob.sales);
43
+ const oWidth = ["*", "*", 75, 75, 75, 75];
44
+ const tabTop = {
45
+ width: "50%",
46
+ table: {
47
+ headerRows: 1,
48
+ // widths: [ 125, 125, 125, '*' ],
49
+ widths: oWidth,
50
+ heights: [6],
51
+ // widths: [ '16%', '16%', '16%', '16%' ],
52
+ body: [
53
+ [
54
+ { text: "FACTURE N°", style: "headerText" },
55
+ { text: "DATE", style: "headerText" },
56
+ { text: "NBRE DE PDTS", style: "headerText" },
57
+ { text: "QUANTITE TOTALE", style: "headerText" },
58
+ { text: "NBRE COLIS", style: "headerText" },
59
+ { text: "NBRE FROID", style: "headerText" },
60
+ ],
61
+ [
62
+ { text: tob.ref, style: "rowText" },
63
+ // { text: moment(tob.createdAt ).format('DD/MM/YYYY'), style: 'rowText'},
64
+ { text: dateFormatter(tob.createdAt, "dmy", "/"), style: "rowText" },
65
+ { text: nbProducts, style: "rowText" },
66
+ { text: totalQtity, style: "rowText" },
67
+ { text: nbColis, style: "rowText" },
68
+ { text: nbFreeze, style: "rowText" },
69
+ ],
70
+ ],
71
+ },
72
+ };
73
+ return tabTop;
74
+ };