update type descriptions

This commit is contained in:
Patrick Nagurny
2018-11-27 16:52:55 -05:00
parent 70a20b6611
commit 947c9b34e0

View File

@@ -142,9 +142,8 @@ export class NewTransactionPage {
let splits = this.form.get('splits') as FormArray; let splits = this.form.get('splits') as FormArray;
if (splits.length > 0) { if (splits.length > 0) {
let account = this.getFirstAccount();
splits.at(0).patchValue({ splits.at(0).patchValue({
accountId: account.id accountId: val
}); });
} }
}); });
@@ -376,7 +375,17 @@ export class NewTransactionPage {
let type = this.form.value.type; let type = this.form.value.type;
if (type) { if (type) {
str += type.charAt(0).toUpperCase() + type.substr(1); switch(type) {
case 'expense':
str += 'Expense';
break;
case 'income':
str += 'Income';
break;
case 'openingBalance':
str += 'Opening Balance';
break;
}
if (account) { if (account) {
str += ' (' + account.name + ')'; str += ' (' + account.name + ')';
} }