Feature: Changed the unposted report to entries report with paging, sorting, etc.

This commit is contained in:
2021-09-14 11:36:40 +05:30
parent d34c8ea0a4
commit 176559466a
35 changed files with 776 additions and 518 deletions

View File

@ -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('');
}
}