techlify-inventory-common 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +13 -0
- package/README.md +27 -0
- package/angular.json +207 -0
- package/e2e/protractor.conf.js +28 -0
- package/e2e/src/app.e2e-spec.ts +14 -0
- package/e2e/src/app.po.ts +11 -0
- package/e2e/tsconfig.e2e.json +13 -0
- package/ng-package.json +6 -0
- package/package.json +92 -0
- package/projects/inventory-common/README.md +24 -0
- package/projects/inventory-common/ng-package.json +7 -0
- package/projects/inventory-common/package.json +12 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form/category-form.component.html +41 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form/category-form.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form/category-form.component.ts +75 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form-button/category-form-button.component.html +32 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form-button/category-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form-button/category-form-button.component.ts +29 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-list-page/category-list-page.component.html +79 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-list-page/category-list-page.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-list-page/category-list-page.component.ts +61 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-routing.module.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category.module.ts +36 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-common-routing.module.ts +65 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-common.module.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.html +88 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.ts +36 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-value-report.service.ts +19 -0
- package/projects/inventory-common/src/lib/inventory-common/low-stock-report.service.ts +19 -0
- package/projects/inventory-common/src/lib/inventory-common/material.module.ts +95 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.html +37 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.ts +44 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-delete/measure-delete.module.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.html +66 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.ts +78 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.html +16 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.ts +29 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form.module.ts +13 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-routing.module.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure.module.ts +26 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measures-list/measures-list.component.html +88 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measures-list/measures-list.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measures-list/measures-list.component.ts +67 -0
- package/projects/inventory-common/src/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.html +52 -0
- package/projects/inventory-common/src/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.ts +42 -0
- package/projects/inventory-common/src/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.ts +20 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-basic-info/product-basic-info.component.html +114 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-basic-info/product-basic-info.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-basic-info/product-basic-info.component.ts +43 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-delete-button/product-delete-button.component.html +33 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-delete-button/product-delete-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-delete-button/product-delete-button.component.ts +53 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form/product-form.component.html +209 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form/product-form.component.spec.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form/product-form.component.ts +182 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form-button/product-form-button.component.html +17 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form-button/product-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form-button/product-form-button.component.ts +39 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-import-page/product-import-page.component.html +1 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-import-page/product-import-page.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-import-page/product-import-page.component.ts +66 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-list/product-list.component.html +254 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-list/product-list.component.spec.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-list/product-list.component.ts +171 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measure-form/product-measure-form.component.html +44 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measure-form/product-measure-form.component.spec.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measure-form/product-measure-form.component.ts +93 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measures-list/product-measures-list.component.html +90 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measures-list/product-measures-list.component.spec.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measures-list/product-measures-list.component.ts +153 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.html +3 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.spec.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.ts +7 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-quick-search/product-quick-search.component.html +110 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-quick-search/product-quick-search.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-quick-search/product-quick-search.component.ts +102 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-routing.module.ts +49 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-search/product-search.component.html +78 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-search/product-search.component.scss +12 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-search/product-search.component.ts +153 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-search/product-search.module.ts +22 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.html +11 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.ts +62 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.ts +15 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-widget/product-summary-widget.component.html +9 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-widget/product-summary-widget.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-widget/product-summary-widget.component.ts +39 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.html +32 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.ts +55 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.html +49 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.ts +87 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.html +48 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.ts +33 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax.module.ts +23 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-view-page/product-view-page.component.html +34 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-view-page/product-view-page.component.ts +63 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product.module.ts +69 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product.service.ts +54 -0
- package/projects/inventory-common/src/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.html +8 -0
- package/projects/inventory-common/src/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.html +140 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.ts +191 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/low-stock-report/low-stock-report.component.html +158 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/low-stock-report/low-stock-report.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/low-stock-report/low-stock-report.component.ts +191 -0
- package/projects/inventory-common/src/lib/inventory-common/services/techlify-form-service.ts +14 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.html +32 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.ts +49 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.module.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuance.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.html +165 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.ts +113 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.module.ts +26 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-routing.module.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances.module.ts +36 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.html +64 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.ts +115 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.html +20 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.ts +35 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.ts +29 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.html +32 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.ts +49 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.html +74 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.ts +122 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.html +18 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.ts +33 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.ts +29 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.html +139 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.ts +109 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-routing.module.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts.module.ts +45 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-summary.service.ts +18 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.html +22 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.ts +44 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector.module.ts +19 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-delete-button/supplier-delete-button.component.css +0 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-delete-button/supplier-delete-button.component.html +3 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-delete-button/supplier-delete-button.component.spec.ts +28 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-delete-button/supplier-delete-button.component.ts +56 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form-button/supplier-form-button.component.css +0 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form-button/supplier-form-button.component.html +3 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form-button/supplier-form-button.component.spec.ts +28 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form-button/supplier-form-button.component.ts +40 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form.component.html +100 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form.component.ts +116 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-information/supplier-information.component.html +67 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-information/supplier-information.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-information/supplier-information.component.ts +68 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-routing.module.ts +32 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-type.service.ts +17 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-view/supplier-view.component.html +60 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-view/supplier-view.component.ts +58 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier.component.html +3 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier.component.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier.module.ts +46 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier.service.ts +57 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.html +98 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.ts +126 -0
- package/projects/inventory-common/src/lib/inventory-common/techlify-filter/techlify-filter.component.html +442 -0
- package/projects/inventory-common/src/lib/inventory-common/techlify-filter/techlify-filter.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/techlify-filter/techlify-filter.component.ts +109 -0
- package/projects/inventory-common/src/lib/inventory-common/techlify-filter/techlify-filter.module.ts +24 -0
- package/projects/inventory-common/src/public-api.ts +10 -0
- package/projects/inventory-common/tsconfig.lib.json +17 -0
- package/projects/inventory-common/tsconfig.lib.prod.json +13 -0
- package/projects/inventory-common/tsconfig.spec.json +17 -0
- package/public_api.ts +23 -0
- package/releases/techlify-ng-users-0.0.4.tgz +0 -0
- package/releases/techlify-ng-users-0.0.5.tgz +0 -0
- package/src/.htaccess +19 -0
- package/src/app/@modules/@shared/print-button/print-button/print-button.component.html +3 -0
- package/src/app/@modules/@shared/print-button/print-button/print-button.component.scss +0 -0
- package/src/app/@modules/@shared/print-button/print-button/print-button.component.ts +11 -0
- package/src/app/@modules/@shared/print-button/print-button.module.ts +11 -0
- package/src/app/@modules/@shared/print-button/print.service.ts +38 -0
- package/src/app/@modules/@shared/techlify-form-service.ts +14 -0
- package/src/app/@modules/@shared/user-menu/user-menu.component.html +26 -0
- package/src/app/@modules/@shared/user-menu/user-menu.component.spec.ts +23 -0
- package/src/app/@modules/@shared/user-menu/user-menu.component.ts +46 -0
- package/src/app/@modules/@shared/user-menu/user-menu.module.ts +20 -0
- package/src/app/@modules/administration/administration-routing.module.ts +44 -0
- package/src/app/@modules/administration/administration.component.html +3 -0
- package/src/app/@modules/administration/administration.component.ts +11 -0
- package/src/app/@modules/administration/administration.module.ts +18 -0
- package/src/app/@modules/administration/administration.service.ts +33 -0
- package/src/app/@modules/auth/auth-routing.module.ts +17 -0
- package/src/app/@modules/auth/auth.module.ts +12 -0
- package/src/app/@modules/auth/login/login.component.html +302 -0
- package/src/app/@modules/auth/login/login.component.scss +43 -0
- package/src/app/@modules/auth/login/login.component.ts +57 -0
- package/src/app/@modules/inventory-common/category/category-form/category-form.component.html +41 -0
- package/src/app/@modules/inventory-common/category/category-form/category-form.component.scss +0 -0
- package/src/app/@modules/inventory-common/category/category-form/category-form.component.ts +75 -0
- package/src/app/@modules/inventory-common/category/category-form-button/category-form-button.component.html +32 -0
- package/src/app/@modules/inventory-common/category/category-form-button/category-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/category/category-form-button/category-form-button.component.ts +29 -0
- package/src/app/@modules/inventory-common/category/category-list-page/category-list-page.component.html +79 -0
- package/src/app/@modules/inventory-common/category/category-list-page/category-list-page.component.scss +0 -0
- package/src/app/@modules/inventory-common/category/category-list-page/category-list-page.component.ts +61 -0
- package/src/app/@modules/inventory-common/category/category-routing.module.ts +16 -0
- package/src/app/@modules/inventory-common/category/category.module.ts +36 -0
- package/src/app/@modules/inventory-common/category/category.service.ts +11 -0
- package/src/app/@modules/inventory-common/inventory-common-routing.module.ts +55 -0
- package/src/app/@modules/inventory-common/inventory-common.module.ts +20 -0
- package/src/app/@modules/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.html +88 -0
- package/src/app/@modules/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.scss +0 -0
- package/src/app/@modules/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.ts +35 -0
- package/src/app/@modules/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.html +37 -0
- package/src/app/@modules/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.ts +44 -0
- package/src/app/@modules/inventory-common/measure/measure-delete/measure-delete.module.ts +11 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form/measure-form.component.html +66 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form/measure-form.component.scss +0 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form/measure-form.component.ts +78 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.html +16 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.ts +29 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form.module.ts +13 -0
- package/src/app/@modules/inventory-common/measure/measure-routing.module.ts +16 -0
- package/src/app/@modules/inventory-common/measure/measure.module.ts +26 -0
- package/src/app/@modules/inventory-common/measure/measure.service.ts +11 -0
- package/src/app/@modules/inventory-common/measure/measures-list/measures-list.component.html +88 -0
- package/src/app/@modules/inventory-common/measure/measures-list/measures-list.component.scss +0 -0
- package/src/app/@modules/inventory-common/measure/measures-list/measures-list.component.ts +67 -0
- package/src/app/@modules/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.html +52 -0
- package/src/app/@modules/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.ts +42 -0
- package/src/app/@modules/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.ts +20 -0
- package/src/app/@modules/inventory-common/product/product-basic-info/product-basic-info.component.html +114 -0
- package/src/app/@modules/inventory-common/product/product-basic-info/product-basic-info.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-basic-info/product-basic-info.component.ts +43 -0
- package/src/app/@modules/inventory-common/product/product-delete-button/product-delete-button.component.html +33 -0
- package/src/app/@modules/inventory-common/product/product-delete-button/product-delete-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-delete-button/product-delete-button.component.ts +53 -0
- package/src/app/@modules/inventory-common/product/product-form/product-form.component.html +209 -0
- package/src/app/@modules/inventory-common/product/product-form/product-form.component.spec.ts +24 -0
- package/src/app/@modules/inventory-common/product/product-form/product-form.component.ts +182 -0
- package/src/app/@modules/inventory-common/product/product-form-button/product-form-button.component.html +17 -0
- package/src/app/@modules/inventory-common/product/product-form-button/product-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-form-button/product-form-button.component.ts +39 -0
- package/src/app/@modules/inventory-common/product/product-form.service.ts +11 -0
- package/src/app/@modules/inventory-common/product/product-import-page/product-import-page.component.html +1 -0
- package/src/app/@modules/inventory-common/product/product-import-page/product-import-page.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-import-page/product-import-page.component.ts +66 -0
- package/src/app/@modules/inventory-common/product/product-list/product-list.component.html +229 -0
- package/src/app/@modules/inventory-common/product/product-list/product-list.component.spec.ts +24 -0
- package/src/app/@modules/inventory-common/product/product-list/product-list.component.ts +176 -0
- package/src/app/@modules/inventory-common/product/product-measure-form/product-measure-form.component.html +44 -0
- package/src/app/@modules/inventory-common/product/product-measure-form/product-measure-form.component.spec.ts +24 -0
- package/src/app/@modules/inventory-common/product/product-measure-form/product-measure-form.component.ts +93 -0
- package/src/app/@modules/inventory-common/product/product-measures-list/product-measures-list.component.html +90 -0
- package/src/app/@modules/inventory-common/product/product-measures-list/product-measures-list.component.spec.ts +24 -0
- package/src/app/@modules/inventory-common/product/product-measures-list/product-measures-list.component.ts +153 -0
- package/src/app/@modules/inventory-common/product/product-nav-bar/product-nav-bar.component.html +3 -0
- package/src/app/@modules/inventory-common/product/product-nav-bar/product-nav-bar.component.spec.ts +24 -0
- package/src/app/@modules/inventory-common/product/product-nav-bar/product-nav-bar.component.ts +7 -0
- package/src/app/@modules/inventory-common/product/product-routing.module.ts +49 -0
- package/src/app/@modules/inventory-common/product/product-search/product-search.component.html +78 -0
- package/src/app/@modules/inventory-common/product/product-search/product-search.component.scss +12 -0
- package/src/app/@modules/inventory-common/product/product-search/product-search.component.ts +153 -0
- package/src/app/@modules/inventory-common/product/product-search/product-search.module.ts +22 -0
- package/src/app/@modules/inventory-common/product/product-summary-chart/product-summary-chart.component.html +17 -0
- package/src/app/@modules/inventory-common/product/product-summary-chart/product-summary-chart.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-summary-chart/product-summary-chart.component.ts +45 -0
- package/src/app/@modules/inventory-common/product/product-summary-chart/product-summary-chart.module.ts +18 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.html +32 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.ts +55 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.html +49 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.ts +87 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.html +48 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.ts +33 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax.module.ts +23 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax.service.ts +11 -0
- package/src/app/@modules/inventory-common/product/product-view-page/product-view-page.component.html +34 -0
- package/src/app/@modules/inventory-common/product/product-view-page/product-view-page.component.ts +63 -0
- package/src/app/@modules/inventory-common/product/product.module.ts +67 -0
- package/src/app/@modules/inventory-common/product/product.service.ts +54 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.html +32 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.ts +49 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.module.ts +11 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuance.service.ts +11 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.html +165 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.ts +113 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.module.ts +26 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances-routing.module.ts +16 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances.module.ts +36 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.html +64 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.ts +115 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.html +20 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.ts +35 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.ts +29 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.html +32 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.ts +49 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.html +74 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.ts +122 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.html +18 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.ts +33 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.ts +29 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt.service.ts +11 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.html +139 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.ts +109 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipts-routing.module.ts +16 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipts.module.ts +45 -0
- package/src/app/@modules/inventory-common/stock-summary.service.ts +18 -0
- package/src/app/@modules/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.html +22 -0
- package/src/app/@modules/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.scss +0 -0
- package/src/app/@modules/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.ts +44 -0
- package/src/app/@modules/inventory-common/supplier/payee-selector/payee-selector.module.ts +19 -0
- package/src/app/@modules/inventory-common/supplier/supplier-form/supplier-form.component.html +133 -0
- package/src/app/@modules/inventory-common/supplier/supplier-form/supplier-form.component.ts +116 -0
- package/src/app/@modules/inventory-common/supplier/supplier-form/supplier-form.service.ts +11 -0
- package/src/app/@modules/inventory-common/supplier/supplier-information/supplier-information.component.html +67 -0
- package/src/app/@modules/inventory-common/supplier/supplier-information/supplier-information.component.scss +0 -0
- package/src/app/@modules/inventory-common/supplier/supplier-information/supplier-information.component.ts +68 -0
- package/src/app/@modules/inventory-common/supplier/supplier-routing.module.ts +32 -0
- package/src/app/@modules/inventory-common/supplier/supplier-type.service.ts +17 -0
- package/src/app/@modules/inventory-common/supplier/supplier-view/supplier-view.component.html +60 -0
- package/src/app/@modules/inventory-common/supplier/supplier-view/supplier-view.component.ts +58 -0
- package/src/app/@modules/inventory-common/supplier/supplier.component.html +3 -0
- package/src/app/@modules/inventory-common/supplier/supplier.component.scss +0 -0
- package/src/app/@modules/inventory-common/supplier/supplier.component.ts +16 -0
- package/src/app/@modules/inventory-common/supplier/supplier.module.ts +42 -0
- package/src/app/@modules/inventory-common/supplier/supplier.service.ts +57 -0
- package/src/app/@modules/inventory-common/supplier/suppliers-list/suppliers-list.component.html +140 -0
- package/src/app/@modules/inventory-common/supplier/suppliers-list/suppliers-list.component.ts +240 -0
- package/src/app/@modules/sidebar-layout/expandable-menu/expandable-menu.component.html +10 -0
- package/src/app/@modules/sidebar-layout/expandable-menu/expandable-menu.component.scss +20 -0
- package/src/app/@modules/sidebar-layout/expandable-menu/expandable-menu.component.ts +24 -0
- package/src/app/@modules/sidebar-layout/menu-item.model.ts +12 -0
- package/src/app/@modules/sidebar-layout/sidebar-administration-menu/sidebar-administration-menu.component.html +26 -0
- package/src/app/@modules/sidebar-layout/sidebar-administration-menu/sidebar-administration-menu.component.ts +23 -0
- package/src/app/@modules/sidebar-layout/sidebar-layout/sidebar-layout.component.html +32 -0
- package/src/app/@modules/sidebar-layout/sidebar-layout/sidebar-layout.component.scss +48 -0
- package/src/app/@modules/sidebar-layout/sidebar-layout/sidebar-layout.component.ts +173 -0
- package/src/app/@modules/sidebar-layout/sidebar-layout-routing.module.ts +52 -0
- package/src/app/@modules/sidebar-layout/sidebar-layout.module.ts +52 -0
- package/src/app/@modules/sidebar-layout/top-menu/top-menu.component.html +85 -0
- package/src/app/@modules/sidebar-layout/top-menu/top-menu.component.scss +0 -0
- package/src/app/@modules/sidebar-layout/top-menu/top-menu.component.ts +46 -0
- package/src/app/@modules/sidebar-layout/top-menu/top-menu.service.ts +29 -0
- package/src/app/@modules/techlify-filter/techlify-filter.component.html +442 -0
- package/src/app/@modules/techlify-filter/techlify-filter.component.scss +0 -0
- package/src/app/@modules/techlify-filter/techlify-filter.component.ts +109 -0
- package/src/app/@modules/techlify-filter/techlify-filter.module.ts +24 -0
- package/src/app/@modules/user/user-layout/user-layout.component.html +15 -0
- package/src/app/@modules/user/user-layout/user-layout.component.scss +0 -0
- package/src/app/@modules/user/user-layout/user-layout.component.ts +12 -0
- package/src/app/@modules/user/user-routing.module.ts +23 -0
- package/src/app/@modules/user/user.module.ts +13 -0
- package/src/app/@modules/user-setting-button/user-setting-button/user-setting-button.component.html +15 -0
- package/src/app/@modules/user-setting-button/user-setting-button/user-setting-button.component.scss +0 -0
- package/src/app/@modules/user-setting-button/user-setting-button/user-setting-button.component.ts +12 -0
- package/src/app/@modules/user-setting-button/user-setting-button.module.ts +20 -0
- package/src/app/app-routing.module.ts +28 -0
- package/src/app/app.component.html +1 -0
- package/src/app/app.component.scss +43 -0
- package/src/app/app.component.spec.ts +18 -0
- package/src/app/app.component.ts +62 -0
- package/src/app/app.module.ts +73 -0
- package/src/app/material.module.ts +95 -0
- package/src/assets/.gitkeep +0 -0
- package/src/assets/images/techlify-logo-xs.png +0 -0
- package/src/assets/product/product-import-sample.csv +1 -0
- package/src/environments/common-environment.ts +36 -0
- package/src/environments/environment.prod.ts +10 -0
- package/src/environments/environment.staging.ts +19 -0
- package/src/environments/environment.ts +18 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +34 -0
- package/src/main.ts +19 -0
- package/src/polyfills.ts +57 -0
- package/src/styles.scss +366 -0
- package/src/test.ts +12 -0
- package/src/theme/theme-variables.scss +132 -0
- package/src/theme/theme.scss +17 -0
- package/src/tsconfig.app.json +15 -0
- package/src/tsconfig.spec.json +14 -0
- package/tsconfig.app.json +17 -0
- package/tsconfig.json +69 -0
- package/tslint.json +130 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Component, Inject, OnInit } from "@angular/core";
|
|
2
|
+
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
|
3
|
+
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
|
|
4
|
+
import { NgxSpinnerService } from "ngx-spinner";
|
|
5
|
+
import {
|
|
6
|
+
AlertService,
|
|
7
|
+
ErrorHandlerService,
|
|
8
|
+
FormValidatorService,
|
|
9
|
+
} from "ngx-techlify-core";
|
|
10
|
+
import { ProductService } from "../product.service";
|
|
11
|
+
|
|
12
|
+
const errorMessages: any = {
|
|
13
|
+
title: {
|
|
14
|
+
required: "Please Enter Title",
|
|
15
|
+
},
|
|
16
|
+
description: {
|
|
17
|
+
required: "Please Enter Description",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
@Component({
|
|
22
|
+
selector: "app-product-measure-form",
|
|
23
|
+
templateUrl: "./product-measure-form.component.html",
|
|
24
|
+
})
|
|
25
|
+
export class ProductMeasureFormComponent implements OnInit {
|
|
26
|
+
public productMeasureForm: FormGroup;
|
|
27
|
+
public isWorking: boolean = false;
|
|
28
|
+
public isUpdate: boolean = false;
|
|
29
|
+
constructor(
|
|
30
|
+
private productService: ProductService,
|
|
31
|
+
private fb: FormBuilder,
|
|
32
|
+
public dialogRef: MatDialogRef<ProductMeasureFormComponent>,
|
|
33
|
+
@Inject(MAT_DIALOG_DATA) public data: any,
|
|
34
|
+
private spinnerService: NgxSpinnerService,
|
|
35
|
+
private formValidatorService: FormValidatorService,
|
|
36
|
+
private errorService: ErrorHandlerService,
|
|
37
|
+
private alertService: AlertService
|
|
38
|
+
) {
|
|
39
|
+
this.productMeasureForm = this.fb.group({
|
|
40
|
+
id: [""],
|
|
41
|
+
title: ["", Validators.compose([Validators.required])],
|
|
42
|
+
description: ["", Validators.compose([Validators.required])],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
ngOnInit(): void {
|
|
47
|
+
if (this.data.details) {
|
|
48
|
+
this.isUpdate = true;
|
|
49
|
+
this.productMeasureForm.patchValue(this.data.details);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async save() {
|
|
54
|
+
if (!this.productMeasureForm.valid) {
|
|
55
|
+
this.alertService.addAlert("Please Fill All Required Fields", "warn");
|
|
56
|
+
this.productMeasureForm.markAllAsTouched();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
let productMeasure = this.productMeasureForm.value;
|
|
60
|
+
try {
|
|
61
|
+
this.spinnerService.show();
|
|
62
|
+
this.isWorking = true;
|
|
63
|
+
let result = this.isUpdate
|
|
64
|
+
? await this.productService.updateProductMeasure(productMeasure)
|
|
65
|
+
: await this.productService.createProductMeasure(productMeasure);
|
|
66
|
+
this.dialogRef.close(result);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
this.errorService.handleError(error);
|
|
69
|
+
} finally {
|
|
70
|
+
this.isWorking = false;
|
|
71
|
+
this.spinnerService.hide();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Method to evaluate form fields
|
|
76
|
+
*/
|
|
77
|
+
isFieldValid(field: string) {
|
|
78
|
+
return this.formValidatorService.isFieldValid(
|
|
79
|
+
field,
|
|
80
|
+
this.productMeasureForm
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Method to find error in form fields
|
|
85
|
+
*/
|
|
86
|
+
getErrorMessage(field: string) {
|
|
87
|
+
return this.formValidatorService.getErrorMessage(
|
|
88
|
+
field,
|
|
89
|
+
this.productMeasureForm,
|
|
90
|
+
errorMessages
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<div fxLayout="column">
|
|
2
|
+
<div class="text-center" fxLayoutAlign="center center">
|
|
3
|
+
<h3 fxLayout>
|
|
4
|
+
<span class="mt-1"> Product Measures </span>
|
|
5
|
+
<button
|
|
6
|
+
mat-raised-button
|
|
7
|
+
class="ml-2"
|
|
8
|
+
color="primary"
|
|
9
|
+
(click)="modifyProductMeasure()"
|
|
10
|
+
>
|
|
11
|
+
<mat-icon>add</mat-icon>
|
|
12
|
+
Product Measure
|
|
13
|
+
</button>
|
|
14
|
+
</h3>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div fxLayout>
|
|
18
|
+
<form [formGroup]="filterFormGroup" fxLayout fxLayoutGap="0.5rem">
|
|
19
|
+
<mat-form-field>
|
|
20
|
+
<input
|
|
21
|
+
matInput
|
|
22
|
+
placeholder="Item Name, Description, etc."
|
|
23
|
+
formControlName="search"
|
|
24
|
+
/>
|
|
25
|
+
</mat-form-field>
|
|
26
|
+
</form>
|
|
27
|
+
|
|
28
|
+
<mat-form-field class="ml-2" fxFlex="0 1 calc(11.11% - 0.5rem)">
|
|
29
|
+
<mat-label>Columns</mat-label>
|
|
30
|
+
<mat-select [(ngModel)]="displayedColumns" multiple name="column">
|
|
31
|
+
<mat-option
|
|
32
|
+
*ngFor="let column of columnDefinitions"
|
|
33
|
+
[value]="column.def"
|
|
34
|
+
[disabled]="!column.isShow"
|
|
35
|
+
>
|
|
36
|
+
{{ column?.def }}</mat-option
|
|
37
|
+
>
|
|
38
|
+
</mat-select>
|
|
39
|
+
</mat-form-field>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<table
|
|
43
|
+
mat-table
|
|
44
|
+
#table
|
|
45
|
+
[dataSource]="dataSource"
|
|
46
|
+
class="mat-elevation-z8 w-100 mt-4 table-hover"
|
|
47
|
+
infiniteScroll
|
|
48
|
+
[infiniteScrollDistance]="2"
|
|
49
|
+
[infiniteScrollThrottle]="50"
|
|
50
|
+
(scrolled)="onScroll()"
|
|
51
|
+
[fromRoot]="true"
|
|
52
|
+
infiniteScrollContainer="mat-sidenav-content"
|
|
53
|
+
matSort
|
|
54
|
+
(matSortChange)="sortColumn($event)"
|
|
55
|
+
matSortDisableClear="true"
|
|
56
|
+
>
|
|
57
|
+
<!-- # Column -->
|
|
58
|
+
<ng-container matColumnDef="#">
|
|
59
|
+
<th mat-header-cell *matHeaderCellDef>#</th>
|
|
60
|
+
<td mat-cell *matCellDef="let element; let i = index">{{ i + 1 }}</td>
|
|
61
|
+
</ng-container>
|
|
62
|
+
|
|
63
|
+
<!-- Title Column -->
|
|
64
|
+
<ng-container matColumnDef="Title">
|
|
65
|
+
<th mat-header-cell mat-sort-header *matHeaderCellDef>Title</th>
|
|
66
|
+
<td mat-cell *matCellDef="let element">{{ element.title }}</td>
|
|
67
|
+
</ng-container>
|
|
68
|
+
|
|
69
|
+
<!-- Description Column -->
|
|
70
|
+
<ng-container matColumnDef="Description">
|
|
71
|
+
<th mat-header-cell mat-sort-header *matHeaderCellDef>Description</th>
|
|
72
|
+
<td mat-cell *matCellDef="let element">{{ element.description }}</td>
|
|
73
|
+
</ng-container>
|
|
74
|
+
|
|
75
|
+
<!-- Actions Column -->
|
|
76
|
+
<ng-container matColumnDef="Actions">
|
|
77
|
+
<th mat-header-cell *matHeaderCellDef>Actions</th>
|
|
78
|
+
<td mat-cell *matCellDef="let element">
|
|
79
|
+
<div class="text-secondary" fxLayoutGap="1rem">
|
|
80
|
+
<button mat-icon-button (click)="modifyProductMeasure(element)">
|
|
81
|
+
<mat-icon>edit</mat-icon>
|
|
82
|
+
</button>
|
|
83
|
+
</div>
|
|
84
|
+
</td>
|
|
85
|
+
</ng-container>
|
|
86
|
+
|
|
87
|
+
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
|
|
88
|
+
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
89
|
+
</table>
|
|
90
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { ProductMeasuresListComponent } from "./product-measures-list.component";
|
|
4
|
+
|
|
5
|
+
describe("ProductMeasuresListComponent", () => {
|
|
6
|
+
let component: ProductMeasuresListComponent;
|
|
7
|
+
let fixture: ComponentFixture<ProductMeasuresListComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ProductMeasuresListComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(ProductMeasuresListComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { ProductMeasureFormComponent } from "../product-measure-form/product-measure-form.component";
|
|
2
|
+
import { ProductService } from "../product.service";
|
|
3
|
+
import { Component, OnInit } from "@angular/core";
|
|
4
|
+
import { FormBuilder, FormGroup } from "@angular/forms";
|
|
5
|
+
import { MatDialog } from "@angular/material/dialog";
|
|
6
|
+
import { MatTableDataSource } from "@angular/material/table";
|
|
7
|
+
import { ActivatedRoute } from "@angular/router";
|
|
8
|
+
import { FilterService } from "ngx-techlify-core";
|
|
9
|
+
import { debounceTime } from "rxjs/operators";
|
|
10
|
+
import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
|
|
11
|
+
|
|
12
|
+
@UntilDestroy()
|
|
13
|
+
@Component({
|
|
14
|
+
selector: "app-product-measure-list",
|
|
15
|
+
templateUrl: "./product-measures-list.component.html",
|
|
16
|
+
})
|
|
17
|
+
export class ProductMeasuresListComponent implements OnInit {
|
|
18
|
+
public filterFormGroup: FormGroup;
|
|
19
|
+
|
|
20
|
+
public lastPage!: number;
|
|
21
|
+
public page: number = 1;
|
|
22
|
+
public perPage: number = 25;
|
|
23
|
+
public totalItems = 0;
|
|
24
|
+
public currentPage = 1;
|
|
25
|
+
public num_items = 25;
|
|
26
|
+
public routeFilters: any;
|
|
27
|
+
public productMeasures: any[] = [];
|
|
28
|
+
|
|
29
|
+
columnDefinitions = [
|
|
30
|
+
{ def: "#", isShow: true },
|
|
31
|
+
{ def: "Title", isShow: true },
|
|
32
|
+
{ def: "Description", isShow: true },
|
|
33
|
+
{ def: "Actions", isShow: true },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
displayedColumns: string[] = ["#", "Title", "Description", "Actions"];
|
|
37
|
+
|
|
38
|
+
public dataSource = new MatTableDataSource();
|
|
39
|
+
|
|
40
|
+
constructor(
|
|
41
|
+
private fb: FormBuilder,
|
|
42
|
+
private dialog: MatDialog,
|
|
43
|
+
private filterService: FilterService,
|
|
44
|
+
private activatedRoute: ActivatedRoute,
|
|
45
|
+
private productService: ProductService
|
|
46
|
+
) {
|
|
47
|
+
this.filterFormGroup = this.fb.group({
|
|
48
|
+
num_items: [this.num_items + "|" + this.currentPage],
|
|
49
|
+
search: [""],
|
|
50
|
+
type_ids: [""],
|
|
51
|
+
sort_by: [""],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ngOnInit(): void {
|
|
56
|
+
this.patchFiltersFromRoute();
|
|
57
|
+
this.listenForChanges();
|
|
58
|
+
this.loadData();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
listenForChanges() {
|
|
62
|
+
this.filterFormGroup.valueChanges
|
|
63
|
+
.pipe(debounceTime(500), untilDestroyed(this))
|
|
64
|
+
.subscribe((changes) => {
|
|
65
|
+
this.filterService.applyFilterToRoute(
|
|
66
|
+
this.activatedRoute,
|
|
67
|
+
this.filterFormGroup.value
|
|
68
|
+
);
|
|
69
|
+
this.reload();
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
patchFiltersFromRoute() {
|
|
74
|
+
this.routeFilters = this.filterService.getFiltersFromRoute(
|
|
75
|
+
this.activatedRoute,
|
|
76
|
+
this.filterFormGroup.value
|
|
77
|
+
);
|
|
78
|
+
this.filterFormGroup.setValue(this.routeFilters);
|
|
79
|
+
|
|
80
|
+
if (this.routeFilters.type_ids) {
|
|
81
|
+
this.filterFormGroup
|
|
82
|
+
.get("type_ids")!
|
|
83
|
+
.setValue(this.routeFilters.type_ids.split(",").map(Number));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async loadData() {
|
|
88
|
+
let filters = this.filterFormGroup.value;
|
|
89
|
+
filters.page = this.page;
|
|
90
|
+
filters.per_page = this.perPage;
|
|
91
|
+
filters.type_ids = filters.type_ids.toString();
|
|
92
|
+
filters.num_items = this.num_items + "|" + this.currentPage;
|
|
93
|
+
|
|
94
|
+
let res = await this.productService.getProductMeasures(filters);
|
|
95
|
+
|
|
96
|
+
if (this.productMeasures.length < 1) {
|
|
97
|
+
this.productMeasures = res.data;
|
|
98
|
+
} else {
|
|
99
|
+
res.data.forEach((item: any) => this.productMeasures.push(item));
|
|
100
|
+
}
|
|
101
|
+
this.dataSource = new MatTableDataSource(this.productMeasures);
|
|
102
|
+
this.totalItems = res.total;
|
|
103
|
+
this.lastPage = res.last_page || this.page;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
reload() {
|
|
107
|
+
this.productMeasures = [];
|
|
108
|
+
this.currentPage = 1;
|
|
109
|
+
this.loadData();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
modifyProductMeasure(model?: any) {
|
|
113
|
+
const dialogRef = this.dialog.open(ProductMeasureFormComponent, {
|
|
114
|
+
width: "600px",
|
|
115
|
+
data: {
|
|
116
|
+
details: model,
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
121
|
+
if (result) {
|
|
122
|
+
this.reload();
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
onScroll() {
|
|
128
|
+
if (this.totalItems > this.productMeasures.length) {
|
|
129
|
+
this.currentPage += 1;
|
|
130
|
+
this.loadData();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
assignFilter(column: any, direction: string) {
|
|
135
|
+
if (column) {
|
|
136
|
+
return this.filterFormGroup
|
|
137
|
+
.get("sort_by")
|
|
138
|
+
?.setValue(column + "|" + direction);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
sortColumn(event: any) {
|
|
143
|
+
var direction = event.direction.toString().toUpperCase();
|
|
144
|
+
this.assignFilter(event.active, direction);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// eslint-disable-next-line @angular-eslint/use-lifecycle-interface
|
|
148
|
+
// eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method
|
|
149
|
+
ngOnDestroy(): void {
|
|
150
|
+
//Called once, before the instance is destroyed.
|
|
151
|
+
//Add 'implements OnDestroy' to the class.
|
|
152
|
+
}
|
|
153
|
+
}
|
package/src/app/@modules/inventory-common/product/product-nav-bar/product-nav-bar.component.spec.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { ProductNavBarComponent } from "./product-nav-bar.component";
|
|
4
|
+
|
|
5
|
+
describe("ProductNavBarComponent", () => {
|
|
6
|
+
let component: ProductNavBarComponent;
|
|
7
|
+
let fixture: ComponentFixture<ProductNavBarComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ProductNavBarComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(ProductNavBarComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ProductMeasuresListComponent } from "./product-measures-list/product-measures-list.component";
|
|
2
|
+
import { NgModule } from "@angular/core";
|
|
3
|
+
import { RouterModule, Routes } from "@angular/router";
|
|
4
|
+
import { AuthenticationGuard } from "ngx-techlify-core";
|
|
5
|
+
import { ProductListComponent } from "./product-list/product-list.component";
|
|
6
|
+
import { ProductNavBarComponent } from "./product-nav-bar/product-nav-bar.component";
|
|
7
|
+
import { ProductViewPageComponent } from "./product-view-page/product-view-page.component";
|
|
8
|
+
import { ProductImportPageComponent } from "./product-import-page/product-import-page.component";
|
|
9
|
+
|
|
10
|
+
const routes: Routes = [
|
|
11
|
+
{
|
|
12
|
+
path: "",
|
|
13
|
+
component: ProductNavBarComponent,
|
|
14
|
+
children: [
|
|
15
|
+
{
|
|
16
|
+
path: "",
|
|
17
|
+
component: ProductListComponent,
|
|
18
|
+
canLoad: [AuthenticationGuard],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
path: "import",
|
|
22
|
+
component: ProductImportPageComponent,
|
|
23
|
+
canLoad: [AuthenticationGuard],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
path: "measure",
|
|
27
|
+
component: ProductMeasuresListComponent,
|
|
28
|
+
canLoad: [AuthenticationGuard],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
path: ":id/view",
|
|
32
|
+
component: ProductViewPageComponent,
|
|
33
|
+
canLoad: [AuthenticationGuard],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
path: "**",
|
|
37
|
+
redirectTo: "",
|
|
38
|
+
pathMatch: "full",
|
|
39
|
+
canLoad: [AuthenticationGuard],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
@NgModule({
|
|
46
|
+
imports: [RouterModule.forChild(routes)],
|
|
47
|
+
exports: [RouterModule],
|
|
48
|
+
})
|
|
49
|
+
export class ProductRoutingModule {}
|
package/src/app/@modules/inventory-common/product/product-search/product-search.component.html
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<div
|
|
2
|
+
id="tableContainer"
|
|
3
|
+
#tableContainer
|
|
4
|
+
fxLayout="column"
|
|
5
|
+
class="table-container"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="text-dark d-flex flex-row justify-content-start align-items-center gap-2"
|
|
9
|
+
>
|
|
10
|
+
<mat-icon class="material-symbol-outlined"> campaign </mat-icon>
|
|
11
|
+
<strong>Product Search</strong>
|
|
12
|
+
</div>
|
|
13
|
+
<small class="text-secondary mt-2">
|
|
14
|
+
Quickly search for a product to be added as a line item.
|
|
15
|
+
</small>
|
|
16
|
+
<form [formGroup]="searchFormGroup">
|
|
17
|
+
<mat-form-field fxFlex="100%">
|
|
18
|
+
<mat-label>Search</mat-label>
|
|
19
|
+
<input
|
|
20
|
+
fxLayout
|
|
21
|
+
matInput
|
|
22
|
+
placeholder="Search product, SKU"
|
|
23
|
+
formControlName="search"
|
|
24
|
+
/>
|
|
25
|
+
</mat-form-field>
|
|
26
|
+
</form>
|
|
27
|
+
<div
|
|
28
|
+
fxLayout="column"
|
|
29
|
+
fxLayoutGap="0.5rem"
|
|
30
|
+
infiniteScroll
|
|
31
|
+
[infiniteScrollDistance]="2"
|
|
32
|
+
[infiniteScrollThrottle]="50"
|
|
33
|
+
[infiniteScrollContainer]="tableContainer"
|
|
34
|
+
(scrolled)="onScroll()"
|
|
35
|
+
[fromRoot]="false"
|
|
36
|
+
>
|
|
37
|
+
<mat-card
|
|
38
|
+
class="p-2"
|
|
39
|
+
style="background: #d9d9d9"
|
|
40
|
+
*ngFor="let product of products"
|
|
41
|
+
>
|
|
42
|
+
<div>
|
|
43
|
+
<div class="d-flex flex-row justify-content-between align-items-center">
|
|
44
|
+
<strong class="text-dark">{{ product?.name }}</strong>
|
|
45
|
+
<strong
|
|
46
|
+
class="text-primary font-xs cursor-pointer"
|
|
47
|
+
(click)="addProduct(product)"
|
|
48
|
+
>
|
|
49
|
+
Add
|
|
50
|
+
</strong>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="d-flex flex-row justify-content-between align-items-center">
|
|
53
|
+
<small class="text-secondary">{{ product?.sku }}</small>
|
|
54
|
+
<mat-icon
|
|
55
|
+
(click)="viewProduct(product, viewProductTemplate)"
|
|
56
|
+
class="material-symbol-outlined font-md cursor-pointer"
|
|
57
|
+
>
|
|
58
|
+
contact_support
|
|
59
|
+
</mat-icon>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</mat-card>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<ng-template #viewProductTemplate let-data>
|
|
67
|
+
<div mat-dialog-content>
|
|
68
|
+
<app-product-basic-info
|
|
69
|
+
[product]="data.product"
|
|
70
|
+
(saved)="reload()"
|
|
71
|
+
(deleted)="reload()"
|
|
72
|
+
></app-product-basic-info>
|
|
73
|
+
|
|
74
|
+
<div class="d-flex justify-content-end mt-2">
|
|
75
|
+
<button mat-flat-button type="button" mat-dialog-close>Close</button>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</ng-template>
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
EventEmitter,
|
|
4
|
+
OnInit,
|
|
5
|
+
Output,
|
|
6
|
+
TemplateRef,
|
|
7
|
+
} from "@angular/core";
|
|
8
|
+
import { FormBuilder, FormGroup } from "@angular/forms";
|
|
9
|
+
import { MatTableDataSource } from "@angular/material/table";
|
|
10
|
+
import { FilterService } from "ngx-techlify-core";
|
|
11
|
+
import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
|
|
12
|
+
import { ProductService } from "../product.service";
|
|
13
|
+
import { debounceTime } from "rxjs/operators";
|
|
14
|
+
import { ActivatedRoute } from "@angular/router";
|
|
15
|
+
import { ProductViewPageComponent } from "../product-view-page/product-view-page.component";
|
|
16
|
+
import { MatDialog } from "@angular/material/dialog";
|
|
17
|
+
|
|
18
|
+
@UntilDestroy()
|
|
19
|
+
@Component({
|
|
20
|
+
selector: "app-product-search",
|
|
21
|
+
templateUrl: "./product-search.component.html",
|
|
22
|
+
styleUrls: ["./product-search.component.scss"],
|
|
23
|
+
})
|
|
24
|
+
export class ProductSearchComponent implements OnInit {
|
|
25
|
+
public searchFormGroup: FormGroup;
|
|
26
|
+
public lastPage!: number;
|
|
27
|
+
public page: number = 1;
|
|
28
|
+
public perPage: number = 7;
|
|
29
|
+
public totalItems = 0;
|
|
30
|
+
public currentPage = 1;
|
|
31
|
+
public num_items = 7;
|
|
32
|
+
public routeFilters: any;
|
|
33
|
+
public products: any[] = [];
|
|
34
|
+
|
|
35
|
+
columnDefinitions = [
|
|
36
|
+
{ def: "Product Title", isShow: true },
|
|
37
|
+
{ def: "Product Sku", isShow: true },
|
|
38
|
+
{ def: "Actions", isShow: true },
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
displayedColumns: string[] = ["Product Title", "Product Sku", "Actions"];
|
|
42
|
+
public dataSource = new MatTableDataSource();
|
|
43
|
+
|
|
44
|
+
@Output() productAdded: EventEmitter<any> = new EventEmitter();
|
|
45
|
+
constructor(
|
|
46
|
+
private dialog: MatDialog,
|
|
47
|
+
private fb: FormBuilder,
|
|
48
|
+
private filterService: FilterService,
|
|
49
|
+
private productService: ProductService,
|
|
50
|
+
private activatedRoute: ActivatedRoute
|
|
51
|
+
) {
|
|
52
|
+
this.searchFormGroup = this.fb.group({
|
|
53
|
+
num_items: [this.num_items + "|" + this.currentPage],
|
|
54
|
+
search: [""],
|
|
55
|
+
sort_by: [""],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
ngOnInit(): void {
|
|
60
|
+
this.listenForChanges();
|
|
61
|
+
this.loadData();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
listenForChanges() {
|
|
65
|
+
this.searchFormGroup.valueChanges
|
|
66
|
+
.pipe(debounceTime(500), untilDestroyed(this))
|
|
67
|
+
.subscribe((changes) => {
|
|
68
|
+
this.filterService.applyFilterToRoute(
|
|
69
|
+
this.activatedRoute,
|
|
70
|
+
this.searchFormGroup.value
|
|
71
|
+
);
|
|
72
|
+
this.reload();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async loadData() {
|
|
77
|
+
var filters = this.searchFormGroup.value;
|
|
78
|
+
filters.page = this.page;
|
|
79
|
+
filters.per_page = this.perPage;
|
|
80
|
+
filters.num_items = this.num_items + "|" + this.currentPage;
|
|
81
|
+
filters.with = "taxes.tax.type";
|
|
82
|
+
var res = await this.productService.getProducts(filters);
|
|
83
|
+
if (this.products.length < 1) {
|
|
84
|
+
this.products = res.data;
|
|
85
|
+
} else {
|
|
86
|
+
res.data.forEach((item: any) => this.products.push(item));
|
|
87
|
+
}
|
|
88
|
+
this.dataSource = new MatTableDataSource(this.products);
|
|
89
|
+
this.totalItems = res.total;
|
|
90
|
+
this.lastPage = res.last_page || this.page;
|
|
91
|
+
this.barCodeAutoAdd();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
reload() {
|
|
95
|
+
this.products = [];
|
|
96
|
+
this.currentPage = 1;
|
|
97
|
+
this.loadData();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
addProduct(product: any) {
|
|
101
|
+
this.productAdded.emit(product);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
assignFilter(column: any, direction: string) {
|
|
105
|
+
if (column) {
|
|
106
|
+
return this.searchFormGroup
|
|
107
|
+
.get("sort_by")
|
|
108
|
+
?.setValue(column + "|" + direction);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Checks search filter for an exact match in a product and adds product to form
|
|
114
|
+
*/
|
|
115
|
+
barCodeAutoAdd() {
|
|
116
|
+
var filters = this.searchFormGroup.value;
|
|
117
|
+
if (filters.search) {
|
|
118
|
+
let result = this.products.find((obj) => {
|
|
119
|
+
return obj.sku === filters.search;
|
|
120
|
+
});
|
|
121
|
+
if (result) {
|
|
122
|
+
this.addProduct(result);
|
|
123
|
+
this.searchFormGroup.get("search")?.patchValue("");
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
sortColumn(event: any) {
|
|
129
|
+
var direction = event.direction.toString().toUpperCase();
|
|
130
|
+
this.assignFilter(event.active, direction);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
onScroll() {
|
|
134
|
+
if (this.totalItems > this.products.length) {
|
|
135
|
+
this.currentPage += 1;
|
|
136
|
+
this.loadData();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
viewProduct(product: any, viewProductTemplate: TemplateRef<any>) {
|
|
141
|
+
const dialogRef = this.dialog.open(viewProductTemplate, {
|
|
142
|
+
width: "800px",
|
|
143
|
+
data: {
|
|
144
|
+
product,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
148
|
+
if (result) {
|
|
149
|
+
this.reload();
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|