techlify-inventory-common 18.1.0 → 18.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/inventory-common/inventory-common-routing.module.mjs +11 -1
- package/esm2022/lib/inventory-common/inventory-common.module.mjs +8 -4
- package/esm2022/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.mjs +10 -8
- package/esm2022/lib/inventory-common/inventory-value-report.service.mjs +21 -0
- package/esm2022/lib/inventory-common/low-stock-report.service.mjs +23 -0
- package/esm2022/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.mjs +9 -7
- package/esm2022/lib/inventory-common/product/product-list/product-list.component.mjs +3 -3
- package/esm2022/lib/inventory-common/product/product-quick-search/product-quick-search.component.mjs +92 -0
- package/esm2022/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.mjs +18 -0
- package/esm2022/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.mjs +170 -0
- package/esm2022/lib/inventory-common/reports/low-stock-report/low-stock-report.component.mjs +165 -0
- package/esm2022/lib/inventory-common/supplier/supplier-delete-button/supplier-delete-button.component.mjs +64 -0
- package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form-button/supplier-form-button.component.mjs +43 -0
- package/esm2022/lib/inventory-common/supplier/supplier.module.mjs +11 -3
- package/esm2022/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.mjs +6 -65
- package/fesm2022/{techlify-inventory-common-category.module-CNm2bEsx.mjs → techlify-inventory-common-category.module-BKEBFEeZ.mjs} +9 -9
- package/fesm2022/{techlify-inventory-common-category.module-CNm2bEsx.mjs.map → techlify-inventory-common-category.module-BKEBFEeZ.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-measure.module-BEaRHh5Z.mjs → techlify-inventory-common-measure.module-CZHhYoQd.mjs} +9 -9
- package/fesm2022/{techlify-inventory-common-measure.module-BEaRHh5Z.mjs.map → techlify-inventory-common-measure.module-CZHhYoQd.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-stock-issuances.module-BQRRP-hW.mjs → techlify-inventory-common-stock-issuances.module-BjPbzqUW.mjs} +2 -4
- package/fesm2022/{techlify-inventory-common-stock-issuances.module-BQRRP-hW.mjs.map → techlify-inventory-common-stock-issuances.module-BjPbzqUW.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-supplier.module-Bwa7gx14.mjs → techlify-inventory-common-supplier.module-CFDwJ-TS.mjs} +251 -218
- package/fesm2022/techlify-inventory-common-supplier.module-CFDwJ-TS.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common-techlify-inventory-common-CYiCJfk9.mjs +3143 -0
- package/fesm2022/techlify-inventory-common-techlify-inventory-common-CYiCJfk9.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common.mjs +1 -1
- package/lib/inventory-common/inventory-common.module.d.ts +2 -1
- package/lib/inventory-common/inventory-value-report.service.d.ts +9 -0
- package/lib/inventory-common/low-stock-report.service.d.ts +10 -0
- package/lib/inventory-common/product/product-quick-search/product-quick-search.component.d.ts +15 -0
- package/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.d.ts +6 -0
- package/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.d.ts +26 -0
- package/lib/inventory-common/reports/low-stock-report/low-stock-report.component.d.ts +26 -0
- package/lib/inventory-common/supplier/supplier-delete-button/supplier-delete-button.component.d.ts +18 -0
- package/lib/inventory-common/supplier/supplier-form/supplier-form-button/supplier-form-button.component.d.ts +13 -0
- package/lib/inventory-common/supplier/supplier.module.d.ts +3 -1
- package/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.d.ts +0 -8
- package/package.json +1 -1
- package/fesm2022/techlify-inventory-common-product.module-BV9Cy88x.mjs +0 -1168
- package/fesm2022/techlify-inventory-common-product.module-BV9Cy88x.mjs.map +0 -1
- package/fesm2022/techlify-inventory-common-stock-issuances-list.module-Dt6gx-ji.mjs +0 -436
- package/fesm2022/techlify-inventory-common-stock-issuances-list.module-Dt6gx-ji.mjs.map +0 -1
- package/fesm2022/techlify-inventory-common-stock-receipt-form.module-DND0GNlf.mjs +0 -302
- package/fesm2022/techlify-inventory-common-stock-receipt-form.module-DND0GNlf.mjs.map +0 -1
- package/fesm2022/techlify-inventory-common-stock-receipts.module-BvYaKITT.mjs +0 -253
- package/fesm2022/techlify-inventory-common-stock-receipts.module-BvYaKITT.mjs.map +0 -1
- package/fesm2022/techlify-inventory-common-supplier-form.component-DVBnhiyH.mjs +0 -177
- package/fesm2022/techlify-inventory-common-supplier-form.component-DVBnhiyH.mjs.map +0 -1
- package/fesm2022/techlify-inventory-common-supplier.module-Bwa7gx14.mjs.map +0 -1
- package/fesm2022/techlify-inventory-common-techlify-form-service-CiVfwYTS.mjs +0 -14
- package/fesm2022/techlify-inventory-common-techlify-form-service-CiVfwYTS.mjs.map +0 -1
- package/fesm2022/techlify-inventory-common-techlify-inventory-common-GFYF7JCA.mjs +0 -495
- package/fesm2022/techlify-inventory-common-techlify-inventory-common-GFYF7JCA.mjs.map +0 -1
|
@@ -1,253 +0,0 @@
|
|
|
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-DND0GNlf.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-GFYF7JCA.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-BvYaKITT.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"techlify-inventory-common-stock-receipts.module-BvYaKITT.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;MAg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,cAAc;YACd,sBAAsB,CAAA,EAAA,CAAA;;4FAGb,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAvB/B,QAAQ;AAAC,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;;;;;;;;;;"}
|
|
@@ -1,177 +0,0 @@
|
|
|
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
|
-
|
|
17
|
-
class SupplierService {
|
|
18
|
-
httpService;
|
|
19
|
-
constructor(httpService) {
|
|
20
|
-
this.httpService = httpService;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* get all suppliers from API
|
|
24
|
-
*
|
|
25
|
-
* @param filters Any attributes to filter suppliers by
|
|
26
|
-
*/
|
|
27
|
-
index(filters) {
|
|
28
|
-
let queries = new HttpParams({ fromObject: filters });
|
|
29
|
-
return this.httpService.get(`api/suppliers`, { params: queries });
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* get individual supplier from API (for view page)
|
|
33
|
-
*
|
|
34
|
-
* @param id ID of the supplier being requested
|
|
35
|
-
*/
|
|
36
|
-
show(id) {
|
|
37
|
-
return this.httpService.get(`api/suppliers/${id}`);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* store a new supplier in the DB
|
|
41
|
-
*
|
|
42
|
-
* @param model data from the supplier form that will be stored in the DB
|
|
43
|
-
*/
|
|
44
|
-
store(model) {
|
|
45
|
-
return this.httpService.post(`api/suppliers`, model);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* update a supplier in the DB
|
|
49
|
-
*
|
|
50
|
-
* @param model.id ID of the supplier being updated
|
|
51
|
-
* @param model data from the supplier form that will be updated in the DB
|
|
52
|
-
*/
|
|
53
|
-
update(model) {
|
|
54
|
-
return this.httpService.put(`api/suppliers/${model?.id}`, model);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* delete a supplier from the DB
|
|
58
|
-
*
|
|
59
|
-
* @param id ID of the supplier being deleted
|
|
60
|
-
*/
|
|
61
|
-
destroy(id) {
|
|
62
|
-
return this.httpService.delete(`api/suppliers/${id}`);
|
|
63
|
-
}
|
|
64
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierService, deps: [{ token: i1.HttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
65
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierService, providedIn: "root" });
|
|
66
|
-
}
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierService, decorators: [{
|
|
68
|
-
type: Injectable,
|
|
69
|
-
args: [{
|
|
70
|
-
providedIn: "root",
|
|
71
|
-
}]
|
|
72
|
-
}], ctorParameters: () => [{ type: i1.HttpService }] });
|
|
73
|
-
|
|
74
|
-
class SupplierFormComponent extends TechlifyFormComponentInterface {
|
|
75
|
-
fb;
|
|
76
|
-
alertService;
|
|
77
|
-
spinnerService;
|
|
78
|
-
dialogRef;
|
|
79
|
-
errorService;
|
|
80
|
-
data;
|
|
81
|
-
supplierService;
|
|
82
|
-
errorMessages = {
|
|
83
|
-
contact_name: {
|
|
84
|
-
required: "Contact Name is required",
|
|
85
|
-
},
|
|
86
|
-
company_name: {
|
|
87
|
-
required: "Company Name is required",
|
|
88
|
-
},
|
|
89
|
-
address: {
|
|
90
|
-
required: "Address is required",
|
|
91
|
-
},
|
|
92
|
-
phone: {
|
|
93
|
-
required: "Phone is required",
|
|
94
|
-
},
|
|
95
|
-
details: {
|
|
96
|
-
required: "Details is required",
|
|
97
|
-
},
|
|
98
|
-
email: {
|
|
99
|
-
required: "Email is required",
|
|
100
|
-
},
|
|
101
|
-
supplier_type_id: {
|
|
102
|
-
required: "Supplier Type is required",
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
isWorking = false;
|
|
106
|
-
isUpdateMode = false;
|
|
107
|
-
supplierForm;
|
|
108
|
-
constructor(fb, formValidatorService, alertService, spinnerService, dialogRef, errorService, data, supplierService) {
|
|
109
|
-
super(formValidatorService);
|
|
110
|
-
this.fb = fb;
|
|
111
|
-
this.alertService = alertService;
|
|
112
|
-
this.spinnerService = spinnerService;
|
|
113
|
-
this.dialogRef = dialogRef;
|
|
114
|
-
this.errorService = errorService;
|
|
115
|
-
this.data = data;
|
|
116
|
-
this.supplierService = supplierService;
|
|
117
|
-
this.supplierForm = this.fb.group({
|
|
118
|
-
id: [""],
|
|
119
|
-
contact_name: [""],
|
|
120
|
-
company_name: ["", Validators.compose([Validators.required])],
|
|
121
|
-
details: [""],
|
|
122
|
-
address: [""],
|
|
123
|
-
phone: [""],
|
|
124
|
-
email: [""],
|
|
125
|
-
supplier_type_id: ["",],
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
ngOnInit() {
|
|
129
|
-
if (this.data.details) {
|
|
130
|
-
this.isUpdateMode = true;
|
|
131
|
-
this.supplierForm.patchValue(this.data.details);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
async submit() {
|
|
135
|
-
if (!this.supplierForm.valid) {
|
|
136
|
-
this.alertService.addAlert("Please Fill All Required Fields", "warn");
|
|
137
|
-
this.supplierForm.markAllAsTouched();
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
var supplier = this.supplierForm.value;
|
|
141
|
-
try {
|
|
142
|
-
this.spinnerService.show();
|
|
143
|
-
this.isWorking = true;
|
|
144
|
-
let result = this.isUpdateMode
|
|
145
|
-
? await lastValueFrom(this.supplierService.update(supplier))
|
|
146
|
-
: await lastValueFrom(this.supplierService.store(supplier));
|
|
147
|
-
this.dialogRef.close(result);
|
|
148
|
-
}
|
|
149
|
-
catch (error) {
|
|
150
|
-
this.errorService.handleError(error);
|
|
151
|
-
}
|
|
152
|
-
finally {
|
|
153
|
-
this.isWorking = false;
|
|
154
|
-
this.spinnerService.hide();
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/**Method to evaluate form fields*/
|
|
158
|
-
isFieldValid(field) {
|
|
159
|
-
return this.formValidatorService.isFieldValid(field, this.supplierForm);
|
|
160
|
-
}
|
|
161
|
-
/**Method to find error in form fields*/
|
|
162
|
-
getErrorMessage(field) {
|
|
163
|
-
return this.formValidatorService.getErrorMessage(field, this.supplierForm, this.errorMessages);
|
|
164
|
-
}
|
|
165
|
-
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 });
|
|
166
|
-
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 (ngSubmit)=\"submit()\"\n [formGroup]=\"supplierForm\"\n class=\"mat-typography\"\n>\n <div class=\"d-flex flex-column justify-content-start gap-2\" mat-dialog-content>\n <h2 class=\"mb-2\">{{ isUpdateMode ? 'Edit' : 'Create' }} Supplier</h2>\n <mat-form-field>\n <mat-label>Company Name</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"company_name\"\n matInput\n placeholder=\"Company Name\"\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>\n <mat-label>Contact Name</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"contact_name\"\n matInput\n placeholder=\"Contact Name\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Types</mat-label>\n <app-searchable-selector\n apiUrl=\"api/supplier-types\"\n formControlName=\"supplier_type_id\"\n titleField=\"title\"\n >\n </app-searchable-selector>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Phone</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"phone\"\n matInput\n placeholder=\"Phone\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Email</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"email\"\n matInput\n placeholder=\"Email\"\n type=\"email\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Address</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"address\"\n matInput\n placeholder=\"Address\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Details</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"details\"\n matInput\n placeholder=\"Details\"\n />\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-3\">\n <button\n (click)=\"dialogRef.close()\"\n [disabled]=\"isWorking\"\n mat-flat-button\n type=\"button\"\n >\n Cancel\n </button>\n <button\n [disabled]=\"isWorking\"\n color=\"primary\"\n mat-raised-button\n type=\"submit\"\n >\n Save\n </button>\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.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { 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: 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 });
|
|
167
|
-
}
|
|
168
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SupplierFormComponent, decorators: [{
|
|
169
|
-
type: Component,
|
|
170
|
-
args: [{ selector: "app-supplier-form", template: "<form\n (ngSubmit)=\"submit()\"\n [formGroup]=\"supplierForm\"\n class=\"mat-typography\"\n>\n <div class=\"d-flex flex-column justify-content-start gap-2\" mat-dialog-content>\n <h2 class=\"mb-2\">{{ isUpdateMode ? 'Edit' : 'Create' }} Supplier</h2>\n <mat-form-field>\n <mat-label>Company Name</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"company_name\"\n matInput\n placeholder=\"Company Name\"\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>\n <mat-label>Contact Name</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"contact_name\"\n matInput\n placeholder=\"Contact Name\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Types</mat-label>\n <app-searchable-selector\n apiUrl=\"api/supplier-types\"\n formControlName=\"supplier_type_id\"\n titleField=\"title\"\n >\n </app-searchable-selector>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Phone</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"phone\"\n matInput\n placeholder=\"Phone\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Email</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"email\"\n matInput\n placeholder=\"Email\"\n type=\"email\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Address</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"address\"\n matInput\n placeholder=\"Address\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Details</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"details\"\n matInput\n placeholder=\"Details\"\n />\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-3\">\n <button\n (click)=\"dialogRef.close()\"\n [disabled]=\"isWorking\"\n mat-flat-button\n type=\"button\"\n >\n Cancel\n </button>\n <button\n [disabled]=\"isWorking\"\n color=\"primary\"\n mat-raised-button\n type=\"submit\"\n >\n Save\n </button>\n </div>\n </div>\n</form>\n" }]
|
|
171
|
-
}], ctorParameters: () => [{ type: i2.FormBuilder }, { type: i1.FormValidatorService }, { type: i1.AlertService }, { type: i3.NgxSpinnerService }, { type: i1$1.MatDialogRef }, { type: i1.ErrorHandlerService }, { type: undefined, decorators: [{
|
|
172
|
-
type: Inject,
|
|
173
|
-
args: [MAT_DIALOG_DATA]
|
|
174
|
-
}] }, { type: SupplierService }] });
|
|
175
|
-
|
|
176
|
-
export { SupplierFormComponent as S, SupplierService as a };
|
|
177
|
-
//# sourceMappingURL=techlify-inventory-common-supplier-form.component-DVBnhiyH.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"techlify-inventory-common-supplier-form.component-DVBnhiyH.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: [\"\"],\n company_name: [\"\", Validators.compose([Validators.required])],\n details: [\"\"],\n address: [\"\"],\n phone: [\"\"],\n email: [\"\"],\n supplier_type_id: [\"\",],\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 (ngSubmit)=\"submit()\"\n [formGroup]=\"supplierForm\"\n class=\"mat-typography\"\n>\n <div class=\"d-flex flex-column justify-content-start gap-2\" mat-dialog-content>\n <h2 class=\"mb-2\">{{ isUpdateMode ? 'Edit' : 'Create' }} Supplier</h2>\n <mat-form-field>\n <mat-label>Company Name</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"company_name\"\n matInput\n placeholder=\"Company Name\"\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>\n <mat-label>Contact Name</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"contact_name\"\n matInput\n placeholder=\"Contact Name\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Types</mat-label>\n <app-searchable-selector\n apiUrl=\"api/supplier-types\"\n formControlName=\"supplier_type_id\"\n titleField=\"title\"\n >\n </app-searchable-selector>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Phone</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"phone\"\n matInput\n placeholder=\"Phone\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Email</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"email\"\n matInput\n placeholder=\"Email\"\n type=\"email\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Address</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"address\"\n matInput\n placeholder=\"Address\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Details</mat-label>\n <input\n autocomplete=\"off\"\n formControlName=\"details\"\n matInput\n placeholder=\"Details\"\n />\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-3\">\n <button\n (click)=\"dialogRef.close()\"\n [disabled]=\"isWorking\"\n mat-flat-button\n type=\"button\"\n >\n Cancel\n </button>\n <button\n [disabled]=\"isWorking\"\n color=\"primary\"\n mat-raised-button\n type=\"submit\"\n >\n Save\n </button>\n </div>\n </div>\n</form>\n"],"names":["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