diff --git a/frontend/src/components/accounts/Create.vue b/frontend/src/components/accounts/Create.vue index afcee2ff95..00f26ad9f5 100644 --- a/frontend/src/components/accounts/Create.vue +++ b/frontend/src/components/accounts/Create.vue @@ -22,7 +22,7 @@
-
+
@@ -217,7 +217,7 @@ export default { }, methods: { storeField: function (payload) { - console.log(payload); + // console.log(payload); if ('location' === payload.field) { if (true === payload.value.hasMarker) { this.location = payload.value; @@ -232,13 +232,13 @@ export default { e.preventDefault(); this.submitting = true; let submission = this.getSubmission(); - console.log('Will submit:'); - console.log(submission); + // console.log('Will submit:'); + // console.log(submission); let url = './api/v1/accounts'; axios.post(url, submission) .then(response => { - console.log('success!'); + // console.log('success!'); this.returnedId = parseInt(response.data.data.id); this.returnedTitle = response.data.data.attributes.name; this.successMessage = this.$t('firefly.stored_new_account_js', {ID: this.returnedId, name: this.returnedTitle}); @@ -249,7 +249,7 @@ export default { } this.submitting = false; if (this.resetFormAfter) { - console.log('reset!'); + // console.log('reset!'); this.name = ''; this.liability_type = 'Loan'; this.liability_direction = 'debit'; @@ -276,7 +276,7 @@ export default { }, parseErrors: function (errors) { this.errors = lodashClonedeep(this.defaultErrors); - console.log(errors); + // console.log(errors); for (let i in errors.errors) { if (errors.errors.hasOwnProperty(i)) { this.errors[i] = errors.errors[i]; diff --git a/frontend/src/components/accounts/Delete.vue b/frontend/src/components/accounts/Delete.vue index 45c6c6dae9..74370196d4 100644 --- a/frontend/src/components/accounts/Delete.vue +++ b/frontend/src/components/accounts/Delete.vue @@ -91,7 +91,7 @@ export default { }, created() { let pathName = window.location.pathname; - console.log(pathName); + // console.log(pathName); let parts = pathName.split('/'); this.accountId = parseInt(parts[parts.length - 1]); this.getAccount(); @@ -153,7 +153,7 @@ export default { } ); // get accounts of the same type. - console.log('Go for "' + type + '"'); + // console.log('Go for "' + type + '"'); }, getPiggyBankCount: function (type, currencyCode) { axios.get('./api/v1/accounts/' + this.accountId + '/piggy_banks') diff --git a/frontend/src/components/accounts/Index.vue b/frontend/src/components/accounts/Index.vue index 63a5242060..01695dc1c6 100644 --- a/frontend/src/components/accounts/Index.vue +++ b/frontend/src/components/accounts/Index.vue @@ -259,9 +259,9 @@ export default { this.fields.push({key: 'menu', label: ' ', sortable: false}); }, getAccountList: function () { - console.log('getAccountList()'); + // console.log('getAccountList()'); if (this.indexReady && !this.loading && !this.downloaded) { - console.log('Index ready, not loading and not already downloaded. Reset.'); + // console.log('Index ready, not loading and not already downloaded. Reset.'); this.loading = true; this.perPage = this.listPageSize ?? 51; this.accounts = []; @@ -269,14 +269,14 @@ export default { this.downloadAccountList(1); } if (this.indexReady && !this.loading && this.downloaded) { - console.log('Index ready, not loading and not downloaded.'); + // console.log('Index ready, not loading and not downloaded.'); this.loading = true; this.filterAccountList(); // TODO filter accounts. } }, downloadAccountList: function (page) { - console.log('downloadAccountList(' + page + ')'); + // console.log('downloadAccountList(' + page + ')'); axios.get('./api/v1/accounts?type=' + this.type + '&page=' + page) .then(response => { let currentPage = parseInt(response.data.meta.pagination.current_page); @@ -288,7 +288,7 @@ export default { this.downloadAccountList(nextPage); } if (currentPage >= totalPage) { - console.log('Looks like all downloaded.'); + // console.log('Looks like all downloaded.'); this.downloaded = true; this.filterAccountList(); } @@ -296,7 +296,7 @@ export default { ); }, filterAccountList: function () { - console.log('filterAccountList()'); + // console.log('filterAccountList()'); this.accounts = []; for (let i in this.allAccounts) { if (this.allAccounts.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) { @@ -304,14 +304,14 @@ export default { // 2 = inactive only // 3 = both if (1 === this.activeFilter && false === this.allAccounts[i].active) { - console.log('Skip account #' + this.allAccounts[i].id + ' because not active.'); + // console.log('Skip account #' + this.allAccounts[i].id + ' because not active.'); continue; } if (2 === this.activeFilter && true === this.allAccounts[i].active) { - console.log('Skip account #' + this.allAccounts[i].id + ' because active.'); + // console.log('Skip account #' + this.allAccounts[i].id + ' because active.'); continue; } - console.log('Include account #' + this.allAccounts[i].id + '.'); + // console.log('Include account #' + this.allAccounts[i].id + '.'); this.accounts.push(this.allAccounts[i]); } @@ -330,7 +330,7 @@ export default { //console.log('Total is now ' + this.total); }, parseAccounts: function (data) { - console.log('In parseAccounts()'); + // console.log('In parseAccounts()'); for (let key in data) { if (data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) { let current = data[key]; @@ -357,7 +357,7 @@ export default { } }, getAccountBalanceDifference: function (index, acct) { - console.log('getAccountBalanceDifference(' + index + ')'); + // console.log('getAccountBalanceDifference(' + index + ')'); // get account on day 0 let promises = []; diff --git a/frontend/src/components/dashboard/MainAccount.vue b/frontend/src/components/dashboard/MainAccount.vue index cfa734faa9..19c65b4ede 100644 --- a/frontend/src/components/dashboard/MainAccount.vue +++ b/frontend/src/components/dashboard/MainAccount.vue @@ -116,8 +116,8 @@ export default { this.drawChart(); }) .catch(error => { - console.log('Has error!'); - console.log(error); + // console.log('Has error!'); + // console.log(error); this.error = true; }); }, diff --git a/frontend/src/components/dashboard/MainBudgetList.vue b/frontend/src/components/dashboard/MainBudgetList.vue index 74348fad0b..918a579adc 100644 --- a/frontend/src/components/dashboard/MainBudgetList.vue +++ b/frontend/src/components/dashboard/MainBudgetList.vue @@ -164,7 +164,7 @@ export default { spent: spentData.sum } ); - console.log('Added budget ' + current.attributes.name + ' (' + spentData.currency_code + ')'); + //console.log('Added budget ' + current.attributes.name + ' (' + spentData.currency_code + ')'); } } } @@ -192,7 +192,7 @@ export default { id: currentId, name: current.attributes.name, }; - console.log('Collected meta data: budget #' + currentId + ' is named ' + current.attributes.name); + //console.log('Collected meta data: budget #' + currentId + ' is named ' + current.attributes.name); } } @@ -250,7 +250,7 @@ export default { for (let i in this.rawBudgets) { if (this.rawBudgets.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) { if (this.rawBudgets[i].currency_id === currencyId && this.rawBudgets[i].id === budgetId) { - console.log('Budget ' + this.rawBudgets[i].name + ' with currency ' + this.rawBudgets[i].currency_code + ' will be removed in favor of a budget limit.'); + //console.log('Budget ' + this.rawBudgets[i].name + ' with currency ' + this.rawBudgets[i].currency_code + ' will be removed in favor of a budget limit.'); this.rawBudgets.splice(parseInt(i), 1); } } diff --git a/frontend/src/components/dashboard/MainCategoryList.vue b/frontend/src/components/dashboard/MainCategoryList.vue index 88820a320d..156b40ed5b 100644 --- a/frontend/src/components/dashboard/MainCategoryList.vue +++ b/frontend/src/components/dashboard/MainCategoryList.vue @@ -136,7 +136,7 @@ export default { }, methods: { - getCategories() { + getCategories: function () { this.categories = []; this.sortedList = []; this.spent = 0; @@ -144,19 +144,32 @@ export default { this.loading = true; let startStr = this.start.toISOString().split('T')[0]; let endStr = this.end.toISOString().split('T')[0]; - axios.get('./api/v1/categories?start=' + startStr + '&end=' + endStr) + this.getCategoryPage(startStr, endStr, 1); + }, + getCategoryPage: function (start, end, page) { + axios.get('./api/v1/categories?start=' + start + '&end=' + end + '&page=' + page) .then(response => { - this.parseCategories(response.data); - this.loading = false; + let categories = response.data.data; + let currentPage = parseInt(response.data.meta.pagination.current_page); + let totalPages = parseInt(response.data.meta.pagination.total_pages); + this.parseCategories(categories); + if (currentPage < totalPages) { + let nextPage = currentPage + 1; + this.getCategoryPage(start, end, nextPage); + } + if (currentPage === totalPages) { + this.loading = false; + this.sortCategories(); + } } ).catch(error => { this.error = true; }); }, parseCategories(data) { - for (let i in data.data) { - if (data.data.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) { - let current = data.data[i]; + for (let i in data) { + if (data.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) { + let current = data[i]; let entryKey = null; let categoryId = parseInt(current.id); @@ -207,7 +220,6 @@ export default { } } } - this.sortCategories(); }, sortCategories() { // no longer care about keys: diff --git a/frontend/src/components/transactions/Create.vue b/frontend/src/components/transactions/Create.vue index 0ddaeb61c6..54db50bfb3 100644 --- a/frontend/src/components/transactions/Create.vue +++ b/frontend/src/components/transactions/Create.vue @@ -22,7 +22,7 @@
- +
@@ -804,8 +804,8 @@ export default { getAllowedOpposingTypes: function () { axios.get('./api/v1/configuration/firefly.allowed_opposing_types') .then(response => { - console.log('opposing types things.'); - console.log(response.data.data.value); + // console.log('opposing types things.'); + // console.log(response.data.data.value); this.allowedOpposingTypes = response.data.data.value; }); }, diff --git a/frontend/src/components/transactions/Edit.vue b/frontend/src/components/transactions/Edit.vue index 7bd0195a68..8826416389 100644 --- a/frontend/src/components/transactions/Edit.vue +++ b/frontend/src/components/transactions/Edit.vue @@ -23,7 +23,7 @@ - +
@@ -389,8 +389,8 @@ export default { }); }, uploadedAttachment: function (payload) { - console.log('event: uploadedAttachment'); - console.log(payload); + // console.log('event: uploadedAttachment'); + // console.log(payload); }, storeLocation: function (payload) { this.transactions[payload.index].zoom_level = payload.zoomLevel; @@ -459,7 +459,7 @@ export default { } let transactionCount = this.originalTransactions.length; let newTransactionCount = this.transactions.length; - console.log('Found ' + this.transactions.length + ' split(s).'); + // console.log('Found ' + this.transactions.length + ' split(s).'); if (newTransactionCount > 1 && typeof submission.group_title === 'undefined' && (null === this.originalGroupTitle || '' === this.originalGroupTitle)) { submission.group_title = this.transactions[0].description; @@ -497,7 +497,7 @@ export default { currentTransaction.source_account_name = this.originalTransactions[0].source_account_name; currentTransaction.source_account_id = this.originalTransactions[0].source_account_id; } - console.log('Will overrule accounts for split ' + i); + // console.log('Will overrule accounts for split ' + i); } for (let ii in basicFields) { @@ -596,15 +596,15 @@ export default { if ( this.date !== this.originalDate ) { - console.log('Date and/or time is changed'); + // console.log('Date and/or time is changed'); // set date and time! shouldSubmit = true; diff.date = this.date; } - console.log('Now at index ' + i); - console.log(Object.keys(diff).length); + // console.log('Now at index ' + i); + // console.log(Object.keys(diff).length); if (Object.keys(diff).length === 0 && newTransactionCount > 1) { - console.log('Will submit just the ID!'); + // console.log('Will submit just the ID!'); diff.transaction_journal_id = originalTransaction.transaction_journal_id; submission.transactions.push(lodashClonedeep(diff)); shouldSubmit = true; @@ -616,10 +616,10 @@ export default { } } - console.log('submitTransaction'); - console.log('shouldUpload : ' + shouldUpload); - console.log('shouldLinks : ' + shouldLinks); - console.log('shouldSubmit : ' + shouldSubmit); + // console.log('submitTransaction'); + // console.log('shouldUpload : ' + shouldUpload); + // console.log('shouldLinks : ' + shouldLinks); + // console.log('shouldSubmit : ' + shouldSubmit); if (shouldSubmit) { this.submitUpdate(submission, shouldLinks, shouldUpload); } @@ -640,7 +640,7 @@ export default { // TODO //this.submittedAttachments(); } - console.log('Done with submit methd.'); + // console.log('Done with submit methd.'); //console.log(submission); }, compareLinks: function (array) { @@ -664,24 +664,24 @@ export default { return JSON.stringify(compare); }, submitUpdate: function (submission, shouldLinks, shouldUpload) { - console.log('submitUpdate'); + // console.log('submitUpdate'); this.inError = false; const url = './api/v1/transactions/' + this.groupId; - console.log(JSON.stringify(submission)); - console.log(submission); + // console.log(JSON.stringify(submission)); + // console.log(submission); axios.put(url, submission) .then(response => { - console.log('Response is OK!'); + // console.log('Response is OK!'); // report the transaction is submitted. this.submittedTransaction = true; // submit links and attachments (can only be done when the transaction is created) if (shouldLinks) { - console.log('Need to update links.'); + // console.log('Need to update links.'); this.submitTransactionLinks(); } if (!shouldLinks) { - console.log('No need to update links.'); + // console.log('No need to update links.'); } // TODO attachments: // this.submitAttachments(data, response); @@ -800,7 +800,7 @@ export default { }, deleteOriginalLinks: function (transaction) { - console.log(transaction.links); + // console.log(transaction.links); for (let i in transaction.links) { if (transaction.links.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) { let current = transaction.links[i]; @@ -820,7 +820,7 @@ export default { let total = 0; let promises = []; - console.log('submitTransactionLinks()'); + // console.log('submitTransactionLinks()'); for (let i in this.transactions) { if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) { // original transaction present? @@ -834,7 +834,7 @@ export default { this.deleteOriginalLinks(originalTransaction); } - console.log('links are different!'); + // console.log('links are different!'); // console.log(newLinks); // console.log(originalLinks); for (let ii in currentTransaction.links) { @@ -855,7 +855,7 @@ export default { linkObject.outward_id = currentLink.transaction_journal_id; } - console.log(linkObject); + // console.log(linkObject); total++; // submit transaction link: promises.push(axios.post('./api/v1/transaction_links', linkObject).then(response => { @@ -877,20 +877,20 @@ export default { }); }, finalizeSubmit: function () { - console.log('now in finalizeSubmit()'); - console.log('submittedTransaction : ' + this.submittedTransaction); - console.log('submittedLinks : ' + this.submittedLinks); - console.log('submittedAttachments : ' + this.submittedAttachments); + // console.log('now in finalizeSubmit()'); + // console.log('submittedTransaction : ' + this.submittedTransaction); + // console.log('submittedLinks : ' + this.submittedLinks); + // console.log('submittedAttachments : ' + this.submittedAttachments); if (this.submittedTransaction && this.submittedAttachments && this.submittedLinks) { - console.log('all true'); - console.log('inError = ' + this.inError); - console.log('stayHere = ' + this.stayHere); - console.log('returnedGroupId = ' + this.returnedGroupId); + // console.log('all true'); + // console.log('inError = ' + this.inError); + // console.log('stayHere = ' + this.stayHere); + // console.log('returnedGroupId = ' + this.returnedGroupId); // no error + no changes + no redirect if (true === this.stayHere && false === this.inError && 0 === this.returnedGroupId) { - console.log('no error + no changes + no redirect'); + // console.log('no error + no changes + no redirect'); // show message: this.errorMessage = ''; this.successMessage = ''; @@ -900,12 +900,12 @@ export default { // no error + no changes + redirect if (false === this.stayHere && false === this.inError && 0 === this.returnedGroupId) { - console.log('no error + no changes + redirect'); + // console.log('no error + no changes + redirect'); window.location.href = (window.previousURL ?? '/') + '?transaction_group_id=' + this.groupId + '&message=no_change'; } // no error + changes + no redirect if (true === this.stayHere && false === this.inError && 0 !== this.returnedGroupId) { - console.log('no error + changes + redirect'); + // console.log('no error + changes + redirect'); // show message: this.errorMessage = ''; this.warningMessage = ''; @@ -915,10 +915,10 @@ export default { // no error + changes + redirect if (false === this.stayHere && false === this.inError && 0 !== this.returnedGroupId) { - console.log('no error + changes + redirect'); + // console.log('no error + changes + redirect'); window.location.href = (window.previousURL ?? '/') + '?transaction_group_id=' + this.groupId + '&message=updated'; } - console.log('end of the line'); + // console.log('end of the line'); // enable flags: this.enableSubmit = true; this.submittedTransaction = false; diff --git a/frontend/src/components/transactions/SplitForm.vue b/frontend/src/components/transactions/SplitForm.vue index a8551cefb9..f6e6921cae 100644 --- a/frontend/src/components/transactions/SplitForm.vue +++ b/frontend/src/components/transactions/SplitForm.vue @@ -381,13 +381,13 @@ export default { return this.date; }, sourceAccount: function () { - console.log('computed::sourceAccount'); + // console.log('computed::sourceAccount'); let value = { id: this.transaction.source_account_id, name: this.transaction.source_account_name, type: this.transaction.source_account_type, }; - console.log(JSON.stringify(value)); + // console.log(JSON.stringify(value)); return value; }, destinationAccount: function () { diff --git a/frontend/src/components/transactions/TransactionAccount.vue b/frontend/src/components/transactions/TransactionAccount.vue index 7fef2bb86b..404bc852fe 100644 --- a/frontend/src/components/transactions/TransactionAccount.vue +++ b/frontend/src/components/transactions/TransactionAccount.vue @@ -192,10 +192,10 @@ export default { * @param value */ selectedAccount: function (value) { - console.log('TransactionAccount::watch selectedAccount()'); - console.log(value); + // console.log('TransactionAccount::watch selectedAccount()'); + // console.log(value); if (true === this.selectedAccountTrigger) { - console.log('$emit alles!'); + // console.log('$emit alles!'); this.$emit('set-account', { index: this.index, @@ -208,18 +208,18 @@ export default { currency_symbol: value.currency_symbol, } ); - console.log('watch::selectedAccount() will now set accountName because selectedAccountTrigger = true'); + // console.log('watch::selectedAccount() will now set accountName because selectedAccountTrigger = true'); this.accountName = value.name; } }, accountName: function (value) { - console.log('now at watch accountName("' + value + '")'); - console.log(this.selectedAccountTrigger); + // console.log('now at watch accountName("' + value + '")'); + // console.log(this.selectedAccountTrigger); if (true === this.selectedAccountTrigger) { - console.log('Do nothing because selectedAccountTrigger = true'); + // console.log('Do nothing because selectedAccountTrigger = true'); } if (false === this.selectedAccountTrigger) { - console.log('$emit name from watch::accountName() because selectedAccountTrigger = false'); + // console.log('$emit name from watch::accountName() because selectedAccountTrigger = false'); this.$emit('set-account', { index: this.index, @@ -234,11 +234,11 @@ export default { ); // this.account = {name: value, type: null, id: null, currency_id: null, currency_code: null, currency_symbol: null}; } - console.log('set selectedAccountTrigger to be FALSE'); + // console.log('set selectedAccountTrigger to be FALSE'); this.selectedAccountTrigger = false; }, value: function (value) { - console.log('TransactionAccount::watch value(' + JSON.stringify(value) + ')'); + // console.log('TransactionAccount::watch value(' + JSON.stringify(value) + ')'); this.systemReturnedAccount(value); // // console.log('Index ' + this.index + ' nwAct: ', value); diff --git a/frontend/src/components/transactions/TransactionDate.vue b/frontend/src/components/transactions/TransactionDate.vue index f5770a0e71..7677bfd1f8 100644 --- a/frontend/src/components/transactions/TransactionDate.vue +++ b/frontend/src/components/transactions/TransactionDate.vue @@ -64,7 +64,7 @@ export default { created() { this.localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; this.systemTimeZone = this.timezone; - console.log('TransactionDate: ' + this.date); + // console.log('TransactionDate: ' + this.date); // split date and time: let parts = this.date.split('T'); this.dateStr = parts[0]; diff --git a/frontend/src/components/transactions/TransactionLinks.vue b/frontend/src/components/transactions/TransactionLinks.vue index bbfb166660..9f45b2b331 100644 --- a/frontend/src/components/transactions/TransactionLinks.vue +++ b/frontend/src/components/transactions/TransactionLinks.vue @@ -91,7 +91,7 @@
- +
diff --git a/frontend/src/components/transactions/TransactionTags.vue b/frontend/src/components/transactions/TransactionTags.vue index a11500c58f..d3a4782931 100644 --- a/frontend/src/components/transactions/TransactionTags.vue +++ b/frontend/src/components/transactions/TransactionTags.vue @@ -78,7 +78,7 @@ export default { this.tagList = value; }, tagList: function (value) { - console.log('watch tagList'); + // console.log('watch tagList'); if (true === this.emitEvent) { this.$emit('set-field', {field: 'tags', index: this.index, value: value}); }