asv-hlps-market 1.0.0 → 1.0.2

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 (171) hide show
  1. package/lib/cjs/index.d.ts +2 -0
  2. package/lib/cjs/index.js +17 -0
  3. package/lib/cjs/models/Market.d.ts +8 -0
  4. package/lib/cjs/models/UMarket.d.ts +11 -0
  5. package/lib/cjs/models/index.d.ts +2 -0
  6. package/lib/cjs/models/index.js +18 -0
  7. package/lib/cjs/products/hlpProduct.d.ts +13 -0
  8. package/lib/cjs/products/hlpProduct.js +49 -0
  9. package/lib/cjs/products/index.d.ts +2 -0
  10. package/lib/cjs/products/index.js +23 -0
  11. package/lib/cjs/products/models/Product.d.ts +39 -0
  12. package/lib/cjs/products/models/ProductAsset.d.ts +8 -0
  13. package/lib/cjs/products/models/ProductCat.d.ts +3 -0
  14. package/lib/cjs/products/models/ProductCollection.d.ts +3 -0
  15. package/lib/cjs/products/models/ProductDepot.d.ts +11 -0
  16. package/lib/cjs/products/models/ProductElt.d.ts +3 -0
  17. package/lib/cjs/products/models/ProductGrp.d.ts +3 -0
  18. package/lib/cjs/products/models/ProductImage.d.ts +5 -0
  19. package/lib/cjs/products/models/ProductIn.d.ts +42 -0
  20. package/lib/cjs/products/models/ProductState.d.ts +3 -0
  21. package/lib/cjs/products/models/ProductStock.d.ts +6 -0
  22. package/lib/cjs/products/models/ProductTag.d.ts +3 -0
  23. package/lib/cjs/products/models/ProductVariant.d.ts +6 -0
  24. package/lib/cjs/products/models/index.d.ts +13 -0
  25. package/lib/cjs/products/models/index.js +29 -0
  26. package/lib/cjs/sales/index.d.ts +1 -0
  27. package/lib/cjs/sales/index.js +17 -0
  28. package/lib/cjs/sales/models/Sale.d.ts +8 -0
  29. package/lib/cjs/sales/models/Sale.js +2 -0
  30. package/lib/cjs/sales/models/SalePayment.d.ts +21 -0
  31. package/lib/cjs/sales/models/SalePayment.js +2 -0
  32. package/lib/cjs/sales/models/SaleProduct.d.ts +8 -0
  33. package/lib/cjs/sales/models/SaleProduct.js +2 -0
  34. package/lib/cjs/sales/models/index.d.ts +3 -0
  35. package/lib/cjs/sales/models/index.js +19 -0
  36. package/lib/cjs/shops/index.d.ts +1 -0
  37. package/lib/cjs/shops/index.js +17 -0
  38. package/lib/cjs/shops/models/Shop.d.ts +13 -0
  39. package/lib/cjs/shops/models/Shop.js +2 -0
  40. package/lib/cjs/users/models/User.d.ts +7 -0
  41. package/lib/cjs/users/models/User.js +2 -0
  42. package/lib/esm/index.d.ts +2 -0
  43. package/lib/esm/index.js +2 -1
  44. package/lib/esm/models/Market.d.ts +8 -0
  45. package/lib/esm/models/UMarket.d.ts +11 -0
  46. package/lib/esm/models/index.d.ts +2 -0
  47. package/lib/esm/models/index.js +2 -0
  48. package/lib/esm/products/hlpProduct.d.ts +13 -0
  49. package/lib/esm/products/hlpProduct.js +47 -0
  50. package/lib/esm/products/index.d.ts +2 -0
  51. package/lib/esm/products/index.js +2 -0
  52. package/lib/esm/products/models/Product.d.ts +39 -0
  53. package/lib/esm/products/models/ProductAsset.d.ts +8 -0
  54. package/lib/esm/products/models/ProductCat.d.ts +3 -0
  55. package/lib/esm/products/models/ProductCollection.d.ts +3 -0
  56. package/lib/esm/products/models/ProductDepot.d.ts +11 -0
  57. package/lib/esm/products/models/ProductElt.d.ts +3 -0
  58. package/lib/esm/products/models/ProductGrp.d.ts +3 -0
  59. package/lib/esm/products/models/ProductImage.d.ts +5 -0
  60. package/lib/esm/products/models/ProductIn.d.ts +42 -0
  61. package/lib/esm/products/models/ProductState.d.ts +3 -0
  62. package/lib/esm/products/models/ProductStock.d.ts +6 -0
  63. package/lib/esm/products/models/ProductTag.d.ts +3 -0
  64. package/lib/esm/products/models/ProductVariant.d.ts +6 -0
  65. package/lib/esm/products/models/index.d.ts +13 -0
  66. package/lib/esm/products/models/index.js +13 -0
  67. package/lib/esm/sales/index.d.ts +1 -0
  68. package/lib/esm/sales/index.js +1 -0
  69. package/lib/esm/sales/models/Sale.d.ts +8 -0
  70. package/lib/esm/sales/models/Sale.js +1 -0
  71. package/lib/esm/sales/models/SalePayment.d.ts +21 -0
  72. package/lib/esm/sales/models/SalePayment.js +1 -0
  73. package/lib/esm/sales/models/SaleProduct.d.ts +8 -0
  74. package/lib/esm/sales/models/SaleProduct.js +1 -0
  75. package/lib/esm/sales/models/index.d.ts +3 -0
  76. package/lib/esm/sales/models/index.js +3 -0
  77. package/lib/esm/shops/index.d.ts +1 -0
  78. package/lib/esm/shops/index.js +1 -0
  79. package/lib/esm/shops/models/Shop.d.ts +13 -0
  80. package/lib/esm/shops/models/Shop.js +1 -0
  81. package/lib/esm/users/models/User.d.ts +7 -0
  82. package/lib/esm/users/models/User.js +1 -0
  83. package/package.json +2 -2
  84. package/lib/cjs/bills/bill.d.ts +0 -19
  85. package/lib/cjs/bills/bill.js +0 -79
  86. package/lib/cjs/bills/models/Bill.d.ts +0 -21
  87. package/lib/cjs/models/Gender.d.ts +0 -6
  88. package/lib/cjs/models/Sale.d.ts +0 -34
  89. package/lib/cjs/models/SaleProduct.d.ts +0 -18
  90. package/lib/cjs/models/SaleProduct.js +0 -6
  91. package/lib/cjs/models/Ste.d.ts +0 -8
  92. package/lib/cjs/models/SteGrp.d.ts +0 -7
  93. package/lib/cjs/models/Titr.d.ts +0 -5
  94. package/lib/cjs/models/User.d.ts +0 -38
  95. package/lib/cjs/models/UserGrp.d.ts +0 -4
  96. package/lib/cjs/models/UserRole.d.ts +0 -5
  97. package/lib/cjs/models/shared/NaAc.d.ts +0 -6
  98. package/lib/cjs/models/shared/NaCoAc.d.ts +0 -4
  99. package/lib/cjs/models/shared/NaCoShortAc.d.ts +0 -4
  100. package/lib/cjs/pdfs/invoices/amountInvoice.d.ts +0 -66
  101. package/lib/cjs/pdfs/invoices/amountInvoice.js +0 -144
  102. package/lib/cjs/pdfs/invoices/infoInvoice.d.ts +0 -32
  103. package/lib/cjs/pdfs/invoices/infoInvoice.js +0 -80
  104. package/lib/cjs/pdfs/tools/tools.d.ts +0 -34
  105. package/lib/cjs/pdfs/tools/tools.js +0 -53
  106. package/lib/cjs/products/interfaces/Product.d.ts +0 -53
  107. package/lib/cjs/products/interfaces/ProductCat.d.ts +0 -6
  108. package/lib/cjs/products/interfaces/ProductStore.d.ts +0 -24
  109. package/lib/cjs/products/product.d.ts +0 -3
  110. package/lib/cjs/products/product.js +0 -22
  111. package/lib/cjs/sales/sale.d.ts +0 -18
  112. package/lib/cjs/sales/sale.js +0 -129
  113. package/lib/esm/bills/bill.d.ts +0 -19
  114. package/lib/esm/bills/bill.js +0 -58
  115. package/lib/esm/bills/models/Bill.d.ts +0 -21
  116. package/lib/esm/models/Gender.d.ts +0 -6
  117. package/lib/esm/models/Sale.d.ts +0 -34
  118. package/lib/esm/models/SaleProduct.d.ts +0 -18
  119. package/lib/esm/models/SaleProduct.js +0 -2
  120. package/lib/esm/models/Ste.d.ts +0 -8
  121. package/lib/esm/models/SteGrp.d.ts +0 -7
  122. package/lib/esm/models/Titr.d.ts +0 -5
  123. package/lib/esm/models/User.d.ts +0 -38
  124. package/lib/esm/models/UserGrp.d.ts +0 -4
  125. package/lib/esm/models/UserRole.d.ts +0 -5
  126. package/lib/esm/models/shared/NaAc.d.ts +0 -6
  127. package/lib/esm/models/shared/NaCoAc.d.ts +0 -4
  128. package/lib/esm/models/shared/NaCoShortAc.d.ts +0 -4
  129. package/lib/esm/pdfs/invoices/amountInvoice.d.ts +0 -66
  130. package/lib/esm/pdfs/invoices/amountInvoice.js +0 -137
  131. package/lib/esm/pdfs/invoices/infoInvoice.d.ts +0 -26
  132. package/lib/esm/pdfs/invoices/infoInvoice.js +0 -75
  133. package/lib/esm/pdfs/tools/tools.d.ts +0 -34
  134. package/lib/esm/pdfs/tools/tools.js +0 -47
  135. package/lib/esm/products/interfaces/Product.d.ts +0 -53
  136. package/lib/esm/products/interfaces/ProductCat.d.ts +0 -6
  137. package/lib/esm/products/interfaces/ProductStore.d.ts +0 -24
  138. package/lib/esm/products/product.d.ts +0 -3
  139. package/lib/esm/products/product.js +0 -17
  140. package/lib/esm/sales/sale.d.ts +0 -19
  141. package/lib/esm/sales/sale.js +0 -112
  142. /package/lib/cjs/{bills/models/Bill.js → models/Market.js} +0 -0
  143. /package/lib/cjs/models/{Gender.js → UMarket.js} +0 -0
  144. /package/lib/cjs/products/{interfaces → models}/Product.js +0 -0
  145. /package/lib/cjs/{models/Sale.js → products/models/ProductAsset.js} +0 -0
  146. /package/lib/cjs/products/{interfaces → models}/ProductCat.js +0 -0
  147. /package/lib/cjs/{models/Ste.js → products/models/ProductCollection.js} +0 -0
  148. /package/lib/cjs/{models/SteGrp.js → products/models/ProductDepot.js} +0 -0
  149. /package/lib/cjs/{models/Titr.js → products/models/ProductElt.js} +0 -0
  150. /package/lib/cjs/{models/User.js → products/models/ProductGrp.js} +0 -0
  151. /package/lib/cjs/{models/UserGrp.js → products/models/ProductImage.js} +0 -0
  152. /package/lib/cjs/{models/UserRole.js → products/models/ProductIn.js} +0 -0
  153. /package/lib/cjs/{models/shared/NaAc.js → products/models/ProductState.js} +0 -0
  154. /package/lib/cjs/{models/shared/NaCoAc.js → products/models/ProductStock.js} +0 -0
  155. /package/lib/cjs/{models/shared/NaCoShortAc.js → products/models/ProductTag.js} +0 -0
  156. /package/lib/cjs/products/{interfaces/ProductStore.js → models/ProductVariant.js} +0 -0
  157. /package/lib/esm/{bills/models/Bill.js → models/Market.js} +0 -0
  158. /package/lib/esm/models/{Gender.js → UMarket.js} +0 -0
  159. /package/lib/esm/products/{interfaces → models}/Product.js +0 -0
  160. /package/lib/esm/{models/Sale.js → products/models/ProductAsset.js} +0 -0
  161. /package/lib/esm/products/{interfaces → models}/ProductCat.js +0 -0
  162. /package/lib/esm/{models/Ste.js → products/models/ProductCollection.js} +0 -0
  163. /package/lib/esm/{models/SteGrp.js → products/models/ProductDepot.js} +0 -0
  164. /package/lib/esm/{models/Titr.js → products/models/ProductElt.js} +0 -0
  165. /package/lib/esm/{models/User.js → products/models/ProductGrp.js} +0 -0
  166. /package/lib/esm/{models/UserGrp.js → products/models/ProductImage.js} +0 -0
  167. /package/lib/esm/{models/UserRole.js → products/models/ProductIn.js} +0 -0
  168. /package/lib/esm/{models/shared/NaAc.js → products/models/ProductState.js} +0 -0
  169. /package/lib/esm/{models/shared/NaCoAc.js → products/models/ProductStock.js} +0 -0
  170. /package/lib/esm/{models/shared/NaCoShortAc.js → products/models/ProductTag.js} +0 -0
  171. /package/lib/esm/products/{interfaces/ProductStore.js → models/ProductVariant.js} +0 -0
@@ -0,0 +1,39 @@
1
+ import { Market } from "../../models/Market";
2
+ import { Shop } from "../../shops/models/Shop";
3
+ import ProductCat from "./ProductCat";
4
+ import ProductImage from "./ProductImage";
5
+ import ProductIn from "./ProductIn";
6
+ interface Stock {
7
+ sumIns: number;
8
+ sumOuts: number;
9
+ qtityPerPackaging: number;
10
+ }
11
+ export default interface Product {
12
+ capacity: string;
13
+ cat: ProductCat;
14
+ createdAt: Date;
15
+ description: string;
16
+ designation: string;
17
+ disabled?: boolean;
18
+ iconName: string;
19
+ iconPack: string;
20
+ id: number;
21
+ images: ProductImage[];
22
+ ins: ProductIn[];
23
+ isActive: boolean;
24
+ isAvailable?: boolean;
25
+ isBulk: boolean;
26
+ market: Market;
27
+ price: number;
28
+ publicPrice: number;
29
+ qtityLimit: number;
30
+ qtityUnit: number;
31
+ stock: Stock;
32
+ qtityPerBox: number;
33
+ qtityPerPackaging: number;
34
+ ref: string;
35
+ salePrice: number;
36
+ shop: Shop;
37
+ updatedAt: Date;
38
+ }
39
+ export {};
@@ -0,0 +1,8 @@
1
+ export default interface ProductAsset {
2
+ id: number;
3
+ elt: string;
4
+ name: string;
5
+ qtity: number;
6
+ size: number;
7
+ isActive: boolean;
8
+ }
@@ -0,0 +1,3 @@
1
+ import { NaCoAcIc } from "asv-hlps/lib/cjs/shared/models/NaCoAcIc";
2
+ export default interface ProductCat extends NaCoAcIc {
3
+ }
@@ -0,0 +1,3 @@
1
+ import NaAc from "asv-hlps/lib/cjs/shared/models/NaCoAc";
2
+ export default interface ProductCollection extends NaAc {
3
+ }
@@ -0,0 +1,11 @@
1
+ import ProductIn from "./ProductIn";
2
+ export default interface ProductDepot {
3
+ id: number;
4
+ name: string;
5
+ code: string;
6
+ main: "master" | "slave";
7
+ hasViewStock: boolean;
8
+ qtityInTransfert: number;
9
+ isActive: boolean;
10
+ ins: ProductIn[];
11
+ }
@@ -0,0 +1,3 @@
1
+ import NaCoAc from "asv-hlps/lib/cjs/shared/models/NaCoAc";
2
+ export default interface ProductElt extends NaCoAc {
3
+ }
@@ -0,0 +1,3 @@
1
+ import NaAc from "asv-hlps/lib/cjs/shared/models/NaAc";
2
+ export default interface ProductGrp extends NaAc {
3
+ }
@@ -0,0 +1,5 @@
1
+ import { Image } from "asv-hlps/lib/cjs/shared/models/Image";
2
+ import Product from "./Product";
3
+ export default interface ProductImage extends Image {
4
+ product: Product;
5
+ }
@@ -0,0 +1,42 @@
1
+ import EInOutMotive from "asv-hlps/lib/cjs/shared/models/EInOutMotive";
2
+ import Product from "./Product";
3
+ import ProductDepot from "./ProductDepot";
4
+ export default interface ProductIn {
5
+ id: number;
6
+ createdAt: Date;
7
+ lot: string;
8
+ qtity: number;
9
+ comment: string;
10
+ isEdit: boolean;
11
+ motive: EInOutMotive;
12
+ authorId: number;
13
+ qtityPerPackaging: number;
14
+ /**
15
+ * remaining qtity
16
+ */
17
+ qtityIn: number;
18
+ isOutDate: boolean;
19
+ /**
20
+ * expired
21
+ */
22
+ isOut: boolean;
23
+ /**
24
+ * if true the productIn is created from transfering qtity from another productin
25
+ */
26
+ fromTransfert: boolean;
27
+ /**
28
+ * indique the qtity waiting to transfert after transfert validation
29
+ */
30
+ qtityInTransfert: number;
31
+ /**
32
+ * is true if the transfert not validate
33
+ */
34
+ inTransfert: boolean;
35
+ depotId: number;
36
+ productId: number;
37
+ designation: string;
38
+ salePrice: number;
39
+ publicPrice: number;
40
+ product: Product;
41
+ depot: ProductDepot;
42
+ }
@@ -0,0 +1,3 @@
1
+ import NaAc from "asv-hlps/lib/cjs/shared/models/NaAc";
2
+ export interface ProductState extends NaAc {
3
+ }
@@ -0,0 +1,6 @@
1
+ export default interface ProductStock {
2
+ sumIns: number;
3
+ sumOuts: number;
4
+ qtityPerPackaging: number;
5
+ qtityUnit?: number;
6
+ }
@@ -0,0 +1,3 @@
1
+ import NaAc from "asv-hlps/lib/cjs/shared/models/NaAc";
2
+ export interface ProductTag extends NaAc {
3
+ }
@@ -0,0 +1,6 @@
1
+ export default interface ProductVariant {
2
+ id: number;
3
+ sku: string;
4
+ size: string;
5
+ color: string;
6
+ }
@@ -0,0 +1,13 @@
1
+ export * from "./Product";
2
+ export * from "./ProductAsset";
3
+ export * from "./ProductCat";
4
+ export * from "./ProductCollection";
5
+ export * from "./ProductDepot";
6
+ export * from "./ProductElt";
7
+ export * from "./ProductGrp";
8
+ export * from "./ProductImage";
9
+ export * from "./ProductIn";
10
+ export * from "./ProductState";
11
+ export * from "./ProductStock";
12
+ export * from "./ProductTag";
13
+ export * from "./ProductVariant";
@@ -0,0 +1,13 @@
1
+ export * from "./Product";
2
+ export * from "./ProductAsset";
3
+ export * from "./ProductCat";
4
+ export * from "./ProductCollection";
5
+ export * from "./ProductDepot";
6
+ export * from "./ProductElt";
7
+ export * from "./ProductGrp";
8
+ export * from "./ProductImage";
9
+ export * from "./ProductIn";
10
+ export * from "./ProductState";
11
+ export * from "./ProductStock";
12
+ export * from "./ProductTag";
13
+ export * from "./ProductVariant";
@@ -0,0 +1 @@
1
+ export * from "./models";
@@ -0,0 +1 @@
1
+ export * from "./models";
@@ -0,0 +1,8 @@
1
+ import BaseSale from "asv-hlps/lib/cjs/sales/models/Sale";
2
+ export default interface Sale extends BaseSale {
3
+ isPaid: boolean;
4
+ isPartialPaid: boolean;
5
+ dueAmount: number;
6
+ totalAmount: number;
7
+ specialPrice: number;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { Bank, BankAccount, PaymentMode } from "asv-hlps/lib/cjs/cashs";
2
+ import User from "../../users/models/User";
3
+ import Sale from "./Sale";
4
+ export interface SalePayment {
5
+ id: number;
6
+ ref: string;
7
+ createdAt: Date;
8
+ paymentDate: Date;
9
+ prevAmount: number;
10
+ paidAmount: number;
11
+ cashReceived: number;
12
+ cashReturned: number;
13
+ restAmount: number;
14
+ checkNumber: string;
15
+ checkDate: string;
16
+ sale: Sale;
17
+ encoder: User;
18
+ account: BankAccount;
19
+ bank: Bank;
20
+ mode: PaymentMode;
21
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import BaseSaleProduct from "asv-hlps/lib/cjs/sales/models/SaleProduct";
2
+ export interface SaleProduct extends BaseSaleProduct {
3
+ buy?: {
4
+ avgUnitCostPrice: number;
5
+ };
6
+ specialPrice?: number;
7
+ qtityUnit?: number;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from "./Sale";
2
+ export * from "./SalePayment";
3
+ export * from "./SaleProduct";
@@ -0,0 +1,3 @@
1
+ export * from "./Sale";
2
+ export * from "./SalePayment";
3
+ export * from "./SaleProduct";
@@ -0,0 +1 @@
1
+ export * from "./models/Shop";
@@ -0,0 +1 @@
1
+ export * from "./models/Shop";
@@ -0,0 +1,13 @@
1
+ import UMarket from "../../models/UMarket";
2
+ import Product from "../../products/models/Product";
3
+ export interface Shop {
4
+ id: number;
5
+ name: string;
6
+ title: string;
7
+ description: string;
8
+ logo: string;
9
+ banner: string;
10
+ isActive: boolean;
11
+ products: Product[];
12
+ umarket: UMarket;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import UserBase from "asv-hlps/lib/cjs/users/models/UserBase";
2
+ import UMarket from "../../models/UMarket";
3
+ export default interface User extends UserBase {
4
+ markets?: UMarket[];
5
+ wallets?: any;
6
+ phone?: string;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps-market",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "helpers for markets app",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -19,6 +19,6 @@
19
19
  "typescript": "^5.7.3"
20
20
  },
21
21
  "dependencies": {
22
- "asv-hlps": "^1.4.8"
22
+ "asv-hlps": "^1.4.9"
23
23
  }
24
24
  }
@@ -1,19 +0,0 @@
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;
@@ -1,79 +0,0 @@
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;
@@ -1,21 +0,0 @@
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 +0,0 @@
1
- export interface Gender {
2
- id: number;
3
- name: string;
4
- avatar: string;
5
- abr: string;
6
- }
@@ -1,34 +0,0 @@
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
- }
@@ -1,18 +0,0 @@
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
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SaleProduct = void 0;
4
- class SaleProduct {
5
- }
6
- exports.SaleProduct = SaleProduct;
@@ -1,8 +0,0 @@
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
- }
@@ -1,7 +0,0 @@
1
- export interface SteGrp {
2
- id: number;
3
- name: string;
4
- code?: string;
5
- shortname: string;
6
- coef?: number;
7
- }
@@ -1,5 +0,0 @@
1
- export interface Titr {
2
- id: number;
3
- name: string;
4
- shortname: string;
5
- }
@@ -1,38 +0,0 @@
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
- }
@@ -1,4 +0,0 @@
1
- import { NaCoShortAc } from "./shared/NaCoShortAc";
2
- export interface UserGrp extends NaCoShortAc {
3
- coef?: number;
4
- }
@@ -1,5 +0,0 @@
1
- import { NaCoShortAc } from "./shared/NaCoShortAc";
2
- export interface UserRole extends NaCoShortAc {
3
- extern?: boolean;
4
- intern?: boolean;
5
- }
@@ -1,6 +0,0 @@
1
- export interface NaAc {
2
- id?: number;
3
- name: string;
4
- isActive?: boolean;
5
- disabled?: boolean;
6
- }
@@ -1,4 +0,0 @@
1
- import { NaAc } from './NaAc';
2
- export interface NaCoAc extends NaAc {
3
- code: string;
4
- }
@@ -1,4 +0,0 @@
1
- import { NaCoAc } from './NaCoAc';
2
- export interface NaCoShortAc extends NaCoAc {
3
- shortname: string;
4
- }