techlify-inventory-common 18.51.0 → 22.0.0

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 (356) hide show
  1. package/fesm2022/techlify-inventory-common-category.module-Dtn1604q.mjs +842 -0
  2. package/fesm2022/techlify-inventory-common-category.module-Dtn1604q.mjs.map +1 -0
  3. package/fesm2022/techlify-inventory-common-location.service-C99J8Lje.mjs +50 -0
  4. package/fesm2022/techlify-inventory-common-location.service-C99J8Lje.mjs.map +1 -0
  5. package/fesm2022/techlify-inventory-common-material.module-ClupVm7-.mjs +190 -0
  6. package/fesm2022/techlify-inventory-common-material.module-ClupVm7-.mjs.map +1 -0
  7. package/fesm2022/techlify-inventory-common-measure.service-DvJUGa0i.mjs +38 -0
  8. package/fesm2022/techlify-inventory-common-measure.service-DvJUGa0i.mjs.map +1 -0
  9. package/fesm2022/techlify-inventory-common-product-category-badges.component-VnfnNhtV.mjs +133 -0
  10. package/fesm2022/techlify-inventory-common-product-category-badges.component-VnfnNhtV.mjs.map +1 -0
  11. package/fesm2022/techlify-inventory-common-product.module-MZoVK3bN.mjs +4278 -0
  12. package/fesm2022/techlify-inventory-common-product.module-MZoVK3bN.mjs.map +1 -0
  13. package/fesm2022/techlify-inventory-common-purchase-order-view.component-CjED8n4_.mjs +852 -0
  14. package/fesm2022/techlify-inventory-common-purchase-order-view.component-CjED8n4_.mjs.map +1 -0
  15. package/fesm2022/techlify-inventory-common-purchase-order.service-ztJ5RRH5.mjs +40 -0
  16. package/fesm2022/techlify-inventory-common-purchase-order.service-ztJ5RRH5.mjs.map +1 -0
  17. package/fesm2022/techlify-inventory-common-recipient.module-gxR77BIj.mjs +647 -0
  18. package/fesm2022/techlify-inventory-common-recipient.module-gxR77BIj.mjs.map +1 -0
  19. package/fesm2022/techlify-inventory-common-shared.module-DP-FVqea.mjs +102 -0
  20. package/fesm2022/techlify-inventory-common-shared.module-DP-FVqea.mjs.map +1 -0
  21. package/fesm2022/techlify-inventory-common-stock-allocation-list.component-Du-VCtbs.mjs +382 -0
  22. package/fesm2022/techlify-inventory-common-stock-allocation-list.component-Du-VCtbs.mjs.map +1 -0
  23. package/fesm2022/techlify-inventory-common-stock-issue-form.component-DfgbqIKn.mjs +486 -0
  24. package/fesm2022/techlify-inventory-common-stock-issue-form.component-DfgbqIKn.mjs.map +1 -0
  25. package/fesm2022/techlify-inventory-common-stock-issue-page.module-DX9n3X1T.mjs +2509 -0
  26. package/fesm2022/techlify-inventory-common-stock-issue-page.module-DX9n3X1T.mjs.map +1 -0
  27. package/fesm2022/techlify-inventory-common-stock-issue-product-view.component-D8aIc5Oh.mjs +208 -0
  28. package/fesm2022/techlify-inventory-common-stock-issue-product-view.component-D8aIc5Oh.mjs.map +1 -0
  29. package/fesm2022/techlify-inventory-common-stock-issue-product.service-BRbfc5KP.mjs +38 -0
  30. package/fesm2022/techlify-inventory-common-stock-issue-product.service-BRbfc5KP.mjs.map +1 -0
  31. package/fesm2022/techlify-inventory-common-stock-issue-view.component-Cp_0YkKh.mjs +239 -0
  32. package/fesm2022/techlify-inventory-common-stock-issue-view.component-Cp_0YkKh.mjs.map +1 -0
  33. package/fesm2022/techlify-inventory-common-stock-issue.service-CLHasWVp.mjs +38 -0
  34. package/fesm2022/techlify-inventory-common-stock-issue.service-CLHasWVp.mjs.map +1 -0
  35. package/fesm2022/techlify-inventory-common-stock-receipts.module-BPxUGNbD.mjs +4195 -0
  36. package/fesm2022/techlify-inventory-common-stock-receipts.module-BPxUGNbD.mjs.map +1 -0
  37. package/fesm2022/techlify-inventory-common-techlify-filter.module-BdRNWNHi.mjs +464 -0
  38. package/fesm2022/techlify-inventory-common-techlify-filter.module-BdRNWNHi.mjs.map +1 -0
  39. package/fesm2022/techlify-inventory-common-techlify-form-service-D9K3W2jt.mjs +13 -0
  40. package/fesm2022/techlify-inventory-common-techlify-form-service-D9K3W2jt.mjs.map +1 -0
  41. package/fesm2022/techlify-inventory-common.mjs +10803 -2
  42. package/fesm2022/techlify-inventory-common.mjs.map +1 -1
  43. package/package.json +9 -11
  44. package/types/techlify-inventory-common.d.ts +1792 -0
  45. package/esm2022/lib/inventory-common/category/category-form/category-form.component.mjs +0 -75
  46. package/esm2022/lib/inventory-common/category/category-form-button/category-form-button.component.mjs +0 -32
  47. package/esm2022/lib/inventory-common/category/category-list-page/category-list-page.component.mjs +0 -64
  48. package/esm2022/lib/inventory-common/category/category-routing.module.mjs +0 -29
  49. package/esm2022/lib/inventory-common/category/category-view/category-view.component.mjs +0 -46
  50. package/esm2022/lib/inventory-common/category/category.module.mjs +0 -62
  51. package/esm2022/lib/inventory-common/category/category.service.mjs +0 -18
  52. package/esm2022/lib/inventory-common/incident/incident-form/incident-form.component.mjs +0 -113
  53. package/esm2022/lib/inventory-common/incident/incident-form-button/incident-form-button.component.mjs +0 -45
  54. package/esm2022/lib/inventory-common/incident/incident-list/incident-list.component.mjs +0 -140
  55. package/esm2022/lib/inventory-common/incident/incident-routing.module.mjs +0 -24
  56. package/esm2022/lib/inventory-common/incident/incident.module.mjs +0 -22
  57. package/esm2022/lib/inventory-common/incident/incident.service.mjs +0 -18
  58. package/esm2022/lib/inventory-common/inventory-common-routing.module.mjs +0 -81
  59. package/esm2022/lib/inventory-common/inventory-common.module.mjs +0 -43
  60. package/esm2022/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.mjs +0 -44
  61. package/esm2022/lib/inventory-common/inventory-value-report.service.mjs +0 -21
  62. package/esm2022/lib/inventory-common/location/location-form/location-form.component.mjs +0 -63
  63. package/esm2022/lib/inventory-common/location/location-form-button/location-form-button.component.mjs +0 -47
  64. package/esm2022/lib/inventory-common/location/location-information/location-information.component.mjs +0 -36
  65. package/esm2022/lib/inventory-common/location/location-list/location-list.component.mjs +0 -81
  66. package/esm2022/lib/inventory-common/location/location-product-statistics/location-product-statistics.component.mjs +0 -80
  67. package/esm2022/lib/inventory-common/location/location-routing.module.mjs +0 -38
  68. package/esm2022/lib/inventory-common/location/location-status-changer/location-status-changer.component.mjs +0 -64
  69. package/esm2022/lib/inventory-common/location/location-view/location-view.component.mjs +0 -52
  70. package/esm2022/lib/inventory-common/location/location.module.mjs +0 -22
  71. package/esm2022/lib/inventory-common/location/location.service.mjs +0 -33
  72. package/esm2022/lib/inventory-common/location/shelf/shelf-form/shelf-form.component.mjs +0 -86
  73. package/esm2022/lib/inventory-common/location/shelf/shelf-form-button/shelf-form-button.component.mjs +0 -39
  74. package/esm2022/lib/inventory-common/location/shelf/shelf-list/shelf-list.component.mjs +0 -103
  75. package/esm2022/lib/inventory-common/location/shelf/shelf-routing.module.mjs +0 -24
  76. package/esm2022/lib/inventory-common/location/shelf/shelf.module.mjs +0 -22
  77. package/esm2022/lib/inventory-common/location/shelf/shelf.service.mjs +0 -20
  78. package/esm2022/lib/inventory-common/low-stock-report.service.mjs +0 -23
  79. package/esm2022/lib/inventory-common/material.module.mjs +0 -172
  80. package/esm2022/lib/inventory-common/measure/measure-form/measure-form.component.mjs +0 -63
  81. package/esm2022/lib/inventory-common/measure/measure-list/measure-list.component.mjs +0 -75
  82. package/esm2022/lib/inventory-common/measure/measure-routing.module.mjs +0 -24
  83. package/esm2022/lib/inventory-common/measure/measure.module.mjs +0 -43
  84. package/esm2022/lib/inventory-common/measure/measure.service.mjs +0 -18
  85. package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.mjs +0 -47
  86. package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.mjs +0 -22
  87. package/esm2022/lib/inventory-common/product/product-basic-info/product-basic-info.component.mjs +0 -58
  88. package/esm2022/lib/inventory-common/product/product-batch-update-form/product-batch-update-form.component.mjs +0 -54
  89. package/esm2022/lib/inventory-common/product/product-delete-button/product-delete-button.component.mjs +0 -54
  90. package/esm2022/lib/inventory-common/product/product-form/product-form.component.mjs +0 -258
  91. package/esm2022/lib/inventory-common/product/product-form-button/product-form-button.component.mjs +0 -15
  92. package/esm2022/lib/inventory-common/product/product-form.service.mjs +0 -17
  93. package/esm2022/lib/inventory-common/product/product-import-page/product-import-page.component.mjs +0 -66
  94. package/esm2022/lib/inventory-common/product/product-list/product-list.component.mjs +0 -177
  95. package/esm2022/lib/inventory-common/product/product-location/product-location-list/product-location-list.component.mjs +0 -61
  96. package/esm2022/lib/inventory-common/product/product-measure-form/product-measure-form.component.mjs +0 -101
  97. package/esm2022/lib/inventory-common/product/product-measures-list/product-measures-list.component.mjs +0 -145
  98. package/esm2022/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.mjs +0 -12
  99. package/esm2022/lib/inventory-common/product/product-quick-search/product-quick-search.component.mjs +0 -69
  100. package/esm2022/lib/inventory-common/product/product-routing.module.mjs +0 -68
  101. package/esm2022/lib/inventory-common/product/product-search/product-search.component.mjs +0 -151
  102. package/esm2022/lib/inventory-common/product/product-search/product-search.module.mjs +0 -39
  103. package/esm2022/lib/inventory-common/product/product-statistics.service.mjs +0 -23
  104. package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.mjs +0 -57
  105. package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.mjs +0 -18
  106. package/esm2022/lib/inventory-common/product/product-summary.service.mjs +0 -20
  107. package/esm2022/lib/inventory-common/product/product-view-page/product-view-page.component.mjs +0 -98
  108. package/esm2022/lib/inventory-common/product/product.module.mjs +0 -145
  109. package/esm2022/lib/inventory-common/product/product.service.mjs +0 -20
  110. package/esm2022/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.mjs +0 -15
  111. package/esm2022/lib/inventory-common/product-batch.service.mjs +0 -20
  112. package/esm2022/lib/inventory-common/rating/rating-form/rating-form.component.mjs +0 -112
  113. package/esm2022/lib/inventory-common/rating/rating-form-button/rating-form-button.component.mjs +0 -45
  114. package/esm2022/lib/inventory-common/rating/rating-list/rating-list.component.mjs +0 -135
  115. package/esm2022/lib/inventory-common/rating/rating-routing.module.mjs +0 -23
  116. package/esm2022/lib/inventory-common/rating/rating.module.mjs +0 -22
  117. package/esm2022/lib/inventory-common/rating/rating.service.mjs +0 -18
  118. package/esm2022/lib/inventory-common/recipient/recipient-form/recipient-form.component.mjs +0 -59
  119. package/esm2022/lib/inventory-common/recipient/recipient-list/recipient-list.component.mjs +0 -49
  120. package/esm2022/lib/inventory-common/recipient/recipient-routing.module.mjs +0 -24
  121. package/esm2022/lib/inventory-common/recipient/recipient.module.mjs +0 -18
  122. package/esm2022/lib/inventory-common/recipient/recipient.service.mjs +0 -18
  123. package/esm2022/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.mjs +0 -152
  124. package/esm2022/lib/inventory-common/reports/low-stock-report/low-stock-report.component.mjs +0 -161
  125. package/esm2022/lib/inventory-common/reports/stock-issue-summary-report/stock-issue-product-data.service.mjs +0 -20
  126. package/esm2022/lib/inventory-common/reports/stock-issue-summary-report/stock-issue-summary-report.component.mjs +0 -98
  127. package/esm2022/lib/inventory-common/services/techlify-form-service.mjs +0 -11
  128. package/esm2022/lib/inventory-common/shared/export-to-excel-button/export-to-excel-button.component.mjs +0 -58
  129. package/esm2022/lib/inventory-common/shared.module.mjs +0 -67
  130. package/esm2022/lib/inventory-common/stock-allocation/stock-allocation-list/stock-allocation-list.component.mjs +0 -81
  131. package/esm2022/lib/inventory-common/stock-allocation/stock-allocation.service.mjs +0 -16
  132. package/esm2022/lib/inventory-common/stock-issue/stock-issue-form/stock-issue-form.component.mjs +0 -198
  133. package/esm2022/lib/inventory-common/stock-issue/stock-issue-import-page/stock-issue-import-page.component.mjs +0 -59
  134. package/esm2022/lib/inventory-common/stock-issue/stock-issue-list/stock-issue-list.component.mjs +0 -149
  135. package/esm2022/lib/inventory-common/stock-issue/stock-issue-page/stock-issue-page.component.mjs +0 -91
  136. package/esm2022/lib/inventory-common/stock-issue/stock-issue-page/stock-issue-page.module.mjs +0 -82
  137. package/esm2022/lib/inventory-common/stock-issue/stock-issue-product-form/stock-issue-product-form-button/stock-issue-product-form-button.component.mjs +0 -35
  138. package/esm2022/lib/inventory-common/stock-issue/stock-issue-product-form/stock-issue-product-form.component.mjs +0 -102
  139. package/esm2022/lib/inventory-common/stock-issue/stock-issue-product-view/stock-issue-product-view.component.mjs +0 -59
  140. package/esm2022/lib/inventory-common/stock-issue/stock-issue-product.service.mjs +0 -16
  141. package/esm2022/lib/inventory-common/stock-issue/stock-issue-products-list/stock-issue-products-list.component.mjs +0 -167
  142. package/esm2022/lib/inventory-common/stock-issue/stock-issue-routing.module.mjs +0 -51
  143. package/esm2022/lib/inventory-common/stock-issue/stock-issue-single-product-form/stock-issue-single-product-form.component.mjs +0 -201
  144. package/esm2022/lib/inventory-common/stock-issue/stock-issue-view/stock-issue-view.component.mjs +0 -64
  145. package/esm2022/lib/inventory-common/stock-issue/stock-issue.module.mjs +0 -47
  146. package/esm2022/lib/inventory-common/stock-issue/stock-issue.service.mjs +0 -18
  147. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.component.mjs +0 -226
  148. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-import-page/stock-receipt-import-page.component.mjs +0 -74
  149. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-list/stock-receipt-list.component.mjs +0 -152
  150. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product-form/stock-receipt-product-form-button/stock-receipt-product-form-button.component.mjs +0 -37
  151. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product-form/stock-receipt-product-form.component.mjs +0 -80
  152. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product-list/stock-receipt-product-list.component.mjs +0 -149
  153. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product-view/stock-receipt-product-view.component.mjs +0 -59
  154. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product.service.mjs +0 -18
  155. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-single-product-form/stock-receipt-simple-form/stock-receipt-single-product-form.component.mjs +0 -181
  156. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-view/stock-receipt-view.component.mjs +0 -54
  157. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt.service.mjs +0 -18
  158. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-page/stock-receipts-page.component.mjs +0 -70
  159. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-routing.module.mjs +0 -52
  160. package/esm2022/lib/inventory-common/stock-receipts/stock-receipts.module.mjs +0 -104
  161. package/esm2022/lib/inventory-common/stock-summary.service.mjs +0 -26
  162. package/esm2022/lib/inventory-common/stock-transfer/stock-transfer-form/stock-transfer-form.component.mjs +0 -98
  163. package/esm2022/lib/inventory-common/stock-transfer/stock-transfer-list/stock-transfer-list.component.mjs +0 -139
  164. package/esm2022/lib/inventory-common/stock-transfer/stock-transfer.service.mjs +0 -18
  165. package/esm2022/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.mjs +0 -59
  166. package/esm2022/lib/inventory-common/supplier/payee-selector/payee-selector.module.mjs +0 -21
  167. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-form/purchase-order-form.component.mjs +0 -156
  168. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-listing/purchase-order-listing.component.mjs +0 -67
  169. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-form/purchase-order-product-form.component.mjs +0 -74
  170. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-form-button/purchase-order-product-form-button.component.mjs +0 -38
  171. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-list.component.mjs +0 -61
  172. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product.service.mjs +0 -20
  173. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order-view/purchase-order-view.component.mjs +0 -64
  174. package/esm2022/lib/inventory-common/supplier/purchase-order/purchase-order.service.mjs +0 -20
  175. package/esm2022/lib/inventory-common/supplier/supplier-branch-delete-button/supplier-branch-delete-button.component.mjs +0 -63
  176. package/esm2022/lib/inventory-common/supplier/supplier-branch-form/supplier-branch-form-button/supplier-branch-form-button.component.mjs +0 -47
  177. package/esm2022/lib/inventory-common/supplier/supplier-branch-form/supplier-branch-form.component.mjs +0 -79
  178. package/esm2022/lib/inventory-common/supplier/supplier-branch.service.mjs +0 -18
  179. package/esm2022/lib/inventory-common/supplier/supplier-branches-list/supplier-branches-list.component.mjs +0 -79
  180. package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.component.mjs +0 -94
  181. package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.service.mjs +0 -17
  182. package/esm2022/lib/inventory-common/supplier/supplier-information/supplier-information.component.mjs +0 -73
  183. package/esm2022/lib/inventory-common/supplier/supplier-list/supplier-list.component.mjs +0 -68
  184. package/esm2022/lib/inventory-common/supplier/supplier-routing.module.mjs +0 -51
  185. package/esm2022/lib/inventory-common/supplier/supplier-type.service.mjs +0 -25
  186. package/esm2022/lib/inventory-common/supplier/supplier-view/supplier-view.component.mjs +0 -70
  187. package/esm2022/lib/inventory-common/supplier/supplier.component.mjs +0 -20
  188. package/esm2022/lib/inventory-common/supplier/supplier.module.mjs +0 -64
  189. package/esm2022/lib/inventory-common/supplier/supplier.service.mjs +0 -20
  190. package/esm2022/lib/inventory-common/techlify-filter/techlify-filter.component.mjs +0 -116
  191. package/esm2022/lib/inventory-common/techlify-filter/techlify-filter.module.mjs +0 -42
  192. package/esm2022/public-api.mjs +0 -71
  193. package/esm2022/techlify-inventory-common.mjs +0 -5
  194. package/fesm2022/techlify-inventory-common-category.module-oi41ku5U.mjs +0 -288
  195. package/fesm2022/techlify-inventory-common-category.module-oi41ku5U.mjs.map +0 -1
  196. package/fesm2022/techlify-inventory-common-purchase-order-view.component-DkWmMRaW.mjs +0 -227
  197. package/fesm2022/techlify-inventory-common-purchase-order-view.component-DkWmMRaW.mjs.map +0 -1
  198. package/fesm2022/techlify-inventory-common-recipient.module-v77bDJCC.mjs +0 -147
  199. package/fesm2022/techlify-inventory-common-recipient.module-v77bDJCC.mjs.map +0 -1
  200. package/fesm2022/techlify-inventory-common-stock-issue-form.component-ABIh_GkN.mjs +0 -199
  201. package/fesm2022/techlify-inventory-common-stock-issue-form.component-ABIh_GkN.mjs.map +0 -1
  202. package/fesm2022/techlify-inventory-common-stock-issue-product-view.component-3FB_GfyZ.mjs +0 -60
  203. package/fesm2022/techlify-inventory-common-stock-issue-product-view.component-3FB_GfyZ.mjs.map +0 -1
  204. package/fesm2022/techlify-inventory-common-stock-issue-view.component-D4AloV4G.mjs +0 -66
  205. package/fesm2022/techlify-inventory-common-stock-issue-view.component-D4AloV4G.mjs.map +0 -1
  206. package/fesm2022/techlify-inventory-common-techlify-inventory-common-B_42CQL_.mjs +0 -7218
  207. package/fesm2022/techlify-inventory-common-techlify-inventory-common-B_42CQL_.mjs.map +0 -1
  208. package/index.d.ts +0 -5
  209. package/lib/inventory-common/category/category-form/category-form.component.d.ts +0 -18
  210. package/lib/inventory-common/category/category-form-button/category-form-button.component.d.ts +0 -13
  211. package/lib/inventory-common/category/category-list-page/category-list-page.component.d.ts +0 -20
  212. package/lib/inventory-common/category/category-routing.module.d.ts +0 -7
  213. package/lib/inventory-common/category/category-view/category-view.component.d.ts +0 -16
  214. package/lib/inventory-common/category/category.module.d.ts +0 -20
  215. package/lib/inventory-common/category/category.service.d.ts +0 -7
  216. package/lib/inventory-common/incident/incident-form/incident-form.component.d.ts +0 -19
  217. package/lib/inventory-common/incident/incident-form-button/incident-form-button.component.d.ts +0 -15
  218. package/lib/inventory-common/incident/incident-list/incident-list.component.d.ts +0 -22
  219. package/lib/inventory-common/incident/incident-routing.module.d.ts +0 -7
  220. package/lib/inventory-common/incident/incident.module.d.ts +0 -8
  221. package/lib/inventory-common/incident/incident.service.d.ts +0 -7
  222. package/lib/inventory-common/inventory-common-routing.module.d.ts +0 -7
  223. package/lib/inventory-common/inventory-common.module.d.ts +0 -14
  224. package/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.d.ts +0 -14
  225. package/lib/inventory-common/inventory-value-report.service.d.ts +0 -9
  226. package/lib/inventory-common/location/location-form/location-form.component.d.ts +0 -18
  227. package/lib/inventory-common/location/location-form-button/location-form-button.component.d.ts +0 -13
  228. package/lib/inventory-common/location/location-information/location-information.component.d.ts +0 -12
  229. package/lib/inventory-common/location/location-list/location-list.component.d.ts +0 -18
  230. package/lib/inventory-common/location/location-product-statistics/location-product-statistics.component.d.ts +0 -18
  231. package/lib/inventory-common/location/location-routing.module.d.ts +0 -7
  232. package/lib/inventory-common/location/location-status-changer/location-status-changer.component.d.ts +0 -17
  233. package/lib/inventory-common/location/location-view/location-view.component.d.ts +0 -16
  234. package/lib/inventory-common/location/location.module.d.ts +0 -8
  235. package/lib/inventory-common/location/location.service.d.ts +0 -15
  236. package/lib/inventory-common/location/shelf/shelf-form/shelf-form.component.d.ts +0 -18
  237. package/lib/inventory-common/location/shelf/shelf-form-button/shelf-form-button.component.d.ts +0 -13
  238. package/lib/inventory-common/location/shelf/shelf-list/shelf-list.component.d.ts +0 -19
  239. package/lib/inventory-common/location/shelf/shelf-routing.module.d.ts +0 -7
  240. package/lib/inventory-common/location/shelf/shelf.module.d.ts +0 -8
  241. package/lib/inventory-common/location/shelf/shelf.service.d.ts +0 -8
  242. package/lib/inventory-common/low-stock-report.service.d.ts +0 -10
  243. package/lib/inventory-common/material.module.d.ts +0 -40
  244. package/lib/inventory-common/measure/measure-form/measure-form.component.d.ts +0 -21
  245. package/lib/inventory-common/measure/measure-list/measure-list.component.d.ts +0 -19
  246. package/lib/inventory-common/measure/measure-routing.module.d.ts +0 -7
  247. package/lib/inventory-common/measure/measure.module.d.ts +0 -14
  248. package/lib/inventory-common/measure/measure.service.d.ts +0 -7
  249. package/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.d.ts +0 -13
  250. package/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.d.ts +0 -12
  251. package/lib/inventory-common/product/product-basic-info/product-basic-info.component.d.ts +0 -21
  252. package/lib/inventory-common/product/product-batch-update-form/product-batch-update-form.component.d.ts +0 -17
  253. package/lib/inventory-common/product/product-delete-button/product-delete-button.component.d.ts +0 -26
  254. package/lib/inventory-common/product/product-form/product-form.component.d.ts +0 -46
  255. package/lib/inventory-common/product/product-form-button/product-form-button.component.d.ts +0 -7
  256. package/lib/inventory-common/product/product-form.service.d.ts +0 -7
  257. package/lib/inventory-common/product/product-import-page/product-import-page.component.d.ts +0 -10
  258. package/lib/inventory-common/product/product-list/product-list.component.d.ts +0 -34
  259. package/lib/inventory-common/product/product-location/product-location-list/product-location-list.component.d.ts +0 -18
  260. package/lib/inventory-common/product/product-measure-form/product-measure-form.component.d.ts +0 -33
  261. package/lib/inventory-common/product/product-measures-list/product-measures-list.component.d.ts +0 -43
  262. package/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.d.ts +0 -5
  263. package/lib/inventory-common/product/product-quick-search/product-quick-search.component.d.ts +0 -15
  264. package/lib/inventory-common/product/product-routing.module.d.ts +0 -7
  265. package/lib/inventory-common/product/product-search/product-search.component.d.ts +0 -48
  266. package/lib/inventory-common/product/product-search/product-search.module.d.ts +0 -13
  267. package/lib/inventory-common/product/product-statistics.service.d.ts +0 -9
  268. package/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.d.ts +0 -15
  269. package/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.d.ts +0 -10
  270. package/lib/inventory-common/product/product-summary.service.d.ts +0 -8
  271. package/lib/inventory-common/product/product-view-page/product-view-page.component.d.ts +0 -44
  272. package/lib/inventory-common/product/product.module.d.ts +0 -31
  273. package/lib/inventory-common/product/product.service.d.ts +0 -8
  274. package/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.d.ts +0 -6
  275. package/lib/inventory-common/product-batch.service.d.ts +0 -8
  276. package/lib/inventory-common/rating/rating-form/rating-form.component.d.ts +0 -19
  277. package/lib/inventory-common/rating/rating-form-button/rating-form-button.component.d.ts +0 -15
  278. package/lib/inventory-common/rating/rating-list/rating-list.component.d.ts +0 -22
  279. package/lib/inventory-common/rating/rating-routing.module.d.ts +0 -7
  280. package/lib/inventory-common/rating/rating.module.d.ts +0 -8
  281. package/lib/inventory-common/rating/rating.service.d.ts +0 -7
  282. package/lib/inventory-common/recipient/recipient-form/recipient-form.component.d.ts +0 -21
  283. package/lib/inventory-common/recipient/recipient-list/recipient-list.component.d.ts +0 -16
  284. package/lib/inventory-common/recipient/recipient-routing.module.d.ts +0 -7
  285. package/lib/inventory-common/recipient/recipient.module.d.ts +0 -9
  286. package/lib/inventory-common/recipient/recipient.service.d.ts +0 -7
  287. package/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.d.ts +0 -27
  288. package/lib/inventory-common/reports/low-stock-report/low-stock-report.component.d.ts +0 -25
  289. package/lib/inventory-common/reports/stock-issue-summary-report/stock-issue-product-data.service.d.ts +0 -8
  290. package/lib/inventory-common/reports/stock-issue-summary-report/stock-issue-summary-report.component.d.ts +0 -25
  291. package/lib/inventory-common/services/techlify-form-service.d.ts +0 -5
  292. package/lib/inventory-common/shared/export-to-excel-button/export-to-excel-button.component.d.ts +0 -12
  293. package/lib/inventory-common/shared.module.d.ts +0 -13
  294. package/lib/inventory-common/stock-allocation/stock-allocation-list/stock-allocation-list.component.d.ts +0 -19
  295. package/lib/inventory-common/stock-allocation/stock-allocation.service.d.ts +0 -7
  296. package/lib/inventory-common/stock-issue/stock-issue-form/stock-issue-form.component.d.ts +0 -45
  297. package/lib/inventory-common/stock-issue/stock-issue-import-page/stock-issue-import-page.component.d.ts +0 -10
  298. package/lib/inventory-common/stock-issue/stock-issue-list/stock-issue-list.component.d.ts +0 -33
  299. package/lib/inventory-common/stock-issue/stock-issue-page/stock-issue-page.component.d.ts +0 -30
  300. package/lib/inventory-common/stock-issue/stock-issue-page/stock-issue-page.module.d.ts +0 -18
  301. package/lib/inventory-common/stock-issue/stock-issue-product-form/stock-issue-product-form-button/stock-issue-product-form-button.component.d.ts +0 -12
  302. package/lib/inventory-common/stock-issue/stock-issue-product-form/stock-issue-product-form.component.d.ts +0 -21
  303. package/lib/inventory-common/stock-issue/stock-issue-product-view/stock-issue-product-view.component.d.ts +0 -19
  304. package/lib/inventory-common/stock-issue/stock-issue-product.service.d.ts +0 -7
  305. package/lib/inventory-common/stock-issue/stock-issue-products-list/stock-issue-products-list.component.d.ts +0 -41
  306. package/lib/inventory-common/stock-issue/stock-issue-routing.module.d.ts +0 -7
  307. package/lib/inventory-common/stock-issue/stock-issue-single-product-form/stock-issue-single-product-form.component.d.ts +0 -42
  308. package/lib/inventory-common/stock-issue/stock-issue-view/stock-issue-view.component.d.ts +0 -19
  309. package/lib/inventory-common/stock-issue/stock-issue.module.d.ts +0 -14
  310. package/lib/inventory-common/stock-issue/stock-issue.service.d.ts +0 -7
  311. package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.component.d.ts +0 -48
  312. package/lib/inventory-common/stock-receipts/stock-receipt-import-page/stock-receipt-import-page.component.d.ts +0 -10
  313. package/lib/inventory-common/stock-receipts/stock-receipt-list/stock-receipt-list.component.d.ts +0 -30
  314. package/lib/inventory-common/stock-receipts/stock-receipt-product-form/stock-receipt-product-form-button/stock-receipt-product-form-button.component.d.ts +0 -12
  315. package/lib/inventory-common/stock-receipts/stock-receipt-product-form/stock-receipt-product-form.component.d.ts +0 -17
  316. package/lib/inventory-common/stock-receipts/stock-receipt-product-list/stock-receipt-product-list.component.d.ts +0 -31
  317. package/lib/inventory-common/stock-receipts/stock-receipt-product-view/stock-receipt-product-view.component.d.ts +0 -19
  318. package/lib/inventory-common/stock-receipts/stock-receipt-product.service.d.ts +0 -7
  319. package/lib/inventory-common/stock-receipts/stock-receipt-single-product-form/stock-receipt-simple-form/stock-receipt-single-product-form.component.d.ts +0 -33
  320. package/lib/inventory-common/stock-receipts/stock-receipt-view/stock-receipt-view.component.d.ts +0 -19
  321. package/lib/inventory-common/stock-receipts/stock-receipt.service.d.ts +0 -7
  322. package/lib/inventory-common/stock-receipts/stock-receipts-page/stock-receipts-page.component.d.ts +0 -21
  323. package/lib/inventory-common/stock-receipts/stock-receipts-routing.module.d.ts +0 -7
  324. package/lib/inventory-common/stock-receipts/stock-receipts.module.d.ts +0 -22
  325. package/lib/inventory-common/stock-summary.service.d.ts +0 -14
  326. package/lib/inventory-common/stock-transfer/stock-transfer-form/stock-transfer-form.component.d.ts +0 -19
  327. package/lib/inventory-common/stock-transfer/stock-transfer-list/stock-transfer-list.component.d.ts +0 -28
  328. package/lib/inventory-common/stock-transfer/stock-transfer.service.d.ts +0 -7
  329. package/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.d.ts +0 -20
  330. package/lib/inventory-common/supplier/payee-selector/payee-selector.module.d.ts +0 -11
  331. package/lib/inventory-common/supplier/purchase-order/purchase-order-form/purchase-order-form.component.d.ts +0 -30
  332. package/lib/inventory-common/supplier/purchase-order/purchase-order-listing/purchase-order-listing.component.d.ts +0 -16
  333. package/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-form/purchase-order-product-form.component.d.ts +0 -16
  334. package/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-form-button/purchase-order-product-form-button.component.d.ts +0 -12
  335. package/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product-list.component.d.ts +0 -15
  336. package/lib/inventory-common/supplier/purchase-order/purchase-order-product-list/purchase-order-product.service.d.ts +0 -8
  337. package/lib/inventory-common/supplier/purchase-order/purchase-order-view/purchase-order-view.component.d.ts +0 -19
  338. package/lib/inventory-common/supplier/purchase-order/purchase-order.service.d.ts +0 -8
  339. package/lib/inventory-common/supplier/supplier-branch-delete-button/supplier-branch-delete-button.component.d.ts +0 -18
  340. package/lib/inventory-common/supplier/supplier-branch-form/supplier-branch-form-button/supplier-branch-form-button.component.d.ts +0 -13
  341. package/lib/inventory-common/supplier/supplier-branch-form/supplier-branch-form.component.d.ts +0 -22
  342. package/lib/inventory-common/supplier/supplier-branch.service.d.ts +0 -7
  343. package/lib/inventory-common/supplier/supplier-branches-list/supplier-branches-list.component.d.ts +0 -18
  344. package/lib/inventory-common/supplier/supplier-form/supplier-form.component.d.ts +0 -25
  345. package/lib/inventory-common/supplier/supplier-form/supplier-form.service.d.ts +0 -7
  346. package/lib/inventory-common/supplier/supplier-information/supplier-information.component.d.ts +0 -18
  347. package/lib/inventory-common/supplier/supplier-list/supplier-list.component.d.ts +0 -20
  348. package/lib/inventory-common/supplier/supplier-routing.module.d.ts +0 -7
  349. package/lib/inventory-common/supplier/supplier-type.service.d.ts +0 -13
  350. package/lib/inventory-common/supplier/supplier-view/supplier-view.component.d.ts +0 -20
  351. package/lib/inventory-common/supplier/supplier.component.d.ts +0 -10
  352. package/lib/inventory-common/supplier/supplier.module.d.ts +0 -20
  353. package/lib/inventory-common/supplier/supplier.service.d.ts +0 -8
  354. package/lib/inventory-common/techlify-filter/techlify-filter.component.d.ts +0 -31
  355. package/lib/inventory-common/techlify-filter/techlify-filter.module.d.ts +0 -12
  356. package/public-api.d.ts +0 -67
@@ -0,0 +1,4195 @@
1
+ import { n as ExportToExcelButtonComponent, t as ProductCategoryBadgesComponent } from "./techlify-inventory-common-product-category-badges.component-VnfnNhtV.mjs";
2
+ import { t as MaterialModule$1 } from "./techlify-inventory-common-material.module-ClupVm7-.mjs";
3
+ import { t as SharedModule } from "./techlify-inventory-common-shared.module-DP-FVqea.mjs";
4
+ import { t as LocationService } from "./techlify-inventory-common-location.service-C99J8Lje.mjs";
5
+ import { t as StockAllocationListComponent } from "./techlify-inventory-common-stock-allocation-list.component-Du-VCtbs.mjs";
6
+ import { t as TechlifyFilterModule } from "./techlify-inventory-common-techlify-filter.module-BdRNWNHi.mjs";
7
+ import * as i0 from "@angular/core";
8
+ import { ChangeDetectionStrategy, Component, Inject, Injectable, Input, NgModule, Optional, effect, forwardRef, input, output, signal } from "@angular/core";
9
+ import * as i9 from "@angular/router";
10
+ import { RouterModule } from "@angular/router";
11
+ import moment from "moment";
12
+ import * as i1 from "ngx-techlify-core";
13
+ import { AuthenticationGuard, ColumnSelectorModule, EntityFilesViewAllModule, ImportCsvModule, NoteModule, SearchableSelectorModule, TechlifyDeleteButtonComponent, TechlifyFeatureModule, TechlifyFormButtonComponent, TechlifyFormComponent, TechlifyIconModule, TechlifyListComponent, TechlifyService, TimelineFilterModule } from "ngx-techlify-core";
14
+ import * as i11 from "@angular/material/icon";
15
+ import * as i6$1 from "@angular/material/card";
16
+ import * as i7 from "@angular/material/table";
17
+ import * as i5 from "@angular/material/progress-bar";
18
+ import * as i10 from "ngx-infinite-scroll";
19
+ import { InfiniteScrollDirective } from "ngx-infinite-scroll";
20
+ import * as i2$1 from "@angular/forms";
21
+ import { FormControl, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from "@angular/forms";
22
+ import { debounceTime, finalize, startWith } from "rxjs";
23
+ import { __decorate } from "tslib";
24
+ import * as i4 from "@angular/material/dialog";
25
+ import { MAT_DIALOG_DATA, MatDialogContent, MatDialogModule, MatDialogTitle } from "@angular/material/dialog";
26
+ import * as i5$1 from "@angular/material/button";
27
+ import * as i8$2 from "@angular/material/form-field";
28
+ import { MatFormFieldModule } from "@angular/material/form-field";
29
+ import * as i9$1 from "@angular/material/input";
30
+ import { UntilDestroy } from "@ngneat/until-destroy";
31
+ import * as i6 from "@angular/material/sort";
32
+ import * as i7$1 from "@angular/material/checkbox";
33
+ import * as i8 from "@angular/material/tooltip";
34
+ import * as i2 from "@angular/material/button-toggle";
35
+ import * as i8$1 from "@angular/material/datepicker";
36
+ import * as i13 from "@angular/common";
37
+ import { CommonModule } from "@angular/common";
38
+ import { toSignal } from "@angular/core/rxjs-interop";
39
+ var __defProp = Object.defineProperty;
40
+ var __exportAll = (all, flags) => {
41
+ let target = Object.setPrototypeOf({}, null);
42
+ for (var name in all) __defProp(target, name, {
43
+ get: all[name],
44
+ enumerable: true
45
+ });
46
+ if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
47
+ return flags & 2 ? target : Object.preventExtensions(target);
48
+ };
49
+ var SupplierService = class SupplierService extends TechlifyService {
50
+ httpService;
51
+ constructor(httpService) {
52
+ super(httpService, "suppliers");
53
+ this.httpService = httpService;
54
+ }
55
+ static ɵfac = i0.ɵɵngDeclareFactory({
56
+ minVersion: "12.0.0",
57
+ version: "22.2.5",
58
+ ngImport: i0,
59
+ type: SupplierService,
60
+ deps: [{ token: i1.HttpService }],
61
+ target: i0.ɵɵFactoryTarget.Injectable
62
+ });
63
+ static ɵprov = i0.ɵɵngDeclareInjectable({
64
+ minVersion: "12.0.0",
65
+ version: "22.2.5",
66
+ ngImport: i0,
67
+ type: SupplierService,
68
+ providedIn: "root"
69
+ });
70
+ };
71
+ i0.ɵɵngDeclareClassMetadata({
72
+ minVersion: "12.0.0",
73
+ version: "22.2.5",
74
+ ngImport: i0,
75
+ type: SupplierService,
76
+ decorators: [{
77
+ type: Injectable,
78
+ args: [{ providedIn: "root" }]
79
+ }],
80
+ ctorParameters: () => [{ type: i1.HttpService }]
81
+ });
82
+ var SupplierFormComponent = class SupplierFormComponent extends TechlifyFormComponent {
83
+ formValidatorService;
84
+ fb;
85
+ service;
86
+ dialogRef;
87
+ data;
88
+ errorMessages = {
89
+ company_name: { required: "Company Name is required" },
90
+ supplier_type_id: { required: "Supplier Type is required" },
91
+ address: { required: "The address field is required" }
92
+ };
93
+ isCreateAnother = new FormControl(false);
94
+ totalRecordSaved = signal(0, ...ngDevMode ? [{ debugName: "totalRecordSaved" }] : /* istanbul ignore next */ []);
95
+ constructor(formValidatorService, fb, service, dialogRef, data) {
96
+ super(formValidatorService, service);
97
+ this.formValidatorService = formValidatorService;
98
+ this.fb = fb;
99
+ this.service = service;
100
+ this.dialogRef = dialogRef;
101
+ this.data = data;
102
+ this.form = this.fb.group({
103
+ id: [""],
104
+ contact_name: [""],
105
+ company_name: ["", Validators.required],
106
+ details: [""],
107
+ address: ["", Validators.required],
108
+ phone: [""],
109
+ email: [""],
110
+ supplier_type_id: ["", Validators.required]
111
+ });
112
+ }
113
+ ngOnInit() {
114
+ const model = this.data?.model;
115
+ if (model) {
116
+ this.isUpdate = true;
117
+ this.form.patchValue(model);
118
+ }
119
+ }
120
+ submit() {
121
+ if (!this.isCreateAnother.value) {
122
+ super.submit();
123
+ return;
124
+ }
125
+ this.form.markAllAsTouched();
126
+ if (!this.form.valid) return;
127
+ this.isWorking = true;
128
+ const model = this.form.value;
129
+ (this.isUpdate ? this.service.update(model) : this.service.store(model)).pipe(finalize(() => this.isWorking = false)).subscribe((res) => {
130
+ this.createdEntries.unshift(res?.item);
131
+ this.totalRecordSaved.set(this.totalRecordSaved() + 1);
132
+ this.alertService.addAlert("Supplier saved successfully. You can create another one now.", "success");
133
+ this.form.reset();
134
+ });
135
+ }
136
+ static ɵfac = i0.ɵɵngDeclareFactory({
137
+ minVersion: "12.0.0",
138
+ version: "22.2.5",
139
+ ngImport: i0,
140
+ type: SupplierFormComponent,
141
+ deps: [
142
+ { token: i1.FormValidatorService },
143
+ { token: i2$1.FormBuilder },
144
+ { token: SupplierService },
145
+ { token: i4.MatDialogRef },
146
+ {
147
+ token: MAT_DIALOG_DATA,
148
+ optional: true
149
+ }
150
+ ],
151
+ target: i0.ɵɵFactoryTarget.Component
152
+ });
153
+ static ɵcmp = i0.ɵɵngDeclareComponent({
154
+ minVersion: "17.0.0",
155
+ version: "22.2.5",
156
+ type: SupplierFormComponent,
157
+ isStandalone: true,
158
+ selector: "app-supplier-form",
159
+ usesInheritance: true,
160
+ ngImport: i0,
161
+ template: "<mat-card-title class=\"d-flex flex-row justify-content-center align-items-center\">\n Supplier Form\n</mat-card-title>\n<mat-card-content>\n <form class=\"d-flex flex-column gap-3\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <mat-form-field>\n <mat-label>Company Name</mat-label>\n <input autocomplete=\"off\" formControlName=\"company_name\" matInput placeholder=\"Company Name\" required />\n @if (isFieldValid('company_name')) {\n <mat-error>\n {{ getErrorMessage('company_name') }}\n </mat-error>\n }\n </mat-form-field>\n <mat-form-field>\n <mat-label>Contact Name</mat-label>\n <input autocomplete=\"off\" formControlName=\"contact_name\" matInput placeholder=\"Contact Name\" />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Types</mat-label>\n <app-searchable-selector apiUrl=\"api/supplier-types\" formControlName=\"supplier_type_id\" titleField=\"title\">\n </app-searchable-selector>\n @if (isFieldValid('supplier_type_id')) {\n <mat-error>\n {{ getErrorMessage('supplier_type_id') }}\n </mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Phone</mat-label>\n <input autocomplete=\"off\" formControlName=\"phone\" matInput placeholder=\"Phone\" />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Email</mat-label>\n <input autocomplete=\"off\" formControlName=\"email\" matInput placeholder=\"Email\" type=\"email\" />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Address</mat-label>\n <input autocomplete=\"off\" formControlName=\"address\" matInput placeholder=\"Address\" required />\n @if (isFieldValid('address')) {\n <mat-error>\n {{ getErrorMessage('address') }}\n </mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Details</mat-label>\n <input autocomplete=\"off\" formControlName=\"details\" matInput placeholder=\"Details\" />\n </mat-form-field>\n\n <div class=\"d-flex justify-content-between align-items-center gap-3\">\n <div class=\"d-flex flex-row gap-2 align-items-center\">\n <mat-checkbox [formControl]=\"isCreateAnother\">Create Another</mat-checkbox>\n <small class=\"text-secondary\">({{ totalRecordSaved() }} records saved successfully)</small>\n </div>\n\n <div class=\"d-flex justify-content-end gap-2\">\n <button type=\"button\" mat-flat-button [disabled]=\"isWorking\" (click)=\"closeDialog()\">Cancel</button>\n <button type=\"submit\" mat-raised-button color=\"primary\" [disabled]=\"isWorking\">Save</button>\n </div>\n </div>\n </form>\n</mat-card-content>\n",
162
+ dependencies: [
163
+ {
164
+ kind: "ngmodule",
165
+ type: SharedModule
166
+ },
167
+ {
168
+ kind: "component",
169
+ type: i5$1.MatButton,
170
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
171
+ inputs: ["matButton"],
172
+ exportAs: ["matButton", "matAnchor"]
173
+ },
174
+ {
175
+ kind: "directive",
176
+ type: i6$1.MatCardContent,
177
+ selector: "mat-card-content"
178
+ },
179
+ {
180
+ kind: "directive",
181
+ type: i6$1.MatCardTitle,
182
+ selector: "mat-card-title, [mat-card-title], [matCardTitle]"
183
+ },
184
+ {
185
+ kind: "component",
186
+ type: i7$1.MatCheckbox,
187
+ selector: "mat-checkbox",
188
+ inputs: [
189
+ "aria-label",
190
+ "aria-labelledby",
191
+ "aria-describedby",
192
+ "aria-expanded",
193
+ "aria-controls",
194
+ "aria-owns",
195
+ "id",
196
+ "required",
197
+ "labelPosition",
198
+ "name",
199
+ "value",
200
+ "disableRipple",
201
+ "tabIndex",
202
+ "color",
203
+ "disabledInteractive",
204
+ "checked",
205
+ "disabled",
206
+ "indeterminate"
207
+ ],
208
+ outputs: ["change", "indeterminateChange"],
209
+ exportAs: ["matCheckbox"]
210
+ },
211
+ {
212
+ kind: "component",
213
+ type: i8$2.MatFormField,
214
+ selector: "mat-form-field",
215
+ inputs: [
216
+ "hideRequiredMarker",
217
+ "color",
218
+ "floatLabel",
219
+ "appearance",
220
+ "subscriptSizing",
221
+ "hintLabel"
222
+ ],
223
+ exportAs: ["matFormField"]
224
+ },
225
+ {
226
+ kind: "directive",
227
+ type: i8$2.MatLabel,
228
+ selector: "mat-label"
229
+ },
230
+ {
231
+ kind: "directive",
232
+ type: i8$2.MatError,
233
+ selector: "mat-error, [matError]",
234
+ inputs: ["id"]
235
+ },
236
+ {
237
+ kind: "directive",
238
+ type: i9$1.MatInput,
239
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
240
+ inputs: [
241
+ "disabled",
242
+ "id",
243
+ "placeholder",
244
+ "name",
245
+ "required",
246
+ "type",
247
+ "errorStateMatcher",
248
+ "aria-describedby",
249
+ "value",
250
+ "readonly",
251
+ "disabledInteractive"
252
+ ],
253
+ exportAs: ["matInput"]
254
+ },
255
+ {
256
+ kind: "directive",
257
+ type: i2$1.ɵNgNoValidate,
258
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
259
+ },
260
+ {
261
+ kind: "directive",
262
+ type: i2$1.DefaultValueAccessor,
263
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
264
+ },
265
+ {
266
+ kind: "directive",
267
+ type: i2$1.NgControlStatus,
268
+ selector: "[formControlName],[ngModel],[formControl]"
269
+ },
270
+ {
271
+ kind: "directive",
272
+ type: i2$1.NgControlStatusGroup,
273
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
274
+ },
275
+ {
276
+ kind: "directive",
277
+ type: i2$1.RequiredValidator,
278
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
279
+ inputs: ["required"]
280
+ },
281
+ {
282
+ kind: "directive",
283
+ type: i2$1.FormControlDirective,
284
+ selector: "[formControl]",
285
+ inputs: [
286
+ "formControl",
287
+ "disabled",
288
+ "ngModel"
289
+ ],
290
+ outputs: ["ngModelChange"],
291
+ exportAs: ["ngForm"]
292
+ },
293
+ {
294
+ kind: "directive",
295
+ type: i2$1.FormGroupDirective,
296
+ selector: "[formGroup]",
297
+ inputs: ["formGroup"],
298
+ outputs: ["ngSubmit"],
299
+ exportAs: ["ngForm"]
300
+ },
301
+ {
302
+ kind: "directive",
303
+ type: i2$1.FormControlName,
304
+ selector: "[formControlName]",
305
+ inputs: [
306
+ "formControlName",
307
+ "disabled",
308
+ "ngModel"
309
+ ],
310
+ outputs: ["ngModelChange"]
311
+ },
312
+ {
313
+ kind: "component",
314
+ type: i1.SearchableSelectorComponent,
315
+ selector: "app-searchable-selector",
316
+ inputs: [
317
+ "valueField",
318
+ "titleField",
319
+ "subtitleField",
320
+ "apiUrl",
321
+ "multiple",
322
+ "selectedValue",
323
+ "enableSearch",
324
+ "add",
325
+ "addConfig",
326
+ "edit",
327
+ "editConfig",
328
+ "sort",
329
+ "sortBy",
330
+ "searchField",
331
+ "itemComponent",
332
+ "items",
333
+ "apiDataProperty",
334
+ "cache",
335
+ "perPage",
336
+ "inDataSearch",
337
+ "panelWidth",
338
+ "focusSearchOnOpen",
339
+ "isEmitInitialEvent",
340
+ "required",
341
+ "disabled",
342
+ "value"
343
+ ],
344
+ outputs: [
345
+ "selectedValueChange",
346
+ "selectionChange",
347
+ "itemsChange",
348
+ "isItemsEmpty"
349
+ ]
350
+ }
351
+ ],
352
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
353
+ preserveWhitespaces: true
354
+ });
355
+ };
356
+ i0.ɵɵngDeclareClassMetadata({
357
+ minVersion: "12.0.0",
358
+ version: "22.2.5",
359
+ ngImport: i0,
360
+ type: SupplierFormComponent,
361
+ decorators: [{
362
+ type: Component,
363
+ args: [{
364
+ selector: "app-supplier-form",
365
+ imports: [SharedModule],
366
+ changeDetection: ChangeDetectionStrategy.Eager,
367
+ template: "<mat-card-title class=\"d-flex flex-row justify-content-center align-items-center\">\n Supplier Form\n</mat-card-title>\n<mat-card-content>\n <form class=\"d-flex flex-column gap-3\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <mat-form-field>\n <mat-label>Company Name</mat-label>\n <input autocomplete=\"off\" formControlName=\"company_name\" matInput placeholder=\"Company Name\" required />\n @if (isFieldValid('company_name')) {\n <mat-error>\n {{ getErrorMessage('company_name') }}\n </mat-error>\n }\n </mat-form-field>\n <mat-form-field>\n <mat-label>Contact Name</mat-label>\n <input autocomplete=\"off\" formControlName=\"contact_name\" matInput placeholder=\"Contact Name\" />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Types</mat-label>\n <app-searchable-selector apiUrl=\"api/supplier-types\" formControlName=\"supplier_type_id\" titleField=\"title\">\n </app-searchable-selector>\n @if (isFieldValid('supplier_type_id')) {\n <mat-error>\n {{ getErrorMessage('supplier_type_id') }}\n </mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Phone</mat-label>\n <input autocomplete=\"off\" formControlName=\"phone\" matInput placeholder=\"Phone\" />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Email</mat-label>\n <input autocomplete=\"off\" formControlName=\"email\" matInput placeholder=\"Email\" type=\"email\" />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Address</mat-label>\n <input autocomplete=\"off\" formControlName=\"address\" matInput placeholder=\"Address\" required />\n @if (isFieldValid('address')) {\n <mat-error>\n {{ getErrorMessage('address') }}\n </mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Details</mat-label>\n <input autocomplete=\"off\" formControlName=\"details\" matInput placeholder=\"Details\" />\n </mat-form-field>\n\n <div class=\"d-flex justify-content-between align-items-center gap-3\">\n <div class=\"d-flex flex-row gap-2 align-items-center\">\n <mat-checkbox [formControl]=\"isCreateAnother\">Create Another</mat-checkbox>\n <small class=\"text-secondary\">({{ totalRecordSaved() }} records saved successfully)</small>\n </div>\n\n <div class=\"d-flex justify-content-end gap-2\">\n <button type=\"button\" mat-flat-button [disabled]=\"isWorking\" (click)=\"closeDialog()\">Cancel</button>\n <button type=\"submit\" mat-raised-button color=\"primary\" [disabled]=\"isWorking\">Save</button>\n </div>\n </div>\n </form>\n</mat-card-content>\n"
368
+ }]
369
+ }],
370
+ ctorParameters: () => [
371
+ { type: i1.FormValidatorService },
372
+ { type: i2$1.FormBuilder },
373
+ { type: SupplierService },
374
+ { type: i4.MatDialogRef },
375
+ {
376
+ type: void 0,
377
+ decorators: [{
378
+ type: Inject,
379
+ args: [MAT_DIALOG_DATA]
380
+ }, { type: Optional }]
381
+ }
382
+ ]
383
+ });
384
+ var PayeeSelectorComponent = class PayeeSelectorComponent {
385
+ label = "Payee";
386
+ appearance = "fill";
387
+ required = false;
388
+ showAddButton = false;
389
+ multiple = false;
390
+ value;
391
+ onChange = () => {};
392
+ onTouch = () => {};
393
+ writeValue(value) {
394
+ this.value = value;
395
+ this.onChange(value);
396
+ this.onTouch(value);
397
+ }
398
+ registerOnChange(fn) {
399
+ this.onChange = fn;
400
+ }
401
+ registerOnTouched(fn) {
402
+ this.onTouch = fn;
403
+ }
404
+ SupplierFormComponent = SupplierFormComponent;
405
+ static ɵfac = i0.ɵɵngDeclareFactory({
406
+ minVersion: "12.0.0",
407
+ version: "22.2.5",
408
+ ngImport: i0,
409
+ type: PayeeSelectorComponent,
410
+ deps: [],
411
+ target: i0.ɵɵFactoryTarget.Component
412
+ });
413
+ static ɵcmp = i0.ɵɵngDeclareComponent({
414
+ minVersion: "17.0.0",
415
+ version: "22.2.5",
416
+ type: PayeeSelectorComponent,
417
+ isStandalone: false,
418
+ selector: "app-payee-selector",
419
+ inputs: {
420
+ label: "label",
421
+ appearance: "appearance",
422
+ required: "required",
423
+ showAddButton: "showAddButton",
424
+ multiple: "multiple"
425
+ },
426
+ providers: [{
427
+ provide: NG_VALUE_ACCESSOR,
428
+ useExisting: forwardRef(() => PayeeSelectorComponent),
429
+ multi: true
430
+ }],
431
+ ngImport: i0,
432
+ template: "<mat-form-field [appearance]=\"appearance\" class=\"w-100\">\n <mat-label>{{ label }}</mat-label>\n <app-searchable-selector\n apiUrl=\"api/suppliers\"\n titleField=\"company_name\"\n sortBy=\"company_name|asc\"\n [required]=\"required\"\n [(ngModel)]=\"value\"\n #payeeSelector=\"ngModel\"\n name=\"payeeSelector\"\n [add]=\"showAddButton\"\n [itemComponent]=\"SupplierFormComponent\"\n (ngModelChange)=\"onChange($event)\"\n [addConfig]=\"{ width: '600px' }\"\n [ngModelOptions]=\"{ standalone: true }\"\n [multiple]=\"multiple\"\n >\n </app-searchable-selector>\n @if (payeeSelector.invalid && payeeSelector.touched) {\n <mat-error> The payee field is required. </mat-error>\n }\n</mat-form-field>\n",
433
+ styles: [""],
434
+ dependencies: [
435
+ {
436
+ kind: "component",
437
+ type: i8$2.MatFormField,
438
+ selector: "mat-form-field",
439
+ inputs: [
440
+ "hideRequiredMarker",
441
+ "color",
442
+ "floatLabel",
443
+ "appearance",
444
+ "subscriptSizing",
445
+ "hintLabel"
446
+ ],
447
+ exportAs: ["matFormField"]
448
+ },
449
+ {
450
+ kind: "directive",
451
+ type: i8$2.MatLabel,
452
+ selector: "mat-label"
453
+ },
454
+ {
455
+ kind: "directive",
456
+ type: i8$2.MatError,
457
+ selector: "mat-error, [matError]",
458
+ inputs: ["id"]
459
+ },
460
+ {
461
+ kind: "directive",
462
+ type: i2$1.NgControlStatus,
463
+ selector: "[formControlName],[ngModel],[formControl]"
464
+ },
465
+ {
466
+ kind: "directive",
467
+ type: i2$1.RequiredValidator,
468
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
469
+ inputs: ["required"]
470
+ },
471
+ {
472
+ kind: "component",
473
+ type: i1.SearchableSelectorComponent,
474
+ selector: "app-searchable-selector",
475
+ inputs: [
476
+ "valueField",
477
+ "titleField",
478
+ "subtitleField",
479
+ "apiUrl",
480
+ "multiple",
481
+ "selectedValue",
482
+ "enableSearch",
483
+ "add",
484
+ "addConfig",
485
+ "edit",
486
+ "editConfig",
487
+ "sort",
488
+ "sortBy",
489
+ "searchField",
490
+ "itemComponent",
491
+ "items",
492
+ "apiDataProperty",
493
+ "cache",
494
+ "perPage",
495
+ "inDataSearch",
496
+ "panelWidth",
497
+ "focusSearchOnOpen",
498
+ "isEmitInitialEvent",
499
+ "required",
500
+ "disabled",
501
+ "value"
502
+ ],
503
+ outputs: [
504
+ "selectedValueChange",
505
+ "selectionChange",
506
+ "itemsChange",
507
+ "isItemsEmpty"
508
+ ]
509
+ },
510
+ {
511
+ kind: "directive",
512
+ type: i2$1.NgModel,
513
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
514
+ inputs: [
515
+ "name",
516
+ "disabled",
517
+ "ngModel",
518
+ "ngModelOptions"
519
+ ],
520
+ outputs: ["ngModelChange"],
521
+ exportAs: ["ngModel"]
522
+ }
523
+ ],
524
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
525
+ preserveWhitespaces: true
526
+ });
527
+ };
528
+ i0.ɵɵngDeclareClassMetadata({
529
+ minVersion: "12.0.0",
530
+ version: "22.2.5",
531
+ ngImport: i0,
532
+ type: PayeeSelectorComponent,
533
+ decorators: [{
534
+ type: Component,
535
+ args: [{
536
+ selector: "app-payee-selector",
537
+ providers: [{
538
+ provide: NG_VALUE_ACCESSOR,
539
+ useExisting: forwardRef(() => PayeeSelectorComponent),
540
+ multi: true
541
+ }],
542
+ changeDetection: ChangeDetectionStrategy.Eager,
543
+ standalone: false,
544
+ template: "<mat-form-field [appearance]=\"appearance\" class=\"w-100\">\n <mat-label>{{ label }}</mat-label>\n <app-searchable-selector\n apiUrl=\"api/suppliers\"\n titleField=\"company_name\"\n sortBy=\"company_name|asc\"\n [required]=\"required\"\n [(ngModel)]=\"value\"\n #payeeSelector=\"ngModel\"\n name=\"payeeSelector\"\n [add]=\"showAddButton\"\n [itemComponent]=\"SupplierFormComponent\"\n (ngModelChange)=\"onChange($event)\"\n [addConfig]=\"{ width: '600px' }\"\n [ngModelOptions]=\"{ standalone: true }\"\n [multiple]=\"multiple\"\n >\n </app-searchable-selector>\n @if (payeeSelector.invalid && payeeSelector.touched) {\n <mat-error> The payee field is required. </mat-error>\n }\n</mat-form-field>\n"
545
+ }]
546
+ }],
547
+ propDecorators: {
548
+ label: [{ type: Input }],
549
+ appearance: [{ type: Input }],
550
+ required: [{ type: Input }],
551
+ showAddButton: [{ type: Input }],
552
+ multiple: [{ type: Input }]
553
+ }
554
+ });
555
+ var PayeeSelectorModule = class PayeeSelectorModule {
556
+ static ɵfac = i0.ɵɵngDeclareFactory({
557
+ minVersion: "12.0.0",
558
+ version: "22.2.5",
559
+ ngImport: i0,
560
+ type: PayeeSelectorModule,
561
+ deps: [],
562
+ target: i0.ɵɵFactoryTarget.NgModule
563
+ });
564
+ static ɵmod = i0.ɵɵngDeclareNgModule({
565
+ minVersion: "14.0.0",
566
+ version: "22.2.5",
567
+ ngImport: i0,
568
+ type: PayeeSelectorModule,
569
+ declarations: [PayeeSelectorComponent],
570
+ imports: [
571
+ CommonModule,
572
+ MatFormFieldModule,
573
+ ReactiveFormsModule,
574
+ SearchableSelectorModule,
575
+ FormsModule
576
+ ],
577
+ exports: [PayeeSelectorComponent]
578
+ });
579
+ static ɵinj = i0.ɵɵngDeclareInjector({
580
+ minVersion: "12.0.0",
581
+ version: "22.2.5",
582
+ ngImport: i0,
583
+ type: PayeeSelectorModule,
584
+ imports: [
585
+ CommonModule,
586
+ MatFormFieldModule,
587
+ ReactiveFormsModule,
588
+ SearchableSelectorModule,
589
+ FormsModule
590
+ ]
591
+ });
592
+ };
593
+ i0.ɵɵngDeclareClassMetadata({
594
+ minVersion: "12.0.0",
595
+ version: "22.2.5",
596
+ ngImport: i0,
597
+ type: PayeeSelectorModule,
598
+ decorators: [{
599
+ type: NgModule,
600
+ args: [{
601
+ declarations: [PayeeSelectorComponent],
602
+ exports: [PayeeSelectorComponent],
603
+ imports: [
604
+ CommonModule,
605
+ MatFormFieldModule,
606
+ ReactiveFormsModule,
607
+ SearchableSelectorModule,
608
+ FormsModule
609
+ ]
610
+ }]
611
+ }]
612
+ });
613
+ var StockReceiptService = class StockReceiptService extends TechlifyService {
614
+ constructor(httpService) {
615
+ super(httpService, "stock-receipts");
616
+ }
617
+ static ɵfac = i0.ɵɵngDeclareFactory({
618
+ minVersion: "12.0.0",
619
+ version: "22.2.5",
620
+ ngImport: i0,
621
+ type: StockReceiptService,
622
+ deps: [{ token: i1.HttpService }],
623
+ target: i0.ɵɵFactoryTarget.Injectable
624
+ });
625
+ static ɵprov = i0.ɵɵngDeclareInjectable({
626
+ minVersion: "12.0.0",
627
+ version: "22.2.5",
628
+ ngImport: i0,
629
+ type: StockReceiptService,
630
+ providedIn: "root"
631
+ });
632
+ };
633
+ i0.ɵɵngDeclareClassMetadata({
634
+ minVersion: "12.0.0",
635
+ version: "22.2.5",
636
+ ngImport: i0,
637
+ type: StockReceiptService,
638
+ decorators: [{
639
+ type: Injectable,
640
+ args: [{ providedIn: "root" }]
641
+ }],
642
+ ctorParameters: () => [{ type: i1.HttpService }]
643
+ });
644
+ var StockReceiptSingleProductFormComponent = class StockReceiptSingleProductFormComponent extends TechlifyFormComponent {
645
+ formValidatorService;
646
+ service;
647
+ formBuilder;
648
+ dateUtils;
649
+ locationService;
650
+ dialogRef;
651
+ data;
652
+ product;
653
+ locationsCountValue = 0;
654
+ constructor(formValidatorService, service, formBuilder, dateUtils, locationService, dialogRef, data) {
655
+ super(formValidatorService);
656
+ this.formValidatorService = formValidatorService;
657
+ this.service = service;
658
+ this.formBuilder = formBuilder;
659
+ this.dateUtils = dateUtils;
660
+ this.locationService = locationService;
661
+ this.dialogRef = dialogRef;
662
+ this.data = data;
663
+ this.errorMessages = {
664
+ date: { required: "The date field is required." },
665
+ quantity: { required: "The quantity field is required." },
666
+ purchase_price: { required: "The purchase price field is required." }
667
+ };
668
+ this.form = this.formBuilder.group({
669
+ id: [""],
670
+ product_id: [""],
671
+ supplier_id: [""],
672
+ location_id: [""],
673
+ date: [/* @__PURE__ */ new Date(), Validators.required],
674
+ quantity: [0, Validators.required],
675
+ purchase_price: [0, Validators.required],
676
+ amount: [0],
677
+ particulars: [""],
678
+ batch_number: [""],
679
+ expires_on: [""]
680
+ });
681
+ }
682
+ ngOnInit() {
683
+ this.product = this.data?.product;
684
+ const stockReceipt = this.data?.model;
685
+ this.locationService.count({ status_id: "1" }).subscribe((count) => {
686
+ this.locationsCountValue = count;
687
+ });
688
+ this.form.get("quantity")?.valueChanges.pipe(debounceTime(500)).subscribe(() => this.updateTotalAmount());
689
+ this.form.get("purchase_price")?.valueChanges.pipe(debounceTime(500)).subscribe(() => this.updateTotalAmount());
690
+ if (stockReceipt) {
691
+ this.isUpdate = true;
692
+ const receiptData = { ...stockReceipt };
693
+ if (receiptData.date) receiptData.date = new Date(receiptData.date);
694
+ if (receiptData?.batch) {
695
+ receiptData.batch_number = receiptData.batch?.batch_number;
696
+ receiptData.expires_on = receiptData.batch?.expires_on ? new Date(receiptData.batch.expires_on) : "";
697
+ }
698
+ this.form.patchValue(receiptData);
699
+ const srp = stockReceipt.stock_receipt_products?.[0];
700
+ if (srp) {
701
+ this.product = srp.product;
702
+ this.form.patchValue({
703
+ product_id: srp.product_id,
704
+ quantity: srp.quantity,
705
+ location_id: srp.location_id,
706
+ supplier_id: srp.supplier_id,
707
+ particulars: srp.particulars,
708
+ purchase_price: srp.purchase_price,
709
+ amount: srp.amount
710
+ });
711
+ }
712
+ } else if (this.product?.last_stock_receipt) {
713
+ const { quantity, purchase_price, location_id } = this.product.last_stock_receipt;
714
+ this.form.patchValue({
715
+ quantity: quantity ?? 0,
716
+ purchase_price: purchase_price ?? 0,
717
+ location_id
718
+ });
719
+ }
720
+ }
721
+ get locationsCount() {
722
+ return this.locationsCountValue;
723
+ }
724
+ save() {
725
+ if (this.form.invalid) {
726
+ this.form.markAllAsTouched();
727
+ this.alertService.addAlert("Please check the form for errors", "error");
728
+ return;
729
+ }
730
+ const data = {
731
+ ...this.form.value,
732
+ products: [{
733
+ ...this.form.value,
734
+ with: "batch",
735
+ id: this.product.id,
736
+ product_id: this.product.id
737
+ }]
738
+ };
739
+ if (data.date) data.date = this.dateUtils.getYYYYMMDDString(data.date);
740
+ if (data?.expires_on) data.expires_on = this.dateUtils.getYYYYMMDDString(data.expires_on);
741
+ this.isWorking = true;
742
+ let request = this.service.store(data);
743
+ if (this.isUpdate) request = this.service.update(data);
744
+ request.subscribe({
745
+ next: (response) => {
746
+ this.isWorking = false;
747
+ this.dialogRef.close(response?.item.stock_receipt_products);
748
+ this.alertService.addAlert("Stock Receipt Saved Successfully!", "success");
749
+ },
750
+ error: () => this.isWorking = false
751
+ });
752
+ }
753
+ updateTotalAmount() {
754
+ const { purchase_price, quantity } = this.form.value;
755
+ const amount = parseFloat(purchase_price) * parseFloat(quantity) || 0;
756
+ this.form.get("amount")?.setValue(amount);
757
+ }
758
+ static ɵfac = i0.ɵɵngDeclareFactory({
759
+ minVersion: "12.0.0",
760
+ version: "22.2.5",
761
+ ngImport: i0,
762
+ type: StockReceiptSingleProductFormComponent,
763
+ deps: [
764
+ { token: i1.FormValidatorService },
765
+ { token: StockReceiptService },
766
+ { token: i2$1.FormBuilder },
767
+ { token: i1.DateUtils },
768
+ { token: LocationService },
769
+ {
770
+ token: i4.MatDialogRef,
771
+ optional: true
772
+ },
773
+ {
774
+ token: MAT_DIALOG_DATA,
775
+ optional: true
776
+ }
777
+ ],
778
+ target: i0.ɵɵFactoryTarget.Component
779
+ });
780
+ static ɵcmp = i0.ɵɵngDeclareComponent({
781
+ minVersion: "17.0.0",
782
+ version: "22.2.5",
783
+ type: StockReceiptSingleProductFormComponent,
784
+ isStandalone: true,
785
+ selector: "app-stock-receipt-single-product-form",
786
+ usesInheritance: true,
787
+ ngImport: i0,
788
+ template: "<mat-card-content>\n <h5 class=\"text-center\">\n Stock Receipt Form\n\n @if (data.product) {\n for {{data.product?.name}}\n }\n </h5>\n <form [formGroup]=\"form\" class=\"d-flex flex-column gap-1 justify-content-start\" (submit)=\"save()\">\n <app-payee-selector label=\"Supplier\" formControlName=\"supplier_id\" appearance=\"fill\"\n [showAddButton]=\"true\"></app-payee-selector>\n\n @if (locationsCount > 1) {\n <mat-form-field appearance=\"fill\">\n <mat-label>Location</mat-label>\n <app-searchable-selector formControlName=\"location_id\" apiUrl=\"api/inventory-locations?status_ids=1\"\n [selectedValue]=\"$safeNavigationMigration(data.model?.stock_receipt_products?.[0]?.location)\" titleField=\"title\"></app-searchable-selector>\n </mat-form-field>\n }\n\n <mat-form-field>\n <mat-label>Date</mat-label>\n <input matInput [matDatepicker]=\"datePicker\" formControlName=\"date\" (focus)=\"datePicker.open()\" />\n <mat-datepicker #datePicker></mat-datepicker>\n @if (isFieldValid('date')) {\n <mat-error>\n {{ getErrorMessage('date') }}\n </mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" type=\"number\" min=\"0\" />\n @if (isFieldValid('quantity')) {\n <mat-error>\n {{ getErrorMessage('quantity') }}\n </mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Purchase Price</mat-label>\n <input matInput formControlName=\"purchase_price\" type=\"number\" min=\"0\" />\n @if (isFieldValid('purchase_price')) {\n <mat-error>\n {{ getErrorMessage('purchase_price') }}\n </mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Total Value</mat-label>\n <input matInput formControlName=\"amount\" readonly type=\"number\" min=\"0\" />\n </mat-form-field>\n\n <div techlifyFeatureEnabled=\"product-batch-numbers\" class=\"d-flex flex-column gap-2 w-100\">\n <mat-form-field>\n <mat-label>Batch #</mat-label>\n <input type=\"text\" formControlName=\"batch_number\" matInput placeholder=\"Batch #\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Expires On</mat-label>\n <input matInput [matDatepicker]=\"expiresOnPicker\" formControlName=\"expires_on\"\n (focus)=\"expiresOnPicker.open()\" />\n <mat-datepicker #expiresOnPicker></mat-datepicker>\n </mat-form-field>\n </div>\n\n <mat-form-field>\n <mat-label>Particulars</mat-label>\n <textarea matInput formControlName=\"particulars\" rows=\"3\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2\">\n <button [disabled]=\"isWorking\" mat-raised-button color=\"primary\" type=\"submit\">Save</button>\n <button [disabled]=\"isWorking\" (click)=\"dialogRef.close()\" mat-flat-button type=\"button\">Cancel</button>\n </div>\n </form>\n</mat-card-content>",
789
+ styles: [""],
790
+ dependencies: [
791
+ {
792
+ kind: "ngmodule",
793
+ type: ReactiveFormsModule
794
+ },
795
+ {
796
+ kind: "directive",
797
+ type: i2$1.ɵNgNoValidate,
798
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
799
+ },
800
+ {
801
+ kind: "directive",
802
+ type: i2$1.DefaultValueAccessor,
803
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
804
+ },
805
+ {
806
+ kind: "directive",
807
+ type: i2$1.NumberValueAccessor,
808
+ selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
809
+ },
810
+ {
811
+ kind: "directive",
812
+ type: i2$1.NgControlStatus,
813
+ selector: "[formControlName],[ngModel],[formControl]"
814
+ },
815
+ {
816
+ kind: "directive",
817
+ type: i2$1.NgControlStatusGroup,
818
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
819
+ },
820
+ {
821
+ kind: "directive",
822
+ type: i2$1.MinValidator,
823
+ selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
824
+ inputs: ["min"]
825
+ },
826
+ {
827
+ kind: "directive",
828
+ type: i2$1.FormGroupDirective,
829
+ selector: "[formGroup]",
830
+ inputs: ["formGroup"],
831
+ outputs: ["ngSubmit"],
832
+ exportAs: ["ngForm"]
833
+ },
834
+ {
835
+ kind: "directive",
836
+ type: i2$1.FormControlName,
837
+ selector: "[formControlName]",
838
+ inputs: [
839
+ "formControlName",
840
+ "disabled",
841
+ "ngModel"
842
+ ],
843
+ outputs: ["ngModelChange"]
844
+ },
845
+ {
846
+ kind: "ngmodule",
847
+ type: MaterialModule$1
848
+ },
849
+ {
850
+ kind: "component",
851
+ type: i5$1.MatButton,
852
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
853
+ inputs: ["matButton"],
854
+ exportAs: ["matButton", "matAnchor"]
855
+ },
856
+ {
857
+ kind: "directive",
858
+ type: i6$1.MatCardContent,
859
+ selector: "mat-card-content"
860
+ },
861
+ {
862
+ kind: "component",
863
+ type: i8$1.MatDatepicker,
864
+ selector: "mat-datepicker",
865
+ exportAs: ["matDatepicker"]
866
+ },
867
+ {
868
+ kind: "directive",
869
+ type: i8$1.MatDatepickerInput,
870
+ selector: "input[matDatepicker]",
871
+ inputs: [
872
+ "matDatepicker",
873
+ "min",
874
+ "max",
875
+ "matDatepickerFilter"
876
+ ],
877
+ exportAs: ["matDatepickerInput"]
878
+ },
879
+ {
880
+ kind: "component",
881
+ type: i8$2.MatFormField,
882
+ selector: "mat-form-field",
883
+ inputs: [
884
+ "hideRequiredMarker",
885
+ "color",
886
+ "floatLabel",
887
+ "appearance",
888
+ "subscriptSizing",
889
+ "hintLabel"
890
+ ],
891
+ exportAs: ["matFormField"]
892
+ },
893
+ {
894
+ kind: "directive",
895
+ type: i8$2.MatLabel,
896
+ selector: "mat-label"
897
+ },
898
+ {
899
+ kind: "directive",
900
+ type: i8$2.MatError,
901
+ selector: "mat-error, [matError]",
902
+ inputs: ["id"]
903
+ },
904
+ {
905
+ kind: "directive",
906
+ type: i9$1.MatInput,
907
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
908
+ inputs: [
909
+ "disabled",
910
+ "id",
911
+ "placeholder",
912
+ "name",
913
+ "required",
914
+ "type",
915
+ "errorStateMatcher",
916
+ "aria-describedby",
917
+ "value",
918
+ "readonly",
919
+ "disabledInteractive"
920
+ ],
921
+ exportAs: ["matInput"]
922
+ },
923
+ {
924
+ kind: "ngmodule",
925
+ type: MatDialogModule
926
+ },
927
+ {
928
+ kind: "ngmodule",
929
+ type: PayeeSelectorModule
930
+ },
931
+ {
932
+ kind: "component",
933
+ type: PayeeSelectorComponent,
934
+ selector: "app-payee-selector",
935
+ inputs: [
936
+ "label",
937
+ "appearance",
938
+ "required",
939
+ "showAddButton",
940
+ "multiple"
941
+ ]
942
+ },
943
+ {
944
+ kind: "ngmodule",
945
+ type: SearchableSelectorModule
946
+ },
947
+ {
948
+ kind: "component",
949
+ type: i1.SearchableSelectorComponent,
950
+ selector: "app-searchable-selector",
951
+ inputs: [
952
+ "valueField",
953
+ "titleField",
954
+ "subtitleField",
955
+ "apiUrl",
956
+ "multiple",
957
+ "selectedValue",
958
+ "enableSearch",
959
+ "add",
960
+ "addConfig",
961
+ "edit",
962
+ "editConfig",
963
+ "sort",
964
+ "sortBy",
965
+ "searchField",
966
+ "itemComponent",
967
+ "items",
968
+ "apiDataProperty",
969
+ "cache",
970
+ "perPage",
971
+ "inDataSearch",
972
+ "panelWidth",
973
+ "focusSearchOnOpen",
974
+ "isEmitInitialEvent",
975
+ "required",
976
+ "disabled",
977
+ "value"
978
+ ],
979
+ outputs: [
980
+ "selectedValueChange",
981
+ "selectionChange",
982
+ "itemsChange",
983
+ "isItemsEmpty"
984
+ ]
985
+ },
986
+ {
987
+ kind: "ngmodule",
988
+ type: TechlifyFeatureModule
989
+ },
990
+ {
991
+ kind: "directive",
992
+ type: i1.TechlifyFeatureEnabledDirective,
993
+ selector: "[techlifyFeatureEnabled]",
994
+ inputs: ["techlifyFeatureEnabled"]
995
+ },
996
+ {
997
+ kind: "ngmodule",
998
+ type: TechlifyIconModule
999
+ },
1000
+ {
1001
+ kind: "ngmodule",
1002
+ type: RouterModule
1003
+ }
1004
+ ],
1005
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
1006
+ preserveWhitespaces: true
1007
+ });
1008
+ };
1009
+ i0.ɵɵngDeclareClassMetadata({
1010
+ minVersion: "12.0.0",
1011
+ version: "22.2.5",
1012
+ ngImport: i0,
1013
+ type: StockReceiptSingleProductFormComponent,
1014
+ decorators: [{
1015
+ type: Component,
1016
+ args: [{
1017
+ selector: "app-stock-receipt-single-product-form",
1018
+ changeDetection: ChangeDetectionStrategy.Eager,
1019
+ imports: [
1020
+ ReactiveFormsModule,
1021
+ MaterialModule$1,
1022
+ MatDialogModule,
1023
+ PayeeSelectorModule,
1024
+ SearchableSelectorModule,
1025
+ TechlifyFeatureModule,
1026
+ TechlifyIconModule,
1027
+ RouterModule
1028
+ ],
1029
+ template: "<mat-card-content>\n <h5 class=\"text-center\">\n Stock Receipt Form\n\n @if (data.product) {\n for {{data.product?.name}}\n }\n </h5>\n <form [formGroup]=\"form\" class=\"d-flex flex-column gap-1 justify-content-start\" (submit)=\"save()\">\n <app-payee-selector label=\"Supplier\" formControlName=\"supplier_id\" appearance=\"fill\"\n [showAddButton]=\"true\"></app-payee-selector>\n\n @if (locationsCount > 1) {\n <mat-form-field appearance=\"fill\">\n <mat-label>Location</mat-label>\n <app-searchable-selector formControlName=\"location_id\" apiUrl=\"api/inventory-locations?status_ids=1\"\n [selectedValue]=\"$safeNavigationMigration(data.model?.stock_receipt_products?.[0]?.location)\" titleField=\"title\"></app-searchable-selector>\n </mat-form-field>\n }\n\n <mat-form-field>\n <mat-label>Date</mat-label>\n <input matInput [matDatepicker]=\"datePicker\" formControlName=\"date\" (focus)=\"datePicker.open()\" />\n <mat-datepicker #datePicker></mat-datepicker>\n @if (isFieldValid('date')) {\n <mat-error>\n {{ getErrorMessage('date') }}\n </mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" type=\"number\" min=\"0\" />\n @if (isFieldValid('quantity')) {\n <mat-error>\n {{ getErrorMessage('quantity') }}\n </mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Purchase Price</mat-label>\n <input matInput formControlName=\"purchase_price\" type=\"number\" min=\"0\" />\n @if (isFieldValid('purchase_price')) {\n <mat-error>\n {{ getErrorMessage('purchase_price') }}\n </mat-error>\n }\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Total Value</mat-label>\n <input matInput formControlName=\"amount\" readonly type=\"number\" min=\"0\" />\n </mat-form-field>\n\n <div techlifyFeatureEnabled=\"product-batch-numbers\" class=\"d-flex flex-column gap-2 w-100\">\n <mat-form-field>\n <mat-label>Batch #</mat-label>\n <input type=\"text\" formControlName=\"batch_number\" matInput placeholder=\"Batch #\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Expires On</mat-label>\n <input matInput [matDatepicker]=\"expiresOnPicker\" formControlName=\"expires_on\"\n (focus)=\"expiresOnPicker.open()\" />\n <mat-datepicker #expiresOnPicker></mat-datepicker>\n </mat-form-field>\n </div>\n\n <mat-form-field>\n <mat-label>Particulars</mat-label>\n <textarea matInput formControlName=\"particulars\" rows=\"3\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2\">\n <button [disabled]=\"isWorking\" mat-raised-button color=\"primary\" type=\"submit\">Save</button>\n <button [disabled]=\"isWorking\" (click)=\"dialogRef.close()\" mat-flat-button type=\"button\">Cancel</button>\n </div>\n </form>\n</mat-card-content>"
1030
+ }]
1031
+ }],
1032
+ ctorParameters: () => [
1033
+ { type: i1.FormValidatorService },
1034
+ { type: StockReceiptService },
1035
+ { type: i2$1.FormBuilder },
1036
+ { type: i1.DateUtils },
1037
+ { type: LocationService },
1038
+ {
1039
+ type: i4.MatDialogRef,
1040
+ decorators: [{ type: Optional }]
1041
+ },
1042
+ {
1043
+ type: void 0,
1044
+ decorators: [{
1045
+ type: Inject,
1046
+ args: [MAT_DIALOG_DATA]
1047
+ }, { type: Optional }]
1048
+ }
1049
+ ]
1050
+ });
1051
+ var StockReceiptProductService = class StockReceiptProductService extends TechlifyService {
1052
+ constructor(httpService) {
1053
+ super(httpService, "stock-receipt-products");
1054
+ }
1055
+ static ɵfac = i0.ɵɵngDeclareFactory({
1056
+ minVersion: "12.0.0",
1057
+ version: "22.2.5",
1058
+ ngImport: i0,
1059
+ type: StockReceiptProductService,
1060
+ deps: [{ token: i1.HttpService }],
1061
+ target: i0.ɵɵFactoryTarget.Injectable
1062
+ });
1063
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1064
+ minVersion: "12.0.0",
1065
+ version: "22.2.5",
1066
+ ngImport: i0,
1067
+ type: StockReceiptProductService,
1068
+ providedIn: "root"
1069
+ });
1070
+ };
1071
+ i0.ɵɵngDeclareClassMetadata({
1072
+ minVersion: "12.0.0",
1073
+ version: "22.2.5",
1074
+ ngImport: i0,
1075
+ type: StockReceiptProductService,
1076
+ decorators: [{
1077
+ type: Injectable,
1078
+ args: [{ providedIn: "root" }]
1079
+ }],
1080
+ ctorParameters: () => [{ type: i1.HttpService }]
1081
+ });
1082
+ var StockReceiptProductFormComponent = class StockReceiptProductFormComponent extends TechlifyFormComponent {
1083
+ fb;
1084
+ service;
1085
+ data;
1086
+ constructor(formValidatorService, fb, service, dialogRef, data) {
1087
+ super(formValidatorService);
1088
+ this.fb = fb;
1089
+ this.service = service;
1090
+ this.data = data;
1091
+ this.dialogRef = dialogRef;
1092
+ this.errorMessages = {
1093
+ product_id: { required: "Product is required." },
1094
+ quantity: {
1095
+ required: "Quantity is required.",
1096
+ min: "Quantity must be greater than or equal to 0."
1097
+ },
1098
+ purchase_price: {
1099
+ required: "Purchase price is required.",
1100
+ min: "Purchase price must be at least 0."
1101
+ }
1102
+ };
1103
+ this.form = this.fb.group({
1104
+ id: [""],
1105
+ stock_receipt_id: ["", Validators.required],
1106
+ product_id: ["", Validators.required],
1107
+ quantity: [0, [Validators.required, Validators.min(0)]],
1108
+ purchase_price: [0, [Validators.required, Validators.min(0)]],
1109
+ amount: [{
1110
+ value: 0,
1111
+ disabled: true
1112
+ }],
1113
+ location_id: [""],
1114
+ particulars: [""]
1115
+ });
1116
+ }
1117
+ ngOnInit() {
1118
+ this.form.patchValue({ stock_receipt_id: this.data.stockReceiptId });
1119
+ this.form.get("quantity")?.valueChanges.pipe(debounceTime(300)).subscribe(() => this.updateAmount());
1120
+ this.form.get("purchase_price")?.valueChanges.pipe(debounceTime(300)).subscribe(() => this.updateAmount());
1121
+ const product = this.data.stockReceiptProduct;
1122
+ if (product) {
1123
+ this.isUpdate = true;
1124
+ this.form.patchValue(product);
1125
+ }
1126
+ }
1127
+ updateAmount() {
1128
+ const quantity = this.form.get("quantity")?.value ?? 0;
1129
+ const purchasePrice = this.form.get("purchase_price")?.value ?? 0;
1130
+ this.form.get("amount")?.setValue(parseFloat(quantity) * parseFloat(purchasePrice) || 0);
1131
+ }
1132
+ cancel() {
1133
+ this.dialogRef.close();
1134
+ }
1135
+ static ɵfac = i0.ɵɵngDeclareFactory({
1136
+ minVersion: "12.0.0",
1137
+ version: "22.2.5",
1138
+ ngImport: i0,
1139
+ type: StockReceiptProductFormComponent,
1140
+ deps: [
1141
+ { token: i1.FormValidatorService },
1142
+ { token: i2$1.FormBuilder },
1143
+ { token: StockReceiptProductService },
1144
+ { token: i4.MatDialogRef },
1145
+ { token: MAT_DIALOG_DATA }
1146
+ ],
1147
+ target: i0.ɵɵFactoryTarget.Component
1148
+ });
1149
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1150
+ minVersion: "17.0.0",
1151
+ version: "22.2.5",
1152
+ type: StockReceiptProductFormComponent,
1153
+ isStandalone: true,
1154
+ selector: "app-stock-receipt-product-form",
1155
+ usesInheritance: true,
1156
+ ngImport: i0,
1157
+ template: "<h3 mat-dialog-title class='text-center'>Stock Receipt Product Form</h3>\n\n<mat-dialog-content>\n <form [formGroup]=\"form\" (submit)=\"submit(form.getRawValue())\" class=\"d-flex flex-column gap-3 mt-2\">\n\n <mat-form-field class=\"w-100\">\n <mat-label>Product</mat-label>\n <app-searchable-selector formControlName=\"product_id\" apiUrl=\"api/products\" titleField=\"name\"\n [selectedValue]=\"data.stockReceiptProduct.product\" [cache]=\"true\"></app-searchable-selector>\n @if (isFieldValid('product_id')) {\n <mat-error>{{ getErrorMessage('product_id') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Quantity</mat-label>\n <input matInput type=\"number\" formControlName=\"quantity\" min=\"0\" step=\"any\">\n @if (isFieldValid('quantity')) {\n <mat-error>{{ getErrorMessage('quantity') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Purchase Price</mat-label>\n <input matInput type=\"number\" formControlName=\"purchase_price\" min=\"0\" step=\"any\">\n @if (isFieldValid('purchase_price')) {\n <mat-error>{{ getErrorMessage('purchase_price') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Total Amount</mat-label>\n <input matInput type=\"number\" formControlName=\"amount\">\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Location</mat-label>\n <app-searchable-selector formControlName=\"location_id\" apiUrl=\"api/inventory-locations?status_ids=1\"\n [selectedValue]=\"data.stockReceiptProduct.location\" titleField=\"title\"></app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Particulars</mat-label>\n <textarea matInput formControlName=\"particulars\" rows=\"3\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end gap-2\">\n <button mat-flat-button type=\"button\" [disabled]=\"isWorking\" (click)=\"cancel()\">Cancel</button>\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"isWorking\">Save</button>\n </div>\n\n </form>\n</mat-dialog-content>\n",
1158
+ dependencies: [
1159
+ {
1160
+ kind: "ngmodule",
1161
+ type: ReactiveFormsModule
1162
+ },
1163
+ {
1164
+ kind: "directive",
1165
+ type: i2$1.ɵNgNoValidate,
1166
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
1167
+ },
1168
+ {
1169
+ kind: "directive",
1170
+ type: i2$1.DefaultValueAccessor,
1171
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
1172
+ },
1173
+ {
1174
+ kind: "directive",
1175
+ type: i2$1.NumberValueAccessor,
1176
+ selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
1177
+ },
1178
+ {
1179
+ kind: "directive",
1180
+ type: i2$1.NgControlStatus,
1181
+ selector: "[formControlName],[ngModel],[formControl]"
1182
+ },
1183
+ {
1184
+ kind: "directive",
1185
+ type: i2$1.NgControlStatusGroup,
1186
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
1187
+ },
1188
+ {
1189
+ kind: "directive",
1190
+ type: i2$1.MinValidator,
1191
+ selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
1192
+ inputs: ["min"]
1193
+ },
1194
+ {
1195
+ kind: "directive",
1196
+ type: i2$1.FormGroupDirective,
1197
+ selector: "[formGroup]",
1198
+ inputs: ["formGroup"],
1199
+ outputs: ["ngSubmit"],
1200
+ exportAs: ["ngForm"]
1201
+ },
1202
+ {
1203
+ kind: "directive",
1204
+ type: i2$1.FormControlName,
1205
+ selector: "[formControlName]",
1206
+ inputs: [
1207
+ "formControlName",
1208
+ "disabled",
1209
+ "ngModel"
1210
+ ],
1211
+ outputs: ["ngModelChange"]
1212
+ },
1213
+ {
1214
+ kind: "ngmodule",
1215
+ type: MaterialModule$1
1216
+ },
1217
+ {
1218
+ kind: "component",
1219
+ type: i5$1.MatButton,
1220
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
1221
+ inputs: ["matButton"],
1222
+ exportAs: ["matButton", "matAnchor"]
1223
+ },
1224
+ {
1225
+ kind: "directive",
1226
+ type: i4.MatDialogTitle,
1227
+ selector: "[mat-dialog-title], [matDialogTitle]",
1228
+ inputs: ["id"],
1229
+ exportAs: ["matDialogTitle"]
1230
+ },
1231
+ {
1232
+ kind: "directive",
1233
+ type: i4.MatDialogContent,
1234
+ selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]"
1235
+ },
1236
+ {
1237
+ kind: "component",
1238
+ type: i8$2.MatFormField,
1239
+ selector: "mat-form-field",
1240
+ inputs: [
1241
+ "hideRequiredMarker",
1242
+ "color",
1243
+ "floatLabel",
1244
+ "appearance",
1245
+ "subscriptSizing",
1246
+ "hintLabel"
1247
+ ],
1248
+ exportAs: ["matFormField"]
1249
+ },
1250
+ {
1251
+ kind: "directive",
1252
+ type: i8$2.MatLabel,
1253
+ selector: "mat-label"
1254
+ },
1255
+ {
1256
+ kind: "directive",
1257
+ type: i8$2.MatError,
1258
+ selector: "mat-error, [matError]",
1259
+ inputs: ["id"]
1260
+ },
1261
+ {
1262
+ kind: "directive",
1263
+ type: i9$1.MatInput,
1264
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
1265
+ inputs: [
1266
+ "disabled",
1267
+ "id",
1268
+ "placeholder",
1269
+ "name",
1270
+ "required",
1271
+ "type",
1272
+ "errorStateMatcher",
1273
+ "aria-describedby",
1274
+ "value",
1275
+ "readonly",
1276
+ "disabledInteractive"
1277
+ ],
1278
+ exportAs: ["matInput"]
1279
+ },
1280
+ {
1281
+ kind: "ngmodule",
1282
+ type: SearchableSelectorModule
1283
+ },
1284
+ {
1285
+ kind: "component",
1286
+ type: i1.SearchableSelectorComponent,
1287
+ selector: "app-searchable-selector",
1288
+ inputs: [
1289
+ "valueField",
1290
+ "titleField",
1291
+ "subtitleField",
1292
+ "apiUrl",
1293
+ "multiple",
1294
+ "selectedValue",
1295
+ "enableSearch",
1296
+ "add",
1297
+ "addConfig",
1298
+ "edit",
1299
+ "editConfig",
1300
+ "sort",
1301
+ "sortBy",
1302
+ "searchField",
1303
+ "itemComponent",
1304
+ "items",
1305
+ "apiDataProperty",
1306
+ "cache",
1307
+ "perPage",
1308
+ "inDataSearch",
1309
+ "panelWidth",
1310
+ "focusSearchOnOpen",
1311
+ "isEmitInitialEvent",
1312
+ "required",
1313
+ "disabled",
1314
+ "value"
1315
+ ],
1316
+ outputs: [
1317
+ "selectedValueChange",
1318
+ "selectionChange",
1319
+ "itemsChange",
1320
+ "isItemsEmpty"
1321
+ ]
1322
+ }
1323
+ ],
1324
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
1325
+ preserveWhitespaces: true
1326
+ });
1327
+ };
1328
+ i0.ɵɵngDeclareClassMetadata({
1329
+ minVersion: "12.0.0",
1330
+ version: "22.2.5",
1331
+ ngImport: i0,
1332
+ type: StockReceiptProductFormComponent,
1333
+ decorators: [{
1334
+ type: Component,
1335
+ args: [{
1336
+ selector: "app-stock-receipt-product-form",
1337
+ changeDetection: ChangeDetectionStrategy.Eager,
1338
+ imports: [
1339
+ ReactiveFormsModule,
1340
+ MaterialModule$1,
1341
+ SearchableSelectorModule,
1342
+ MatDialogTitle,
1343
+ MatDialogContent
1344
+ ],
1345
+ template: "<h3 mat-dialog-title class='text-center'>Stock Receipt Product Form</h3>\n\n<mat-dialog-content>\n <form [formGroup]=\"form\" (submit)=\"submit(form.getRawValue())\" class=\"d-flex flex-column gap-3 mt-2\">\n\n <mat-form-field class=\"w-100\">\n <mat-label>Product</mat-label>\n <app-searchable-selector formControlName=\"product_id\" apiUrl=\"api/products\" titleField=\"name\"\n [selectedValue]=\"data.stockReceiptProduct.product\" [cache]=\"true\"></app-searchable-selector>\n @if (isFieldValid('product_id')) {\n <mat-error>{{ getErrorMessage('product_id') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Quantity</mat-label>\n <input matInput type=\"number\" formControlName=\"quantity\" min=\"0\" step=\"any\">\n @if (isFieldValid('quantity')) {\n <mat-error>{{ getErrorMessage('quantity') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Purchase Price</mat-label>\n <input matInput type=\"number\" formControlName=\"purchase_price\" min=\"0\" step=\"any\">\n @if (isFieldValid('purchase_price')) {\n <mat-error>{{ getErrorMessage('purchase_price') }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Total Amount</mat-label>\n <input matInput type=\"number\" formControlName=\"amount\">\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Location</mat-label>\n <app-searchable-selector formControlName=\"location_id\" apiUrl=\"api/inventory-locations?status_ids=1\"\n [selectedValue]=\"data.stockReceiptProduct.location\" titleField=\"title\"></app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Particulars</mat-label>\n <textarea matInput formControlName=\"particulars\" rows=\"3\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end gap-2\">\n <button mat-flat-button type=\"button\" [disabled]=\"isWorking\" (click)=\"cancel()\">Cancel</button>\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"isWorking\">Save</button>\n </div>\n\n </form>\n</mat-dialog-content>\n"
1346
+ }]
1347
+ }],
1348
+ ctorParameters: () => [
1349
+ { type: i1.FormValidatorService },
1350
+ { type: i2$1.FormBuilder },
1351
+ { type: StockReceiptProductService },
1352
+ { type: i4.MatDialogRef },
1353
+ {
1354
+ type: void 0,
1355
+ decorators: [{
1356
+ type: Inject,
1357
+ args: [MAT_DIALOG_DATA]
1358
+ }]
1359
+ }
1360
+ ]
1361
+ });
1362
+ var StockReceiptProductFormButtonComponent = class StockReceiptProductFormButtonComponent {
1363
+ dialog;
1364
+ stockReceiptProduct = input(...ngDevMode ? [void 0, { debugName: "stockReceiptProduct" }] : /* istanbul ignore next */ []);
1365
+ stockReceiptId = input.required(...ngDevMode ? [{ debugName: "stockReceiptId" }] : /* istanbul ignore next */ []);
1366
+ saved = output();
1367
+ constructor(dialog) {
1368
+ this.dialog = dialog;
1369
+ }
1370
+ open() {
1371
+ this.dialog.open(StockReceiptProductFormComponent, {
1372
+ width: "500px",
1373
+ data: {
1374
+ stockReceiptId: this.stockReceiptId(),
1375
+ stockReceiptProduct: this.stockReceiptProduct()
1376
+ }
1377
+ }).afterClosed().subscribe((item) => {
1378
+ if (item) this.saved.emit(item);
1379
+ });
1380
+ }
1381
+ static ɵfac = i0.ɵɵngDeclareFactory({
1382
+ minVersion: "12.0.0",
1383
+ version: "22.2.5",
1384
+ ngImport: i0,
1385
+ type: StockReceiptProductFormButtonComponent,
1386
+ deps: [{ token: i4.MatDialog }],
1387
+ target: i0.ɵɵFactoryTarget.Component
1388
+ });
1389
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1390
+ minVersion: "17.1.0",
1391
+ version: "22.2.5",
1392
+ type: StockReceiptProductFormButtonComponent,
1393
+ isStandalone: true,
1394
+ selector: "app-stock-receipt-product-form-button",
1395
+ inputs: {
1396
+ stockReceiptProduct: {
1397
+ classPropertyName: "stockReceiptProduct",
1398
+ publicName: "stockReceiptProduct",
1399
+ isSignal: true,
1400
+ isRequired: false,
1401
+ transformFunction: null
1402
+ },
1403
+ stockReceiptId: {
1404
+ classPropertyName: "stockReceiptId",
1405
+ publicName: "stockReceiptId",
1406
+ isSignal: true,
1407
+ isRequired: true,
1408
+ transformFunction: null
1409
+ }
1410
+ },
1411
+ outputs: { saved: "saved" },
1412
+ ngImport: i0,
1413
+ template: "<app-techlify-icon role=\"button\" [name]=\"stockReceiptProduct() ? 'edit' : 'add'\" (click)=\"open()\">\n</app-techlify-icon>",
1414
+ dependencies: [{
1415
+ kind: "ngmodule",
1416
+ type: TechlifyIconModule
1417
+ }, {
1418
+ kind: "component",
1419
+ type: i1.TechlifyIconComponent,
1420
+ selector: "app-techlify-icon",
1421
+ inputs: ["name", "size"]
1422
+ }],
1423
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
1424
+ preserveWhitespaces: true
1425
+ });
1426
+ };
1427
+ i0.ɵɵngDeclareClassMetadata({
1428
+ minVersion: "12.0.0",
1429
+ version: "22.2.5",
1430
+ ngImport: i0,
1431
+ type: StockReceiptProductFormButtonComponent,
1432
+ decorators: [{
1433
+ type: Component,
1434
+ args: [{
1435
+ selector: "app-stock-receipt-product-form-button",
1436
+ changeDetection: ChangeDetectionStrategy.Eager,
1437
+ imports: [TechlifyIconModule],
1438
+ template: "<app-techlify-icon role=\"button\" [name]=\"stockReceiptProduct() ? 'edit' : 'add'\" (click)=\"open()\">\n</app-techlify-icon>"
1439
+ }]
1440
+ }],
1441
+ ctorParameters: () => [{ type: i4.MatDialog }],
1442
+ propDecorators: {
1443
+ stockReceiptProduct: [{
1444
+ type: i0.Input,
1445
+ args: [{
1446
+ isSignal: true,
1447
+ alias: "stockReceiptProduct",
1448
+ required: false
1449
+ }]
1450
+ }],
1451
+ stockReceiptId: [{
1452
+ type: i0.Input,
1453
+ args: [{
1454
+ isSignal: true,
1455
+ alias: "stockReceiptId",
1456
+ required: true
1457
+ }]
1458
+ }],
1459
+ saved: [{
1460
+ type: i0.Output,
1461
+ args: ["saved"]
1462
+ }]
1463
+ }
1464
+ });
1465
+ let StockReceiptProductsListComponent = class StockReceiptProductsListComponent extends TechlifyListComponent {
1466
+ service;
1467
+ formBuilder;
1468
+ featureService;
1469
+ filtersInput = input({}, {
1470
+ ...ngDevMode ? { debugName: "filtersInput" } : /* istanbul ignore next */ {},
1471
+ alias: "filters"
1472
+ });
1473
+ isProductView = input(false, ...ngDevMode ? [{ debugName: "isProductView" }] : /* istanbul ignore next */ []);
1474
+ selectedColumns = input([], ...ngDevMode ? [{ debugName: "selectedColumns" }] : /* istanbul ignore next */ []);
1475
+ exportInProgress = input(false, ...ngDevMode ? [{ debugName: "exportInProgress" }] : /* istanbul ignore next */ []);
1476
+ listUpdated = output();
1477
+ columnConfigReady = output();
1478
+ product = input(null, ...ngDevMode ? [{ debugName: "product" }] : /* istanbul ignore next */ []);
1479
+ stockReceiptSingleProductForm = signal(StockReceiptSingleProductFormComponent, ...ngDevMode ? [{ debugName: "stockReceiptSingleProductForm" }] : /* istanbul ignore next */ []);
1480
+ productViewHiddenColumns = [
1481
+ "product",
1482
+ "sku",
1483
+ "measure"
1484
+ ];
1485
+ _defaultSelectedColumns = [];
1486
+ columnConfig = [
1487
+ {
1488
+ label: "#",
1489
+ def: "no",
1490
+ isSelected: true,
1491
+ isEditable: false
1492
+ },
1493
+ {
1494
+ label: "Receipt #",
1495
+ def: "receipt_number",
1496
+ isSelected: true,
1497
+ isEditable: false
1498
+ },
1499
+ {
1500
+ label: "Product",
1501
+ def: "product",
1502
+ isSelected: true,
1503
+ isEditable: false
1504
+ },
1505
+ {
1506
+ label: "Product Categories",
1507
+ def: "product_categories",
1508
+ isSelected: false,
1509
+ isEditable: true,
1510
+ isExportable: false
1511
+ },
1512
+ {
1513
+ label: "Categories",
1514
+ def: "categories",
1515
+ isSelected: false,
1516
+ isEditable: false,
1517
+ isExportable: true
1518
+ },
1519
+ {
1520
+ label: "SKU",
1521
+ def: "sku",
1522
+ isSelected: true,
1523
+ isEditable: false
1524
+ },
1525
+ {
1526
+ label: "Date",
1527
+ def: "date",
1528
+ isSelected: true,
1529
+ isEditable: false
1530
+ },
1531
+ {
1532
+ label: "Quantity",
1533
+ def: "quantity",
1534
+ isSelected: true,
1535
+ isEditable: false
1536
+ },
1537
+ {
1538
+ label: "Measure",
1539
+ def: "measure",
1540
+ isSelected: true,
1541
+ isEditable: true
1542
+ },
1543
+ {
1544
+ label: "Location",
1545
+ def: "location",
1546
+ isSelected: true,
1547
+ isEditable: false
1548
+ },
1549
+ {
1550
+ label: "Purchase Price",
1551
+ def: "purchase_price",
1552
+ isSelected: true,
1553
+ isEditable: false
1554
+ },
1555
+ {
1556
+ label: "Total Value",
1557
+ def: "amount",
1558
+ isSelected: true,
1559
+ isEditable: false
1560
+ },
1561
+ {
1562
+ label: "Supplier",
1563
+ def: "supplier",
1564
+ isSelected: true,
1565
+ isEditable: false
1566
+ },
1567
+ {
1568
+ label: "Supplier Contact",
1569
+ def: "supplier_contact",
1570
+ isSelected: false,
1571
+ isEditable: true
1572
+ },
1573
+ {
1574
+ label: "Supplier Phone",
1575
+ def: "supplier_phone",
1576
+ isSelected: false,
1577
+ isEditable: true
1578
+ },
1579
+ {
1580
+ label: "Particulars",
1581
+ def: "particulars",
1582
+ isSelected: true,
1583
+ isEditable: false
1584
+ },
1585
+ {
1586
+ label: "Creator",
1587
+ def: "creator",
1588
+ isSelected: false,
1589
+ isEditable: true
1590
+ },
1591
+ {
1592
+ label: "Actions",
1593
+ def: "actions",
1594
+ isSelected: true,
1595
+ isEditable: false,
1596
+ isExportable: false
1597
+ }
1598
+ ];
1599
+ get displayedColumns() {
1600
+ const cols = this.selectedColumns().length > 0 ? this.selectedColumns() : this._defaultSelectedColumns;
1601
+ const selectedDefs = new Set(cols.map((col) => col.def));
1602
+ return this.columnConfig.filter((col) => {
1603
+ if (this.isProductView() && this.productViewHiddenColumns.includes(col.def)) return false;
1604
+ if (this.exportInProgress()) {
1605
+ if (col.isExportable === true) return true;
1606
+ if (col.isExportable === false) return false;
1607
+ }
1608
+ return selectedDefs.has(col.def);
1609
+ }).map((col) => col.def);
1610
+ }
1611
+ get totalPurchasePrice() {
1612
+ return this.models.reduce((sum, model) => sum + Number(model?.purchase_price ?? 0), 0);
1613
+ }
1614
+ get totalValue() {
1615
+ return this.models.reduce((sum, model) => sum + Number(model?.amount ?? 0), 0);
1616
+ }
1617
+ get footerColumns() {
1618
+ return this.displayedColumns.map((col) => `footer-${col}`);
1619
+ }
1620
+ constructor(service, formBuilder, featureService) {
1621
+ super();
1622
+ this.service = service;
1623
+ this.formBuilder = formBuilder;
1624
+ this.featureService = featureService;
1625
+ this.filterFormConfiguration = {
1626
+ date_from: { date: true },
1627
+ date_to: { date: true },
1628
+ category_ids: { multiple: true },
1629
+ supplier_ids: { multiple: true },
1630
+ location_ids: { multiple: true },
1631
+ measure_ids: { multiple: true },
1632
+ product_ids: { multiple: true }
1633
+ };
1634
+ this.filterForm = this.formBuilder.group({
1635
+ category_ids: [""],
1636
+ date_from: [""],
1637
+ date_to: [""],
1638
+ duration: [""],
1639
+ location_ids: [""],
1640
+ measure_ids: [""],
1641
+ product_ids: [""],
1642
+ search: [""],
1643
+ sort_by: ["date|desc"],
1644
+ supplier_ids: [""],
1645
+ page: this.page,
1646
+ perPage: this.perPage
1647
+ });
1648
+ let initialized = false;
1649
+ effect(() => {
1650
+ const filters = this.filtersInput();
1651
+ if (!initialized) {
1652
+ initialized = true;
1653
+ return;
1654
+ }
1655
+ this.filterForm.patchValue(filters, { emitEvent: true });
1656
+ });
1657
+ }
1658
+ ngOnInit() {
1659
+ this.loadFeatures();
1660
+ this._defaultSelectedColumns = this.columnConfig.filter((col) => col.isSelected);
1661
+ queueMicrotask(() => this.columnConfigReady.emit(this.columnConfig));
1662
+ const initialFilters = this.filtersInput();
1663
+ if (initialFilters) this.filterForm.patchValue(initialFilters, { emitEvent: false });
1664
+ this.patchFiltersFromRoute();
1665
+ this.listenFilterChanges();
1666
+ this.loadData();
1667
+ }
1668
+ loadFeatures() {
1669
+ if (this.featureService.isFeatureExists("product-batch-numbers")) {
1670
+ const qtyIndex = this.columnConfig.findIndex((c) => c.def === "quantity");
1671
+ if (qtyIndex >= 0) this.columnConfig.splice(qtyIndex + 1, 0, {
1672
+ label: "Batch",
1673
+ def: "batch",
1674
+ isSelected: true,
1675
+ isEditable: false
1676
+ });
1677
+ }
1678
+ }
1679
+ static ɵfac = i0.ɵɵngDeclareFactory({
1680
+ minVersion: "12.0.0",
1681
+ version: "22.2.5",
1682
+ ngImport: i0,
1683
+ type: StockReceiptProductsListComponent,
1684
+ deps: [
1685
+ { token: StockReceiptProductService },
1686
+ { token: i2$1.FormBuilder },
1687
+ { token: i1.TechlifyFeatureService }
1688
+ ],
1689
+ target: i0.ɵɵFactoryTarget.Component
1690
+ });
1691
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1692
+ minVersion: "17.0.0",
1693
+ version: "22.2.5",
1694
+ type: StockReceiptProductsListComponent,
1695
+ isStandalone: false,
1696
+ selector: "app-stock-receipt-product-list",
1697
+ inputs: {
1698
+ filtersInput: {
1699
+ classPropertyName: "filtersInput",
1700
+ publicName: "filters",
1701
+ isSignal: true,
1702
+ isRequired: false,
1703
+ transformFunction: null
1704
+ },
1705
+ isProductView: {
1706
+ classPropertyName: "isProductView",
1707
+ publicName: "isProductView",
1708
+ isSignal: true,
1709
+ isRequired: false,
1710
+ transformFunction: null
1711
+ },
1712
+ selectedColumns: {
1713
+ classPropertyName: "selectedColumns",
1714
+ publicName: "selectedColumns",
1715
+ isSignal: true,
1716
+ isRequired: false,
1717
+ transformFunction: null
1718
+ },
1719
+ exportInProgress: {
1720
+ classPropertyName: "exportInProgress",
1721
+ publicName: "exportInProgress",
1722
+ isSignal: true,
1723
+ isRequired: false,
1724
+ transformFunction: null
1725
+ },
1726
+ product: {
1727
+ classPropertyName: "product",
1728
+ publicName: "product",
1729
+ isSignal: true,
1730
+ isRequired: false,
1731
+ transformFunction: null
1732
+ }
1733
+ },
1734
+ outputs: {
1735
+ listUpdated: "listUpdated",
1736
+ columnConfigReady: "columnConfigReady"
1737
+ },
1738
+ usesInheritance: true,
1739
+ ngImport: i0,
1740
+ template: "<mat-card>\n @if (isProductView()) {\n <mat-card-header class=\"d-flex align-items-center gap-2\">\n <mat-card-title>Stock Receipts</mat-card-title>\n <app-techlify-form-button [component]=\"stockReceiptSingleProductForm()\" [data]=\"{product: product()}\" width=\"500px\"\n (saved)=\"modelCreated($event); listUpdated.emit(true)\"\n ></app-techlify-form-button>\n </mat-card-header>\n }\n\n <mat-card-content class=\"p-0\">\n <table mat-table [dataSource]=\"models\" class=\"w-100\" aria-describedby=\"Stock Receipt Products\" infiniteScroll\n id=\"stockReceiptTable\" [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" matSort\n (matSortChange)=\"sortColumn($event)\">\n\n <!-- # Column -->\n <ng-container matColumnDef=\"no\">\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 <ng-container matColumnDef=\"receipt_number\">\n <th mat-header-cell *matHeaderCellDef matTooltip=\"Stock Receipt ID\">Receipt #</th>\n <td mat-cell *matCellDef=\"let element\">\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/stock-receipts', $safeNavigationMigration(element?.stock_receipt_id), 'view']\">\n {{ element?.stock_receipt_id }} <i class=\"fa-solid fa-up-right-from-square\"></i>\n </a>\n </td>\n </ng-container>\n\n <!-- Product Column -->\n <ng-container matColumnDef=\"product\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/products', $safeNavigationMigration(element?.product?.id), 'view']\">\n {{ element?.product?.name }}\n </a>\n </td>\n </ng-container>\n\n <!-- Product Categories Column -->\n <ng-container matColumnDef=\"product_categories\">\n <th mat-header-cell *matHeaderCellDef>Product Categories</th>\n <td mat-cell *matCellDef=\"let element\">\n <app-product-category-badges [product]=\"$safeNavigationMigration(element?.product)\"></app-product-category-badges>\n </td>\n </ng-container>\n\n <!-- Categories Column (export only) -->\n <ng-container matColumnDef=\"categories\">\n <th mat-header-cell *matHeaderCellDef>Categories</th>\n <td mat-cell *matCellDef=\"let element\">\n @for (category of element?.product?.categories; track category; let\n last = $last) {\n <span> {{ category?.title }}@if (!last) { , } </span>\n }\n </td>\n </ng-container>\n\n <!-- SKU Column -->\n <ng-container matColumnDef=\"sku\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>SKU</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.product?.sku }}</td>\n </ng-container>\n\n <!-- Date Column -->\n <ng-container matColumnDef=\"date\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Date</th>\n <td mat-cell *matCellDef=\"let element\">{{ $safeNavigationMigration(element?.stock_receipt?.date) | date }}</td>\n </ng-container>\n\n <!-- Quantity Column -->\n <ng-container matColumnDef=\"quantity\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Quantity</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.quantity }} {{ element?.product?.measure?.title }}\n </td>\n </ng-container>\n\n <!-- Batch Column -->\n <ng-container matColumnDef=\"batch\">\n <th mat-header-cell *matHeaderCellDef>Batch</th>\n <td mat-cell *matCellDef=\"let element\">\n @if (element?.batch?.batch_number) {\n <p class=\"mb-0\">{{ element?.batch?.batch_number }}</p>\n } @if (element?.batch?.expires_on) {\n <small class=\"text-secondary\">\n Expires\n {{ $safeNavigationMigration(element?.batch?.expires_on) | date }}\n </small>\n }\n </td>\n </ng-container>\n\n <!-- Measure Column -->\n <ng-container matColumnDef=\"measure\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Measure</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.product?.measure?.title }}</td>\n </ng-container>\n\n <!-- Location Column -->\n <ng-container matColumnDef=\"location\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Location</th>\n <td mat-cell *matCellDef=\"let element\">\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/locations', $safeNavigationMigration(element?.location_id), 'view']\">\n {{ element?.location?.title }}\n </a>\n </td>\n </ng-container>\n\n <!-- Purchase Price Column -->\n <ng-container matColumnDef=\"purchase_price\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Purchase Price</th>\n <td mat-cell *matCellDef=\"let element\">{{ $safeNavigationMigration(element?.purchase_price) | currency }}</td>\n </ng-container>\n\n <!-- Total Value Column -->\n <ng-container matColumnDef=\"amount\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Total Value</th>\n <td mat-cell *matCellDef=\"let element\">{{ $safeNavigationMigration(element?.amount) | currency }}</td>\n </ng-container>\n\n <!-- Particulars Column -->\n <ng-container matColumnDef=\"particulars\">\n <th mat-header-cell *matHeaderCellDef>Particulars</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.particulars }}</td>\n </ng-container>\n\n <!-- Supplier Column -->\n <ng-container matColumnDef=\"supplier\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Supplier</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt?.supplier?.company_name }}</td>\n </ng-container>\n\n <!-- Supplier Contact Column -->\n <ng-container matColumnDef=\"supplier_contact\">\n <th mat-header-cell *matHeaderCellDef>Supplier Contact</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt?.supplier?.contact_name }}</td>\n </ng-container>\n\n <!-- Supplier Phone Column -->\n <ng-container matColumnDef=\"supplier_phone\">\n <th mat-header-cell *matHeaderCellDef>Supplier Phone</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt?.supplier?.phone }}</td>\n </ng-container>\n\n <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-1\">{{ element?.stock_receipt?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ $safeNavigationMigration(element?.stock_receipt?.created_at) | date }}</small>\n </td>\n </ng-container>\n\n <!-- Actions Column -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef>Actions</th>\n <td mat-cell *matCellDef=\"let element\">\n\n @if (element?.stock_receipt?.stock_transfer) {\n <span class=\"badge rounded-pill text-bg-secondary\">Stock Transfer</span>\n } @else {\n <div class=\"d-flex gap-1 text-secondary\">\n <app-techlify-icon role='button' name='view' class='text-secondary'\n [routerLink]=\"['/inventory', 'stock-receipts', 'products', $safeNavigationMigration(element?.id), 'view']\"></app-techlify-icon>\n <app-stock-receipt-product-form-button [stockReceiptId]=\"$safeNavigationMigration(element?.stock_receipt_id)\"\n [stockReceiptProduct]=\"element\" (saved)=\"reload(); listUpdated.emit(true)\">\n </app-stock-receipt-product-form-button>\n <app-techlify-delete-button [model]=\"element\" [service]=\"service\"\n [data]=\"{ title: $safeNavigationMigration(element?.product?.name), type: 'Stock Receipt Product' }\"\n (deleted)=\"reload(); listUpdated.emit(true)\">\n </app-techlify-delete-button>\n </div>\n }\n </td>\n </ng-container>\n\n <!-- Footer Cells for Total Row -->\n <ng-container matColumnDef=\"footer-no\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-receipt_number\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-product\">\n <td mat-footer-cell *matFooterCellDef><strong>Total</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-product_categories\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-sku\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-categories\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-date\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-quantity\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-batch\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-measure\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-location\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-purchase_price\">\n <td mat-footer-cell *matFooterCellDef><strong>{{ totalPurchasePrice | currency }}</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-amount\">\n <td mat-footer-cell *matFooterCellDef><strong>{{ totalValue | currency }}</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-particulars\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier_contact\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier_phone\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-creator\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-actions\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n <tr mat-footer-row *matFooterRowDef=\"footerColumns\"></tr>\n </table>\n\n @if (isWorking) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </mat-card-content>\n</mat-card>",
1741
+ styles: [":host ::ng-deep .mat-mdc-footer-row{position:sticky;bottom:0;background-color:#fff;z-index:10;box-shadow:0 -2px 4px #0000001a}\n"],
1742
+ dependencies: [
1743
+ {
1744
+ kind: "component",
1745
+ type: i6$1.MatCard,
1746
+ selector: "mat-card",
1747
+ inputs: ["appearance"],
1748
+ exportAs: ["matCard"]
1749
+ },
1750
+ {
1751
+ kind: "directive",
1752
+ type: i6$1.MatCardContent,
1753
+ selector: "mat-card-content"
1754
+ },
1755
+ {
1756
+ kind: "component",
1757
+ type: i6$1.MatCardHeader,
1758
+ selector: "mat-card-header"
1759
+ },
1760
+ {
1761
+ kind: "directive",
1762
+ type: i6$1.MatCardTitle,
1763
+ selector: "mat-card-title, [mat-card-title], [matCardTitle]"
1764
+ },
1765
+ {
1766
+ kind: "component",
1767
+ type: i5.MatProgressBar,
1768
+ selector: "mat-progress-bar",
1769
+ inputs: [
1770
+ "color",
1771
+ "value",
1772
+ "bufferValue",
1773
+ "mode"
1774
+ ],
1775
+ outputs: ["animationEnd"],
1776
+ exportAs: ["matProgressBar"]
1777
+ },
1778
+ {
1779
+ kind: "directive",
1780
+ type: i6.MatSort,
1781
+ selector: "[matSort]",
1782
+ inputs: [
1783
+ "matSortActive",
1784
+ "matSortStart",
1785
+ "matSortDirection",
1786
+ "matSortDisableClear",
1787
+ "matSortDisabled"
1788
+ ],
1789
+ outputs: ["matSortChange"],
1790
+ exportAs: ["matSort"]
1791
+ },
1792
+ {
1793
+ kind: "component",
1794
+ type: i6.MatSortHeader,
1795
+ selector: "[mat-sort-header]",
1796
+ inputs: [
1797
+ "mat-sort-header",
1798
+ "arrowPosition",
1799
+ "start",
1800
+ "disabled",
1801
+ "sortActionDescription",
1802
+ "disableClear"
1803
+ ],
1804
+ exportAs: ["matSortHeader"]
1805
+ },
1806
+ {
1807
+ kind: "component",
1808
+ type: i7.MatTable,
1809
+ selector: "mat-table, table[mat-table]",
1810
+ exportAs: ["matTable"]
1811
+ },
1812
+ {
1813
+ kind: "directive",
1814
+ type: i7.MatHeaderCellDef,
1815
+ selector: "[matHeaderCellDef]"
1816
+ },
1817
+ {
1818
+ kind: "directive",
1819
+ type: i7.MatHeaderRowDef,
1820
+ selector: "[matHeaderRowDef]",
1821
+ inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"]
1822
+ },
1823
+ {
1824
+ kind: "directive",
1825
+ type: i7.MatColumnDef,
1826
+ selector: "[matColumnDef]",
1827
+ inputs: ["matColumnDef"]
1828
+ },
1829
+ {
1830
+ kind: "directive",
1831
+ type: i7.MatCellDef,
1832
+ selector: "[matCellDef]"
1833
+ },
1834
+ {
1835
+ kind: "directive",
1836
+ type: i7.MatRowDef,
1837
+ selector: "[matRowDef]",
1838
+ inputs: ["matRowDefColumns", "matRowDefWhen"]
1839
+ },
1840
+ {
1841
+ kind: "directive",
1842
+ type: i7.MatFooterCellDef,
1843
+ selector: "[matFooterCellDef]"
1844
+ },
1845
+ {
1846
+ kind: "directive",
1847
+ type: i7.MatFooterRowDef,
1848
+ selector: "[matFooterRowDef]",
1849
+ inputs: ["matFooterRowDef", "matFooterRowDefSticky"]
1850
+ },
1851
+ {
1852
+ kind: "directive",
1853
+ type: i7.MatHeaderCell,
1854
+ selector: "mat-header-cell, th[mat-header-cell]"
1855
+ },
1856
+ {
1857
+ kind: "directive",
1858
+ type: i7.MatCell,
1859
+ selector: "mat-cell, td[mat-cell]"
1860
+ },
1861
+ {
1862
+ kind: "directive",
1863
+ type: i7.MatFooterCell,
1864
+ selector: "mat-footer-cell, td[mat-footer-cell]"
1865
+ },
1866
+ {
1867
+ kind: "component",
1868
+ type: i7.MatHeaderRow,
1869
+ selector: "mat-header-row, tr[mat-header-row]",
1870
+ exportAs: ["matHeaderRow"]
1871
+ },
1872
+ {
1873
+ kind: "component",
1874
+ type: i7.MatRow,
1875
+ selector: "mat-row, tr[mat-row]",
1876
+ exportAs: ["matRow"]
1877
+ },
1878
+ {
1879
+ kind: "component",
1880
+ type: i7.MatFooterRow,
1881
+ selector: "mat-footer-row, tr[mat-footer-row]",
1882
+ exportAs: ["matFooterRow"]
1883
+ },
1884
+ {
1885
+ kind: "directive",
1886
+ type: i8.MatTooltip,
1887
+ selector: "[matTooltip]",
1888
+ inputs: [
1889
+ "matTooltipPosition",
1890
+ "matTooltipPositionAtOrigin",
1891
+ "matTooltipDisabled",
1892
+ "matTooltipShowDelay",
1893
+ "matTooltipHideDelay",
1894
+ "matTooltipTouchGestures",
1895
+ "matTooltip",
1896
+ "matTooltipClass"
1897
+ ],
1898
+ exportAs: ["matTooltip"]
1899
+ },
1900
+ {
1901
+ kind: "directive",
1902
+ type: i9.RouterLink,
1903
+ selector: "[routerLink]",
1904
+ inputs: [
1905
+ "target",
1906
+ "queryParams",
1907
+ "fragment",
1908
+ "queryParamsHandling",
1909
+ "state",
1910
+ "info",
1911
+ "relativeTo",
1912
+ "preserveFragment",
1913
+ "skipLocationChange",
1914
+ "replaceUrl",
1915
+ "browserUrl",
1916
+ "routerLink"
1917
+ ]
1918
+ },
1919
+ {
1920
+ kind: "directive",
1921
+ type: i10.InfiniteScrollDirective,
1922
+ selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]",
1923
+ inputs: [
1924
+ "infiniteScrollDistance",
1925
+ "infiniteScrollUpDistance",
1926
+ "infiniteScrollThrottle",
1927
+ "infiniteScrollDisabled",
1928
+ "infiniteScrollContainer",
1929
+ "scrollWindow",
1930
+ "immediateCheck",
1931
+ "horizontal",
1932
+ "alwaysCallback",
1933
+ "fromRoot"
1934
+ ],
1935
+ outputs: ["scrolled", "scrolledUp"]
1936
+ },
1937
+ {
1938
+ kind: "component",
1939
+ type: ProductCategoryBadgesComponent,
1940
+ selector: "app-product-category-badges",
1941
+ inputs: ["product"]
1942
+ },
1943
+ {
1944
+ kind: "component",
1945
+ type: i1.TechlifyIconComponent,
1946
+ selector: "app-techlify-icon",
1947
+ inputs: ["name", "size"]
1948
+ },
1949
+ {
1950
+ kind: "component",
1951
+ type: i1.TechlifyDeleteButtonComponent,
1952
+ selector: "app-techlify-delete-button",
1953
+ inputs: [
1954
+ "data",
1955
+ "model",
1956
+ "message",
1957
+ "service"
1958
+ ],
1959
+ outputs: ["deleted", "loading"]
1960
+ },
1961
+ {
1962
+ kind: "component",
1963
+ type: StockReceiptProductFormButtonComponent,
1964
+ selector: "app-stock-receipt-product-form-button",
1965
+ inputs: ["stockReceiptProduct", "stockReceiptId"],
1966
+ outputs: ["saved"]
1967
+ },
1968
+ {
1969
+ kind: "component",
1970
+ type: i1.TechlifyFormButtonComponent,
1971
+ selector: "app-techlify-form-button",
1972
+ inputs: [
1973
+ "component",
1974
+ "model",
1975
+ "data",
1976
+ "width",
1977
+ "tooltip",
1978
+ "multiAddComponent",
1979
+ "multiAddData",
1980
+ "multiAddWidth",
1981
+ "multiAddTooltip"
1982
+ ],
1983
+ outputs: ["saved"]
1984
+ },
1985
+ {
1986
+ kind: "pipe",
1987
+ type: i13.CurrencyPipe,
1988
+ name: "currency"
1989
+ },
1990
+ {
1991
+ kind: "pipe",
1992
+ type: i13.DatePipe,
1993
+ name: "date"
1994
+ }
1995
+ ],
1996
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
1997
+ preserveWhitespaces: true
1998
+ });
1999
+ };
2000
+ StockReceiptProductsListComponent = __decorate([UntilDestroy()], StockReceiptProductsListComponent);
2001
+ i0.ɵɵngDeclareClassMetadata({
2002
+ minVersion: "12.0.0",
2003
+ version: "22.2.5",
2004
+ ngImport: i0,
2005
+ type: StockReceiptProductsListComponent,
2006
+ decorators: [{
2007
+ type: Component,
2008
+ args: [{
2009
+ selector: "app-stock-receipt-product-list",
2010
+ changeDetection: ChangeDetectionStrategy.Eager,
2011
+ standalone: false,
2012
+ template: "<mat-card>\n @if (isProductView()) {\n <mat-card-header class=\"d-flex align-items-center gap-2\">\n <mat-card-title>Stock Receipts</mat-card-title>\n <app-techlify-form-button [component]=\"stockReceiptSingleProductForm()\" [data]=\"{product: product()}\" width=\"500px\"\n (saved)=\"modelCreated($event); listUpdated.emit(true)\"\n ></app-techlify-form-button>\n </mat-card-header>\n }\n\n <mat-card-content class=\"p-0\">\n <table mat-table [dataSource]=\"models\" class=\"w-100\" aria-describedby=\"Stock Receipt Products\" infiniteScroll\n id=\"stockReceiptTable\" [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" matSort\n (matSortChange)=\"sortColumn($event)\">\n\n <!-- # Column -->\n <ng-container matColumnDef=\"no\">\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 <ng-container matColumnDef=\"receipt_number\">\n <th mat-header-cell *matHeaderCellDef matTooltip=\"Stock Receipt ID\">Receipt #</th>\n <td mat-cell *matCellDef=\"let element\">\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/stock-receipts', $safeNavigationMigration(element?.stock_receipt_id), 'view']\">\n {{ element?.stock_receipt_id }} <i class=\"fa-solid fa-up-right-from-square\"></i>\n </a>\n </td>\n </ng-container>\n\n <!-- Product Column -->\n <ng-container matColumnDef=\"product\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/products', $safeNavigationMigration(element?.product?.id), 'view']\">\n {{ element?.product?.name }}\n </a>\n </td>\n </ng-container>\n\n <!-- Product Categories Column -->\n <ng-container matColumnDef=\"product_categories\">\n <th mat-header-cell *matHeaderCellDef>Product Categories</th>\n <td mat-cell *matCellDef=\"let element\">\n <app-product-category-badges [product]=\"$safeNavigationMigration(element?.product)\"></app-product-category-badges>\n </td>\n </ng-container>\n\n <!-- Categories Column (export only) -->\n <ng-container matColumnDef=\"categories\">\n <th mat-header-cell *matHeaderCellDef>Categories</th>\n <td mat-cell *matCellDef=\"let element\">\n @for (category of element?.product?.categories; track category; let\n last = $last) {\n <span> {{ category?.title }}@if (!last) { , } </span>\n }\n </td>\n </ng-container>\n\n <!-- SKU Column -->\n <ng-container matColumnDef=\"sku\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>SKU</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.product?.sku }}</td>\n </ng-container>\n\n <!-- Date Column -->\n <ng-container matColumnDef=\"date\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Date</th>\n <td mat-cell *matCellDef=\"let element\">{{ $safeNavigationMigration(element?.stock_receipt?.date) | date }}</td>\n </ng-container>\n\n <!-- Quantity Column -->\n <ng-container matColumnDef=\"quantity\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Quantity</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.quantity }} {{ element?.product?.measure?.title }}\n </td>\n </ng-container>\n\n <!-- Batch Column -->\n <ng-container matColumnDef=\"batch\">\n <th mat-header-cell *matHeaderCellDef>Batch</th>\n <td mat-cell *matCellDef=\"let element\">\n @if (element?.batch?.batch_number) {\n <p class=\"mb-0\">{{ element?.batch?.batch_number }}</p>\n } @if (element?.batch?.expires_on) {\n <small class=\"text-secondary\">\n Expires\n {{ $safeNavigationMigration(element?.batch?.expires_on) | date }}\n </small>\n }\n </td>\n </ng-container>\n\n <!-- Measure Column -->\n <ng-container matColumnDef=\"measure\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Measure</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.product?.measure?.title }}</td>\n </ng-container>\n\n <!-- Location Column -->\n <ng-container matColumnDef=\"location\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Location</th>\n <td mat-cell *matCellDef=\"let element\">\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/locations', $safeNavigationMigration(element?.location_id), 'view']\">\n {{ element?.location?.title }}\n </a>\n </td>\n </ng-container>\n\n <!-- Purchase Price Column -->\n <ng-container matColumnDef=\"purchase_price\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Purchase Price</th>\n <td mat-cell *matCellDef=\"let element\">{{ $safeNavigationMigration(element?.purchase_price) | currency }}</td>\n </ng-container>\n\n <!-- Total Value Column -->\n <ng-container matColumnDef=\"amount\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Total Value</th>\n <td mat-cell *matCellDef=\"let element\">{{ $safeNavigationMigration(element?.amount) | currency }}</td>\n </ng-container>\n\n <!-- Particulars Column -->\n <ng-container matColumnDef=\"particulars\">\n <th mat-header-cell *matHeaderCellDef>Particulars</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.particulars }}</td>\n </ng-container>\n\n <!-- Supplier Column -->\n <ng-container matColumnDef=\"supplier\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Supplier</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt?.supplier?.company_name }}</td>\n </ng-container>\n\n <!-- Supplier Contact Column -->\n <ng-container matColumnDef=\"supplier_contact\">\n <th mat-header-cell *matHeaderCellDef>Supplier Contact</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt?.supplier?.contact_name }}</td>\n </ng-container>\n\n <!-- Supplier Phone Column -->\n <ng-container matColumnDef=\"supplier_phone\">\n <th mat-header-cell *matHeaderCellDef>Supplier Phone</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt?.supplier?.phone }}</td>\n </ng-container>\n\n <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-1\">{{ element?.stock_receipt?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ $safeNavigationMigration(element?.stock_receipt?.created_at) | date }}</small>\n </td>\n </ng-container>\n\n <!-- Actions Column -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef>Actions</th>\n <td mat-cell *matCellDef=\"let element\">\n\n @if (element?.stock_receipt?.stock_transfer) {\n <span class=\"badge rounded-pill text-bg-secondary\">Stock Transfer</span>\n } @else {\n <div class=\"d-flex gap-1 text-secondary\">\n <app-techlify-icon role='button' name='view' class='text-secondary'\n [routerLink]=\"['/inventory', 'stock-receipts', 'products', $safeNavigationMigration(element?.id), 'view']\"></app-techlify-icon>\n <app-stock-receipt-product-form-button [stockReceiptId]=\"$safeNavigationMigration(element?.stock_receipt_id)\"\n [stockReceiptProduct]=\"element\" (saved)=\"reload(); listUpdated.emit(true)\">\n </app-stock-receipt-product-form-button>\n <app-techlify-delete-button [model]=\"element\" [service]=\"service\"\n [data]=\"{ title: $safeNavigationMigration(element?.product?.name), type: 'Stock Receipt Product' }\"\n (deleted)=\"reload(); listUpdated.emit(true)\">\n </app-techlify-delete-button>\n </div>\n }\n </td>\n </ng-container>\n\n <!-- Footer Cells for Total Row -->\n <ng-container matColumnDef=\"footer-no\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-receipt_number\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-product\">\n <td mat-footer-cell *matFooterCellDef><strong>Total</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-product_categories\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-sku\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-categories\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-date\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-quantity\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-batch\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-measure\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-location\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-purchase_price\">\n <td mat-footer-cell *matFooterCellDef><strong>{{ totalPurchasePrice | currency }}</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-amount\">\n <td mat-footer-cell *matFooterCellDef><strong>{{ totalValue | currency }}</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-particulars\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier_contact\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier_phone\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-creator\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-actions\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n <tr mat-footer-row *matFooterRowDef=\"footerColumns\"></tr>\n </table>\n\n @if (isWorking) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </mat-card-content>\n</mat-card>",
2013
+ styles: [":host ::ng-deep .mat-mdc-footer-row{position:sticky;bottom:0;background-color:#fff;z-index:10;box-shadow:0 -2px 4px #0000001a}\n"]
2014
+ }]
2015
+ }],
2016
+ ctorParameters: () => [
2017
+ { type: StockReceiptProductService },
2018
+ { type: i2$1.FormBuilder },
2019
+ { type: i1.TechlifyFeatureService }
2020
+ ],
2021
+ propDecorators: {
2022
+ filtersInput: [{
2023
+ type: i0.Input,
2024
+ args: [{
2025
+ isSignal: true,
2026
+ alias: "filters",
2027
+ required: false
2028
+ }]
2029
+ }],
2030
+ isProductView: [{
2031
+ type: i0.Input,
2032
+ args: [{
2033
+ isSignal: true,
2034
+ alias: "isProductView",
2035
+ required: false
2036
+ }]
2037
+ }],
2038
+ selectedColumns: [{
2039
+ type: i0.Input,
2040
+ args: [{
2041
+ isSignal: true,
2042
+ alias: "selectedColumns",
2043
+ required: false
2044
+ }]
2045
+ }],
2046
+ exportInProgress: [{
2047
+ type: i0.Input,
2048
+ args: [{
2049
+ isSignal: true,
2050
+ alias: "exportInProgress",
2051
+ required: false
2052
+ }]
2053
+ }],
2054
+ listUpdated: [{
2055
+ type: i0.Output,
2056
+ args: ["listUpdated"]
2057
+ }],
2058
+ columnConfigReady: [{
2059
+ type: i0.Output,
2060
+ args: ["columnConfigReady"]
2061
+ }],
2062
+ product: [{
2063
+ type: i0.Input,
2064
+ args: [{
2065
+ isSignal: true,
2066
+ alias: "product",
2067
+ required: false
2068
+ }]
2069
+ }]
2070
+ }
2071
+ });
2072
+ let StockReceiptListComponent = class StockReceiptListComponent extends TechlifyListComponent {
2073
+ service;
2074
+ formBuilder;
2075
+ router;
2076
+ featureService;
2077
+ filtersInput = input({}, {
2078
+ ...ngDevMode ? { debugName: "filtersInput" } : /* istanbul ignore next */ {},
2079
+ alias: "filters"
2080
+ });
2081
+ selectedColumns = input([], ...ngDevMode ? [{ debugName: "selectedColumns" }] : /* istanbul ignore next */ []);
2082
+ exportInProgress = input(false, ...ngDevMode ? [{ debugName: "exportInProgress" }] : /* istanbul ignore next */ []);
2083
+ listUpdated = output();
2084
+ columnConfigReady = output();
2085
+ _defaultSelectedColumns = [];
2086
+ columnConfig = [
2087
+ {
2088
+ label: "#",
2089
+ def: "no",
2090
+ isSelected: true,
2091
+ isEditable: false
2092
+ },
2093
+ {
2094
+ label: "Receipt #",
2095
+ def: "receipt_number",
2096
+ isSelected: true,
2097
+ isEditable: false
2098
+ },
2099
+ {
2100
+ label: "Product",
2101
+ def: "product",
2102
+ isSelected: true,
2103
+ isEditable: false
2104
+ },
2105
+ {
2106
+ label: "Product Categories",
2107
+ def: "product_categories",
2108
+ isSelected: false,
2109
+ isEditable: true,
2110
+ isExportable: false
2111
+ },
2112
+ {
2113
+ label: "Categories",
2114
+ def: "categories",
2115
+ isSelected: false,
2116
+ isEditable: false,
2117
+ isExportable: true
2118
+ },
2119
+ {
2120
+ label: "SKU",
2121
+ def: "sku",
2122
+ isSelected: true,
2123
+ isEditable: false
2124
+ },
2125
+ {
2126
+ label: "Date",
2127
+ def: "date",
2128
+ isSelected: true,
2129
+ isEditable: false
2130
+ },
2131
+ {
2132
+ label: "Quantity",
2133
+ def: "quantity",
2134
+ isSelected: true,
2135
+ isEditable: false
2136
+ },
2137
+ {
2138
+ label: "Measure",
2139
+ def: "measure",
2140
+ isSelected: true,
2141
+ isEditable: true
2142
+ },
2143
+ {
2144
+ label: "Location",
2145
+ def: "location",
2146
+ isSelected: true,
2147
+ isEditable: false
2148
+ },
2149
+ {
2150
+ label: "Purchase Price",
2151
+ def: "purchase_price",
2152
+ isSelected: true,
2153
+ isEditable: false
2154
+ },
2155
+ {
2156
+ label: "Total Value",
2157
+ def: "amount",
2158
+ isSelected: true,
2159
+ isEditable: false
2160
+ },
2161
+ {
2162
+ label: "Supplier",
2163
+ def: "supplier",
2164
+ isSelected: true,
2165
+ isEditable: false
2166
+ },
2167
+ {
2168
+ label: "Supplier Contact",
2169
+ def: "supplier_contact",
2170
+ isSelected: false,
2171
+ isEditable: true
2172
+ },
2173
+ {
2174
+ label: "Supplier Phone",
2175
+ def: "supplier_phone",
2176
+ isSelected: false,
2177
+ isEditable: true
2178
+ },
2179
+ {
2180
+ label: "Particulars",
2181
+ def: "particulars",
2182
+ isSelected: true,
2183
+ isEditable: false
2184
+ },
2185
+ {
2186
+ label: "Creator",
2187
+ def: "creator",
2188
+ isSelected: false,
2189
+ isEditable: true
2190
+ },
2191
+ {
2192
+ label: "Actions",
2193
+ def: "actions",
2194
+ isSelected: true,
2195
+ isEditable: false,
2196
+ isExportable: false
2197
+ }
2198
+ ];
2199
+ get displayedColumns() {
2200
+ const cols = this.selectedColumns().length > 0 ? this.selectedColumns() : this._defaultSelectedColumns;
2201
+ const selectedDefs = new Set(cols.map((col) => col.def));
2202
+ return this.columnConfig.filter((col) => {
2203
+ if (this.exportInProgress()) {
2204
+ if (col.isExportable === true) return true;
2205
+ if (col.isExportable === false) return false;
2206
+ }
2207
+ return selectedDefs.has(col.def);
2208
+ }).map((col) => col.def);
2209
+ }
2210
+ get totalPurchasePrice() {
2211
+ return this.models.reduce((sum, model) => {
2212
+ return sum + (model?.stock_receipt_products ?? []).reduce((productSum, product) => productSum + Number(product?.purchase_price ?? 0), 0);
2213
+ }, 0);
2214
+ }
2215
+ get totalValue() {
2216
+ return this.models.reduce((sum, model) => {
2217
+ return sum + (model?.stock_receipt_products ?? []).reduce((productSum, product) => productSum + Number(product?.amount ?? 0), 0);
2218
+ }, 0);
2219
+ }
2220
+ get footerColumns() {
2221
+ return this.displayedColumns.map((col) => `footer-${col}`);
2222
+ }
2223
+ constructor(service, formBuilder, router, featureService) {
2224
+ super();
2225
+ this.service = service;
2226
+ this.formBuilder = formBuilder;
2227
+ this.router = router;
2228
+ this.featureService = featureService;
2229
+ this.lastPage = 0;
2230
+ this.filterFormConfiguration = {
2231
+ date_from: { date: true },
2232
+ date_to: { date: true },
2233
+ category_ids: { multiple: true },
2234
+ supplier_ids: { multiple: true },
2235
+ location_ids: { multiple: true },
2236
+ measure_ids: { multiple: true },
2237
+ product_ids: { multiple: true }
2238
+ };
2239
+ this.filterForm = this.formBuilder.group({
2240
+ category_ids: [""],
2241
+ date_from: [""],
2242
+ date_to: [""],
2243
+ duration: [""],
2244
+ import_id: [""],
2245
+ location_ids: [""],
2246
+ measure_ids: [""],
2247
+ product_ids: [""],
2248
+ search: [""],
2249
+ sort_by: ["date|desc"],
2250
+ supplier_ids: [""],
2251
+ page: this.page,
2252
+ perPage: this.perPage,
2253
+ with: ["creator,supplier,batch,stockReceiptProducts.product,stockReceiptProducts.product.categories,stockReceiptProducts.location,stockReceiptProducts.stockTransfer"]
2254
+ });
2255
+ let initialized = false;
2256
+ effect(() => {
2257
+ const filters = this.filtersInput();
2258
+ if (!initialized) {
2259
+ initialized = true;
2260
+ return;
2261
+ }
2262
+ this.filterForm.patchValue(filters, { emitEvent: true });
2263
+ });
2264
+ }
2265
+ ngOnInit() {
2266
+ this.loadFeatures();
2267
+ this._defaultSelectedColumns = this.columnConfig.filter((col) => col.isSelected);
2268
+ queueMicrotask(() => this.columnConfigReady.emit(this.columnConfig));
2269
+ this.patchFiltersFromRoute();
2270
+ this.listenFilterChanges();
2271
+ this.loadData();
2272
+ }
2273
+ loadFeatures() {
2274
+ if (this.featureService.isFeatureExists("product-batch-numbers")) {
2275
+ const qtyIndex = this.columnConfig.findIndex((c) => c.def === "quantity");
2276
+ if (qtyIndex >= 0) this.columnConfig.splice(qtyIndex + 1, 0, {
2277
+ label: "Batch",
2278
+ def: "batch",
2279
+ isSelected: true,
2280
+ isEditable: false
2281
+ });
2282
+ }
2283
+ }
2284
+ redirectToView(model) {
2285
+ this.router.navigate([
2286
+ "/inventory/stock-receipts",
2287
+ model?.id,
2288
+ "view"
2289
+ ]);
2290
+ }
2291
+ getStockReceiptDeleteTitle(model) {
2292
+ return `#${model?.id}`;
2293
+ }
2294
+ static ɵfac = i0.ɵɵngDeclareFactory({
2295
+ minVersion: "12.0.0",
2296
+ version: "22.2.5",
2297
+ ngImport: i0,
2298
+ type: StockReceiptListComponent,
2299
+ deps: [
2300
+ { token: StockReceiptService },
2301
+ { token: i2$1.FormBuilder },
2302
+ { token: i9.Router },
2303
+ { token: i1.TechlifyFeatureService }
2304
+ ],
2305
+ target: i0.ɵɵFactoryTarget.Component
2306
+ });
2307
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2308
+ minVersion: "17.0.0",
2309
+ version: "22.2.5",
2310
+ type: StockReceiptListComponent,
2311
+ isStandalone: false,
2312
+ selector: "app-stock-receipt-list",
2313
+ inputs: {
2314
+ filtersInput: {
2315
+ classPropertyName: "filtersInput",
2316
+ publicName: "filters",
2317
+ isSignal: true,
2318
+ isRequired: false,
2319
+ transformFunction: null
2320
+ },
2321
+ selectedColumns: {
2322
+ classPropertyName: "selectedColumns",
2323
+ publicName: "selectedColumns",
2324
+ isSignal: true,
2325
+ isRequired: false,
2326
+ transformFunction: null
2327
+ },
2328
+ exportInProgress: {
2329
+ classPropertyName: "exportInProgress",
2330
+ publicName: "exportInProgress",
2331
+ isSignal: true,
2332
+ isRequired: false,
2333
+ transformFunction: null
2334
+ }
2335
+ },
2336
+ outputs: {
2337
+ listUpdated: "listUpdated",
2338
+ columnConfigReady: "columnConfigReady"
2339
+ },
2340
+ usesInheritance: true,
2341
+ ngImport: i0,
2342
+ template: "<mat-card>\n <mat-card-content class=\"p-0\">\n <table mat-table [dataSource]=\"models\" class=\"w-100\" aria-describedby=\"Stock Receipts\" infiniteScroll\n id=\"stockReceiptTable\" [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" matSort\n (matSortChange)=\"sortColumn($event)\">\n\n <!-- # Column -->\n <ng-container matColumnDef=\"no\">\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 <ng-container matColumnDef=\"receipt_number\">\n <th mat-header-cell *matHeaderCellDef matTooltip=\"Stock Receipt ID\">Receipt #</th>\n <td mat-cell *matCellDef=\"let element\">\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/stock-receipts', $safeNavigationMigration(element?.id), 'view']\">\n {{ element?.id }} <i class=\"fa-solid fa-up-right-from-square\"></i>\n </a>\n </td>\n </ng-container>\n\n <!-- Product Column -->\n <ng-container matColumnDef=\"product\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <ul class=\"mb-0 ps-3\">\n @for (srp of element?.stock_receipt_products; track srp) {\n <li>\n {{ srp?.quantity }} {{ srp?.product?.measure?.title }} <em>of</em>\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/products', $safeNavigationMigration(srp?.product?.id), 'view']\">\n {{ srp?.product?.name }}\n </a>\n </li>\n }\n </ul>\n </td>\n </ng-container>\n\n <!-- Product Categories Column -->\n <ng-container matColumnDef=\"product_categories\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Product Categories</th>\n <td mat-cell *matCellDef=\"let element\">\n <app-product-category-badges\n [product]=\"$safeNavigationMigration(element?.stock_receipt_products[0]?.product)\"></app-product-category-badges>\n </td>\n </ng-container>\n\n <!-- SKU Column -->\n <ng-container matColumnDef=\"sku\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>SKU</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt_products[0]?.product?.sku }}</td>\n </ng-container>\n\n <!-- Categories Column (export only) -->\n <ng-container matColumnDef=\"categories\">\n <th mat-header-cell *matHeaderCellDef>Categories</th>\n <td mat-cell *matCellDef=\"let element\">\n @for (category of\n element?.stock_receipt_products[0]?.product?.categories; track\n category; let last = $last) {\n <span> {{ category?.title }}@if (!last) { , } </span>\n }\n </td>\n </ng-container>\n\n <!-- Date Column -->\n <ng-container matColumnDef=\"date\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Date</th>\n <td mat-cell *matCellDef=\"let element\">{{ $safeNavigationMigration(element?.date) | date }}</td>\n </ng-container>\n\n <!-- Quantity Column -->\n <ng-container matColumnDef=\"quantity\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Quantity</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt_products[0]?.quantity }} {{\n element?.stock_receipt_products[0]?.product?.measure?.title }}</td>\n </ng-container>\n\n <!-- Batch Column -->\n <ng-container matColumnDef=\"batch\">\n <th mat-header-cell *matHeaderCellDef>Batch</th>\n <td mat-cell *matCellDef=\"let element\">\n @if (element?.batch?.batch_number) {\n <p class=\"mb-0\">{{ element?.batch?.batch_number }}</p>\n } @if (element?.batch?.expires_on) {\n <small class=\"text-secondary\">\n Expires\n {{ $safeNavigationMigration(element?.batch?.expires_on) | date }}\n </small>\n }\n </td>\n </ng-container>\n\n <!-- Measure Column -->\n <ng-container matColumnDef=\"measure\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Measure</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt_products[0]?.product?.measure?.title }}</td>\n </ng-container>\n\n <!-- Location Column -->\n <ng-container matColumnDef=\"location\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Location</th>\n <td mat-cell *matCellDef=\"let element\">\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/locations', $safeNavigationMigration(element?.stock_receipt_products[0]?.location_id), 'view']\">\n {{ element?.stock_receipt_products[0]?.location?.title }}\n </a>\n </td>\n </ng-container>\n\n <!-- Purchase Price Column -->\n <ng-container matColumnDef=\"purchase_price\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Purchase Price</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ $safeNavigationMigration(element?.stock_receipt_products[0]?.purchase_price) | currency }}\n </td>\n </ng-container>\n\n <!-- Total Value Column -->\n <ng-container matColumnDef=\"amount\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Total Value</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ $safeNavigationMigration(element?.stock_receipt_products[0]?.amount) | currency }}\n </td>\n </ng-container>\n\n <!-- Particulars Column -->\n <ng-container matColumnDef=\"particulars\">\n <th mat-header-cell *matHeaderCellDef>Particulars</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.details }}</td>\n </ng-container>\n\n <!-- Supplier Column -->\n <ng-container matColumnDef=\"supplier\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Supplier</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.supplier?.company_name }}</td>\n </ng-container>\n\n <!-- Supplier Contact Column -->\n <ng-container matColumnDef=\"supplier_contact\">\n <th mat-header-cell *matHeaderCellDef>Supplier Contact</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.supplier?.contact_name }}</td>\n </ng-container>\n\n <!-- Supplier Phone Column -->\n <ng-container matColumnDef=\"supplier_phone\">\n <th mat-header-cell *matHeaderCellDef>Supplier Phone</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.supplier?.phone }}</td>\n </ng-container>\n\n <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-1\">{{ element?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ $safeNavigationMigration(element?.created_at) | date }}</small>\n </td>\n </ng-container>\n\n <!-- Actions Column -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef>Actions</th>\n <td mat-cell *matCellDef=\"let element\">\n @if (!element.stock_transfer) {\n <div class=\"d-flex gap-1 text-secondary\">\n <app-techlify-icon role='button' name='view' class='text-secondary'\n [routerLink]=\"['/inventory', 'stock-receipts', $safeNavigationMigration(element?.id), 'view']\"></app-techlify-icon>\n <app-techlify-icon role='button' name='edit'\n [routerLink]=\"['/inventory/stock-receipts/form', $safeNavigationMigration(element?.id)]\"></app-techlify-icon>\n <app-techlify-delete-button [service]=\"service\" [model]=\"element\"\n [data]=\"{ title: getStockReceiptDeleteTitle(element), type: 'Stock Receipt' }\"\n (deleted)=\"reload(); listUpdated.emit(true)\"></app-techlify-delete-button>\n </div>\n } @if (element.stock_transfer) {\n <span class=\"badge rounded-pill text-bg-secondary\">Stock Transfer</span>\n }\n </td>\n </ng-container>\n\n <!-- Footer Cells for Total Row -->\n <ng-container matColumnDef=\"footer-no\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-receipt_number\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-product\">\n <td mat-footer-cell *matFooterCellDef colspan=\"1\"><strong>Total</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-product_categories\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-sku\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-categories\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-date\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-quantity\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-batch\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-measure\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-location\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-purchase_price\">\n <td mat-footer-cell *matFooterCellDef><strong>{{ totalPurchasePrice | currency }}</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-amount\">\n <td mat-footer-cell *matFooterCellDef><strong>{{ totalValue | currency }}</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-particulars\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier_contact\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier_phone\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-creator\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-actions\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n <tr mat-footer-row *matFooterRowDef=\"footerColumns\"></tr>\n </table>\n\n @if (isWorking) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </mat-card-content>\n</mat-card>",
2343
+ styles: [":host ::ng-deep .mat-mdc-footer-row{position:sticky;bottom:0;background-color:#fff;z-index:10;box-shadow:0 -2px 4px #0000001a}\n"],
2344
+ dependencies: [
2345
+ {
2346
+ kind: "component",
2347
+ type: i6$1.MatCard,
2348
+ selector: "mat-card",
2349
+ inputs: ["appearance"],
2350
+ exportAs: ["matCard"]
2351
+ },
2352
+ {
2353
+ kind: "directive",
2354
+ type: i6$1.MatCardContent,
2355
+ selector: "mat-card-content"
2356
+ },
2357
+ {
2358
+ kind: "component",
2359
+ type: i5.MatProgressBar,
2360
+ selector: "mat-progress-bar",
2361
+ inputs: [
2362
+ "color",
2363
+ "value",
2364
+ "bufferValue",
2365
+ "mode"
2366
+ ],
2367
+ outputs: ["animationEnd"],
2368
+ exportAs: ["matProgressBar"]
2369
+ },
2370
+ {
2371
+ kind: "directive",
2372
+ type: i6.MatSort,
2373
+ selector: "[matSort]",
2374
+ inputs: [
2375
+ "matSortActive",
2376
+ "matSortStart",
2377
+ "matSortDirection",
2378
+ "matSortDisableClear",
2379
+ "matSortDisabled"
2380
+ ],
2381
+ outputs: ["matSortChange"],
2382
+ exportAs: ["matSort"]
2383
+ },
2384
+ {
2385
+ kind: "component",
2386
+ type: i6.MatSortHeader,
2387
+ selector: "[mat-sort-header]",
2388
+ inputs: [
2389
+ "mat-sort-header",
2390
+ "arrowPosition",
2391
+ "start",
2392
+ "disabled",
2393
+ "sortActionDescription",
2394
+ "disableClear"
2395
+ ],
2396
+ exportAs: ["matSortHeader"]
2397
+ },
2398
+ {
2399
+ kind: "component",
2400
+ type: i7.MatTable,
2401
+ selector: "mat-table, table[mat-table]",
2402
+ exportAs: ["matTable"]
2403
+ },
2404
+ {
2405
+ kind: "directive",
2406
+ type: i7.MatHeaderCellDef,
2407
+ selector: "[matHeaderCellDef]"
2408
+ },
2409
+ {
2410
+ kind: "directive",
2411
+ type: i7.MatHeaderRowDef,
2412
+ selector: "[matHeaderRowDef]",
2413
+ inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"]
2414
+ },
2415
+ {
2416
+ kind: "directive",
2417
+ type: i7.MatColumnDef,
2418
+ selector: "[matColumnDef]",
2419
+ inputs: ["matColumnDef"]
2420
+ },
2421
+ {
2422
+ kind: "directive",
2423
+ type: i7.MatCellDef,
2424
+ selector: "[matCellDef]"
2425
+ },
2426
+ {
2427
+ kind: "directive",
2428
+ type: i7.MatRowDef,
2429
+ selector: "[matRowDef]",
2430
+ inputs: ["matRowDefColumns", "matRowDefWhen"]
2431
+ },
2432
+ {
2433
+ kind: "directive",
2434
+ type: i7.MatFooterCellDef,
2435
+ selector: "[matFooterCellDef]"
2436
+ },
2437
+ {
2438
+ kind: "directive",
2439
+ type: i7.MatFooterRowDef,
2440
+ selector: "[matFooterRowDef]",
2441
+ inputs: ["matFooterRowDef", "matFooterRowDefSticky"]
2442
+ },
2443
+ {
2444
+ kind: "directive",
2445
+ type: i7.MatHeaderCell,
2446
+ selector: "mat-header-cell, th[mat-header-cell]"
2447
+ },
2448
+ {
2449
+ kind: "directive",
2450
+ type: i7.MatCell,
2451
+ selector: "mat-cell, td[mat-cell]"
2452
+ },
2453
+ {
2454
+ kind: "directive",
2455
+ type: i7.MatFooterCell,
2456
+ selector: "mat-footer-cell, td[mat-footer-cell]"
2457
+ },
2458
+ {
2459
+ kind: "component",
2460
+ type: i7.MatHeaderRow,
2461
+ selector: "mat-header-row, tr[mat-header-row]",
2462
+ exportAs: ["matHeaderRow"]
2463
+ },
2464
+ {
2465
+ kind: "component",
2466
+ type: i7.MatRow,
2467
+ selector: "mat-row, tr[mat-row]",
2468
+ exportAs: ["matRow"]
2469
+ },
2470
+ {
2471
+ kind: "component",
2472
+ type: i7.MatFooterRow,
2473
+ selector: "mat-footer-row, tr[mat-footer-row]",
2474
+ exportAs: ["matFooterRow"]
2475
+ },
2476
+ {
2477
+ kind: "directive",
2478
+ type: i8.MatTooltip,
2479
+ selector: "[matTooltip]",
2480
+ inputs: [
2481
+ "matTooltipPosition",
2482
+ "matTooltipPositionAtOrigin",
2483
+ "matTooltipDisabled",
2484
+ "matTooltipShowDelay",
2485
+ "matTooltipHideDelay",
2486
+ "matTooltipTouchGestures",
2487
+ "matTooltip",
2488
+ "matTooltipClass"
2489
+ ],
2490
+ exportAs: ["matTooltip"]
2491
+ },
2492
+ {
2493
+ kind: "directive",
2494
+ type: i9.RouterLink,
2495
+ selector: "[routerLink]",
2496
+ inputs: [
2497
+ "target",
2498
+ "queryParams",
2499
+ "fragment",
2500
+ "queryParamsHandling",
2501
+ "state",
2502
+ "info",
2503
+ "relativeTo",
2504
+ "preserveFragment",
2505
+ "skipLocationChange",
2506
+ "replaceUrl",
2507
+ "browserUrl",
2508
+ "routerLink"
2509
+ ]
2510
+ },
2511
+ {
2512
+ kind: "directive",
2513
+ type: i10.InfiniteScrollDirective,
2514
+ selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]",
2515
+ inputs: [
2516
+ "infiniteScrollDistance",
2517
+ "infiniteScrollUpDistance",
2518
+ "infiniteScrollThrottle",
2519
+ "infiniteScrollDisabled",
2520
+ "infiniteScrollContainer",
2521
+ "scrollWindow",
2522
+ "immediateCheck",
2523
+ "horizontal",
2524
+ "alwaysCallback",
2525
+ "fromRoot"
2526
+ ],
2527
+ outputs: ["scrolled", "scrolledUp"]
2528
+ },
2529
+ {
2530
+ kind: "component",
2531
+ type: ProductCategoryBadgesComponent,
2532
+ selector: "app-product-category-badges",
2533
+ inputs: ["product"]
2534
+ },
2535
+ {
2536
+ kind: "component",
2537
+ type: i1.TechlifyIconComponent,
2538
+ selector: "app-techlify-icon",
2539
+ inputs: ["name", "size"]
2540
+ },
2541
+ {
2542
+ kind: "component",
2543
+ type: i1.TechlifyDeleteButtonComponent,
2544
+ selector: "app-techlify-delete-button",
2545
+ inputs: [
2546
+ "data",
2547
+ "model",
2548
+ "message",
2549
+ "service"
2550
+ ],
2551
+ outputs: ["deleted", "loading"]
2552
+ },
2553
+ {
2554
+ kind: "pipe",
2555
+ type: i13.CurrencyPipe,
2556
+ name: "currency"
2557
+ },
2558
+ {
2559
+ kind: "pipe",
2560
+ type: i13.DatePipe,
2561
+ name: "date"
2562
+ }
2563
+ ],
2564
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
2565
+ preserveWhitespaces: true
2566
+ });
2567
+ };
2568
+ StockReceiptListComponent = __decorate([UntilDestroy()], StockReceiptListComponent);
2569
+ i0.ɵɵngDeclareClassMetadata({
2570
+ minVersion: "12.0.0",
2571
+ version: "22.2.5",
2572
+ ngImport: i0,
2573
+ type: StockReceiptListComponent,
2574
+ decorators: [{
2575
+ type: Component,
2576
+ args: [{
2577
+ selector: "app-stock-receipt-list",
2578
+ changeDetection: ChangeDetectionStrategy.Eager,
2579
+ standalone: false,
2580
+ template: "<mat-card>\n <mat-card-content class=\"p-0\">\n <table mat-table [dataSource]=\"models\" class=\"w-100\" aria-describedby=\"Stock Receipts\" infiniteScroll\n id=\"stockReceiptTable\" [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" matSort\n (matSortChange)=\"sortColumn($event)\">\n\n <!-- # Column -->\n <ng-container matColumnDef=\"no\">\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 <ng-container matColumnDef=\"receipt_number\">\n <th mat-header-cell *matHeaderCellDef matTooltip=\"Stock Receipt ID\">Receipt #</th>\n <td mat-cell *matCellDef=\"let element\">\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/stock-receipts', $safeNavigationMigration(element?.id), 'view']\">\n {{ element?.id }} <i class=\"fa-solid fa-up-right-from-square\"></i>\n </a>\n </td>\n </ng-container>\n\n <!-- Product Column -->\n <ng-container matColumnDef=\"product\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <ul class=\"mb-0 ps-3\">\n @for (srp of element?.stock_receipt_products; track srp) {\n <li>\n {{ srp?.quantity }} {{ srp?.product?.measure?.title }} <em>of</em>\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/products', $safeNavigationMigration(srp?.product?.id), 'view']\">\n {{ srp?.product?.name }}\n </a>\n </li>\n }\n </ul>\n </td>\n </ng-container>\n\n <!-- Product Categories Column -->\n <ng-container matColumnDef=\"product_categories\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Product Categories</th>\n <td mat-cell *matCellDef=\"let element\">\n <app-product-category-badges\n [product]=\"$safeNavigationMigration(element?.stock_receipt_products[0]?.product)\"></app-product-category-badges>\n </td>\n </ng-container>\n\n <!-- SKU Column -->\n <ng-container matColumnDef=\"sku\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>SKU</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt_products[0]?.product?.sku }}</td>\n </ng-container>\n\n <!-- Categories Column (export only) -->\n <ng-container matColumnDef=\"categories\">\n <th mat-header-cell *matHeaderCellDef>Categories</th>\n <td mat-cell *matCellDef=\"let element\">\n @for (category of\n element?.stock_receipt_products[0]?.product?.categories; track\n category; let last = $last) {\n <span> {{ category?.title }}@if (!last) { , } </span>\n }\n </td>\n </ng-container>\n\n <!-- Date Column -->\n <ng-container matColumnDef=\"date\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Date</th>\n <td mat-cell *matCellDef=\"let element\">{{ $safeNavigationMigration(element?.date) | date }}</td>\n </ng-container>\n\n <!-- Quantity Column -->\n <ng-container matColumnDef=\"quantity\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Quantity</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt_products[0]?.quantity }} {{\n element?.stock_receipt_products[0]?.product?.measure?.title }}</td>\n </ng-container>\n\n <!-- Batch Column -->\n <ng-container matColumnDef=\"batch\">\n <th mat-header-cell *matHeaderCellDef>Batch</th>\n <td mat-cell *matCellDef=\"let element\">\n @if (element?.batch?.batch_number) {\n <p class=\"mb-0\">{{ element?.batch?.batch_number }}</p>\n } @if (element?.batch?.expires_on) {\n <small class=\"text-secondary\">\n Expires\n {{ $safeNavigationMigration(element?.batch?.expires_on) | date }}\n </small>\n }\n </td>\n </ng-container>\n\n <!-- Measure Column -->\n <ng-container matColumnDef=\"measure\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Measure</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.stock_receipt_products[0]?.product?.measure?.title }}</td>\n </ng-container>\n\n <!-- Location Column -->\n <ng-container matColumnDef=\"location\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Location</th>\n <td mat-cell *matCellDef=\"let element\">\n <a class=\"text-decoration-none text-dark\"\n [routerLink]=\"['/inventory/locations', $safeNavigationMigration(element?.stock_receipt_products[0]?.location_id), 'view']\">\n {{ element?.stock_receipt_products[0]?.location?.title }}\n </a>\n </td>\n </ng-container>\n\n <!-- Purchase Price Column -->\n <ng-container matColumnDef=\"purchase_price\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Purchase Price</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ $safeNavigationMigration(element?.stock_receipt_products[0]?.purchase_price) | currency }}\n </td>\n </ng-container>\n\n <!-- Total Value Column -->\n <ng-container matColumnDef=\"amount\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Total Value</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ $safeNavigationMigration(element?.stock_receipt_products[0]?.amount) | currency }}\n </td>\n </ng-container>\n\n <!-- Particulars Column -->\n <ng-container matColumnDef=\"particulars\">\n <th mat-header-cell *matHeaderCellDef>Particulars</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.details }}</td>\n </ng-container>\n\n <!-- Supplier Column -->\n <ng-container matColumnDef=\"supplier\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Supplier</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.supplier?.company_name }}</td>\n </ng-container>\n\n <!-- Supplier Contact Column -->\n <ng-container matColumnDef=\"supplier_contact\">\n <th mat-header-cell *matHeaderCellDef>Supplier Contact</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.supplier?.contact_name }}</td>\n </ng-container>\n\n <!-- Supplier Phone Column -->\n <ng-container matColumnDef=\"supplier_phone\">\n <th mat-header-cell *matHeaderCellDef>Supplier Phone</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.supplier?.phone }}</td>\n </ng-container>\n\n <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-1\">{{ element?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ $safeNavigationMigration(element?.created_at) | date }}</small>\n </td>\n </ng-container>\n\n <!-- Actions Column -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef>Actions</th>\n <td mat-cell *matCellDef=\"let element\">\n @if (!element.stock_transfer) {\n <div class=\"d-flex gap-1 text-secondary\">\n <app-techlify-icon role='button' name='view' class='text-secondary'\n [routerLink]=\"['/inventory', 'stock-receipts', $safeNavigationMigration(element?.id), 'view']\"></app-techlify-icon>\n <app-techlify-icon role='button' name='edit'\n [routerLink]=\"['/inventory/stock-receipts/form', $safeNavigationMigration(element?.id)]\"></app-techlify-icon>\n <app-techlify-delete-button [service]=\"service\" [model]=\"element\"\n [data]=\"{ title: getStockReceiptDeleteTitle(element), type: 'Stock Receipt' }\"\n (deleted)=\"reload(); listUpdated.emit(true)\"></app-techlify-delete-button>\n </div>\n } @if (element.stock_transfer) {\n <span class=\"badge rounded-pill text-bg-secondary\">Stock Transfer</span>\n }\n </td>\n </ng-container>\n\n <!-- Footer Cells for Total Row -->\n <ng-container matColumnDef=\"footer-no\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-receipt_number\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-product\">\n <td mat-footer-cell *matFooterCellDef colspan=\"1\"><strong>Total</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-product_categories\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-sku\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-categories\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-date\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-quantity\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-batch\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-measure\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-location\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-purchase_price\">\n <td mat-footer-cell *matFooterCellDef><strong>{{ totalPurchasePrice | currency }}</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-amount\">\n <td mat-footer-cell *matFooterCellDef><strong>{{ totalValue | currency }}</strong></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-particulars\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier_contact\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-supplier_phone\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-creator\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"footer-actions\">\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n <tr mat-footer-row *matFooterRowDef=\"footerColumns\"></tr>\n </table>\n\n @if (isWorking) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </mat-card-content>\n</mat-card>",
2581
+ styles: [":host ::ng-deep .mat-mdc-footer-row{position:sticky;bottom:0;background-color:#fff;z-index:10;box-shadow:0 -2px 4px #0000001a}\n"]
2582
+ }]
2583
+ }],
2584
+ ctorParameters: () => [
2585
+ { type: StockReceiptService },
2586
+ { type: i2$1.FormBuilder },
2587
+ { type: i9.Router },
2588
+ { type: i1.TechlifyFeatureService }
2589
+ ],
2590
+ propDecorators: {
2591
+ filtersInput: [{
2592
+ type: i0.Input,
2593
+ args: [{
2594
+ isSignal: true,
2595
+ alias: "filters",
2596
+ required: false
2597
+ }]
2598
+ }],
2599
+ selectedColumns: [{
2600
+ type: i0.Input,
2601
+ args: [{
2602
+ isSignal: true,
2603
+ alias: "selectedColumns",
2604
+ required: false
2605
+ }]
2606
+ }],
2607
+ exportInProgress: [{
2608
+ type: i0.Input,
2609
+ args: [{
2610
+ isSignal: true,
2611
+ alias: "exportInProgress",
2612
+ required: false
2613
+ }]
2614
+ }],
2615
+ listUpdated: [{
2616
+ type: i0.Output,
2617
+ args: ["listUpdated"]
2618
+ }],
2619
+ columnConfigReady: [{
2620
+ type: i0.Output,
2621
+ args: ["columnConfigReady"]
2622
+ }]
2623
+ }
2624
+ });
2625
+ let StockReceiptPageComponent = class StockReceiptPageComponent {
2626
+ formBuilder;
2627
+ product = input(null, ...ngDevMode ? [{ debugName: "product" }] : /* istanbul ignore next */ []);
2628
+ supplierId = input(void 0, ...ngDevMode ? [{ debugName: "supplierId" }] : /* istanbul ignore next */ []);
2629
+ listUpdated = output();
2630
+ selectedView = signal("itemized", ...ngDevMode ? [{ debugName: "selectedView" }] : /* istanbul ignore next */ []);
2631
+ exportInProgress = signal(false, ...ngDevMode ? [{ debugName: "exportInProgress" }] : /* istanbul ignore next */ []);
2632
+ columnConfig = [];
2633
+ selectedColumns = [];
2634
+ filterForm;
2635
+ filtersValue;
2636
+ constructor(formBuilder) {
2637
+ this.formBuilder = formBuilder;
2638
+ this.filterForm = this.formBuilder.group({
2639
+ category_ids: [""],
2640
+ duration: [""],
2641
+ location_ids: [""],
2642
+ measure_ids: [""],
2643
+ product_ids: [""],
2644
+ search: [""],
2645
+ supplier_ids: [""],
2646
+ date_from: [""],
2647
+ date_to: [""]
2648
+ });
2649
+ this.filtersValue = toSignal(this.filterForm.valueChanges.pipe(startWith(this.filterForm.value)));
2650
+ }
2651
+ ngOnInit() {
2652
+ const productVal = this.product();
2653
+ if (productVal) this.filterForm.get("product_ids")?.setValue(productVal.id);
2654
+ const supplierIdVal = this.supplierId();
2655
+ if (supplierIdVal) this.filterForm.get("supplier_ids")?.setValue(supplierIdVal);
2656
+ }
2657
+ onColumnConfigReady(config) {
2658
+ this.columnConfig = config;
2659
+ this.selectedColumns = config.filter((col) => col.isSelected);
2660
+ }
2661
+ static ɵfac = i0.ɵɵngDeclareFactory({
2662
+ minVersion: "12.0.0",
2663
+ version: "22.2.5",
2664
+ ngImport: i0,
2665
+ type: StockReceiptPageComponent,
2666
+ deps: [{ token: i2$1.FormBuilder }],
2667
+ target: i0.ɵɵFactoryTarget.Component
2668
+ });
2669
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2670
+ minVersion: "17.0.0",
2671
+ version: "22.2.5",
2672
+ type: StockReceiptPageComponent,
2673
+ isStandalone: false,
2674
+ selector: "app-stock-receipts-page",
2675
+ inputs: {
2676
+ product: {
2677
+ classPropertyName: "product",
2678
+ publicName: "product",
2679
+ isSignal: true,
2680
+ isRequired: false,
2681
+ transformFunction: null
2682
+ },
2683
+ supplierId: {
2684
+ classPropertyName: "supplierId",
2685
+ publicName: "supplierId",
2686
+ isSignal: true,
2687
+ isRequired: false,
2688
+ transformFunction: null
2689
+ }
2690
+ },
2691
+ outputs: { listUpdated: "listUpdated" },
2692
+ ngImport: i0,
2693
+ template: "@if (!product()) {\n<mat-card class=\"mb-2\">\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-3\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <h3 class=\"mb-0\">Stock Receipts</h3>\n\n <app-techlify-icon role='button' name='add' [routerLink]=\"['/inventory/stock-receipts/form']\"\n class='ms-2'></app-techlify-icon>\n\n <span matTooltip=\"Import\" routerLink=\"import\" class=\"cursor-pointer material-symbols-outlined\">\n file_upload\n </span>\n\n <app-export-to-excel-button tableId=\"stockReceiptTable\" fileName=\"Stock Receipts\"\n (onExportStart)=\"exportInProgress.set(true)\" (onExportEnd)=\"exportInProgress.set(false)\">\n </app-export-to-excel-button>\n @if (columnConfig.length > 0) {\n <app-column-selector mode=\"icon\" class=\"mt-1 d-print-none\"\n [columnConfigs]=\"columnConfig\" [(selectedColumns)]=\"selectedColumns\"></app-column-selector>\n }\n <mat-button-toggle-group class=\"view-toggle\" [value]=\"selectedView()\" (change)=\"selectedView.set($event.value)\">\n <mat-button-toggle value=\"itemized\">Itemized</mat-button-toggle>\n <mat-button-toggle value=\"grouped\">Grouped</mat-button-toggle>\n </mat-button-toggle-group>\n </div>\n\n <form [formGroup]=\"filterForm\" class=\"d-flex align-items-center gap-2 flex-wrap\">\n <mat-form-field>\n <mat-label>Search</mat-label>\n <input matInput formControlName=\"search\" />\n </mat-form-field>\n\n <app-timeline-filter labelText=\"Date\" formControlName=\"duration\" [form]=\"filterForm\"></app-timeline-filter>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Category</mat-label>\n <app-searchable-selector apiUrl=\"api/product-categories\" formControlName=\"category_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Measure</mat-label>\n <app-searchable-selector apiUrl=\"api/product-measures\" formControlName=\"measure_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Location</mat-label>\n <app-searchable-selector apiUrl=\"api/inventory-locations\" formControlName=\"location_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Supplier</mat-label>\n <app-searchable-selector apiUrl=\"api/suppliers\" formControlName=\"supplier_ids\" titleField=\"company_name\"\n [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n </form>\n </mat-card-content>\n</mat-card>\n} @if (product()) {\n<mat-card class=\"mb-2\">\n <mat-card-content class=\"mb-0\">\n <div class=\"d-flex justify-content-start align-items-center gap-2 mb-2\">\n <span class=\"material-symbols-outlined\"> output_circle </span>\n <h3 class=\"mb-0\">Stock Receipts</h3>\n </div>\n </mat-card-content>\n</mat-card>\n} @if (selectedView() === 'itemized') {\n<app-stock-receipt-product-list [filters]=\"filtersValue()\"\n [selectedColumns]=\"selectedColumns\" [exportInProgress]=\"exportInProgress()\"\n (columnConfigReady)=\"onColumnConfigReady($event)\" (listUpdated)=\"listUpdated.emit($event)\">\n</app-stock-receipt-product-list>\n} @if (selectedView() === 'grouped') {\n<app-stock-receipt-list [filters]=\"filtersValue()\"\n [selectedColumns]=\"selectedColumns\" [exportInProgress]=\"exportInProgress()\"\n (columnConfigReady)=\"onColumnConfigReady($event)\" (listUpdated)=\"listUpdated.emit($event)\">\n</app-stock-receipt-list>\n}",
2694
+ styles: [":host ::ng-deep .mat-mdc-footer-row{position:sticky;bottom:0;background-color:#fff;z-index:10;box-shadow:0 -2px 4px #0000001a}\n"],
2695
+ dependencies: [
2696
+ {
2697
+ kind: "directive",
2698
+ type: i2.MatButtonToggleGroup,
2699
+ selector: "mat-button-toggle-group",
2700
+ inputs: [
2701
+ "appearance",
2702
+ "name",
2703
+ "vertical",
2704
+ "value",
2705
+ "multiple",
2706
+ "disabled",
2707
+ "disabledInteractive",
2708
+ "hideSingleSelectionIndicator",
2709
+ "hideMultipleSelectionIndicator"
2710
+ ],
2711
+ outputs: ["valueChange", "change"],
2712
+ exportAs: ["matButtonToggleGroup"]
2713
+ },
2714
+ {
2715
+ kind: "component",
2716
+ type: i2.MatButtonToggle,
2717
+ selector: "mat-button-toggle",
2718
+ inputs: [
2719
+ "aria-label",
2720
+ "aria-labelledby",
2721
+ "id",
2722
+ "name",
2723
+ "value",
2724
+ "tabIndex",
2725
+ "disableRipple",
2726
+ "appearance",
2727
+ "checked",
2728
+ "disabled",
2729
+ "disabledInteractive"
2730
+ ],
2731
+ outputs: ["change"],
2732
+ exportAs: ["matButtonToggle"]
2733
+ },
2734
+ {
2735
+ kind: "component",
2736
+ type: i6$1.MatCard,
2737
+ selector: "mat-card",
2738
+ inputs: ["appearance"],
2739
+ exportAs: ["matCard"]
2740
+ },
2741
+ {
2742
+ kind: "directive",
2743
+ type: i6$1.MatCardContent,
2744
+ selector: "mat-card-content"
2745
+ },
2746
+ {
2747
+ kind: "component",
2748
+ type: i8$2.MatFormField,
2749
+ selector: "mat-form-field",
2750
+ inputs: [
2751
+ "hideRequiredMarker",
2752
+ "color",
2753
+ "floatLabel",
2754
+ "appearance",
2755
+ "subscriptSizing",
2756
+ "hintLabel"
2757
+ ],
2758
+ exportAs: ["matFormField"]
2759
+ },
2760
+ {
2761
+ kind: "directive",
2762
+ type: i8$2.MatLabel,
2763
+ selector: "mat-label"
2764
+ },
2765
+ {
2766
+ kind: "directive",
2767
+ type: i9$1.MatInput,
2768
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
2769
+ inputs: [
2770
+ "disabled",
2771
+ "id",
2772
+ "placeholder",
2773
+ "name",
2774
+ "required",
2775
+ "type",
2776
+ "errorStateMatcher",
2777
+ "aria-describedby",
2778
+ "value",
2779
+ "readonly",
2780
+ "disabledInteractive"
2781
+ ],
2782
+ exportAs: ["matInput"]
2783
+ },
2784
+ {
2785
+ kind: "directive",
2786
+ type: i8.MatTooltip,
2787
+ selector: "[matTooltip]",
2788
+ inputs: [
2789
+ "matTooltipPosition",
2790
+ "matTooltipPositionAtOrigin",
2791
+ "matTooltipDisabled",
2792
+ "matTooltipShowDelay",
2793
+ "matTooltipHideDelay",
2794
+ "matTooltipTouchGestures",
2795
+ "matTooltip",
2796
+ "matTooltipClass"
2797
+ ],
2798
+ exportAs: ["matTooltip"]
2799
+ },
2800
+ {
2801
+ kind: "directive",
2802
+ type: i9.RouterLink,
2803
+ selector: "[routerLink]",
2804
+ inputs: [
2805
+ "target",
2806
+ "queryParams",
2807
+ "fragment",
2808
+ "queryParamsHandling",
2809
+ "state",
2810
+ "info",
2811
+ "relativeTo",
2812
+ "preserveFragment",
2813
+ "skipLocationChange",
2814
+ "replaceUrl",
2815
+ "browserUrl",
2816
+ "routerLink"
2817
+ ]
2818
+ },
2819
+ {
2820
+ kind: "component",
2821
+ type: i1.SearchableSelectorComponent,
2822
+ selector: "app-searchable-selector",
2823
+ inputs: [
2824
+ "valueField",
2825
+ "titleField",
2826
+ "subtitleField",
2827
+ "apiUrl",
2828
+ "multiple",
2829
+ "selectedValue",
2830
+ "enableSearch",
2831
+ "add",
2832
+ "addConfig",
2833
+ "edit",
2834
+ "editConfig",
2835
+ "sort",
2836
+ "sortBy",
2837
+ "searchField",
2838
+ "itemComponent",
2839
+ "items",
2840
+ "apiDataProperty",
2841
+ "cache",
2842
+ "perPage",
2843
+ "inDataSearch",
2844
+ "panelWidth",
2845
+ "focusSearchOnOpen",
2846
+ "isEmitInitialEvent",
2847
+ "required",
2848
+ "disabled",
2849
+ "value"
2850
+ ],
2851
+ outputs: [
2852
+ "selectedValueChange",
2853
+ "selectionChange",
2854
+ "itemsChange",
2855
+ "isItemsEmpty"
2856
+ ]
2857
+ },
2858
+ {
2859
+ kind: "component",
2860
+ type: i1.TimelineFilterComponent,
2861
+ selector: "app-timeline-filter",
2862
+ inputs: [
2863
+ "defaultValue",
2864
+ "required",
2865
+ "disabled",
2866
+ "value",
2867
+ "timelines",
2868
+ "dateFrom",
2869
+ "dateTo",
2870
+ "appearance",
2871
+ "showClearButton",
2872
+ "form",
2873
+ "labelText"
2874
+ ],
2875
+ outputs: ["selectionChange"]
2876
+ },
2877
+ {
2878
+ kind: "directive",
2879
+ type: i2$1.ɵNgNoValidate,
2880
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
2881
+ },
2882
+ {
2883
+ kind: "directive",
2884
+ type: i2$1.DefaultValueAccessor,
2885
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
2886
+ },
2887
+ {
2888
+ kind: "directive",
2889
+ type: i2$1.NgControlStatus,
2890
+ selector: "[formControlName],[ngModel],[formControl]"
2891
+ },
2892
+ {
2893
+ kind: "directive",
2894
+ type: i2$1.NgControlStatusGroup,
2895
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
2896
+ },
2897
+ {
2898
+ kind: "directive",
2899
+ type: i2$1.FormGroupDirective,
2900
+ selector: "[formGroup]",
2901
+ inputs: ["formGroup"],
2902
+ outputs: ["ngSubmit"],
2903
+ exportAs: ["ngForm"]
2904
+ },
2905
+ {
2906
+ kind: "directive",
2907
+ type: i2$1.FormControlName,
2908
+ selector: "[formControlName]",
2909
+ inputs: [
2910
+ "formControlName",
2911
+ "disabled",
2912
+ "ngModel"
2913
+ ],
2914
+ outputs: ["ngModelChange"]
2915
+ },
2916
+ {
2917
+ kind: "component",
2918
+ type: i1.ColumnSelectorComponent,
2919
+ selector: "app-column-selector",
2920
+ inputs: [
2921
+ "label",
2922
+ "mode",
2923
+ "columnConfigs",
2924
+ "selectedColumns",
2925
+ "isExportWorking"
2926
+ ],
2927
+ outputs: ["selectedColumnsChange", "displayedColumnsChange"]
2928
+ },
2929
+ {
2930
+ kind: "component",
2931
+ type: i1.TechlifyIconComponent,
2932
+ selector: "app-techlify-icon",
2933
+ inputs: ["name", "size"]
2934
+ },
2935
+ {
2936
+ kind: "component",
2937
+ type: ExportToExcelButtonComponent,
2938
+ selector: "app-export-to-excel-button",
2939
+ inputs: ["tableId", "fileName"],
2940
+ outputs: ["onExportStart", "onExportEnd"]
2941
+ },
2942
+ {
2943
+ kind: "component",
2944
+ type: StockReceiptListComponent,
2945
+ selector: "app-stock-receipt-list",
2946
+ inputs: [
2947
+ "filters",
2948
+ "selectedColumns",
2949
+ "exportInProgress"
2950
+ ],
2951
+ outputs: ["listUpdated", "columnConfigReady"]
2952
+ },
2953
+ {
2954
+ kind: "component",
2955
+ type: StockReceiptProductsListComponent,
2956
+ selector: "app-stock-receipt-product-list",
2957
+ inputs: [
2958
+ "filters",
2959
+ "isProductView",
2960
+ "selectedColumns",
2961
+ "exportInProgress",
2962
+ "product"
2963
+ ],
2964
+ outputs: ["listUpdated", "columnConfigReady"]
2965
+ }
2966
+ ],
2967
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
2968
+ preserveWhitespaces: true
2969
+ });
2970
+ };
2971
+ StockReceiptPageComponent = __decorate([UntilDestroy()], StockReceiptPageComponent);
2972
+ i0.ɵɵngDeclareClassMetadata({
2973
+ minVersion: "12.0.0",
2974
+ version: "22.2.5",
2975
+ ngImport: i0,
2976
+ type: StockReceiptPageComponent,
2977
+ decorators: [{
2978
+ type: Component,
2979
+ args: [{
2980
+ selector: "app-stock-receipts-page",
2981
+ changeDetection: ChangeDetectionStrategy.Eager,
2982
+ standalone: false,
2983
+ template: "@if (!product()) {\n<mat-card class=\"mb-2\">\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-3\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <h3 class=\"mb-0\">Stock Receipts</h3>\n\n <app-techlify-icon role='button' name='add' [routerLink]=\"['/inventory/stock-receipts/form']\"\n class='ms-2'></app-techlify-icon>\n\n <span matTooltip=\"Import\" routerLink=\"import\" class=\"cursor-pointer material-symbols-outlined\">\n file_upload\n </span>\n\n <app-export-to-excel-button tableId=\"stockReceiptTable\" fileName=\"Stock Receipts\"\n (onExportStart)=\"exportInProgress.set(true)\" (onExportEnd)=\"exportInProgress.set(false)\">\n </app-export-to-excel-button>\n @if (columnConfig.length > 0) {\n <app-column-selector mode=\"icon\" class=\"mt-1 d-print-none\"\n [columnConfigs]=\"columnConfig\" [(selectedColumns)]=\"selectedColumns\"></app-column-selector>\n }\n <mat-button-toggle-group class=\"view-toggle\" [value]=\"selectedView()\" (change)=\"selectedView.set($event.value)\">\n <mat-button-toggle value=\"itemized\">Itemized</mat-button-toggle>\n <mat-button-toggle value=\"grouped\">Grouped</mat-button-toggle>\n </mat-button-toggle-group>\n </div>\n\n <form [formGroup]=\"filterForm\" class=\"d-flex align-items-center gap-2 flex-wrap\">\n <mat-form-field>\n <mat-label>Search</mat-label>\n <input matInput formControlName=\"search\" />\n </mat-form-field>\n\n <app-timeline-filter labelText=\"Date\" formControlName=\"duration\" [form]=\"filterForm\"></app-timeline-filter>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Category</mat-label>\n <app-searchable-selector apiUrl=\"api/product-categories\" formControlName=\"category_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Measure</mat-label>\n <app-searchable-selector apiUrl=\"api/product-measures\" formControlName=\"measure_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Location</mat-label>\n <app-searchable-selector apiUrl=\"api/inventory-locations\" formControlName=\"location_ids\" [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n\n <mat-form-field class='fl-sm'>\n <mat-label>Supplier</mat-label>\n <app-searchable-selector apiUrl=\"api/suppliers\" formControlName=\"supplier_ids\" titleField=\"company_name\"\n [multiple]=\"true\">\n </app-searchable-selector>\n </mat-form-field>\n </form>\n </mat-card-content>\n</mat-card>\n} @if (product()) {\n<mat-card class=\"mb-2\">\n <mat-card-content class=\"mb-0\">\n <div class=\"d-flex justify-content-start align-items-center gap-2 mb-2\">\n <span class=\"material-symbols-outlined\"> output_circle </span>\n <h3 class=\"mb-0\">Stock Receipts</h3>\n </div>\n </mat-card-content>\n</mat-card>\n} @if (selectedView() === 'itemized') {\n<app-stock-receipt-product-list [filters]=\"filtersValue()\"\n [selectedColumns]=\"selectedColumns\" [exportInProgress]=\"exportInProgress()\"\n (columnConfigReady)=\"onColumnConfigReady($event)\" (listUpdated)=\"listUpdated.emit($event)\">\n</app-stock-receipt-product-list>\n} @if (selectedView() === 'grouped') {\n<app-stock-receipt-list [filters]=\"filtersValue()\"\n [selectedColumns]=\"selectedColumns\" [exportInProgress]=\"exportInProgress()\"\n (columnConfigReady)=\"onColumnConfigReady($event)\" (listUpdated)=\"listUpdated.emit($event)\">\n</app-stock-receipt-list>\n}",
2984
+ styles: [":host ::ng-deep .mat-mdc-footer-row{position:sticky;bottom:0;background-color:#fff;z-index:10;box-shadow:0 -2px 4px #0000001a}\n"]
2985
+ }]
2986
+ }],
2987
+ ctorParameters: () => [{ type: i2$1.FormBuilder }],
2988
+ propDecorators: {
2989
+ product: [{
2990
+ type: i0.Input,
2991
+ args: [{
2992
+ isSignal: true,
2993
+ alias: "product",
2994
+ required: false
2995
+ }]
2996
+ }],
2997
+ supplierId: [{
2998
+ type: i0.Input,
2999
+ args: [{
3000
+ isSignal: true,
3001
+ alias: "supplierId",
3002
+ required: false
3003
+ }]
3004
+ }],
3005
+ listUpdated: [{
3006
+ type: i0.Output,
3007
+ args: ["listUpdated"]
3008
+ }]
3009
+ }
3010
+ });
3011
+ var StockReceiptImportPageComponent = class StockReceiptImportPageComponent {
3012
+ importConfig = {
3013
+ apiUrl: "api/stock-receipts-import",
3014
+ title: "Stock Receipts",
3015
+ importType: "stock-receipt",
3016
+ properties: [
3017
+ {
3018
+ label: "Product",
3019
+ value: "product",
3020
+ type: "text"
3021
+ },
3022
+ {
3023
+ label: "Supplier",
3024
+ value: "supplier",
3025
+ type: "text"
3026
+ },
3027
+ {
3028
+ label: "Date",
3029
+ value: "date",
3030
+ type: "date"
3031
+ },
3032
+ {
3033
+ label: "Quantity",
3034
+ value: "quantity",
3035
+ type: "number"
3036
+ },
3037
+ {
3038
+ label: "Purchase Price",
3039
+ value: "purchase_price",
3040
+ type: "number"
3041
+ },
3042
+ {
3043
+ label: "Amount",
3044
+ value: "amount",
3045
+ type: "number"
3046
+ },
3047
+ {
3048
+ label: "Particulars",
3049
+ value: "particulars",
3050
+ type: "text"
3051
+ }
3052
+ ],
3053
+ sampleFile: {
3054
+ name: "Stock Receipt Sample",
3055
+ path: "assets/stock-receipt/stock-receipt-sample.csv"
3056
+ },
3057
+ importHistory: {
3058
+ isEnabled: true,
3059
+ type: "stock-receipt",
3060
+ apiUrl: "api/import-histories"
3061
+ },
3062
+ viewRouterLink: "/inventory/stock-receipts"
3063
+ };
3064
+ constructor() {}
3065
+ ngOnInit() {}
3066
+ static ɵfac = i0.ɵɵngDeclareFactory({
3067
+ minVersion: "12.0.0",
3068
+ version: "22.2.5",
3069
+ ngImport: i0,
3070
+ type: StockReceiptImportPageComponent,
3071
+ deps: [],
3072
+ target: i0.ɵɵFactoryTarget.Component
3073
+ });
3074
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3075
+ minVersion: "14.0.0",
3076
+ version: "22.2.5",
3077
+ type: StockReceiptImportPageComponent,
3078
+ isStandalone: true,
3079
+ selector: "app-stock-receipt-import-page",
3080
+ ngImport: i0,
3081
+ template: "<app-import-csv [config]=\"importConfig\"></app-import-csv>",
3082
+ styles: [""],
3083
+ dependencies: [
3084
+ {
3085
+ kind: "ngmodule",
3086
+ type: MaterialModule$1
3087
+ },
3088
+ {
3089
+ kind: "ngmodule",
3090
+ type: ImportCsvModule
3091
+ },
3092
+ {
3093
+ kind: "component",
3094
+ type: i1.ImportCsvComponent,
3095
+ selector: "app-import-csv",
3096
+ inputs: ["config"]
3097
+ }
3098
+ ],
3099
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
3100
+ preserveWhitespaces: true
3101
+ });
3102
+ };
3103
+ i0.ɵɵngDeclareClassMetadata({
3104
+ minVersion: "12.0.0",
3105
+ version: "22.2.5",
3106
+ ngImport: i0,
3107
+ type: StockReceiptImportPageComponent,
3108
+ decorators: [{
3109
+ type: Component,
3110
+ args: [{
3111
+ selector: "app-stock-receipt-import-page",
3112
+ changeDetection: ChangeDetectionStrategy.Eager,
3113
+ imports: [MaterialModule$1, ImportCsvModule],
3114
+ template: "<app-import-csv [config]=\"importConfig\"></app-import-csv>"
3115
+ }]
3116
+ }],
3117
+ ctorParameters: () => []
3118
+ });
3119
+ var StockReceiptViewComponent = class StockReceiptViewComponent {
3120
+ activatedRoute;
3121
+ service;
3122
+ location;
3123
+ id;
3124
+ isLoading;
3125
+ stockReceipt;
3126
+ constructor(activatedRoute, service, location) {
3127
+ this.activatedRoute = activatedRoute;
3128
+ this.service = service;
3129
+ this.location = location;
3130
+ }
3131
+ ngOnInit() {
3132
+ this.activatedRoute.params.subscribe((params) => {
3133
+ this.id = parseInt(params["id"]);
3134
+ if (this.id) this.loadData();
3135
+ });
3136
+ }
3137
+ loadData() {
3138
+ this.isLoading = true;
3139
+ this.service.show(this.id, { with: "creator,stockReceiptProducts.product,batch" }).subscribe({
3140
+ next: (response) => {
3141
+ this.stockReceipt = response?.item;
3142
+ this.isLoading = false;
3143
+ },
3144
+ error: () => {
3145
+ this.isLoading = false;
3146
+ }
3147
+ });
3148
+ }
3149
+ redirectBack() {
3150
+ this.location.back();
3151
+ }
3152
+ static ɵfac = i0.ɵɵngDeclareFactory({
3153
+ minVersion: "12.0.0",
3154
+ version: "22.2.5",
3155
+ ngImport: i0,
3156
+ type: StockReceiptViewComponent,
3157
+ deps: [
3158
+ { token: i9.ActivatedRoute },
3159
+ { token: StockReceiptService },
3160
+ { token: i13.Location }
3161
+ ],
3162
+ target: i0.ɵɵFactoryTarget.Component
3163
+ });
3164
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3165
+ minVersion: "17.0.0",
3166
+ version: "22.2.5",
3167
+ type: StockReceiptViewComponent,
3168
+ isStandalone: false,
3169
+ selector: "app-stock-receipt-view",
3170
+ ngImport: i0,
3171
+ template: "@if (isLoading) {\n<mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n} @if (stockReceipt) {\n<div class=\"d-flex flex-column justify-content-start gap-2\">\n <mat-card>\n <mat-card-content>\n <h3 class=\"mb-0\">Stock Receipt for {{ stockReceipt?.stock_receipt_products[0]?.product?.name }}</h3>\n </mat-card-content>\n </mat-card>\n <div class=\"d-flex justify-content-start align-items-start gap-2\">\n <div class=\"d-flex flex-column gap-2\" style=\"width: 350px\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> campaign </span>\n <strong class=\"mb-0 text-dark\">Information</strong>\n </div>\n <div class=\"d-flex justify-content-start align-items-center gap-2 text-secondary\">\n <app-techlify-icon role='button' name='edit'\n [routerLink]=\"['/inventory/stock-receipts/form', $safeNavigationMigration(stockReceipt?.id)]\"></app-techlify-icon>\n <app-techlify-delete-button [model]=\"stockReceipt\" [service]=\"service\"\n [data]=\"{ title: $safeNavigationMigration(stockReceipt?.id), type: 'Stock Receipt' }\"\n (deleted)=\"redirectBack()\">\n </app-techlify-delete-button>\n </div>\n </mat-card-content>\n <mat-card-content class=\"d-flex flex-column justify-content-start gap-2 mt-3\">\n <div class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex flex-column gap-0\">\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/products', $safeNavigationMigration(stockReceipt?.stock_receipt_products[0]?.product?.id), 'view']\">\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.product?.name }}</p>\n </a>\n @if (stockReceipt?.stock_receipt_products[0]?.product?.sku) {\n <small>{{\n stockReceipt?.stock_receipt_products[0]?.product?.sku }}</small>\n }\n </div>\n <div class=\"d-flex flex-column justify-content-end gap-0\">\n @if (stockReceipt?.date) {\n <small>{{ $safeNavigationMigration(stockReceipt?.date) | date }}</small>\n } @if (stockReceipt?.stock_receipt_products[0]?.batch?.expires_on)\n {\n <small techlifyFeatureEnabled=\"product-batch-numbers\">\n Expires on\n {{ $safeNavigationMigration(stockReceipt?.stock_receipt_products[0]?.batch?.expires_on) | date }}\n </small>\n }\n </div>\n </div>\n <div class=\"row\">\n @if (stockReceipt?.stock_receipt_products[0]?.purchase_price) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Purchase Price</small>\n <p class=\"mb-0\">{{ $safeNavigationMigration(stockReceipt?.stock_receipt_products[0]?.purchase_price) | currency }}</p>\n </div>\n </div>\n } @if (stockReceipt?.stock_receipt_products[0]?.supplier) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Supplier</small>\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/suppliers', $safeNavigationMigration(stockReceipt?.stock_receipt_products[0]?.supplier?.id), 'view']\">\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.supplier?.company_name }}</p>\n </a>\n </div>\n </div>\n }\n </div>\n <div class=\"row\">\n @if (stockReceipt?.stock_receipt_products[0]?.quantity) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Quantity</small>\n <div class=\"d-flex gap-1\">\n <h3 class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.quantity }}</h3>\n <small class=\"text-secondary\">{{ stockReceipt?.stock_receipt_products[0]?.product?.measure?.title\n }}</small>\n </div>\n </div>\n </div>\n } @if (stockReceipt?.stock_receipt_products[0]?.amount) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Total Value</small>\n <h3 class=\"mb-0\">{{ $safeNavigationMigration(stockReceipt?.stock_receipt_products[0]?.amount) | currency }}</h3>\n </div>\n </div>\n }\n </div>\n @if (stockReceipt?.stock_receipt_products[0]?.particulars) {\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Particulars</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.particulars }}</p>\n </div>\n </div>\n </div>\n }\n <div class=\"row\">\n @if (stockReceipt?.stock_receipt_products[0]?.location) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Location</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.location?.title }}</p>\n </div>\n </div>\n } @if (stockReceipt?.stock_receipt_products[0]?.batch) {\n <div class=\"col-6\" techlifyFeatureEnabled=\"product-batch-numbers\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Batch</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.batch?.batch_number }}</p>\n </div>\n </div>\n }\n </div>\n @if (stockReceipt?.creator) {\n <div class=\"row\">\n <div class=\"col-12\">\n <small class=\"mb-0\">\n <span class=\"text-secondary\">Created By</span> {{ stockReceipt?.creator?.name }}\n <span class=\"text-secondary\">On</span> {{ $safeNavigationMigration(stockReceipt?.created_at) | date }}\n </small>\n </div>\n </div>\n }\n </mat-card-content>\n </mat-card>\n\n <app-note-list labelText=\"Notes\" viewMode=\"timeline\" modelType=\"StockReceipt\"\n [relatedModelId]=\"$safeNavigationMigration(stockReceipt?.id)\"></app-note-list>\n </div>\n\n <div style=\"width: calc(100% - 350px - 0.5rem)\">\n <app-entity-files-view-all title=\"Document\" [entityId]=\"$safeNavigationMigration(stockReceipt?.id)\" entityType=\"StockReceipt\">\n </app-entity-files-view-all>\n </div>\n </div>\n</div>\n}",
3172
+ styles: [""],
3173
+ dependencies: [
3174
+ {
3175
+ kind: "component",
3176
+ type: i6$1.MatCard,
3177
+ selector: "mat-card",
3178
+ inputs: ["appearance"],
3179
+ exportAs: ["matCard"]
3180
+ },
3181
+ {
3182
+ kind: "directive",
3183
+ type: i6$1.MatCardContent,
3184
+ selector: "mat-card-content"
3185
+ },
3186
+ {
3187
+ kind: "component",
3188
+ type: i5.MatProgressBar,
3189
+ selector: "mat-progress-bar",
3190
+ inputs: [
3191
+ "color",
3192
+ "value",
3193
+ "bufferValue",
3194
+ "mode"
3195
+ ],
3196
+ outputs: ["animationEnd"],
3197
+ exportAs: ["matProgressBar"]
3198
+ },
3199
+ {
3200
+ kind: "directive",
3201
+ type: i9.RouterLink,
3202
+ selector: "[routerLink]",
3203
+ inputs: [
3204
+ "target",
3205
+ "queryParams",
3206
+ "fragment",
3207
+ "queryParamsHandling",
3208
+ "state",
3209
+ "info",
3210
+ "relativeTo",
3211
+ "preserveFragment",
3212
+ "skipLocationChange",
3213
+ "replaceUrl",
3214
+ "browserUrl",
3215
+ "routerLink"
3216
+ ]
3217
+ },
3218
+ {
3219
+ kind: "component",
3220
+ type: i1.EntityFileListComponent,
3221
+ selector: "app-entity-file-list, app-entity-files-view-all",
3222
+ inputs: [
3223
+ "entityId",
3224
+ "entityType",
3225
+ "viewOnly",
3226
+ "removeSearch",
3227
+ "hideTitleAndDetails",
3228
+ "displayMode",
3229
+ "allowMultipleFiles",
3230
+ "allowBulkUpdate",
3231
+ "viewMode",
3232
+ "fileDropperHeight",
3233
+ "isShowDragDropSection",
3234
+ "defaultFilters",
3235
+ "isFilterPatchFromRoute",
3236
+ "useTechlifyTags",
3237
+ "techlifyTagCategories",
3238
+ "techlifyTagConfig",
3239
+ "title",
3240
+ "permission"
3241
+ ]
3242
+ },
3243
+ {
3244
+ kind: "directive",
3245
+ type: i1.TechlifyFeatureEnabledDirective,
3246
+ selector: "[techlifyFeatureEnabled]",
3247
+ inputs: ["techlifyFeatureEnabled"]
3248
+ },
3249
+ {
3250
+ kind: "component",
3251
+ type: i1.NoteListComponent,
3252
+ selector: "app-note-list",
3253
+ inputs: [
3254
+ "relatedModelId",
3255
+ "modelType",
3256
+ "readonly",
3257
+ "labelText",
3258
+ "commentsView",
3259
+ "viewMode"
3260
+ ]
3261
+ },
3262
+ {
3263
+ kind: "component",
3264
+ type: i1.TechlifyIconComponent,
3265
+ selector: "app-techlify-icon",
3266
+ inputs: ["name", "size"]
3267
+ },
3268
+ {
3269
+ kind: "component",
3270
+ type: i1.TechlifyDeleteButtonComponent,
3271
+ selector: "app-techlify-delete-button",
3272
+ inputs: [
3273
+ "data",
3274
+ "model",
3275
+ "message",
3276
+ "service"
3277
+ ],
3278
+ outputs: ["deleted", "loading"]
3279
+ },
3280
+ {
3281
+ kind: "pipe",
3282
+ type: i13.CurrencyPipe,
3283
+ name: "currency"
3284
+ },
3285
+ {
3286
+ kind: "pipe",
3287
+ type: i13.DatePipe,
3288
+ name: "date"
3289
+ }
3290
+ ],
3291
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
3292
+ preserveWhitespaces: true
3293
+ });
3294
+ };
3295
+ i0.ɵɵngDeclareClassMetadata({
3296
+ minVersion: "12.0.0",
3297
+ version: "22.2.5",
3298
+ ngImport: i0,
3299
+ type: StockReceiptViewComponent,
3300
+ decorators: [{
3301
+ type: Component,
3302
+ args: [{
3303
+ selector: "app-stock-receipt-view",
3304
+ changeDetection: ChangeDetectionStrategy.Eager,
3305
+ standalone: false,
3306
+ template: "@if (isLoading) {\n<mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n} @if (stockReceipt) {\n<div class=\"d-flex flex-column justify-content-start gap-2\">\n <mat-card>\n <mat-card-content>\n <h3 class=\"mb-0\">Stock Receipt for {{ stockReceipt?.stock_receipt_products[0]?.product?.name }}</h3>\n </mat-card-content>\n </mat-card>\n <div class=\"d-flex justify-content-start align-items-start gap-2\">\n <div class=\"d-flex flex-column gap-2\" style=\"width: 350px\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> campaign </span>\n <strong class=\"mb-0 text-dark\">Information</strong>\n </div>\n <div class=\"d-flex justify-content-start align-items-center gap-2 text-secondary\">\n <app-techlify-icon role='button' name='edit'\n [routerLink]=\"['/inventory/stock-receipts/form', $safeNavigationMigration(stockReceipt?.id)]\"></app-techlify-icon>\n <app-techlify-delete-button [model]=\"stockReceipt\" [service]=\"service\"\n [data]=\"{ title: $safeNavigationMigration(stockReceipt?.id), type: 'Stock Receipt' }\"\n (deleted)=\"redirectBack()\">\n </app-techlify-delete-button>\n </div>\n </mat-card-content>\n <mat-card-content class=\"d-flex flex-column justify-content-start gap-2 mt-3\">\n <div class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex flex-column gap-0\">\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/products', $safeNavigationMigration(stockReceipt?.stock_receipt_products[0]?.product?.id), 'view']\">\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.product?.name }}</p>\n </a>\n @if (stockReceipt?.stock_receipt_products[0]?.product?.sku) {\n <small>{{\n stockReceipt?.stock_receipt_products[0]?.product?.sku }}</small>\n }\n </div>\n <div class=\"d-flex flex-column justify-content-end gap-0\">\n @if (stockReceipt?.date) {\n <small>{{ $safeNavigationMigration(stockReceipt?.date) | date }}</small>\n } @if (stockReceipt?.stock_receipt_products[0]?.batch?.expires_on)\n {\n <small techlifyFeatureEnabled=\"product-batch-numbers\">\n Expires on\n {{ $safeNavigationMigration(stockReceipt?.stock_receipt_products[0]?.batch?.expires_on) | date }}\n </small>\n }\n </div>\n </div>\n <div class=\"row\">\n @if (stockReceipt?.stock_receipt_products[0]?.purchase_price) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Purchase Price</small>\n <p class=\"mb-0\">{{ $safeNavigationMigration(stockReceipt?.stock_receipt_products[0]?.purchase_price) | currency }}</p>\n </div>\n </div>\n } @if (stockReceipt?.stock_receipt_products[0]?.supplier) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Supplier</small>\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/suppliers', $safeNavigationMigration(stockReceipt?.stock_receipt_products[0]?.supplier?.id), 'view']\">\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.supplier?.company_name }}</p>\n </a>\n </div>\n </div>\n }\n </div>\n <div class=\"row\">\n @if (stockReceipt?.stock_receipt_products[0]?.quantity) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Quantity</small>\n <div class=\"d-flex gap-1\">\n <h3 class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.quantity }}</h3>\n <small class=\"text-secondary\">{{ stockReceipt?.stock_receipt_products[0]?.product?.measure?.title\n }}</small>\n </div>\n </div>\n </div>\n } @if (stockReceipt?.stock_receipt_products[0]?.amount) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Total Value</small>\n <h3 class=\"mb-0\">{{ $safeNavigationMigration(stockReceipt?.stock_receipt_products[0]?.amount) | currency }}</h3>\n </div>\n </div>\n }\n </div>\n @if (stockReceipt?.stock_receipt_products[0]?.particulars) {\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Particulars</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.particulars }}</p>\n </div>\n </div>\n </div>\n }\n <div class=\"row\">\n @if (stockReceipt?.stock_receipt_products[0]?.location) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Location</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.location?.title }}</p>\n </div>\n </div>\n } @if (stockReceipt?.stock_receipt_products[0]?.batch) {\n <div class=\"col-6\" techlifyFeatureEnabled=\"product-batch-numbers\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Batch</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.batch?.batch_number }}</p>\n </div>\n </div>\n }\n </div>\n @if (stockReceipt?.creator) {\n <div class=\"row\">\n <div class=\"col-12\">\n <small class=\"mb-0\">\n <span class=\"text-secondary\">Created By</span> {{ stockReceipt?.creator?.name }}\n <span class=\"text-secondary\">On</span> {{ $safeNavigationMigration(stockReceipt?.created_at) | date }}\n </small>\n </div>\n </div>\n }\n </mat-card-content>\n </mat-card>\n\n <app-note-list labelText=\"Notes\" viewMode=\"timeline\" modelType=\"StockReceipt\"\n [relatedModelId]=\"$safeNavigationMigration(stockReceipt?.id)\"></app-note-list>\n </div>\n\n <div style=\"width: calc(100% - 350px - 0.5rem)\">\n <app-entity-files-view-all title=\"Document\" [entityId]=\"$safeNavigationMigration(stockReceipt?.id)\" entityType=\"StockReceipt\">\n </app-entity-files-view-all>\n </div>\n </div>\n</div>\n}"
3307
+ }]
3308
+ }],
3309
+ ctorParameters: () => [
3310
+ { type: i9.ActivatedRoute },
3311
+ { type: StockReceiptService },
3312
+ { type: i13.Location }
3313
+ ]
3314
+ });
3315
+ var StockReceiptFormComponent = class StockReceiptFormComponent extends TechlifyFormComponent {
3316
+ formValidatorService;
3317
+ fb;
3318
+ stockReceiptService;
3319
+ router;
3320
+ route;
3321
+ locationService;
3322
+ location;
3323
+ locationCount = signal(0, ...ngDevMode ? [{ debugName: "locationCount" }] : /* istanbul ignore next */ []);
3324
+ stockReceiptId = signal(null, ...ngDevMode ? [{ debugName: "stockReceiptId" }] : /* istanbul ignore next */ []);
3325
+ stockReceipt = signal(null, ...ngDevMode ? [{ debugName: "stockReceipt" }] : /* istanbul ignore next */ []);
3326
+ constructor(formValidatorService, fb, stockReceiptService, router, route, locationService, location) {
3327
+ super(formValidatorService);
3328
+ this.formValidatorService = formValidatorService;
3329
+ this.fb = fb;
3330
+ this.stockReceiptService = stockReceiptService;
3331
+ this.router = router;
3332
+ this.route = route;
3333
+ this.locationService = locationService;
3334
+ this.location = location;
3335
+ this.errorMessages = {
3336
+ supplier_id: { required: "The supplier field is required." },
3337
+ date: { required: "The date field is required." },
3338
+ details: { required: "The particulars field is required." }
3339
+ };
3340
+ this.form = this.fb.group({
3341
+ supplier_id: ["", Validators.compose([Validators.required])],
3342
+ date: [/* @__PURE__ */ new Date(), Validators.compose([Validators.required])],
3343
+ details: [""],
3344
+ stock_receipt_products: this.fb.array([])
3345
+ });
3346
+ }
3347
+ ngOnInit() {
3348
+ this.locationService.count().subscribe((count) => {
3349
+ this.locationCount.set(count);
3350
+ });
3351
+ const id = this.route.snapshot.paramMap.get("id");
3352
+ if (id) {
3353
+ this.stockReceiptId.set(+id);
3354
+ this.loadStockReceipt(+id);
3355
+ } else this.addStockReceiptProduct();
3356
+ }
3357
+ loadStockReceipt(id) {
3358
+ this.isWorking = true;
3359
+ this.stockReceiptService.show(id, { with: "stockReceiptProducts.product,stockReceiptProducts.location" }).subscribe({
3360
+ next: (response) => {
3361
+ this.isWorking = false;
3362
+ this.stockReceipt.set(response.item);
3363
+ },
3364
+ error: () => {
3365
+ this.isWorking = false;
3366
+ },
3367
+ complete: () => {
3368
+ this.form.patchValue({
3369
+ supplier_id: this.stockReceipt().supplier_id,
3370
+ date: this.stockReceipt().date ? new Date(this.stockReceipt().date) : /* @__PURE__ */ new Date(),
3371
+ details: this.stockReceipt().details
3372
+ });
3373
+ this.stockReceiptProducts.clear();
3374
+ this.stockReceipt().stock_receipt_products?.forEach((srp) => {
3375
+ const group = this.createStockReceiptProduct();
3376
+ group.patchValue({
3377
+ id: srp.id,
3378
+ product_id: srp.product_id,
3379
+ location_id: srp.location_id,
3380
+ quantity: srp.quantity,
3381
+ purchase_price: srp.purchase_price,
3382
+ total_amount: (srp.quantity || 0) * (srp.purchase_price || 0),
3383
+ particulars: srp.particulars
3384
+ });
3385
+ const index = this.stockReceiptProducts.length;
3386
+ group.get("quantity")?.valueChanges.pipe(debounceTime(300)).subscribe(() => this.updateRowTotal(index));
3387
+ group.get("purchase_price")?.valueChanges.pipe(debounceTime(300)).subscribe(() => this.updateRowTotal(index));
3388
+ this.stockReceiptProducts.push(group);
3389
+ });
3390
+ }
3391
+ });
3392
+ }
3393
+ get stockReceiptProducts() {
3394
+ return this.form.get("stock_receipt_products");
3395
+ }
3396
+ createStockReceiptProduct() {
3397
+ return this.fb.group({
3398
+ id: [""],
3399
+ product_id: ["", Validators.required],
3400
+ location_id: ["", this.locationCount() > 0 ? Validators.required : null],
3401
+ quantity: [0, [Validators.required, Validators.min(0)]],
3402
+ purchase_price: [0, [Validators.required, Validators.min(0)]],
3403
+ total_amount: [{
3404
+ value: 0,
3405
+ disabled: true
3406
+ }],
3407
+ particulars: [""]
3408
+ });
3409
+ }
3410
+ getSelectedProduct(index) {
3411
+ return this.stockReceipt()?.stock_receipt_products?.find((sr) => sr.id === this.stockReceiptProducts.at(index)?.get("id")?.value)?.product;
3412
+ }
3413
+ getSelectedLocation(index) {
3414
+ return this.stockReceipt()?.stock_receipt_products?.find((sr) => sr.id === this.stockReceiptProducts.at(index)?.get("id")?.value)?.location;
3415
+ }
3416
+ addStockReceiptProduct() {
3417
+ const group = this.createStockReceiptProduct();
3418
+ const index = this.stockReceiptProducts.length;
3419
+ group.get("quantity")?.valueChanges.pipe(debounceTime(300)).subscribe(() => this.updateRowTotal(index));
3420
+ group.get("purchase_price")?.valueChanges.pipe(debounceTime(300)).subscribe(() => this.updateRowTotal(index));
3421
+ this.stockReceiptProducts.push(group);
3422
+ }
3423
+ removeStockReceiptProduct(index) {
3424
+ this.stockReceiptProducts.removeAt(index);
3425
+ }
3426
+ clearProducts() {
3427
+ this.stockReceiptProducts.clear();
3428
+ }
3429
+ getRowTotal(index) {
3430
+ const row = this.stockReceiptProducts.at(index);
3431
+ if (!row) return 0;
3432
+ return row.get("quantity")?.value * row.get("purchase_price")?.value;
3433
+ }
3434
+ updateRowTotal(index) {
3435
+ this.stockReceiptProducts.at(index)?.get("total_amount")?.setValue(this.getRowTotal(index));
3436
+ }
3437
+ save() {
3438
+ if (this.form.invalid) {
3439
+ this.form.markAllAsTouched();
3440
+ this.form.markAsDirty();
3441
+ this.alertService.addAlert("Please check the form for errors.", "error");
3442
+ return;
3443
+ }
3444
+ if (this.stockReceiptProducts.length === 0) {
3445
+ this.alertService.addAlert("Please add at least one product.", "error");
3446
+ return;
3447
+ }
3448
+ const formData = this.form.getRawValue();
3449
+ const data = {
3450
+ id: this.stockReceipt()?.id ?? null,
3451
+ date: moment(formData.date).format("YYYY-MM-DD"),
3452
+ supplier_id: formData.supplier_id,
3453
+ details: formData.details,
3454
+ products: formData.stock_receipt_products.map((row) => ({
3455
+ id: row.product_id,
3456
+ product_id: row.product_id,
3457
+ supplier_id: formData.supplier_id,
3458
+ quantity: row.quantity,
3459
+ purchase_price: row.purchase_price,
3460
+ amount: (parseFloat(row.quantity) || 0) * (parseFloat(row.purchase_price) || 0),
3461
+ location_id: row.location_id,
3462
+ particulars: row.particulars
3463
+ }))
3464
+ };
3465
+ this.isWorking = true;
3466
+ (this.stockReceipt()?.id ? this.stockReceiptService.update(data) : this.stockReceiptService.store(data)).subscribe({
3467
+ next: () => {
3468
+ this.isWorking = false;
3469
+ this.alertService.addAlert("Stock receipts saved successfully!", "success");
3470
+ this.location.back();
3471
+ },
3472
+ error: () => {
3473
+ this.isWorking = false;
3474
+ }
3475
+ });
3476
+ }
3477
+ cancel() {
3478
+ this.location.back();
3479
+ }
3480
+ static ɵfac = i0.ɵɵngDeclareFactory({
3481
+ minVersion: "12.0.0",
3482
+ version: "22.2.5",
3483
+ ngImport: i0,
3484
+ type: StockReceiptFormComponent,
3485
+ deps: [
3486
+ { token: i1.FormValidatorService },
3487
+ { token: i2$1.FormBuilder },
3488
+ { token: StockReceiptService },
3489
+ { token: i9.Router },
3490
+ { token: i9.ActivatedRoute },
3491
+ { token: LocationService },
3492
+ { token: i13.Location }
3493
+ ],
3494
+ target: i0.ɵɵFactoryTarget.Component
3495
+ });
3496
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3497
+ minVersion: "17.0.0",
3498
+ version: "22.2.5",
3499
+ type: StockReceiptFormComponent,
3500
+ isStandalone: true,
3501
+ selector: "app-stock-receipt-form",
3502
+ usesInheritance: true,
3503
+ ngImport: i0,
3504
+ template: "<mat-card class=\"d-flex flex-column gap-2 container\">\n <mat-card-content>\n\n <div class=\"d-flex flex-column gap-1\">\n <h5>\n <span class=\"material-symbols-outlined align-middle\">download</span>\n Receive Stock\n </h5>\n </div>\n\n <form class=\"d-flex flex-column gap-2\" [formGroup]=\"form\" (submit)=\"save()\">\n\n <div class=\"d-flex flex-column\">\n <div class=\"d-flex flex-row gap-2 justify-content-between\">\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Supplier</mat-label>\n <app-searchable-selector apiUrl='api/suppliers' formControlName=\"supplier_id\"\n titleField='company_name' required></app-searchable-selector>\n @if (isFieldValid('supplier_id')) {\n <mat-error>{{ getErrorMessage('supplier_id') }}</mat-error>\n }\n </mat-form-field>\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Date</mat-label>\n <input matInput [matDatepicker]=\"picker\" placeholder=\"Date\" formControlName=\"date\" required>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n @if (isFieldValid('date')) {\n <mat-error>{{ getErrorMessage('date') }}</mat-error>\n }\n </mat-form-field>\n </div>\n\n <div class=\"d-flex flex-row gap-2 justify-content-between\">\n <div class=\"w-50\">\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Particulars</mat-label>\n <textarea matInput placeholder=\"Particulars\" formControlName=\"details\"></textarea>\n </mat-form-field>\n </div>\n </div>\n </div>\n\n <table class=\"table mt-3\">\n <thead>\n <tr>\n <th scope=\"col\">#</th>\n <th scope=\"col\">Product</th>\n @if (locationCount() > 0) {\n <th scope=\"col\">Location</th>\n }\n <th scope=\"col\">Quantity</th>\n <th scope=\"col\">Purchase Price</th>\n <th scope=\"col\">Total Value</th>\n <th scope=\"col\">Particulars</th>\n <th scope=\"col\" class=\"text-center\" width=\"50\"></th>\n </tr>\n </thead>\n <tbody formArrayName=\"stock_receipt_products\">\n @for (row of stockReceiptProducts.controls; track row; let i = $index)\n {\n <tr [formGroupName]=\"i\">\n <th scope=\"row\">{{ i + 1 }}</th>\n <td>\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Product</mat-label>\n <app-searchable-selector apiUrl='api/products' formControlName=\"product_id\"\n titleField='name' [cache]=\"true\" [selectedValue]=\"getSelectedProduct(i)\"\n required></app-searchable-selector>\n </mat-form-field>\n </td>\n @if (locationCount() > 0) {\n <td>\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Location</mat-label>\n <app-searchable-selector apiUrl='api/inventory-locations?status_ids=1'\n formControlName=\"location_id\" titleField='title'\n [selectedValue]=\"getSelectedLocation(i)\"></app-searchable-selector>\n </mat-form-field>\n </td>\n }\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" min=\"0\" type=\"number\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Purchase Price</mat-label>\n <input matInput formControlName=\"purchase_price\" type=\"number\" min=\"0\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Total Value</mat-label>\n <input matInput [value]=\"getRowTotal(i) | currency\" readonly>\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline'>\n <mat-label>Particulars</mat-label>\n <input matInput formControlName=\"particulars\">\n </mat-form-field>\n </td>\n <td class=\"text-center align-middle\">\n <div class=\"d-flex gap-2 justify-content-center align-items-center text-secondary\">\n <app-techlify-icon role='button' name='delete' (click)=\"removeStockReceiptProduct(i)\"\n matTooltip=\"Remove row\"></app-techlify-icon>\n </div>\n </td>\n </tr>\n }\n </tbody>\n <tfoot>\n <tr>\n <td colspan=\"8\" class=\"text-end\">\n <div class=\"d-flex flex-row gap-2 justify-content-end\">\n <button mat-button color=\"primary\" type=\"button\" (click)=\"clearProducts()\"\n [disabled]=\"stockReceiptProducts.length === 0\">\n <mat-icon>block</mat-icon> CLEAR ALL\n </button>\n <button mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"addStockReceiptProduct()\">\n <mat-icon>add</mat-icon> ADD\n </button>\n </div>\n </td>\n </tr>\n </tfoot>\n </table>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2 mt-2\">\n <button [disabled]=\"isWorking\" mat-flat-button type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button [disabled]=\"isWorking || stockReceiptProducts.length === 0\" mat-raised-button color=\"primary\"\n type=\"submit\">Save</button>\n </div>\n\n </form>\n\n </mat-card-content>\n</mat-card>\n",
3505
+ dependencies: [
3506
+ {
3507
+ kind: "ngmodule",
3508
+ type: CommonModule
3509
+ },
3510
+ {
3511
+ kind: "ngmodule",
3512
+ type: ReactiveFormsModule
3513
+ },
3514
+ {
3515
+ kind: "directive",
3516
+ type: i2$1.ɵNgNoValidate,
3517
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
3518
+ },
3519
+ {
3520
+ kind: "directive",
3521
+ type: i2$1.DefaultValueAccessor,
3522
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
3523
+ },
3524
+ {
3525
+ kind: "directive",
3526
+ type: i2$1.NumberValueAccessor,
3527
+ selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
3528
+ },
3529
+ {
3530
+ kind: "directive",
3531
+ type: i2$1.NgControlStatus,
3532
+ selector: "[formControlName],[ngModel],[formControl]"
3533
+ },
3534
+ {
3535
+ kind: "directive",
3536
+ type: i2$1.NgControlStatusGroup,
3537
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
3538
+ },
3539
+ {
3540
+ kind: "directive",
3541
+ type: i2$1.RequiredValidator,
3542
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
3543
+ inputs: ["required"]
3544
+ },
3545
+ {
3546
+ kind: "directive",
3547
+ type: i2$1.MinValidator,
3548
+ selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
3549
+ inputs: ["min"]
3550
+ },
3551
+ {
3552
+ kind: "directive",
3553
+ type: i2$1.FormGroupDirective,
3554
+ selector: "[formGroup]",
3555
+ inputs: ["formGroup"],
3556
+ outputs: ["ngSubmit"],
3557
+ exportAs: ["ngForm"]
3558
+ },
3559
+ {
3560
+ kind: "directive",
3561
+ type: i2$1.FormControlName,
3562
+ selector: "[formControlName]",
3563
+ inputs: [
3564
+ "formControlName",
3565
+ "disabled",
3566
+ "ngModel"
3567
+ ],
3568
+ outputs: ["ngModelChange"]
3569
+ },
3570
+ {
3571
+ kind: "directive",
3572
+ type: i2$1.FormGroupName,
3573
+ selector: "[formGroupName]",
3574
+ inputs: ["formGroupName"]
3575
+ },
3576
+ {
3577
+ kind: "directive",
3578
+ type: i2$1.FormArrayName,
3579
+ selector: "[formArrayName]",
3580
+ inputs: ["formArrayName"]
3581
+ },
3582
+ {
3583
+ kind: "ngmodule",
3584
+ type: MaterialModule$1
3585
+ },
3586
+ {
3587
+ kind: "component",
3588
+ type: i5$1.MatButton,
3589
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
3590
+ inputs: ["matButton"],
3591
+ exportAs: ["matButton", "matAnchor"]
3592
+ },
3593
+ {
3594
+ kind: "component",
3595
+ type: i6$1.MatCard,
3596
+ selector: "mat-card",
3597
+ inputs: ["appearance"],
3598
+ exportAs: ["matCard"]
3599
+ },
3600
+ {
3601
+ kind: "directive",
3602
+ type: i6$1.MatCardContent,
3603
+ selector: "mat-card-content"
3604
+ },
3605
+ {
3606
+ kind: "component",
3607
+ type: i8$1.MatDatepicker,
3608
+ selector: "mat-datepicker",
3609
+ exportAs: ["matDatepicker"]
3610
+ },
3611
+ {
3612
+ kind: "directive",
3613
+ type: i8$1.MatDatepickerInput,
3614
+ selector: "input[matDatepicker]",
3615
+ inputs: [
3616
+ "matDatepicker",
3617
+ "min",
3618
+ "max",
3619
+ "matDatepickerFilter"
3620
+ ],
3621
+ exportAs: ["matDatepickerInput"]
3622
+ },
3623
+ {
3624
+ kind: "component",
3625
+ type: i8$1.MatDatepickerToggle,
3626
+ selector: "mat-datepicker-toggle",
3627
+ inputs: [
3628
+ "for",
3629
+ "tabIndex",
3630
+ "aria-label",
3631
+ "disabled",
3632
+ "disableRipple"
3633
+ ],
3634
+ exportAs: ["matDatepickerToggle"]
3635
+ },
3636
+ {
3637
+ kind: "component",
3638
+ type: i8$2.MatFormField,
3639
+ selector: "mat-form-field",
3640
+ inputs: [
3641
+ "hideRequiredMarker",
3642
+ "color",
3643
+ "floatLabel",
3644
+ "appearance",
3645
+ "subscriptSizing",
3646
+ "hintLabel"
3647
+ ],
3648
+ exportAs: ["matFormField"]
3649
+ },
3650
+ {
3651
+ kind: "directive",
3652
+ type: i8$2.MatLabel,
3653
+ selector: "mat-label"
3654
+ },
3655
+ {
3656
+ kind: "directive",
3657
+ type: i8$2.MatError,
3658
+ selector: "mat-error, [matError]",
3659
+ inputs: ["id"]
3660
+ },
3661
+ {
3662
+ kind: "directive",
3663
+ type: i8$2.MatSuffix,
3664
+ selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
3665
+ inputs: ["matTextSuffix"]
3666
+ },
3667
+ {
3668
+ kind: "component",
3669
+ type: i11.MatIcon,
3670
+ selector: "mat-icon",
3671
+ inputs: [
3672
+ "color",
3673
+ "inline",
3674
+ "svgIcon",
3675
+ "fontSet",
3676
+ "fontIcon"
3677
+ ],
3678
+ exportAs: ["matIcon"]
3679
+ },
3680
+ {
3681
+ kind: "directive",
3682
+ type: i9$1.MatInput,
3683
+ selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
3684
+ inputs: [
3685
+ "disabled",
3686
+ "id",
3687
+ "placeholder",
3688
+ "name",
3689
+ "required",
3690
+ "type",
3691
+ "errorStateMatcher",
3692
+ "aria-describedby",
3693
+ "value",
3694
+ "readonly",
3695
+ "disabledInteractive"
3696
+ ],
3697
+ exportAs: ["matInput"]
3698
+ },
3699
+ {
3700
+ kind: "directive",
3701
+ type: i8.MatTooltip,
3702
+ selector: "[matTooltip]",
3703
+ inputs: [
3704
+ "matTooltipPosition",
3705
+ "matTooltipPositionAtOrigin",
3706
+ "matTooltipDisabled",
3707
+ "matTooltipShowDelay",
3708
+ "matTooltipHideDelay",
3709
+ "matTooltipTouchGestures",
3710
+ "matTooltip",
3711
+ "matTooltipClass"
3712
+ ],
3713
+ exportAs: ["matTooltip"]
3714
+ },
3715
+ {
3716
+ kind: "ngmodule",
3717
+ type: SearchableSelectorModule
3718
+ },
3719
+ {
3720
+ kind: "component",
3721
+ type: i1.SearchableSelectorComponent,
3722
+ selector: "app-searchable-selector",
3723
+ inputs: [
3724
+ "valueField",
3725
+ "titleField",
3726
+ "subtitleField",
3727
+ "apiUrl",
3728
+ "multiple",
3729
+ "selectedValue",
3730
+ "enableSearch",
3731
+ "add",
3732
+ "addConfig",
3733
+ "edit",
3734
+ "editConfig",
3735
+ "sort",
3736
+ "sortBy",
3737
+ "searchField",
3738
+ "itemComponent",
3739
+ "items",
3740
+ "apiDataProperty",
3741
+ "cache",
3742
+ "perPage",
3743
+ "inDataSearch",
3744
+ "panelWidth",
3745
+ "focusSearchOnOpen",
3746
+ "isEmitInitialEvent",
3747
+ "required",
3748
+ "disabled",
3749
+ "value"
3750
+ ],
3751
+ outputs: [
3752
+ "selectedValueChange",
3753
+ "selectionChange",
3754
+ "itemsChange",
3755
+ "isItemsEmpty"
3756
+ ]
3757
+ },
3758
+ {
3759
+ kind: "ngmodule",
3760
+ type: TechlifyIconModule
3761
+ },
3762
+ {
3763
+ kind: "component",
3764
+ type: i1.TechlifyIconComponent,
3765
+ selector: "app-techlify-icon",
3766
+ inputs: ["name", "size"]
3767
+ },
3768
+ {
3769
+ kind: "pipe",
3770
+ type: i13.CurrencyPipe,
3771
+ name: "currency"
3772
+ }
3773
+ ],
3774
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
3775
+ preserveWhitespaces: true
3776
+ });
3777
+ };
3778
+ i0.ɵɵngDeclareClassMetadata({
3779
+ minVersion: "12.0.0",
3780
+ version: "22.2.5",
3781
+ ngImport: i0,
3782
+ type: StockReceiptFormComponent,
3783
+ decorators: [{
3784
+ type: Component,
3785
+ args: [{
3786
+ selector: "app-stock-receipt-form",
3787
+ changeDetection: ChangeDetectionStrategy.Eager,
3788
+ imports: [
3789
+ CommonModule,
3790
+ ReactiveFormsModule,
3791
+ MaterialModule$1,
3792
+ SearchableSelectorModule,
3793
+ TechlifyIconModule
3794
+ ],
3795
+ template: "<mat-card class=\"d-flex flex-column gap-2 container\">\n <mat-card-content>\n\n <div class=\"d-flex flex-column gap-1\">\n <h5>\n <span class=\"material-symbols-outlined align-middle\">download</span>\n Receive Stock\n </h5>\n </div>\n\n <form class=\"d-flex flex-column gap-2\" [formGroup]=\"form\" (submit)=\"save()\">\n\n <div class=\"d-flex flex-column\">\n <div class=\"d-flex flex-row gap-2 justify-content-between\">\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Supplier</mat-label>\n <app-searchable-selector apiUrl='api/suppliers' formControlName=\"supplier_id\"\n titleField='company_name' required></app-searchable-selector>\n @if (isFieldValid('supplier_id')) {\n <mat-error>{{ getErrorMessage('supplier_id') }}</mat-error>\n }\n </mat-form-field>\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Date</mat-label>\n <input matInput [matDatepicker]=\"picker\" placeholder=\"Date\" formControlName=\"date\" required>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n @if (isFieldValid('date')) {\n <mat-error>{{ getErrorMessage('date') }}</mat-error>\n }\n </mat-form-field>\n </div>\n\n <div class=\"d-flex flex-row gap-2 justify-content-between\">\n <div class=\"w-50\">\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Particulars</mat-label>\n <textarea matInput placeholder=\"Particulars\" formControlName=\"details\"></textarea>\n </mat-form-field>\n </div>\n </div>\n </div>\n\n <table class=\"table mt-3\">\n <thead>\n <tr>\n <th scope=\"col\">#</th>\n <th scope=\"col\">Product</th>\n @if (locationCount() > 0) {\n <th scope=\"col\">Location</th>\n }\n <th scope=\"col\">Quantity</th>\n <th scope=\"col\">Purchase Price</th>\n <th scope=\"col\">Total Value</th>\n <th scope=\"col\">Particulars</th>\n <th scope=\"col\" class=\"text-center\" width=\"50\"></th>\n </tr>\n </thead>\n <tbody formArrayName=\"stock_receipt_products\">\n @for (row of stockReceiptProducts.controls; track row; let i = $index)\n {\n <tr [formGroupName]=\"i\">\n <th scope=\"row\">{{ i + 1 }}</th>\n <td>\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Product</mat-label>\n <app-searchable-selector apiUrl='api/products' formControlName=\"product_id\"\n titleField='name' [cache]=\"true\" [selectedValue]=\"getSelectedProduct(i)\"\n required></app-searchable-selector>\n </mat-form-field>\n </td>\n @if (locationCount() > 0) {\n <td>\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Location</mat-label>\n <app-searchable-selector apiUrl='api/inventory-locations?status_ids=1'\n formControlName=\"location_id\" titleField='title'\n [selectedValue]=\"getSelectedLocation(i)\"></app-searchable-selector>\n </mat-form-field>\n </td>\n }\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" min=\"0\" type=\"number\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Purchase Price</mat-label>\n <input matInput formControlName=\"purchase_price\" type=\"number\" min=\"0\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Total Value</mat-label>\n <input matInput [value]=\"getRowTotal(i) | currency\" readonly>\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline'>\n <mat-label>Particulars</mat-label>\n <input matInput formControlName=\"particulars\">\n </mat-form-field>\n </td>\n <td class=\"text-center align-middle\">\n <div class=\"d-flex gap-2 justify-content-center align-items-center text-secondary\">\n <app-techlify-icon role='button' name='delete' (click)=\"removeStockReceiptProduct(i)\"\n matTooltip=\"Remove row\"></app-techlify-icon>\n </div>\n </td>\n </tr>\n }\n </tbody>\n <tfoot>\n <tr>\n <td colspan=\"8\" class=\"text-end\">\n <div class=\"d-flex flex-row gap-2 justify-content-end\">\n <button mat-button color=\"primary\" type=\"button\" (click)=\"clearProducts()\"\n [disabled]=\"stockReceiptProducts.length === 0\">\n <mat-icon>block</mat-icon> CLEAR ALL\n </button>\n <button mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"addStockReceiptProduct()\">\n <mat-icon>add</mat-icon> ADD\n </button>\n </div>\n </td>\n </tr>\n </tfoot>\n </table>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2 mt-2\">\n <button [disabled]=\"isWorking\" mat-flat-button type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button [disabled]=\"isWorking || stockReceiptProducts.length === 0\" mat-raised-button color=\"primary\"\n type=\"submit\">Save</button>\n </div>\n\n </form>\n\n </mat-card-content>\n</mat-card>\n"
3796
+ }]
3797
+ }],
3798
+ ctorParameters: () => [
3799
+ { type: i1.FormValidatorService },
3800
+ { type: i2$1.FormBuilder },
3801
+ { type: StockReceiptService },
3802
+ { type: i9.Router },
3803
+ { type: i9.ActivatedRoute },
3804
+ { type: LocationService },
3805
+ { type: i13.Location }
3806
+ ]
3807
+ });
3808
+ var StockReceiptProductViewComponent = class StockReceiptProductViewComponent {
3809
+ activatedRoute;
3810
+ service;
3811
+ location;
3812
+ id;
3813
+ isLoading;
3814
+ model;
3815
+ constructor(activatedRoute, service, location) {
3816
+ this.activatedRoute = activatedRoute;
3817
+ this.service = service;
3818
+ this.location = location;
3819
+ }
3820
+ ngOnInit() {
3821
+ this.activatedRoute.params.subscribe((params) => {
3822
+ this.id = parseInt(params["id"]);
3823
+ if (this.id) this.loadData();
3824
+ });
3825
+ }
3826
+ loadData() {
3827
+ this.isLoading = true;
3828
+ this.service.show(this.id).subscribe({
3829
+ next: (response) => {
3830
+ this.model = response?.item;
3831
+ this.isLoading = false;
3832
+ },
3833
+ error: () => {
3834
+ this.isLoading = false;
3835
+ }
3836
+ });
3837
+ }
3838
+ redirectBack() {
3839
+ this.location.back();
3840
+ }
3841
+ static ɵfac = i0.ɵɵngDeclareFactory({
3842
+ minVersion: "12.0.0",
3843
+ version: "22.2.5",
3844
+ ngImport: i0,
3845
+ type: StockReceiptProductViewComponent,
3846
+ deps: [
3847
+ { token: i9.ActivatedRoute },
3848
+ { token: StockReceiptProductService },
3849
+ { token: i13.Location }
3850
+ ],
3851
+ target: i0.ɵɵFactoryTarget.Component
3852
+ });
3853
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3854
+ minVersion: "17.0.0",
3855
+ version: "22.2.5",
3856
+ type: StockReceiptProductViewComponent,
3857
+ isStandalone: true,
3858
+ selector: "app-stock-receipt-product-view",
3859
+ ngImport: i0,
3860
+ template: "@if (isLoading) {\n<mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n} @if (model) {\n<div class=\"d-flex flex-column justify-content-start gap-2\">\n <mat-card>\n <mat-card-content>\n <h3 class=\"mb-0\">Stock Receipt for {{ model?.product?.name }}</h3>\n </mat-card-content>\n </mat-card>\n <div class=\"d-flex justify-content-start align-items-start gap-2\">\n <div class=\"d-flex flex-column gap-2\" style=\"width: 350px\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> campaign </span>\n <strong class=\"mb-0 text-dark\">Information</strong>\n </div>\n <div class=\"d-flex justify-content-start align-items-center gap-2 text-secondary\">\n <app-techlify-icon name=\"edit\" role=\"button\"\n [routerLink]=\"['/inventory/stock-receipts/form', $safeNavigationMigration(model?.stock_receipt_id)]\"></app-techlify-icon>\n <app-techlify-delete-button [model]=\"model\" [service]=\"service\"\n [data]=\"{ title: $safeNavigationMigration(model?.product?.name), type: 'Stock Receipt Product' }\"\n (deleted)=\"redirectBack()\"\n >\n </app-techlify-delete-button>\n </div>\n </mat-card-content>\n <mat-card-content class=\"d-flex flex-column justify-content-start gap-2 mt-3\">\n <div class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex flex-column gap-0\">\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/products', $safeNavigationMigration(model?.product?.id), 'view']\">\n <p class=\"mb-0\">{{ model?.product?.name }}</p>\n </a>\n @if (model?.product?.sku) {\n <small>{{ model?.product?.sku }}</small>\n }\n </div>\n <div class=\"d-flex flex-column justify-content-end gap-0\">\n @if (model?.stock_receipt?.date) {\n <small>{{ $safeNavigationMigration(model?.stock_receipt?.date) | date }}</small>\n } @if (model?.batch?.expires_on) {\n <small techlifyFeatureEnabled=\"product-batch-numbers\">\n Expires on\n {{ $safeNavigationMigration(model?.batch?.expires_on) | date }}\n </small>\n }\n </div>\n </div>\n\n <div class=\"row\">\n @if (model?.purchase_price) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Purchase Price</small>\n <p class=\"mb-0\">{{ $safeNavigationMigration(model?.purchase_price) | currency }}</p>\n </div>\n </div>\n } @if (model?.stock_receipt?.supplier) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Supplier</small>\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/suppliers', $safeNavigationMigration(model?.stock_receipt?.supplier?.id), 'view']\">\n <p class=\"mb-0\">{{ model?.stock_receipt?.supplier?.company_name }}</p>\n </a>\n </div>\n </div>\n }\n </div>\n\n <div class=\"row\">\n @if (model?.quantity) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Quantity</small>\n <div class=\"d-flex gap-1\">\n <h3 class=\"mb-0\">{{ model?.quantity }}</h3>\n <small class=\"text-secondary\">{{ model?.product?.measure?.title }}</small>\n </div>\n </div>\n </div>\n } @if (model?.amount) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Total Value</small>\n <h3 class=\"mb-0\">{{ $safeNavigationMigration(model?.amount) | currency }}</h3>\n </div>\n </div>\n }\n </div>\n @if (model?.particulars) {\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Particulars</small>\n <p class=\"mb-0\">{{ model?.particulars }}</p>\n </div>\n </div>\n </div>\n }\n <div class=\"row\">\n @if (model?.location) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Location</small>\n <p class=\"mb-0\">{{ model?.location?.title }}</p>\n </div>\n </div>\n } @if (model?.batch) {\n <div class=\"col-6\" techlifyFeatureEnabled=\"product-batch-numbers\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Batch</small>\n <p class=\"mb-0\">{{ model?.batch?.batch_number }}</p>\n </div>\n </div>\n }\n </div>\n @if (model?.stock_receipt?.creator) {\n <div class=\"row\">\n <div class=\"col-12\">\n <small class=\"mb-0\">\n <span class=\"text-secondary\">Created By</span> {{ model?.stock_receipt?.creator?.name }}\n <span class=\"text-secondary\">On</span> {{ $safeNavigationMigration(model?.stock_receipt?.created_at) | date }}\n </small>\n </div>\n </div>\n }\n </mat-card-content>\n </mat-card>\n\n <app-note-list labelText=\"Notes\" viewMode=\"timeline\" modelType=\"StockReceiptProduct\"\n [relatedModelId]=\"$safeNavigationMigration(model?.stock_receipt_id)\"></app-note-list>\n </div>\n\n <div style=\"width: calc(100% - 350px - 0.5rem)\">\n <app-stock-allocation-list [stockReceiptProductId]=\"$safeNavigationMigration(model?.id)\"></app-stock-allocation-list>\n </div>\n </div>\n</div>\n}\n",
3861
+ styles: [""],
3862
+ dependencies: [
3863
+ {
3864
+ kind: "ngmodule",
3865
+ type: SharedModule
3866
+ },
3867
+ {
3868
+ kind: "component",
3869
+ type: i6$1.MatCard,
3870
+ selector: "mat-card",
3871
+ inputs: ["appearance"],
3872
+ exportAs: ["matCard"]
3873
+ },
3874
+ {
3875
+ kind: "directive",
3876
+ type: i6$1.MatCardContent,
3877
+ selector: "mat-card-content"
3878
+ },
3879
+ {
3880
+ kind: "component",
3881
+ type: i5.MatProgressBar,
3882
+ selector: "mat-progress-bar",
3883
+ inputs: [
3884
+ "color",
3885
+ "value",
3886
+ "bufferValue",
3887
+ "mode"
3888
+ ],
3889
+ outputs: ["animationEnd"],
3890
+ exportAs: ["matProgressBar"]
3891
+ },
3892
+ {
3893
+ kind: "component",
3894
+ type: i1.NoteListComponent,
3895
+ selector: "app-note-list",
3896
+ inputs: [
3897
+ "relatedModelId",
3898
+ "modelType",
3899
+ "readonly",
3900
+ "labelText",
3901
+ "commentsView",
3902
+ "viewMode"
3903
+ ]
3904
+ },
3905
+ {
3906
+ kind: "directive",
3907
+ type: i9.RouterLink,
3908
+ selector: "[routerLink]",
3909
+ inputs: [
3910
+ "target",
3911
+ "queryParams",
3912
+ "fragment",
3913
+ "queryParamsHandling",
3914
+ "state",
3915
+ "info",
3916
+ "relativeTo",
3917
+ "preserveFragment",
3918
+ "skipLocationChange",
3919
+ "replaceUrl",
3920
+ "browserUrl",
3921
+ "routerLink"
3922
+ ]
3923
+ },
3924
+ {
3925
+ kind: "component",
3926
+ type: i1.TechlifyDeleteButtonComponent,
3927
+ selector: "app-techlify-delete-button",
3928
+ inputs: [
3929
+ "data",
3930
+ "model",
3931
+ "message",
3932
+ "service"
3933
+ ],
3934
+ outputs: ["deleted", "loading"]
3935
+ },
3936
+ {
3937
+ kind: "component",
3938
+ type: i1.TechlifyIconComponent,
3939
+ selector: "app-techlify-icon",
3940
+ inputs: ["name", "size"]
3941
+ },
3942
+ {
3943
+ kind: "ngmodule",
3944
+ type: NoteModule
3945
+ },
3946
+ {
3947
+ kind: "ngmodule",
3948
+ type: TechlifyFeatureModule
3949
+ },
3950
+ {
3951
+ kind: "directive",
3952
+ type: i1.TechlifyFeatureEnabledDirective,
3953
+ selector: "[techlifyFeatureEnabled]",
3954
+ inputs: ["techlifyFeatureEnabled"]
3955
+ },
3956
+ {
3957
+ kind: "component",
3958
+ type: StockAllocationListComponent,
3959
+ selector: "app-stock-allocation-list",
3960
+ inputs: [
3961
+ "stockIssueProductId",
3962
+ "stockReceiptProductId",
3963
+ "selectedColumns"
3964
+ ],
3965
+ outputs: ["selectedColumnsChange"]
3966
+ },
3967
+ {
3968
+ kind: "pipe",
3969
+ type: i13.CurrencyPipe,
3970
+ name: "currency"
3971
+ },
3972
+ {
3973
+ kind: "pipe",
3974
+ type: i13.DatePipe,
3975
+ name: "date"
3976
+ }
3977
+ ],
3978
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
3979
+ preserveWhitespaces: true
3980
+ });
3981
+ };
3982
+ i0.ɵɵngDeclareClassMetadata({
3983
+ minVersion: "12.0.0",
3984
+ version: "22.2.5",
3985
+ ngImport: i0,
3986
+ type: StockReceiptProductViewComponent,
3987
+ decorators: [{
3988
+ type: Component,
3989
+ args: [{
3990
+ selector: "app-stock-receipt-product-view",
3991
+ changeDetection: ChangeDetectionStrategy.Eager,
3992
+ imports: [
3993
+ SharedModule,
3994
+ NoteModule,
3995
+ TechlifyFeatureModule,
3996
+ StockAllocationListComponent
3997
+ ],
3998
+ template: "@if (isLoading) {\n<mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n} @if (model) {\n<div class=\"d-flex flex-column justify-content-start gap-2\">\n <mat-card>\n <mat-card-content>\n <h3 class=\"mb-0\">Stock Receipt for {{ model?.product?.name }}</h3>\n </mat-card-content>\n </mat-card>\n <div class=\"d-flex justify-content-start align-items-start gap-2\">\n <div class=\"d-flex flex-column gap-2\" style=\"width: 350px\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> campaign </span>\n <strong class=\"mb-0 text-dark\">Information</strong>\n </div>\n <div class=\"d-flex justify-content-start align-items-center gap-2 text-secondary\">\n <app-techlify-icon name=\"edit\" role=\"button\"\n [routerLink]=\"['/inventory/stock-receipts/form', $safeNavigationMigration(model?.stock_receipt_id)]\"></app-techlify-icon>\n <app-techlify-delete-button [model]=\"model\" [service]=\"service\"\n [data]=\"{ title: $safeNavigationMigration(model?.product?.name), type: 'Stock Receipt Product' }\"\n (deleted)=\"redirectBack()\"\n >\n </app-techlify-delete-button>\n </div>\n </mat-card-content>\n <mat-card-content class=\"d-flex flex-column justify-content-start gap-2 mt-3\">\n <div class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex flex-column gap-0\">\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/products', $safeNavigationMigration(model?.product?.id), 'view']\">\n <p class=\"mb-0\">{{ model?.product?.name }}</p>\n </a>\n @if (model?.product?.sku) {\n <small>{{ model?.product?.sku }}</small>\n }\n </div>\n <div class=\"d-flex flex-column justify-content-end gap-0\">\n @if (model?.stock_receipt?.date) {\n <small>{{ $safeNavigationMigration(model?.stock_receipt?.date) | date }}</small>\n } @if (model?.batch?.expires_on) {\n <small techlifyFeatureEnabled=\"product-batch-numbers\">\n Expires on\n {{ $safeNavigationMigration(model?.batch?.expires_on) | date }}\n </small>\n }\n </div>\n </div>\n\n <div class=\"row\">\n @if (model?.purchase_price) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Purchase Price</small>\n <p class=\"mb-0\">{{ $safeNavigationMigration(model?.purchase_price) | currency }}</p>\n </div>\n </div>\n } @if (model?.stock_receipt?.supplier) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Supplier</small>\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/suppliers', $safeNavigationMigration(model?.stock_receipt?.supplier?.id), 'view']\">\n <p class=\"mb-0\">{{ model?.stock_receipt?.supplier?.company_name }}</p>\n </a>\n </div>\n </div>\n }\n </div>\n\n <div class=\"row\">\n @if (model?.quantity) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Quantity</small>\n <div class=\"d-flex gap-1\">\n <h3 class=\"mb-0\">{{ model?.quantity }}</h3>\n <small class=\"text-secondary\">{{ model?.product?.measure?.title }}</small>\n </div>\n </div>\n </div>\n } @if (model?.amount) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Total Value</small>\n <h3 class=\"mb-0\">{{ $safeNavigationMigration(model?.amount) | currency }}</h3>\n </div>\n </div>\n }\n </div>\n @if (model?.particulars) {\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Particulars</small>\n <p class=\"mb-0\">{{ model?.particulars }}</p>\n </div>\n </div>\n </div>\n }\n <div class=\"row\">\n @if (model?.location) {\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Location</small>\n <p class=\"mb-0\">{{ model?.location?.title }}</p>\n </div>\n </div>\n } @if (model?.batch) {\n <div class=\"col-6\" techlifyFeatureEnabled=\"product-batch-numbers\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Batch</small>\n <p class=\"mb-0\">{{ model?.batch?.batch_number }}</p>\n </div>\n </div>\n }\n </div>\n @if (model?.stock_receipt?.creator) {\n <div class=\"row\">\n <div class=\"col-12\">\n <small class=\"mb-0\">\n <span class=\"text-secondary\">Created By</span> {{ model?.stock_receipt?.creator?.name }}\n <span class=\"text-secondary\">On</span> {{ $safeNavigationMigration(model?.stock_receipt?.created_at) | date }}\n </small>\n </div>\n </div>\n }\n </mat-card-content>\n </mat-card>\n\n <app-note-list labelText=\"Notes\" viewMode=\"timeline\" modelType=\"StockReceiptProduct\"\n [relatedModelId]=\"$safeNavigationMigration(model?.stock_receipt_id)\"></app-note-list>\n </div>\n\n <div style=\"width: calc(100% - 350px - 0.5rem)\">\n <app-stock-allocation-list [stockReceiptProductId]=\"$safeNavigationMigration(model?.id)\"></app-stock-allocation-list>\n </div>\n </div>\n</div>\n}\n"
3999
+ }]
4000
+ }],
4001
+ ctorParameters: () => [
4002
+ { type: i9.ActivatedRoute },
4003
+ { type: StockReceiptProductService },
4004
+ { type: i13.Location }
4005
+ ]
4006
+ });
4007
+ const routes = [
4008
+ {
4009
+ path: "",
4010
+ component: StockReceiptPageComponent
4011
+ },
4012
+ {
4013
+ path: ":id/view",
4014
+ component: StockReceiptViewComponent
4015
+ },
4016
+ {
4017
+ path: "products/:id/view",
4018
+ component: StockReceiptProductViewComponent
4019
+ },
4020
+ {
4021
+ path: "import",
4022
+ component: StockReceiptImportPageComponent,
4023
+ canLoad: [AuthenticationGuard]
4024
+ },
4025
+ {
4026
+ path: "form",
4027
+ component: StockReceiptFormComponent,
4028
+ canLoad: [AuthenticationGuard]
4029
+ },
4030
+ {
4031
+ path: "form/:id",
4032
+ component: StockReceiptFormComponent,
4033
+ canLoad: [AuthenticationGuard]
4034
+ }
4035
+ ];
4036
+ var StockReceiptsRoutingModule = class StockReceiptsRoutingModule {
4037
+ static ɵfac = i0.ɵɵngDeclareFactory({
4038
+ minVersion: "12.0.0",
4039
+ version: "22.2.5",
4040
+ ngImport: i0,
4041
+ type: StockReceiptsRoutingModule,
4042
+ deps: [],
4043
+ target: i0.ɵɵFactoryTarget.NgModule
4044
+ });
4045
+ static ɵmod = i0.ɵɵngDeclareNgModule({
4046
+ minVersion: "14.0.0",
4047
+ version: "22.2.5",
4048
+ ngImport: i0,
4049
+ type: StockReceiptsRoutingModule,
4050
+ imports: [i9.RouterModule],
4051
+ exports: [RouterModule]
4052
+ });
4053
+ static ɵinj = i0.ɵɵngDeclareInjector({
4054
+ minVersion: "12.0.0",
4055
+ version: "22.2.5",
4056
+ ngImport: i0,
4057
+ type: StockReceiptsRoutingModule,
4058
+ imports: [RouterModule.forChild(routes), RouterModule]
4059
+ });
4060
+ };
4061
+ i0.ɵɵngDeclareClassMetadata({
4062
+ minVersion: "12.0.0",
4063
+ version: "22.2.5",
4064
+ ngImport: i0,
4065
+ type: StockReceiptsRoutingModule,
4066
+ decorators: [{
4067
+ type: NgModule,
4068
+ args: [{
4069
+ imports: [RouterModule.forChild(routes)],
4070
+ exports: [RouterModule]
4071
+ }]
4072
+ }]
4073
+ });
4074
+ var stock_receipts_module_exports = /* @__PURE__ */ __exportAll({ StockReceiptsModule: () => StockReceiptsModule });
4075
+ var StockReceiptsModule = class StockReceiptsModule {
4076
+ static ɵfac = i0.ɵɵngDeclareFactory({
4077
+ minVersion: "12.0.0",
4078
+ version: "22.2.5",
4079
+ ngImport: i0,
4080
+ type: StockReceiptsModule,
4081
+ deps: [],
4082
+ target: i0.ɵɵFactoryTarget.NgModule
4083
+ });
4084
+ static ɵmod = i0.ɵɵngDeclareNgModule({
4085
+ minVersion: "14.0.0",
4086
+ version: "22.2.5",
4087
+ ngImport: i0,
4088
+ type: StockReceiptsModule,
4089
+ declarations: [
4090
+ StockReceiptPageComponent,
4091
+ StockReceiptViewComponent,
4092
+ StockReceiptListComponent,
4093
+ StockReceiptProductsListComponent
4094
+ ],
4095
+ imports: [
4096
+ CommonModule,
4097
+ MaterialModule$1,
4098
+ StockReceiptsRoutingModule,
4099
+ TechlifyFilterModule,
4100
+ SearchableSelectorModule,
4101
+ TimelineFilterModule,
4102
+ ReactiveFormsModule,
4103
+ PayeeSelectorModule,
4104
+ InfiniteScrollDirective,
4105
+ ProductCategoryBadgesComponent,
4106
+ ColumnSelectorModule,
4107
+ EntityFilesViewAllModule,
4108
+ TechlifyFeatureModule,
4109
+ NoteModule,
4110
+ TechlifyIconModule,
4111
+ RouterModule,
4112
+ ExportToExcelButtonComponent,
4113
+ TechlifyDeleteButtonComponent,
4114
+ StockReceiptProductFormButtonComponent,
4115
+ TechlifyFormButtonComponent
4116
+ ],
4117
+ exports: [
4118
+ StockReceiptPageComponent,
4119
+ StockReceiptListComponent,
4120
+ StockReceiptProductsListComponent
4121
+ ]
4122
+ });
4123
+ static ɵinj = i0.ɵɵngDeclareInjector({
4124
+ minVersion: "12.0.0",
4125
+ version: "22.2.5",
4126
+ ngImport: i0,
4127
+ type: StockReceiptsModule,
4128
+ imports: [
4129
+ CommonModule,
4130
+ MaterialModule$1,
4131
+ StockReceiptsRoutingModule,
4132
+ TechlifyFilterModule,
4133
+ SearchableSelectorModule,
4134
+ TimelineFilterModule,
4135
+ ReactiveFormsModule,
4136
+ PayeeSelectorModule,
4137
+ ColumnSelectorModule,
4138
+ EntityFilesViewAllModule,
4139
+ TechlifyFeatureModule,
4140
+ NoteModule,
4141
+ TechlifyIconModule,
4142
+ RouterModule,
4143
+ TechlifyDeleteButtonComponent,
4144
+ StockReceiptProductFormButtonComponent,
4145
+ TechlifyFormButtonComponent
4146
+ ]
4147
+ });
4148
+ };
4149
+ i0.ɵɵngDeclareClassMetadata({
4150
+ minVersion: "12.0.0",
4151
+ version: "22.2.5",
4152
+ ngImport: i0,
4153
+ type: StockReceiptsModule,
4154
+ decorators: [{
4155
+ type: NgModule,
4156
+ args: [{
4157
+ declarations: [
4158
+ StockReceiptPageComponent,
4159
+ StockReceiptViewComponent,
4160
+ StockReceiptListComponent,
4161
+ StockReceiptProductsListComponent
4162
+ ],
4163
+ exports: [
4164
+ StockReceiptPageComponent,
4165
+ StockReceiptListComponent,
4166
+ StockReceiptProductsListComponent
4167
+ ],
4168
+ imports: [
4169
+ CommonModule,
4170
+ MaterialModule$1,
4171
+ StockReceiptsRoutingModule,
4172
+ TechlifyFilterModule,
4173
+ SearchableSelectorModule,
4174
+ TimelineFilterModule,
4175
+ ReactiveFormsModule,
4176
+ PayeeSelectorModule,
4177
+ InfiniteScrollDirective,
4178
+ ProductCategoryBadgesComponent,
4179
+ ColumnSelectorModule,
4180
+ EntityFilesViewAllModule,
4181
+ TechlifyFeatureModule,
4182
+ NoteModule,
4183
+ TechlifyIconModule,
4184
+ RouterModule,
4185
+ ExportToExcelButtonComponent,
4186
+ TechlifyDeleteButtonComponent,
4187
+ StockReceiptProductFormButtonComponent,
4188
+ TechlifyFormButtonComponent
4189
+ ]
4190
+ }]
4191
+ }]
4192
+ });
4193
+ export { StockReceiptListComponent as a, StockReceiptProductFormComponent as c, PayeeSelectorComponent as d, SupplierFormComponent as f, StockReceiptPageComponent as i, StockReceiptSingleProductFormComponent as l, __exportAll as m, stock_receipts_module_exports as n, StockReceiptProductsListComponent as o, SupplierService as p, StockReceiptViewComponent as r, StockReceiptProductFormButtonComponent as s, StockReceiptsModule as t, PayeeSelectorModule as u };
4194
+
4195
+ //# sourceMappingURL=techlify-inventory-common-stock-receipts.module-BPxUGNbD.mjs.map