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,32 @@
|
|
|
1
|
+
import { SupplierViewComponent } from "./supplier-view/supplier-view.component";
|
|
2
|
+
import { NgModule } from "@angular/core";
|
|
3
|
+
import { RouterModule, Routes } from "@angular/router";
|
|
4
|
+
import { SupplierComponent } from "./supplier.component";
|
|
5
|
+
import { SuppliersListComponent } from "./suppliers-list/suppliers-list.component";
|
|
6
|
+
|
|
7
|
+
const routes: Routes = [
|
|
8
|
+
{
|
|
9
|
+
path: "",
|
|
10
|
+
component: SupplierComponent,
|
|
11
|
+
children: [
|
|
12
|
+
{ path: "", component: SuppliersListComponent },
|
|
13
|
+
{
|
|
14
|
+
path: ":id/view",
|
|
15
|
+
component: SupplierViewComponent,
|
|
16
|
+
children: [
|
|
17
|
+
{
|
|
18
|
+
path: "",
|
|
19
|
+
redirectTo: "incidents",
|
|
20
|
+
pathMatch: "full",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
@NgModule({
|
|
29
|
+
imports: [RouterModule.forChild(routes)],
|
|
30
|
+
exports: [RouterModule],
|
|
31
|
+
})
|
|
32
|
+
export class SupplierRoutingModule {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Injectable } from "@angular/core";
|
|
2
|
+
import { HttpService } from "ngx-techlify-core";
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: "root",
|
|
6
|
+
})
|
|
7
|
+
export class SupplierTypeService {
|
|
8
|
+
constructor(private httpService: HttpService) {}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* get all suppliers from API
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
index() {
|
|
15
|
+
return this.httpService.get(`api/supplier-types`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<mat-progress-bar *ngIf="isLoading" mode="indeterminate"></mat-progress-bar>
|
|
2
|
+
|
|
3
|
+
<div *ngIf="supplier" class="d-flex justify-content-start gap-3">
|
|
4
|
+
<div style="width: 300px">
|
|
5
|
+
<app-supplier-information [supplier]="supplier"></app-supplier-information>
|
|
6
|
+
<mat-card class="mt-3">
|
|
7
|
+
<mat-card-content class="p-0">
|
|
8
|
+
<app-note-list
|
|
9
|
+
modelType="Supplier"
|
|
10
|
+
[relatedModelId]="supplier?.id"
|
|
11
|
+
></app-note-list>
|
|
12
|
+
</mat-card-content>
|
|
13
|
+
</mat-card>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div style="width: calc(100% - 300px - 1rem)">
|
|
17
|
+
<mat-card style="width: fit-content">
|
|
18
|
+
<mat-card-content class="p-0">
|
|
19
|
+
<mat-tab-group
|
|
20
|
+
mat-stretch-tabs="false"
|
|
21
|
+
mat-align-tabs="start"
|
|
22
|
+
[selectedIndex]="selectedTabIndex"
|
|
23
|
+
(selectedTabChange)="onTabChange($event)"
|
|
24
|
+
>
|
|
25
|
+
<mat-tab>
|
|
26
|
+
<ng-template mat-tab-label>
|
|
27
|
+
<div
|
|
28
|
+
class="d-flex justify-content-start align-items-center gap-1"
|
|
29
|
+
>
|
|
30
|
+
<span class="material-symbols-outlined">unknown_document</span>
|
|
31
|
+
<span class="pl-2">Incidents</span>
|
|
32
|
+
</div>
|
|
33
|
+
</ng-template>
|
|
34
|
+
</mat-tab>
|
|
35
|
+
<mat-tab>
|
|
36
|
+
<ng-template mat-tab-label>
|
|
37
|
+
<div
|
|
38
|
+
class="d-flex justify-content-start align-items-center gap-1"
|
|
39
|
+
>
|
|
40
|
+
<span class="material-symbols-outlined">star</span>
|
|
41
|
+
<span class="pl-2">Ratings</span>
|
|
42
|
+
</div>
|
|
43
|
+
</ng-template>
|
|
44
|
+
</mat-tab>
|
|
45
|
+
<mat-tab>
|
|
46
|
+
<ng-template mat-tab-label>
|
|
47
|
+
<div
|
|
48
|
+
class="d-flex justify-content-start align-items-center gap-1"
|
|
49
|
+
>
|
|
50
|
+
<span class="material-symbols-outlined">price_change</span>
|
|
51
|
+
<span class="pl-2">Estimates</span>
|
|
52
|
+
</div>
|
|
53
|
+
</ng-template>
|
|
54
|
+
</mat-tab>
|
|
55
|
+
</mat-tab-group>
|
|
56
|
+
</mat-card-content>
|
|
57
|
+
</mat-card>
|
|
58
|
+
<router-outlet></router-outlet>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { lastValueFrom } from "rxjs";
|
|
2
|
+
import { Component, OnInit } from "@angular/core";
|
|
3
|
+
import { ActivatedRoute, Router } from "@angular/router";
|
|
4
|
+
import { SupplierService } from "../supplier.service";
|
|
5
|
+
import { MatTabChangeEvent } from "@angular/material/tabs";
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: "app-supplier-view",
|
|
9
|
+
templateUrl: "./supplier-view.component.html",
|
|
10
|
+
})
|
|
11
|
+
export class SupplierViewComponent implements OnInit {
|
|
12
|
+
supplier: any;
|
|
13
|
+
supplierId: number = 0;
|
|
14
|
+
selectedTabIndex: number = 0;
|
|
15
|
+
isLoading: boolean = false;
|
|
16
|
+
|
|
17
|
+
constructor(
|
|
18
|
+
private supplierService: SupplierService,
|
|
19
|
+
private route: ActivatedRoute,
|
|
20
|
+
private router: Router
|
|
21
|
+
) {}
|
|
22
|
+
|
|
23
|
+
ngOnInit(): void {
|
|
24
|
+
this.route.firstChild?.url.subscribe((url) => {
|
|
25
|
+
if (url[0].path === "ratings") {
|
|
26
|
+
this.selectedTabIndex = 1;
|
|
27
|
+
} else if (url[0].path === "estimates") {
|
|
28
|
+
this.selectedTabIndex = 2;
|
|
29
|
+
} else {
|
|
30
|
+
this.selectedTabIndex = 0;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
this.supplierId = this.route.snapshot.params["id"];
|
|
35
|
+
this.getSupplier(this.supplierId);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
onTabChange(event: MatTabChangeEvent) {
|
|
39
|
+
switch (event.index) {
|
|
40
|
+
case 0:
|
|
41
|
+
this.router.navigate(["incidents"], { relativeTo: this.route });
|
|
42
|
+
return;
|
|
43
|
+
case 1:
|
|
44
|
+
this.router.navigate(["ratings"], { relativeTo: this.route });
|
|
45
|
+
return;
|
|
46
|
+
case 2:
|
|
47
|
+
this.router.navigate(["estimates"], { relativeTo: this.route });
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async getSupplier(id: number) {
|
|
53
|
+
this.isLoading = true;
|
|
54
|
+
let result: any = await lastValueFrom(this.supplierService.show(id));
|
|
55
|
+
this.isLoading = false;
|
|
56
|
+
this.supplier = result.item;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from "@angular/core";
|
|
2
|
+
import { SupplierFormComponent } from "./supplier-form/supplier-form.component";
|
|
3
|
+
import { MatDialog } from "@angular/material/dialog";
|
|
4
|
+
import { SupplierFormService } from "./supplier-form/supplier-form.service";
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "app-supplier",
|
|
8
|
+
templateUrl: "./supplier.component.html",
|
|
9
|
+
styleUrls: ["./supplier.component.scss"],
|
|
10
|
+
})
|
|
11
|
+
export class SupplierComponent {
|
|
12
|
+
constructor(
|
|
13
|
+
public dialog: MatDialog,
|
|
14
|
+
private supplierFormService: SupplierFormService
|
|
15
|
+
) {}
|
|
16
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuditLogForModelModule,
|
|
3
|
+
NoteModule,
|
|
4
|
+
SearchableSelectorModule,
|
|
5
|
+
} from "ngx-techlify-core";
|
|
6
|
+
import { NgModule } from "@angular/core";
|
|
7
|
+
import { CommonModule } from "@angular/common";
|
|
8
|
+
|
|
9
|
+
import { SupplierRoutingModule } from "./supplier-routing.module";
|
|
10
|
+
import { SupplierComponent } from "./supplier.component";
|
|
11
|
+
import { SupplierViewComponent } from "./supplier-view/supplier-view.component";
|
|
12
|
+
import { SuppliersListComponent } from "./suppliers-list/suppliers-list.component";
|
|
13
|
+
import { SupplierFormComponent } from "./supplier-form/supplier-form.component";
|
|
14
|
+
import { SupplierInformationComponent } from "./supplier-information/supplier-information.component";
|
|
15
|
+
import { FlexModule } from "@angular/flex-layout";
|
|
16
|
+
import { MaterialModule } from "@app/material.module";
|
|
17
|
+
import { ReactiveFormsModule } from "@angular/forms";
|
|
18
|
+
import { InfiniteScrollModule } from "ngx-infinite-scroll";
|
|
19
|
+
|
|
20
|
+
@NgModule({
|
|
21
|
+
declarations: [
|
|
22
|
+
SupplierComponent,
|
|
23
|
+
SupplierViewComponent,
|
|
24
|
+
SuppliersListComponent,
|
|
25
|
+
SupplierFormComponent,
|
|
26
|
+
SupplierInformationComponent,
|
|
27
|
+
],
|
|
28
|
+
imports: [
|
|
29
|
+
CommonModule,
|
|
30
|
+
SupplierRoutingModule,
|
|
31
|
+
MaterialModule,
|
|
32
|
+
SearchableSelectorModule,
|
|
33
|
+
AuditLogForModelModule,
|
|
34
|
+
NoteModule,
|
|
35
|
+
FlexModule,
|
|
36
|
+
MaterialModule,
|
|
37
|
+
MaterialModule,
|
|
38
|
+
ReactiveFormsModule,
|
|
39
|
+
InfiniteScrollModule,
|
|
40
|
+
],
|
|
41
|
+
})
|
|
42
|
+
export class SupplierModule {}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Injectable } from "@angular/core";
|
|
2
|
+
import { HttpService } from "ngx-techlify-core";
|
|
3
|
+
import { HttpParams } from "@angular/common/http";
|
|
4
|
+
|
|
5
|
+
@Injectable({
|
|
6
|
+
providedIn: "root",
|
|
7
|
+
})
|
|
8
|
+
export class SupplierService {
|
|
9
|
+
constructor(private httpService: HttpService) {}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* get all suppliers from API
|
|
13
|
+
*
|
|
14
|
+
* @param filters Any attributes to filter suppliers by
|
|
15
|
+
*/
|
|
16
|
+
index(filters?: any) {
|
|
17
|
+
let queries = new HttpParams({ fromObject: filters });
|
|
18
|
+
return this.httpService.get(`api/suppliers`, { params: queries });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* get individual supplier from API (for view page)
|
|
23
|
+
*
|
|
24
|
+
* @param id ID of the supplier being requested
|
|
25
|
+
*/
|
|
26
|
+
show(id: any) {
|
|
27
|
+
return this.httpService.get(`api/suppliers/${id}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* store a new supplier in the DB
|
|
32
|
+
*
|
|
33
|
+
* @param model data from the supplier form that will be stored in the DB
|
|
34
|
+
*/
|
|
35
|
+
store(model: any) {
|
|
36
|
+
return this.httpService.post(`api/suppliers`, model);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* update a supplier in the DB
|
|
41
|
+
*
|
|
42
|
+
* @param model.id ID of the supplier being updated
|
|
43
|
+
* @param model data from the supplier form that will be updated in the DB
|
|
44
|
+
*/
|
|
45
|
+
update(model: any) {
|
|
46
|
+
return this.httpService.put(`api/suppliers/${model?.id}`, model);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* delete a supplier from the DB
|
|
51
|
+
*
|
|
52
|
+
* @param id ID of the supplier being deleted
|
|
53
|
+
*/
|
|
54
|
+
destroy(id: number) {
|
|
55
|
+
return this.httpService.delete(`api/suppliers/${id}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/app/@modules/inventory-common/supplier/suppliers-list/suppliers-list.component.html
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<div class="d-flex justify-content-center align-items-center gap-3 mb-3">
|
|
2
|
+
<h2 class="mb-0">Suppliers</h2>
|
|
3
|
+
<mat-icon
|
|
4
|
+
color="primary"
|
|
5
|
+
class="cursor-pointer"
|
|
6
|
+
(click)="showAddSupplierDialog()"
|
|
7
|
+
>
|
|
8
|
+
add
|
|
9
|
+
</mat-icon>
|
|
10
|
+
</div>
|
|
11
|
+
<mat-card class="mb-3">
|
|
12
|
+
<mat-card-content>
|
|
13
|
+
<form
|
|
14
|
+
[formGroup]="filterFormGroup"
|
|
15
|
+
fxLayout
|
|
16
|
+
fxLayoutGap="1rem"
|
|
17
|
+
fxLayoutAlign="start center"
|
|
18
|
+
>
|
|
19
|
+
<mat-form-field fxFlex="24">
|
|
20
|
+
<input
|
|
21
|
+
matInput
|
|
22
|
+
placeholder="Search Supplier by Name, Phone, Address, Email, Description"
|
|
23
|
+
formControlName="search"
|
|
24
|
+
/>
|
|
25
|
+
<mat-icon matSuffix>search</mat-icon>
|
|
26
|
+
</mat-form-field>
|
|
27
|
+
<mat-label class="ml-4">Type</mat-label>
|
|
28
|
+
<mat-button-toggle-group formControlName="supplier_type_ids" multiple>
|
|
29
|
+
<mat-button-toggle
|
|
30
|
+
*ngFor="let item of supplierTypes"
|
|
31
|
+
[value]="item.id"
|
|
32
|
+
>{{ item.title }}</mat-button-toggle
|
|
33
|
+
>
|
|
34
|
+
</mat-button-toggle-group>
|
|
35
|
+
</form>
|
|
36
|
+
</mat-card-content>
|
|
37
|
+
</mat-card>
|
|
38
|
+
<mat-card>
|
|
39
|
+
<mat-card-content class="p-0">
|
|
40
|
+
<table
|
|
41
|
+
mat-table
|
|
42
|
+
#table
|
|
43
|
+
[dataSource]="dataSource"
|
|
44
|
+
class="w-100 table-hover"
|
|
45
|
+
infiniteScroll
|
|
46
|
+
[infiniteScrollDistance]="2"
|
|
47
|
+
[infiniteScrollThrottle]="50"
|
|
48
|
+
(scrolled)="onScroll()"
|
|
49
|
+
[fromRoot]="true"
|
|
50
|
+
matSort
|
|
51
|
+
(matSortChange)="sortColumn($event)"
|
|
52
|
+
aria-describedby="Suppliers List"
|
|
53
|
+
>
|
|
54
|
+
<ng-container matColumnDef="#">
|
|
55
|
+
<th mat-header-cell *matHeaderCellDef>#</th>
|
|
56
|
+
<td mat-cell *matCellDef="let element; let i = index">{{ i + 1 }}</td>
|
|
57
|
+
</ng-container>
|
|
58
|
+
|
|
59
|
+
<ng-container matColumnDef="company_name">
|
|
60
|
+
<th mat-header-cell *matHeaderCellDef mat-sort-header>Company</th>
|
|
61
|
+
<td mat-cell *matCellDef="let element">
|
|
62
|
+
<div class="d-flex flex-column gap-1">
|
|
63
|
+
<strong>{{ element?.company_name }}</strong>
|
|
64
|
+
<span class="status-pill status-pill-sm status-ongoing">
|
|
65
|
+
{{ element?.type?.title }}
|
|
66
|
+
</span>
|
|
67
|
+
</div>
|
|
68
|
+
</td>
|
|
69
|
+
</ng-container>
|
|
70
|
+
|
|
71
|
+
<ng-container matColumnDef="contact_name">
|
|
72
|
+
<th mat-header-cell *matHeaderCellDef mat-sort-header>Contact Name</th>
|
|
73
|
+
<td mat-cell *matCellDef="let element">
|
|
74
|
+
{{ element?.contact_name }}
|
|
75
|
+
</td>
|
|
76
|
+
</ng-container>
|
|
77
|
+
|
|
78
|
+
<ng-container matColumnDef="phone">
|
|
79
|
+
<th mat-header-cell *matHeaderCellDef>Phone</th>
|
|
80
|
+
<td mat-cell *matCellDef="let element">{{ element?.phone }}</td>
|
|
81
|
+
</ng-container>
|
|
82
|
+
|
|
83
|
+
<ng-container matColumnDef="address">
|
|
84
|
+
<th mat-header-cell *matHeaderCellDef mat-sort-header>Address</th>
|
|
85
|
+
<td mat-cell *matCellDef="let element">{{ element?.address }}</td>
|
|
86
|
+
</ng-container>
|
|
87
|
+
|
|
88
|
+
<ng-container matColumnDef="email">
|
|
89
|
+
<th mat-header-cell *matHeaderCellDef mat-sort-header>Email</th>
|
|
90
|
+
<td mat-cell *matCellDef="let element">{{ element?.email }}</td>
|
|
91
|
+
</ng-container>
|
|
92
|
+
|
|
93
|
+
<ng-container matColumnDef="details">
|
|
94
|
+
<th mat-header-cell *matHeaderCellDef>Description</th>
|
|
95
|
+
<td mat-cell *matCellDef="let element">{{ element?.details }}</td>
|
|
96
|
+
</ng-container>
|
|
97
|
+
|
|
98
|
+
<ng-container matColumnDef="actions">
|
|
99
|
+
<th mat-header-cell *matHeaderCellDef>Actions</th>
|
|
100
|
+
<td mat-cell *matCellDef="let element">
|
|
101
|
+
<div class="text-secondary" fxLayoutGap="1rem">
|
|
102
|
+
<app-audit-log-for-model
|
|
103
|
+
[modelId]="element?.id"
|
|
104
|
+
modelType="Supplier"
|
|
105
|
+
logView="all"
|
|
106
|
+
></app-audit-log-for-model>
|
|
107
|
+
<button
|
|
108
|
+
mat-icon-button
|
|
109
|
+
[routerLink]="['/suppliers', element.id, 'view']"
|
|
110
|
+
routerLinkActive="route-link-active"
|
|
111
|
+
*ngxPermissionsOnly="['supplier.read']"
|
|
112
|
+
>
|
|
113
|
+
<mat-icon matTooltip="View">remove_red_eye</mat-icon>
|
|
114
|
+
</button>
|
|
115
|
+
<button
|
|
116
|
+
*ngxPermissionsOnly="['supplier.update']"
|
|
117
|
+
mat-icon-button
|
|
118
|
+
(click)="editForm(element)"
|
|
119
|
+
>
|
|
120
|
+
<mat-icon>edit</mat-icon>
|
|
121
|
+
</button>
|
|
122
|
+
<button
|
|
123
|
+
*ngxPermissionsOnly="['supplier.delete']"
|
|
124
|
+
type="button"
|
|
125
|
+
mat-icon-button
|
|
126
|
+
(click)="deleteForm(element)"
|
|
127
|
+
>
|
|
128
|
+
<mat-icon>delete</mat-icon>
|
|
129
|
+
</button>
|
|
130
|
+
</div>
|
|
131
|
+
</td>
|
|
132
|
+
</ng-container>
|
|
133
|
+
|
|
134
|
+
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
|
|
135
|
+
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
136
|
+
</table>
|
|
137
|
+
|
|
138
|
+
<mat-progress-bar mode="indeterminate" *ngIf="isLoading"></mat-progress-bar>
|
|
139
|
+
</mat-card-content>
|
|
140
|
+
</mat-card>
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { Component, OnInit } from "@angular/core";
|
|
2
|
+
import { FormGroup, FormBuilder } from "@angular/forms";
|
|
3
|
+
import { MatDialog } from "@angular/material/dialog";
|
|
4
|
+
import { MatTableDataSource } from "@angular/material/table";
|
|
5
|
+
import { ActivatedRoute } from "@angular/router";
|
|
6
|
+
import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
|
|
7
|
+
import { NgxSpinnerService } from "ngx-spinner";
|
|
8
|
+
import {
|
|
9
|
+
ActionPopup,
|
|
10
|
+
ActionPopupComponent,
|
|
11
|
+
AlertService,
|
|
12
|
+
ErrorHandlerService,
|
|
13
|
+
FilterService,
|
|
14
|
+
TechlifyListingControllerInterface,
|
|
15
|
+
} from "ngx-techlify-core";
|
|
16
|
+
import { debounceTime, lastValueFrom } from "rxjs";
|
|
17
|
+
import { SupplierFormComponent } from "../supplier-form/supplier-form.component";
|
|
18
|
+
import { SupplierTypeService } from "../supplier-type.service";
|
|
19
|
+
import { SupplierService } from "../supplier.service";
|
|
20
|
+
import { SupplierFormService } from "../supplier-form/supplier-form.service";
|
|
21
|
+
@UntilDestroy()
|
|
22
|
+
@Component({
|
|
23
|
+
selector: "app-suppliers-list",
|
|
24
|
+
templateUrl: "./suppliers-list.component.html",
|
|
25
|
+
})
|
|
26
|
+
export class SuppliersListComponent
|
|
27
|
+
extends TechlifyListingControllerInterface
|
|
28
|
+
implements OnInit
|
|
29
|
+
{
|
|
30
|
+
displayedColumns: string[] = [
|
|
31
|
+
"#",
|
|
32
|
+
"company_name",
|
|
33
|
+
"contact_name",
|
|
34
|
+
"phone",
|
|
35
|
+
"address",
|
|
36
|
+
"email",
|
|
37
|
+
"details",
|
|
38
|
+
"actions",
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
public filterFormGroup: FormGroup;
|
|
42
|
+
public dataSource = new MatTableDataSource();
|
|
43
|
+
public totalItems = 0;
|
|
44
|
+
public currentPage = 1;
|
|
45
|
+
public routeFilters: any;
|
|
46
|
+
public supplierTypes: any;
|
|
47
|
+
public isLoading: boolean = false;
|
|
48
|
+
|
|
49
|
+
constructor(
|
|
50
|
+
private spinner: NgxSpinnerService,
|
|
51
|
+
private fb: FormBuilder,
|
|
52
|
+
private supplierService: SupplierService,
|
|
53
|
+
private supplierTypeService: SupplierTypeService,
|
|
54
|
+
private errorHandler: ErrorHandlerService,
|
|
55
|
+
private filterService: FilterService,
|
|
56
|
+
private activatedRoute: ActivatedRoute,
|
|
57
|
+
private alertService: AlertService,
|
|
58
|
+
private dialog: MatDialog,
|
|
59
|
+
private supplierFormService: SupplierFormService
|
|
60
|
+
) {
|
|
61
|
+
super();
|
|
62
|
+
this.page = 1;
|
|
63
|
+
this.perPage = 25;
|
|
64
|
+
this.models = [];
|
|
65
|
+
this.filterFormGroup = this.fb.group({
|
|
66
|
+
search: [""],
|
|
67
|
+
supplier_type_ids: ["1,2"],
|
|
68
|
+
num_items: [this.perPage + "|" + this.currentPage],
|
|
69
|
+
sort_by: [""],
|
|
70
|
+
});
|
|
71
|
+
this.supplierTypes = [];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
ngOnInit(): void {
|
|
75
|
+
this.patchFiltersFromRoute();
|
|
76
|
+
this.listenForChanges();
|
|
77
|
+
this.getSupplierTypes();
|
|
78
|
+
this.loadData();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
override listenForChanges() {
|
|
82
|
+
// listen for supplier added event to update the list.
|
|
83
|
+
this.supplierFormService.isListUpdated().subscribe((val: boolean) => {
|
|
84
|
+
if (val && !this.isLoading) this.reload();
|
|
85
|
+
});
|
|
86
|
+
// listen for form group changes.
|
|
87
|
+
this.filterFormGroup.valueChanges
|
|
88
|
+
.pipe(debounceTime(500), untilDestroyed(this))
|
|
89
|
+
.subscribe((changes) => {
|
|
90
|
+
this.filterService.applyFilterToRoute(
|
|
91
|
+
this.activatedRoute,
|
|
92
|
+
this.filterFormGroup.value
|
|
93
|
+
);
|
|
94
|
+
this.reload();
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
patchFiltersFromRoute() {
|
|
99
|
+
this.routeFilters = this.filterService.getFiltersFromRoute(
|
|
100
|
+
this.activatedRoute,
|
|
101
|
+
this.filterFormGroup.value
|
|
102
|
+
);
|
|
103
|
+
this.filterFormGroup.setValue(this.routeFilters);
|
|
104
|
+
|
|
105
|
+
if (this.routeFilters.supplier_type_ids) {
|
|
106
|
+
this.filterFormGroup
|
|
107
|
+
.get("supplier_type_ids")!
|
|
108
|
+
.setValue(this.routeFilters.supplier_type_ids.split(",").map(Number));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
sortColumn(event: any) {
|
|
113
|
+
var direction = event.direction.toString().toUpperCase();
|
|
114
|
+
this.assignFilter(event.active, direction);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
assignFilter(column: any, direction: any) {
|
|
118
|
+
return this.filterFormGroup
|
|
119
|
+
.get("sort_by")
|
|
120
|
+
?.setValue(column + "|" + direction);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async getSupplierTypes() {
|
|
124
|
+
try {
|
|
125
|
+
let res: any = await lastValueFrom(this.supplierTypeService.index());
|
|
126
|
+
this.supplierTypes = res.data;
|
|
127
|
+
console.log(this.supplierTypes);
|
|
128
|
+
} catch (error) {
|
|
129
|
+
this.errorHandler.handleError(error);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
async loadData() {
|
|
134
|
+
let filters = this.filterFormGroup.value;
|
|
135
|
+
filters.page = this.page = 1;
|
|
136
|
+
filters.per_page = this.perPage;
|
|
137
|
+
filters.supplier_type_ids = filters?.supplier_type_ids?.toString();
|
|
138
|
+
filters.num_items = this.perPage + "|" + this.currentPage;
|
|
139
|
+
try {
|
|
140
|
+
this.isLoading = true;
|
|
141
|
+
let res: any = await lastValueFrom(this.supplierService.index(filters));
|
|
142
|
+
if (this.models.length < 1) {
|
|
143
|
+
this.models = res.data;
|
|
144
|
+
} else {
|
|
145
|
+
res.data.forEach((item: any) => this.models.push(item));
|
|
146
|
+
}
|
|
147
|
+
this.dataSource = new MatTableDataSource(this.models);
|
|
148
|
+
this.totalItems = res.total;
|
|
149
|
+
this.lastPage = res.last_page || this.page;
|
|
150
|
+
// list is updated do not listen form isListUpdated
|
|
151
|
+
this.supplierFormService.listUpdated(false);
|
|
152
|
+
} catch (error) {
|
|
153
|
+
this.errorHandler.handleError(error);
|
|
154
|
+
} finally {
|
|
155
|
+
this.isLoading = false;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
override reload() {
|
|
160
|
+
if (this.isLoading) return;
|
|
161
|
+
this.models = [];
|
|
162
|
+
this.currentPage = 1;
|
|
163
|
+
this.loadData();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
override onScroll() {
|
|
167
|
+
if (this.totalItems > this.models.length && !this.isLoading) {
|
|
168
|
+
this.currentPage += 1;
|
|
169
|
+
this.loadData();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
editForm(model?: any): void {
|
|
174
|
+
const dialogRef = this.dialog.open(SupplierFormComponent, {
|
|
175
|
+
width: "400px",
|
|
176
|
+
autoFocus: false,
|
|
177
|
+
data: {
|
|
178
|
+
details: model,
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
dialogRef.afterClosed().subscribe((result: any) => {
|
|
183
|
+
if (result) {
|
|
184
|
+
this.reload();
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
deleteForm(supplier: any): void {
|
|
189
|
+
const dialogRef = this.dialog.open(ActionPopupComponent, {
|
|
190
|
+
width: "400px",
|
|
191
|
+
data: <ActionPopup>{
|
|
192
|
+
title: "Delete Supplier",
|
|
193
|
+
message: "Are you sure you want to delete the Supplier?",
|
|
194
|
+
},
|
|
195
|
+
autoFocus: false,
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
dialogRef.afterClosed().subscribe(async (result) => {
|
|
199
|
+
if (result) {
|
|
200
|
+
this.spinner.show();
|
|
201
|
+
try {
|
|
202
|
+
const result = await lastValueFrom(
|
|
203
|
+
this.supplierService.destroy(supplier.id)
|
|
204
|
+
);
|
|
205
|
+
this.alertService.addAlert(
|
|
206
|
+
"Successfully deleted the Supplier",
|
|
207
|
+
"success"
|
|
208
|
+
);
|
|
209
|
+
this.reload();
|
|
210
|
+
} catch (error) {
|
|
211
|
+
this.errorHandler.handleError(error);
|
|
212
|
+
} finally {
|
|
213
|
+
this.spinner.hide();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Show the supplier create form.
|
|
221
|
+
*
|
|
222
|
+
* @param model
|
|
223
|
+
*/
|
|
224
|
+
showAddSupplierDialog(model?: any) {
|
|
225
|
+
const dialogRef = this.dialog.open(SupplierFormComponent, {
|
|
226
|
+
width: "400px",
|
|
227
|
+
autoFocus: false,
|
|
228
|
+
data: {
|
|
229
|
+
model,
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
dialogRef.afterClosed().subscribe((result: any) => {
|
|
234
|
+
if (result) {
|
|
235
|
+
// record added successfully, inform the list component.
|
|
236
|
+
this.supplierFormService.listUpdated(true);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|