techlify-inventory-common 18.0.1

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 (182) hide show
  1. package/README.md +24 -0
  2. package/esm2022/lib/inventory-common/category/category-form/category-form.component.mjs +77 -0
  3. package/esm2022/lib/inventory-common/category/category-form-button/category-form-button.component.mjs +32 -0
  4. package/esm2022/lib/inventory-common/category/category-list-page/category-list-page.component.mjs +68 -0
  5. package/esm2022/lib/inventory-common/category/category-routing.module.mjs +24 -0
  6. package/esm2022/lib/inventory-common/category/category.module.mjs +63 -0
  7. package/esm2022/lib/inventory-common/category/category.service.mjs +18 -0
  8. package/esm2022/lib/inventory-common/inventory-common-routing.module.mjs +53 -0
  9. package/esm2022/lib/inventory-common/inventory-common.module.mjs +39 -0
  10. package/esm2022/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.mjs +42 -0
  11. package/esm2022/lib/inventory-common/material.module.mjs +172 -0
  12. package/esm2022/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.mjs +44 -0
  13. package/esm2022/lib/inventory-common/measure/measure-delete/measure-delete.module.mjs +19 -0
  14. package/esm2022/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.mjs +80 -0
  15. package/esm2022/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.mjs +30 -0
  16. package/esm2022/lib/inventory-common/measure/measure-form/measure-form.module.mjs +21 -0
  17. package/esm2022/lib/inventory-common/measure/measure-routing.module.mjs +24 -0
  18. package/esm2022/lib/inventory-common/measure/measure.module.mjs +47 -0
  19. package/esm2022/lib/inventory-common/measure/measure.service.mjs +18 -0
  20. package/esm2022/lib/inventory-common/measure/measures-list/measures-list.component.mjs +71 -0
  21. package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.mjs +45 -0
  22. package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.mjs +36 -0
  23. package/esm2022/lib/inventory-common/product/product-basic-info/product-basic-info.component.mjs +54 -0
  24. package/esm2022/lib/inventory-common/product/product-delete-button/product-delete-button.component.mjs +54 -0
  25. package/esm2022/lib/inventory-common/product/product-form/product-form.component.mjs +180 -0
  26. package/esm2022/lib/inventory-common/product/product-form-button/product-form-button.component.mjs +40 -0
  27. package/esm2022/lib/inventory-common/product/product-form.service.mjs +17 -0
  28. package/esm2022/lib/inventory-common/product/product-import-page/product-import-page.component.mjs +66 -0
  29. package/esm2022/lib/inventory-common/product/product-list/product-list.component.mjs +189 -0
  30. package/esm2022/lib/inventory-common/product/product-measure-form/product-measure-form.component.mjs +101 -0
  31. package/esm2022/lib/inventory-common/product/product-measures-list/product-measures-list.component.mjs +151 -0
  32. package/esm2022/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.mjs +12 -0
  33. package/esm2022/lib/inventory-common/product/product-routing.module.mjs +57 -0
  34. package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.mjs +63 -0
  35. package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.mjs +29 -0
  36. package/esm2022/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.mjs +54 -0
  37. package/esm2022/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.mjs +77 -0
  38. package/esm2022/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.mjs +35 -0
  39. package/esm2022/lib/inventory-common/product/product-tax/product-tax.module.mjs +39 -0
  40. package/esm2022/lib/inventory-common/product/product-tax/product-tax.service.mjs +18 -0
  41. package/esm2022/lib/inventory-common/product/product-view-page/product-view-page.component.mjs +68 -0
  42. package/esm2022/lib/inventory-common/product/product.module.mjs +111 -0
  43. package/esm2022/lib/inventory-common/product/product.service.mjs +49 -0
  44. package/esm2022/lib/inventory-common/services/techlify-form-service.mjs +11 -0
  45. package/esm2022/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.mjs +47 -0
  46. package/esm2022/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.module.mjs +19 -0
  47. package/esm2022/lib/inventory-common/stock-issuances/stock-issuance.service.mjs +18 -0
  48. package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.mjs +126 -0
  49. package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.module.mjs +48 -0
  50. package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-routing.module.mjs +24 -0
  51. package/esm2022/lib/inventory-common/stock-issuances/stock-issuances.module.mjs +67 -0
  52. package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.mjs +120 -0
  53. package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.mjs +44 -0
  54. package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.mjs +53 -0
  55. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.mjs +47 -0
  56. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.mjs +125 -0
  57. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.mjs +38 -0
  58. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.mjs +53 -0
  59. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt.service.mjs +18 -0
  60. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.mjs +119 -0
  61. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-routing.module.mjs +24 -0
  62. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts.module.mjs +75 -0
  63. package/esm2022/lib/inventory-common/stock-summary.service.mjs +26 -0
  64. package/esm2022/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.mjs +59 -0
  65. package/esm2022/lib/inventory-common/supplier/payee-selector/payee-selector.module.mjs +35 -0
  66. package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.component.mjs +118 -0
  67. package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.service.mjs +17 -0
  68. package/esm2022/lib/inventory-common/supplier/supplier-information/supplier-information.component.mjs +72 -0
  69. package/esm2022/lib/inventory-common/supplier/supplier-routing.module.mjs +40 -0
  70. package/esm2022/lib/inventory-common/supplier/supplier-type.service.mjs +25 -0
  71. package/esm2022/lib/inventory-common/supplier/supplier-view/supplier-view.component.mjs +66 -0
  72. package/esm2022/lib/inventory-common/supplier/supplier.component.mjs +20 -0
  73. package/esm2022/lib/inventory-common/supplier/supplier.module.mjs +63 -0
  74. package/esm2022/lib/inventory-common/supplier/supplier.service.mjs +61 -0
  75. package/esm2022/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.mjs +241 -0
  76. package/esm2022/lib/inventory-common/techlify-filter/techlify-filter.component.mjs +118 -0
  77. package/esm2022/lib/inventory-common/techlify-filter/techlify-filter.module.mjs +38 -0
  78. package/esm2022/public-api.mjs +9 -0
  79. package/esm2022/techlify-inventory-common.mjs +5 -0
  80. package/fesm2022/techlify-inventory-common-category.module-Stn6e73V.mjs +257 -0
  81. package/fesm2022/techlify-inventory-common-category.module-Stn6e73V.mjs.map +1 -0
  82. package/fesm2022/techlify-inventory-common-measure.module-CirswKXn.mjs +313 -0
  83. package/fesm2022/techlify-inventory-common-measure.module-CirswKXn.mjs.map +1 -0
  84. package/fesm2022/techlify-inventory-common-product.module-qdeafFV5.mjs +1172 -0
  85. package/fesm2022/techlify-inventory-common-product.module-qdeafFV5.mjs.map +1 -0
  86. package/fesm2022/techlify-inventory-common-stock-issuances-list.module-CyFDxARk.mjs +436 -0
  87. package/fesm2022/techlify-inventory-common-stock-issuances-list.module-CyFDxARk.mjs.map +1 -0
  88. package/fesm2022/techlify-inventory-common-stock-issuances.module-Dm9i2kcf.mjs +89 -0
  89. package/fesm2022/techlify-inventory-common-stock-issuances.module-Dm9i2kcf.mjs.map +1 -0
  90. package/fesm2022/techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs +302 -0
  91. package/fesm2022/techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs.map +1 -0
  92. package/fesm2022/techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs +253 -0
  93. package/fesm2022/techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs.map +1 -0
  94. package/fesm2022/techlify-inventory-common-supplier-form.component-CHmMG7O8.mjs +178 -0
  95. package/fesm2022/techlify-inventory-common-supplier-form.component-CHmMG7O8.mjs.map +1 -0
  96. package/fesm2022/techlify-inventory-common-supplier.module-gzHesNtQ.mjs +665 -0
  97. package/fesm2022/techlify-inventory-common-supplier.module-gzHesNtQ.mjs.map +1 -0
  98. package/fesm2022/techlify-inventory-common-techlify-form-service-CiVfwYTS.mjs +14 -0
  99. package/fesm2022/techlify-inventory-common-techlify-form-service-CiVfwYTS.mjs.map +1 -0
  100. package/fesm2022/techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs +495 -0
  101. package/fesm2022/techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs.map +1 -0
  102. package/fesm2022/techlify-inventory-common.mjs +2 -0
  103. package/fesm2022/techlify-inventory-common.mjs.map +1 -0
  104. package/index.d.ts +5 -0
  105. package/lib/inventory-common/category/category-form/category-form.component.d.ts +19 -0
  106. package/lib/inventory-common/category/category-form-button/category-form-button.component.d.ts +13 -0
  107. package/lib/inventory-common/category/category-list-page/category-list-page.component.d.ts +20 -0
  108. package/lib/inventory-common/category/category-routing.module.d.ts +7 -0
  109. package/lib/inventory-common/category/category.module.d.ts +19 -0
  110. package/lib/inventory-common/category/category.service.d.ts +7 -0
  111. package/lib/inventory-common/inventory-common-routing.module.d.ts +7 -0
  112. package/lib/inventory-common/inventory-common.module.d.ts +13 -0
  113. package/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.d.ts +14 -0
  114. package/lib/inventory-common/material.module.d.ts +40 -0
  115. package/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.d.ts +19 -0
  116. package/lib/inventory-common/measure/measure-delete/measure-delete.module.d.ts +9 -0
  117. package/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.d.ts +19 -0
  118. package/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.d.ts +13 -0
  119. package/lib/inventory-common/measure/measure-form/measure-form.module.d.ts +11 -0
  120. package/lib/inventory-common/measure/measure-routing.module.d.ts +7 -0
  121. package/lib/inventory-common/measure/measure.module.d.ts +15 -0
  122. package/lib/inventory-common/measure/measure.service.d.ts +7 -0
  123. package/lib/inventory-common/measure/measures-list/measures-list.component.d.ts +17 -0
  124. package/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.d.ts +13 -0
  125. package/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.d.ts +12 -0
  126. package/lib/inventory-common/product/product-basic-info/product-basic-info.component.d.ts +19 -0
  127. package/lib/inventory-common/product/product-delete-button/product-delete-button.component.d.ts +26 -0
  128. package/lib/inventory-common/product/product-form/product-form.component.d.ts +44 -0
  129. package/lib/inventory-common/product/product-form-button/product-form-button.component.d.ts +20 -0
  130. package/lib/inventory-common/product/product-form.service.d.ts +7 -0
  131. package/lib/inventory-common/product/product-import-page/product-import-page.component.d.ts +10 -0
  132. package/lib/inventory-common/product/product-list/product-list.component.d.ts +44 -0
  133. package/lib/inventory-common/product/product-measure-form/product-measure-form.component.d.ts +33 -0
  134. package/lib/inventory-common/product/product-measures-list/product-measures-list.component.d.ts +43 -0
  135. package/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.d.ts +5 -0
  136. package/lib/inventory-common/product/product-routing.module.d.ts +7 -0
  137. package/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.d.ts +15 -0
  138. package/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.d.ts +10 -0
  139. package/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.d.ts +26 -0
  140. package/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.d.ts +21 -0
  141. package/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.d.ts +13 -0
  142. package/lib/inventory-common/product/product-tax/product-tax.module.d.ts +12 -0
  143. package/lib/inventory-common/product/product-tax/product-tax.service.d.ts +7 -0
  144. package/lib/inventory-common/product/product-view-page/product-view-page.component.d.ts +33 -0
  145. package/lib/inventory-common/product/product.module.d.ts +28 -0
  146. package/lib/inventory-common/product/product.service.d.ts +19 -0
  147. package/lib/inventory-common/services/techlify-form-service.d.ts +5 -0
  148. package/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.d.ts +18 -0
  149. package/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.module.d.ts +9 -0
  150. package/lib/inventory-common/stock-issuances/stock-issuance.service.d.ts +7 -0
  151. package/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.d.ts +24 -0
  152. package/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.module.d.ts +15 -0
  153. package/lib/inventory-common/stock-issuances/stock-issuances-routing.module.d.ts +7 -0
  154. package/lib/inventory-common/stock-issuances/stock-issuances.module.d.ts +19 -0
  155. package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.d.ts +24 -0
  156. package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.d.ts +18 -0
  157. package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.d.ts +17 -0
  158. package/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.d.ts +18 -0
  159. package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.d.ts +22 -0
  160. package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.d.ts +16 -0
  161. package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.d.ts +17 -0
  162. package/lib/inventory-common/stock-receipts/stock-receipt.service.d.ts +7 -0
  163. package/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.d.ts +21 -0
  164. package/lib/inventory-common/stock-receipts/stock-receipts-routing.module.d.ts +7 -0
  165. package/lib/inventory-common/stock-receipts/stock-receipts.module.d.ts +20 -0
  166. package/lib/inventory-common/stock-summary.service.d.ts +14 -0
  167. package/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.d.ts +20 -0
  168. package/lib/inventory-common/supplier/payee-selector/payee-selector.module.d.ts +11 -0
  169. package/lib/inventory-common/supplier/supplier-form/supplier-form.component.d.ts +29 -0
  170. package/lib/inventory-common/supplier/supplier-form/supplier-form.service.d.ts +7 -0
  171. package/lib/inventory-common/supplier/supplier-information/supplier-information.component.d.ts +18 -0
  172. package/lib/inventory-common/supplier/supplier-routing.module.d.ts +7 -0
  173. package/lib/inventory-common/supplier/supplier-type.service.d.ts +13 -0
  174. package/lib/inventory-common/supplier/supplier-view/supplier-view.component.d.ts +20 -0
  175. package/lib/inventory-common/supplier/supplier.component.d.ts +10 -0
  176. package/lib/inventory-common/supplier/supplier.module.d.ts +18 -0
  177. package/lib/inventory-common/supplier/supplier.service.d.ts +39 -0
  178. package/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.d.ts +51 -0
  179. package/lib/inventory-common/techlify-filter/techlify-filter.component.d.ts +31 -0
  180. package/lib/inventory-common/techlify-filter/techlify-filter.module.d.ts +11 -0
  181. package/package.json +25 -0
  182. package/public-api.d.ts +5 -0
@@ -0,0 +1,495 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, Input, NgModule, EventEmitter, Output } from '@angular/core';
3
+ import * as i2 from '@angular/router';
4
+ import { RouterModule } from '@angular/router';
5
+ import moment from 'moment';
6
+ import * as i1 from 'ngx-techlify-core';
7
+ import { TechlifyServiceBaseClass, TechlifyListingControllerInterface, MaterialModule, SearchableSelectorModule, TimelineFilterModule } from 'ngx-techlify-core';
8
+ import * as i3$1 from '@angular/material/icon';
9
+ import * as i3 from '@angular/material/card';
10
+ import { MatCard, MatCardContent } from '@angular/material/card';
11
+ import * as i6 from '@angular/material/table';
12
+ import * as i10 from 'ngx-infinite-scroll';
13
+ import { InfiniteScrollModule } from 'ngx-infinite-scroll';
14
+ import * as i2$1 from 'angular-google-charts';
15
+ import { ChartType, GoogleChartsModule } from 'angular-google-charts';
16
+ import { MatProgressBar, MatProgressBarModule } from '@angular/material/progress-bar';
17
+ import * as i4 from '@angular/common';
18
+ import { NgIf, CommonModule } from '@angular/common';
19
+ import { debounceTime, distinctUntilChanged } from 'rxjs';
20
+ import * as i2$2 from '@angular/forms';
21
+ import { ReactiveFormsModule } from '@angular/forms';
22
+ import * as i10$1 from '@angular/flex-layout';
23
+ import { FlexLayoutModule } from '@angular/flex-layout';
24
+ import * as i7 from '@angular/material/button';
25
+ import * as i6$1 from '@angular/material/form-field';
26
+ import * as i7$1 from '@angular/material/input';
27
+ import * as i10$2 from '@angular/material/core';
28
+ import * as i11 from '@angular/material/select';
29
+ import * as i12 from '@angular/material/button-toggle';
30
+
31
+ class ProductService extends TechlifyServiceBaseClass {
32
+ dataManager;
33
+ httpService;
34
+ constructor(dataManager, httpService) {
35
+ super(httpService, "products");
36
+ this.dataManager = dataManager;
37
+ this.httpService = httpService;
38
+ }
39
+ getProducts(filters) {
40
+ return this.dataManager.GET(`api/products`, filters);
41
+ }
42
+ getProduct(id) {
43
+ return this.dataManager.GET(`api/products/${id}`);
44
+ }
45
+ createProduct(model) {
46
+ return this.dataManager.POST(`api/products`, model);
47
+ }
48
+ updateProducts(model) {
49
+ return this.dataManager.PUT(`api/products/${model.id}`, model);
50
+ }
51
+ deleteProduct(id) {
52
+ return this.dataManager.DELETE(`api/products/${id}`);
53
+ }
54
+ getProductMeasures(filters) {
55
+ return this.dataManager.GET(`api/product-measures`, filters);
56
+ }
57
+ createProductMeasure(model) {
58
+ return this.dataManager.POST(`api/product-measures`, model);
59
+ }
60
+ updateProductMeasure(model) {
61
+ return this.dataManager.PUT(`api/product-measures/${model.id}`, model);
62
+ }
63
+ summary(params) {
64
+ return this.httpService.get("api/products-summary", { params });
65
+ }
66
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductService, deps: [{ token: i1.DataManager }, { token: i1.HttpService }], target: i0.ɵɵFactoryTarget.Injectable });
67
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductService, providedIn: "root" });
68
+ }
69
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductService, decorators: [{
70
+ type: Injectable,
71
+ args: [{
72
+ providedIn: "root",
73
+ }]
74
+ }], ctorParameters: () => [{ type: i1.DataManager }, { type: i1.HttpService }] });
75
+
76
+ class LowStockProductsWidgetComponent extends TechlifyListingControllerInterface {
77
+ productService;
78
+ displayedColumns = ["#", "Product", "Stock", "Reorder Point"];
79
+ constructor(productService) {
80
+ super();
81
+ this.productService = productService;
82
+ this.lastPage = 0;
83
+ this.perPage = 1000;
84
+ }
85
+ ngOnInit() {
86
+ this.loadData();
87
+ }
88
+ loadData() {
89
+ const params = {
90
+ page: this.page,
91
+ perPage: this.perPage,
92
+ is_low_stock: true,
93
+ num_items: this.perPage + "|" + this.page,
94
+ };
95
+ this.isWorking = true;
96
+ this.productService.index(params).subscribe({
97
+ next: (response) => {
98
+ this.models = this.models?.concat(response?.data);
99
+ this.lastPage = response?.last_page;
100
+ this.isWorking = false;
101
+ },
102
+ error: () => (this.isWorking = false),
103
+ });
104
+ }
105
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LowStockProductsWidgetComponent, deps: [{ token: ProductService }], target: i0.ɵɵFactoryTarget.Component });
106
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LowStockProductsWidgetComponent, selector: "app-low-stock-products-widget", usesInheritance: true, ngImport: i0, template: "<mat-card style=\"max-height: 460px; overflow: auto\">\n <mat-card-content>\n <h3>Low Stock Products</h3>\n </mat-card-content>\n <mat-card-content class=\"p-0\">\n <table\n mat-table\n [dataSource]=\"models\"\n class=\"w-100\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n >\n <!-- # Column -->\n <ng-container matColumnDef=\"#\">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <!-- Product Column -->\n <ng-container matColumnDef=\"Product\">\n <th mat-header-cell *matHeaderCellDef>Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <a\n [routerLink]=\"['/inventory/products', element?.id, 'view']\"\n class=\"text-dark\"\n >\n {{ element?.name }}\n </a>\n </td>\n </ng-container>\n\n <!-- Stock Column -->\n <ng-container matColumnDef=\"Stock\">\n <th mat-header-cell *matHeaderCellDef>Stock</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.current_stock }}</td>\n </ng-container>\n\n <!-- Reorder Point Column -->\n <ng-container matColumnDef=\"Reorder Point\">\n <th mat-header-cell *matHeaderCellDef>Reorder Point</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.reorder_point }}</td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n\n <!-- <mat-progress-bar mode=\"indeterminate\" *ngIf=\"isWorking\"></mat-progress-bar>-->\n </mat-card-content>\n</mat-card>\n", dependencies: [{ kind: "component", type: i6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i10.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], preserveWhitespaces: true });
107
+ }
108
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LowStockProductsWidgetComponent, decorators: [{
109
+ type: Component,
110
+ args: [{ selector: "app-low-stock-products-widget", template: "<mat-card style=\"max-height: 460px; overflow: auto\">\n <mat-card-content>\n <h3>Low Stock Products</h3>\n </mat-card-content>\n <mat-card-content class=\"p-0\">\n <table\n mat-table\n [dataSource]=\"models\"\n class=\"w-100\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n >\n <!-- # Column -->\n <ng-container matColumnDef=\"#\">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <!-- Product Column -->\n <ng-container matColumnDef=\"Product\">\n <th mat-header-cell *matHeaderCellDef>Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <a\n [routerLink]=\"['/inventory/products', element?.id, 'view']\"\n class=\"text-dark\"\n >\n {{ element?.name }}\n </a>\n </td>\n </ng-container>\n\n <!-- Stock Column -->\n <ng-container matColumnDef=\"Stock\">\n <th mat-header-cell *matHeaderCellDef>Stock</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.current_stock }}</td>\n </ng-container>\n\n <!-- Reorder Point Column -->\n <ng-container matColumnDef=\"Reorder Point\">\n <th mat-header-cell *matHeaderCellDef>Reorder Point</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.reorder_point }}</td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n\n <!-- <mat-progress-bar mode=\"indeterminate\" *ngIf=\"isWorking\"></mat-progress-bar>-->\n </mat-card-content>\n</mat-card>\n" }]
111
+ }], ctorParameters: () => [{ type: ProductService }] });
112
+
113
+ class ProductSummaryChartComponent {
114
+ productService;
115
+ height = 400;
116
+ title = 'Product Summary';
117
+ constructor(productService) {
118
+ this.productService = productService;
119
+ }
120
+ chart = {
121
+ title: 'Pie Chart',
122
+ type: ChartType.PieChart,
123
+ data: [],
124
+ options: {
125
+ pieSliceText: 'value'
126
+ }
127
+ };
128
+ isLoading = false;
129
+ ngOnInit() {
130
+ this.loadData();
131
+ }
132
+ loadData() {
133
+ const params = {
134
+ include: 'products_aggregated',
135
+ group_by: 'category_id',
136
+ };
137
+ this.isLoading = true;
138
+ this.productService.summary(params).subscribe({
139
+ next: (response) => {
140
+ let data = [];
141
+ response?.products_aggregated?.forEach((item) => {
142
+ data.push([item?.title, item?.product_count]);
143
+ });
144
+ this.chart.data = data;
145
+ this.isLoading = false;
146
+ },
147
+ error: () => (this.isLoading = false)
148
+ });
149
+ }
150
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductSummaryChartComponent, deps: [{ token: ProductService }], target: i0.ɵɵFactoryTarget.Component });
151
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProductSummaryChartComponent, isStandalone: true, selector: "app-product-summary-chart", inputs: { height: "height", title: "title" }, ngImport: i0, template: "<mat-card>\n <mat-card-content>\n <h3>{{ title }}</h3>\n </mat-card-content>\n <mat-progress-bar mode=\"indeterminate\" *ngIf=\"isLoading\"></mat-progress-bar>\n <mat-card-content *ngIf=\"chart.data?.length > 0\">\n <google-chart class=\"w-100\" [height]=\"height\" [type]=\"chart.type\" [data]=\"chart.data\" [columns]=\"chart.columns\"\n [options]=\"chart.options\">\n </google-chart>\n </mat-card-content>\n</mat-card>", styles: [""], dependencies: [{ kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: GoogleChartsModule }, { kind: "component", type: i2$1.GoogleChartComponent, selector: "google-chart", inputs: ["type", "data", "columns", "title", "width", "height", "options", "formatters", "dynamicResize"], outputs: ["ready", "error", "select", "mouseover", "mouseleave"], exportAs: ["googleChart"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], preserveWhitespaces: true });
152
+ }
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductSummaryChartComponent, decorators: [{
154
+ type: Component,
155
+ args: [{ selector: 'app-product-summary-chart', standalone: true, imports: [
156
+ MatCard,
157
+ MatCardContent,
158
+ GoogleChartsModule,
159
+ MatProgressBar,
160
+ NgIf
161
+ ], template: "<mat-card>\n <mat-card-content>\n <h3>{{ title }}</h3>\n </mat-card-content>\n <mat-progress-bar mode=\"indeterminate\" *ngIf=\"isLoading\"></mat-progress-bar>\n <mat-card-content *ngIf=\"chart.data?.length > 0\">\n <google-chart class=\"w-100\" [height]=\"height\" [type]=\"chart.type\" [data]=\"chart.data\" [columns]=\"chart.columns\"\n [options]=\"chart.options\">\n </google-chart>\n </mat-card-content>\n</mat-card>" }]
162
+ }], ctorParameters: () => [{ type: ProductService }], propDecorators: { height: [{
163
+ type: Input
164
+ }], title: [{
165
+ type: Input
166
+ }] } });
167
+
168
+ class InventoryDashboardPageComponent {
169
+ productService;
170
+ lowStockProductsCount;
171
+ stockReceiptsQtySum;
172
+ stockIssuanceQtySum;
173
+ constructor(productService) {
174
+ this.productService = productService;
175
+ }
176
+ ngOnInit() {
177
+ this.loadProductSummary();
178
+ }
179
+ loadProductSummary() {
180
+ const params = {
181
+ include: 'low_stock_products_count,stock_receipts_quantity_sum,stock_issuances_quantity_sum',
182
+ date_from: moment().startOf('month').format('YYYY-MM-DD'),
183
+ date_to: moment().endOf('month').format('YYYY-MM-DD'),
184
+ };
185
+ this.productService.summary(params).subscribe({
186
+ next: (response) => {
187
+ this.lowStockProductsCount = response?.low_stock_products_count;
188
+ this.stockReceiptsQtySum = response?.stock_receipts_quantity_sum;
189
+ this.stockIssuanceQtySum = response?.stock_issuances_quantity_sum;
190
+ }
191
+ });
192
+ }
193
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InventoryDashboardPageComponent, deps: [{ token: ProductService }], target: i0.ɵɵFactoryTarget.Component });
194
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: InventoryDashboardPageComponent, selector: "app-inventory-dashboard-page", ngImport: i0, template: "<div class=\"d-flex justify-content-start align-items-start gap-3 vh-100\">\n <div class=\"row\" style=\"width: calc(100% - 300px)\">\n <div class=\"col-lg-4 mb-3\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-center align-items-center gap-3\">\n <span class=\"material-symbols-outlined fs-1 fw-bold\" style=\"color: #F5222D !important;\">\n inventory_2\n </span>\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Low Stock Products</small>\n <h1 class=\"mb-0 fw-bold\">{{ lowStockProductsCount | number }}</h1>\n </div>\n </mat-card-content>\n </mat-card>\n </div>\n <div class=\"col-lg-4 mb-3\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-center align-items-center gap-3\">\n <span class=\"material-symbols-outlined fs-1 fw-bold\">\n arrow_circle_down\n </span>\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Products Received This Month</small>\n <h1 class=\"mb-0 fw-bold\">{{ stockReceiptsQtySum | number }}</h1>\n </div>\n </mat-card-content>\n </mat-card>\n </div>\n <div class=\"col-lg-4 mb-3\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-center align-items-center gap-3\">\n <span class=\"material-symbols-outlined fs-1 fw-bold\">\n arrow_circle_up\n </span>\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Products Issued This Month</small>\n <h1 class=\"mb-0 fw-bold\">{{ stockIssuanceQtySum | number }}</h1>\n </div>\n </mat-card-content>\n </mat-card>\n </div>\n <div class=\"col-lg-6 mb-3\">\n <app-product-summary-chart title=\"Product By Category\"></app-product-summary-chart>\n </div>\n <div class=\"col-lg-6 mb-3\">\n <app-low-stock-products-widget></app-low-stock-products-widget>\n </div>\n </div>\n <div style=\"width: 300px\" class=\"d-flex flex-column gap-3 h-100\">\n <mat-card class=\"h-100\">\n <mat-card-content>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <mat-icon>flag</mat-icon>\n <h3 class=\"mb-0 fw-bold\">Reports</h3>\n </div>\n </mat-card-content>\n <mat-card-content class=\"mt-3 d-flex flex-column justify-content-start gap-3\">\n <a class=\"d-flex justify-content-start align-items-center gap-2 text-decoration-none text-dark cursor-pointer\">\n <span class=\"material-symbols-outlined fs-3\">\n description\n </span>\n <h3 class=\"mb-0\">On Hand Report</h3>\n <span class=\"material-symbols-outlined\">\n chevron_forward\n </span>\n </a>\n <a class=\"d-flex justify-content-start align-items-center gap-2 text-decoration-none text-dark cursor-pointer\">\n <span class=\"material-symbols-outlined fs-3\">\n description\n </span>\n <h3 class=\"mb-0\">Inventory Value Report</h3>\n <span class=\"material-symbols-outlined\">\n chevron_forward\n </span>\n </a>\n </mat-card-content>\n </mat-card>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: LowStockProductsWidgetComponent, selector: "app-low-stock-products-widget" }, { kind: "component", type: ProductSummaryChartComponent, selector: "app-product-summary-chart", inputs: ["height", "title"] }, { kind: "pipe", type: i4.DecimalPipe, name: "number" }], preserveWhitespaces: true });
195
+ }
196
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InventoryDashboardPageComponent, decorators: [{
197
+ type: Component,
198
+ args: [{ selector: 'app-inventory-dashboard-page', template: "<div class=\"d-flex justify-content-start align-items-start gap-3 vh-100\">\n <div class=\"row\" style=\"width: calc(100% - 300px)\">\n <div class=\"col-lg-4 mb-3\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-center align-items-center gap-3\">\n <span class=\"material-symbols-outlined fs-1 fw-bold\" style=\"color: #F5222D !important;\">\n inventory_2\n </span>\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Low Stock Products</small>\n <h1 class=\"mb-0 fw-bold\">{{ lowStockProductsCount | number }}</h1>\n </div>\n </mat-card-content>\n </mat-card>\n </div>\n <div class=\"col-lg-4 mb-3\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-center align-items-center gap-3\">\n <span class=\"material-symbols-outlined fs-1 fw-bold\">\n arrow_circle_down\n </span>\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Products Received This Month</small>\n <h1 class=\"mb-0 fw-bold\">{{ stockReceiptsQtySum | number }}</h1>\n </div>\n </mat-card-content>\n </mat-card>\n </div>\n <div class=\"col-lg-4 mb-3\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-center align-items-center gap-3\">\n <span class=\"material-symbols-outlined fs-1 fw-bold\">\n arrow_circle_up\n </span>\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Products Issued This Month</small>\n <h1 class=\"mb-0 fw-bold\">{{ stockIssuanceQtySum | number }}</h1>\n </div>\n </mat-card-content>\n </mat-card>\n </div>\n <div class=\"col-lg-6 mb-3\">\n <app-product-summary-chart title=\"Product By Category\"></app-product-summary-chart>\n </div>\n <div class=\"col-lg-6 mb-3\">\n <app-low-stock-products-widget></app-low-stock-products-widget>\n </div>\n </div>\n <div style=\"width: 300px\" class=\"d-flex flex-column gap-3 h-100\">\n <mat-card class=\"h-100\">\n <mat-card-content>\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <mat-icon>flag</mat-icon>\n <h3 class=\"mb-0 fw-bold\">Reports</h3>\n </div>\n </mat-card-content>\n <mat-card-content class=\"mt-3 d-flex flex-column justify-content-start gap-3\">\n <a class=\"d-flex justify-content-start align-items-center gap-2 text-decoration-none text-dark cursor-pointer\">\n <span class=\"material-symbols-outlined fs-3\">\n description\n </span>\n <h3 class=\"mb-0\">On Hand Report</h3>\n <span class=\"material-symbols-outlined\">\n chevron_forward\n </span>\n </a>\n <a class=\"d-flex justify-content-start align-items-center gap-2 text-decoration-none text-dark cursor-pointer\">\n <span class=\"material-symbols-outlined fs-3\">\n description\n </span>\n <h3 class=\"mb-0\">Inventory Value Report</h3>\n <span class=\"material-symbols-outlined\">\n chevron_forward\n </span>\n </a>\n </mat-card-content>\n </mat-card>\n </div>\n</div>" }]
199
+ }], ctorParameters: () => [{ type: ProductService }] });
200
+
201
+ const routes = [
202
+ {
203
+ path: "suppliers",
204
+ loadChildren: () => import('./techlify-inventory-common-supplier.module-gzHesNtQ.mjs').then((m) => m.SupplierModule),
205
+ },
206
+ {
207
+ path: "measures",
208
+ loadChildren: () => import('./techlify-inventory-common-measure.module-CirswKXn.mjs').then((mod) => mod.MeasureModule),
209
+ },
210
+ {
211
+ path: "stock-issuances",
212
+ loadChildren: () => import('./techlify-inventory-common-stock-issuances.module-Dm9i2kcf.mjs').then((mod) => mod.StockIssuancesModule),
213
+ },
214
+ {
215
+ path: "stock-receipts",
216
+ loadChildren: () => import('./techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs').then(function (n) { return n.s; }).then((mod) => mod.StockReceiptsModule),
217
+ },
218
+ {
219
+ path: "categories",
220
+ loadChildren: () => import('./techlify-inventory-common-category.module-Stn6e73V.mjs').then((mod) => mod.CategoryModule),
221
+ },
222
+ {
223
+ path: "products",
224
+ loadChildren: () => import('./techlify-inventory-common-product.module-qdeafFV5.mjs').then((mod) => mod.ProductModule),
225
+ },
226
+ {
227
+ path: "dashboard",
228
+ component: InventoryDashboardPageComponent,
229
+ },
230
+ {
231
+ path: "**",
232
+ redirectTo: "dashboard",
233
+ pathMatch: "full",
234
+ },
235
+ ];
236
+ class InventoryCommonRoutingModule {
237
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InventoryCommonRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
238
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: InventoryCommonRoutingModule, imports: [i2.RouterModule], exports: [RouterModule] });
239
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InventoryCommonRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
240
+ }
241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InventoryCommonRoutingModule, decorators: [{
242
+ type: NgModule,
243
+ args: [{
244
+ imports: [RouterModule.forChild(routes)],
245
+ exports: [RouterModule],
246
+ }]
247
+ }] });
248
+
249
+ class LowStockProductsWidgetModule {
250
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LowStockProductsWidgetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
251
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LowStockProductsWidgetModule, declarations: [LowStockProductsWidgetComponent], imports: [CommonModule,
252
+ MaterialModule,
253
+ InfiniteScrollModule,
254
+ MatProgressBarModule,
255
+ RouterModule], exports: [LowStockProductsWidgetComponent] });
256
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LowStockProductsWidgetModule, imports: [CommonModule,
257
+ MaterialModule,
258
+ InfiniteScrollModule,
259
+ MatProgressBarModule,
260
+ RouterModule] });
261
+ }
262
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LowStockProductsWidgetModule, decorators: [{
263
+ type: NgModule,
264
+ args: [{
265
+ declarations: [LowStockProductsWidgetComponent],
266
+ imports: [
267
+ CommonModule,
268
+ MaterialModule,
269
+ InfiniteScrollModule,
270
+ MatProgressBarModule,
271
+ RouterModule,
272
+ ],
273
+ exports: [LowStockProductsWidgetComponent],
274
+ }]
275
+ }] });
276
+
277
+ class ProductSummaryChartModule {
278
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductSummaryChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
279
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ProductSummaryChartModule, imports: [CommonModule,
280
+ MaterialModule,
281
+ MatProgressBarModule,
282
+ GoogleChartsModule] });
283
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductSummaryChartModule, imports: [CommonModule,
284
+ MaterialModule,
285
+ MatProgressBarModule,
286
+ GoogleChartsModule] });
287
+ }
288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductSummaryChartModule, decorators: [{
289
+ type: NgModule,
290
+ args: [{
291
+ imports: [
292
+ CommonModule,
293
+ MaterialModule,
294
+ MatProgressBarModule,
295
+ GoogleChartsModule,
296
+ ],
297
+ }]
298
+ }] });
299
+
300
+ class InventoryCommonModule {
301
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InventoryCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
302
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: InventoryCommonModule, declarations: [InventoryDashboardPageComponent], imports: [CommonModule,
303
+ InventoryCommonRoutingModule,
304
+ MaterialModule,
305
+ LowStockProductsWidgetModule,
306
+ ProductSummaryChartModule,
307
+ ProductSummaryChartComponent] });
308
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InventoryCommonModule, imports: [CommonModule,
309
+ InventoryCommonRoutingModule,
310
+ MaterialModule,
311
+ LowStockProductsWidgetModule,
312
+ ProductSummaryChartModule,
313
+ ProductSummaryChartComponent] });
314
+ }
315
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InventoryCommonModule, decorators: [{
316
+ type: NgModule,
317
+ args: [{
318
+ declarations: [InventoryDashboardPageComponent],
319
+ imports: [
320
+ CommonModule,
321
+ InventoryCommonRoutingModule,
322
+ MaterialModule,
323
+ LowStockProductsWidgetModule,
324
+ ProductSummaryChartModule,
325
+ ProductSummaryChartComponent
326
+ ],
327
+ }]
328
+ }] });
329
+
330
+ class StockSummaryService {
331
+ httpService;
332
+ constructor(httpService) {
333
+ this.httpService = httpService;
334
+ }
335
+ /**
336
+ * Get the stocks summary.
337
+ *
338
+ * @param params
339
+ */
340
+ summary(params) {
341
+ return this.httpService.get("api/stocks-summary", { params });
342
+ }
343
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockSummaryService, deps: [{ token: i1.HttpService }], target: i0.ɵɵFactoryTarget.Injectable });
344
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockSummaryService, providedIn: "root" });
345
+ }
346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockSummaryService, decorators: [{
347
+ type: Injectable,
348
+ args: [{
349
+ providedIn: "root",
350
+ }]
351
+ }], ctorParameters: () => [{ type: i1.HttpService }] });
352
+
353
+ class TechlifyFilterComponent {
354
+ requestHelperService;
355
+ activatedRoute;
356
+ filterForm;
357
+ filterConfig;
358
+ filterUpdated = new EventEmitter();
359
+ constructor(requestHelperService, activatedRoute) {
360
+ this.requestHelperService = requestHelperService;
361
+ this.activatedRoute = activatedRoute;
362
+ }
363
+ ngOnInit() {
364
+ // listen for filter changes
365
+ this.filterForm.valueChanges.subscribe({
366
+ next: (value) => {
367
+ const params = this.requestHelperService.convertToFormData(value);
368
+ this.requestHelperService.updateQueryParams(params);
369
+ },
370
+ });
371
+ // update form with query params
372
+ this.requestHelperService.updateFormWithQueryParams(this.filterForm, {
373
+ duration: { number: true },
374
+ expiry_duration: { number: true },
375
+ payment_method_ids: { multiple: true },
376
+ payment_account_ids: { multiple: true },
377
+ project_ids: { multiple: true },
378
+ invoice_status_ids: { multiple: true },
379
+ customer_ids: { multiple: true },
380
+ cost_category_ids: { multiple: true },
381
+ team_member_ids: { multiple: true },
382
+ task_status_ids: { multiple: true },
383
+ asset_account_ids: { multiple: true },
384
+ depreciation_method_ids: { multiple: true },
385
+ depreciation_expense_account_ids: { multiple: true },
386
+ fixed_asset_type_ids: { multiple: true },
387
+ fixed_asset_document_type_ids: { multiple: true },
388
+ service_center_ids: { multiple: true },
389
+ fixed_asset_maintenance_status_ids: { multiple: true },
390
+ milestone_ids: { multiple: true },
391
+ product_ids: { multiple: true },
392
+ supplier_ids: { multiple: true },
393
+ measure_ids: { multiple: true },
394
+ type_ids: { multiple: true },
395
+ fixed_asset_ids: { multiple: true },
396
+ });
397
+ // listen for route change
398
+ this.activatedRoute.queryParams
399
+ .pipe(debounceTime(800), distinctUntilChanged())
400
+ .subscribe((val) => {
401
+ this.filterUpdated.emit(this.filterForm.value);
402
+ });
403
+ }
404
+ resetField(field) {
405
+ this.filterForm.get(field)?.setValue("");
406
+ }
407
+ onDurationChange(timelineValue) {
408
+ let { date_to, date_from } = timelineValue;
409
+ this.filterForm.patchValue({
410
+ date_from: date_from ? moment(date_from).format("YYYY-MM-DD") : "",
411
+ date_to: date_to ? moment(date_to).format("YYYY-MM-DD") : "",
412
+ }, { emitEvent: false });
413
+ }
414
+ /**
415
+ * Update expiry date from and date to on value change.
416
+ *
417
+ * @param timelineValue
418
+ */
419
+ onExpiryDurationChange(timelineValue) {
420
+ let { date_to, date_from } = timelineValue;
421
+ this.filterForm.patchValue({
422
+ expiry_date_from: date_from ? moment(date_from).format("YYYY-MM-DD") : "",
423
+ expiry_date_to: date_to ? moment(date_to).format("YYYY-MM-DD") : "",
424
+ });
425
+ }
426
+ /**
427
+ * Get the attribute value for the field.
428
+ *
429
+ * @param attribute
430
+ * @param field
431
+ */
432
+ getFilterConfig(attribute, field) {
433
+ if (!this.filterConfig)
434
+ return "";
435
+ // Check if the field and attribute exist in the filter config, return the value or an empty string
436
+ return this.filterConfig[field] &&
437
+ this.filterConfig[field][attribute] !== undefined
438
+ ? this.filterConfig[field][attribute]
439
+ : "";
440
+ }
441
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TechlifyFilterComponent, deps: [{ token: i1.RequestHelperService }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
442
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: TechlifyFilterComponent, selector: "app-techlify-filter", inputs: { filterForm: "filterForm", filterConfig: "filterConfig" }, outputs: { filterUpdated: "filterUpdated" }, ngImport: i0, template: "<form\n [formGroup]=\"filterForm\"\n fxLayout\n fxLayoutAlign=\"start center\"\n fxLayoutGap=\"10px\"\n>\n <mat-form-field\n *ngIf=\"filterForm.get('search')\"\n [appearance]=\"getFilterConfig('appearance', 'search')\"\n >\n <mat-label>Search</mat-label>\n <input\n formControlName=\"search\"\n matInput\n [placeholder]=\"getFilterConfig('placeholder', 'search')\"\n />\n <button\n *ngIf=\"filterForm.value?.search\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('search')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <app-timeline-filter\n *ngIf=\"filterForm?.get('duration')\"\n appearance=\"fill\"\n [labelText]=\"getFilterConfig('label', 'duration')\"\n [appearance]=\"getFilterConfig('appearance', 'duration')\"\n formControlName=\"duration\"\n (selectionChange)=\"onDurationChange($event)\"\n [showClearButton]=\"true\"\n [dateFrom]=\"filterForm.value?.date_from\"\n [dateTo]=\"filterForm.value?.date_to\"\n ></app-timeline-filter>\n\n <mat-form-field *ngIf=\"filterForm.get('payment_method_ids')\">\n <mat-label>Payment Method</mat-label>\n <app-searchable-selector\n formControlName=\"payment_method_ids\"\n apiUrl=\"api/payment-methods\"\n [multiple]=\"true\"\n [enableSearch]=\"false\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.payment_method_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('payment_method_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <ng-container *ngIf=\"filterForm.get('payment_account_ids')\">\n <mat-form-field *ngxPermissionsOnly=\"['accountingcommon_account.read']\">\n <mat-label>{{\n getFilterConfig(\"label\", \"payment_account_ids\") || \"Payment Account\"\n }}</mat-label>\n <app-searchable-selector\n formControlName=\"payment_account_ids\"\n [apiUrl]=\"\n getFilterConfig('apiUrl', 'payment_account_ids') || 'api/accounts'\n \"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.payment_account_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('payment_account_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field *ngIf=\"filterForm.get('invoice_status_ids')\">\n <mat-label>Invoice Status</mat-label>\n <app-searchable-selector\n formControlName=\"invoice_status_ids\"\n apiUrl=\"api/invoice-statuses\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.invoice_status_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('invoice_status_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <ng-container *ngIf=\"filterForm.get('customer_ids')\">\n <mat-form-field *ngxPermissionsOnly=\"['customer_read']\">\n <mat-label>Customer</mat-label>\n <app-searchable-selector\n formControlName=\"customer_ids\"\n titleField=\"name\"\n apiUrl=\"api/customers\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.customer_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('customer_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </ng-container>\n\n <ng-container\n *ngIf=\"\n filterForm.get('project_ids') &&\n getFilterConfig('disabled', 'project_ids') === false\n \"\n >\n <mat-form-field *ngxPermissionsOnly=\"['project.read']\">\n <mat-label>Project</mat-label>\n <app-searchable-selector\n formControlName=\"project_ids\"\n apiUrl=\"api/projects\"\n titleField=\"project_name\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.project_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('project_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field *ngIf=\"filterForm.get('product_ids')\">\n <mat-label>Product</mat-label>\n <app-searchable-selector\n formControlName=\"product_ids\"\n apiUrl=\"api/products\"\n titleField=\"name\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.product_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('product_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('measure_ids')\">\n <mat-label>Measure</mat-label>\n <app-searchable-selector\n formControlName=\"measure_ids\"\n apiUrl=\"api/product-measures\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.measure_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('measure_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <ng-container *ngxPermissionsOnly=\"['supplier.read']\">\n <mat-form-field\n *ngIf=\"filterForm.get('supplier_ids')\"\n [appearance]=\"getFilterConfig('appearance', 'supplier_ids')\"\n >\n <mat-label>Supplier</mat-label>\n <app-searchable-selector\n formControlName=\"supplier_ids\"\n titleField=\"company_name\"\n apiUrl=\"api/suppliers\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.supplier_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('supplier_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </ng-container>\n\n <app-timeline-filter\n appearance=\"fill\"\n [labelText]=\"getFilterConfig('label', 'expiry_duration')\"\n *ngIf=\"filterForm?.get('expiry_duration')\"\n formControlName=\"expiry_duration\"\n (selectionChange)=\"onExpiryDurationChange($event)\"\n [showClearButton]=\"true\"\n [dateFrom]=\"filterForm.value?.expiry_date_from\"\n [dateTo]=\"filterForm.value?.expiry_date_to\"\n ></app-timeline-filter>\n\n <mat-form-field\n *ngIf=\"filterForm.get('cost_category_ids')\"\n style=\"width: 150px\"\n >\n <mat-label>Cost Category</mat-label>\n <app-searchable-selector\n formControlName=\"cost_category_ids\"\n apiUrl=\"api/cost-code-categories\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.cost_category_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('cost_category_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('milestone_ids')\" style=\"width: 150px\">\n <mat-label>Milestone</mat-label>\n <app-searchable-selector\n formControlName=\"milestone_ids\"\n apiUrl=\"api/milestones\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.milestone_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('milestone_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('team_member_ids')\">\n <mat-label>Assignee</mat-label>\n <app-searchable-selector\n apiUrl=\"api/persons\"\n formControlName=\"team_member_ids\"\n titleField=\"name\"\n [multiple]=\"true\"\n >\n </app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.team_member_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('team_member_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('fixed_asset_type_ids')\">\n <mat-label>Type</mat-label>\n <app-searchable-selector\n formControlName=\"fixed_asset_type_ids\"\n apiUrl=\"api/accounting-plus/fixed-asset-types\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.fixed_asset_type_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('fixed_asset_type_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('fixed_asset_document_type_ids')\">\n <mat-label>Type</mat-label>\n <app-searchable-selector\n formControlName=\"fixed_asset_document_type_ids\"\n apiUrl=\"api/accounting-plus/fixed-asset-document-types\"\n [multiple]=\"true\"\n [enableSearch]=\"\n getFilterConfig('enableSearch', 'fixed_asset_document_type_ids')\n \"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.fixed_asset_document_type_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('fixed_asset_document_type_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <div *ngIf=\"filterForm.get('fixed_asset_document_status')\">\n <small\n class=\"mr-2 text-secondary\"\n *ngIf=\"getFilterConfig('showLabel', 'fixed_asset_document_status')\"\n >\n Status\n </small>\n <mat-button-toggle-group\n formControlName=\"fixed_asset_document_status\"\n [multiple]=\"false\"\n >\n <mat-button-toggle value=\"all\">All</mat-button-toggle>\n <mat-button-toggle value=\"active\">Active</mat-button-toggle>\n <mat-button-toggle value=\"expired\">Expired</mat-button-toggle>\n </mat-button-toggle-group>\n </div>\n\n <mat-form-field *ngIf=\"filterForm.get('asset_account_ids')\">\n <mat-label>Asset Account</mat-label>\n <app-searchable-selector\n formControlName=\"asset_account_ids\"\n apiUrl=\"api/accounts\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.asset_account_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('asset_account_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('depreciation_expense_account_ids')\">\n <mat-label>Depreciation Expense Account</mat-label>\n <app-searchable-selector\n [multiple]=\"true\"\n apiUrl=\"api/accounts\"\n formControlName=\"depreciation_expense_account_ids\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.depreciation_expense_account_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('depreciation_expense_account_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('depreciation_method_ids')\">\n <mat-label>Depreciation Method</mat-label>\n <app-searchable-selector\n formControlName=\"depreciation_method_ids\"\n apiUrl=\"api/accounting-plus/depreciation-methods\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n (click)=\"resetField('depreciation_method_ids')\"\n *ngIf=\"filterForm.value?.depreciation_method_ids\"\n mat-icon-button\n matSuffix\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field\n *ngIf=\"filterForm.get('task_status_ids')\"\n style=\"width: 150px\"\n >\n <mat-label>Status</mat-label>\n <app-searchable-selector\n apiUrl=\"api/task-statuses\"\n formControlName=\"task_status_ids\"\n titleField=\"title\"\n [multiple]=\"true\"\n [enableSearch]=\"false\"\n >\n </app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.task_status_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('task_status_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('service_center_ids')\">\n <mat-label>Service Center</mat-label>\n <app-searchable-selector\n apiUrl=\"api/accounting-plus/service-centers\"\n formControlName=\"service_center_ids\"\n titleField=\"name\"\n [enableSearch]=\"false\"\n [multiple]=\"true\"\n >\n </app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.service_center_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('service_center_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('fixed_asset_maintenance_status_ids')\">\n <mat-label>Status</mat-label>\n <app-searchable-selector\n apiUrl=\"api/accounting-plus/fixed-asset-maintenance-statuses\"\n formControlName=\"fixed_asset_maintenance_status_ids\"\n [multiple]=\"true\"\n [enableSearch]=\"false\"\n >\n </app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.fixed_asset_maintenance_status_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('fixed_asset_maintenance_status_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('group_by')\">\n <mat-label>Group By</mat-label>\n <mat-select formControlName=\"group_by\">\n <mat-option value=\"week\">Week</mat-option>\n <mat-option value=\"month\">Month</mat-option>\n <mat-option value=\"year\">Year</mat-option>\n </mat-select>\n </mat-form-field>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i10$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i10$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i10$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "component", type: i1.SearchableSelectorComponent, selector: "app-searchable-selector", inputs: ["valueField", "titleField", "subtitleField", "apiUrl", "multiple", "selectedValue", "enableSearch", "add", "addConfig", "edit", "editConfig", "sort", "sortBy", "searchField", "itemComponent", "items", "apiDataProperty", "cache", "perPage", "inDataSearch", "panelWidth", "focusSearchOnOpen", "required", "disabled", "value"], outputs: ["selectedValueChange", "selectionChange", "itemsChange"] }, { kind: "component", type: i1.TimelineFilterComponent, selector: "app-timeline-filter", inputs: ["defaultValue", "required", "disabled", "value", "timelines", "dateFrom", "dateTo", "appearance", "showClearButton", "form", "labelText"], outputs: ["selectionChange"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i6$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i10$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i12.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i12.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }], preserveWhitespaces: true });
443
+ }
444
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TechlifyFilterComponent, decorators: [{
445
+ type: Component,
446
+ args: [{ selector: "app-techlify-filter", template: "<form\n [formGroup]=\"filterForm\"\n fxLayout\n fxLayoutAlign=\"start center\"\n fxLayoutGap=\"10px\"\n>\n <mat-form-field\n *ngIf=\"filterForm.get('search')\"\n [appearance]=\"getFilterConfig('appearance', 'search')\"\n >\n <mat-label>Search</mat-label>\n <input\n formControlName=\"search\"\n matInput\n [placeholder]=\"getFilterConfig('placeholder', 'search')\"\n />\n <button\n *ngIf=\"filterForm.value?.search\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('search')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <app-timeline-filter\n *ngIf=\"filterForm?.get('duration')\"\n appearance=\"fill\"\n [labelText]=\"getFilterConfig('label', 'duration')\"\n [appearance]=\"getFilterConfig('appearance', 'duration')\"\n formControlName=\"duration\"\n (selectionChange)=\"onDurationChange($event)\"\n [showClearButton]=\"true\"\n [dateFrom]=\"filterForm.value?.date_from\"\n [dateTo]=\"filterForm.value?.date_to\"\n ></app-timeline-filter>\n\n <mat-form-field *ngIf=\"filterForm.get('payment_method_ids')\">\n <mat-label>Payment Method</mat-label>\n <app-searchable-selector\n formControlName=\"payment_method_ids\"\n apiUrl=\"api/payment-methods\"\n [multiple]=\"true\"\n [enableSearch]=\"false\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.payment_method_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('payment_method_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <ng-container *ngIf=\"filterForm.get('payment_account_ids')\">\n <mat-form-field *ngxPermissionsOnly=\"['accountingcommon_account.read']\">\n <mat-label>{{\n getFilterConfig(\"label\", \"payment_account_ids\") || \"Payment Account\"\n }}</mat-label>\n <app-searchable-selector\n formControlName=\"payment_account_ids\"\n [apiUrl]=\"\n getFilterConfig('apiUrl', 'payment_account_ids') || 'api/accounts'\n \"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.payment_account_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('payment_account_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field *ngIf=\"filterForm.get('invoice_status_ids')\">\n <mat-label>Invoice Status</mat-label>\n <app-searchable-selector\n formControlName=\"invoice_status_ids\"\n apiUrl=\"api/invoice-statuses\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.invoice_status_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('invoice_status_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <ng-container *ngIf=\"filterForm.get('customer_ids')\">\n <mat-form-field *ngxPermissionsOnly=\"['customer_read']\">\n <mat-label>Customer</mat-label>\n <app-searchable-selector\n formControlName=\"customer_ids\"\n titleField=\"name\"\n apiUrl=\"api/customers\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.customer_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('customer_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </ng-container>\n\n <ng-container\n *ngIf=\"\n filterForm.get('project_ids') &&\n getFilterConfig('disabled', 'project_ids') === false\n \"\n >\n <mat-form-field *ngxPermissionsOnly=\"['project.read']\">\n <mat-label>Project</mat-label>\n <app-searchable-selector\n formControlName=\"project_ids\"\n apiUrl=\"api/projects\"\n titleField=\"project_name\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.project_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('project_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field *ngIf=\"filterForm.get('product_ids')\">\n <mat-label>Product</mat-label>\n <app-searchable-selector\n formControlName=\"product_ids\"\n apiUrl=\"api/products\"\n titleField=\"name\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.product_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('product_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('measure_ids')\">\n <mat-label>Measure</mat-label>\n <app-searchable-selector\n formControlName=\"measure_ids\"\n apiUrl=\"api/product-measures\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.measure_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('measure_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <ng-container *ngxPermissionsOnly=\"['supplier.read']\">\n <mat-form-field\n *ngIf=\"filterForm.get('supplier_ids')\"\n [appearance]=\"getFilterConfig('appearance', 'supplier_ids')\"\n >\n <mat-label>Supplier</mat-label>\n <app-searchable-selector\n formControlName=\"supplier_ids\"\n titleField=\"company_name\"\n apiUrl=\"api/suppliers\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.supplier_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('supplier_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </ng-container>\n\n <app-timeline-filter\n appearance=\"fill\"\n [labelText]=\"getFilterConfig('label', 'expiry_duration')\"\n *ngIf=\"filterForm?.get('expiry_duration')\"\n formControlName=\"expiry_duration\"\n (selectionChange)=\"onExpiryDurationChange($event)\"\n [showClearButton]=\"true\"\n [dateFrom]=\"filterForm.value?.expiry_date_from\"\n [dateTo]=\"filterForm.value?.expiry_date_to\"\n ></app-timeline-filter>\n\n <mat-form-field\n *ngIf=\"filterForm.get('cost_category_ids')\"\n style=\"width: 150px\"\n >\n <mat-label>Cost Category</mat-label>\n <app-searchable-selector\n formControlName=\"cost_category_ids\"\n apiUrl=\"api/cost-code-categories\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.cost_category_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('cost_category_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('milestone_ids')\" style=\"width: 150px\">\n <mat-label>Milestone</mat-label>\n <app-searchable-selector\n formControlName=\"milestone_ids\"\n apiUrl=\"api/milestones\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.milestone_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('milestone_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('team_member_ids')\">\n <mat-label>Assignee</mat-label>\n <app-searchable-selector\n apiUrl=\"api/persons\"\n formControlName=\"team_member_ids\"\n titleField=\"name\"\n [multiple]=\"true\"\n >\n </app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.team_member_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('team_member_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('fixed_asset_type_ids')\">\n <mat-label>Type</mat-label>\n <app-searchable-selector\n formControlName=\"fixed_asset_type_ids\"\n apiUrl=\"api/accounting-plus/fixed-asset-types\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.fixed_asset_type_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('fixed_asset_type_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('fixed_asset_document_type_ids')\">\n <mat-label>Type</mat-label>\n <app-searchable-selector\n formControlName=\"fixed_asset_document_type_ids\"\n apiUrl=\"api/accounting-plus/fixed-asset-document-types\"\n [multiple]=\"true\"\n [enableSearch]=\"\n getFilterConfig('enableSearch', 'fixed_asset_document_type_ids')\n \"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.fixed_asset_document_type_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('fixed_asset_document_type_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <div *ngIf=\"filterForm.get('fixed_asset_document_status')\">\n <small\n class=\"mr-2 text-secondary\"\n *ngIf=\"getFilterConfig('showLabel', 'fixed_asset_document_status')\"\n >\n Status\n </small>\n <mat-button-toggle-group\n formControlName=\"fixed_asset_document_status\"\n [multiple]=\"false\"\n >\n <mat-button-toggle value=\"all\">All</mat-button-toggle>\n <mat-button-toggle value=\"active\">Active</mat-button-toggle>\n <mat-button-toggle value=\"expired\">Expired</mat-button-toggle>\n </mat-button-toggle-group>\n </div>\n\n <mat-form-field *ngIf=\"filterForm.get('asset_account_ids')\">\n <mat-label>Asset Account</mat-label>\n <app-searchable-selector\n formControlName=\"asset_account_ids\"\n apiUrl=\"api/accounts\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.asset_account_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('asset_account_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('depreciation_expense_account_ids')\">\n <mat-label>Depreciation Expense Account</mat-label>\n <app-searchable-selector\n [multiple]=\"true\"\n apiUrl=\"api/accounts\"\n formControlName=\"depreciation_expense_account_ids\"\n ></app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.depreciation_expense_account_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('depreciation_expense_account_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('depreciation_method_ids')\">\n <mat-label>Depreciation Method</mat-label>\n <app-searchable-selector\n formControlName=\"depreciation_method_ids\"\n apiUrl=\"api/accounting-plus/depreciation-methods\"\n [multiple]=\"true\"\n ></app-searchable-selector>\n <button\n (click)=\"resetField('depreciation_method_ids')\"\n *ngIf=\"filterForm.value?.depreciation_method_ids\"\n mat-icon-button\n matSuffix\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field\n *ngIf=\"filterForm.get('task_status_ids')\"\n style=\"width: 150px\"\n >\n <mat-label>Status</mat-label>\n <app-searchable-selector\n apiUrl=\"api/task-statuses\"\n formControlName=\"task_status_ids\"\n titleField=\"title\"\n [multiple]=\"true\"\n [enableSearch]=\"false\"\n >\n </app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.task_status_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('task_status_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('service_center_ids')\">\n <mat-label>Service Center</mat-label>\n <app-searchable-selector\n apiUrl=\"api/accounting-plus/service-centers\"\n formControlName=\"service_center_ids\"\n titleField=\"name\"\n [enableSearch]=\"false\"\n [multiple]=\"true\"\n >\n </app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.service_center_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('service_center_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('fixed_asset_maintenance_status_ids')\">\n <mat-label>Status</mat-label>\n <app-searchable-selector\n apiUrl=\"api/accounting-plus/fixed-asset-maintenance-statuses\"\n formControlName=\"fixed_asset_maintenance_status_ids\"\n [multiple]=\"true\"\n [enableSearch]=\"false\"\n >\n </app-searchable-selector>\n <button\n *ngIf=\"filterForm.value?.fixed_asset_maintenance_status_ids\"\n mat-icon-button\n matSuffix\n (click)=\"resetField('fixed_asset_maintenance_status_ids')\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"filterForm.get('group_by')\">\n <mat-label>Group By</mat-label>\n <mat-select formControlName=\"group_by\">\n <mat-option value=\"week\">Week</mat-option>\n <mat-option value=\"month\">Month</mat-option>\n <mat-option value=\"year\">Year</mat-option>\n </mat-select>\n </mat-form-field>\n</form>\n" }]
447
+ }], ctorParameters: () => [{ type: i1.RequestHelperService }, { type: i2.ActivatedRoute }], propDecorators: { filterForm: [{
448
+ type: Input
449
+ }], filterConfig: [{
450
+ type: Input
451
+ }], filterUpdated: [{
452
+ type: Output
453
+ }] } });
454
+
455
+ class TechlifyFilterModule {
456
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TechlifyFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
457
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: TechlifyFilterModule, declarations: [TechlifyFilterComponent], imports: [CommonModule,
458
+ ReactiveFormsModule,
459
+ FlexLayoutModule,
460
+ SearchableSelectorModule,
461
+ TimelineFilterModule,
462
+ MaterialModule], exports: [TechlifyFilterComponent] });
463
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TechlifyFilterModule, imports: [CommonModule,
464
+ ReactiveFormsModule,
465
+ FlexLayoutModule,
466
+ SearchableSelectorModule,
467
+ TimelineFilterModule,
468
+ MaterialModule] });
469
+ }
470
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TechlifyFilterModule, decorators: [{
471
+ type: NgModule,
472
+ args: [{
473
+ declarations: [TechlifyFilterComponent],
474
+ imports: [
475
+ CommonModule,
476
+ ReactiveFormsModule,
477
+ FlexLayoutModule,
478
+ SearchableSelectorModule,
479
+ TimelineFilterModule,
480
+ MaterialModule,
481
+ ],
482
+ exports: [TechlifyFilterComponent],
483
+ }]
484
+ }] });
485
+
486
+ /*
487
+ * Public API Surface of inventory-common
488
+ */
489
+
490
+ /**
491
+ * Generated bundle index. Do not edit.
492
+ */
493
+
494
+ export { InventoryCommonRoutingModule as I, ProductService as P, StockSummaryService as S, TechlifyFilterComponent as T, TechlifyFilterModule as a, InventoryCommonModule as b };
495
+ //# sourceMappingURL=techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs.map