Refactored customer discount and choose discount. They were using the same schema unnecessarily which was leading to confusion.
This commit is contained in:
1 parent
c5eaeb1497
commit
516b22ed1c
15 files changed
+66
-42
No files matched your search
@@ -39,6 +39,7 @@
|
||||
<mat-label>Discount on {{ r.name }}</mat-label>
|
||||
<input matInput formControlName="discount" />
|
||||
<span matSuffix>%</span>
|
||||
<mat-hint>Max {{ r.limit | percent : '1.2-2' }}</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -131,7 +131,7 @@ export class CustomerDetailComponent implements OnInit, AfterViewInit {
|
||||
if (array_item && array_item?.discount) {
|
||||
item.discount = Math.max(Math.min(round(array_item.discount / 100, 5), 100), 0);
|
||||
} else {
|
||||
item.discount = null;
|
||||
item.discount = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user