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,109 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
|
2
|
+
import {
|
|
3
|
+
RequestHelperService,
|
|
4
|
+
TechlifyListingControllerInterface,
|
|
5
|
+
Timeline,
|
|
6
|
+
} from "ngx-techlify-core";
|
|
7
|
+
import { StockReceiptService } from "../stock-receipt.service";
|
|
8
|
+
import { FormBuilder, FormGroup } from "@angular/forms";
|
|
9
|
+
import { UntilDestroy } from "@ngneat/until-destroy";
|
|
10
|
+
import { Sort } from "@angular/material/sort";
|
|
11
|
+
import { debounceTime } from "rxjs";
|
|
12
|
+
|
|
13
|
+
@UntilDestroy()
|
|
14
|
+
@Component({
|
|
15
|
+
selector: "app-stock-receipts-list-page",
|
|
16
|
+
templateUrl: "./stock-receipts-list-page.component.html",
|
|
17
|
+
styleUrls: ["./stock-receipts-list-page.component.scss"],
|
|
18
|
+
})
|
|
19
|
+
export class StockReceiptsListPageComponent
|
|
20
|
+
extends TechlifyListingControllerInterface
|
|
21
|
+
implements OnInit
|
|
22
|
+
{
|
|
23
|
+
@Input() product: any;
|
|
24
|
+
@Output() listUpdated: EventEmitter<any> = new EventEmitter<any>();
|
|
25
|
+
|
|
26
|
+
displayedColumns: string[] = [
|
|
27
|
+
"no",
|
|
28
|
+
"product",
|
|
29
|
+
"date",
|
|
30
|
+
"quantity",
|
|
31
|
+
"purchase_price",
|
|
32
|
+
"amount",
|
|
33
|
+
"particulars",
|
|
34
|
+
"supplier",
|
|
35
|
+
"creator",
|
|
36
|
+
"actions",
|
|
37
|
+
];
|
|
38
|
+
filterConfig: any = {
|
|
39
|
+
duration: {
|
|
40
|
+
label: "Date",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
constructor(
|
|
45
|
+
private stockReceiptService: StockReceiptService,
|
|
46
|
+
private formBuilder: FormBuilder,
|
|
47
|
+
private requestHelperService: RequestHelperService
|
|
48
|
+
) {
|
|
49
|
+
super();
|
|
50
|
+
this.lastPage = 0;
|
|
51
|
+
this.filterForm = this.formBuilder.group({
|
|
52
|
+
product_ids: [""],
|
|
53
|
+
duration: [Timeline.THIS_MONTH],
|
|
54
|
+
date_from: [""],
|
|
55
|
+
date_to: [""],
|
|
56
|
+
supplier_ids: [""],
|
|
57
|
+
measure_ids: [""],
|
|
58
|
+
sort_by: ["date|desc"],
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
ngOnInit(): void {
|
|
63
|
+
(this.filterForm as FormGroup).valueChanges
|
|
64
|
+
.pipe(debounceTime(500))
|
|
65
|
+
.subscribe({
|
|
66
|
+
next: () => this.reload(),
|
|
67
|
+
});
|
|
68
|
+
if (this.product) {
|
|
69
|
+
this.filterForm.get("product_ids")?.setValue(this.product?.id);
|
|
70
|
+
const index = this.displayedColumns.indexOf("product");
|
|
71
|
+
if (index !== -1) {
|
|
72
|
+
this.displayedColumns.splice(index, 1);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
loadData(): void {
|
|
78
|
+
const params: any = {
|
|
79
|
+
page: this.page,
|
|
80
|
+
perPage: this.perPage,
|
|
81
|
+
with: "creator,supplier,product.measure",
|
|
82
|
+
...this.requestHelperService.convertToFormData(this.filterForm.value),
|
|
83
|
+
};
|
|
84
|
+
this.isWorking = true;
|
|
85
|
+
this.stockReceiptService.index(params).subscribe({
|
|
86
|
+
next: (response: any) => {
|
|
87
|
+
this.models = this.models.concat(response?.data);
|
|
88
|
+
this.lastPage = response?.last_page;
|
|
89
|
+
this.isWorking = false;
|
|
90
|
+
},
|
|
91
|
+
error: () => {
|
|
92
|
+
this.isWorking = false;
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
onSortChange(sort: Sort) {
|
|
98
|
+
console.log(sort);
|
|
99
|
+
let { active, direction } = sort;
|
|
100
|
+
if (!active) {
|
|
101
|
+
active = "date";
|
|
102
|
+
}
|
|
103
|
+
if (!direction) {
|
|
104
|
+
direction = "desc";
|
|
105
|
+
active = "date";
|
|
106
|
+
}
|
|
107
|
+
this.filterForm.get("sort_by").setValue(active + "|" + direction);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NgModule } from "@angular/core";
|
|
2
|
+
import { RouterModule, Routes } from "@angular/router";
|
|
3
|
+
import { StockReceiptsListPageComponent } from "./stock-receipts-list-page/stock-receipts-list-page.component";
|
|
4
|
+
|
|
5
|
+
const routes: Routes = [
|
|
6
|
+
{
|
|
7
|
+
path: "",
|
|
8
|
+
component: StockReceiptsListPageComponent,
|
|
9
|
+
},
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
@NgModule({
|
|
13
|
+
imports: [RouterModule.forChild(routes)],
|
|
14
|
+
exports: [RouterModule],
|
|
15
|
+
})
|
|
16
|
+
export class StockReceiptsRoutingModule {}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { NgModule } from "@angular/core";
|
|
2
|
+
import { CommonModule } from "@angular/common";
|
|
3
|
+
|
|
4
|
+
import { StockReceiptsRoutingModule } from "./stock-receipts-routing.module";
|
|
5
|
+
import { StockReceiptsListPageComponent } from "./stock-receipts-list-page/stock-receipts-list-page.component";
|
|
6
|
+
import { MatCardModule } from "@angular/material/card";
|
|
7
|
+
import { MatTableModule } from "@angular/material/table";
|
|
8
|
+
import { MatFormFieldModule } from "@angular/material/form-field";
|
|
9
|
+
import {
|
|
10
|
+
MaterialModule,
|
|
11
|
+
SearchableSelectorModule,
|
|
12
|
+
TimelineFilterModule,
|
|
13
|
+
} from "ngx-techlify-core";
|
|
14
|
+
import { ReactiveFormsModule } from "@angular/forms";
|
|
15
|
+
import { MatProgressBarModule } from "@angular/material/progress-bar";
|
|
16
|
+
import { InfiniteScrollModule } from "ngx-infinite-scroll";
|
|
17
|
+
import { StockReceiptFormModule } from "./stock-receipt-form/stock-receipt-form.module";
|
|
18
|
+
import { StockReceiptDeleteButtonComponent } from "./stock-receipt-delete-button/stock-receipt-delete-button.component";
|
|
19
|
+
import { PayeeSelectorModule } from "@modules/inventory-common/supplier/payee-selector/payee-selector.module";
|
|
20
|
+
import { TechlifyFilterModule } from "@modules/techlify-filter/techlify-filter.module";
|
|
21
|
+
|
|
22
|
+
@NgModule({
|
|
23
|
+
declarations: [
|
|
24
|
+
StockReceiptsListPageComponent,
|
|
25
|
+
StockReceiptDeleteButtonComponent,
|
|
26
|
+
],
|
|
27
|
+
exports: [StockReceiptDeleteButtonComponent, StockReceiptsListPageComponent],
|
|
28
|
+
imports: [
|
|
29
|
+
CommonModule,
|
|
30
|
+
StockReceiptsRoutingModule,
|
|
31
|
+
MatCardModule,
|
|
32
|
+
TechlifyFilterModule,
|
|
33
|
+
MatTableModule,
|
|
34
|
+
MatFormFieldModule,
|
|
35
|
+
SearchableSelectorModule,
|
|
36
|
+
TimelineFilterModule,
|
|
37
|
+
ReactiveFormsModule,
|
|
38
|
+
PayeeSelectorModule,
|
|
39
|
+
MatProgressBarModule,
|
|
40
|
+
InfiniteScrollModule,
|
|
41
|
+
MaterialModule,
|
|
42
|
+
StockReceiptFormModule,
|
|
43
|
+
],
|
|
44
|
+
})
|
|
45
|
+
export class StockReceiptsModule {}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Injectable } from "@angular/core";
|
|
2
|
+
import { HttpService } from "ngx-techlify-core";
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: "root",
|
|
6
|
+
})
|
|
7
|
+
export class StockSummaryService {
|
|
8
|
+
constructor(private httpService: HttpService) {}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Get the stocks summary.
|
|
12
|
+
*
|
|
13
|
+
* @param params
|
|
14
|
+
*/
|
|
15
|
+
summary(params?: any) {
|
|
16
|
+
return this.httpService.get("api/stocks-summary", { params });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<mat-form-field [appearance]="appearance" class="w-100">
|
|
2
|
+
<mat-label>{{ label }}</mat-label>
|
|
3
|
+
<app-searchable-selector
|
|
4
|
+
apiUrl="api/suppliers"
|
|
5
|
+
titleField="company_name"
|
|
6
|
+
sortBy="company_name|asc"
|
|
7
|
+
[required]="required"
|
|
8
|
+
[(ngModel)]="value"
|
|
9
|
+
#payeeSelector="ngModel"
|
|
10
|
+
name="payeeSelector"
|
|
11
|
+
[add]="showAddButton"
|
|
12
|
+
[itemComponent]="SupplierFormComponent"
|
|
13
|
+
(ngModelChange)="onChange($event)"
|
|
14
|
+
[addConfig]="{ width: '600px' }"
|
|
15
|
+
[ngModelOptions]="{ standalone: true }"
|
|
16
|
+
[multiple]="multiple"
|
|
17
|
+
>
|
|
18
|
+
</app-searchable-selector>
|
|
19
|
+
<mat-error *ngIf="payeeSelector.invalid && payeeSelector.touched">
|
|
20
|
+
The payee field is required.
|
|
21
|
+
</mat-error>
|
|
22
|
+
</mat-form-field>
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Component, forwardRef, Input, OnInit } from "@angular/core";
|
|
2
|
+
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
3
|
+
import { SupplierFormComponent } from "../../supplier-form/supplier-form.component";
|
|
4
|
+
import { MatFormFieldAppearance } from "@angular/material/form-field";
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "app-payee-selector",
|
|
8
|
+
templateUrl: "./payee-selector.component.html",
|
|
9
|
+
styleUrls: ["./payee-selector.component.scss"],
|
|
10
|
+
providers: [
|
|
11
|
+
{
|
|
12
|
+
provide: NG_VALUE_ACCESSOR,
|
|
13
|
+
useExisting: forwardRef(() => PayeeSelectorComponent),
|
|
14
|
+
multi: true,
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
})
|
|
18
|
+
export class PayeeSelectorComponent implements ControlValueAccessor {
|
|
19
|
+
@Input() label = "Payee";
|
|
20
|
+
@Input() appearance: MatFormFieldAppearance = "fill";
|
|
21
|
+
@Input() required: boolean = false;
|
|
22
|
+
@Input() showAddButton: boolean = false;
|
|
23
|
+
@Input() multiple: boolean = false;
|
|
24
|
+
|
|
25
|
+
value: any;
|
|
26
|
+
onChange: any = () => {};
|
|
27
|
+
onTouch: any = () => {};
|
|
28
|
+
|
|
29
|
+
writeValue(value: any): void {
|
|
30
|
+
this.value = value;
|
|
31
|
+
this.onChange(value);
|
|
32
|
+
this.onTouch(value);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
registerOnChange(fn: any): void {
|
|
36
|
+
this.onChange = fn;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
registerOnTouched(fn: any): void {
|
|
40
|
+
this.onTouch = fn;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
protected readonly SupplierFormComponent = SupplierFormComponent;
|
|
44
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NgModule } from "@angular/core";
|
|
2
|
+
import { CommonModule } from "@angular/common";
|
|
3
|
+
import { PayeeSelectorComponent } from "./payee-selector/payee-selector.component";
|
|
4
|
+
import { MatFormFieldModule } from "@angular/material/form-field";
|
|
5
|
+
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
|
6
|
+
import { SearchableSelectorModule } from "ngx-techlify-core";
|
|
7
|
+
|
|
8
|
+
@NgModule({
|
|
9
|
+
declarations: [PayeeSelectorComponent],
|
|
10
|
+
exports: [PayeeSelectorComponent],
|
|
11
|
+
imports: [
|
|
12
|
+
CommonModule,
|
|
13
|
+
MatFormFieldModule,
|
|
14
|
+
ReactiveFormsModule,
|
|
15
|
+
SearchableSelectorModule,
|
|
16
|
+
FormsModule,
|
|
17
|
+
],
|
|
18
|
+
})
|
|
19
|
+
export class PayeeSelectorModule {}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<form
|
|
2
|
+
[formGroup]="supplierForm"
|
|
3
|
+
(ngSubmit)="submit()"
|
|
4
|
+
class="mat-typography p-3"
|
|
5
|
+
>
|
|
6
|
+
<div fxLayout="column">
|
|
7
|
+
<div mat-dialog-title class="text-center">
|
|
8
|
+
<div>Supplier</div>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div fxLayout="row" fxLayoutGap="10px">
|
|
12
|
+
<mat-form-field fxFlex="50%">
|
|
13
|
+
<input
|
|
14
|
+
matInput
|
|
15
|
+
formControlName="company_name"
|
|
16
|
+
placeholder="Company Name"
|
|
17
|
+
autocomplete="off"
|
|
18
|
+
required
|
|
19
|
+
/>
|
|
20
|
+
<mat-error *ngIf="isFieldValid('company_name')">
|
|
21
|
+
{{ getErrorMessage("company_name") }}
|
|
22
|
+
</mat-error>
|
|
23
|
+
</mat-form-field>
|
|
24
|
+
<mat-form-field fxFlex="50%">
|
|
25
|
+
<input
|
|
26
|
+
matInput
|
|
27
|
+
formControlName="contact_name"
|
|
28
|
+
placeholder="Contact Name"
|
|
29
|
+
autocomplete="off"
|
|
30
|
+
required
|
|
31
|
+
/>
|
|
32
|
+
<mat-error *ngIf="isFieldValid('contact_name')">
|
|
33
|
+
{{ getErrorMessage("contact_name") }}
|
|
34
|
+
</mat-error>
|
|
35
|
+
</mat-form-field>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div fxLayout="row" fxLayoutGap="10px">
|
|
39
|
+
<mat-form-field fxFlex="50%">
|
|
40
|
+
<mat-label>Types</mat-label>
|
|
41
|
+
<app-searchable-selector
|
|
42
|
+
titleField="title"
|
|
43
|
+
apiUrl="api/supplier-types"
|
|
44
|
+
formControlName="supplier_type_id"
|
|
45
|
+
>
|
|
46
|
+
</app-searchable-selector>
|
|
47
|
+
<mat-error *ngIf="isFieldValid('supplier_type_id')">
|
|
48
|
+
{{ getErrorMessage("supplier_type_id") }}
|
|
49
|
+
</mat-error>
|
|
50
|
+
</mat-form-field>
|
|
51
|
+
<mat-form-field fxFlex="50%">
|
|
52
|
+
<input
|
|
53
|
+
matInput
|
|
54
|
+
formControlName="phone"
|
|
55
|
+
placeholder="Phone"
|
|
56
|
+
autocomplete="off"
|
|
57
|
+
required
|
|
58
|
+
/>
|
|
59
|
+
<mat-error *ngIf="isFieldValid('phone')">
|
|
60
|
+
{{ getErrorMessage("phone") }}
|
|
61
|
+
</mat-error>
|
|
62
|
+
</mat-form-field>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div fxLayout="row wrap">
|
|
66
|
+
<mat-form-field fxFlex="100%" class="mt-1">
|
|
67
|
+
<input
|
|
68
|
+
matInput
|
|
69
|
+
formControlName="email"
|
|
70
|
+
placeholder="Email"
|
|
71
|
+
autocomplete="off"
|
|
72
|
+
required
|
|
73
|
+
/>
|
|
74
|
+
<mat-error *ngIf="isFieldValid('email')">
|
|
75
|
+
{{ getErrorMessage("email") }}
|
|
76
|
+
</mat-error>
|
|
77
|
+
</mat-form-field>
|
|
78
|
+
|
|
79
|
+
<mat-form-field fxFlex="100%" class="mt-1">
|
|
80
|
+
<input
|
|
81
|
+
matInput
|
|
82
|
+
formControlName="address"
|
|
83
|
+
placeholder="Address"
|
|
84
|
+
autocomplete="off"
|
|
85
|
+
required
|
|
86
|
+
/>
|
|
87
|
+
<mat-error *ngIf="isFieldValid('address')">
|
|
88
|
+
{{ getErrorMessage("address") }}
|
|
89
|
+
</mat-error>
|
|
90
|
+
</mat-form-field>
|
|
91
|
+
|
|
92
|
+
<mat-form-field fxFlex="100%" class="mt-1">
|
|
93
|
+
<input
|
|
94
|
+
matInput
|
|
95
|
+
formControlName="details"
|
|
96
|
+
placeholder="Details"
|
|
97
|
+
autocomplete="off"
|
|
98
|
+
required
|
|
99
|
+
/>
|
|
100
|
+
<mat-error *ngIf="isFieldValid('details')">
|
|
101
|
+
{{ getErrorMessage("details") }}
|
|
102
|
+
</mat-error>
|
|
103
|
+
</mat-form-field>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div fxLayout="row">
|
|
107
|
+
<div
|
|
108
|
+
class="my-2"
|
|
109
|
+
fxLayout="row"
|
|
110
|
+
fxLayoutGap="30px"
|
|
111
|
+
fxLayoutAlign="end"
|
|
112
|
+
fxFlex="100%"
|
|
113
|
+
>
|
|
114
|
+
<button
|
|
115
|
+
[disabled]="isWorking"
|
|
116
|
+
mat-flat-button
|
|
117
|
+
type="button"
|
|
118
|
+
(click)="dialogRef.close()"
|
|
119
|
+
>
|
|
120
|
+
Cancel
|
|
121
|
+
</button>
|
|
122
|
+
<button
|
|
123
|
+
[disabled]="isWorking"
|
|
124
|
+
mat-raised-button
|
|
125
|
+
type="submit"
|
|
126
|
+
color="primary"
|
|
127
|
+
>
|
|
128
|
+
Save
|
|
129
|
+
</button>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</form>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { SupplierService } from "./../supplier.service";
|
|
2
|
+
import { Component, Inject, OnInit } from "@angular/core";
|
|
3
|
+
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
|
4
|
+
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
|
|
5
|
+
import { NgxSpinnerService } from "ngx-spinner";
|
|
6
|
+
import {
|
|
7
|
+
AlertService,
|
|
8
|
+
ErrorHandlerService,
|
|
9
|
+
FormValidatorService,
|
|
10
|
+
TechlifyFormComponentInterface,
|
|
11
|
+
} from "ngx-techlify-core";
|
|
12
|
+
import { lastValueFrom } from "rxjs";
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: "app-supplier-form",
|
|
16
|
+
templateUrl: "./supplier-form.component.html",
|
|
17
|
+
})
|
|
18
|
+
export class SupplierFormComponent
|
|
19
|
+
extends TechlifyFormComponentInterface
|
|
20
|
+
implements OnInit
|
|
21
|
+
{
|
|
22
|
+
override errorMessages: any = {
|
|
23
|
+
contact_name: {
|
|
24
|
+
required: "Contact Name is required",
|
|
25
|
+
},
|
|
26
|
+
company_name: {
|
|
27
|
+
required: "Company Name is required",
|
|
28
|
+
},
|
|
29
|
+
address: {
|
|
30
|
+
required: "Address is required",
|
|
31
|
+
},
|
|
32
|
+
phone: {
|
|
33
|
+
required: "Phone is required",
|
|
34
|
+
},
|
|
35
|
+
details: {
|
|
36
|
+
required: "Details is required",
|
|
37
|
+
},
|
|
38
|
+
email: {
|
|
39
|
+
required: "Email is required",
|
|
40
|
+
},
|
|
41
|
+
supplier_type_id: {
|
|
42
|
+
required: "Supplier Type is required",
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
isWorking: boolean = false;
|
|
47
|
+
isUpdateMode: boolean = false;
|
|
48
|
+
supplierForm: FormGroup;
|
|
49
|
+
|
|
50
|
+
constructor(
|
|
51
|
+
private fb: FormBuilder,
|
|
52
|
+
formValidatorService: FormValidatorService,
|
|
53
|
+
private alertService: AlertService,
|
|
54
|
+
private spinnerService: NgxSpinnerService,
|
|
55
|
+
public dialogRef: MatDialogRef<SupplierFormComponent>,
|
|
56
|
+
private errorService: ErrorHandlerService,
|
|
57
|
+
@Inject(MAT_DIALOG_DATA) public data: any,
|
|
58
|
+
private supplierService: SupplierService
|
|
59
|
+
) {
|
|
60
|
+
super(formValidatorService);
|
|
61
|
+
this.supplierForm = this.fb.group({
|
|
62
|
+
id: [""],
|
|
63
|
+
contact_name: ["", Validators.compose([Validators.required])],
|
|
64
|
+
company_name: ["", Validators.compose([Validators.required])],
|
|
65
|
+
details: ["", Validators.compose([Validators.required])],
|
|
66
|
+
address: ["", Validators.compose([Validators.required])],
|
|
67
|
+
phone: ["", Validators.compose([Validators.required])],
|
|
68
|
+
email: ["", Validators.compose([Validators.required])],
|
|
69
|
+
supplier_type_id: ["", Validators.compose([Validators.required])],
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
ngOnInit() {
|
|
74
|
+
if (this.data.details) {
|
|
75
|
+
this.isUpdateMode = true;
|
|
76
|
+
this.supplierForm.patchValue(this.data.details);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async submit() {
|
|
81
|
+
if (!this.supplierForm.valid) {
|
|
82
|
+
this.alertService.addAlert("Please Fill All Required Fields", "warn");
|
|
83
|
+
this.supplierForm.markAllAsTouched();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
var supplier = this.supplierForm.value;
|
|
88
|
+
try {
|
|
89
|
+
this.spinnerService.show();
|
|
90
|
+
this.isWorking = true;
|
|
91
|
+
let result = this.isUpdateMode
|
|
92
|
+
? await lastValueFrom(this.supplierService.update(supplier))
|
|
93
|
+
: await lastValueFrom(this.supplierService.store(supplier));
|
|
94
|
+
this.dialogRef.close(result);
|
|
95
|
+
} catch (error) {
|
|
96
|
+
this.errorService.handleError(error);
|
|
97
|
+
} finally {
|
|
98
|
+
this.isWorking = false;
|
|
99
|
+
this.spinnerService.hide();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**Method to evaluate form fields*/
|
|
104
|
+
override isFieldValid(field: string) {
|
|
105
|
+
return this.formValidatorService.isFieldValid(field, this.supplierForm);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**Method to find error in form fields*/
|
|
109
|
+
override getErrorMessage(field: string) {
|
|
110
|
+
return this.formValidatorService.getErrorMessage(
|
|
111
|
+
field,
|
|
112
|
+
this.supplierForm,
|
|
113
|
+
this.errorMessages
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Injectable } from "@angular/core";
|
|
2
|
+
import TechlifyFormService from "@modules/@shared/techlify-form-service";
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: "root",
|
|
6
|
+
})
|
|
7
|
+
export class SupplierFormService extends TechlifyFormService {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<mat-card>
|
|
2
|
+
<mat-card-content>
|
|
3
|
+
<div class="d-flex justify-content-between align-items-center">
|
|
4
|
+
<h3 class="mb-0">Personal Information</h3>
|
|
5
|
+
<div class="d-flex justify-content-end align-items-center gap-1">
|
|
6
|
+
<app-audit-log-for-model
|
|
7
|
+
[modelId]="supplier?.id"
|
|
8
|
+
modelType="Supplier"
|
|
9
|
+
logView="all"
|
|
10
|
+
></app-audit-log-for-model>
|
|
11
|
+
<mat-icon
|
|
12
|
+
class="material-icons cursor-pointer"
|
|
13
|
+
(click)="modifySupplier(supplier)"
|
|
14
|
+
>
|
|
15
|
+
edit
|
|
16
|
+
</mat-icon>
|
|
17
|
+
<mat-icon
|
|
18
|
+
class="material-icons cursor-pointer"
|
|
19
|
+
(click)="deleteSupplier(supplier)"
|
|
20
|
+
>
|
|
21
|
+
delete
|
|
22
|
+
</mat-icon>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<mat-divider></mat-divider>
|
|
27
|
+
|
|
28
|
+
<div class="mt-2">
|
|
29
|
+
<div class="d-flex justify-content-start gap-2">
|
|
30
|
+
<div>
|
|
31
|
+
<h3 class="mb-0">{{ supplier?.company_name }}</h3>
|
|
32
|
+
<span class="status-pill-sm status-light-orange">{{
|
|
33
|
+
supplier?.type?.title
|
|
34
|
+
}}</span>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="row mt-3">
|
|
40
|
+
<div class="col-6">
|
|
41
|
+
<p class="text-muted mb-0">Contact Name</p>
|
|
42
|
+
<p class="text-wrap">{{ supplier?.contact_name }}</p>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="col-6">
|
|
45
|
+
<p class="text-muted mb-0">Email</p>
|
|
46
|
+
<p class="text-wrap">{{ supplier?.email }}</p>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="col-6">
|
|
49
|
+
<p class="text-muted mb-0">Phone</p>
|
|
50
|
+
<p class="text-wrap">{{ supplier?.phone }}</p>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="col-6">
|
|
53
|
+
<p class="text-muted mb-0">Details</p>
|
|
54
|
+
<p class="text-wrap">{{ supplier?.details }}</p>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="row mt-2 h-100">
|
|
59
|
+
<div class="d-flex">
|
|
60
|
+
<mat-icon class="material-icons text-primary my-auto"
|
|
61
|
+
>location_on</mat-icon
|
|
62
|
+
>
|
|
63
|
+
<p class="ms-2 my-auto">{{ supplier?.address }}</p>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</mat-card-content>
|
|
67
|
+
</mat-card>
|
|
File without changes
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Component, Input } from "@angular/core";
|
|
2
|
+
import {
|
|
3
|
+
ActionPopup,
|
|
4
|
+
ActionPopupComponent,
|
|
5
|
+
AlertService,
|
|
6
|
+
ErrorHandlerService,
|
|
7
|
+
} from "ngx-techlify-core";
|
|
8
|
+
import { SupplierFormComponent } from "../supplier-form/supplier-form.component";
|
|
9
|
+
import { MatDialog } from "@angular/material/dialog";
|
|
10
|
+
import { SupplierService } from "../supplier.service";
|
|
11
|
+
import { Router } from "@angular/router";
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: "app-supplier-information",
|
|
15
|
+
templateUrl: "./supplier-information.component.html",
|
|
16
|
+
})
|
|
17
|
+
export class SupplierInformationComponent {
|
|
18
|
+
@Input() supplier!: any;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
private dialog: MatDialog,
|
|
22
|
+
private supplierService: SupplierService,
|
|
23
|
+
private alertService: AlertService,
|
|
24
|
+
private router: Router,
|
|
25
|
+
private errorService: ErrorHandlerService
|
|
26
|
+
) {}
|
|
27
|
+
|
|
28
|
+
modifySupplier(model?: any) {
|
|
29
|
+
const dialogRef = this.dialog.open(SupplierFormComponent, {
|
|
30
|
+
width: "600px",
|
|
31
|
+
data: {
|
|
32
|
+
details: model,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
dialogRef.afterClosed().subscribe((result: any) => {
|
|
36
|
+
if (result) {
|
|
37
|
+
location.reload();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
deleteSupplier(id: any) {
|
|
43
|
+
const dialogRef = this.dialog.open(ActionPopupComponent, {
|
|
44
|
+
width: "400px",
|
|
45
|
+
data: <ActionPopup>{
|
|
46
|
+
title: "Delete Supplier",
|
|
47
|
+
message: "Are you sure you want to delete this supplier?",
|
|
48
|
+
},
|
|
49
|
+
autoFocus: false,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
dialogRef.afterClosed().subscribe(async (result: any) => {
|
|
53
|
+
if (result) {
|
|
54
|
+
try {
|
|
55
|
+
const result = await this.supplierService.destroy(id);
|
|
56
|
+
this.alertService.addAlert(
|
|
57
|
+
"Successfully Deleted Supplier",
|
|
58
|
+
"success"
|
|
59
|
+
);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
this.errorService.handleError(error);
|
|
62
|
+
} finally {
|
|
63
|
+
this.router.navigateByUrl("/suppliers");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|