Fix some tag related issues.

This commit is contained in:
James Cole 2019-08-11 07:29:05 +02:00
parent f67a9547cc
commit 788bde5562
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
5 changed files with 18 additions and 7 deletions

2
public/v1/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@ -106,7 +106,7 @@ function getBalanceBox() {
// show balance in "sums", show single entry in list.
for (x in data.sums) {
$('#box-balance-sums').html(data.sums[x]);
$('#box-balance-list').html(data.incomes[x] + ' / ' + data.expenses[x]);
$('#box-balance-list').html(data.incomes[x] + ' + ' + data.expenses[x]);
}
return;
}
@ -120,7 +120,7 @@ function getBalanceBox() {
sum = data.sums[x];
expense = data.expenses[x];
income = data.incomes[x];
string = income + ' / ' + expense + ': ' + sum;
string = income + ' + ' + expense + ': ' + sum;
if (data.preferred == x) {
$('#box-balance-list').html(current + '<span title="' + string + '">' + string + '</span>' + '<br>');
}
@ -136,7 +136,7 @@ function getBalanceBox() {
sum = data.sums[x];
expense = data.expenses[x];
income = data.incomes[x];
string = income + ' / ' + expense + ': ' + sum;
string = income + ' + ' + expense + ': ' + sum;
if (data.preferred != x) {
$('#box-balance-list').html(current + '<span title="' + string + '">' + string + '</span>' + '<br>');
}

View File

@ -297,7 +297,7 @@
foreignCurrency = null;
// loop tags
for (let tagKey in row.tags) {
if (row.tags.hasOwnProperty(tagKey) && /^0$|^[1-9]\d*$/.test(tagKey) && key <= 4294967294) {
if (row.tags.hasOwnProperty(tagKey) && /^0$|^[1-9]\d*$/.test(tagKey) && tagKey <= 4294967294) {
tagList.push(row.tags[tagKey].text);
}
}

View File

@ -155,6 +155,7 @@
></piggy-bank>
-->
<tags
:tags="transaction.tags"
v-model="transaction.tags"
:error="transaction.errors.tags"
></tags>
@ -355,6 +356,14 @@
processIncomingGroupRow(transaction) {
console.log(transaction);
this.setTransactionType(transaction.type);
let newTags = [];
for(let key in transaction.tags) {
if (transaction.tags.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
newTags.push({text: transaction.tags[key], tiClasses: []});
}
}
this.transactions.push({
description: transaction.description,
date: transaction.date.substr(0, 10),
@ -385,7 +394,8 @@
},
},
budget: transaction.budget_id,
tags: transaction.tags,
tags: newTags,
//tags: 'abc',
custom_fields: {
interest_date: transaction.interest_date,
book_date: transaction.book_date,

View File

@ -52,9 +52,9 @@
data() {
return {
tag: '',
tags: [],
autocompleteItems: [],
debounce: null,
tags: this.value,
};
},
watch: {
@ -70,6 +70,7 @@
return this.error.length > 0;
},
initItems() {
console.log('Now in initItems');
if (this.tag.length < 2) {
return;
}