// line deletion and addition buttons
td_add_del = add_td(tr);
add_button(td_add_del, 'add new', false, function() {
- new_line = {error: '', comment: '', booked: {account: '', amount: '', currency: ''}};
+ new_line = {error: '', comment: '', booked: {account: '', amount: 'None', currency: ''}};
dat_lines.splice(i + 1, 0, new_line);
});
if (i > 0) {
function mirror() {
dat_lines.slice(1).forEach((dat_line) => {
- let inverted_amount = `-${dat_line.booked.amount}`;
- if (inverted_amount.startsWith('--')) {
- inverted_amount = inverted_amount.slice(2);
+ let inverted_amount = 'None';
+ if (dat_line.booked.amount != 'None') {
+ inverted_amount = `-${dat_line.booked.amount}`;
+ if (inverted_amount.startsWith('--')) {
+ inverted_amount = inverted_amount.slice(2);
+ }
}
dat_lines.push({
error: '',