Fix the import, etc on this. While entering discount in sale, it checks the max allowed.
31 lines
1.3 KiB
HTML
31 lines
1.3 KiB
HTML
<h2 mat-dialog-title>Discount</h2>
|
|
<mat-dialog-content>
|
|
<form [formGroup]="form" fxLayout="column">
|
|
<mat-table #table [dataSource]="dataSource" formArrayName="discounts">
|
|
<!-- Name Column -->
|
|
<ng-container matColumnDef="name">
|
|
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.name }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Discount Column -->
|
|
<ng-container matColumnDef="discount">
|
|
<mat-header-cell *matHeaderCellDef class="center" fxFlex>Discount</mat-header-cell>
|
|
<mat-cell *matCellDef="let row; let i = index" class="center" [formGroupName]="i" fxFlex>
|
|
<mat-form-field>
|
|
<input matInput type="number" formControlName="discount" autocomplete="off" />
|
|
<mat-hint>Maximum Discount {{ row.discountLimit | percent: '1.2-2' }}</mat-hint>
|
|
</mat-form-field>
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
|
</mat-table>
|
|
</form>
|
|
</mat-dialog-content>
|
|
<mat-dialog-actions align="end">
|
|
<button mat-button [mat-dialog-close]="false">Cancel</button>
|
|
<button mat-button (click)="accept()" color="primary">Ok</button>
|
|
</mat-dialog-actions>
|