asv-hlps-market 1.0.6 → 1.0.9

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 (166) hide show
  1. package/lib/cjs/bills/bill.d.ts +19 -0
  2. package/lib/cjs/bills/bill.js +79 -0
  3. package/lib/cjs/bills/models/Bill.d.ts +21 -0
  4. package/lib/cjs/buys/models/Buy.d.ts +3 -2
  5. package/lib/cjs/buys/models/BuyProduct.d.ts +3 -0
  6. package/lib/cjs/index.d.ts +12 -2
  7. package/lib/cjs/index.js +14 -2
  8. package/lib/cjs/markets/index.d.ts +1 -0
  9. package/lib/cjs/{shops → markets}/index.js +1 -1
  10. package/lib/cjs/{models → markets/models}/Market.d.ts +2 -1
  11. package/lib/{esm → cjs/markets}/models/UMarket.d.ts +2 -2
  12. package/lib/cjs/models/Gender.d.ts +6 -0
  13. package/lib/cjs/models/Gender.js +2 -0
  14. package/lib/cjs/models/Sale.d.ts +34 -0
  15. package/lib/cjs/models/Sale.js +2 -0
  16. package/lib/cjs/models/SaleProduct.d.ts +18 -0
  17. package/lib/cjs/models/SaleProduct.js +6 -0
  18. package/lib/cjs/models/Ste.d.ts +8 -0
  19. package/lib/cjs/models/Ste.js +2 -0
  20. package/lib/cjs/models/SteGrp.d.ts +7 -0
  21. package/lib/cjs/models/SteGrp.js +2 -0
  22. package/lib/cjs/models/Titr.d.ts +5 -0
  23. package/lib/cjs/models/Titr.js +2 -0
  24. package/lib/cjs/models/User.d.ts +38 -0
  25. package/lib/cjs/models/User.js +2 -0
  26. package/lib/cjs/models/UserGrp.d.ts +4 -0
  27. package/lib/cjs/models/UserGrp.js +2 -0
  28. package/lib/cjs/models/UserRole.d.ts +5 -0
  29. package/lib/cjs/models/UserRole.js +2 -0
  30. package/lib/cjs/models/shared/NaAc.d.ts +6 -0
  31. package/lib/cjs/models/shared/NaAc.js +2 -0
  32. package/lib/cjs/models/shared/NaCoAc.d.ts +4 -0
  33. package/lib/cjs/models/shared/NaCoAc.js +2 -0
  34. package/lib/cjs/models/shared/NaCoShortAc.d.ts +4 -0
  35. package/lib/cjs/models/shared/NaCoShortAc.js +2 -0
  36. package/lib/cjs/pdfs/invoices/amountInvoice.d.ts +66 -0
  37. package/lib/cjs/pdfs/invoices/amountInvoice.js +144 -0
  38. package/lib/cjs/pdfs/invoices/infoInvoice.d.ts +32 -0
  39. package/lib/cjs/pdfs/invoices/infoInvoice.js +80 -0
  40. package/lib/cjs/pdfs/tools/tools.d.ts +34 -0
  41. package/lib/cjs/pdfs/tools/tools.js +53 -0
  42. package/lib/cjs/products/hlpProduct.d.ts +1 -2
  43. package/lib/cjs/products/hlpProduct.js +7 -16
  44. package/lib/cjs/products/interfaces/Product.d.ts +53 -0
  45. package/lib/cjs/products/interfaces/Product.js +2 -0
  46. package/lib/cjs/products/interfaces/ProductCat.d.ts +6 -0
  47. package/lib/cjs/products/interfaces/ProductCat.js +2 -0
  48. package/lib/cjs/products/interfaces/ProductStore.d.ts +24 -0
  49. package/lib/cjs/products/interfaces/ProductStore.js +2 -0
  50. package/lib/cjs/products/models/Product.d.ts +5 -5
  51. package/lib/cjs/products/product.d.ts +3 -0
  52. package/lib/cjs/products/product.js +22 -0
  53. package/lib/cjs/sales/models/SaleItems.d.ts +2 -2
  54. package/lib/cjs/sales/models/SalePayment.d.ts +2 -1
  55. package/lib/cjs/sales/sale.d.ts +18 -0
  56. package/lib/cjs/sales/sale.js +129 -0
  57. package/lib/cjs/shared/CartItem.js +0 -1
  58. package/lib/cjs/shopping/models/CartItem.d.ts +6 -0
  59. package/lib/cjs/shopping/models/CartItem.js +2 -0
  60. package/lib/cjs/shopping/models/index.d.ts +1 -0
  61. package/lib/cjs/shopping/models/index.js +17 -0
  62. package/lib/cjs/shops/models/CartItem.d.ts +6 -0
  63. package/lib/cjs/shops/models/CartItem.js +2 -0
  64. package/lib/cjs/shops/models/Shop.d.ts +1 -1
  65. package/lib/cjs/shops/models/index.d.ts +1 -0
  66. package/lib/cjs/shops/models/index.js +17 -0
  67. package/lib/cjs/users/index.d.ts +1 -0
  68. package/lib/cjs/users/index.js +17 -0
  69. package/lib/cjs/users/models/User.d.ts +1 -1
  70. package/lib/cjs/users/models/index.d.ts +1 -0
  71. package/lib/cjs/users/models/index.js +17 -0
  72. package/lib/esm/bills/bill.d.ts +19 -0
  73. package/lib/esm/bills/bill.js +58 -0
  74. package/lib/esm/bills/models/Bill.d.ts +21 -0
  75. package/lib/esm/buys/models/Buy.d.ts +3 -2
  76. package/lib/esm/buys/models/BuyProduct.d.ts +3 -0
  77. package/lib/esm/index.d.ts +12 -2
  78. package/lib/esm/index.js +14 -2
  79. package/lib/esm/markets/index.d.ts +1 -0
  80. package/lib/esm/markets/index.js +1 -0
  81. package/lib/esm/{models → markets/models}/Market.d.ts +2 -1
  82. package/lib/{cjs → esm/markets}/models/UMarket.d.ts +2 -2
  83. package/lib/esm/models/Gender.d.ts +6 -0
  84. package/lib/esm/models/Gender.js +1 -0
  85. package/lib/esm/models/Sale.d.ts +34 -0
  86. package/lib/esm/models/Sale.js +1 -0
  87. package/lib/esm/models/SaleProduct.d.ts +18 -0
  88. package/lib/esm/models/SaleProduct.js +2 -0
  89. package/lib/esm/models/Ste.d.ts +8 -0
  90. package/lib/esm/models/Ste.js +1 -0
  91. package/lib/esm/models/SteGrp.d.ts +7 -0
  92. package/lib/esm/models/SteGrp.js +1 -0
  93. package/lib/esm/models/Titr.d.ts +5 -0
  94. package/lib/esm/models/Titr.js +1 -0
  95. package/lib/esm/models/User.d.ts +38 -0
  96. package/lib/esm/models/User.js +1 -0
  97. package/lib/esm/models/UserGrp.d.ts +4 -0
  98. package/lib/esm/models/UserGrp.js +1 -0
  99. package/lib/esm/models/UserRole.d.ts +5 -0
  100. package/lib/esm/models/UserRole.js +1 -0
  101. package/lib/esm/models/shared/NaAc.d.ts +6 -0
  102. package/lib/esm/models/shared/NaAc.js +1 -0
  103. package/lib/esm/models/shared/NaCoAc.d.ts +4 -0
  104. package/lib/esm/models/shared/NaCoAc.js +1 -0
  105. package/lib/esm/models/shared/NaCoShortAc.d.ts +4 -0
  106. package/lib/esm/models/shared/NaCoShortAc.js +1 -0
  107. package/lib/esm/pdfs/invoices/amountInvoice.d.ts +66 -0
  108. package/lib/esm/pdfs/invoices/amountInvoice.js +137 -0
  109. package/lib/esm/pdfs/invoices/infoInvoice.d.ts +26 -0
  110. package/lib/esm/pdfs/invoices/infoInvoice.js +75 -0
  111. package/lib/esm/pdfs/tools/tools.d.ts +34 -0
  112. package/lib/esm/pdfs/tools/tools.js +47 -0
  113. package/lib/esm/products/hlpProduct.d.ts +1 -2
  114. package/lib/esm/products/hlpProduct.js +7 -16
  115. package/lib/esm/products/interfaces/Product.d.ts +53 -0
  116. package/lib/esm/products/interfaces/Product.js +1 -0
  117. package/lib/esm/products/interfaces/ProductCat.d.ts +6 -0
  118. package/lib/esm/products/interfaces/ProductCat.js +1 -0
  119. package/lib/esm/products/interfaces/ProductStore.d.ts +24 -0
  120. package/lib/esm/products/interfaces/ProductStore.js +1 -0
  121. package/lib/esm/products/models/Product.d.ts +5 -5
  122. package/lib/esm/products/product.d.ts +3 -0
  123. package/lib/esm/products/product.js +17 -0
  124. package/lib/esm/sales/models/SaleItems.d.ts +2 -2
  125. package/lib/esm/sales/models/SalePayment.d.ts +2 -1
  126. package/lib/esm/sales/sale.d.ts +18 -0
  127. package/lib/esm/sales/sale.js +109 -0
  128. package/lib/esm/shared/CartItem.js +0 -1
  129. package/lib/esm/shopping/models/CartItem.d.ts +6 -0
  130. package/lib/esm/shopping/models/CartItem.js +1 -0
  131. package/lib/esm/shopping/models/index.d.ts +1 -0
  132. package/lib/esm/shopping/models/index.js +1 -0
  133. package/lib/esm/shops/models/CartItem.d.ts +6 -0
  134. package/lib/esm/shops/models/CartItem.js +1 -0
  135. package/lib/esm/shops/models/Shop.d.ts +1 -1
  136. package/lib/esm/shops/models/index.d.ts +1 -0
  137. package/lib/esm/shops/models/index.js +1 -0
  138. package/lib/esm/users/index.d.ts +1 -0
  139. package/lib/esm/users/index.js +1 -0
  140. package/lib/esm/users/models/User.d.ts +1 -1
  141. package/lib/esm/users/models/index.d.ts +1 -0
  142. package/lib/esm/users/models/index.js +1 -0
  143. package/package.json +4 -4
  144. package/lib/cjs/pos/CartProduct.d.ts +0 -6
  145. package/lib/cjs/pos/hlpShop.d.ts +0 -37
  146. package/lib/cjs/pos/hlpShop.js +0 -216
  147. package/lib/cjs/pos/index.d.ts +0 -1
  148. package/lib/cjs/pos/index.js +0 -8
  149. package/lib/cjs/shops/index.d.ts +0 -1
  150. package/lib/esm/pos/CartProduct.d.ts +0 -6
  151. package/lib/esm/pos/hlpShop.d.ts +0 -37
  152. package/lib/esm/pos/hlpShop.js +0 -210
  153. package/lib/esm/pos/index.d.ts +0 -1
  154. package/lib/esm/pos/index.js +0 -1
  155. package/lib/esm/shops/index.d.ts +0 -1
  156. package/lib/esm/shops/index.js +0 -1
  157. /package/lib/cjs/{models/Market.js → bills/models/Bill.js} +0 -0
  158. /package/lib/cjs/{models/UMarket.js → markets/models/Market.js} +0 -0
  159. /package/lib/cjs/{pos/CartProduct.js → markets/models/UMarket.js} +0 -0
  160. /package/lib/cjs/{models → markets/models}/index.d.ts +0 -0
  161. /package/lib/cjs/{models → markets/models}/index.js +0 -0
  162. /package/lib/esm/{models/Market.js → bills/models/Bill.js} +0 -0
  163. /package/lib/esm/{models/UMarket.js → markets/models/Market.js} +0 -0
  164. /package/lib/esm/{pos/CartProduct.js → markets/models/UMarket.js} +0 -0
  165. /package/lib/esm/{models → markets/models}/index.d.ts +0 -0
  166. /package/lib/esm/{models → markets/models}/index.js +0 -0
@@ -0,0 +1,19 @@
1
+ import { Bill, Sale } from "asv-hlps-models";
2
+ export declare const getNbProductsOnBill: (sales: Sale[]) => number;
3
+ export declare const getNbPackagesOnBill: (sales: Sale[]) => number;
4
+ export declare const getNbFreezeOnBill: (sales: Sale[]) => number;
5
+ export declare const getTotalTvaOnBill: (sales: Sale[]) => number;
6
+ export declare const getTotalAmountOnBill: (sales: Sale[]) => number;
7
+ export declare const getTotalAmountBackOnBill: (sales: Sale[]) => number;
8
+ export declare const getTotalTvaBackOnBill: (sales: Sale[]) => number;
9
+ export declare const getTotalQtityOnBill: (sales: Sale[]) => number;
10
+ export declare const getTotalQtityFreeOnBill: (sales: Sale[]) => number;
11
+ export declare const getTotalAmountWithoutTvaOnBill: (sales: Sale[]) => number;
12
+ export declare const getTotalAmountWithoutTvaBackOnBill: (sales: Sale[]) => number;
13
+ export declare const getTotalAmountAllIncludedOnBill: (sales: Sale[]) => number;
14
+ export declare const getTotalAmountTvaOnBill: (sales: Sale[]) => number;
15
+ export declare const getTotalAmountTvaBackOnBill: (sales: Sale[]) => number;
16
+ export declare const getTotalAmountOnListBill: (bills: Bill[]) => number;
17
+ export declare const getTotalAmountTvaOnListBill: (bills: Bill[]) => number;
18
+ export declare const getTotalAmountWithoutTvaOnListBill: (bills: Bill[]) => number;
19
+ export declare const getTotalDueAmountOnListBill: (bills: Bill[]) => number;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTotalDueAmountOnListBill = exports.getTotalAmountWithoutTvaOnListBill = exports.getTotalAmountTvaOnListBill = exports.getTotalAmountOnListBill = exports.getTotalAmountTvaBackOnBill = exports.getTotalAmountTvaOnBill = exports.getTotalAmountAllIncludedOnBill = exports.getTotalAmountWithoutTvaBackOnBill = exports.getTotalAmountWithoutTvaOnBill = exports.getTotalQtityFreeOnBill = exports.getTotalQtityOnBill = exports.getTotalTvaBackOnBill = exports.getTotalAmountBackOnBill = exports.getTotalAmountOnBill = exports.getTotalTvaOnBill = exports.getNbFreezeOnBill = exports.getNbPackagesOnBill = exports.getNbProductsOnBill = void 0;
4
+ const sale_1 = require("../sales/sale");
5
+ const getNbProductsOnBill = (sales) => {
6
+ return sales.reduce((prev, sale) => prev + (+(0, sale_1.getNbProductsOnSale)(sale)), 0);
7
+ };
8
+ exports.getNbProductsOnBill = getNbProductsOnBill;
9
+ const getNbPackagesOnBill = (sales) => {
10
+ return sales.reduce((prev, sale) => prev + (+sale.nbPackages), 0);
11
+ };
12
+ exports.getNbPackagesOnBill = getNbPackagesOnBill;
13
+ const getNbFreezeOnBill = (sales) => {
14
+ return sales.reduce((prev, sale) => prev + (+sale.nbFreeze), 0);
15
+ };
16
+ exports.getNbFreezeOnBill = getNbFreezeOnBill;
17
+ const getTotalTvaOnBill = (sales) => {
18
+ if (!sales.length) {
19
+ return 0;
20
+ }
21
+ return sales.reduce((prev, sale) => prev + ((0, sale_1.getTotalTvaOnSale)(sale, true)), 0);
22
+ };
23
+ exports.getTotalTvaOnBill = getTotalTvaOnBill;
24
+ const getTotalAmountOnBill = (sales) => {
25
+ return sales.reduce((prev, sale) => prev + ((0, sale_1.getTotalAmountOnSale)(sale, true)), 0);
26
+ };
27
+ exports.getTotalAmountOnBill = getTotalAmountOnBill;
28
+ const getTotalAmountBackOnBill = (sales) => {
29
+ return sales.reduce((prev, sale) => prev + ((0, sale_1.getTotalAmountBackOnSale)(sale)), 0);
30
+ };
31
+ exports.getTotalAmountBackOnBill = getTotalAmountBackOnBill;
32
+ const getTotalTvaBackOnBill = (sales) => {
33
+ return sales.reduce((prev, sale) => prev + ((0, sale_1.getTotalTvaBackOnSale)(sale)), 0);
34
+ };
35
+ exports.getTotalTvaBackOnBill = getTotalTvaBackOnBill;
36
+ const getTotalQtityOnBill = (sales) => {
37
+ return sales.reduce((prev, sale) => prev + ((0, sale_1.getTotalQtityOnSale)(sale, true)), 0);
38
+ };
39
+ exports.getTotalQtityOnBill = getTotalQtityOnBill;
40
+ const getTotalQtityFreeOnBill = (sales) => {
41
+ return sales.reduce((prev, sale) => prev + ((0, sale_1.getTotalQtityFreeOnSale)(sale)), 0);
42
+ };
43
+ exports.getTotalQtityFreeOnBill = getTotalQtityFreeOnBill;
44
+ const getTotalAmountWithoutTvaOnBill = (sales) => {
45
+ return sales.reduce((prev, sale) => prev + (+(0, sale_1.getTotalAmountWithoutTvaOnSale)(sale, true)), 0);
46
+ };
47
+ exports.getTotalAmountWithoutTvaOnBill = getTotalAmountWithoutTvaOnBill;
48
+ const getTotalAmountWithoutTvaBackOnBill = (sales) => {
49
+ return sales.reduce((prev, sale) => prev + (+(0, sale_1.getTotalAmountWithoutTvaBackOnSale)(sale)), 0);
50
+ };
51
+ exports.getTotalAmountWithoutTvaBackOnBill = getTotalAmountWithoutTvaBackOnBill;
52
+ const getTotalAmountAllIncludedOnBill = (sales) => {
53
+ return sales.reduce((prev, sale) => prev + (+(0, sale_1.getTotalAmountAllIncludedOnSale)(sale, true)), 0);
54
+ };
55
+ exports.getTotalAmountAllIncludedOnBill = getTotalAmountAllIncludedOnBill;
56
+ const getTotalAmountTvaOnBill = (sales) => {
57
+ return sales.reduce((prev, sale) => prev + (+(0, sale_1.getTotalTvaOnSale)(sale, true)), 0);
58
+ };
59
+ exports.getTotalAmountTvaOnBill = getTotalAmountTvaOnBill;
60
+ const getTotalAmountTvaBackOnBill = (sales) => {
61
+ return sales.reduce((prev, sale) => prev + (+(0, sale_1.getTotalTvaBackOnSale)(sale)), 0);
62
+ };
63
+ exports.getTotalAmountTvaBackOnBill = getTotalAmountTvaBackOnBill;
64
+ const getTotalAmountOnListBill = (bills) => {
65
+ return bills.reduce((prev, curr) => prev + (+curr.totalAmount), 0);
66
+ };
67
+ exports.getTotalAmountOnListBill = getTotalAmountOnListBill;
68
+ const getTotalAmountTvaOnListBill = (bills) => {
69
+ return bills.reduce((prev, curr) => prev + (+(0, exports.getTotalAmountTvaOnBill)(curr.sales)), 0);
70
+ };
71
+ exports.getTotalAmountTvaOnListBill = getTotalAmountTvaOnListBill;
72
+ const getTotalAmountWithoutTvaOnListBill = (bills) => {
73
+ return bills.reduce((prev, curr) => prev + (+(0, exports.getTotalAmountWithoutTvaOnBill)(curr.sales)), 0);
74
+ };
75
+ exports.getTotalAmountWithoutTvaOnListBill = getTotalAmountWithoutTvaOnListBill;
76
+ const getTotalDueAmountOnListBill = (bills) => {
77
+ return bills.reduce((prev, curr) => prev + (+curr.dueAmount), 0);
78
+ };
79
+ exports.getTotalDueAmountOnListBill = getTotalDueAmountOnListBill;
@@ -0,0 +1,21 @@
1
+ import { Sale } from "../../models/Sale";
2
+ export interface Bill {
3
+ id?: number;
4
+ createdAt?: Date;
5
+ ref?: string;
6
+ totalAmount?: number;
7
+ isPaid?: boolean;
8
+ isPartialPaid?: boolean;
9
+ paidDate?: Date;
10
+ dueAmount?: number;
11
+ escompteAmount?: number;
12
+ totalAmountAllIncluded?: number;
13
+ hasTva?: boolean;
14
+ isBack?: boolean;
15
+ fromCron?: boolean;
16
+ nbPrint?: number;
17
+ type?: 'sale' | 'avoir';
18
+ store?: string;
19
+ sales?: Sale[];
20
+ nbrePayment?: number;
21
+ }
@@ -1,6 +1,6 @@
1
1
  import Ste from "asv-hlps/lib/cjs/users/models/Ste";
2
- import User from "asv-hlps/lib/cjs/users/models/User";
3
- import ProductIn from "asv-hlps/lib/cjs/products/models/ProductIn";
2
+ import ProductIn from "../../products/models/ProductIn";
3
+ import User from "../../users/models/User";
4
4
  import { BuyProduct } from "./BuyProduct";
5
5
  export interface Buy {
6
6
  author: User;
@@ -29,3 +29,4 @@ export interface Buy {
29
29
  updatedAt: Date;
30
30
  directReceived: boolean;
31
31
  }
32
+ export default Buy;
@@ -20,4 +20,7 @@ export interface BuyProduct {
20
20
  buyPrice: number;
21
21
  amountBuyPrice: number;
22
22
  publicPrice: number;
23
+ unitCost: number;
24
+ unitCostPrice: number;
25
+ unitPrice: number;
23
26
  }
@@ -1,2 +1,12 @@
1
- export * from "./models";
2
- export * from "./products/models";
1
+ import './bills/bill';
2
+ import './pdfs/invoices/amountInvoice';
3
+ import './pdfs/invoices/infoInvoice';
4
+ import './pdfs/tools/tools';
5
+ import './products/product';
6
+ import './sales/sale';
7
+ export * from './bills/bill';
8
+ export * from './pdfs/invoices/amountInvoice';
9
+ export * from './pdfs/invoices/infoInvoice';
10
+ export * from './pdfs/tools/tools';
11
+ export * from './products/product';
12
+ export * from './sales/sale';
package/lib/cjs/index.js CHANGED
@@ -14,5 +14,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./models"), exports);
18
- __exportStar(require("./products/models"), exports);
17
+ // import 'asv-hlps';
18
+ require("./bills/bill");
19
+ require("./pdfs/invoices/amountInvoice");
20
+ require("./pdfs/invoices/infoInvoice");
21
+ require("./pdfs/tools/tools");
22
+ require("./products/product");
23
+ require("./sales/sale");
24
+ // export * from 'asv-hlps/lib/cjs';
25
+ __exportStar(require("./bills/bill"), exports);
26
+ __exportStar(require("./pdfs/invoices/amountInvoice"), exports);
27
+ __exportStar(require("./pdfs/invoices/infoInvoice"), exports);
28
+ __exportStar(require("./pdfs/tools/tools"), exports);
29
+ __exportStar(require("./products/product"), exports);
30
+ __exportStar(require("./sales/sale"), exports);
@@ -0,0 +1 @@
1
+ export * from "./models";
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./models/Shop"), exports);
17
+ __exportStar(require("./models"), exports);
@@ -1,4 +1,4 @@
1
- export interface Market {
1
+ interface Market {
2
2
  id?: number;
3
3
  name: string;
4
4
  code: string;
@@ -6,3 +6,4 @@ export interface Market {
6
6
  iconPack: string;
7
7
  isActive: boolean;
8
8
  }
9
+ export default Market;
@@ -1,5 +1,5 @@
1
- import User from "../users/models/User";
2
- import { Market } from "./Market";
1
+ import User from "../../users/models/User";
2
+ import Market from "./Market";
3
3
  export default interface UMarket {
4
4
  id: number;
5
5
  createdAt: Date;
@@ -0,0 +1,6 @@
1
+ export interface Gender {
2
+ id: number;
3
+ name: string;
4
+ avatar: string;
5
+ abr: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,34 @@
1
+ import { SaleProduct } from "./SaleProduct";
2
+ import { User } from "./User";
3
+ export interface Sale {
4
+ id: number;
5
+ ref?: string;
6
+ createdAt?: any;
7
+ saleDate?: any;
8
+ deliveryDate?: Date;
9
+ shippingDate?: Date;
10
+ shippingFee?: number;
11
+ otherFee?: number;
12
+ nbPrint?: number;
13
+ discountRate?: number;
14
+ status?: number;
15
+ isValided?: boolean;
16
+ isProforma?: boolean;
17
+ proformaToSale?: boolean;
18
+ hasBack?: boolean;
19
+ isBack?: boolean;
20
+ isWaiting?: boolean;
21
+ waitingToSale?: boolean;
22
+ backChoice?: string;
23
+ nbPackages?: number;
24
+ nbFreeze?: number;
25
+ isProcessing?: boolean;
26
+ isProcessed?: boolean;
27
+ isOnProcessed?: boolean;
28
+ isDelivering?: boolean;
29
+ isPicking?: boolean;
30
+ isDelivered?: boolean;
31
+ rejectedReason?: string;
32
+ saleProducts?: SaleProduct[];
33
+ client?: User;
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { Product } from '../products/interfaces/Product';
2
+ export declare class SaleProduct {
3
+ id: number;
4
+ qtityFund?: number;
5
+ qtityOdr?: number;
6
+ qtityDlvr?: number;
7
+ qtityFree?: number;
8
+ qtityBack?: number;
9
+ publicPrice?: number;
10
+ unitPrice?: number;
11
+ speUnitPrice?: number;
12
+ pghtPrice?: number;
13
+ promo?: number;
14
+ tva?: number;
15
+ isBack?: boolean;
16
+ hasBack?: boolean;
17
+ product?: Product;
18
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SaleProduct = void 0;
4
+ class SaleProduct {
5
+ }
6
+ exports.SaleProduct = SaleProduct;
@@ -0,0 +1,8 @@
1
+ import { SteGrp } from './SteGrp';
2
+ export interface Ste {
3
+ id: number;
4
+ name: string;
5
+ isValided?: boolean;
6
+ isActive?: boolean;
7
+ grp?: SteGrp;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export interface SteGrp {
2
+ id: number;
3
+ name: string;
4
+ code?: string;
5
+ shortname: string;
6
+ coef?: number;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface Titr {
2
+ id: number;
3
+ name: string;
4
+ shortname: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,38 @@
1
+ import { Gender } from "./Gender";
2
+ import { Ste } from "./Ste";
3
+ import { Titr } from "./Titr";
4
+ import { UserGrp } from "./UserGrp";
5
+ import { UserRole } from "./UserRole";
6
+ export interface User {
7
+ id: number;
8
+ codeCompta?: string | number;
9
+ firstname?: string;
10
+ lastname?: string;
11
+ username?: string;
12
+ birthday?: Date | string;
13
+ password?: string;
14
+ approval?: string;
15
+ approvalExpDate?: Date;
16
+ ip?: string;
17
+ isActive?: boolean;
18
+ isSpecial?: boolean;
19
+ hasBillCredit?: boolean;
20
+ isValided?: boolean;
21
+ disabled?: boolean;
22
+ isBadPayer?: boolean;
23
+ isEqeerUser?: boolean;
24
+ ifDarkMode?: boolean;
25
+ foto?: string;
26
+ clp?: string;
27
+ periodBill?: string;
28
+ limitAmountSaleByMonth?: number;
29
+ hasLimitSaleSafe?: boolean;
30
+ hasBillSafe?: boolean;
31
+ gender?: Gender;
32
+ titr?: Titr;
33
+ clientId?: number;
34
+ grp?: UserGrp;
35
+ role?: UserRole;
36
+ ste?: Ste;
37
+ fullname: string;
38
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { NaCoShortAc } from "./shared/NaCoShortAc";
2
+ export interface UserGrp extends NaCoShortAc {
3
+ coef?: number;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { NaCoShortAc } from "./shared/NaCoShortAc";
2
+ export interface UserRole extends NaCoShortAc {
3
+ extern?: boolean;
4
+ intern?: boolean;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export 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 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 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,66 @@
1
+ import { Bill } from "asv-hlps-models";
2
+ import { Sale } from "asv-hlps-models";
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,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.infoAmountOnBill = exports.infoAmounOntSale = exports.infoAmountOnProforma = exports.infoAmountOnBl = void 0;
4
+ const asv_hlps_1 = require("asv-hlps");
5
+ const bill_1 = require("../../bills/bill");
6
+ const sale_1 = require("../../sales/sale");
7
+ const infoAmountOnBl = (tob) => {
8
+ const totalAmountWithoutTva = (tob.isBack && (tob.backChoice.toLowerCase() === 'autre' || tob.rejectedReason)) ? 0 : (0, asv_hlps_1.formatToStringCfa)((0, sale_1.getTotalAmountWithoutTvaOnSale)(tob, true));
9
+ // const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
10
+ const totalTva = (0, asv_hlps_1.formatToStringCfa)((0, sale_1.getTotalTvaOnSale)(tob, true));
11
+ const totalAmountAllIncluded = (tob.isBack && (tob.backChoice.toLowerCase() === 'autre' || tob.rejectedReason)) ? 0 : (0, asv_hlps_1.formatToStringCfa)((0, sale_1.getTotalAmountAllIncludedOnSale)(tob, true));
12
+ const tabFooter = {
13
+ width: '50%',
14
+ table: {
15
+ headerRows: 1,
16
+ // widths: [ 100, 100, 100, 100 ],
17
+ widths: ['*', '*', '*', '*'],
18
+ heights: [6],
19
+ body: [
20
+ [
21
+ { text: 'TOTAL HT', style: 'headerText' },
22
+ // {text: 'PORT HT', style: 'headerText'},
23
+ { text: 'TOTAL TVA', style: 'headerText' },
24
+ { text: 'TOTAL TTC', style: 'headerText' },
25
+ { text: 'NET A PAYER', style: 'headerText' }
26
+ ],
27
+ [
28
+ { text: totalAmountWithoutTva, style: 'rowText', alignment: 'center' },
29
+ // { text: totalPort, style: 'rowText', alignment: 'center' },
30
+ { text: totalTva, style: 'rowText', alignment: 'center' },
31
+ { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
32
+ { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
33
+ ]
34
+ ]
35
+ }
36
+ };
37
+ return tabFooter;
38
+ };
39
+ exports.infoAmountOnBl = infoAmountOnBl;
40
+ const infoAmountOnProforma = (tob) => {
41
+ const totalAmountWithoutTva = (tob.isBack && tob.backChoice.toLowerCase() === 'autre') ? 0 : (0, asv_hlps_1.formatToStringCfa)((0, sale_1.getTotalAmountWithoutTvaOnSale)(tob));
42
+ // const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
43
+ const totalTva = (0, asv_hlps_1.formatToStringCfa)((0, sale_1.getTotalTvaOnSale)(tob));
44
+ const totalAmountAllIncluded = (tob.isBack && tob.backChoice.toLowerCase() === 'autre') ? 0 : (0, asv_hlps_1.formatToStringCfa)((0, sale_1.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
+ exports.infoAmountOnProforma = infoAmountOnProforma;
73
+ const infoAmounOntSale = (tob) => {
74
+ const totalAmountWithoutTva = (tob.isBack && (tob.backChoice.toLowerCase() === 'autre' || tob.rejectedReason)) ? 0 : (0, asv_hlps_1.formatToStringCfa)((0, sale_1.getTotalAmountWithoutTvaOnSale)(tob, true));
75
+ const totalPort = (0, asv_hlps_1.formatToStringCfa)((0, sale_1.getTotalShippingOnSale)(tob));
76
+ const totalTva = (0, asv_hlps_1.formatToStringCfa)((0, sale_1.getTotalTvaOnSale)(tob, true));
77
+ const totalAmountAllIncluded = (tob.isBack && (tob.backChoice.toLowerCase() === 'autre' || tob.rejectedReason)) ? 0 : (0, asv_hlps_1.formatToStringCfa)((0, sale_1.getTotalAmountAllIncludedOnSale)(tob, true));
78
+ const tabFooter = {
79
+ width: '50%',
80
+ table: {
81
+ headerRows: 1,
82
+ // widths: [ 100, 100, 100, 100 ],
83
+ widths: ['*', '*', '*', '*', '*'],
84
+ heights: [6],
85
+ body: [
86
+ [
87
+ { text: 'TOTAL HT', style: 'headerText' },
88
+ { text: 'PORT HT', style: 'headerText' },
89
+ { text: 'TOTAL TVA', style: 'headerText' },
90
+ { text: 'TOTAL TTC', style: 'headerText' },
91
+ { text: 'NET A PAYER', style: 'headerText' }
92
+ ],
93
+ [
94
+ { text: totalAmountWithoutTva, style: 'rowText', alignment: 'center' },
95
+ { text: totalPort, style: 'rowText', alignment: 'center' },
96
+ { text: totalTva, style: 'rowText', alignment: 'center' },
97
+ { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
98
+ { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
99
+ ]
100
+ ]
101
+ }
102
+ };
103
+ return tabFooter;
104
+ };
105
+ exports.infoAmounOntSale = infoAmounOntSale;
106
+ const infoAmountOnBill = (tob) => {
107
+ const totalAmountAllAndBackInclused = (0, bill_1.getTotalAmountAllIncludedOnBill)(tob.sales);
108
+ const totalAmountWithoutTvaAllAndBack = (0, bill_1.getTotalAmountWithoutTvaOnBill)(tob.sales);
109
+ const totalAmountTvaAllAndBack = (0, bill_1.getTotalAmountTvaOnBill)(tob.sales);
110
+ // const totalAmountWithoutTva = formatToStringCfa(HlpSale.getTotalAmountWithoutTvaOnBill(tob.sales));
111
+ const totalAmountWithoutTva = (0, asv_hlps_1.formatToStringCfa)(totalAmountWithoutTvaAllAndBack);
112
+ // const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
113
+ const totalTva = (0, asv_hlps_1.formatToStringCfa)(totalAmountTvaAllAndBack);
114
+ // const totalTva = formatToStringCfa(HlpSale.getTotalAmountTvaOnBill(tob.sales));
115
+ // const totalAmountAllIncluded = formatToStringCfa(HlpSale.getTotalAmountOnBill(tob.sales));
116
+ const totalAmountAllIncluded = (0, asv_hlps_1.formatToStringCfa)(totalAmountAllAndBackInclused);
117
+ const tabFooter = {
118
+ width: '50%',
119
+ table: {
120
+ headerRows: 1,
121
+ // widths: [ 100, 100, 100, 100 ],
122
+ widths: ['*', '*', '*', '*'],
123
+ heights: [6],
124
+ body: [
125
+ [
126
+ { text: 'TOTAL HT', style: 'headerText' },
127
+ // {text: 'PORT HT', style: 'headerText'},
128
+ { text: 'TOTAL TVA', style: 'headerText' },
129
+ { text: 'TOTAL TTC', style: 'headerText' },
130
+ { text: 'NET A PAYER', style: 'headerText' }
131
+ ],
132
+ [
133
+ { text: totalAmountWithoutTva, style: 'rowText', alignment: 'center' },
134
+ // { text: totalPort, style: 'rowText', alignment: 'center' },
135
+ { text: totalTva, style: 'rowText', alignment: 'center' },
136
+ { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
137
+ { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
138
+ ]
139
+ ]
140
+ }
141
+ };
142
+ return tabFooter;
143
+ };
144
+ exports.infoAmountOnBill = infoAmountOnBill;