techlify-inventory-common 18.47.0 → 18.48.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.
Files changed (52) hide show
  1. package/esm2022/lib/inventory-common/inventory-common-routing.module.mjs +5 -1
  2. package/esm2022/lib/inventory-common/location/location-selector/location-selector.component.mjs +5 -4
  3. package/esm2022/lib/inventory-common/recipient/recipient-form/recipient-form.component.mjs +59 -0
  4. package/esm2022/lib/inventory-common/recipient/recipient-list/recipient-list.component.mjs +49 -0
  5. package/esm2022/lib/inventory-common/recipient/recipient-routing.module.mjs +24 -0
  6. package/esm2022/lib/inventory-common/recipient/recipient.module.mjs +18 -0
  7. package/esm2022/lib/inventory-common/recipient/recipient.service.mjs +18 -0
  8. package/esm2022/lib/inventory-common/reports/stock-issue-summary-report/stock-issue-summary-report.component.mjs +31 -32
  9. package/esm2022/lib/inventory-common/shared.module.mjs +9 -2
  10. package/esm2022/lib/inventory-common/stock-issue/stock-issue-form/stock-issue-form.component.mjs +29 -19
  11. package/esm2022/lib/inventory-common/stock-issue/stock-issue-list/stock-issue-list.component.mjs +6 -7
  12. package/esm2022/lib/inventory-common/stock-issue/stock-issue-page/stock-issue-page.component.mjs +3 -3
  13. package/esm2022/lib/inventory-common/stock-issue/stock-issue-product-form/stock-issue-product-form.component.mjs +6 -6
  14. package/esm2022/lib/inventory-common/stock-issue/stock-issue-products-list/stock-issue-products-list.component.mjs +7 -7
  15. package/esm2022/lib/inventory-common/stock-issue/stock-issue-single-product-form/stock-issue-single-product-form.component.mjs +38 -17
  16. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.component.mjs +2 -2
  17. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-list/stock-receipt-list.component.mjs +5 -5
  18. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-product-list/stock-receipt-product-list.component.mjs +6 -6
  19. package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-single-product-form/stock-receipt-simple-form/stock-receipt-single-product-form.component.mjs +2 -2
  20. package/fesm2022/{techlify-inventory-common-category.module-BL0mKMMU.mjs → techlify-inventory-common-category.module-VjAS4ehQ.mjs} +8 -8
  21. package/fesm2022/{techlify-inventory-common-category.module-BL0mKMMU.mjs.map → techlify-inventory-common-category.module-VjAS4ehQ.mjs.map} +1 -1
  22. package/fesm2022/{techlify-inventory-common-purchase-order-view.component-BDdTC81P.mjs → techlify-inventory-common-purchase-order-view.component-D5GrUK-m.mjs} +8 -8
  23. package/fesm2022/{techlify-inventory-common-purchase-order-view.component-BDdTC81P.mjs.map → techlify-inventory-common-purchase-order-view.component-D5GrUK-m.mjs.map} +1 -1
  24. package/fesm2022/techlify-inventory-common-recipient.module-BnRAWk8N.mjs +147 -0
  25. package/fesm2022/techlify-inventory-common-recipient.module-BnRAWk8N.mjs.map +1 -0
  26. package/fesm2022/techlify-inventory-common-stock-issue-form.component-B-aNyhLA.mjs +194 -0
  27. package/fesm2022/techlify-inventory-common-stock-issue-form.component-B-aNyhLA.mjs.map +1 -0
  28. package/fesm2022/{techlify-inventory-common-stock-issue-product-view.component-Di1fJWqD.mjs → techlify-inventory-common-stock-issue-product-view.component-BP2yFaQn.mjs} +2 -2
  29. package/fesm2022/{techlify-inventory-common-stock-issue-product-view.component-Di1fJWqD.mjs.map → techlify-inventory-common-stock-issue-product-view.component-BP2yFaQn.mjs.map} +1 -1
  30. package/fesm2022/{techlify-inventory-common-stock-issue-view.component-DfntkifG.mjs → techlify-inventory-common-stock-issue-view.component-DHdnoIR8.mjs} +2 -2
  31. package/fesm2022/{techlify-inventory-common-stock-issue-view.component-DfntkifG.mjs.map → techlify-inventory-common-stock-issue-view.component-DHdnoIR8.mjs.map} +1 -1
  32. package/fesm2022/{techlify-inventory-common-techlify-inventory-common-BbtWdC-G.mjs → techlify-inventory-common-techlify-inventory-common-DuAN6iqX.mjs} +148 -117
  33. package/fesm2022/techlify-inventory-common-techlify-inventory-common-DuAN6iqX.mjs.map +1 -0
  34. package/fesm2022/techlify-inventory-common.mjs +1 -1
  35. package/lib/inventory-common/location/location-selector/location-selector.component.d.ts +2 -1
  36. package/lib/inventory-common/recipient/recipient-form/recipient-form.component.d.ts +21 -0
  37. package/lib/inventory-common/recipient/recipient-list/recipient-list.component.d.ts +16 -0
  38. package/lib/inventory-common/recipient/recipient-routing.module.d.ts +7 -0
  39. package/lib/inventory-common/recipient/recipient.module.d.ts +9 -0
  40. package/lib/inventory-common/recipient/recipient.service.d.ts +7 -0
  41. package/lib/inventory-common/reports/stock-issue-summary-report/stock-issue-summary-report.component.d.ts +4 -10
  42. package/lib/inventory-common/shared.module.d.ts +4 -3
  43. package/lib/inventory-common/stock-issue/stock-issue-form/stock-issue-form.component.d.ts +5 -3
  44. package/lib/inventory-common/stock-issue/stock-issue-list/stock-issue-list.component.d.ts +2 -2
  45. package/lib/inventory-common/stock-issue/stock-issue-products-list/stock-issue-products-list.component.d.ts +2 -2
  46. package/lib/inventory-common/stock-issue/stock-issue-single-product-form/stock-issue-single-product-form.component.d.ts +5 -3
  47. package/lib/inventory-common/stock-receipts/stock-receipt-list/stock-receipt-list.component.d.ts +2 -2
  48. package/lib/inventory-common/stock-receipts/stock-receipt-product-list/stock-receipt-product-list.component.d.ts +2 -2
  49. package/package.json +1 -1
  50. package/fesm2022/techlify-inventory-common-stock-issue-form.component-B-5myP-N.mjs +0 -183
  51. package/fesm2022/techlify-inventory-common-stock-issue-form.component-B-5myP-N.mjs.map +0 -1
  52. package/fesm2022/techlify-inventory-common-techlify-inventory-common-BbtWdC-G.mjs.map +0 -1
@@ -0,0 +1,147 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, Inject, Optional, signal, NgModule } from '@angular/core';
3
+ import * as i1$2 from '@angular/router';
4
+ import { RouterModule } from '@angular/router';
5
+ import * as i1 from 'ngx-techlify-core';
6
+ import { TechlifyService, TechlifyFormComponent, TechlifyListComponent } from 'ngx-techlify-core';
7
+ import * as i2 from '@angular/forms';
8
+ import { Validators } from '@angular/forms';
9
+ import * as i1$1 from '@angular/material/dialog';
10
+ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
11
+ import { S as SharedModule } from './techlify-inventory-common-techlify-inventory-common-DuAN6iqX.mjs';
12
+ import * as i3 from '@angular/common';
13
+ import * as i6 from '@angular/material/button';
14
+ import * as i4 from '@angular/material/card';
15
+ import * as i8 from '@angular/material/form-field';
16
+ import * as i8$1 from '@angular/material/input';
17
+ import * as i11 from 'ngx-infinite-scroll';
18
+ import * as i5 from '@angular/material/progress-bar';
19
+ import * as i10 from '@angular/material/sort';
20
+ import * as i8$2 from '@angular/material/table';
21
+ import * as i13 from 'ngx-permissions';
22
+
23
+ class RecipientService extends TechlifyService {
24
+ constructor(httpService) {
25
+ super(httpService, 'recipients');
26
+ }
27
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientService, deps: [{ token: i1.HttpService }], target: i0.ɵɵFactoryTarget.Injectable });
28
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientService, providedIn: 'root' });
29
+ }
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientService, decorators: [{
31
+ type: Injectable,
32
+ args: [{
33
+ providedIn: 'root',
34
+ }]
35
+ }], ctorParameters: () => [{ type: i1.HttpService }] });
36
+
37
+ class RecipientFormComponent extends TechlifyFormComponent {
38
+ formValidatorService;
39
+ formBuilder;
40
+ service;
41
+ dialogRef;
42
+ data;
43
+ constructor(formValidatorService, formBuilder, service, dialogRef, data) {
44
+ super(formValidatorService, service);
45
+ this.formValidatorService = formValidatorService;
46
+ this.formBuilder = formBuilder;
47
+ this.service = service;
48
+ this.dialogRef = dialogRef;
49
+ this.data = data;
50
+ this.errorMessages = {
51
+ name: {
52
+ required: 'The name field is required.',
53
+ },
54
+ };
55
+ this.form = this.formBuilder.group({
56
+ id: [''],
57
+ name: ['', Validators.required],
58
+ details: [''],
59
+ });
60
+ }
61
+ ngOnInit() {
62
+ const model = this.data?.model;
63
+ if (model) {
64
+ this.isUpdate = true;
65
+ this.form.patchValue(model);
66
+ }
67
+ }
68
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientFormComponent, deps: [{ token: i1.FormValidatorService }, { token: i2.FormBuilder }, { token: RecipientService }, { token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA, optional: true }], target: i0.ɵɵFactoryTarget.Component });
69
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: RecipientFormComponent, isStandalone: true, selector: "app-recipient-form", usesInheritance: true, ngImport: i0, template: "<mat-card-title class=\"d-flex flex-row justify-content-center align-items-center\">\n Recipient Form\n</mat-card-title>\n<mat-card-content>\n <form class=\"d-flex flex-column gap-3\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"w-100\">\n <mat-label>Name</mat-label>\n <input matInput formControlName=\"name\" required />\n <mat-error *ngIf=\"isFieldValid('name')\">{{ getErrorMessage('name') }}</mat-error>\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Details</mat-label>\n <textarea matInput formControlName=\"details\" rows=\"3\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end gap-2\">\n <button type=\"button\" mat-flat-button [disabled]=\"isWorking\" (click)=\"dialogRef.close()\">Cancel</button>\n <button type=\"submit\" mat-raised-button color=\"primary\" [disabled]=\"isWorking\">Save</button>\n </div>\n </form>\n</mat-card-content>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: SharedModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i4.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i8.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i8$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: "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 });
70
+ }
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientFormComponent, decorators: [{
72
+ type: Component,
73
+ args: [{ selector: 'app-recipient-form', standalone: true, imports: [SharedModule], template: "<mat-card-title class=\"d-flex flex-row justify-content-center align-items-center\">\n Recipient Form\n</mat-card-title>\n<mat-card-content>\n <form class=\"d-flex flex-column gap-3\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"w-100\">\n <mat-label>Name</mat-label>\n <input matInput formControlName=\"name\" required />\n <mat-error *ngIf=\"isFieldValid('name')\">{{ getErrorMessage('name') }}</mat-error>\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Details</mat-label>\n <textarea matInput formControlName=\"details\" rows=\"3\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end gap-2\">\n <button type=\"button\" mat-flat-button [disabled]=\"isWorking\" (click)=\"dialogRef.close()\">Cancel</button>\n <button type=\"submit\" mat-raised-button color=\"primary\" [disabled]=\"isWorking\">Save</button>\n </div>\n </form>\n</mat-card-content>\n" }]
74
+ }], ctorParameters: () => [{ type: i1.FormValidatorService }, { type: i2.FormBuilder }, { type: RecipientService }, { type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
75
+ type: Inject,
76
+ args: [MAT_DIALOG_DATA]
77
+ }, {
78
+ type: Optional
79
+ }] }] });
80
+
81
+ class RecipientListComponent extends TechlifyListComponent {
82
+ fb;
83
+ service;
84
+ recipientForm = signal(RecipientFormComponent);
85
+ displayedColumns = [
86
+ '#',
87
+ 'name',
88
+ 'details',
89
+ 'actions'
90
+ ];
91
+ constructor(fb, service) {
92
+ super(service);
93
+ this.fb = fb;
94
+ this.service = service;
95
+ this.filterFormConfiguration = {};
96
+ this.filterForm = this.fb.group({
97
+ search: [''],
98
+ sort_by: ['created_at|desc'],
99
+ });
100
+ }
101
+ ngOnInit() {
102
+ this.patchFiltersFromRoute();
103
+ this.loadData();
104
+ this.listenFilterChanges();
105
+ }
106
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientListComponent, deps: [{ token: i2.FormBuilder }, { token: RecipientService }], target: i0.ɵɵFactoryTarget.Component });
107
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: RecipientListComponent, selector: "app-recipient-list", usesInheritance: true, ngImport: i0, template: "<div class=\"d-flex flex-column gap-2\">\n <mat-card>\n <mat-card-content class=\"d-flex flex-row justify-content-between align-items-center\">\n <div class=\"d-flex flex-row align-items-center gap-2\">\n <h5 class=\"mb-0\">Recipients</h5>\n <app-techlify-form-button *ngxPermissionsOnly=\"['recipient.create']\" [component]=\"recipientForm()\"\n [width]=\"'500px'\" (saved)=\"modelCreated($event)\"></app-techlify-form-button>\n </div>\n <div class=\"d-flex flex-row gap-2\" [formGroup]=\"filterForm\">\n <mat-form-field class=\"fl-md\">\n <mat-label>Search</mat-label>\n <input matInput formControlName=\"search\" />\n </mat-form-field>\n </div>\n </mat-card-content>\n </mat-card>\n\n <mat-card>\n <mat-card-content>\n <table mat-table [dataSource]=\"models\" class=\"w-100\" aria-describedby=\"Recipients\" infiniteScroll\n [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" matSort\n (matSortChange)=\"sortColumn($event)\">\n <ng-container matColumnDef=\"#\">\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 <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.name }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"details\">\n <th mat-header-cell *matHeaderCellDef>Details</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.details }}</td>\n </ng-container>\n\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 flex-row gap-1 align-items-center text-secondary\">\n <app-techlify-form-button *ngxPermissionsOnly=\"['recipient.update']\" [component]=\"recipientForm()\"\n [model]=\"element\" [width]=\"'500px'\" (saved)=\"modelsUpdatedById($event)\"></app-techlify-form-button>\n <app-techlify-delete-button *ngxPermissionsOnly=\"['recipient.delete']\" [service]=\"service\"\n [model]=\"element\" [data]=\"{ type: 'Recipient', title: element?.name }\"\n (deleted)=\"modelsDeletedById($event)\"></app-techlify-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 <mat-progress-bar *ngIf=\"isWorking\" mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-content>\n </mat-card>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i11.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i4.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i8$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: i5.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i10.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i10.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i8$2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8$2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8$2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8$2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8$2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8$2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8$2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8$2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8$2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8$2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i13.NgxPermissionsDirective, selector: "[ngxPermissionsOnly],[ngxPermissionsExcept]", inputs: ["ngxPermissionsOnly", "ngxPermissionsOnlyThen", "ngxPermissionsOnlyElse", "ngxPermissionsExcept", "ngxPermissionsExceptElse", "ngxPermissionsExceptThen", "ngxPermissionsThen", "ngxPermissionsElse", "ngxPermissionsOnlyAuthorisedStrategy", "ngxPermissionsOnlyUnauthorisedStrategy", "ngxPermissionsExceptUnauthorisedStrategy", "ngxPermissionsExceptAuthorisedStrategy", "ngxPermissionsUnauthorisedStrategy", "ngxPermissionsAuthorisedStrategy"], outputs: ["permissionsAuthorized", "permissionsUnauthorized"] }, { 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.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1.TechlifyDeleteButtonComponent, selector: "app-techlify-delete-button", inputs: ["data", "model", "message", "service"], outputs: ["deleted"] }, { kind: "component", type: i1.TechlifyFormButtonComponent, selector: "app-techlify-form-button", inputs: ["component", "model", "data", "width"], outputs: ["saved"] }], preserveWhitespaces: true });
108
+ }
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientListComponent, decorators: [{
110
+ type: Component,
111
+ args: [{ selector: 'app-recipient-list', template: "<div class=\"d-flex flex-column gap-2\">\n <mat-card>\n <mat-card-content class=\"d-flex flex-row justify-content-between align-items-center\">\n <div class=\"d-flex flex-row align-items-center gap-2\">\n <h5 class=\"mb-0\">Recipients</h5>\n <app-techlify-form-button *ngxPermissionsOnly=\"['recipient.create']\" [component]=\"recipientForm()\"\n [width]=\"'500px'\" (saved)=\"modelCreated($event)\"></app-techlify-form-button>\n </div>\n <div class=\"d-flex flex-row gap-2\" [formGroup]=\"filterForm\">\n <mat-form-field class=\"fl-md\">\n <mat-label>Search</mat-label>\n <input matInput formControlName=\"search\" />\n </mat-form-field>\n </div>\n </mat-card-content>\n </mat-card>\n\n <mat-card>\n <mat-card-content>\n <table mat-table [dataSource]=\"models\" class=\"w-100\" aria-describedby=\"Recipients\" infiniteScroll\n [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" matSort\n (matSortChange)=\"sortColumn($event)\">\n <ng-container matColumnDef=\"#\">\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 <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.name }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"details\">\n <th mat-header-cell *matHeaderCellDef>Details</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.details }}</td>\n </ng-container>\n\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 flex-row gap-1 align-items-center text-secondary\">\n <app-techlify-form-button *ngxPermissionsOnly=\"['recipient.update']\" [component]=\"recipientForm()\"\n [model]=\"element\" [width]=\"'500px'\" (saved)=\"modelsUpdatedById($event)\"></app-techlify-form-button>\n <app-techlify-delete-button *ngxPermissionsOnly=\"['recipient.delete']\" [service]=\"service\"\n [model]=\"element\" [data]=\"{ type: 'Recipient', title: element?.name }\"\n (deleted)=\"modelsDeletedById($event)\"></app-techlify-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 <mat-progress-bar *ngIf=\"isWorking\" mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-content>\n </mat-card>\n</div>\n" }]
112
+ }], ctorParameters: () => [{ type: i2.FormBuilder }, { type: RecipientService }] });
113
+
114
+ const routes = [
115
+ {
116
+ path: '',
117
+ component: RecipientListComponent,
118
+ },
119
+ ];
120
+ class RecipientRoutingModule {
121
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
122
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: RecipientRoutingModule, imports: [i1$2.RouterModule], exports: [RouterModule] });
123
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
124
+ }
125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientRoutingModule, decorators: [{
126
+ type: NgModule,
127
+ args: [{
128
+ imports: [RouterModule.forChild(routes)],
129
+ exports: [RouterModule],
130
+ }]
131
+ }] });
132
+
133
+ class RecipientModule {
134
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
135
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: RecipientModule, declarations: [RecipientListComponent], imports: [RecipientRoutingModule, SharedModule] });
136
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientModule, imports: [RecipientRoutingModule, SharedModule] });
137
+ }
138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RecipientModule, decorators: [{
139
+ type: NgModule,
140
+ args: [{
141
+ declarations: [RecipientListComponent],
142
+ imports: [RecipientRoutingModule, SharedModule],
143
+ }]
144
+ }] });
145
+
146
+ export { RecipientModule };
147
+ //# sourceMappingURL=techlify-inventory-common-recipient.module-BnRAWk8N.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"techlify-inventory-common-recipient.module-BnRAWk8N.mjs","sources":["../../../projects/inventory-common/src/lib/inventory-common/recipient/recipient.service.ts","../../../projects/inventory-common/src/lib/inventory-common/recipient/recipient-form/recipient-form.component.ts","../../../projects/inventory-common/src/lib/inventory-common/recipient/recipient-form/recipient-form.component.html","../../../projects/inventory-common/src/lib/inventory-common/recipient/recipient-list/recipient-list.component.ts","../../../projects/inventory-common/src/lib/inventory-common/recipient/recipient-list/recipient-list.component.html","../../../projects/inventory-common/src/lib/inventory-common/recipient/recipient-routing.module.ts","../../../projects/inventory-common/src/lib/inventory-common/recipient/recipient.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HttpService, TechlifyService } from 'ngx-techlify-core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class RecipientService extends TechlifyService {\n constructor(httpService: HttpService) {\n super(httpService, 'recipients');\n }\n}\n","import { Component, Inject, OnInit, Optional } from '@angular/core';\nimport { FormBuilder, Validators } from '@angular/forms';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { FormValidatorService, TechlifyFormComponent } from 'ngx-techlify-core';\nimport { RecipientService } from '../recipient.service';\nimport { SharedModule } from '../../shared.module';\n\n@Component({\n selector: 'app-recipient-form',\n standalone: true,\n imports: [SharedModule],\n templateUrl: './recipient-form.component.html',\n styleUrls: ['./recipient-form.component.scss'],\n})\nexport class RecipientFormComponent extends TechlifyFormComponent implements OnInit {\n constructor(\n protected override formValidatorService: FormValidatorService,\n private formBuilder: FormBuilder,\n protected override service: RecipientService,\n public override dialogRef: MatDialogRef<RecipientFormComponent>,\n @Inject(MAT_DIALOG_DATA) @Optional() public data: { model?: any }\n ) {\n super(formValidatorService, service);\n\n this.errorMessages = {\n name: {\n required: 'The name field is required.',\n },\n };\n\n this.form = this.formBuilder.group({\n id: [''],\n name: ['', Validators.required],\n details: [''],\n });\n }\n\n ngOnInit(): void {\n const model = this.data?.model;\n if (model) {\n this.isUpdate = true;\n this.form.patchValue(model);\n }\n }\n}\n","<mat-card-title class=\"d-flex flex-row justify-content-center align-items-center\">\n Recipient Form\n</mat-card-title>\n<mat-card-content>\n <form class=\"d-flex flex-column gap-3\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"w-100\">\n <mat-label>Name</mat-label>\n <input matInput formControlName=\"name\" required />\n <mat-error *ngIf=\"isFieldValid('name')\">{{ getErrorMessage('name') }}</mat-error>\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Details</mat-label>\n <textarea matInput formControlName=\"details\" rows=\"3\"></textarea>\n </mat-form-field>\n\n <div class=\"d-flex justify-content-end gap-2\">\n <button type=\"button\" mat-flat-button [disabled]=\"isWorking\" (click)=\"dialogRef.close()\">Cancel</button>\n <button type=\"submit\" mat-raised-button color=\"primary\" [disabled]=\"isWorking\">Save</button>\n </div>\n </form>\n</mat-card-content>\n","import { Component, OnInit, signal } from '@angular/core';\nimport { FormBuilder } from '@angular/forms';\nimport { TechlifyListComponent } from 'ngx-techlify-core';\nimport { RecipientService } from '../recipient.service';\nimport { RecipientFormComponent } from '../recipient-form/recipient-form.component';\n\n@Component({\n selector: 'app-recipient-list',\n templateUrl: './recipient-list.component.html',\n styleUrls: ['./recipient-list.component.scss'],\n})\nexport class RecipientListComponent extends TechlifyListComponent implements OnInit {\n recipientForm = signal(RecipientFormComponent);\n\n displayedColumns: string[] = [\n '#',\n 'name',\n 'details',\n 'actions'\n ];\n\n constructor(private fb: FormBuilder, protected override service: RecipientService) {\n super(service);\n this.filterFormConfiguration = {};\n this.filterForm = this.fb.group({\n search: [''],\n sort_by: ['created_at|desc'],\n });\n }\n\n ngOnInit(): void {\n this.patchFiltersFromRoute();\n this.loadData();\n this.listenFilterChanges();\n }\n}\n","<div class=\"d-flex flex-column gap-2\">\n <mat-card>\n <mat-card-content class=\"d-flex flex-row justify-content-between align-items-center\">\n <div class=\"d-flex flex-row align-items-center gap-2\">\n <h5 class=\"mb-0\">Recipients</h5>\n <app-techlify-form-button *ngxPermissionsOnly=\"['recipient.create']\" [component]=\"recipientForm()\"\n [width]=\"'500px'\" (saved)=\"modelCreated($event)\"></app-techlify-form-button>\n </div>\n <div class=\"d-flex flex-row gap-2\" [formGroup]=\"filterForm\">\n <mat-form-field class=\"fl-md\">\n <mat-label>Search</mat-label>\n <input matInput formControlName=\"search\" />\n </mat-form-field>\n </div>\n </mat-card-content>\n </mat-card>\n\n <mat-card>\n <mat-card-content>\n <table mat-table [dataSource]=\"models\" class=\"w-100\" aria-describedby=\"Recipients\" infiniteScroll\n [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" matSort\n (matSortChange)=\"sortColumn($event)\">\n <ng-container matColumnDef=\"#\">\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 <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.name }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"details\">\n <th mat-header-cell *matHeaderCellDef>Details</th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.details }}</td>\n </ng-container>\n\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 flex-row gap-1 align-items-center text-secondary\">\n <app-techlify-form-button *ngxPermissionsOnly=\"['recipient.update']\" [component]=\"recipientForm()\"\n [model]=\"element\" [width]=\"'500px'\" (saved)=\"modelsUpdatedById($event)\"></app-techlify-form-button>\n <app-techlify-delete-button *ngxPermissionsOnly=\"['recipient.delete']\" [service]=\"service\"\n [model]=\"element\" [data]=\"{ type: 'Recipient', title: element?.name }\"\n (deleted)=\"modelsDeletedById($event)\"></app-techlify-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 <mat-progress-bar *ngIf=\"isWorking\" mode=\"indeterminate\"></mat-progress-bar>\n </mat-card-content>\n </mat-card>\n</div>\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { RecipientListComponent } from './recipient-list/recipient-list.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: RecipientListComponent,\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class RecipientRoutingModule {}\n","import { NgModule } from '@angular/core';\nimport { NgxPermissionsModule } from 'ngx-permissions';\nimport { RecipientRoutingModule } from './recipient-routing.module';\nimport { RecipientListComponent } from './recipient-list/recipient-list.component';\nimport { SharedModule } from '../shared.module';\n\n@NgModule({\n declarations: [RecipientListComponent],\n imports: [RecipientRoutingModule, SharedModule],\n})\nexport class RecipientModule {}\n"],"names":["i5","i7","i9","i1","i2.RecipientService","i4","i6","i8","i10","i11","i12"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAMM,MAAO,gBAAiB,SAAQ,eAAe,CAAA;AACnD,IAAA,WAAA,CAAY,WAAwB,EAAA;AAClC,QAAA,KAAK,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;KAClC;wGAHU,gBAAgB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA,CAAA;;4FAEP,gBAAgB,EAAA,U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CAAA;;;MCJY,eAAe,CAAA;wGAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAHX,YAAA,EAAA,CAAA,sBAAsB,CAC3B,EAAA,OAAA,EAAA,CAAA,sBAAsB,EAAE,YAAY,CAAA,EAAA,CAAA,CAAA;yGAEnC,eAAe,EAAA,OAAA,EAAA,CAFhB,sBAAsB,EAAE,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAEnC,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,sBAAsB,CAAC;AACtC,oBAAA,OAAO,EAAE,CAAC,sBAAsB,EAAE,YAAY,CAAC;AAChD,iBAAA,CAAA;;;;;"}
@@ -0,0 +1,194 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, Component } from '@angular/core';
3
+ import * as i2 from '@angular/forms';
4
+ import { Validators } from '@angular/forms';
5
+ import * as i1 from 'ngx-techlify-core';
6
+ import { TechlifyFormComponent, FormConfigurationUtilityService } from 'ngx-techlify-core';
7
+ import { b as StockIssueService, L as LocationService, S as SharedModule, c as LocationSelectorComponent } from './techlify-inventory-common-techlify-inventory-common-DuAN6iqX.mjs';
8
+ import moment from 'moment';
9
+ import * as i1$1 from '@angular/router';
10
+ import * as i3 from '@angular/common';
11
+ import * as i6 from '@angular/material/button';
12
+ import * as i4 from '@angular/material/card';
13
+ import * as i9 from '@angular/material/datepicker';
14
+ import * as i8 from '@angular/material/form-field';
15
+ import * as i11 from '@angular/material/icon';
16
+ import * as i8$1 from '@angular/material/input';
17
+ import * as i9$1 from '@angular/material/tooltip';
18
+
19
+ class StockIssueFormComponent extends TechlifyFormComponent {
20
+ formValidatorService;
21
+ fb;
22
+ stockIssueService;
23
+ route;
24
+ locationService;
25
+ location;
26
+ formConfigService;
27
+ locationCount = signal(0);
28
+ stockIssue = signal(null);
29
+ issuableData = signal(null);
30
+ formConfigurationUtilityService;
31
+ constructor(formValidatorService, fb, stockIssueService, route, locationService, location, formConfigService) {
32
+ super(formValidatorService);
33
+ this.formValidatorService = formValidatorService;
34
+ this.fb = fb;
35
+ this.stockIssueService = stockIssueService;
36
+ this.route = route;
37
+ this.locationService = locationService;
38
+ this.location = location;
39
+ this.formConfigService = formConfigService;
40
+ this.formConfigurationUtilityService = new FormConfigurationUtilityService();
41
+ this.errorMessages = {
42
+ date: {
43
+ required: 'The date field is required.',
44
+ },
45
+ recipient_id: {
46
+ required: 'Please select a recipient.',
47
+ },
48
+ };
49
+ this.form = this.fb.group({
50
+ date: [new Date(), Validators.compose([Validators.required])],
51
+ particulars: [''],
52
+ recipient_id: [''],
53
+ stock_issue_products: this.fb.array([])
54
+ });
55
+ }
56
+ ngOnInit() {
57
+ this.locationService.count().subscribe((count) => {
58
+ this.locationCount.set(count);
59
+ });
60
+ this.formConfigurationUtilityService.initialize(this.formConfigService, 'stock-issue').subscribe({
61
+ next: () => {
62
+ this.form.get('recipient_id')?.setValidators(this.formConfigurationUtilityService.getFieldRequired('recipient_id') ? Validators.required : null);
63
+ this.form.get('recipient_id')?.updateValueAndValidity();
64
+ }
65
+ });
66
+ const id = this.route.snapshot.paramMap.get('id');
67
+ if (id) {
68
+ this.loadStockIssue(+id);
69
+ }
70
+ else {
71
+ this.addStockIssueProduct();
72
+ }
73
+ this.route.queryParams.subscribe({
74
+ next: (params) => {
75
+ this.issuableData.set({
76
+ issuable_type: params['issuable_type'],
77
+ issuable_id: params['issuable_id']
78
+ });
79
+ }
80
+ });
81
+ }
82
+ loadStockIssue(id) {
83
+ this.isWorking = true;
84
+ this.stockIssueService.show(id, { with: 'stockIssueProducts.product' }).subscribe({
85
+ next: (response) => {
86
+ this.isWorking = false;
87
+ this.stockIssue.set(response.item);
88
+ },
89
+ error: () => {
90
+ this.isWorking = false;
91
+ },
92
+ complete: () => {
93
+ const issue = this.stockIssue();
94
+ this.form.patchValue({
95
+ date: issue.date ? new Date(issue.date) : new Date(),
96
+ particulars: issue.details,
97
+ recipient_id: issue.recipient_id,
98
+ });
99
+ this.stockIssueProducts.clear();
100
+ issue.stock_issue_products?.forEach((sip) => {
101
+ const group = this.createStockIssueProduct();
102
+ group.patchValue({
103
+ id: sip.id,
104
+ product_id: sip.product_id,
105
+ location_from_id: sip.location_from_id,
106
+ quantity: sip.quantity,
107
+ particulars: sip.particulars,
108
+ });
109
+ this.stockIssueProducts.push(group);
110
+ });
111
+ }
112
+ });
113
+ }
114
+ get stockIssueProducts() {
115
+ return this.form.get('stock_issue_products');
116
+ }
117
+ createStockIssueProduct() {
118
+ return this.fb.group({
119
+ id: [''],
120
+ product_id: ['', Validators.required],
121
+ location_from_id: ['', this.locationCount() > 0 ? Validators.required : null],
122
+ quantity: [0, [Validators.required, Validators.min(0)]],
123
+ particulars: [''],
124
+ issuable_id: [this.issuableData()?.issuable_id ?? ''],
125
+ issuable_type: [this.issuableData()?.issuable_type ?? '']
126
+ });
127
+ }
128
+ addStockIssueProduct() {
129
+ this.stockIssueProducts.push(this.createStockIssueProduct());
130
+ }
131
+ removeStockIssueProduct(index) {
132
+ this.stockIssueProducts.removeAt(index);
133
+ }
134
+ clearProducts() {
135
+ this.stockIssueProducts.clear();
136
+ }
137
+ save() {
138
+ if (this.form.invalid) {
139
+ this.form.markAllAsTouched();
140
+ this.form.markAsDirty();
141
+ this.alertService.addAlert('Please check the form for errors.', 'error');
142
+ return;
143
+ }
144
+ if (this.stockIssueProducts.length === 0) {
145
+ this.alertService.addAlert('Please add at least one product.', 'error');
146
+ return;
147
+ }
148
+ const formData = this.form.getRawValue();
149
+ const data = {
150
+ id: this.stockIssue()?.id ?? null,
151
+ date: moment(formData.date).format('YYYY-MM-DD'),
152
+ details: formData.particulars,
153
+ recipient_id: formData.recipient_id || null,
154
+ products: formData.stock_issue_products.map((row) => ({
155
+ id: row.product_id,
156
+ product_id: row.product_id,
157
+ quantity: row.quantity,
158
+ location_from_id: row.location_from_id,
159
+ particulars: row.particulars,
160
+ issuable_id: row.issuable_id,
161
+ issuable_type: row.issuable_type
162
+ }))
163
+ };
164
+ this.isWorking = true;
165
+ const request$ = this.stockIssue()?.id
166
+ ? this.stockIssueService.update(data)
167
+ : this.stockIssueService.store(data);
168
+ request$.subscribe({
169
+ next: () => {
170
+ this.isWorking = false;
171
+ this.alertService.addAlert('Stock issues saved successfully!', 'success');
172
+ this.location.back();
173
+ },
174
+ error: () => {
175
+ this.isWorking = false;
176
+ }
177
+ });
178
+ }
179
+ cancel() {
180
+ this.location.back();
181
+ }
182
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StockIssueFormComponent, deps: [{ token: i1.FormValidatorService }, { token: i2.FormBuilder }, { token: StockIssueService }, { token: i1$1.ActivatedRoute }, { token: LocationService }, { token: i3.Location }, { token: i1.FormConfigurationFormService }], target: i0.ɵɵFactoryTarget.Component });
183
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: StockIssueFormComponent, isStandalone: true, selector: "app-stock-issue-form", usesInheritance: true, ngImport: i0, template: "<mat-card class=\"d-flex flex-column gap-2 container\">\n <mat-card-content>\n\n <div class=\"d-flex flex-row justify-content-between align-items-center gap-1\">\n <h5>\n <span class=\"material-symbols-outlined align-middle\">upload</span>\n Issue Stock\n </h5>\n <app-form-configuration-for-form formCode=\"stock-issue\"></app-form-configuration-for-form>\n </div>\n\n <form class=\"d-flex flex-column gap-2\" [formGroup]=\"form\" (submit)=\"save()\">\n\n <div class=\"d-flex flex-column\">\n <div class=\"d-flex flex-row gap-2 justify-content-between\">\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Date</mat-label>\n <input matInput [matDatepicker]=\"picker\" placeholder=\"Date\" formControlName=\"date\" required>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error *ngIf=\"isFieldValid('date')\">{{ getErrorMessage('date') }}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance='outline' class=\"w-100\"\n *ngIf=\"formConfigurationUtilityService.getFieldEnabled('recipient_id')\">\n <mat-label>Recipient\n <sup *ngIf=\"formConfigurationUtilityService.getFieldRequired('recipient_id')\">*</sup>\n </mat-label>\n <app-searchable-selector apiUrl=\"api/recipients\" formControlName=\"recipient_id\"\n titleField=\"name\"></app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('recipient_id')\">{{ getErrorMessage('recipient_id')\n }}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Particulars</mat-label>\n <textarea matInput placeholder=\"Particulars\" formControlName=\"particulars\"></textarea>\n </mat-form-field>\n </div>\n </div>\n\n <table class=\"table mt-3\">\n <thead>\n <tr>\n <th scope=\"col\">#</th>\n <th scope=\"col\">Product</th>\n <th *ngIf=\"locationCount() > 0\" scope=\"col\">Location</th>\n <th scope=\"col\" width=\"45\">Quantity</th>\n <th scope=\"col\">Particulars</th>\n <th scope=\"col\" class=\"text-center\" width=\"50\"></th>\n </tr>\n </thead>\n <tbody formArrayName=\"stock_issue_products\">\n <tr *ngFor=\"let row of stockIssueProducts.controls; let i = index\" [formGroupName]=\"i\">\n <th scope=\"row\">{{ i + 1 }}</th>\n <td>\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Product</mat-label>\n <app-searchable-selector apiUrl='api/products' formControlName=\"product_id\"\n titleField='name' [cache]=\"true\" required></app-searchable-selector>\n </mat-form-field>\n </td>\n <td *ngIf=\"locationCount() > 0\">\n <app-location-selector appearance='outline' label=\"Location From\"\n hint=\"Which warehouse are we taking stock from?\"\n formControlName=\"location_from_id\"></app-location-selector>\n </td>\n <td>\n <mat-form-field appearance='outline' class=\"wpx-90\">\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" type=\"number\" min=\"0\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='w-100'>\n <mat-label>Particulars</mat-label>\n <textarea matInput formControlName=\"particulars\" rows=\"2\"></textarea>\n </mat-form-field>\n </td>\n <td class=\"text-center align-middle\">\n <div class=\"d-flex gap-2 justify-content-center align-items-center text-secondary\">\n <app-techlify-icon role='button' name='delete' (click)=\"removeStockIssueProduct(i)\"\n matTooltip=\"Remove row\"></app-techlify-icon>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td colspan=\"6\" class=\"text-end\">\n <div class=\"d-flex flex-row gap-2 justify-content-end\">\n <button mat-button color=\"primary\" type=\"button\" (click)=\"clearProducts()\"\n [disabled]=\"stockIssueProducts.length === 0\">\n <mat-icon>block</mat-icon> CLEAR ALL\n </button>\n <button mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"addStockIssueProduct()\">\n <mat-icon>add</mat-icon> ADD\n </button>\n </div>\n </td>\n </tr>\n </tfoot>\n </table>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2 mt-2\">\n <button [disabled]=\"isWorking\" mat-flat-button type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button [disabled]=\"isWorking || stockIssueProducts.length === 0\" mat-raised-button color=\"primary\"\n type=\"submit\">Save</button>\n </div>\n\n </form>\n\n </mat-card-content>\n</mat-card>", dependencies: [{ kind: "ngmodule", type: SharedModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.FormConfigurationForFormComponent, selector: "app-form-configuration-for-form", inputs: ["formCode"] }, { kind: "component", type: i6.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i4.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i9.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i9.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i9.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i8.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i8.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i11.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8$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: "directive", type: i9$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { 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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { 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.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { 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"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { 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", "isEmitInitialEvent", "required", "disabled", "value"], outputs: ["selectedValueChange", "selectionChange", "itemsChange"] }, { kind: "component", type: i1.TechlifyIconComponent, selector: "app-techlify-icon", inputs: ["name", "size"] }, { kind: "component", type: LocationSelectorComponent, selector: "app-location-selector", inputs: ["appearance", "label", "placeholder", "hint", "includeNone"] }], preserveWhitespaces: true });
184
+ }
185
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StockIssueFormComponent, decorators: [{
186
+ type: Component,
187
+ args: [{ selector: 'app-stock-issue-form', standalone: true, imports: [
188
+ SharedModule,
189
+ LocationSelectorComponent,
190
+ ], template: "<mat-card class=\"d-flex flex-column gap-2 container\">\n <mat-card-content>\n\n <div class=\"d-flex flex-row justify-content-between align-items-center gap-1\">\n <h5>\n <span class=\"material-symbols-outlined align-middle\">upload</span>\n Issue Stock\n </h5>\n <app-form-configuration-for-form formCode=\"stock-issue\"></app-form-configuration-for-form>\n </div>\n\n <form class=\"d-flex flex-column gap-2\" [formGroup]=\"form\" (submit)=\"save()\">\n\n <div class=\"d-flex flex-column\">\n <div class=\"d-flex flex-row gap-2 justify-content-between\">\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Date</mat-label>\n <input matInput [matDatepicker]=\"picker\" placeholder=\"Date\" formControlName=\"date\" required>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error *ngIf=\"isFieldValid('date')\">{{ getErrorMessage('date') }}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance='outline' class=\"w-100\"\n *ngIf=\"formConfigurationUtilityService.getFieldEnabled('recipient_id')\">\n <mat-label>Recipient\n <sup *ngIf=\"formConfigurationUtilityService.getFieldRequired('recipient_id')\">*</sup>\n </mat-label>\n <app-searchable-selector apiUrl=\"api/recipients\" formControlName=\"recipient_id\"\n titleField=\"name\"></app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('recipient_id')\">{{ getErrorMessage('recipient_id')\n }}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Particulars</mat-label>\n <textarea matInput placeholder=\"Particulars\" formControlName=\"particulars\"></textarea>\n </mat-form-field>\n </div>\n </div>\n\n <table class=\"table mt-3\">\n <thead>\n <tr>\n <th scope=\"col\">#</th>\n <th scope=\"col\">Product</th>\n <th *ngIf=\"locationCount() > 0\" scope=\"col\">Location</th>\n <th scope=\"col\" width=\"45\">Quantity</th>\n <th scope=\"col\">Particulars</th>\n <th scope=\"col\" class=\"text-center\" width=\"50\"></th>\n </tr>\n </thead>\n <tbody formArrayName=\"stock_issue_products\">\n <tr *ngFor=\"let row of stockIssueProducts.controls; let i = index\" [formGroupName]=\"i\">\n <th scope=\"row\">{{ i + 1 }}</th>\n <td>\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Product</mat-label>\n <app-searchable-selector apiUrl='api/products' formControlName=\"product_id\"\n titleField='name' [cache]=\"true\" required></app-searchable-selector>\n </mat-form-field>\n </td>\n <td *ngIf=\"locationCount() > 0\">\n <app-location-selector appearance='outline' label=\"Location From\"\n hint=\"Which warehouse are we taking stock from?\"\n formControlName=\"location_from_id\"></app-location-selector>\n </td>\n <td>\n <mat-form-field appearance='outline' class=\"wpx-90\">\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" type=\"number\" min=\"0\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='w-100'>\n <mat-label>Particulars</mat-label>\n <textarea matInput formControlName=\"particulars\" rows=\"2\"></textarea>\n </mat-form-field>\n </td>\n <td class=\"text-center align-middle\">\n <div class=\"d-flex gap-2 justify-content-center align-items-center text-secondary\">\n <app-techlify-icon role='button' name='delete' (click)=\"removeStockIssueProduct(i)\"\n matTooltip=\"Remove row\"></app-techlify-icon>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td colspan=\"6\" class=\"text-end\">\n <div class=\"d-flex flex-row gap-2 justify-content-end\">\n <button mat-button color=\"primary\" type=\"button\" (click)=\"clearProducts()\"\n [disabled]=\"stockIssueProducts.length === 0\">\n <mat-icon>block</mat-icon> CLEAR ALL\n </button>\n <button mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"addStockIssueProduct()\">\n <mat-icon>add</mat-icon> ADD\n </button>\n </div>\n </td>\n </tr>\n </tfoot>\n </table>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2 mt-2\">\n <button [disabled]=\"isWorking\" mat-flat-button type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button [disabled]=\"isWorking || stockIssueProducts.length === 0\" mat-raised-button color=\"primary\"\n type=\"submit\">Save</button>\n </div>\n\n </form>\n\n </mat-card-content>\n</mat-card>" }]
191
+ }], ctorParameters: () => [{ type: i1.FormValidatorService }, { type: i2.FormBuilder }, { type: StockIssueService }, { type: i1$1.ActivatedRoute }, { type: LocationService }, { type: i3.Location }, { type: i1.FormConfigurationFormService }] });
192
+
193
+ export { StockIssueFormComponent };
194
+ //# sourceMappingURL=techlify-inventory-common-stock-issue-form.component-B-aNyhLA.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"techlify-inventory-common-stock-issue-form.component-B-aNyhLA.mjs","sources":["../../../projects/inventory-common/src/lib/inventory-common/stock-issue/stock-issue-form/stock-issue-form.component.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-issue/stock-issue-form/stock-issue-form.component.html"],"sourcesContent":["import { Component, OnInit, signal } from \"@angular/core\";\nimport { FormArray, FormBuilder, Validators } from '@angular/forms';\nimport {\n FormConfigurationFormService,\n FormConfigurationUtilityService,\n FormValidatorService,\n TechlifyFormComponent\n} from \"ngx-techlify-core\";\nimport { Location } from '@angular/common';\nimport { LocationSelectorComponent } from '../../location/location-selector/location-selector.component';\nimport { StockIssueService } from '../stock-issue.service';\nimport { ActivatedRoute } from '@angular/router';\nimport moment from 'moment';\nimport { LocationService } from '../../location/location.service';\nimport { SharedModule } from \"../../shared.module\";\n\n@Component({\n selector: 'app-stock-issue-form',\n templateUrl: './stock-issue-form.component.html',\n standalone: true,\n imports: [\n SharedModule,\n LocationSelectorComponent,\n ]\n})\n\nexport class StockIssueFormComponent extends TechlifyFormComponent implements OnInit {\n\n locationCount = signal<number>(0);\n stockIssue = signal<any>(null);\n\n issuableData = signal<{\n issuable_type: String,\n issuable_id: number\n } | null>(null)\n\n public formConfigurationUtilityService: FormConfigurationUtilityService;\n\n constructor(protected override formValidatorService: FormValidatorService,\n private fb: FormBuilder,\n private stockIssueService: StockIssueService,\n private route: ActivatedRoute,\n private locationService: LocationService,\n private location: Location,\n private formConfigService: FormConfigurationFormService\n ) {\n super(formValidatorService);\n\n this.formConfigurationUtilityService = new FormConfigurationUtilityService();\n\n this.errorMessages = {\n date: {\n required: 'The date field is required.',\n },\n recipient_id: {\n required: 'Please select a recipient.',\n },\n };\n\n this.form = this.fb.group({\n date: [new Date(), Validators.compose([Validators.required])],\n particulars: [''],\n recipient_id: [''],\n stock_issue_products: this.fb.array([])\n });\n }\n\n ngOnInit(): void {\n this.locationService.count().subscribe((count: number) => {\n this.locationCount.set(count);\n });\n\n this.formConfigurationUtilityService.initialize(this.formConfigService, 'stock-issue').subscribe({\n next: () => {\n this.form.get('recipient_id')?.setValidators(\n this.formConfigurationUtilityService.getFieldRequired('recipient_id') ? Validators.required : null\n );\n this.form.get('recipient_id')?.updateValueAndValidity();\n }\n });\n\n const id = this.route.snapshot.paramMap.get('id');\n if (id) {\n this.loadStockIssue(+id);\n } else {\n this.addStockIssueProduct();\n }\n\n this.route.queryParams.subscribe({\n next: (params: any) => {\n this.issuableData.set({\n issuable_type: params['issuable_type'],\n issuable_id: params['issuable_id']\n });\n\n }\n })\n }\n\n private loadStockIssue(id: number): void {\n this.isWorking = true;\n this.stockIssueService.show(id, { with: 'stockIssueProducts.product' }).subscribe({\n next: (response: any) => {\n this.isWorking = false;\n this.stockIssue.set(response.item);\n },\n error: () => {\n this.isWorking = false;\n },\n complete: () => {\n const issue = this.stockIssue();\n this.form.patchValue({\n date: issue.date ? new Date(issue.date) : new Date(),\n particulars: issue.details,\n recipient_id: issue.recipient_id,\n });\n\n this.stockIssueProducts.clear();\n issue.stock_issue_products?.forEach((sip: any) => {\n const group = this.createStockIssueProduct();\n group.patchValue({\n id: sip.id,\n product_id: sip.product_id,\n location_from_id: sip.location_from_id,\n quantity: sip.quantity,\n particulars: sip.particulars,\n });\n this.stockIssueProducts.push(group);\n });\n }\n });\n }\n\n get stockIssueProducts(): FormArray {\n return this.form.get('stock_issue_products') as FormArray;\n }\n\n createStockIssueProduct() {\n return this.fb.group({\n id: [''],\n product_id: ['', Validators.required],\n location_from_id: ['', this.locationCount() > 0 ? Validators.required : null],\n quantity: [0, [Validators.required, Validators.min(0)]],\n particulars: [''],\n issuable_id: [this.issuableData()?.issuable_id ?? ''],\n issuable_type: [this.issuableData()?.issuable_type ?? '']\n });\n }\n\n addStockIssueProduct() {\n this.stockIssueProducts.push(this.createStockIssueProduct());\n }\n\n removeStockIssueProduct(index: number) {\n this.stockIssueProducts.removeAt(index);\n }\n\n clearProducts() {\n this.stockIssueProducts.clear();\n }\n\n save() {\n if (this.form.invalid) {\n this.form.markAllAsTouched();\n this.form.markAsDirty();\n this.alertService.addAlert('Please check the form for errors.', 'error');\n return;\n }\n\n if (this.stockIssueProducts.length === 0) {\n this.alertService.addAlert('Please add at least one product.', 'error');\n return;\n }\n\n const formData = this.form.getRawValue();\n const data: any = {\n id: this.stockIssue()?.id ?? null,\n date: moment(formData.date).format('YYYY-MM-DD'),\n details: formData.particulars,\n recipient_id: formData.recipient_id || null,\n products: formData.stock_issue_products.map((row: any) => ({\n id: row.product_id,\n product_id: row.product_id,\n quantity: row.quantity,\n location_from_id: row.location_from_id,\n particulars: row.particulars,\n issuable_id: row.issuable_id,\n issuable_type: row.issuable_type\n }))\n };\n\n this.isWorking = true;\n const request$ = this.stockIssue()?.id\n ? this.stockIssueService.update(data)\n : this.stockIssueService.store(data);\n\n request$.subscribe({\n next: () => {\n this.isWorking = false;\n this.alertService.addAlert('Stock issues saved successfully!', 'success');\n this.location.back();\n },\n error: () => {\n this.isWorking = false;\n }\n });\n }\n\n cancel() {\n this.location.back();\n }\n}\n","<mat-card class=\"d-flex flex-column gap-2 container\">\n <mat-card-content>\n\n <div class=\"d-flex flex-row justify-content-between align-items-center gap-1\">\n <h5>\n <span class=\"material-symbols-outlined align-middle\">upload</span>\n Issue Stock\n </h5>\n <app-form-configuration-for-form formCode=\"stock-issue\"></app-form-configuration-for-form>\n </div>\n\n <form class=\"d-flex flex-column gap-2\" [formGroup]=\"form\" (submit)=\"save()\">\n\n <div class=\"d-flex flex-column\">\n <div class=\"d-flex flex-row gap-2 justify-content-between\">\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Date</mat-label>\n <input matInput [matDatepicker]=\"picker\" placeholder=\"Date\" formControlName=\"date\" required>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error *ngIf=\"isFieldValid('date')\">{{ getErrorMessage('date') }}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance='outline' class=\"w-100\"\n *ngIf=\"formConfigurationUtilityService.getFieldEnabled('recipient_id')\">\n <mat-label>Recipient\n <sup *ngIf=\"formConfigurationUtilityService.getFieldRequired('recipient_id')\">*</sup>\n </mat-label>\n <app-searchable-selector apiUrl=\"api/recipients\" formControlName=\"recipient_id\"\n titleField=\"name\"></app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('recipient_id')\">{{ getErrorMessage('recipient_id')\n }}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Particulars</mat-label>\n <textarea matInput placeholder=\"Particulars\" formControlName=\"particulars\"></textarea>\n </mat-form-field>\n </div>\n </div>\n\n <table class=\"table mt-3\">\n <thead>\n <tr>\n <th scope=\"col\">#</th>\n <th scope=\"col\">Product</th>\n <th *ngIf=\"locationCount() > 0\" scope=\"col\">Location</th>\n <th scope=\"col\" width=\"45\">Quantity</th>\n <th scope=\"col\">Particulars</th>\n <th scope=\"col\" class=\"text-center\" width=\"50\"></th>\n </tr>\n </thead>\n <tbody formArrayName=\"stock_issue_products\">\n <tr *ngFor=\"let row of stockIssueProducts.controls; let i = index\" [formGroupName]=\"i\">\n <th scope=\"row\">{{ i + 1 }}</th>\n <td>\n <mat-form-field appearance='outline' class=\"w-100\">\n <mat-label>Product</mat-label>\n <app-searchable-selector apiUrl='api/products' formControlName=\"product_id\"\n titleField='name' [cache]=\"true\" required></app-searchable-selector>\n </mat-form-field>\n </td>\n <td *ngIf=\"locationCount() > 0\">\n <app-location-selector appearance='outline' label=\"Location From\"\n hint=\"Which warehouse are we taking stock from?\"\n formControlName=\"location_from_id\"></app-location-selector>\n </td>\n <td>\n <mat-form-field appearance='outline' class=\"wpx-90\">\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" type=\"number\" min=\"0\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='w-100'>\n <mat-label>Particulars</mat-label>\n <textarea matInput formControlName=\"particulars\" rows=\"2\"></textarea>\n </mat-form-field>\n </td>\n <td class=\"text-center align-middle\">\n <div class=\"d-flex gap-2 justify-content-center align-items-center text-secondary\">\n <app-techlify-icon role='button' name='delete' (click)=\"removeStockIssueProduct(i)\"\n matTooltip=\"Remove row\"></app-techlify-icon>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td colspan=\"6\" class=\"text-end\">\n <div class=\"d-flex flex-row gap-2 justify-content-end\">\n <button mat-button color=\"primary\" type=\"button\" (click)=\"clearProducts()\"\n [disabled]=\"stockIssueProducts.length === 0\">\n <mat-icon>block</mat-icon> CLEAR ALL\n </button>\n <button mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"addStockIssueProduct()\">\n <mat-icon>add</mat-icon> ADD\n </button>\n </div>\n </td>\n </tr>\n </tfoot>\n </table>\n\n <div class=\"d-flex justify-content-end align-items-center gap-2 mt-2\">\n <button [disabled]=\"isWorking\" mat-flat-button type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button [disabled]=\"isWorking || stockIssueProducts.length === 0\" mat-raised-button color=\"primary\"\n type=\"submit\">Save</button>\n </div>\n\n </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,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,uBAAuB,EC1BpC,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,s7MAkHW,ED7FP,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,YAAY,gwJACZ,yBAAyB,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,OAAA,EAAA,aAAA,EAAA,MAAA,EAAA,aAAA,CAAA,EAAA,CAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;4FAIhB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAVnC,SAAS;+BACE,sBAAsB,EAAA,UAAA,EAEpB,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,yBAAyB;AAC1B,qBAAA,EAAA,QAAA,EAAA,s7MAAA,EAAA,CAAA;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Component } from '@angular/core';
3
- import { c as StockIssueProductService, d as SharedModule, e as StockAllocationListComponent } from './techlify-inventory-common-techlify-inventory-common-BbtWdC-G.mjs';
3
+ import { d as StockIssueProductService, S as SharedModule, e as StockAllocationListComponent } from './techlify-inventory-common-techlify-inventory-common-DuAN6iqX.mjs';
4
4
  import * as i1$1 from 'ngx-techlify-core';
5
5
  import { NoteModule, TechlifyFeatureModule } from 'ngx-techlify-core';
6
6
  import * as i1 from '@angular/router';
@@ -57,4 +57,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
57
57
  }], ctorParameters: () => [{ type: i1.ActivatedRoute }, { type: StockIssueProductService }, { type: i3.Location }] });
58
58
 
59
59
  export { StockIssueProductViewComponent };
60
- //# sourceMappingURL=techlify-inventory-common-stock-issue-product-view.component-Di1fJWqD.mjs.map
60
+ //# sourceMappingURL=techlify-inventory-common-stock-issue-product-view.component-BP2yFaQn.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"techlify-inventory-common-stock-issue-product-view.component-Di1fJWqD.mjs","sources":["../../../projects/inventory-common/src/lib/inventory-common/stock-issue/stock-issue-product-view/stock-issue-product-view.component.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-issue/stock-issue-product-view/stock-issue-product-view.component.html"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { Location } from '@angular/common';\nimport { ActivatedRoute } from '@angular/router';\nimport { SharedModule } from '../../shared.module';\nimport { StockIssueProductService } from '../stock-issue-product.service';\nimport { NoteModule, TechlifyFeatureModule } from 'ngx-techlify-core';\nimport { StockAllocationListComponent } from '../../stock-allocation/stock-allocation-list/stock-allocation-list.component';\n\n@Component({\n selector: 'app-stock-issue-product-view',\n templateUrl: './stock-issue-product-view.component.html',\n styleUrl: './stock-issue-product-view.component.scss',\n standalone: true,\n imports: [\n SharedModule,\n NoteModule,\n TechlifyFeatureModule,\n StockAllocationListComponent\n ],\n})\nexport class StockIssueProductViewComponent implements OnInit {\n\n id!: number;\n isLoading!: boolean;\n model!: any;\n\n constructor(\n private activatedRoute: ActivatedRoute,\n protected service: StockIssueProductService,\n private location: Location\n ) { }\n\n ngOnInit(): void {\n this.activatedRoute.params.subscribe(params => {\n this.id = parseInt(params['id']);\n if (this.id) {\n this.loadData();\n }\n });\n }\n\n loadData() {\n this.isLoading = true;\n this.service.show(this.id).subscribe({\n next: (response: any) => {\n this.model = response?.item;\n this.isLoading = false;\n },\n error: () => {\n this.isLoading = false;\n }\n });\n }\n\n redirectBack() {\n this.location.back();\n }\n}\n","<mat-progress-bar mode=\"indeterminate\" *ngIf=\"isLoading\"></mat-progress-bar>\n\n<div *ngIf=\"model\" class=\"d-flex flex-column justify-content-start gap-2\">\n <mat-card>\n <mat-card-content>\n <h3 class=\"mb-0\">Stock Issue for {{ model?.product?.name }}</h3>\n </mat-card-content>\n </mat-card>\n <div class=\"d-flex justify-content-start align-items-start gap-2\">\n <div class=\"d-flex flex-column gap-2\" style=\"width: 350px\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> ungroup </span>\n <strong class=\"mb-0 text-dark\">Information</strong>\n </div>\n <div class=\"d-flex justify-content-start align-items-center gap-2 text-secondary\">\n <app-techlify-icon name=\"edit\" role=\"button\"\n [routerLink]=\"['/inventory/stock-issues/form', model?.stock_issue_id]\"></app-techlify-icon>\n <app-techlify-delete-button [model]=\"model\" [service]=\"service\"\n [data]=\"{ title: model?.product?.name, type: 'Stock Issue Product' }\"\n (deleted)=\"redirectBack();\">\n </app-techlify-delete-button>\n </div>\n </mat-card-content>\n <mat-card-content class=\"d-flex flex-column justify-content-start gap-2 mt-3\">\n <div class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex flex-column gap-0\">\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/products', model?.product?.id, 'view']\">\n <p class=\"mb-0\">{{ model?.product?.name }}</p>\n </a>\n <small *ngIf=\"model?.product?.sku\">{{ model?.product?.sku }}</small>\n </div>\n <div class=\"d-flex flex-column justify-content-end gap-0\">\n <small *ngIf=\"model?.stock_issue?.date\">{{ model?.stock_issue?.date | date }}</small>\n <ng-container *ngIf=\"model?.batch?.expires_on\">\n <small techlifyFeatureEnabled=\"product-batch-numbers\">\n Expires on {{ model?.batch?.expires_on | date }}\n </small>\n </ng-container>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-6\" *ngIf=\"model?.quantity\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Quantity</small>\n <div class=\"d-flex gap-1\">\n <h3 class=\"mb-0\">{{ model?.quantity }}</h3>\n <small class=\"text-secondary\">{{ model?.product?.measure?.title }}</small>\n </div>\n </div>\n </div>\n\n <div class=\"col-6\" *ngIf=\"model?.location\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Location</small>\n <p class=\"mb-0\">{{ model?.location?.title }}</p>\n </div>\n </div>\n </div>\n\n <ng-container *ngIf=\"model?.batch\">\n <div class=\"row\" techlifyFeatureEnabled=\"product-batch-numbers\">\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Batch</small>\n <p class=\"mb-0\">{{ model?.batch?.batch_number }}</p>\n </div>\n </div>\n <div class=\"col-6\" *ngIf=\"model?.batch?.expires_on\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Expires On</small>\n <p class=\"mb-0\">{{ model?.batch?.expires_on | date }}</p>\n </div>\n </div>\n </div>\n </ng-container>\n\n <div class=\"row\" *ngIf=\"model?.particulars\">\n <div class=\"col-12\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Particulars</small>\n <p class=\"mb-0\">{{ model?.particulars }}</p>\n </div>\n </div>\n </div>\n\n <div class=\"row\" *ngIf=\"model?.stock_issue?.creator\">\n <div class=\"col-12\">\n <small class=\"mb-0\">\n <span class=\"text-secondary\">Created By</span> {{ model?.stock_issue?.creator?.name }}\n <span class=\"text-secondary\">On</span> {{ model?.stock_issue?.created_at | date }}\n </small>\n </div>\n </div>\n </mat-card-content>\n </mat-card>\n\n <app-note-list labelText=\"Notes\" viewMode=\"timeline\" modelType=\"StockIssueProduct\"\n [relatedModelId]=\"model?.stock_issue_id\"></app-note-list>\n </div>\n\n <div style=\"width: calc(100% - 350px - 0.5rem)\">\n <app-stock-allocation-list [stockIssueProductId]=\"model?.id\"></app-stock-allocation-list>\n </div>\n </div>\n</div>\n"],"names":["i2.StockIssueProductService","i6"],"mappings":";;;;;;;;;;MAoBa,8BAA8B,CAAA;AAO3B,IAAA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;;"}
1
+ {"version":3,"file":"techlify-inventory-common-stock-issue-product-view.component-BP2yFaQn.mjs","sources":["../../../projects/inventory-common/src/lib/inventory-common/stock-issue/stock-issue-product-view/stock-issue-product-view.component.ts","../../../projects/inventory-common/src/lib/inventory-common/stock-issue/stock-issue-product-view/stock-issue-product-view.component.html"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { Location } from '@angular/common';\nimport { ActivatedRoute } from '@angular/router';\nimport { SharedModule } from '../../shared.module';\nimport { StockIssueProductService } from '../stock-issue-product.service';\nimport { NoteModule, TechlifyFeatureModule } from 'ngx-techlify-core';\nimport { StockAllocationListComponent } from '../../stock-allocation/stock-allocation-list/stock-allocation-list.component';\n\n@Component({\n selector: 'app-stock-issue-product-view',\n templateUrl: './stock-issue-product-view.component.html',\n styleUrl: './stock-issue-product-view.component.scss',\n standalone: true,\n imports: [\n SharedModule,\n NoteModule,\n TechlifyFeatureModule,\n StockAllocationListComponent\n ],\n})\nexport class StockIssueProductViewComponent implements OnInit {\n\n id!: number;\n isLoading!: boolean;\n model!: any;\n\n constructor(\n private activatedRoute: ActivatedRoute,\n protected service: StockIssueProductService,\n private location: Location\n ) { }\n\n ngOnInit(): void {\n this.activatedRoute.params.subscribe(params => {\n this.id = parseInt(params['id']);\n if (this.id) {\n this.loadData();\n }\n });\n }\n\n loadData() {\n this.isLoading = true;\n this.service.show(this.id).subscribe({\n next: (response: any) => {\n this.model = response?.item;\n this.isLoading = false;\n },\n error: () => {\n this.isLoading = false;\n }\n });\n }\n\n redirectBack() {\n this.location.back();\n }\n}\n","<mat-progress-bar mode=\"indeterminate\" *ngIf=\"isLoading\"></mat-progress-bar>\n\n<div *ngIf=\"model\" class=\"d-flex flex-column justify-content-start gap-2\">\n <mat-card>\n <mat-card-content>\n <h3 class=\"mb-0\">Stock Issue for {{ model?.product?.name }}</h3>\n </mat-card-content>\n </mat-card>\n <div class=\"d-flex justify-content-start align-items-start gap-2\">\n <div class=\"d-flex flex-column gap-2\" style=\"width: 350px\">\n <mat-card>\n <mat-card-content class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span class=\"material-symbols-outlined\"> ungroup </span>\n <strong class=\"mb-0 text-dark\">Information</strong>\n </div>\n <div class=\"d-flex justify-content-start align-items-center gap-2 text-secondary\">\n <app-techlify-icon name=\"edit\" role=\"button\"\n [routerLink]=\"['/inventory/stock-issues/form', model?.stock_issue_id]\"></app-techlify-icon>\n <app-techlify-delete-button [model]=\"model\" [service]=\"service\"\n [data]=\"{ title: model?.product?.name, type: 'Stock Issue Product' }\"\n (deleted)=\"redirectBack();\">\n </app-techlify-delete-button>\n </div>\n </mat-card-content>\n <mat-card-content class=\"d-flex flex-column justify-content-start gap-2 mt-3\">\n <div class=\"d-flex justify-content-between align-items-center gap-2\">\n <div class=\"d-flex flex-column gap-0\">\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/products', model?.product?.id, 'view']\">\n <p class=\"mb-0\">{{ model?.product?.name }}</p>\n </a>\n <small *ngIf=\"model?.product?.sku\">{{ model?.product?.sku }}</small>\n </div>\n <div class=\"d-flex flex-column justify-content-end gap-0\">\n <small *ngIf=\"model?.stock_issue?.date\">{{ model?.stock_issue?.date | date }}</small>\n <ng-container *ngIf=\"model?.batch?.expires_on\">\n <small techlifyFeatureEnabled=\"product-batch-numbers\">\n Expires on {{ model?.batch?.expires_on | date }}\n </small>\n </ng-container>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-6\" *ngIf=\"model?.quantity\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Quantity</small>\n <div class=\"d-flex gap-1\">\n <h3 class=\"mb-0\">{{ model?.quantity }}</h3>\n <small class=\"text-secondary\">{{ model?.product?.measure?.title }}</small>\n </div>\n </div>\n </div>\n\n <div class=\"col-6\" *ngIf=\"model?.location\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Location</small>\n <p class=\"mb-0\">{{ model?.location?.title }}</p>\n </div>\n </div>\n </div>\n\n <ng-container *ngIf=\"model?.batch\">\n <div class=\"row\" techlifyFeatureEnabled=\"product-batch-numbers\">\n <div class=\"col-6\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Batch</small>\n <p class=\"mb-0\">{{ model?.batch?.batch_number }}</p>\n </div>\n </div>\n <div class=\"col-6\" *ngIf=\"model?.batch?.expires_on\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Expires On</small>\n <p class=\"mb-0\">{{ model?.batch?.expires_on | date }}</p>\n </div>\n </div>\n </div>\n </ng-container>\n\n <div class=\"row\" *ngIf=\"model?.particulars\">\n <div class=\"col-12\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Particulars</small>\n <p class=\"mb-0\">{{ model?.particulars }}</p>\n </div>\n </div>\n </div>\n\n <div class=\"row\" *ngIf=\"model?.stock_issue?.creator\">\n <div class=\"col-12\">\n <small class=\"mb-0\">\n <span class=\"text-secondary\">Created By</span> {{ model?.stock_issue?.creator?.name }}\n <span class=\"text-secondary\">On</span> {{ model?.stock_issue?.created_at | date }}\n </small>\n </div>\n </div>\n </mat-card-content>\n </mat-card>\n\n <app-note-list labelText=\"Notes\" viewMode=\"timeline\" modelType=\"StockIssueProduct\"\n [relatedModelId]=\"model?.stock_issue_id\"></app-note-list>\n </div>\n\n <div style=\"width: calc(100% - 350px - 0.5rem)\">\n <app-stock-allocation-list [stockIssueProductId]=\"model?.id\"></app-stock-allocation-list>\n </div>\n </div>\n</div>\n"],"names":["i2.StockIssueProductService","i6"],"mappings":";;;;;;;;;;MAoBa,8BAA8B,CAAA;AAO3B,IAAA,cAAA,CAAA;AACE,IAAA,OAAA,CAAA;AACF,IAAA,QAAA,CAAA;AAPZ,IAAA,EAAE,CAAU;AACZ,IAAA,SAAS,CAAW;AACpB,IAAA,KAAK,CAAO;AAEZ,IAAA,WAAA,CACY,cAA8B,EAC5B,OAAiC,E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