techlify-inventory-common 18.29.0 → 18.30.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/location/location-form-button/location-form-button.component.mjs +7 -4
- package/esm2022/lib/inventory-common/location/location-information/location-information.component.mjs +17 -15
- package/esm2022/lib/inventory-common/location/location-list/location-list.component.mjs +7 -7
- package/esm2022/lib/inventory-common/location/location-selector/location-selector.component.mjs +6 -5
- package/esm2022/lib/inventory-common/location/location-view/location-view.component.mjs +8 -9
- package/esm2022/lib/inventory-common/location/shelf/shelf-form-button/shelf-form-button.component.mjs +10 -6
- package/esm2022/lib/inventory-common/location/shelf/shelf-list/shelf-list.component.mjs +17 -16
- package/esm2022/lib/inventory-common/product/product-form-button/product-form-button.component.mjs +3 -3
- package/esm2022/lib/inventory-common/stock-issuances/stock-issue-batch-form/stock-issue-batch-form.component.mjs +120 -0
- package/esm2022/lib/inventory-common/stock-issuances/stock-issue-list/stock-issue-list.component.mjs +3 -3
- package/esm2022/lib/inventory-common/stock-issuances/stock-issue-routing.module.mjs +6 -1
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-batch-form/stock-receipt-batch-form.component.mjs +152 -0
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.mjs +1 -1
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipt-view/stock-receipt-view.component.mjs +1 -1
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.mjs +19 -72
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipts-routing.module.mjs +7 -1
- package/esm2022/lib/inventory-common/stock-receipts/stock-receipts.module.mjs +31 -30
- package/esm2022/public-api.mjs +1 -3
- package/fesm2022/{techlify-inventory-common-category.module-BT3uLLqI.mjs → techlify-inventory-common-category.module--x7n_KLq.mjs} +9 -9
- package/fesm2022/{techlify-inventory-common-category.module-BT3uLLqI.mjs.map → techlify-inventory-common-category.module--x7n_KLq.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-measure.module-s9xhNWZM.mjs → techlify-inventory-common-measure.module-D2jxHH_D.mjs} +4 -4
- package/fesm2022/{techlify-inventory-common-measure.module-s9xhNWZM.mjs.map → techlify-inventory-common-measure.module-D2jxHH_D.mjs.map} +1 -1
- package/fesm2022/techlify-inventory-common-stock-issue-batch-form.component-DWWhMwul.mjs +119 -0
- package/fesm2022/techlify-inventory-common-stock-issue-batch-form.component-DWWhMwul.mjs.map +1 -0
- package/fesm2022/{techlify-inventory-common-stock-issue-view.component-CNrY99hf.mjs → techlify-inventory-common-stock-issue-view.component-CVmdJazX.mjs} +2 -2
- package/fesm2022/{techlify-inventory-common-stock-issue-view.component-CNrY99hf.mjs.map → techlify-inventory-common-stock-issue-view.component-CVmdJazX.mjs.map} +1 -1
- package/fesm2022/{techlify-inventory-common-techlify-inventory-common-DRw7na0D.mjs → techlify-inventory-common-techlify-inventory-common-DZ-tDtUV.mjs} +252 -269
- package/fesm2022/techlify-inventory-common-techlify-inventory-common-DZ-tDtUV.mjs.map +1 -0
- package/fesm2022/techlify-inventory-common.mjs +1 -1
- package/lib/inventory-common/location/location-information/location-information.component.d.ts +3 -1
- package/lib/inventory-common/location/location-selector/location-selector.component.d.ts +3 -1
- package/lib/inventory-common/stock-issuances/stock-issue-batch-form/stock-issue-batch-form.component.d.ts +31 -0
- package/lib/inventory-common/stock-receipts/stock-receipt-batch-form/stock-receipt-batch-form.component.d.ts +39 -0
- package/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.d.ts +3 -10
- package/lib/inventory-common/stock-receipts/stock-receipts.module.d.ts +10 -12
- package/package.json +1 -1
- package/public-api.d.ts +0 -2
- package/esm2022/lib/inventory-common/location/location-delete-button/location-delete-button.component.mjs +0 -68
- package/esm2022/lib/inventory-common/location/shelf/shelf-delete-button/shelf-delete-button.component.mjs +0 -60
- package/fesm2022/techlify-inventory-common-techlify-inventory-common-DRw7na0D.mjs.map +0 -1
- package/lib/inventory-common/location/location-delete-button/location-delete-button.component.d.ts +0 -28
- package/lib/inventory-common/location/shelf/shelf-delete-button/shelf-delete-button.component.d.ts +0 -20
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Component, signal } from "@angular/core";
|
|
2
|
+
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
|
3
|
+
import { TechlifyFormComponentInterface, TechlifyIconModule } from "ngx-techlify-core";
|
|
4
|
+
import { MaterialModule } from '../../material.module';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import { SearchableSelectorModule } from 'ngx-techlify-core';
|
|
7
|
+
import { LocationSelectorComponent } from '../../location/location-selector/location-selector.component';
|
|
8
|
+
import { debounceTime } from 'rxjs';
|
|
9
|
+
import moment from 'moment';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "ngx-techlify-core";
|
|
12
|
+
import * as i2 from "@angular/forms";
|
|
13
|
+
import * as i3 from "../stock-receipt.service";
|
|
14
|
+
import * as i4 from "@angular/router";
|
|
15
|
+
import * as i5 from "../../location/location.service";
|
|
16
|
+
import * as i6 from "@angular/common";
|
|
17
|
+
import * as i7 from "@angular/material/button";
|
|
18
|
+
import * as i8 from "@angular/material/card";
|
|
19
|
+
import * as i9 from "@angular/material/datepicker";
|
|
20
|
+
import * as i10 from "@angular/material/form-field";
|
|
21
|
+
import * as i11 from "@angular/material/icon";
|
|
22
|
+
import * as i12 from "@angular/material/input";
|
|
23
|
+
import * as i13 from "@angular/material/tooltip";
|
|
24
|
+
export class StockReceiptBatchFormComponent extends TechlifyFormComponentInterface {
|
|
25
|
+
formValidatorService;
|
|
26
|
+
fb;
|
|
27
|
+
stockReceiptService;
|
|
28
|
+
router;
|
|
29
|
+
locationService;
|
|
30
|
+
locationCount = signal(0);
|
|
31
|
+
constructor(formValidatorService, fb, stockReceiptService, router, locationService) {
|
|
32
|
+
super(formValidatorService);
|
|
33
|
+
this.formValidatorService = formValidatorService;
|
|
34
|
+
this.fb = fb;
|
|
35
|
+
this.stockReceiptService = stockReceiptService;
|
|
36
|
+
this.router = router;
|
|
37
|
+
this.locationService = locationService;
|
|
38
|
+
this.form = this.fb.group({
|
|
39
|
+
supplier_id: ['', Validators.compose([Validators.required])],
|
|
40
|
+
date: [new Date(), Validators.compose([Validators.required])],
|
|
41
|
+
particulars: ['', Validators.compose([Validators.required])],
|
|
42
|
+
stock_receipt_products: this.fb.array([])
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
ngOnInit() {
|
|
46
|
+
this.locationService.count().subscribe((count) => {
|
|
47
|
+
this.locationCount.set(count);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
get stockReceiptProducts() {
|
|
51
|
+
return this.form.get('stock_receipt_products');
|
|
52
|
+
}
|
|
53
|
+
createStockReceiptProduct() {
|
|
54
|
+
return this.fb.group({
|
|
55
|
+
product_id: ['', Validators.required],
|
|
56
|
+
location_id: ['', this.locationCount() > 0 ? Validators.required : null],
|
|
57
|
+
quantity: [1, [Validators.required, Validators.min(1)]],
|
|
58
|
+
purchase_price: [0, [Validators.required, Validators.min(0)]],
|
|
59
|
+
total_amount: [{ value: 0, disabled: true }],
|
|
60
|
+
particulars: ['']
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
addStockReceiptProduct() {
|
|
64
|
+
const group = this.createStockReceiptProduct();
|
|
65
|
+
const index = this.stockReceiptProducts.length;
|
|
66
|
+
group.get('quantity')?.valueChanges.pipe(debounceTime(300))
|
|
67
|
+
.subscribe(() => this.updateRowTotal(index));
|
|
68
|
+
group.get('purchase_price')?.valueChanges.pipe(debounceTime(300))
|
|
69
|
+
.subscribe(() => this.updateRowTotal(index));
|
|
70
|
+
this.stockReceiptProducts.push(group);
|
|
71
|
+
}
|
|
72
|
+
removeStockReceiptProduct(index) {
|
|
73
|
+
this.stockReceiptProducts.removeAt(index);
|
|
74
|
+
}
|
|
75
|
+
clearProducts() {
|
|
76
|
+
this.stockReceiptProducts.clear();
|
|
77
|
+
}
|
|
78
|
+
getRowTotal(index) {
|
|
79
|
+
const row = this.stockReceiptProducts.at(index);
|
|
80
|
+
if (!row) {
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
const quantity = row.get('quantity')?.value;
|
|
84
|
+
const purchasePrice = row.get('purchase_price')?.value;
|
|
85
|
+
return quantity * purchasePrice;
|
|
86
|
+
}
|
|
87
|
+
updateRowTotal(index) {
|
|
88
|
+
this.stockReceiptProducts.at(index)
|
|
89
|
+
?.get('total_amount')
|
|
90
|
+
?.setValue(this.getRowTotal(index));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* We're doing a little more than a normal submit so we won't use the
|
|
94
|
+
* techlify-form's submit method
|
|
95
|
+
*/
|
|
96
|
+
save() {
|
|
97
|
+
if (this.form.invalid) {
|
|
98
|
+
this.form.markAllAsTouched();
|
|
99
|
+
this.form.markAsDirty();
|
|
100
|
+
this.alertService.addAlert('Please check the form for errors.', 'error');
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (this.stockReceiptProducts.length === 0) {
|
|
104
|
+
this.alertService.addAlert('Please add at least one product.', 'error');
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const formData = this.form.getRawValue();
|
|
108
|
+
const data = {
|
|
109
|
+
date: moment(formData.date).format('YYYY-MM-DD'),
|
|
110
|
+
supplier_id: formData.supplier_id,
|
|
111
|
+
details: formData.particulars,
|
|
112
|
+
products: formData.stock_receipt_products.map((row) => ({
|
|
113
|
+
id: row.product_id,
|
|
114
|
+
product_id: row.product_id,
|
|
115
|
+
supplier_id: formData.supplier_id,
|
|
116
|
+
quantity: row.quantity,
|
|
117
|
+
purchase_price: row.purchase_price,
|
|
118
|
+
amount: (parseFloat(row.quantity) || 0) * (parseFloat(row.purchase_price) || 0),
|
|
119
|
+
location_id: row.location_id,
|
|
120
|
+
particulars: row.particulars,
|
|
121
|
+
}))
|
|
122
|
+
};
|
|
123
|
+
this.isWorking = true;
|
|
124
|
+
this.stockReceiptService.store(data).subscribe({
|
|
125
|
+
next: (response) => {
|
|
126
|
+
this.isWorking = false;
|
|
127
|
+
this.alertService.addAlert('Stock receipts saved successfully!', 'success');
|
|
128
|
+
this.router.navigate(['/inventory/stock-receipts']);
|
|
129
|
+
},
|
|
130
|
+
error: () => {
|
|
131
|
+
this.isWorking = false;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
cancel() {
|
|
136
|
+
this.router.navigate(['/inventory/stock-receipts']);
|
|
137
|
+
}
|
|
138
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StockReceiptBatchFormComponent, deps: [{ token: i1.FormValidatorService }, { token: i2.FormBuilder }, { token: i3.StockReceiptService }, { token: i4.Router }, { token: i5.LocationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
139
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: StockReceiptBatchFormComponent, isStandalone: true, selector: "app-stock-receipt-batch-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-column gap-1\">\n <h5>\n <span class=\"material-symbols-outlined align-middle\">download</span>\n Receive Stock\n </h5>\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>Supplier</mat-label>\n <app-searchable-selector apiUrl='api/suppliers' formControlName=\"supplier_id\"\n titleField='company_name' required></app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('supplier_id')\">{{ getErrorMessage('supplier_id') }}</mat-error>\n </mat-form-field>\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 </div>\n\n <div class=\"d-flex flex-row gap-2 justify-content-between\">\n <div class=\"w-50\">\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-error *ngIf=\"isFieldValid('particulars')\">{{ getErrorMessage('particulars')\n }}</mat-error>\n </mat-form-field>\n </div>\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\">Quantity</th>\n <th scope=\"col\">Purchase Price</th>\n <th scope=\"col\">Total Value</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_receipt_products\">\n <tr *ngFor=\"let row of stockReceiptProducts.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' formControlName=\"location_id\"></app-location-selector>\n </td>\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" type=\"number\" min=\"1\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Purchase Price</mat-label>\n <input matInput formControlName=\"purchase_price\" type=\"number\" min=\"0\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Total Value</mat-label>\n <input matInput [value]=\"getRowTotal(i) | currency\" readonly>\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline'>\n <mat-label>Particulars</mat-label>\n <input matInput formControlName=\"particulars\">\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)=\"removeStockReceiptProduct(i)\"\n matTooltip=\"Remove row\"></app-techlify-icon>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td colspan=\"8\" 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]=\"stockReceiptProducts.length === 0\">\n <mat-icon>block</mat-icon> CLEAR ALL\n </button>\n <button mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"addStockReceiptProduct()\">\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 || stockReceiptProducts.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: CommonModule }, { kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i6.CurrencyPipe, name: "currency" }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: "ngmodule", type: MaterialModule }, { kind: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.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: i10.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i10.MatLabel, selector: "mat-label" }, { kind: "directive", type: i10.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i10.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: i12.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: i13.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: SearchableSelectorModule }, { 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: "component", type: LocationSelectorComponent, selector: "app-location-selector", inputs: ["appearance", "label", "placeholder", "includeNone"] }, { kind: "ngmodule", type: TechlifyIconModule }, { kind: "component", type: i1.TechlifyIconComponent, selector: "app-techlify-icon", inputs: ["name", "size"] }], preserveWhitespaces: true });
|
|
140
|
+
}
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StockReceiptBatchFormComponent, decorators: [{
|
|
142
|
+
type: Component,
|
|
143
|
+
args: [{ selector: 'app-stock-receipt-batch-form', standalone: true, imports: [
|
|
144
|
+
CommonModule,
|
|
145
|
+
ReactiveFormsModule,
|
|
146
|
+
MaterialModule,
|
|
147
|
+
SearchableSelectorModule,
|
|
148
|
+
LocationSelectorComponent,
|
|
149
|
+
TechlifyIconModule
|
|
150
|
+
], template: "<mat-card class=\"d-flex flex-column gap-2 container\">\n <mat-card-content>\n\n <div class=\"d-flex flex-column gap-1\">\n <h5>\n <span class=\"material-symbols-outlined align-middle\">download</span>\n Receive Stock\n </h5>\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>Supplier</mat-label>\n <app-searchable-selector apiUrl='api/suppliers' formControlName=\"supplier_id\"\n titleField='company_name' required></app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('supplier_id')\">{{ getErrorMessage('supplier_id') }}</mat-error>\n </mat-form-field>\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 </div>\n\n <div class=\"d-flex flex-row gap-2 justify-content-between\">\n <div class=\"w-50\">\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-error *ngIf=\"isFieldValid('particulars')\">{{ getErrorMessage('particulars')\n }}</mat-error>\n </mat-form-field>\n </div>\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\">Quantity</th>\n <th scope=\"col\">Purchase Price</th>\n <th scope=\"col\">Total Value</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_receipt_products\">\n <tr *ngFor=\"let row of stockReceiptProducts.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' formControlName=\"location_id\"></app-location-selector>\n </td>\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Quantity</mat-label>\n <input matInput formControlName=\"quantity\" type=\"number\" min=\"1\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Purchase Price</mat-label>\n <input matInput formControlName=\"purchase_price\" type=\"number\" min=\"0\">\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline' class='fl-sm'>\n <mat-label>Total Value</mat-label>\n <input matInput [value]=\"getRowTotal(i) | currency\" readonly>\n </mat-form-field>\n </td>\n <td>\n <mat-form-field appearance='outline'>\n <mat-label>Particulars</mat-label>\n <input matInput formControlName=\"particulars\">\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)=\"removeStockReceiptProduct(i)\"\n matTooltip=\"Remove row\"></app-techlify-icon>\n </div>\n </td>\n </tr>\n </tbody>\n <tfoot>\n <tr>\n <td colspan=\"8\" 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]=\"stockReceiptProducts.length === 0\">\n <mat-icon>block</mat-icon> CLEAR ALL\n </button>\n <button mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"addStockReceiptProduct()\">\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 || stockReceiptProducts.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>" }]
|
|
151
|
+
}], ctorParameters: () => [{ type: i1.FormValidatorService }, { type: i2.FormBuilder }, { type: i3.StockReceiptService }, { type: i4.Router }, { type: i5.LocationService }] });
|
|
152
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvY2stcmVjZWlwdC1iYXRjaC1mb3JtLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2ludmVudG9yeS1jb21tb24vc3JjL2xpYi9pbnZlbnRvcnktY29tbW9uL3N0b2NrLXJlY2VpcHRzL3N0b2NrLXJlY2VpcHQtYmF0Y2gtZm9ybS9zdG9jay1yZWNlaXB0LWJhdGNoLWZvcm0uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi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ZWVlZLU1NLUREJyksXG4gICAgICAgICAgICBzdXBwbGllcl9pZDogZm9ybURhdGEuc3VwcGxpZXJfaWQsXG4gICAgICAgICAgICBkZXRhaWxzOiBmb3JtRGF0YS5wYXJ0aWN1bGFycyxcbiAgICAgICAgICAgIHByb2R1Y3RzOiBmb3JtRGF0YS5zdG9ja19yZWNlaXB0X3Byb2R1Y3RzLm1hcCgocm93OiBhbnkpID0+ICh7XG4gICAgICAgICAgICAgICAgaWQ6IHJvdy5wcm9kdWN0X2lkLFxuICAgICAgICAgICAgICAgIHByb2R1Y3RfaWQ6IHJvdy5wcm9kdWN0X2lkLFxuICAgICAgICAgICAgICAgIHN1cHBsaWVyX2lkOiBmb3JtRGF0YS5zdXBwbGllcl9pZCxcbiAgICAgICAgICAgICAgICBxdWFudGl0eTogcm93LnF1YW50aXR5LFxuICAgICAgICAgICAgICAgIHB1cmNoYXNlX3ByaWNlOiByb3cucHVyY2hhc2VfcHJpY2UsXG4gICAgICAgICAgICAgICAgYW1vdW50OiAocGFyc2VGbG9hdChyb3cucXVhbnRpdHkpIHx8IDApICogKHBhcnNlRmxvYXQocm93LnB1cmNoYXNlX3ByaWNlKSB8fCAwKSxcbiAgICAgICAgICAgICAgICBsb2NhdGlvbl9pZDogcm93LmxvY2F0aW9uX2lkLFxuICAgICAgICAgICAgICAgIHBhcnRpY3VsYXJzOiByb3cucGFydGljdWxhcnMsXG4gICAgICAgICAgICB9KSlcbiAgICAgICAgfTtcblxuICAgICAgICB0aGlzLmlzV29ya2luZyA9IHRydWU7XG4gICAgICAgIHRoaXMuc3RvY2tSZWNlaXB0U2VydmljZS5zdG9yZShkYXRhKS5zdWJzY3JpYmUoe1xuICAgICAgICAgICAgbmV4dDogKHJlc3BvbnNlOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmlzV29ya2luZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHRoaXMuYWxlcnRTZXJ2aWNlLmFkZEFsZXJ0KCdTdG9j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tYXQtZGF0ZXBpY2tlci10b2dnbGU+XG4gICAgICAgICAgICAgICAgICAgICAgICA8bWF0LWRhdGVwaWNrZXIgI3BpY2tlcj48L21hdC1kYXRlcGlja2VyPlxuICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1lcnJvciAqbmdJZj1cImlzRmllbGRWYWxpZCgnZGF0ZScpXCI+e3sgZ2V0RXJyb3JNZXNzYWdlKCdkYXRlJykgfX08L21hdC1lcnJvcj5cbiAgICAgICAgICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cblxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJkLWZsZXggZmxleC1yb3cgZ2FwLTIganVzdGlmeS1jb250ZW50LWJldHdlZW5cIj5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInctNTBcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtZm9ybS1maWVsZCBhcHBlYXJhbmNlPSdvdXRsaW5lJyBjbGFzcz1cInctMTAwXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1sYWJlbD5QYXJ0aWN1bGFyczwvbWF0LWxhYmVsPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZXh0YXJlYSBtYXRJbnB1dCBwbGFjZWhvbGRlcj1cIlBhcnRpY3VsYXJzXCIgZm9ybUNvbnRyb2xOYW1lPVwicGFydGljdWxhcnNcIj48L3RleHRhcmVhPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtZXJyb3IgKm5nSWY9XCJpc0ZpZWxkVmFsaWQoJ3BhcnRpY3VsYXJzJylcIj57eyBnZXRFcnJvck1lc3NhZ2UoJ3BhcnRpY3VsYXJzJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfX08L21hdC1lcnJvcj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvbWF0LWZvcm0tZmllbGQ+XG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPC9kaXY+XG5cbiAgICAgICAgICAgIDx0YWJsZSBjbGFzcz1cInRhYmxlIG10LTNcIj5cbiAgICAgICAgICAgICAgICA8dGhlYWQ+XG4gICAgICAgICAgICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDx0aCBzY29wZT1cImNvbFwiPiM8L3RoPlxuICAgICAgICAgICAgICAgICAgICAgICAgPHRoIHNjb3BlPVwiY29sXCI+UHJvZHVjdDwvdGg+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGggKm5nSWY9XCJsb2NhdGlvbkNvdW50KCkgPiAwXCIgc2NvcGU9XCJjb2xcIj5Mb2NhdGlvbjwvdGg+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGggc2NvcGU9XCJjb2xcIj5RdWFudGl0eTwvdGg+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGggc2NvcGU9XCJjb2xcIj5QdXJjaGFzZSBQcmljZTwvdGg+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGggc2NvcGU9XCJjb2xcIj5Ub3RhbCBWYWx1ZTwvdGg+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGggc2NvcGU9XCJjb2xcIj5QYXJ0aWN1bGFyczwvdGg+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGggc2NvcGU9XCJjb2xcIiBjbGFzcz1cInRleHQtY2VudGVyXCIgd2lkdGg9XCI1MFwiPjwvdGg+XG4gICAgICAgICAgICAgICAgICAgIDwvdHI+XG4gICAgICAgICAgICAgICAgPC90aGVhZD5cbiAgICAgICAgICAgICAgICA8dGJvZHkgZm9ybUFycmF5TmFtZT1cInN0b2NrX3JlY2VpcHRfcHJvZHVjdHNcIj5cbiAgICAgICAgICAgICAgICAgICAgPHRyICpuZ0Zvcj1cImxldCByb3cgb2Ygc3RvY2tSZWNlaXB0UHJvZHVjdHMuY29udHJvbHM7IGxldCBpID0gaW5kZXhcIiBbZm9ybUdyb3VwTmFtZV09XCJpXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGggc2NvcGU9XCJyb3dcIj57eyBpICsgMSB9fTwvdGg+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1mb3JtLWZpZWxkIGFwcGVhcmFuY2U9J291dGxpbmUnIGNsYXNzPVwidy0xMDBcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1sYWJlbD5Qcm9kdWN0PC9tYXQtbGFiZWw+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxhcHAtc2VhcmNoYWJsZS1zZWxlY3RvciBhcGlVcmw9J2FwaS9wcm9kdWN0cycgZm9ybUNvbnRyb2xOYW1lPVwicHJvZHVjdF9pZFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZUZpZWxkPSduYW1lJyBbY2FjaGVdPVwidHJ1ZVwiIHJlcXVpcmVkPjwvYXBwLXNlYXJjaGFibGUtc2VsZWN0b3I+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGQgKm5nSWY9XCJsb2NhdGlvbkNvdW50KCkgPiAwXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGFwcC1sb2NhdGlvbi1zZWxlY3RvciBhcHBlYXJhbmNlPSdvdXRsaW5lJyBmb3JtQ29udHJvbE5hbWU9XCJsb2NhdGlvbl9pZFwiPjwvYXBwLWxvY2F0aW9uLXNlbGVjdG9yPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDx0ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bWF0LWZvcm0tZmllbGQgYXBwZWFyYW5jZT0nb3V0bGluZScgY2xhc3M9J2ZsLXNtJz5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1sYWJlbD5RdWFudGl0eTwvbWF0LWxhYmVsPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgbWF0SW5wdXQgZm9ybUNvbnRyb2xOYW1lPVwicXVhbnRpdHlcIiB0eXBlPVwibnVtYmVyXCIgbWluPVwiMVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvbWF0LWZvcm0tZmllbGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgPHRkPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtZm9ybS1maWVsZCBhcHBlYXJhbmNlPSdvdXRsaW5lJyBjbGFzcz0nZmwtc20nPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bWF0LWxhYmVsPlB1cmNoYXNlIFByaWNlPC9tYXQtbGFiZWw+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBtYXRJbnB1dCBmb3JtQ29udHJvbE5hbWU9XCJwdXJjaGFzZV9wcmljZVwiIHR5cGU9XCJudW1iZXJcIiBtaW49XCIwXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1mb3JtLWZpZWxkIGFwcGVhcmFuY2U9J291dGxpbmUnIGNsYXNzPSdmbC1zbSc+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtbGFiZWw+VG90YWwgVmFsdWU8L21hdC1sYWJlbD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IG1hdElucHV0IFt2YWx1ZV09XCJnZXRSb3dUb3RhbChpKSB8IGN1cnJlbmN5XCIgcmVhZG9ubHk+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICA8dGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1mb3JtLWZpZWxkIGFwcGVhcmFuY2U9J291dGxpbmUnPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bWF0LWxhYmVsPlBhcnRpY3VsYXJzPC9tYXQtbGFiZWw+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBtYXRJbnB1dCBmb3JtQ29udHJvbE5hbWU9XCJwYXJ0aWN1bGFyc1wiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvbWF0LWZvcm0tZmllbGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgPHRkIGNsYXNzPVwidGV4dC1jZW50ZXIgYWxpZ24tbWlkZGxlXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImQtZmxleCBnYXAtMiBqdXN0aWZ5LWNvbnRlbnQtY2VudGVyIGFsaWduLWl0ZW1zLWNlbnRlciB0ZXh0LXNlY29uZGFyeVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YXBwLXRlY2hsaWZ5LWljb24gcm9sZT0nYnV0dG9uJyBuYW1lPSdkZWxldGUnIChjbGljayk9XCJyZW1vdmVTdG9ja1JlY2VpcHRQcm9kdWN0KGkpXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hdFRvb2x0aXA9XCJSZW1vdmUgcm93XCI+PC9hcHAtdGVjaGxpZnktaWNvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICAgIDwvdHI+XG4gICAgICAgICAgICAgICAgPC90Ym9keT5cbiAgICAgICAgICAgICAgICA8dGZvb3Q+XG4gICAgICAgICAgICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjb2xzcGFuPVwiOFwiIGNsYXNzPVwidGV4dC1lbmRcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZC1mbGV4IGZsZXgtcm93IGdhcC0yIGp1c3RpZnktY29udGVudC1lbmRcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBtYXQtYnV0dG9uIGNvbG9yPVwicHJpbWFyeVwiIHR5cGU9XCJidXR0b25cIiAoY2xpY2spPVwiY2xlYXJQcm9kdWN0cygpXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtkaXNhYmxlZF09XCJzdG9ja1JlY2VpcHRQcm9kdWN0cy5sZW5ndGggPT09IDBcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtaWNvbj5ibG9jazwvbWF0LWljb24+IENMRUFSIEFMTFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBtYXQtcmFpc2VkLWJ1dHRvbiBjb2xvcj1cInByaW1hcnlcIiB0eXBlPVwiYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjbGljayk9XCJhZGRTdG9ja1JlY2VpcHRQcm9kdWN0KClcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtaWNvbj5hZGQ8L21hdC1pY29uPiBBRERcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICA8L3RyPlxuICAgICAgICAgICAgICAgIDwvdGZvb3Q+XG4gICAgICAgICAgICA8L3RhYmxlPlxuXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZC1mbGV4IGp1c3RpZnktY29udGVudC1lbmQgYWxpZ24taXRlbXMtY2VudGVyIGdhcC0yIG10LTJcIj5cbiAgICAgICAgICAgICAgICA8YnV0dG9uIFtkaXNhYmxlZF09XCJpc1dvcmtpbmdcIiBtYXQtZmxhdC1idXR0b24gdHlwZT1cImJ1dHRvblwiIChjbGljayk9XCJjYW5jZWwoKVwiPkNhbmNlbDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgIDxidXR0b24gW2Rpc2FibGVkXT1cImlzV29ya2luZyB8fCBzdG9ja1JlY2VpcHRQcm9kdWN0cy5sZW5ndGggPT09IDBcIiBtYXQtcmFpc2VkLWJ1dHRvbiBjb2xvcj1cInByaW1hcnlcIlxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwic3VibWl0XCI+U2F2ZTwvYnV0dG9uPlxuICAgICAgICAgICAgPC9kaXY+XG5cbiAgICAgICAgPC9mb3JtPlxuXG4gICAgPC9tYXQtY2FyZC1jb250ZW50PlxuPC9tYXQtY2FyZD4iXX0=
|
|
@@ -159,7 +159,7 @@ export class StockReceiptFormComponent extends TechlifyFormComponentInterface {
|
|
|
159
159
|
this.form.get('amount')?.setValue(amount);
|
|
160
160
|
}
|
|
161
161
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StockReceiptFormComponent, deps: [{ token: i1.FormValidatorService }, { token: i2.FormBuilder }, { token: i3.StockReceiptService }, { token: i1.DateUtils }, { token: i4.LocationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
162
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: StockReceiptFormComponent, selector: "app-stock-receipt-form", inputs: { product: "product", stockReceipt: "stockReceipt", stockReceiptProduct: "stockReceiptProduct", latestLocationId: "latestLocationId" }, outputs: { saved: "saved", cancelled: "cancelled" }, usesInheritance: true, ngImport: i0, template: "<h3 class=\"text-center\">{{ stockReceipt?.id ? 'Edit' : 'Receive' }} Stock for {{ product?.name }}</h3>\n<form [formGroup]=\"form\" class=\"d-flex flex-column gap-1 justify-content-start\" (submit)=\"save()\">\n <app-payee-selector label=\"Supplier\" formControlName=\"supplier_id\" appearance=\"fill\"\n [showAddButton]=\"true\"></app-payee-selector>\n\n <app-location-selector *ngIf=\"locationsCount > 1\" formControlName=\"location_id\"></app-location-selector>\n\n <mat-form-field>\n <mat-label>Date</mat-label>\n <input matInput [matDatepicker]=\"datePicker\" formControlName=\"date\" (focus)=\"datePicker.open()\" />\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 <div techlifyFeatureEnabled=\"product-batch-numbers\" class=\"d-flex flex-column gap-2 w-100\">\n <mat-form-field>\n <mat-label>Batch #</mat-label>\n <input type=\"text\" formControlName=\"batch_number\" matInput placeholder=\"Batch #\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Expires On</mat-label>\n <input matInput [matDatepicker]=\"expiresOnPicker\" formControlName=\"expires_on\" (focus)=\"expiresOnPicker.open()\" />\n <mat-datepicker #expiresOnPicker></mat-datepicker>\n </mat-form-field>\n </div>\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 [disabled]=\"isWorking\" mat-raised-button color=\"primary\" type=\"submit\">Save</button>\n <button [disabled]=\"isWorking\" (click)=\"cancelled.emit()\" mat-flat-button type=\"button\">Cancel</button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.PayeeSelectorComponent, selector: "app-payee-selector", inputs: ["label", "appearance", "required", "showAddButton", "multiple"] }, { 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.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: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i8.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i10.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: i1.TechlifyFeatureEnabledDirective, selector: "[techlifyFeatureEnabled]", inputs: ["techlifyFeatureEnabled"] }, { kind: "component", type: i11.LocationSelectorComponent, selector: "app-location-selector", inputs: ["label", "placeholder", "includeNone"] }], preserveWhitespaces: true });
|
|
162
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: StockReceiptFormComponent, selector: "app-stock-receipt-form", inputs: { product: "product", stockReceipt: "stockReceipt", stockReceiptProduct: "stockReceiptProduct", latestLocationId: "latestLocationId" }, outputs: { saved: "saved", cancelled: "cancelled" }, usesInheritance: true, ngImport: i0, template: "<h3 class=\"text-center\">{{ stockReceipt?.id ? 'Edit' : 'Receive' }} Stock for {{ product?.name }}</h3>\n<form [formGroup]=\"form\" class=\"d-flex flex-column gap-1 justify-content-start\" (submit)=\"save()\">\n <app-payee-selector label=\"Supplier\" formControlName=\"supplier_id\" appearance=\"fill\"\n [showAddButton]=\"true\"></app-payee-selector>\n\n <app-location-selector *ngIf=\"locationsCount > 1\" formControlName=\"location_id\"></app-location-selector>\n\n <mat-form-field>\n <mat-label>Date</mat-label>\n <input matInput [matDatepicker]=\"datePicker\" formControlName=\"date\" (focus)=\"datePicker.open()\" />\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 <div techlifyFeatureEnabled=\"product-batch-numbers\" class=\"d-flex flex-column gap-2 w-100\">\n <mat-form-field>\n <mat-label>Batch #</mat-label>\n <input type=\"text\" formControlName=\"batch_number\" matInput placeholder=\"Batch #\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Expires On</mat-label>\n <input matInput [matDatepicker]=\"expiresOnPicker\" formControlName=\"expires_on\" (focus)=\"expiresOnPicker.open()\" />\n <mat-datepicker #expiresOnPicker></mat-datepicker>\n </mat-form-field>\n </div>\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 [disabled]=\"isWorking\" mat-raised-button color=\"primary\" type=\"submit\">Save</button>\n <button [disabled]=\"isWorking\" (click)=\"cancelled.emit()\" mat-flat-button type=\"button\">Cancel</button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.PayeeSelectorComponent, selector: "app-payee-selector", inputs: ["label", "appearance", "required", "showAddButton", "multiple"] }, { 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.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: "component", type: i7.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i8.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i10.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: i1.TechlifyFeatureEnabledDirective, selector: "[techlifyFeatureEnabled]", inputs: ["techlifyFeatureEnabled"] }, { kind: "component", type: i11.LocationSelectorComponent, selector: "app-location-selector", inputs: ["appearance", "label", "placeholder", "includeNone"] }], preserveWhitespaces: true });
|
|
163
163
|
}
|
|
164
164
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StockReceiptFormComponent, decorators: [{
|
|
165
165
|
type: Component,
|
|
@@ -47,7 +47,7 @@ export class StockReceiptViewComponent {
|
|
|
47
47
|
this.location.back();
|
|
48
48
|
}
|
|
49
49
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StockReceiptViewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.StockReceiptService }, { token: i3.Location }], target: i0.ɵɵFactoryTarget.Component });
|
|
50
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: StockReceiptViewComponent, selector: "app-stock-receipt-view", ngImport: i0, template: "<mat-progress-bar mode=\"indeterminate\" *ngIf=\"isLoading\"></mat-progress-bar>\n\n<div *ngIf=\"stockReceipt\" class=\"d-flex flex-column justify-content-start gap-2\">\n <mat-card>\n <mat-card-content>\n <h3 class=\"mb-0\">Stock Receipt for {{ stockReceipt?.stock_receipt_products[0]?.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\"> campaign </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\">\n <app-stock-receipt-form-button [stockReceipt]=\"stockReceipt\" [product]=\"stockReceipt?.product\"\n (saved)=\"loadData()\">\n </app-stock-receipt-form-button>\n <app-stock-receipt-delete-button [stockReceipt]=\"stockReceipt\" (deleted)=\"redirectBack()\">\n </app-stock-receipt-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', stockReceipt?.stock_receipt_products[0]?.product?.id, 'view']\">\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.product?.name }}</p>\n </a>\n <small *ngIf=\"stockReceipt?.stock_receipt_products[0]?.product?.sku\">{{\n stockReceipt?.stock_receipt_products[0]?.product?.sku }}</small>\n </div>\n <div class=\"d-flex flex-column justify-content-end gap-0\">\n <small *ngIf=\"stockReceipt?.date\">{{ stockReceipt?.date | date }}</small>\n <ng-container *ngIf=\"stockReceipt?.stock_receipt_products[0]?.batch?.expires_on\">\n <small techlifyFeatureEnabled=\"product-batch-numbers\">\n Expires on {{ stockReceipt?.stock_receipt_products[0]?.batch?.expires_on | date }}\n </small>\n </ng-container>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-6\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.purchase_price\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Purchase Price</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.purchase_price | currency }}</p>\n </div>\n </div>\n\n <div class=\"col-6\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.supplier\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Supplier</small>\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/suppliers', stockReceipt?.stock_receipt_products[0]?.supplier?.id, 'view']\">\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.supplier?.company_name }}</p>\n </a>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-6\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.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\">{{ stockReceipt?.stock_receipt_products[0]?.quantity }}</h3>\n <small class=\"text-secondary\">{{ stockReceipt?.stock_receipt_products[0]?.product?.measure?.title\n }}</small>\n </div>\n </div>\n </div>\n\n <div class=\"col-6\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.amount\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Total Value</small>\n <h3 class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.amount | currency }}</h3>\n </div>\n </div>\n </div>\n <div class=\"row\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.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\">{{ stockReceipt?.stock_receipt_products[0]?.particulars }}</p>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-6\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.location\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Location</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.location?.title }}</p>\n </div>\n </div>\n <ng-container *ngIf=\"stockReceipt?.stock_receipt_products[0]?.batch\">\n <div class=\"col-6\" techlifyFeatureEnabled=\"product-batch-numbers\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Batch</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.batch?.batch_number }}</p>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"row\" *ngIf=\"stockReceipt?.creator\">\n <div class=\"col-12\">\n <small class=\"mb-0\">\n <span class=\"text-secondary\">Created By</span> {{ stockReceipt?.creator?.name }}\n <span class=\"text-secondary\">On</span> {{ stockReceipt?.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=\"StockReceipt\"\n [relatedModelId]=\"stockReceipt?.id\"></app-note-list>\n </div>\n\n <div style=\"width: calc(100% - 350px - 0.5rem)\">\n <app-entity-files-view-all title=\"Document\" [entityId]=\"stockReceipt?.id\" entityType=\"StockReceipt\">\n </app-entity-files-view-all>\n </div>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "
|
|
50
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: StockReceiptViewComponent, selector: "app-stock-receipt-view", ngImport: i0, template: "<mat-progress-bar mode=\"indeterminate\" *ngIf=\"isLoading\"></mat-progress-bar>\n\n<div *ngIf=\"stockReceipt\" class=\"d-flex flex-column justify-content-start gap-2\">\n <mat-card>\n <mat-card-content>\n <h3 class=\"mb-0\">Stock Receipt for {{ stockReceipt?.stock_receipt_products[0]?.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\"> campaign </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\">\n <app-stock-receipt-form-button [stockReceipt]=\"stockReceipt\" [product]=\"stockReceipt?.product\"\n (saved)=\"loadData()\">\n </app-stock-receipt-form-button>\n <app-stock-receipt-delete-button [stockReceipt]=\"stockReceipt\" (deleted)=\"redirectBack()\">\n </app-stock-receipt-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', stockReceipt?.stock_receipt_products[0]?.product?.id, 'view']\">\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.product?.name }}</p>\n </a>\n <small *ngIf=\"stockReceipt?.stock_receipt_products[0]?.product?.sku\">{{\n stockReceipt?.stock_receipt_products[0]?.product?.sku }}</small>\n </div>\n <div class=\"d-flex flex-column justify-content-end gap-0\">\n <small *ngIf=\"stockReceipt?.date\">{{ stockReceipt?.date | date }}</small>\n <ng-container *ngIf=\"stockReceipt?.stock_receipt_products[0]?.batch?.expires_on\">\n <small techlifyFeatureEnabled=\"product-batch-numbers\">\n Expires on {{ stockReceipt?.stock_receipt_products[0]?.batch?.expires_on | date }}\n </small>\n </ng-container>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-6\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.purchase_price\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Purchase Price</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.purchase_price | currency }}</p>\n </div>\n </div>\n\n <div class=\"col-6\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.supplier\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Supplier</small>\n <a class=\"text-decoration-none text-black\"\n [routerLink]=\"['/inventory/suppliers', stockReceipt?.stock_receipt_products[0]?.supplier?.id, 'view']\">\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.supplier?.company_name }}</p>\n </a>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-6\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.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\">{{ stockReceipt?.stock_receipt_products[0]?.quantity }}</h3>\n <small class=\"text-secondary\">{{ stockReceipt?.stock_receipt_products[0]?.product?.measure?.title\n }}</small>\n </div>\n </div>\n </div>\n\n <div class=\"col-6\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.amount\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Total Value</small>\n <h3 class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.amount | currency }}</h3>\n </div>\n </div>\n </div>\n <div class=\"row\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.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\">{{ stockReceipt?.stock_receipt_products[0]?.particulars }}</p>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-6\" *ngIf=\"stockReceipt?.stock_receipt_products[0]?.location\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Location</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.location?.title }}</p>\n </div>\n </div>\n <ng-container *ngIf=\"stockReceipt?.stock_receipt_products[0]?.batch\">\n <div class=\"col-6\" techlifyFeatureEnabled=\"product-batch-numbers\">\n <div class=\"d-flex flex-column gap-0\">\n <small class=\"text-secondary\">Batch</small>\n <p class=\"mb-0\">{{ stockReceipt?.stock_receipt_products[0]?.batch?.batch_number }}</p>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"row\" *ngIf=\"stockReceipt?.creator\">\n <div class=\"col-12\">\n <small class=\"mb-0\">\n <span class=\"text-secondary\">Created By</span> {{ stockReceipt?.creator?.name }}\n <span class=\"text-secondary\">On</span> {{ stockReceipt?.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=\"StockReceipt\"\n [relatedModelId]=\"stockReceipt?.id\"></app-note-list>\n </div>\n\n <div style=\"width: calc(100% - 350px - 0.5rem)\">\n <app-entity-files-view-all title=\"Document\" [entityId]=\"stockReceipt?.id\" entityType=\"StockReceipt\">\n </app-entity-files-view-all>\n </div>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i4.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i5.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i6.StockReceiptFormButtonComponent, selector: "app-stock-receipt-form-button", inputs: ["product", "stockReceipt", "latestLocationId", "icon"], outputs: ["saved"] }, { kind: "component", type: i7.EntityFilesViewAllComponent, selector: "app-entity-files-view-all", inputs: ["entityId", "entityType", "viewOnly", "removeSearch", "hideTitleAndDetails", "displayMode", "allowMultipleFiles", "allowBulkUpdate", "viewMode", "fileDropperHeight", "isShowDragDropSection", "useTechlifyTags", "techlifyTagCategories", "techlifyTagConfig", "title", "permission"] }, { kind: "directive", type: i7.TechlifyFeatureEnabledDirective, selector: "[techlifyFeatureEnabled]", inputs: ["techlifyFeatureEnabled"] }, { kind: "component", type: i7.NoteListComponent, selector: "app-note-list", inputs: ["relatedModelId", "modelType", "readonly", "labelText", "commentsView", "viewMode"] }, { kind: "component", type: i8.StockReceiptDeleteButtonComponent, selector: "app-stock-receipt-delete-button", inputs: ["stockReceipt"], outputs: ["deleted"] }, { kind: "pipe", type: i3.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i3.DatePipe, name: "date" }], preserveWhitespaces: true });
|
|
51
51
|
}
|
|
52
52
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StockReceiptViewComponent, decorators: [{
|
|
53
53
|
type: Component,
|