techlify-inventory-common 18.0.1 → 18.1.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/product/product-list/product-list.component.mjs +30 -40
- package/esm2022/lib/inventory-common/product/product.module.mjs +7 -4
- package/esm2022/lib/inventory-common/supplier/supplier-form/supplier-form.component.mjs +9 -10
- package/esm2022/lib/inventory-common/supplier/supplier.module.mjs +7 -3
- package/esm2022/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.mjs +77 -118
- package/fesm2022/{techlify-inventory-common-category.module-Stn6e73V.mjs → techlify-inventory-common-category.module-CNm2bEsx.mjs} +2 -2
- package/fesm2022/{techlify-inventory-common-category.module-Stn6e73V.mjs.map → techlify-inventory-common-category.module-CNm2bEsx.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-measure.module-CirswKXn.mjs → techlify-inventory-common-measure.module-BEaRHh5Z.mjs} +2 -2
- package/fesm2022/{techlify-inventory-common-measure.module-CirswKXn.mjs.map → techlify-inventory-common-measure.module-BEaRHh5Z.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-product.module-qdeafFV5.mjs → techlify-inventory-common-product.module-BV9Cy88x.mjs} +34 -38
- package/fesm2022/techlify-inventory-common-product.module-BV9Cy88x.mjs.map +1 -0
- package/fesm2022/{techlify-inventory-common-stock-issuances-list.module-CyFDxARk.mjs → techlify-inventory-common-stock-issuances-list.module-Dt6gx-ji.mjs} +2 -2
- package/fesm2022/{techlify-inventory-common-stock-issuances-list.module-CyFDxARk.mjs.map → techlify-inventory-common-stock-issuances-list.module-Dt6gx-ji.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-stock-issuances.module-Dm9i2kcf.mjs → techlify-inventory-common-stock-issuances.module-BQRRP-hW.mjs} +4 -4
- package/fesm2022/{techlify-inventory-common-stock-issuances.module-Dm9i2kcf.mjs.map → techlify-inventory-common-stock-issuances.module-BQRRP-hW.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs → techlify-inventory-common-stock-receipt-form.module-DND0GNlf.mjs} +2 -2
- package/fesm2022/{techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs.map → techlify-inventory-common-stock-receipt-form.module-DND0GNlf.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs → techlify-inventory-common-stock-receipts.module-BvYaKITT.mjs} +3 -3
- package/fesm2022/{techlify-inventory-common-stock-receipts.module-CUPdWteR.mjs.map → techlify-inventory-common-stock-receipts.module-BvYaKITT.mjs.map} +1 -1
- package/fesm2022/techlify-inventory-common-supplier-form.component-DVBnhiyH.mjs +177 -0
- package/fesm2022/techlify-inventory-common-supplier-form.component-DVBnhiyH.mjs.map +1 -0
- package/fesm2022/{techlify-inventory-common-supplier.module-gzHesNtQ.mjs → techlify-inventory-common-supplier.module-Bwa7gx14.mjs} +73 -130
- package/fesm2022/techlify-inventory-common-supplier.module-Bwa7gx14.mjs.map +1 -0
- package/fesm2022/{techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs → techlify-inventory-common-techlify-inventory-common-GFYF7JCA.mjs} +7 -7
- package/fesm2022/{techlify-inventory-common-techlify-inventory-common-Czyc0jLI.mjs.map → techlify-inventory-common-techlify-inventory-common-GFYF7JCA.mjs.map} +1 -1
- package/fesm2022/techlify-inventory-common.mjs +1 -1
- package/lib/inventory-common/product/product-list/product-list.component.d.ts +5 -7
- package/lib/inventory-common/product/product.module.d.ts +1 -1
- package/lib/inventory-common/supplier/supplier.module.d.ts +2 -1
- package/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.d.ts +14 -24
- package/package.json +1 -1
- package/esm2022/lib/inventory-common/supplier/supplier-type.service.mjs +0 -25
- package/fesm2022/techlify-inventory-common-product.module-qdeafFV5.mjs.map +0 -1
- package/fesm2022/techlify-inventory-common-supplier-form.component-CHmMG7O8.mjs +0 -178
- package/fesm2022/techlify-inventory-common-supplier-form.component-CHmMG7O8.mjs.map +0 -1
- package/fesm2022/techlify-inventory-common-supplier.module-gzHesNtQ.mjs.map +0 -1
- package/lib/inventory-common/supplier/supplier-type.service.d.ts +0 -13
|
@@ -3,16 +3,16 @@ import { NgModule } from '@angular/core';
|
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import * as i2 from '@angular/router';
|
|
5
5
|
import { RouterModule } from '@angular/router';
|
|
6
|
-
import { S as StockIssuancesListComponent, a as StockIssueFormModule, b as StockIssuancesListModule } from './techlify-inventory-common-stock-issuances-list.module-
|
|
6
|
+
import { S as StockIssuancesListComponent, a as StockIssueFormModule, b as StockIssuancesListModule } from './techlify-inventory-common-stock-issuances-list.module-Dt6gx-ji.mjs';
|
|
7
7
|
import { MatCardModule } from '@angular/material/card';
|
|
8
8
|
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
|
9
9
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
10
10
|
import { MatSortModule } from '@angular/material/sort';
|
|
11
11
|
import { MatTableModule } from '@angular/material/table';
|
|
12
|
-
import { S as StockReceiptFormModule } from './techlify-inventory-common-stock-receipt-form.module-
|
|
12
|
+
import { S as StockReceiptFormModule } from './techlify-inventory-common-stock-receipt-form.module-DND0GNlf.mjs';
|
|
13
13
|
import { MatDialogModule } from '@angular/material/dialog';
|
|
14
14
|
import { MatButtonModule } from '@angular/material/button';
|
|
15
|
-
import { a as TechlifyFilterModule } from './techlify-inventory-common-techlify-inventory-common-
|
|
15
|
+
import { a as TechlifyFilterModule } from './techlify-inventory-common-techlify-inventory-common-GFYF7JCA.mjs';
|
|
16
16
|
|
|
17
17
|
const routes = [
|
|
18
18
|
{
|
|
@@ -86,4 +86,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
86
86
|
}] });
|
|
87
87
|
|
|
88
88
|
export { StockIssuancesModule };
|
|
89
|
-
//# sourceMappingURL=techlify-inventory-common-stock-issuances.module-
|
|
89
|
+
//# sourceMappingURL=techlify-inventory-common-stock-issuances.module-BQRRP-hW.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"techlify-inventory-common-stock-issuances.module-
|
|
1
|
+
{"version":3,"file":"techlify-inventory-common-stock-issuances.module-BQRRP-hW.mjs","sources":["../../../projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-routing.module.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances.module.ts"],"sourcesContent":["import { NgModule } from \"@angular/core\";\nimport { RouterModule, Routes } from \"@angular/router\";\nimport { StockIssuancesListComponent } from \"./stock-issuances-list/stock-issuances-list.component\";\n\nconst routes: Routes = [\n {\n path: \"\",\n component: StockIssuancesListComponent,\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class StockIssuancesRoutingModule {}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { StockIssuancesRoutingModule } from \"./stock-issuances-routing.module\";\nimport { MatCardModule } from \"@angular/material/card\";\nimport { InfiniteScrollModule } from \"ngx-infinite-scroll\";\nimport { MatProgressBarModule } from \"@angular/material/progress-bar\";\nimport { MatSortModule } from \"@angular/material/sort\";\nimport { MatTableModule } from \"@angular/material/table\";\nimport { StockReceiptFormModule } from \"../stock-receipts/stock-receipt-form/stock-receipt-form.module\";\nimport { StockIssueFormModule } from \"./stock-issue-form/stock-issue-form.module\";\nimport { MatDialogModule } from \"@angular/material/dialog\";\nimport { MatButtonModule } from \"@angular/material/button\";\nimport { StockIssuancesListModule } from \"./stock-issuances-list/stock-issuances-list.module\";\nimport { TechlifyFilterModule } from '../techlify-filter/techlify-filter.module';\n\n@NgModule({\n declarations: [],\n exports: [],\n imports: [\n CommonModule,\n StockIssuancesRoutingModule,\n MatCardModule,\n TechlifyFilterModule,\n InfiniteScrollModule,\n MatProgressBarModule,\n MatSortModule,\n MatTableModule,\n StockReceiptFormModule,\n StockIssueFormModule,\n MatDialogModule,\n MatButtonModule,\n StockIssuancesListModule,\n ],\n})\nexport class StockIssuancesModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,MAAM,MAAM,GAAW;AACrB,IAAA;AACE,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,SAAS,EAAE,2BAA2B;AACvC,KAAA;CACF;MAMY,2BAA2B,CAAA;wGAA3B,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,wCAF5B,YAAY,CAAA,EAAA,CAAA;yGAEX,2BAA2B,EAAA,OAAA,EAAA,CAH5B,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC7B,YAAY,CAAA,EAAA,CAAA;;4FAEX,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAJvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;oBACxC,OAAO,EAAE,CAAC,YAAY,CAAC;AACxB,iBAAA;;;MCqBY,oBAAoB,CAAA;wGAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAf7B,YAAY;YACZ,2BAA2B;YAC3B,aAAa;YACb,oBAAoB;YACpB,oBAAoB;YACpB,oBAAoB;YACpB,aAAa;YACb,cAAc;YACd,sBAAsB;YACtB,oBAAoB;YACpB,eAAe;YACf,eAAe;YACf,wBAAwB,CAAA,EAAA,CAAA;AAGf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAf7B,YAAY;YACZ,2BAA2B;YAC3B,aAAa;YACb,oBAAoB;YACpB,oBAAoB;YACpB,oBAAoB;YACpB,aAAa;YACb,cAAc;YACd,sBAAsB;YACtB,oBAAoB;YACpB,eAAe;YACf,eAAe;YACf,wBAAwB,CAAA,EAAA,CAAA;;4FAGf,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAnBhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,2BAA2B;wBAC3B,aAAa;wBACb,oBAAoB;wBACpB,oBAAoB;wBACpB,oBAAoB;wBACpB,aAAa;wBACb,cAAc;wBACd,sBAAsB;wBACtB,oBAAoB;wBACpB,eAAe;wBACf,eAAe;wBACf,wBAAwB;AACzB,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -7,7 +7,7 @@ import { TechlifyServiceBaseClass, TechlifyFormComponentInterface, SearchableSel
|
|
|
7
7
|
import * as i2 from '@angular/forms';
|
|
8
8
|
import { NG_VALUE_ACCESSOR, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
9
9
|
import { debounceTime } from 'rxjs';
|
|
10
|
-
import { S as SupplierFormComponent } from './techlify-inventory-common-supplier-form.component-
|
|
10
|
+
import { S as SupplierFormComponent } from './techlify-inventory-common-supplier-form.component-DVBnhiyH.mjs';
|
|
11
11
|
import * as i6 from '@angular/material/form-field';
|
|
12
12
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
13
13
|
import * as i7 from '@angular/material/input';
|
|
@@ -299,4 +299,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
299
299
|
}] });
|
|
300
300
|
|
|
301
301
|
export { PayeeSelectorModule as P, StockReceiptFormModule as S, StockReceiptFormButtonComponent as a, StockReceiptService as b };
|
|
302
|
-
//# sourceMappingURL=techlify-inventory-common-stock-receipt-form.module-
|
|
302
|
+
//# sourceMappingURL=techlify-inventory-common-stock-receipt-form.module-DND0GNlf.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"techlify-inventory-common-stock-receipt-form.module-BZDrN7la.mjs","sources":["../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt.service.ts","../../../projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.ts","../../../projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.html","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.html","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.html","../../../projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector.module.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { HttpService, TechlifyServiceBaseClass } from \"ngx-techlify-core\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class StockReceiptService extends TechlifyServiceBaseClass {\n constructor(httpService: HttpService) {\n super(httpService, \"stock-receipts\");\n }\n}\n","import { Component, forwardRef, Input, OnInit } from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { SupplierFormComponent } from \"../../supplier-form/supplier-form.component\";\nimport { MatFormFieldAppearance } from \"@angular/material/form-field\";\n\n@Component({\n selector: \"app-payee-selector\",\n templateUrl: \"./payee-selector.component.html\",\n styleUrls: [\"./payee-selector.component.scss\"],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => PayeeSelectorComponent),\n multi: true,\n },\n ],\n})\nexport class PayeeSelectorComponent implements ControlValueAccessor {\n @Input() label = \"Payee\";\n @Input() appearance: MatFormFieldAppearance = \"fill\";\n @Input() required: boolean = false;\n @Input() showAddButton: boolean = false;\n @Input() multiple: boolean = false;\n\n value: any;\n onChange: any = () => {};\n onTouch: any = () => {};\n\n writeValue(value: any): void {\n this.value = value;\n this.onChange(value);\n this.onTouch(value);\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouch = fn;\n }\n\n protected readonly SupplierFormComponent = SupplierFormComponent;\n}\n","<mat-form-field [appearance]=\"appearance\" class=\"w-100\">\n <mat-label>{{ label }}</mat-label>\n <app-searchable-selector\n apiUrl=\"api/suppliers\"\n titleField=\"company_name\"\n sortBy=\"company_name|asc\"\n [required]=\"required\"\n [(ngModel)]=\"value\"\n #payeeSelector=\"ngModel\"\n name=\"payeeSelector\"\n [add]=\"showAddButton\"\n [itemComponent]=\"SupplierFormComponent\"\n (ngModelChange)=\"onChange($event)\"\n [addConfig]=\"{ width: '600px' }\"\n [ngModelOptions]=\"{ standalone: true }\"\n [multiple]=\"multiple\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"payeeSelector.invalid && payeeSelector.touched\">\n The payee field is required.\n </mat-error>\n</mat-form-field>\n","import { Component, EventEmitter, Input, OnInit, Output } from \"@angular/core\";\nimport {\n AlertService,\n DateUtils,\n FormValidatorService,\n TechlifyFormComponentInterface,\n} from \"ngx-techlify-core\";\nimport { FormBuilder, Validators } from \"@angular/forms\";\nimport { StockReceiptService } from \"../../stock-receipt.service\";\nimport { debounceTime, Observable } from \"rxjs\";\n\n@Component({\n selector: \"app-stock-receipt-form\",\n templateUrl: \"./stock-receipt-form.component.html\",\n styleUrls: [\"./stock-receipt-form.component.scss\"],\n})\nexport class StockReceiptFormComponent\n extends TechlifyFormComponentInterface\n implements OnInit\n{\n @Input() product: any;\n @Input() stockReceipt: any;\n @Output() saved: EventEmitter<any> = new EventEmitter<any>();\n @Output() cancelled: EventEmitter<any> = new EventEmitter<any>();\n\n isWorking!: boolean;\n\n constructor(\n formValidatorService: FormValidatorService,\n private formBuilder: FormBuilder,\n private stockReceiptService: StockReceiptService,\n private alertService: AlertService,\n private dateUtils: DateUtils\n ) {\n super(formValidatorService);\n this.errorMessages = {\n date: {\n required: \"The date field is required.\",\n },\n quantity: {\n required: \"The quantity field is required.\",\n },\n purchase_price: {\n required: \"The purchase price field is required.\",\n },\n };\n\n this.form = this.formBuilder.group({\n id: [\"\"],\n supplier_id: [\"\"],\n date: [new Date(), Validators.required],\n quantity: [1, Validators.required],\n purchase_price: [0, Validators.required],\n amount: [0],\n particulars: [\"\"],\n });\n }\n\n ngOnInit() {\n this.form\n .get(\"quantity\")\n ?.valueChanges.pipe(debounceTime(500))\n .subscribe(() => this.updateTotalAmount());\n this.form\n .get(\"purchase_price\")\n ?.valueChanges.pipe(debounceTime(500))\n .subscribe(() => this.updateTotalAmount());\n\n if (this.stockReceipt) {\n let data: any = { ...this.stockReceipt };\n if (data.date) {\n data.date = new Date(data.date);\n }\n this.form.patchValue(data);\n } else {\n // on create for set default quantity and purchase price from last record\n if (this.product?.last_stock_receipt) {\n const { quantity, purchase_price } = this.product.last_stock_receipt;\n this.form.patchValue({\n quantity,\n purchase_price,\n });\n }\n }\n }\n\n save() {\n if (this.form.invalid) {\n this.alertService.addAlert(\"Please check the form for errors\", \"error\");\n return;\n }\n const data: any = {\n product_id: this.product?.id,\n ...this.form.value,\n };\n if (data.date) {\n data.date = this.dateUtils.getYYYYMMDDString(data.date);\n }\n this.isWorking = true;\n let request: Observable<any> = this.stockReceiptService.store(data);\n if (this.stockReceipt?.id) {\n request = this.stockReceiptService.update(data);\n }\n request.subscribe({\n next: (response: any) => {\n this.isWorking = false;\n this.saved.emit(response?.item);\n this.alertService.addAlert(\n \"Stock Receipt Saved Successfully!\",\n \"success\"\n );\n },\n error: () => (this.isWorking = false),\n });\n }\n\n private updateTotalAmount() {\n const { purchase_price, quantity } = this.form.value;\n const amount: any = parseFloat(purchase_price) * parseFloat(quantity) || 0;\n this.form.get(\"amount\")?.setValue(amount);\n }\n}\n","<h3 class=\"text-center\">\n {{ stockReceipt?.id ? \"Edit\" : \"Receive\" }} Stock for {{ product?.name }}\n</h3>\n<form\n [formGroup]=\"form\"\n class=\"d-flex flex-column gap-1 justify-content-start\"\n (submit)=\"save()\"\n>\n <app-payee-selector\n label=\"Supplier\"\n formControlName=\"supplier_id\"\n appearance=\"fill\"\n [showAddButton]=\"true\"\n ></app-payee-selector>\n\n <mat-form-field>\n <mat-label>Date</mat-label>\n <input\n matInput\n [matDatepicker]=\"datePicker\"\n formControlName=\"date\"\n (focus)=\"datePicker.open()\"\n />\n <mat-datepicker #datePicker></mat-datepicker>\n <mat-error *ngIf=\"isFieldValid('date')\">\n {{ getErrorMessage(\"date\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" type=\"number\" min=\"0\" />\n <mat-error *ngIf=\"isFieldValid('quantity')\">\n {{ getErrorMessage(\"quantity\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Purchase Price</mat-label>\n <input matInput formControlName=\"purchase_price\" type=\"number\" min=\"0\" />\n <mat-error *ngIf=\"isFieldValid('purchase_price')\">\n {{ getErrorMessage(\"purchase_price\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Total Value</mat-label>\n <input matInput formControlName=\"amount\" readonly type=\"number\" min=\"0\" />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Particulars</mat-label>\n <textarea matInput formControlName=\"particulars\" rows=\"3\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2\">\n <button\n [disabled]=\"isWorking\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\"\n >\n Save\n </button>\n <button\n [disabled]=\"isWorking\"\n (click)=\"cancelled.emit()\"\n mat-flat-button\n type=\"button\"\n >\n Cancel\n </button>\n </div>\n</form>\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n} from \"@angular/core\";\nimport { MatDialog, MatDialogRef } from \"@angular/material/dialog\";\n\n@Component({\n selector: \"app-stock-receipt-form-button\",\n templateUrl: \"./stock-receipt-form-button.component.html\",\n styleUrls: [\"./stock-receipt-form-button.component.scss\"],\n})\nexport class StockReceiptFormButtonComponent {\n @Input() product: any;\n @Input() stockReceipt: any;\n @Input() icon!: string | null;\n @Output() saved: EventEmitter<any> = new EventEmitter<any>();\n\n matDialogRef!: MatDialogRef<any>;\n\n constructor(private matDialog: MatDialog) {}\n\n showStockReceiptForm(templateRef: TemplateRef<any>) {\n this.matDialogRef = this.matDialog.open(templateRef, { width: \"500px\" });\n }\n\n onStockReceiptSaved(item: any) {\n this.matDialogRef.close();\n this.saved.emit(item);\n }\n}\n","<span\n class=\"material-symbols-outlined cursor-pointer\"\n [class.text-primary]=\"icon\"\n matTooltip=\"Stock Receipt\"\n (click)=\"showStockReceiptForm(stockReceiptFormTemplate)\"\n>\n {{ stockReceipt ? \"edit\" : icon ?? \"download\" }}\n</span>\n\n<ng-template #stockReceiptFormTemplate>\n <app-stock-receipt-form\n mat-dialog-content\n [product]=\"product\"\n [stockReceipt]=\"stockReceipt\"\n (cancelled)=\"matDialogRef.close()\"\n (saved)=\"onStockReceiptSaved($event)\"\n ></app-stock-receipt-form>\n</ng-template>\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { PayeeSelectorComponent } from \"./payee-selector/payee-selector.component\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { FormsModule, ReactiveFormsModule } from \"@angular/forms\";\nimport { SearchableSelectorModule } from \"ngx-techlify-core\";\n\n@NgModule({\n declarations: [PayeeSelectorComponent],\n exports: [PayeeSelectorComponent],\n imports: [\n CommonModule,\n MatFormFieldModule,\n ReactiveFormsModule,\n SearchableSelectorModule,\n FormsModule,\n ],\n})\nexport class PayeeSelectorModule {}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { StockReceiptFormComponent } from \"./stock-receipt-form/stock-receipt-form.component\";\nimport { StockReceiptFormButtonComponent } from \"./stock-receipt-form-button/stock-receipt-form-button.component\";\nimport { MatTooltipModule } from \"@angular/material/tooltip\";\nimport { MatDialogModule } from \"@angular/material/dialog\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { MatInputModule } from \"@angular/material/input\";\nimport { MatDatepickerModule } from \"@angular/material/datepicker\";\nimport { MatButtonModule } from \"@angular/material/button\";\nimport { PayeeSelectorModule } from '../../supplier/payee-selector/payee-selector.module';\n\n@NgModule({\n declarations: [StockReceiptFormComponent, StockReceiptFormButtonComponent],\n exports: [StockReceiptFormButtonComponent],\n imports: [\n CommonModule,\n MatTooltipModule,\n MatDialogModule,\n PayeeSelectorModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n MatInputModule,\n MatDatepickerModule,\n MatButtonModule,\n ],\n})\nexport class StockReceiptFormModule {}\n"],"names":["i1","i2","i3","i4","i3.StockReceiptService","i5.PayeeSelectorComponent","i8","i9","i3.StockReceiptFormComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAMM,MAAO,mBAAoB,SAAQ,wBAAwB,CAAA;AAC/D,IAAA,WAAA,CAAY,WAAwB,EAAA;AAClC,QAAA,KAA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+B,aAGvE,YAAY;YACZ,gBAAgB;YAChB,eAAe;YACf,mBAAmB;YACnB,mBAAmB;YACnB,kBAAkB;YAClB,cAAc;YACd,mBAAmB;AACnB,YAAA,eAAe,aAVP,+BAA+B,CAAA,EAAA,CAAA;AAa9B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAX/B,YAAY;YACZ,gBAAgB;YAChB,eAAe;YACf,mBAAmB;YACnB,mBAAmB;YACnB,kBAAkB;YAClB,cAAc;YACd,mBAAmB;YACnB,eAAe,CAAA,EAAA,CAAA;;4FAGN,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAflC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,yBAAyB,EAAE,+BAA+B,CAAC;oBAC1E,OAAO,EAAE,CAAC,+BAA+B,CAAC;AAC1C,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,gBAAgB;wBAChB,eAAe;wBACf,mBAAmB;wBACnB,mBAAmB;wBACnB,kBAAkB;wBAClB,cAAc;wBACd,mBAAmB;wBACnB,eAAe;AAChB,qBAAA;AACF,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"techlify-inventory-common-stock-receipt-form.module-DND0GNlf.mjs","sources":["../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt.service.ts","../../../projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.ts","../../../projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.html","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.html","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.html","../../../projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector.module.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { HttpService, TechlifyServiceBaseClass } from \"ngx-techlify-core\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class StockReceiptService extends TechlifyServiceBaseClass {\n constructor(httpService: HttpService) {\n super(httpService, \"stock-receipts\");\n }\n}\n","import { Component, forwardRef, Input, OnInit } from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { SupplierFormComponent } from \"../../supplier-form/supplier-form.component\";\nimport { MatFormFieldAppearance } from \"@angular/material/form-field\";\n\n@Component({\n selector: \"app-payee-selector\",\n templateUrl: \"./payee-selector.component.html\",\n styleUrls: [\"./payee-selector.component.scss\"],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => PayeeSelectorComponent),\n multi: true,\n },\n ],\n})\nexport class PayeeSelectorComponent implements ControlValueAccessor {\n @Input() label = \"Payee\";\n @Input() appearance: MatFormFieldAppearance = \"fill\";\n @Input() required: boolean = false;\n @Input() showAddButton: boolean = false;\n @Input() multiple: boolean = false;\n\n value: any;\n onChange: any = () => {};\n onTouch: any = () => {};\n\n writeValue(value: any): void {\n this.value = value;\n this.onChange(value);\n this.onTouch(value);\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouch = fn;\n }\n\n protected readonly SupplierFormComponent = SupplierFormComponent;\n}\n","<mat-form-field [appearance]=\"appearance\" class=\"w-100\">\n <mat-label>{{ label }}</mat-label>\n <app-searchable-selector\n apiUrl=\"api/suppliers\"\n titleField=\"company_name\"\n sortBy=\"company_name|asc\"\n [required]=\"required\"\n [(ngModel)]=\"value\"\n #payeeSelector=\"ngModel\"\n name=\"payeeSelector\"\n [add]=\"showAddButton\"\n [itemComponent]=\"SupplierFormComponent\"\n (ngModelChange)=\"onChange($event)\"\n [addConfig]=\"{ width: '600px' }\"\n [ngModelOptions]=\"{ standalone: true }\"\n [multiple]=\"multiple\"\n >\n </app-searchable-selector>\n <mat-error *ngIf=\"payeeSelector.invalid && payeeSelector.touched\">\n The payee field is required.\n </mat-error>\n</mat-form-field>\n","import { Component, EventEmitter, Input, OnInit, Output } from \"@angular/core\";\nimport {\n AlertService,\n DateUtils,\n FormValidatorService,\n TechlifyFormComponentInterface,\n} from \"ngx-techlify-core\";\nimport { FormBuilder, Validators } from \"@angular/forms\";\nimport { StockReceiptService } from \"../../stock-receipt.service\";\nimport { debounceTime, Observable } from \"rxjs\";\n\n@Component({\n selector: \"app-stock-receipt-form\",\n templateUrl: \"./stock-receipt-form.component.html\",\n styleUrls: [\"./stock-receipt-form.component.scss\"],\n})\nexport class StockReceiptFormComponent\n extends TechlifyFormComponentInterface\n implements OnInit\n{\n @Input() product: any;\n @Input() stockReceipt: any;\n @Output() saved: EventEmitter<any> = new EventEmitter<any>();\n @Output() cancelled: EventEmitter<any> = new EventEmitter<any>();\n\n isWorking!: boolean;\n\n constructor(\n formValidatorService: FormValidatorService,\n private formBuilder: FormBuilder,\n private stockReceiptService: StockReceiptService,\n private alertService: AlertService,\n private dateUtils: DateUtils\n ) {\n super(formValidatorService);\n this.errorMessages = {\n date: {\n required: \"The date field is required.\",\n },\n quantity: {\n required: \"The quantity field is required.\",\n },\n purchase_price: {\n required: \"The purchase price field is required.\",\n },\n };\n\n this.form = this.formBuilder.group({\n id: [\"\"],\n supplier_id: [\"\"],\n date: [new Date(), Validators.required],\n quantity: [1, Validators.required],\n purchase_price: [0, Validators.required],\n amount: [0],\n particulars: [\"\"],\n });\n }\n\n ngOnInit() {\n this.form\n .get(\"quantity\")\n ?.valueChanges.pipe(debounceTime(500))\n .subscribe(() => this.updateTotalAmount());\n this.form\n .get(\"purchase_price\")\n ?.valueChanges.pipe(debounceTime(500))\n .subscribe(() => this.updateTotalAmount());\n\n if (this.stockReceipt) {\n let data: any = { ...this.stockReceipt };\n if (data.date) {\n data.date = new Date(data.date);\n }\n this.form.patchValue(data);\n } else {\n // on create for set default quantity and purchase price from last record\n if (this.product?.last_stock_receipt) {\n const { quantity, purchase_price } = this.product.last_stock_receipt;\n this.form.patchValue({\n quantity,\n purchase_price,\n });\n }\n }\n }\n\n save() {\n if (this.form.invalid) {\n this.alertService.addAlert(\"Please check the form for errors\", \"error\");\n return;\n }\n const data: any = {\n product_id: this.product?.id,\n ...this.form.value,\n };\n if (data.date) {\n data.date = this.dateUtils.getYYYYMMDDString(data.date);\n }\n this.isWorking = true;\n let request: Observable<any> = this.stockReceiptService.store(data);\n if (this.stockReceipt?.id) {\n request = this.stockReceiptService.update(data);\n }\n request.subscribe({\n next: (response: any) => {\n this.isWorking = false;\n this.saved.emit(response?.item);\n this.alertService.addAlert(\n \"Stock Receipt Saved Successfully!\",\n \"success\"\n );\n },\n error: () => (this.isWorking = false),\n });\n }\n\n private updateTotalAmount() {\n const { purchase_price, quantity } = this.form.value;\n const amount: any = parseFloat(purchase_price) * parseFloat(quantity) || 0;\n this.form.get(\"amount\")?.setValue(amount);\n }\n}\n","<h3 class=\"text-center\">\n {{ stockReceipt?.id ? \"Edit\" : \"Receive\" }} Stock for {{ product?.name }}\n</h3>\n<form\n [formGroup]=\"form\"\n class=\"d-flex flex-column gap-1 justify-content-start\"\n (submit)=\"save()\"\n>\n <app-payee-selector\n label=\"Supplier\"\n formControlName=\"supplier_id\"\n appearance=\"fill\"\n [showAddButton]=\"true\"\n ></app-payee-selector>\n\n <mat-form-field>\n <mat-label>Date</mat-label>\n <input\n matInput\n [matDatepicker]=\"datePicker\"\n formControlName=\"date\"\n (focus)=\"datePicker.open()\"\n />\n <mat-datepicker #datePicker></mat-datepicker>\n <mat-error *ngIf=\"isFieldValid('date')\">\n {{ getErrorMessage(\"date\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" type=\"number\" min=\"0\" />\n <mat-error *ngIf=\"isFieldValid('quantity')\">\n {{ getErrorMessage(\"quantity\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Purchase Price</mat-label>\n <input matInput formControlName=\"purchase_price\" type=\"number\" min=\"0\" />\n <mat-error *ngIf=\"isFieldValid('purchase_price')\">\n {{ getErrorMessage(\"purchase_price\") }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Total Value</mat-label>\n <input matInput formControlName=\"amount\" readonly type=\"number\" min=\"0\" />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Particulars</mat-label>\n <textarea matInput formControlName=\"particulars\" rows=\"3\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2\">\n <button\n [disabled]=\"isWorking\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\"\n >\n Save\n </button>\n <button\n [disabled]=\"isWorking\"\n (click)=\"cancelled.emit()\"\n mat-flat-button\n type=\"button\"\n >\n Cancel\n </button>\n </div>\n</form>\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n} from \"@angular/core\";\nimport { MatDialog, MatDialogRef } from \"@angular/material/dialog\";\n\n@Component({\n selector: \"app-stock-receipt-form-button\",\n templateUrl: \"./stock-receipt-form-button.component.html\",\n styleUrls: [\"./stock-receipt-form-button.component.scss\"],\n})\nexport class StockReceiptFormButtonComponent {\n @Input() product: any;\n @Input() stockReceipt: any;\n @Input() icon!: string | null;\n @Output() saved: EventEmitter<any> = new EventEmitter<any>();\n\n matDialogRef!: MatDialogRef<any>;\n\n constructor(private matDialog: MatDialog) {}\n\n showStockReceiptForm(templateRef: TemplateRef<any>) {\n this.matDialogRef = this.matDialog.open(templateRef, { width: \"500px\" });\n }\n\n onStockReceiptSaved(item: any) {\n this.matDialogRef.close();\n this.saved.emit(item);\n }\n}\n","<span\n class=\"material-symbols-outlined cursor-pointer\"\n [class.text-primary]=\"icon\"\n matTooltip=\"Stock Receipt\"\n (click)=\"showStockReceiptForm(stockReceiptFormTemplate)\"\n>\n {{ stockReceipt ? \"edit\" : icon ?? \"download\" }}\n</span>\n\n<ng-template #stockReceiptFormTemplate>\n <app-stock-receipt-form\n mat-dialog-content\n [product]=\"product\"\n [stockReceipt]=\"stockReceipt\"\n (cancelled)=\"matDialogRef.close()\"\n (saved)=\"onStockReceiptSaved($event)\"\n ></app-stock-receipt-form>\n</ng-template>\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { PayeeSelectorComponent } from \"./payee-selector/payee-selector.component\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { FormsModule, ReactiveFormsModule } from \"@angular/forms\";\nimport { SearchableSelectorModule } from \"ngx-techlify-core\";\n\n@NgModule({\n declarations: [PayeeSelectorComponent],\n exports: [PayeeSelectorComponent],\n imports: [\n CommonModule,\n MatFormFieldModule,\n ReactiveFormsModule,\n SearchableSelectorModule,\n FormsModule,\n ],\n})\nexport class PayeeSelectorModule {}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { StockReceiptFormComponent } from \"./stock-receipt-form/stock-receipt-form.component\";\nimport { StockReceiptFormButtonComponent } from \"./stock-receipt-form-button/stock-receipt-form-button.component\";\nimport { MatTooltipModule } from \"@angular/material/tooltip\";\nimport { MatDialogModule } from \"@angular/material/dialog\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { MatInputModule } from \"@angular/material/input\";\nimport { MatDatepickerModule } from \"@angular/material/datepicker\";\nimport { MatButtonModule } from \"@angular/material/button\";\nimport { PayeeSelectorModule } from '../../supplier/payee-selector/payee-selector.module';\n\n@NgModule({\n declarations: [StockReceiptFormComponent, StockReceiptFormButtonComponent],\n exports: [StockReceiptFormButtonComponent],\n imports: [\n CommonModule,\n MatTooltipModule,\n MatDialogModule,\n PayeeSelectorModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n MatInputModule,\n MatDatepickerModule,\n MatButtonModule,\n ],\n})\nexport class StockReceiptFormModule {}\n"],"names":["i1","i2","i3","i4","i3.StockReceiptService","i5.PayeeSelectorComponent","i8","i9","i3.StockReceiptFormComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAMM,MAAO,mBAAoB,SAAQ,wBAAwB,CAAA;AAC/D,IAAA,WAAA,CAAY,WAAwB,EAAA;AAClC,QAAA,KAAK,CAAC,WAAW,EAAE,gBAAgB,CAAC;;wGAF3B,mBAAmB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA;;4FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;MCYY,sBAAsB,CAAA;IACxB,KAAK,GAAG,OAAO;IACf,UAAU,GAA2B,MAAM;IAC3C,QAAQ,GAAY,KAAK;IACzB,aAAa,GAAY,KAAK;IAC9B,QAAQ,GAAY,KAAK;AAElC,IAAA,KAAK;AACL,IAAA,QAAQ,GAAQ,MAAK,GAAG;AACxB,IAAA,OAAO,GAAQ,MAAK,GAAG;AAEvB,IAAA,UAAU,CAAC,KAAU,EAAA;AACnB,QAA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ACnB,eAAe;AAChB,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -9,12 +9,12 @@ import * as i1$1 from 'ngx-techlify-core';
|
|
|
9
9
|
import { TechlifyListingControllerInterface, Timeline, SearchableSelectorModule, TimelineFilterModule, MaterialModule } from 'ngx-techlify-core';
|
|
10
10
|
import { UntilDestroy } from '@ngneat/until-destroy';
|
|
11
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-
|
|
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
13
|
import * as i2 from '@angular/forms';
|
|
14
14
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
15
15
|
import * as i3 from '@angular/material/card';
|
|
16
16
|
import { MatCardModule } from '@angular/material/card';
|
|
17
|
-
import { T as TechlifyFilterComponent, a as TechlifyFilterModule } from './techlify-inventory-common-techlify-inventory-common-
|
|
17
|
+
import { T as TechlifyFilterComponent, a as TechlifyFilterModule } from './techlify-inventory-common-techlify-inventory-common-GFYF7JCA.mjs';
|
|
18
18
|
import * as i6 from '@angular/material/table';
|
|
19
19
|
import { MatTableModule } from '@angular/material/table';
|
|
20
20
|
import * as i7$1 from '@angular/material/progress-bar';
|
|
@@ -250,4 +250,4 @@ var stockReceipts_module = /*#__PURE__*/Object.freeze({
|
|
|
250
250
|
});
|
|
251
251
|
|
|
252
252
|
export { StockReceiptsListPageComponent as S, StockReceiptsModule as a, stockReceipts_module as s };
|
|
253
|
-
//# sourceMappingURL=techlify-inventory-common-stock-receipts.module-
|
|
253
|
+
//# sourceMappingURL=techlify-inventory-common-stock-receipts.module-BvYaKITT.mjs.map
|
|
@@ -1 +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,OAAO,GAAsB,IAAI,YAAY,EAAO;IAC9D,UAAU,GAAY,KAAK;AAE3B,IAAA,WAAA,CACU,SAAoB,EACpB,mBAAwC,EACxC,YAA0B,EAAA;QAF1B,IAAS,CAAA,SAAA,GAAT,SAAS;QACT,IAAmB,CAAA,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AE;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
|
+
{"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":";;;;;;;;;;;;;;;;;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pB,oBAAoB;YACpB,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;;;;;;;;;;"}
|
|
@@ -0,0 +1,177 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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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