techlify-inventory-common 18.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/esm2022/lib/inventory-common/category/category-form/category-form.component.mjs +77 -0
- package/esm2022/lib/inventory-common/category/category-form-button/category-form-button.component.mjs +32 -0
- package/esm2022/lib/inventory-common/category/category-list-page/category-list-page.component.mjs +68 -0
- package/esm2022/lib/inventory-common/category/category-routing.module.mjs +24 -0
- package/esm2022/lib/inventory-common/category/category.module.mjs +63 -0
- package/esm2022/lib/inventory-common/category/category.service.mjs +18 -0
- package/esm2022/lib/inventory-common/inventory-common-routing.module.mjs +53 -0
- package/esm2022/lib/inventory-common/inventory-common.module.mjs +39 -0
- package/esm2022/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.mjs +42 -0
- package/esm2022/lib/inventory-common/material.module.mjs +172 -0
- package/esm2022/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.mjs +44 -0
- package/esm2022/lib/inventory-common/measure/measure-delete/measure-delete.module.mjs +19 -0
- package/esm2022/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.mjs +80 -0
- package/esm2022/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.mjs +30 -0
- package/esm2022/lib/inventory-common/measure/measure-form/measure-form.module.mjs +21 -0
- package/esm2022/lib/inventory-common/measure/measure-routing.module.mjs +24 -0
- package/esm2022/lib/inventory-common/measure/measure.module.mjs +47 -0
- package/esm2022/lib/inventory-common/measure/measure.service.mjs +18 -0
- package/esm2022/lib/inventory-common/measure/measures-list/measures-list.component.mjs +71 -0
- package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.mjs +45 -0
- package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.mjs +36 -0
- package/esm2022/lib/inventory-common/product/product-basic-info/product-basic-info.component.mjs +54 -0
- package/esm2022/lib/inventory-common/product/product-delete-button/product-delete-button.component.mjs +54 -0
- package/esm2022/lib/inventory-common/product/product-form/product-form.component.mjs +180 -0
- package/esm2022/lib/inventory-common/product/product-form-button/product-form-button.component.mjs +40 -0
- package/esm2022/lib/inventory-common/product/product-form.service.mjs +17 -0
- package/esm2022/lib/inventory-common/product/product-import-page/product-import-page.component.mjs +66 -0
- package/esm2022/lib/inventory-common/product/product-list/product-list.component.mjs +189 -0
- package/esm2022/lib/inventory-common/product/product-measure-form/product-measure-form.component.mjs +101 -0
- package/esm2022/lib/inventory-common/product/product-measures-list/product-measures-list.component.mjs +151 -0
- package/esm2022/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.mjs +12 -0
- package/esm2022/lib/inventory-common/product/product-routing.module.mjs +57 -0
- package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.mjs +63 -0
- package/esm2022/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.mjs +29 -0
- package/esm2022/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.mjs +54 -0
- package/esm2022/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.mjs +77 -0
- package/esm2022/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.mjs +35 -0
- package/esm2022/lib/inventory-common/product/product-tax/product-tax.module.mjs +39 -0
- package/esm2022/lib/inventory-common/product/product-tax/product-tax.service.mjs +18 -0
- package/esm2022/lib/inventory-common/product/product-view-page/product-view-page.component.mjs +68 -0
- package/esm2022/lib/inventory-common/product/product.module.mjs +111 -0
- package/esm2022/lib/inventory-common/product/product.service.mjs +49 -0
- package/esm2022/lib/inventory-common/services/techlify-form-service.mjs +11 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.mjs +47 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.module.mjs +19 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issuance.service.mjs +18 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.mjs +126 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.module.mjs +48 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issuances-routing.module.mjs +24 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issuances.module.mjs +67 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.mjs +120 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.mjs +44 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.mjs +53 -0
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.mjs +47 -0
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.mjs +125 -0
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.mjs +38 -0
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.mjs +53 -0
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt.service.mjs +18 -0
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.mjs +119 -0
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-routing.module.mjs +24 -0
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipts.module.mjs +75 -0
- package/esm2022/lib/inventory-common/stock-summary.service.mjs +26 -0
- package/esm2022/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.mjs +59 -0
- package/esm2022/lib/inventory-common/supplier/payee-selector/payee-selector.module.mjs +35 -0
- package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.component.mjs +118 -0
- package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.service.mjs +17 -0
- package/esm2022/lib/inventory-common/supplier/supplier-information/supplier-information.component.mjs +72 -0
- package/esm2022/lib/inventory-common/supplier/supplier-routing.module.mjs +40 -0
- package/esm2022/lib/inventory-common/supplier/supplier-type.service.mjs +25 -0
- package/esm2022/lib/inventory-common/supplier/supplier-view/supplier-view.component.mjs +66 -0
- package/esm2022/lib/inventory-common/supplier/supplier.component.mjs +20 -0
- package/esm2022/lib/inventory-common/supplier/supplier.module.mjs +63 -0
- package/esm2022/lib/inventory-common/supplier/supplier.service.mjs +61 -0
- package/esm2022/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.mjs +241 -0
- package/esm2022/lib/inventory-common/techlify-filter/techlify-filter.component.mjs +118 -0
- package/esm2022/lib/inventory-common/techlify-filter/techlify-filter.module.mjs +38 -0
- package/esm2022/public-api.mjs +9 -0
- package/esm2022/techlify-inventory-common.mjs +5 -0
- package/fesm2022/techlify-inventory-common-category.module-Stn6e73V.mjs +257 -0
- package/fesm2022/techlify-inventory-common-category.module-Stn6e73V.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-measure.module-CirswKXn.mjs +313 -0
- package/fesm2022/techlify-inventory-common-measure.module-CirswKXn.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-product.module-qdeafFV5.mjs +1172 -0
- package/fesm2022/techlify-inventory-common-product.module-qdeafFV5.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-stock-issuances-list.module-CyFDxARk.mjs +436 -0
- package/fesm2022/techlify-inventory-common-stock-issuances-list.module-CyFDxARk.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-stock-issuances.module-Dm9i2kcf.mjs +89 -0
- package/fesm2022/techlify-inventory-common-stock-issuances.module-Dm9i2kcf.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs +302 -0
- package/fesm2022/techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs +253 -0
- package/fesm2022/techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-supplier-form.component-CHmMG7O8.mjs +178 -0
- package/fesm2022/techlify-inventory-common-supplier-form.component-CHmMG7O8.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-supplier.module-gzHesNtQ.mjs +665 -0
- package/fesm2022/techlify-inventory-common-supplier.module-gzHesNtQ.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-techlify-form-service-CiVfwYTS.mjs +14 -0
- package/fesm2022/techlify-inventory-common-techlify-form-service-CiVfwYTS.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs +495 -0
- package/fesm2022/techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common.mjs +2 -0
- package/fesm2022/techlify-inventory-common.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/inventory-common/category/category-form/category-form.component.d.ts +19 -0
- package/lib/inventory-common/category/category-form-button/category-form-button.component.d.ts +13 -0
- package/lib/inventory-common/category/category-list-page/category-list-page.component.d.ts +20 -0
- package/lib/inventory-common/category/category-routing.module.d.ts +7 -0
- package/lib/inventory-common/category/category.module.d.ts +19 -0
- package/lib/inventory-common/category/category.service.d.ts +7 -0
- package/lib/inventory-common/inventory-common-routing.module.d.ts +7 -0
- package/lib/inventory-common/inventory-common.module.d.ts +13 -0
- package/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.d.ts +14 -0
- package/lib/inventory-common/material.module.d.ts +40 -0
- package/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.d.ts +19 -0
- package/lib/inventory-common/measure/measure-delete/measure-delete.module.d.ts +9 -0
- package/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.d.ts +19 -0
- package/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.d.ts +13 -0
- package/lib/inventory-common/measure/measure-form/measure-form.module.d.ts +11 -0
- package/lib/inventory-common/measure/measure-routing.module.d.ts +7 -0
- package/lib/inventory-common/measure/measure.module.d.ts +15 -0
- package/lib/inventory-common/measure/measure.service.d.ts +7 -0
- package/lib/inventory-common/measure/measures-list/measures-list.component.d.ts +17 -0
- package/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.d.ts +13 -0
- package/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.d.ts +12 -0
- package/lib/inventory-common/product/product-basic-info/product-basic-info.component.d.ts +19 -0
- package/lib/inventory-common/product/product-delete-button/product-delete-button.component.d.ts +26 -0
- package/lib/inventory-common/product/product-form/product-form.component.d.ts +44 -0
- package/lib/inventory-common/product/product-form-button/product-form-button.component.d.ts +20 -0
- package/lib/inventory-common/product/product-form.service.d.ts +7 -0
- package/lib/inventory-common/product/product-import-page/product-import-page.component.d.ts +10 -0
- package/lib/inventory-common/product/product-list/product-list.component.d.ts +44 -0
- package/lib/inventory-common/product/product-measure-form/product-measure-form.component.d.ts +33 -0
- package/lib/inventory-common/product/product-measures-list/product-measures-list.component.d.ts +43 -0
- package/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.d.ts +5 -0
- package/lib/inventory-common/product/product-routing.module.d.ts +7 -0
- package/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.d.ts +15 -0
- package/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.d.ts +10 -0
- package/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.d.ts +26 -0
- package/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.d.ts +21 -0
- package/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.d.ts +13 -0
- package/lib/inventory-common/product/product-tax/product-tax.module.d.ts +12 -0
- package/lib/inventory-common/product/product-tax/product-tax.service.d.ts +7 -0
- package/lib/inventory-common/product/product-view-page/product-view-page.component.d.ts +33 -0
- package/lib/inventory-common/product/product.module.d.ts +28 -0
- package/lib/inventory-common/product/product.service.d.ts +19 -0
- package/lib/inventory-common/services/techlify-form-service.d.ts +5 -0
- package/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.d.ts +18 -0
- package/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.module.d.ts +9 -0
- package/lib/inventory-common/stock-issuances/stock-issuance.service.d.ts +7 -0
- package/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.d.ts +24 -0
- package/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.module.d.ts +15 -0
- package/lib/inventory-common/stock-issuances/stock-issuances-routing.module.d.ts +7 -0
- package/lib/inventory-common/stock-issuances/stock-issuances.module.d.ts +19 -0
- package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.d.ts +24 -0
- package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.d.ts +18 -0
- package/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.d.ts +17 -0
- package/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.d.ts +18 -0
- package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.d.ts +22 -0
- package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.d.ts +16 -0
- package/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.d.ts +17 -0
- package/lib/inventory-common/stock-receipts/stock-receipt.service.d.ts +7 -0
- package/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.d.ts +21 -0
- package/lib/inventory-common/stock-receipts/stock-receipts-routing.module.d.ts +7 -0
- package/lib/inventory-common/stock-receipts/stock-receipts.module.d.ts +20 -0
- package/lib/inventory-common/stock-summary.service.d.ts +14 -0
- package/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.d.ts +20 -0
- package/lib/inventory-common/supplier/payee-selector/payee-selector.module.d.ts +11 -0
- package/lib/inventory-common/supplier/supplier-form/supplier-form.component.d.ts +29 -0
- package/lib/inventory-common/supplier/supplier-form/supplier-form.service.d.ts +7 -0
- package/lib/inventory-common/supplier/supplier-information/supplier-information.component.d.ts +18 -0
- package/lib/inventory-common/supplier/supplier-routing.module.d.ts +7 -0
- package/lib/inventory-common/supplier/supplier-type.service.d.ts +13 -0
- package/lib/inventory-common/supplier/supplier-view/supplier-view.component.d.ts +20 -0
- package/lib/inventory-common/supplier/supplier.component.d.ts +10 -0
- package/lib/inventory-common/supplier/supplier.module.d.ts +18 -0
- package/lib/inventory-common/supplier/supplier.service.d.ts +39 -0
- package/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.d.ts +51 -0
- package/lib/inventory-common/techlify-filter/techlify-filter.component.d.ts +31 -0
- package/lib/inventory-common/techlify-filter/techlify-filter.module.d.ts +11 -0
- package/package.json +25 -0
- package/public-api.d.ts +5 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Output, Input, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i2$1 from '@angular/router';
|
|
6
|
+
import { RouterModule } from '@angular/router';
|
|
7
|
+
import { __decorate } from 'tslib';
|
|
8
|
+
import * as i1$1 from 'ngx-techlify-core';
|
|
9
|
+
import { TechlifyListingControllerInterface, Timeline, SearchableSelectorModule, TimelineFilterModule, MaterialModule } from 'ngx-techlify-core';
|
|
10
|
+
import { UntilDestroy } from '@ngneat/until-destroy';
|
|
11
|
+
import { debounceTime } from 'rxjs';
|
|
12
|
+
import { b as StockReceiptService, a as StockReceiptFormButtonComponent, P as PayeeSelectorModule, S as StockReceiptFormModule } from './techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs';
|
|
13
|
+
import * as i2 from '@angular/forms';
|
|
14
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
15
|
+
import * as i3 from '@angular/material/card';
|
|
16
|
+
import { MatCardModule } from '@angular/material/card';
|
|
17
|
+
import { T as TechlifyFilterComponent, a as TechlifyFilterModule } from './techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs';
|
|
18
|
+
import * as i6 from '@angular/material/table';
|
|
19
|
+
import { MatTableModule } from '@angular/material/table';
|
|
20
|
+
import * as i7$1 from '@angular/material/progress-bar';
|
|
21
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
22
|
+
import * as i10 from 'ngx-infinite-scroll';
|
|
23
|
+
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
|
24
|
+
import * as i5 from '@angular/material/sort';
|
|
25
|
+
import * as i1 from '@angular/material/dialog';
|
|
26
|
+
import * as i7 from '@angular/material/button';
|
|
27
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
28
|
+
|
|
29
|
+
class StockReceiptDeleteButtonComponent {
|
|
30
|
+
matDialog;
|
|
31
|
+
stockReceiptService;
|
|
32
|
+
alertService;
|
|
33
|
+
stockReceipt;
|
|
34
|
+
deleted = new EventEmitter();
|
|
35
|
+
isDeleting = false;
|
|
36
|
+
constructor(matDialog, stockReceiptService, alertService) {
|
|
37
|
+
this.matDialog = matDialog;
|
|
38
|
+
this.stockReceiptService = stockReceiptService;
|
|
39
|
+
this.alertService = alertService;
|
|
40
|
+
}
|
|
41
|
+
showDeleteConfirmModel(templateRef) {
|
|
42
|
+
this.matDialog.open(templateRef, { width: "400px" });
|
|
43
|
+
}
|
|
44
|
+
delete() {
|
|
45
|
+
this.isDeleting = true;
|
|
46
|
+
this.stockReceiptService.delete(this.stockReceipt).subscribe({
|
|
47
|
+
next: () => {
|
|
48
|
+
this.matDialog.closeAll();
|
|
49
|
+
this.isDeleting = false;
|
|
50
|
+
this.deleted.emit();
|
|
51
|
+
this.alertService.addAlert("Stock Receipt deleted successfully!", "success");
|
|
52
|
+
},
|
|
53
|
+
error: () => {
|
|
54
|
+
this.isDeleting = false;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptDeleteButtonComponent, deps: [{ token: i1.MatDialog }, { token: StockReceiptService }, { token: i1$1.AlertService }], target: i0.ɵɵFactoryTarget.Component });
|
|
59
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: StockReceiptDeleteButtonComponent, selector: "app-stock-receipt-delete-button", inputs: { stockReceipt: "stockReceipt" }, outputs: { deleted: "deleted" }, ngImport: i0, template: "<span\n class=\"material-symbols-outlined cursor-pointer\"\n (click)=\"showDeleteConfirmModel(deleteModelTemplate)\"\n>\n delete\n</span>\n\n<ng-template #deleteModelTemplate>\n <h3 mat-dialog-title>Delete Stock Receipt</h3>\n <div mat-dialog-content>\n <p>Are you sure you want to delete the stock receipt record?</p>\n </div>\n <div mat-dialog-actions class=\"d-flex justify-content-end gap-2\">\n <button\n [disabled]=\"isDeleting\"\n mat-raised-button\n type=\"button\"\n color=\"warn\"\n (click)=\"delete()\"\n >\n Delete\n </button>\n <button\n [disabled]=\"isDeleting\"\n mat-flat-button\n mat-dialog-close\n type=\"button\"\n >\n Cancel\n </button>\n </div>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }], preserveWhitespaces: true });
|
|
60
|
+
}
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptDeleteButtonComponent, decorators: [{
|
|
62
|
+
type: Component,
|
|
63
|
+
args: [{ selector: "app-stock-receipt-delete-button", template: "<span\n class=\"material-symbols-outlined cursor-pointer\"\n (click)=\"showDeleteConfirmModel(deleteModelTemplate)\"\n>\n delete\n</span>\n\n<ng-template #deleteModelTemplate>\n <h3 mat-dialog-title>Delete Stock Receipt</h3>\n <div mat-dialog-content>\n <p>Are you sure you want to delete the stock receipt record?</p>\n </div>\n <div mat-dialog-actions class=\"d-flex justify-content-end gap-2\">\n <button\n [disabled]=\"isDeleting\"\n mat-raised-button\n type=\"button\"\n color=\"warn\"\n (click)=\"delete()\"\n >\n Delete\n </button>\n <button\n [disabled]=\"isDeleting\"\n mat-flat-button\n mat-dialog-close\n type=\"button\"\n >\n Cancel\n </button>\n </div>\n</ng-template>\n" }]
|
|
64
|
+
}], ctorParameters: () => [{ type: i1.MatDialog }, { type: StockReceiptService }, { type: i1$1.AlertService }], propDecorators: { stockReceipt: [{
|
|
65
|
+
type: Input
|
|
66
|
+
}], deleted: [{
|
|
67
|
+
type: Output
|
|
68
|
+
}] } });
|
|
69
|
+
|
|
70
|
+
let StockReceiptsListPageComponent = class StockReceiptsListPageComponent extends TechlifyListingControllerInterface {
|
|
71
|
+
stockReceiptService;
|
|
72
|
+
formBuilder;
|
|
73
|
+
requestHelperService;
|
|
74
|
+
product;
|
|
75
|
+
listUpdated = new EventEmitter();
|
|
76
|
+
displayedColumns = [
|
|
77
|
+
"no",
|
|
78
|
+
"product",
|
|
79
|
+
"date",
|
|
80
|
+
"quantity",
|
|
81
|
+
"purchase_price",
|
|
82
|
+
"amount",
|
|
83
|
+
"particulars",
|
|
84
|
+
"supplier",
|
|
85
|
+
"creator",
|
|
86
|
+
"actions",
|
|
87
|
+
];
|
|
88
|
+
filterConfig = {
|
|
89
|
+
duration: {
|
|
90
|
+
label: "Date",
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
constructor(stockReceiptService, formBuilder, requestHelperService) {
|
|
94
|
+
super();
|
|
95
|
+
this.stockReceiptService = stockReceiptService;
|
|
96
|
+
this.formBuilder = formBuilder;
|
|
97
|
+
this.requestHelperService = requestHelperService;
|
|
98
|
+
this.lastPage = 0;
|
|
99
|
+
this.filterForm = this.formBuilder.group({
|
|
100
|
+
product_ids: [""],
|
|
101
|
+
duration: [Timeline.THIS_MONTH],
|
|
102
|
+
date_from: [""],
|
|
103
|
+
date_to: [""],
|
|
104
|
+
supplier_ids: [""],
|
|
105
|
+
measure_ids: [""],
|
|
106
|
+
sort_by: ["date|desc"],
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
ngOnInit() {
|
|
110
|
+
this.filterForm.valueChanges
|
|
111
|
+
.pipe(debounceTime(500))
|
|
112
|
+
.subscribe({
|
|
113
|
+
next: () => this.reload(),
|
|
114
|
+
});
|
|
115
|
+
if (this.product) {
|
|
116
|
+
this.filterForm.get("product_ids")?.setValue(this.product?.id);
|
|
117
|
+
const index = this.displayedColumns.indexOf("product");
|
|
118
|
+
if (index !== -1) {
|
|
119
|
+
this.displayedColumns.splice(index, 1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
loadData() {
|
|
124
|
+
const params = {
|
|
125
|
+
page: this.page,
|
|
126
|
+
perPage: this.perPage,
|
|
127
|
+
with: "creator,supplier,product.measure",
|
|
128
|
+
...this.requestHelperService.convertToFormData(this.filterForm.value),
|
|
129
|
+
};
|
|
130
|
+
this.isWorking = true;
|
|
131
|
+
this.stockReceiptService.index(params).subscribe({
|
|
132
|
+
next: (response) => {
|
|
133
|
+
this.models = this.models.concat(response?.data);
|
|
134
|
+
this.lastPage = response?.last_page;
|
|
135
|
+
this.isWorking = false;
|
|
136
|
+
},
|
|
137
|
+
error: () => {
|
|
138
|
+
this.isWorking = false;
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
onSortChange(sort) {
|
|
143
|
+
console.log(sort);
|
|
144
|
+
let { active, direction } = sort;
|
|
145
|
+
if (!active) {
|
|
146
|
+
active = "date";
|
|
147
|
+
}
|
|
148
|
+
if (!direction) {
|
|
149
|
+
direction = "desc";
|
|
150
|
+
active = "date";
|
|
151
|
+
}
|
|
152
|
+
this.filterForm.get("sort_by").setValue(active + "|" + direction);
|
|
153
|
+
}
|
|
154
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptsListPageComponent, deps: [{ token: StockReceiptService }, { token: i2.FormBuilder }, { token: i1$1.RequestHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
155
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: StockReceiptsListPageComponent, selector: "app-stock-receipts-list-page", inputs: { product: "product" }, outputs: { listUpdated: "listUpdated" }, usesInheritance: true, ngImport: i0, template: "<mat-card *ngIf=\"!product\" class=\"mb-2\">\n <mat-card-content\n class=\"d-flex justify-content-between align-items-center gap-3\"\n >\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <h3 class=\"mb-0\">Stock Receipts</h3>\n </div>\n\n <app-techlify-filter\n [filterForm]=\"filterForm\"\n (filterUpdated)=\"reload()\"\n [filterConfig]=\"filterConfig\"\n ></app-techlify-filter>\n </mat-card-content>\n</mat-card>\n\n<mat-card>\n <mat-card-content *ngIf=\"product\" class=\"mb-0\">\n <div class=\"d-flex justify-content-start align-items-center gap-2 mb-2\">\n <span class=\"material-symbols-outlined\"> output_circle </span>\n <h3 class=\"mb-0\">Stock Receipts</h3>\n <app-stock-receipt-form-button\n [product]=\"product\"\n (saved)=\"reload(); listUpdated.emit()\"\n icon=\"add\"\n ></app-stock-receipt-form-button>\n </div>\n </mat-card-content>\n <mat-card-content class=\"p-0\">\n <table\n mat-table\n [dataSource]=\"models\"\n class=\"w-100\"\n aria-describedby=\"Stock Receipts\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n matSort\n (matSortChange)=\"onSortChange($event)\"\n >\n <!-- # Column -->\n <ng-container matColumnDef=\"no\">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <!-- Product Column -->\n <ng-container matColumnDef=\"product\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <a\n [routerLink]=\"['/inventory/products', element?.product?.id, 'view']\"\n >\n {{ element?.product?.name }}\n </a>\n </td>\n </ng-container>\n\n <!-- Date Column -->\n <ng-container matColumnDef=\"date\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Date</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.date | date }}</td>\n </ng-container>\n\n <!-- Quantity Column -->\n <ng-container matColumnDef=\"quantity\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Quantity</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.quantity }} {{ element?.product?.measure?.title }}\n </td>\n </ng-container>\n\n <!-- Purchase Price Column -->\n <ng-container matColumnDef=\"purchase_price\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>\n Purchase Price\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.purchase_price | currency }}\n </td>\n </ng-container>\n\n <!-- Total Value Column -->\n <ng-container matColumnDef=\"amount\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Total Value</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.amount | currency }}\n </td>\n </ng-container>\n\n <!-- Particulars Column -->\n <ng-container matColumnDef=\"particulars\">\n <th mat-header-cell *matHeaderCellDef>Particulars</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.particulars }}</td>\n </ng-container>\n\n <!-- Supplier Column -->\n <ng-container matColumnDef=\"supplier\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Supplier</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.supplier?.company_name }}\n </td>\n </ng-container>\n\n <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-1\">{{ element?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ element?.created_at | date }}</small>\n </td>\n </ng-container>\n\n <!-- Actions Column -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef>Actions</th>\n <td mat-cell *matCellDef=\"let element\">\n <div class=\"d-flex gap-1\">\n <app-stock-receipt-form-button\n [product]=\"element.product\"\n [stockReceipt]=\"element\"\n (saved)=\"reload(); listUpdated.emit()\"\n ></app-stock-receipt-form-button>\n <app-stock-receipt-delete-button\n [stockReceipt]=\"element\"\n (deleted)=\"reload(); listUpdated.emit()\"\n ></app-stock-receipt-delete-button>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n\n <mat-progress-bar *ngIf=\"isWorking\" mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: TechlifyFilterComponent, selector: "app-techlify-filter", inputs: ["filterForm", "filterConfig"], outputs: ["filterUpdated"] }, { kind: "component", type: i6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i7$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i10.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "directive", type: i5.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i5.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: StockReceiptFormButtonComponent, selector: "app-stock-receipt-form-button", inputs: ["product", "stockReceipt", "icon"], outputs: ["saved"] }, { kind: "component", type: StockReceiptDeleteButtonComponent, selector: "app-stock-receipt-delete-button", inputs: ["stockReceipt"], outputs: ["deleted"] }, { kind: "pipe", type: i4.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i4.DatePipe, name: "date" }], preserveWhitespaces: true });
|
|
156
|
+
};
|
|
157
|
+
StockReceiptsListPageComponent = __decorate([
|
|
158
|
+
UntilDestroy()
|
|
159
|
+
], StockReceiptsListPageComponent);
|
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptsListPageComponent, decorators: [{
|
|
161
|
+
type: Component,
|
|
162
|
+
args: [{ selector: "app-stock-receipts-list-page", template: "<mat-card *ngIf=\"!product\" class=\"mb-2\">\n <mat-card-content\n class=\"d-flex justify-content-between align-items-center gap-3\"\n >\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <h3 class=\"mb-0\">Stock Receipts</h3>\n </div>\n\n <app-techlify-filter\n [filterForm]=\"filterForm\"\n (filterUpdated)=\"reload()\"\n [filterConfig]=\"filterConfig\"\n ></app-techlify-filter>\n </mat-card-content>\n</mat-card>\n\n<mat-card>\n <mat-card-content *ngIf=\"product\" class=\"mb-0\">\n <div class=\"d-flex justify-content-start align-items-center gap-2 mb-2\">\n <span class=\"material-symbols-outlined\"> output_circle </span>\n <h3 class=\"mb-0\">Stock Receipts</h3>\n <app-stock-receipt-form-button\n [product]=\"product\"\n (saved)=\"reload(); listUpdated.emit()\"\n icon=\"add\"\n ></app-stock-receipt-form-button>\n </div>\n </mat-card-content>\n <mat-card-content class=\"p-0\">\n <table\n mat-table\n [dataSource]=\"models\"\n class=\"w-100\"\n aria-describedby=\"Stock Receipts\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n matSort\n (matSortChange)=\"onSortChange($event)\"\n >\n <!-- # Column -->\n <ng-container matColumnDef=\"no\">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <!-- Product Column -->\n <ng-container matColumnDef=\"product\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <a\n [routerLink]=\"['/inventory/products', element?.product?.id, 'view']\"\n >\n {{ element?.product?.name }}\n </a>\n </td>\n </ng-container>\n\n <!-- Date Column -->\n <ng-container matColumnDef=\"date\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Date</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.date | date }}</td>\n </ng-container>\n\n <!-- Quantity Column -->\n <ng-container matColumnDef=\"quantity\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Quantity</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.quantity }} {{ element?.product?.measure?.title }}\n </td>\n </ng-container>\n\n <!-- Purchase Price Column -->\n <ng-container matColumnDef=\"purchase_price\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>\n Purchase Price\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.purchase_price | currency }}\n </td>\n </ng-container>\n\n <!-- Total Value Column -->\n <ng-container matColumnDef=\"amount\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Total Value</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.amount | currency }}\n </td>\n </ng-container>\n\n <!-- Particulars Column -->\n <ng-container matColumnDef=\"particulars\">\n <th mat-header-cell *matHeaderCellDef>Particulars</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.particulars }}</td>\n </ng-container>\n\n <!-- Supplier Column -->\n <ng-container matColumnDef=\"supplier\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Supplier</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.supplier?.company_name }}\n </td>\n </ng-container>\n\n <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-1\">{{ element?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ element?.created_at | date }}</small>\n </td>\n </ng-container>\n\n <!-- Actions Column -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef>Actions</th>\n <td mat-cell *matCellDef=\"let element\">\n <div class=\"d-flex gap-1\">\n <app-stock-receipt-form-button\n [product]=\"element.product\"\n [stockReceipt]=\"element\"\n (saved)=\"reload(); listUpdated.emit()\"\n ></app-stock-receipt-form-button>\n <app-stock-receipt-delete-button\n [stockReceipt]=\"element\"\n (deleted)=\"reload(); listUpdated.emit()\"\n ></app-stock-receipt-delete-button>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n\n <mat-progress-bar *ngIf=\"isWorking\" mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>\n" }]
|
|
163
|
+
}], ctorParameters: () => [{ type: StockReceiptService }, { type: i2.FormBuilder }, { type: i1$1.RequestHelperService }], propDecorators: { product: [{
|
|
164
|
+
type: Input
|
|
165
|
+
}], listUpdated: [{
|
|
166
|
+
type: Output
|
|
167
|
+
}] } });
|
|
168
|
+
|
|
169
|
+
const routes = [
|
|
170
|
+
{
|
|
171
|
+
path: "",
|
|
172
|
+
component: StockReceiptsListPageComponent,
|
|
173
|
+
},
|
|
174
|
+
];
|
|
175
|
+
class StockReceiptsRoutingModule {
|
|
176
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptsRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
177
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptsRoutingModule, imports: [i2$1.RouterModule], exports: [RouterModule] });
|
|
178
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptsRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
|
|
179
|
+
}
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptsRoutingModule, decorators: [{
|
|
181
|
+
type: NgModule,
|
|
182
|
+
args: [{
|
|
183
|
+
imports: [RouterModule.forChild(routes)],
|
|
184
|
+
exports: [RouterModule],
|
|
185
|
+
}]
|
|
186
|
+
}] });
|
|
187
|
+
|
|
188
|
+
class StockReceiptsModule {
|
|
189
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
190
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptsModule, declarations: [StockReceiptsListPageComponent,
|
|
191
|
+
StockReceiptDeleteButtonComponent], imports: [CommonModule,
|
|
192
|
+
StockReceiptsRoutingModule,
|
|
193
|
+
MatCardModule,
|
|
194
|
+
TechlifyFilterModule,
|
|
195
|
+
MatTableModule,
|
|
196
|
+
MatFormFieldModule,
|
|
197
|
+
SearchableSelectorModule,
|
|
198
|
+
TimelineFilterModule,
|
|
199
|
+
ReactiveFormsModule,
|
|
200
|
+
PayeeSelectorModule,
|
|
201
|
+
MatProgressBarModule,
|
|
202
|
+
InfiniteScrollModule,
|
|
203
|
+
MaterialModule,
|
|
204
|
+
StockReceiptFormModule], exports: [StockReceiptDeleteButtonComponent, StockReceiptsListPageComponent] });
|
|
205
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptsModule, imports: [CommonModule,
|
|
206
|
+
StockReceiptsRoutingModule,
|
|
207
|
+
MatCardModule,
|
|
208
|
+
TechlifyFilterModule,
|
|
209
|
+
MatTableModule,
|
|
210
|
+
MatFormFieldModule,
|
|
211
|
+
SearchableSelectorModule,
|
|
212
|
+
TimelineFilterModule,
|
|
213
|
+
ReactiveFormsModule,
|
|
214
|
+
PayeeSelectorModule,
|
|
215
|
+
MatProgressBarModule,
|
|
216
|
+
InfiniteScrollModule,
|
|
217
|
+
MaterialModule,
|
|
218
|
+
StockReceiptFormModule] });
|
|
219
|
+
}
|
|
220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StockReceiptsModule, decorators: [{
|
|
221
|
+
type: NgModule,
|
|
222
|
+
args: [{
|
|
223
|
+
declarations: [
|
|
224
|
+
StockReceiptsListPageComponent,
|
|
225
|
+
StockReceiptDeleteButtonComponent,
|
|
226
|
+
],
|
|
227
|
+
exports: [StockReceiptDeleteButtonComponent, StockReceiptsListPageComponent],
|
|
228
|
+
imports: [
|
|
229
|
+
CommonModule,
|
|
230
|
+
StockReceiptsRoutingModule,
|
|
231
|
+
MatCardModule,
|
|
232
|
+
TechlifyFilterModule,
|
|
233
|
+
MatTableModule,
|
|
234
|
+
MatFormFieldModule,
|
|
235
|
+
SearchableSelectorModule,
|
|
236
|
+
TimelineFilterModule,
|
|
237
|
+
ReactiveFormsModule,
|
|
238
|
+
PayeeSelectorModule,
|
|
239
|
+
MatProgressBarModule,
|
|
240
|
+
InfiniteScrollModule,
|
|
241
|
+
MaterialModule,
|
|
242
|
+
StockReceiptFormModule,
|
|
243
|
+
],
|
|
244
|
+
}]
|
|
245
|
+
}] });
|
|
246
|
+
|
|
247
|
+
var stockReceipts_module = /*#__PURE__*/Object.freeze({
|
|
248
|
+
__proto__: null,
|
|
249
|
+
StockReceiptsModule: StockReceiptsModule
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
export { StockReceiptsListPageComponent as S, StockReceiptsModule as a, stockReceipts_module as s };
|
|
253
|
+
//# sourceMappingURL=techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs","sources":["../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.html","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.html","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-routing.module.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts.module.ts"],"sourcesContent":["import {\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n} from \"@angular/core\";\nimport { MatDialog } from \"@angular/material/dialog\";\nimport { AlertService } from \"ngx-techlify-core\";\nimport { StockReceiptService } from \"../stock-receipt.service\";\n\n@Component({\n selector: \"app-stock-receipt-delete-button\",\n templateUrl: \"./stock-receipt-delete-button.component.html\",\n styleUrls: [\"./stock-receipt-delete-button.component.scss\"],\n})\nexport class StockReceiptDeleteButtonComponent {\n @Input() stockReceipt: any;\n @Output() deleted: EventEmitter<any> = new EventEmitter<any>();\n isDeleting: boolean = false;\n\n constructor(\n private matDialog: MatDialog,\n private stockReceiptService: StockReceiptService,\n private alertService: AlertService\n ) {}\n\n showDeleteConfirmModel(templateRef: TemplateRef<any>) {\n this.matDialog.open(templateRef, { width: \"400px\" });\n }\n\n delete() {\n this.isDeleting = true;\n this.stockReceiptService.delete(this.stockReceipt).subscribe({\n next: () => {\n this.matDialog.closeAll();\n this.isDeleting = false;\n this.deleted.emit();\n this.alertService.addAlert(\n \"Stock Receipt deleted successfully!\",\n \"success\"\n );\n },\n error: () => {\n this.isDeleting = false;\n },\n });\n }\n}\n","<span\n class=\"material-symbols-outlined cursor-pointer\"\n (click)=\"showDeleteConfirmModel(deleteModelTemplate)\"\n>\n delete\n</span>\n\n<ng-template #deleteModelTemplate>\n <h3 mat-dialog-title>Delete Stock Receipt</h3>\n <div mat-dialog-content>\n <p>Are you sure you want to delete the stock receipt record?</p>\n </div>\n <div mat-dialog-actions class=\"d-flex justify-content-end gap-2\">\n <button\n [disabled]=\"isDeleting\"\n mat-raised-button\n type=\"button\"\n color=\"warn\"\n (click)=\"delete()\"\n >\n Delete\n </button>\n <button\n [disabled]=\"isDeleting\"\n mat-flat-button\n mat-dialog-close\n type=\"button\"\n >\n Cancel\n </button>\n </div>\n</ng-template>\n","import { Component, EventEmitter, Input, OnInit, Output } from \"@angular/core\";\nimport {\n RequestHelperService,\n TechlifyListingControllerInterface,\n Timeline,\n} from \"ngx-techlify-core\";\nimport { StockReceiptService } from \"../stock-receipt.service\";\nimport { FormBuilder, FormGroup } from \"@angular/forms\";\nimport { UntilDestroy } from \"@ngneat/until-destroy\";\nimport { Sort } from \"@angular/material/sort\";\nimport { debounceTime } from \"rxjs\";\n\n@UntilDestroy()\n@Component({\n selector: \"app-stock-receipts-list-page\",\n templateUrl: \"./stock-receipts-list-page.component.html\",\n styleUrls: [\"./stock-receipts-list-page.component.scss\"],\n})\nexport class StockReceiptsListPageComponent\n extends TechlifyListingControllerInterface\n implements OnInit\n{\n @Input() product: any;\n @Output() listUpdated: EventEmitter<any> = new EventEmitter<any>();\n\n displayedColumns: string[] = [\n \"no\",\n \"product\",\n \"date\",\n \"quantity\",\n \"purchase_price\",\n \"amount\",\n \"particulars\",\n \"supplier\",\n \"creator\",\n \"actions\",\n ];\n filterConfig: any = {\n duration: {\n label: \"Date\",\n },\n };\n\n constructor(\n private stockReceiptService: StockReceiptService,\n private formBuilder: FormBuilder,\n private requestHelperService: RequestHelperService\n ) {\n super();\n this.lastPage = 0;\n this.filterForm = this.formBuilder.group({\n product_ids: [\"\"],\n duration: [Timeline.THIS_MONTH],\n date_from: [\"\"],\n date_to: [\"\"],\n supplier_ids: [\"\"],\n measure_ids: [\"\"],\n sort_by: [\"date|desc\"],\n });\n }\n\n ngOnInit(): void {\n (this.filterForm as FormGroup).valueChanges\n .pipe(debounceTime(500))\n .subscribe({\n next: () => this.reload(),\n });\n if (this.product) {\n this.filterForm.get(\"product_ids\")?.setValue(this.product?.id);\n const index = this.displayedColumns.indexOf(\"product\");\n if (index !== -1) {\n this.displayedColumns.splice(index, 1);\n }\n }\n }\n\n loadData(): void {\n const params: any = {\n page: this.page,\n perPage: this.perPage,\n with: \"creator,supplier,product.measure\",\n ...this.requestHelperService.convertToFormData(this.filterForm.value),\n };\n this.isWorking = true;\n this.stockReceiptService.index(params).subscribe({\n next: (response: any) => {\n this.models = this.models.concat(response?.data);\n this.lastPage = response?.last_page;\n this.isWorking = false;\n },\n error: () => {\n this.isWorking = false;\n },\n });\n }\n\n onSortChange(sort: Sort) {\n console.log(sort);\n let { active, direction } = sort;\n if (!active) {\n active = \"date\";\n }\n if (!direction) {\n direction = \"desc\";\n active = \"date\";\n }\n this.filterForm.get(\"sort_by\").setValue(active + \"|\" + direction);\n }\n}\n","<mat-card *ngIf=\"!product\" class=\"mb-2\">\n <mat-card-content\n class=\"d-flex justify-content-between align-items-center gap-3\"\n >\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <h3 class=\"mb-0\">Stock Receipts</h3>\n </div>\n\n <app-techlify-filter\n [filterForm]=\"filterForm\"\n (filterUpdated)=\"reload()\"\n [filterConfig]=\"filterConfig\"\n ></app-techlify-filter>\n </mat-card-content>\n</mat-card>\n\n<mat-card>\n <mat-card-content *ngIf=\"product\" class=\"mb-0\">\n <div class=\"d-flex justify-content-start align-items-center gap-2 mb-2\">\n <span class=\"material-symbols-outlined\"> output_circle </span>\n <h3 class=\"mb-0\">Stock Receipts</h3>\n <app-stock-receipt-form-button\n [product]=\"product\"\n (saved)=\"reload(); listUpdated.emit()\"\n icon=\"add\"\n ></app-stock-receipt-form-button>\n </div>\n </mat-card-content>\n <mat-card-content class=\"p-0\">\n <table\n mat-table\n [dataSource]=\"models\"\n class=\"w-100\"\n aria-describedby=\"Stock Receipts\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\"\n matSort\n (matSortChange)=\"onSortChange($event)\"\n >\n <!-- # Column -->\n <ng-container matColumnDef=\"no\">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef=\"let element; let i = index\">{{ i + 1 }}</td>\n </ng-container>\n\n <!-- Product Column -->\n <ng-container matColumnDef=\"product\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Product</th>\n <td mat-cell *matCellDef=\"let element\">\n <a\n [routerLink]=\"['/inventory/products', element?.product?.id, 'view']\"\n >\n {{ element?.product?.name }}\n </a>\n </td>\n </ng-container>\n\n <!-- Date Column -->\n <ng-container matColumnDef=\"date\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Date</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.date | date }}</td>\n </ng-container>\n\n <!-- Quantity Column -->\n <ng-container matColumnDef=\"quantity\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Quantity</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.quantity }} {{ element?.product?.measure?.title }}\n </td>\n </ng-container>\n\n <!-- Purchase Price Column -->\n <ng-container matColumnDef=\"purchase_price\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>\n Purchase Price\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.purchase_price | currency }}\n </td>\n </ng-container>\n\n <!-- Total Value Column -->\n <ng-container matColumnDef=\"amount\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Total Value</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.amount | currency }}\n </td>\n </ng-container>\n\n <!-- Particulars Column -->\n <ng-container matColumnDef=\"particulars\">\n <th mat-header-cell *matHeaderCellDef>Particulars</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.particulars }}</td>\n </ng-container>\n\n <!-- Supplier Column -->\n <ng-container matColumnDef=\"supplier\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Supplier</th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.supplier?.company_name }}\n </td>\n </ng-container>\n\n <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef>Creator</th>\n <td mat-cell *matCellDef=\"let element\">\n <p class=\"mb-1\">{{ element?.creator?.name }}</p>\n <small class=\"text-secondary\">{{ element?.created_at | date }}</small>\n </td>\n </ng-container>\n\n <!-- Actions Column -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef>Actions</th>\n <td mat-cell *matCellDef=\"let element\">\n <div class=\"d-flex gap-1\">\n <app-stock-receipt-form-button\n [product]=\"element.product\"\n [stockReceipt]=\"element\"\n (saved)=\"reload(); listUpdated.emit()\"\n ></app-stock-receipt-form-button>\n <app-stock-receipt-delete-button\n [stockReceipt]=\"element\"\n (deleted)=\"reload(); listUpdated.emit()\"\n ></app-stock-receipt-delete-button>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n\n <mat-progress-bar *ngIf=\"isWorking\" mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-content>\n</mat-card>\n","import { NgModule } from \"@angular/core\";\nimport { RouterModule, Routes } from \"@angular/router\";\nimport { StockReceiptsListPageComponent } from \"./stock-receipts-list-page/stock-receipts-list-page.component\";\n\nconst routes: Routes = [\n {\n path: \"\",\n component: StockReceiptsListPageComponent,\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class StockReceiptsRoutingModule {}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { StockReceiptsRoutingModule } from \"./stock-receipts-routing.module\";\nimport { StockReceiptsListPageComponent } from \"./stock-receipts-list-page/stock-receipts-list-page.component\";\nimport { MatCardModule } from \"@angular/material/card\";\nimport { MatTableModule } from \"@angular/material/table\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport {\n MaterialModule,\n SearchableSelectorModule,\n TimelineFilterModule,\n} from \"ngx-techlify-core\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { MatProgressBarModule } from \"@angular/material/progress-bar\";\nimport { InfiniteScrollModule } from \"ngx-infinite-scroll\";\nimport { StockReceiptFormModule } from \"./stock-receipt-form/stock-receipt-form.module\";\nimport { StockReceiptDeleteButtonComponent } from \"./stock-receipt-delete-button/stock-receipt-delete-button.component\";\nimport { PayeeSelectorModule } from '../supplier/payee-selector/payee-selector.module';\nimport { TechlifyFilterModule } from '../techlify-filter/techlify-filter.module';\n\n@NgModule({\n declarations: [\n StockReceiptsListPageComponent,\n StockReceiptDeleteButtonComponent,\n ],\n exports: [StockReceiptDeleteButtonComponent, StockReceiptsListPageComponent],\n imports: [\n CommonModule,\n StockReceiptsRoutingModule,\n MatCardModule,\n TechlifyFilterModule,\n MatTableModule,\n MatFormFieldModule,\n SearchableSelectorModule,\n TimelineFilterModule,\n ReactiveFormsModule,\n PayeeSelectorModule,\n MatProgressBarModule,\n InfiniteScrollModule,\n MaterialModule,\n StockReceiptFormModule,\n ],\n})\nexport class StockReceiptsModule {}\n"],"names":["i2.StockReceiptService","i3","i4","i1.StockReceiptService","i5","i6","i7.TechlifyFilterComponent","i8","i9","i11","i12.StockReceiptFormButtonComponent","i13.StockReceiptDeleteButtonComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBa,iCAAiC,CAAA;AAMlC,IAAA,SAAA;AACA,IAAA,mBAAA;AACA,IAAA,YAAA;AAPD,IAAA,YAAY;AACX,IAAA,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,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,8BAA8B;wBAC9B,iCAAiC;AAClC,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,iCAAiC,EAAE,8BAA8B,CAAC;AAC5E,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,0BAA0B;wBAC1B,aAAa;wBACb,oBAAoB;wBACpB,cAAc;wBACd,kBAAkB;wBAClB,wBAAwB;wBACxB,oBAAoB;wBACpB,mBAAmB;wBACnB,mBAAmB;wBACnB,oBAAoB;wBACpB,oBAAoB;wBACpB,cAAc;wBACd,sBAAsB;AACvB,qBAAA;AACF,iBAAA;;;;;;;;;;"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Inject, Component } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/forms';
|
|
4
|
+
import { Validators } from '@angular/forms';
|
|
5
|
+
import * as i1$1 from '@angular/material/dialog';
|
|
6
|
+
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
7
|
+
import * as i1 from 'ngx-techlify-core';
|
|
8
|
+
import { TechlifyFormComponentInterface } from 'ngx-techlify-core';
|
|
9
|
+
import { lastValueFrom } from 'rxjs';
|
|
10
|
+
import * as i3 from 'ngx-spinner';
|
|
11
|
+
import { HttpParams } from '@angular/common/http';
|
|
12
|
+
import * as i4 from '@angular/common';
|
|
13
|
+
import * as i7 from '@angular/material/button';
|
|
14
|
+
import * as i6 from '@angular/material/form-field';
|
|
15
|
+
import * as i7$1 from '@angular/material/input';
|
|
16
|
+
import * as i10 from '@angular/flex-layout';
|
|
17
|
+
|
|
18
|
+
class SupplierService {
|
|
19
|
+
httpService;
|
|
20
|
+
constructor(httpService) {
|
|
21
|
+
this.httpService = httpService;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* get all suppliers from API
|
|
25
|
+
*
|
|
26
|
+
* @param filters Any attributes to filter suppliers by
|
|
27
|
+
*/
|
|
28
|
+
index(filters) {
|
|
29
|
+
let queries = new HttpParams({ fromObject: filters });
|
|
30
|
+
return this.httpService.get(`api/suppliers`, { params: queries });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* get individual supplier from API (for view page)
|
|
34
|
+
*
|
|
35
|
+
* @param id ID of the supplier being requested
|
|
36
|
+
*/
|
|
37
|
+
show(id) {
|
|
38
|
+
return this.httpService.get(`api/suppliers/${id}`);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* store a new supplier in the DB
|
|
42
|
+
*
|
|
43
|
+
* @param model data from the supplier form that will be stored in the DB
|
|
44
|
+
*/
|
|
45
|
+
store(model) {
|
|
46
|
+
return this.httpService.post(`api/suppliers`, model);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* update a supplier in the DB
|
|
50
|
+
*
|
|
51
|
+
* @param model.id ID of the supplier being updated
|
|
52
|
+
* @param model data from the supplier form that will be updated in the DB
|
|
53
|
+
*/
|
|
54
|
+
update(model) {
|
|
55
|
+
return this.httpService.put(`api/suppliers/${model?.id}`, model);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* delete a supplier from the DB
|
|
59
|
+
*
|
|
60
|
+
* @param id ID of the supplier being deleted
|
|
61
|
+
*/
|
|
62
|
+
destroy(id) {
|
|
63
|
+
return this.httpService.delete(`api/suppliers/${id}`);
|
|
64
|
+
}
|
|
65
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierService, deps: [{ token: i1.HttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
66
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierService, providedIn: "root" });
|
|
67
|
+
}
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierService, decorators: [{
|
|
69
|
+
type: Injectable,
|
|
70
|
+
args: [{
|
|
71
|
+
providedIn: "root",
|
|
72
|
+
}]
|
|
73
|
+
}], ctorParameters: () => [{ type: i1.HttpService }] });
|
|
74
|
+
|
|
75
|
+
class SupplierFormComponent extends TechlifyFormComponentInterface {
|
|
76
|
+
fb;
|
|
77
|
+
alertService;
|
|
78
|
+
spinnerService;
|
|
79
|
+
dialogRef;
|
|
80
|
+
errorService;
|
|
81
|
+
data;
|
|
82
|
+
supplierService;
|
|
83
|
+
errorMessages = {
|
|
84
|
+
contact_name: {
|
|
85
|
+
required: "Contact Name is required",
|
|
86
|
+
},
|
|
87
|
+
company_name: {
|
|
88
|
+
required: "Company Name is required",
|
|
89
|
+
},
|
|
90
|
+
address: {
|
|
91
|
+
required: "Address is required",
|
|
92
|
+
},
|
|
93
|
+
phone: {
|
|
94
|
+
required: "Phone is required",
|
|
95
|
+
},
|
|
96
|
+
details: {
|
|
97
|
+
required: "Details is required",
|
|
98
|
+
},
|
|
99
|
+
email: {
|
|
100
|
+
required: "Email is required",
|
|
101
|
+
},
|
|
102
|
+
supplier_type_id: {
|
|
103
|
+
required: "Supplier Type is required",
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
isWorking = false;
|
|
107
|
+
isUpdateMode = false;
|
|
108
|
+
supplierForm;
|
|
109
|
+
constructor(fb, formValidatorService, alertService, spinnerService, dialogRef, errorService, data, supplierService) {
|
|
110
|
+
super(formValidatorService);
|
|
111
|
+
this.fb = fb;
|
|
112
|
+
this.alertService = alertService;
|
|
113
|
+
this.spinnerService = spinnerService;
|
|
114
|
+
this.dialogRef = dialogRef;
|
|
115
|
+
this.errorService = errorService;
|
|
116
|
+
this.data = data;
|
|
117
|
+
this.supplierService = supplierService;
|
|
118
|
+
this.supplierForm = this.fb.group({
|
|
119
|
+
id: [""],
|
|
120
|
+
contact_name: ["", Validators.compose([Validators.required])],
|
|
121
|
+
company_name: ["", Validators.compose([Validators.required])],
|
|
122
|
+
details: ["", Validators.compose([Validators.required])],
|
|
123
|
+
address: ["", Validators.compose([Validators.required])],
|
|
124
|
+
phone: ["", Validators.compose([Validators.required])],
|
|
125
|
+
email: ["", Validators.compose([Validators.required])],
|
|
126
|
+
supplier_type_id: ["", Validators.compose([Validators.required])],
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
ngOnInit() {
|
|
130
|
+
if (this.data.details) {
|
|
131
|
+
this.isUpdateMode = true;
|
|
132
|
+
this.supplierForm.patchValue(this.data.details);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async submit() {
|
|
136
|
+
if (!this.supplierForm.valid) {
|
|
137
|
+
this.alertService.addAlert("Please Fill All Required Fields", "warn");
|
|
138
|
+
this.supplierForm.markAllAsTouched();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
var supplier = this.supplierForm.value;
|
|
142
|
+
try {
|
|
143
|
+
this.spinnerService.show();
|
|
144
|
+
this.isWorking = true;
|
|
145
|
+
let result = this.isUpdateMode
|
|
146
|
+
? await lastValueFrom(this.supplierService.update(supplier))
|
|
147
|
+
: await lastValueFrom(this.supplierService.store(supplier));
|
|
148
|
+
this.dialogRef.close(result);
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
this.errorService.handleError(error);
|
|
152
|
+
}
|
|
153
|
+
finally {
|
|
154
|
+
this.isWorking = false;
|
|
155
|
+
this.spinnerService.hide();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**Method to evaluate form fields*/
|
|
159
|
+
isFieldValid(field) {
|
|
160
|
+
return this.formValidatorService.isFieldValid(field, this.supplierForm);
|
|
161
|
+
}
|
|
162
|
+
/**Method to find error in form fields*/
|
|
163
|
+
getErrorMessage(field) {
|
|
164
|
+
return this.formValidatorService.getErrorMessage(field, this.supplierForm, this.errorMessages);
|
|
165
|
+
}
|
|
166
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierFormComponent, deps: [{ token: i2.FormBuilder }, { token: i1.FormValidatorService }, { token: i1.AlertService }, { token: i3.NgxSpinnerService }, { token: i1$1.MatDialogRef }, { token: i1.ErrorHandlerService }, { token: MAT_DIALOG_DATA }, { token: SupplierService }], target: i0.ɵɵFactoryTarget.Component });
|
|
167
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SupplierFormComponent, selector: "app-supplier-form", usesInheritance: true, ngImport: i0, template: "<form\n [formGroup]=\"supplierForm\"\n (ngSubmit)=\"submit()\"\n class=\"mat-typography p-3\"\n>\n <div fxLayout=\"column\">\n <div mat-dialog-title class=\"text-center\">\n <div>Supplier</div>\n </div>\n\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\n <mat-form-field fxFlex=\"50%\">\n <input\n matInput\n formControlName=\"company_name\"\n placeholder=\"Company Name\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('company_name')\">\n {{ getErrorMessage(\"company_name\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\">\n <input\n matInput\n formControlName=\"contact_name\"\n placeholder=\"Contact Name\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('contact_name')\">\n {{ getErrorMessage(\"contact_name\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\n <mat-form-field fxFlex=\"50%\">\n <mat-label>Types</mat-label>\n <app-searchable-selector\n titleField=\"title\"\n apiUrl=\"api/supplier-types\"\n formControlName=\"supplier_type_id\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('supplier_type_id')\">\n {{ getErrorMessage(\"supplier_type_id\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\">\n <input\n matInput\n formControlName=\"phone\"\n placeholder=\"Phone\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('phone')\">\n {{ getErrorMessage(\"phone\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row wrap\">\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input\n matInput\n formControlName=\"email\"\n placeholder=\"Email\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('email')\">\n {{ getErrorMessage(\"email\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input\n matInput\n formControlName=\"address\"\n placeholder=\"Address\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('address')\">\n {{ getErrorMessage(\"address\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input\n matInput\n formControlName=\"details\"\n placeholder=\"Details\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('details')\">\n {{ getErrorMessage(\"details\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row\">\n <div\n class=\"my-2\"\n fxLayout=\"row\"\n fxLayoutGap=\"30px\"\n fxLayoutAlign=\"end\"\n fxFlex=\"100%\"\n >\n <button\n [disabled]=\"isWorking\"\n mat-flat-button\n type=\"button\"\n (click)=\"dialogRef.close()\"\n >\n Cancel\n </button>\n <button\n [disabled]=\"isWorking\"\n mat-raised-button\n type=\"submit\"\n color=\"primary\"\n >\n Save\n </button>\n </div>\n </div>\n </div>\n</form>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i7$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i1.SearchableSelectorComponent, selector: "app-searchable-selector", inputs: ["valueField", "titleField", "subtitleField", "apiUrl", "multiple", "selectedValue", "enableSearch", "add", "addConfig", "edit", "editConfig", "sort", "sortBy", "searchField", "itemComponent", "items", "apiDataProperty", "cache", "perPage", "inDataSearch", "panelWidth", "focusSearchOnOpen", "required", "disabled", "value"], outputs: ["selectedValueChange", "selectionChange", "itemsChange"] }, { kind: "directive", type: i10.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i10.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i10.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i10.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], preserveWhitespaces: true });
|
|
168
|
+
}
|
|
169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierFormComponent, decorators: [{
|
|
170
|
+
type: Component,
|
|
171
|
+
args: [{ selector: "app-supplier-form", template: "<form\n [formGroup]=\"supplierForm\"\n (ngSubmit)=\"submit()\"\n class=\"mat-typography p-3\"\n>\n <div fxLayout=\"column\">\n <div mat-dialog-title class=\"text-center\">\n <div>Supplier</div>\n </div>\n\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\n <mat-form-field fxFlex=\"50%\">\n <input\n matInput\n formControlName=\"company_name\"\n placeholder=\"Company Name\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('company_name')\">\n {{ getErrorMessage(\"company_name\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\">\n <input\n matInput\n formControlName=\"contact_name\"\n placeholder=\"Contact Name\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('contact_name')\">\n {{ getErrorMessage(\"contact_name\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\n <mat-form-field fxFlex=\"50%\">\n <mat-label>Types</mat-label>\n <app-searchable-selector\n titleField=\"title\"\n apiUrl=\"api/supplier-types\"\n formControlName=\"supplier_type_id\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('supplier_type_id')\">\n {{ getErrorMessage(\"supplier_type_id\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\">\n <input\n matInput\n formControlName=\"phone\"\n placeholder=\"Phone\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('phone')\">\n {{ getErrorMessage(\"phone\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row wrap\">\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input\n matInput\n formControlName=\"email\"\n placeholder=\"Email\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('email')\">\n {{ getErrorMessage(\"email\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input\n matInput\n formControlName=\"address\"\n placeholder=\"Address\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('address')\">\n {{ getErrorMessage(\"address\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input\n matInput\n formControlName=\"details\"\n placeholder=\"Details\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('details')\">\n {{ getErrorMessage(\"details\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row\">\n <div\n class=\"my-2\"\n fxLayout=\"row\"\n fxLayoutGap=\"30px\"\n fxLayoutAlign=\"end\"\n fxFlex=\"100%\"\n >\n <button\n [disabled]=\"isWorking\"\n mat-flat-button\n type=\"button\"\n (click)=\"dialogRef.close()\"\n >\n Cancel\n </button>\n <button\n [disabled]=\"isWorking\"\n mat-raised-button\n type=\"submit\"\n color=\"primary\"\n >\n Save\n </button>\n </div>\n </div>\n </div>\n</form>\n" }]
|
|
172
|
+
}], ctorParameters: () => [{ type: i2.FormBuilder }, { type: i1.FormValidatorService }, { type: i1.AlertService }, { type: i3.NgxSpinnerService }, { type: i1$1.MatDialogRef }, { type: i1.ErrorHandlerService }, { type: undefined, decorators: [{
|
|
173
|
+
type: Inject,
|
|
174
|
+
args: [MAT_DIALOG_DATA]
|
|
175
|
+
}] }, { type: SupplierService }] });
|
|
176
|
+
|
|
177
|
+
export { SupplierFormComponent as S, SupplierService as a };
|
|
178
|
+
//# sourceMappingURL=techlify-inventory-common-supplier-form.component-CHmMG7O8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"techlify-inventory-common-supplier-form.component-CHmMG7O8.mjs","sources":["../../../projects/inventory-common/src/lib/inventory-common/supplier/supplier.service.ts","../../../projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form.component.ts","../../../projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form.component.html"],"sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { HttpService } from \"ngx-techlify-core\";\nimport { HttpParams } from \"@angular/common/http\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class SupplierService {\n constructor(private httpService: HttpService) {}\n\n /**\n * get all suppliers from API\n *\n * @param filters Any attributes to filter suppliers by\n */\n index(filters?: any) {\n let queries = new HttpParams({ fromObject: filters });\n return this.httpService.get(`api/suppliers`, { params: queries });\n }\n\n /**\n * get individual supplier from API (for view page)\n *\n * @param id ID of the supplier being requested\n */\n show(id: any) {\n return this.httpService.get(`api/suppliers/${id}`);\n }\n\n /**\n * store a new supplier in the DB\n *\n * @param model data from the supplier form that will be stored in the DB\n */\n store(model: any) {\n return this.httpService.post(`api/suppliers`, model);\n }\n\n /**\n * update a supplier in the DB\n *\n * @param model.id ID of the supplier being updated\n * @param model data from the supplier form that will be updated in the DB\n */\n update(model: any) {\n return this.httpService.put(`api/suppliers/${model?.id}`, model);\n }\n\n /**\n * delete a supplier from the DB\n *\n * @param id ID of the supplier being deleted\n */\n destroy(id: number) {\n return this.httpService.delete(`api/suppliers/${id}`);\n }\n}\n","import { SupplierService } from \"./../supplier.service\";\nimport { Component, Inject, OnInit } from \"@angular/core\";\nimport { FormBuilder, FormGroup, Validators } from \"@angular/forms\";\nimport { MatDialogRef, MAT_DIALOG_DATA } from \"@angular/material/dialog\";\nimport { NgxSpinnerService } from \"ngx-spinner\";\nimport {\n AlertService,\n ErrorHandlerService,\n FormValidatorService,\n TechlifyFormComponentInterface,\n} from \"ngx-techlify-core\";\nimport { lastValueFrom } from \"rxjs\";\n\n@Component({\n selector: \"app-supplier-form\",\n templateUrl: \"./supplier-form.component.html\",\n})\nexport class SupplierFormComponent\n extends TechlifyFormComponentInterface\n implements OnInit\n{\n override errorMessages: any = {\n contact_name: {\n required: \"Contact Name is required\",\n },\n company_name: {\n required: \"Company Name is required\",\n },\n address: {\n required: \"Address is required\",\n },\n phone: {\n required: \"Phone is required\",\n },\n details: {\n required: \"Details is required\",\n },\n email: {\n required: \"Email is required\",\n },\n supplier_type_id: {\n required: \"Supplier Type is required\",\n },\n };\n\n isWorking: boolean = false;\n isUpdateMode: boolean = false;\n supplierForm: FormGroup;\n\n constructor(\n private fb: FormBuilder,\n formValidatorService: FormValidatorService,\n private alertService: AlertService,\n private spinnerService: NgxSpinnerService,\n public dialogRef: MatDialogRef<SupplierFormComponent>,\n private errorService: ErrorHandlerService,\n @Inject(MAT_DIALOG_DATA) public data: any,\n private supplierService: SupplierService\n ) {\n super(formValidatorService);\n this.supplierForm = this.fb.group({\n id: [\"\"],\n contact_name: [\"\", Validators.compose([Validators.required])],\n company_name: [\"\", Validators.compose([Validators.required])],\n details: [\"\", Validators.compose([Validators.required])],\n address: [\"\", Validators.compose([Validators.required])],\n phone: [\"\", Validators.compose([Validators.required])],\n email: [\"\", Validators.compose([Validators.required])],\n supplier_type_id: [\"\", Validators.compose([Validators.required])],\n });\n }\n\n ngOnInit() {\n if (this.data.details) {\n this.isUpdateMode = true;\n this.supplierForm.patchValue(this.data.details);\n }\n }\n\n async submit() {\n if (!this.supplierForm.valid) {\n this.alertService.addAlert(\"Please Fill All Required Fields\", \"warn\");\n this.supplierForm.markAllAsTouched();\n return;\n }\n\n var supplier = this.supplierForm.value;\n try {\n this.spinnerService.show();\n this.isWorking = true;\n let result = this.isUpdateMode\n ? await lastValueFrom(this.supplierService.update(supplier))\n : await lastValueFrom(this.supplierService.store(supplier));\n this.dialogRef.close(result);\n } catch (error) {\n this.errorService.handleError(error);\n } finally {\n this.isWorking = false;\n this.spinnerService.hide();\n }\n }\n\n /**Method to evaluate form fields*/\n override isFieldValid(field: string) {\n return this.formValidatorService.isFieldValid(field, this.supplierForm);\n }\n\n /**Method to find error in form fields*/\n override getErrorMessage(field: string) {\n return this.formValidatorService.getErrorMessage(\n field,\n this.supplierForm,\n this.errorMessages\n );\n }\n}\n","<form\n [formGroup]=\"supplierForm\"\n (ngSubmit)=\"submit()\"\n class=\"mat-typography p-3\"\n>\n <div fxLayout=\"column\">\n <div mat-dialog-title class=\"text-center\">\n <div>Supplier</div>\n </div>\n\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\n <mat-form-field fxFlex=\"50%\">\n <input\n matInput\n formControlName=\"company_name\"\n placeholder=\"Company Name\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('company_name')\">\n {{ getErrorMessage(\"company_name\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\">\n <input\n matInput\n formControlName=\"contact_name\"\n placeholder=\"Contact Name\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('contact_name')\">\n {{ getErrorMessage(\"contact_name\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\n <mat-form-field fxFlex=\"50%\">\n <mat-label>Types</mat-label>\n <app-searchable-selector\n titleField=\"title\"\n apiUrl=\"api/supplier-types\"\n formControlName=\"supplier_type_id\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('supplier_type_id')\">\n {{ getErrorMessage(\"supplier_type_id\") }}\n </mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50%\">\n <input\n matInput\n formControlName=\"phone\"\n placeholder=\"Phone\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('phone')\">\n {{ getErrorMessage(\"phone\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row wrap\">\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input\n matInput\n formControlName=\"email\"\n placeholder=\"Email\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('email')\">\n {{ getErrorMessage(\"email\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input\n matInput\n formControlName=\"address\"\n placeholder=\"Address\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('address')\">\n {{ getErrorMessage(\"address\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input\n matInput\n formControlName=\"details\"\n placeholder=\"Details\"\n autocomplete=\"off\"\n required\n />\n <mat-error *ngIf=\"isFieldValid('details')\">\n {{ getErrorMessage(\"details\") }}\n </mat-error>\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row\">\n <div\n class=\"my-2\"\n fxLayout=\"row\"\n fxLayoutGap=\"30px\"\n fxLayoutAlign=\"end\"\n fxFlex=\"100%\"\n >\n <button\n [disabled]=\"isWorking\"\n mat-flat-button\n type=\"button\"\n (click)=\"dialogRef.close()\"\n >\n Cancel\n </button>\n <button\n [disabled]=\"isWorking\"\n mat-raised-button\n type=\"submit\"\n color=\"primary\"\n >\n Save\n </button>\n </div>\n </div>\n </div>\n</form>\n"],"names":["i5.SupplierService","i6","i4","i8","i9","i2","i1"],"mappings":";;;;;;;;;;;;;;;;;MAOa,eAAe,CAAA;AACN,IAAA,WAAA;AAApB,IAAA,WAAA,CAAoB,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;;AAE/B;;;;AAIG;AACH,IAAA,KAAK,CAAC,OAAa,EAAA;QACjB,IAAI,OAAO,GAAG,IAAI,UAAU,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AACrD,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA,aAAA,CAAe,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;AAGnE;;;;AAIG;AACH,IAAA,IAAI,CAAC,EAAO,EAAA;QACV,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAiB,cAAA,EAAA,EAAE,CAAE,CAAA,CAAC;;AAGpD;;;;AAIG;AACH,IAAA,KAAK,CAAC,KAAU,EAAA;QACd,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAe,aAAA,CAAA,EAAE,KAAK,CAAC;;AAGtD;;;;;AAKG;AACH,IAAA,MAAM,CAAC,KAAU,EAAA;AACf,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA,cAAA,EAAiB,KAAK,EAAE,EAAE,CAAA,CAAE,EAAE,KAAK,CAAC;;AAGlE;;;;AAIG;AACH,IAAA,OAAO,CAAC,EAAU,EAAA;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAiB,cAAA,EAAA,EAAE,CAAE,CAAA,CAAC;;wGA/C5C,eAAe,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EA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