48 lines
1.7 KiB
HTML
48 lines
1.7 KiB
HTML
@if (itemResource.isLoading()) {
|
|
<app-skeleton-loader type="card" [count]="1" />
|
|
} @else if (itemResource.error()) {
|
|
<app-error-state (retryAction)="itemResource.reload()" />
|
|
} @else {
|
|
<h2>Customer</h2>
|
|
<form class="flex-col">
|
|
<div class="row-container">
|
|
<mat-form-field class="flex-auto">
|
|
<mat-label>Name</mat-label>
|
|
<input matInput [formField]="form.name" />
|
|
</mat-form-field>
|
|
</div>
|
|
<div class="row-container">
|
|
<mat-form-field class="flex-auto">
|
|
<mat-label>Phone</mat-label>
|
|
<input matInput [formField]="form.phone" />
|
|
</mat-form-field>
|
|
</div>
|
|
<div class="row-container">
|
|
<mat-form-field class="flex-auto">
|
|
<mat-label>Address</mat-label>
|
|
<textarea matInput [formField]="form.address"> </textarea>
|
|
</mat-form-field>
|
|
</div>
|
|
<div class="row-container">
|
|
<mat-checkbox [formField]="form.printInBill">Print in Bill?</mat-checkbox>
|
|
</div>
|
|
<mat-divider></mat-divider>
|
|
<div class="discounts">
|
|
@for (r of item().discounts; track r.id; let i = $index) {
|
|
<div class="row-container">
|
|
<mat-form-field class="flex-auto">
|
|
<mat-label>Discount on {{ r.name }}</mat-label>
|
|
<input matInput type="number" [formField]="form.discounts[i].discount" />
|
|
<span matTextSuffix>%</span>
|
|
<mat-hint>Max {{ r.limit | percent: '1.2-2' }}</mat-hint>
|
|
</mat-form-field>
|
|
</div>
|
|
}
|
|
</div>
|
|
</form>
|
|
<div class="row-container">
|
|
<button type="button" mat-raised-button color="primary" class="" (click)="save()">Save</button>
|
|
<button type="button" mat-raised-button color="warn" (click)="confirmDelete()">Delete</button>
|
|
</div>
|
|
}
|