This commit is contained in:
James Cole
2019-08-27 07:51:34 +02:00
parent 7720519076
commit 33d0b8ca22
4 changed files with 184 additions and 169 deletions

View File

@@ -415,7 +415,7 @@
}
} else {
console.log('Will redirect to previous URL. (' + previousUri + ')');
window.location.href = window.previousUri + '?transaction_group_id=' + groupId+ '&message=created';
window.location.href = window.previousUri + '?transaction_group_id=' + groupId + '&message=created';
}
},
@@ -597,6 +597,11 @@
break;
}
}
// unique some things
this.transactions[transactionIndex].errors.source_account =
Array.from(new Set(this.transactions[transactionIndex].errors.source_account));
this.transactions[transactionIndex].errors.destination_account =
Array.from(new Set(this.transactions[transactionIndex].errors.destination_account));
}
}
},
@@ -605,73 +610,73 @@
},
addTransactionToArray: function (e) {
this.transactions.push({
description: "",
date: "",
amount: "",
category: "",
piggy_bank: 0,
errors: {
source_account: [],
destination_account: [],
description: [],
amount: [],
date: [],
budget_id: [],
foreign_amount: [],
category: [],
piggy_bank: [],
tags: [],
// custom fields:
custom_errors: {
interest_date: [],
book_date: [],
process_date: [],
due_date: [],
payment_date: [],
invoice_date: [],
internal_reference: [],
notes: [],
attachments: [],
},
},
budget: 0,
tags: [],
custom_fields: {
"interest_date": "",
"book_date": "",
"process_date": "",
"due_date": "",
"payment_date": "",
"invoice_date": "",
"internal_reference": "",
"notes": "",
"attachments": []
},
foreign_amount: {
amount: "",
currency_id: 0
},
source_account: {
id: 0,
name: "",
type: "",
currency_id: 0,
currency_name: '',
currency_code: '',
currency_decimal_places: 2,
allowed_types: []
},
destination_account: {
id: 0,
name: "",
type: "",
currency_id: 0,
currency_name: '',
currency_code: '',
currency_decimal_places: 2,
allowed_types: []
}
});
description: "",
date: "",
amount: "",
category: "",
piggy_bank: 0,
errors: {
source_account: [],
destination_account: [],
description: [],
amount: [],
date: [],
budget_id: [],
foreign_amount: [],
category: [],
piggy_bank: [],
tags: [],
// custom fields:
custom_errors: {
interest_date: [],
book_date: [],
process_date: [],
due_date: [],
payment_date: [],
invoice_date: [],
internal_reference: [],
notes: [],
attachments: [],
},
},
budget: 0,
tags: [],
custom_fields: {
"interest_date": "",
"book_date": "",
"process_date": "",
"due_date": "",
"payment_date": "",
"invoice_date": "",
"internal_reference": "",
"notes": "",
"attachments": []
},
foreign_amount: {
amount: "",
currency_id: 0
},
source_account: {
id: 0,
name: "",
type: "",
currency_id: 0,
currency_name: '',
currency_code: '',
currency_decimal_places: 2,
allowed_types: []
},
destination_account: {
id: 0,
name: "",
type: "",
currency_id: 0,
currency_name: '',
currency_code: '',
currency_decimal_places: 2,
allowed_types: []
}
});
if (this.transactions.length === 1) {
// set first date.
let today = new Date();