Feature: Changed the unposted report to entries report with paging, sorting, etc.
This commit is contained in:
@ -364,20 +364,21 @@ export class PurchaseComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
productSelected(event: MatAutocompleteSelectedEvent): void {
|
||||
const product: Product = event.option.value;
|
||||
const addRowForm: FormControl = this.form.get('addRow') as FormControl;
|
||||
this.product = product;
|
||||
((this.form.get('addRow') as FormControl).get('price') as FormControl).setValue(product.price);
|
||||
(addRowForm.get('price') as FormControl).setValue(product.price);
|
||||
if (product.isRateContracted) {
|
||||
((this.form.get('addRow') as FormControl).get('price') as FormControl).disable();
|
||||
((this.form.get('addRow') as FormControl).get('tax') as FormControl).disable();
|
||||
((this.form.get('addRow') as FormControl).get('discount') as FormControl).disable();
|
||||
((this.form.get('addRow') as FormControl).get('tax') as FormControl).setValue('RC');
|
||||
((this.form.get('addRow') as FormControl).get('discount') as FormControl).setValue('RC');
|
||||
(addRowForm.get('price') as FormControl).disable();
|
||||
(addRowForm.get('tax') as FormControl).disable();
|
||||
(addRowForm.get('discount') as FormControl).disable();
|
||||
(addRowForm.get('tax') as FormControl).setValue('RC');
|
||||
(addRowForm.get('discount') as FormControl).setValue('RC');
|
||||
} else {
|
||||
((this.form.get('addRow') as FormControl).get('price') as FormControl).enable();
|
||||
((this.form.get('addRow') as FormControl).get('tax') as FormControl).enable();
|
||||
((this.form.get('addRow') as FormControl).get('discount') as FormControl).enable();
|
||||
((this.form.get('addRow') as FormControl).get('tax') as FormControl).setValue('');
|
||||
((this.form.get('addRow') as FormControl).get('discount') as FormControl).setValue('');
|
||||
(addRowForm.get('price') as FormControl).enable();
|
||||
(addRowForm.get('tax') as FormControl).enable();
|
||||
(addRowForm.get('discount') as FormControl).enable();
|
||||
(addRowForm.get('tax') as FormControl).setValue('');
|
||||
(addRowForm.get('discount') as FormControl).setValue('');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user