Expand create transaction form.

This commit is contained in:
James Cole
2024-01-04 14:59:37 +01:00
parent 1ba7847d84
commit 566bb2f097
26 changed files with 877 additions and 723 deletions

View File

@@ -29,6 +29,48 @@ function getAccount() {
};
}
export function defaultErrorSet() {
return {
description: [],
// amount information:
amount: [],
currency_code: [],
foreign_amount: [],
foreign_currency_code: [],
// source and destination
source_account: [],
destination_account: [],
// meta data information:
budget_id: [],
category_name: [],
piggy_bank_id: [],
bill_id: [],
tags: [],
notes: [],
// other meta fields:
internal_reference: [],
external_url: [],
// map
latitude: [],
longitude: [],
zoom_level: [],
// date and time
date: [],
interest_date: [],
book_date: [],
process_date: [],
due_date: [],
payment_date: [],
invoice_date: [],
};
}
export function createEmptySplit() {
let now = new Date();
let formatted = format(now, 'yyyy-MM-dd HH:mm');
@@ -75,44 +117,6 @@ export function createEmptySplit() {
payment_date: '',
invoice_date: '',
errors: {
description: [],
// amount information:
amount: [],
currency_code: [],
foreign_amount: [],
foreign_currency_code: [],
// source and destination
source_account: [],
destination_account: [],
// meta data information:
budget_id: [],
category_name: [],
piggy_bank_id: [],
bill_id: [],
tags: [],
notes: [],
// other meta fields:
internal_reference: [],
external_url: [],
// map
latitude: [],
longitude: [],
zoom_level: [],
// date and time
date: [],
interest_date: [],
book_date: [],
process_date: [],
due_date: [],
payment_date: [],
invoice_date: [],
},
errors: defaultErrorSet(),
};
}