Amended purchase validation and submission

This commit is contained in:
piratefinn 2018-03-13 12:49:30 +00:00
parent 977cee339d
commit 065aa80e98
4 changed files with 31 additions and 35 deletions

View file

@ -177,14 +177,15 @@ export class AddDataComponent implements OnInit {
}
transactionFormValidate() {
if (this.submitOrg.name.length === 0 ||
this.submitOrg.town.length === 0 ||
this.amount === 0 ||
this.recurringPurchase &&
!this.recurringType) {
this.transactionFormInvalid = true;
} else {
if (this.submitOrg.name.length &&
this.amount &&
(this.recurringPurchase &&
this.recurringType ||
!this.recurringPurchase &&
!this.recurringType)) {
this.transactionFormInvalid = false;
} else {
this.transactionFormInvalid = true;
}
}