mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Remove lots of debug comments.
This commit is contained in:
parent
d357eaeb51
commit
43476167d8
@ -22,7 +22,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<Alert :message="errorMessage" type="danger"/>
|
<Alert :message="errorMessage" type="danger"/>
|
||||||
<Alert :message="successMessage" type="success"/>
|
<Alert :message="successMessage" type="success"/>
|
||||||
<form @submit="submitForm">
|
<form @submit="submitForm" autocomplete="off">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12">
|
<div class="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12">
|
||||||
<div class="card card-primary">
|
<div class="card card-primary">
|
||||||
@ -217,7 +217,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
storeField: function (payload) {
|
storeField: function (payload) {
|
||||||
console.log(payload);
|
// console.log(payload);
|
||||||
if ('location' === payload.field) {
|
if ('location' === payload.field) {
|
||||||
if (true === payload.value.hasMarker) {
|
if (true === payload.value.hasMarker) {
|
||||||
this.location = payload.value;
|
this.location = payload.value;
|
||||||
@ -232,13 +232,13 @@ export default {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.submitting = true;
|
this.submitting = true;
|
||||||
let submission = this.getSubmission();
|
let submission = this.getSubmission();
|
||||||
console.log('Will submit:');
|
// console.log('Will submit:');
|
||||||
console.log(submission);
|
// console.log(submission);
|
||||||
let url = './api/v1/accounts';
|
let url = './api/v1/accounts';
|
||||||
|
|
||||||
axios.post(url, submission)
|
axios.post(url, submission)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log('success!');
|
// console.log('success!');
|
||||||
this.returnedId = parseInt(response.data.data.id);
|
this.returnedId = parseInt(response.data.data.id);
|
||||||
this.returnedTitle = response.data.data.attributes.name;
|
this.returnedTitle = response.data.data.attributes.name;
|
||||||
this.successMessage = this.$t('firefly.stored_new_account_js', {ID: this.returnedId, name: this.returnedTitle});
|
this.successMessage = this.$t('firefly.stored_new_account_js', {ID: this.returnedId, name: this.returnedTitle});
|
||||||
@ -249,7 +249,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.submitting = false;
|
this.submitting = false;
|
||||||
if (this.resetFormAfter) {
|
if (this.resetFormAfter) {
|
||||||
console.log('reset!');
|
// console.log('reset!');
|
||||||
this.name = '';
|
this.name = '';
|
||||||
this.liability_type = 'Loan';
|
this.liability_type = 'Loan';
|
||||||
this.liability_direction = 'debit';
|
this.liability_direction = 'debit';
|
||||||
@ -276,7 +276,7 @@ export default {
|
|||||||
},
|
},
|
||||||
parseErrors: function (errors) {
|
parseErrors: function (errors) {
|
||||||
this.errors = lodashClonedeep(this.defaultErrors);
|
this.errors = lodashClonedeep(this.defaultErrors);
|
||||||
console.log(errors);
|
// console.log(errors);
|
||||||
for (let i in errors.errors) {
|
for (let i in errors.errors) {
|
||||||
if (errors.errors.hasOwnProperty(i)) {
|
if (errors.errors.hasOwnProperty(i)) {
|
||||||
this.errors[i] = errors.errors[i];
|
this.errors[i] = errors.errors[i];
|
||||||
|
@ -91,7 +91,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
let pathName = window.location.pathname;
|
let pathName = window.location.pathname;
|
||||||
console.log(pathName);
|
// console.log(pathName);
|
||||||
let parts = pathName.split('/');
|
let parts = pathName.split('/');
|
||||||
this.accountId = parseInt(parts[parts.length - 1]);
|
this.accountId = parseInt(parts[parts.length - 1]);
|
||||||
this.getAccount();
|
this.getAccount();
|
||||||
@ -153,7 +153,7 @@ export default {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
// get accounts of the same type.
|
// get accounts of the same type.
|
||||||
console.log('Go for "' + type + '"');
|
// console.log('Go for "' + type + '"');
|
||||||
},
|
},
|
||||||
getPiggyBankCount: function (type, currencyCode) {
|
getPiggyBankCount: function (type, currencyCode) {
|
||||||
axios.get('./api/v1/accounts/' + this.accountId + '/piggy_banks')
|
axios.get('./api/v1/accounts/' + this.accountId + '/piggy_banks')
|
||||||
|
@ -259,9 +259,9 @@ export default {
|
|||||||
this.fields.push({key: 'menu', label: ' ', sortable: false});
|
this.fields.push({key: 'menu', label: ' ', sortable: false});
|
||||||
},
|
},
|
||||||
getAccountList: function () {
|
getAccountList: function () {
|
||||||
console.log('getAccountList()');
|
// console.log('getAccountList()');
|
||||||
if (this.indexReady && !this.loading && !this.downloaded) {
|
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.loading = true;
|
||||||
this.perPage = this.listPageSize ?? 51;
|
this.perPage = this.listPageSize ?? 51;
|
||||||
this.accounts = [];
|
this.accounts = [];
|
||||||
@ -269,14 +269,14 @@ export default {
|
|||||||
this.downloadAccountList(1);
|
this.downloadAccountList(1);
|
||||||
}
|
}
|
||||||
if (this.indexReady && !this.loading && this.downloaded) {
|
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.loading = true;
|
||||||
this.filterAccountList();
|
this.filterAccountList();
|
||||||
// TODO filter accounts.
|
// TODO filter accounts.
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
downloadAccountList: function (page) {
|
downloadAccountList: function (page) {
|
||||||
console.log('downloadAccountList(' + page + ')');
|
// console.log('downloadAccountList(' + page + ')');
|
||||||
axios.get('./api/v1/accounts?type=' + this.type + '&page=' + page)
|
axios.get('./api/v1/accounts?type=' + this.type + '&page=' + page)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
let currentPage = parseInt(response.data.meta.pagination.current_page);
|
let currentPage = parseInt(response.data.meta.pagination.current_page);
|
||||||
@ -288,7 +288,7 @@ export default {
|
|||||||
this.downloadAccountList(nextPage);
|
this.downloadAccountList(nextPage);
|
||||||
}
|
}
|
||||||
if (currentPage >= totalPage) {
|
if (currentPage >= totalPage) {
|
||||||
console.log('Looks like all downloaded.');
|
// console.log('Looks like all downloaded.');
|
||||||
this.downloaded = true;
|
this.downloaded = true;
|
||||||
this.filterAccountList();
|
this.filterAccountList();
|
||||||
}
|
}
|
||||||
@ -296,7 +296,7 @@ export default {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
filterAccountList: function () {
|
filterAccountList: function () {
|
||||||
console.log('filterAccountList()');
|
// console.log('filterAccountList()');
|
||||||
this.accounts = [];
|
this.accounts = [];
|
||||||
for (let i in this.allAccounts) {
|
for (let i in this.allAccounts) {
|
||||||
if (this.allAccounts.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
if (this.allAccounts.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||||
@ -304,14 +304,14 @@ export default {
|
|||||||
// 2 = inactive only
|
// 2 = inactive only
|
||||||
// 3 = both
|
// 3 = both
|
||||||
if (1 === this.activeFilter && false === this.allAccounts[i].active) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
if (2 === this.activeFilter && true === this.allAccounts[i].active) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
console.log('Include account #' + this.allAccounts[i].id + '.');
|
// console.log('Include account #' + this.allAccounts[i].id + '.');
|
||||||
|
|
||||||
this.accounts.push(this.allAccounts[i]);
|
this.accounts.push(this.allAccounts[i]);
|
||||||
}
|
}
|
||||||
@ -330,7 +330,7 @@ export default {
|
|||||||
//console.log('Total is now ' + this.total);
|
//console.log('Total is now ' + this.total);
|
||||||
},
|
},
|
||||||
parseAccounts: function (data) {
|
parseAccounts: function (data) {
|
||||||
console.log('In parseAccounts()');
|
// console.log('In parseAccounts()');
|
||||||
for (let key in data) {
|
for (let key in data) {
|
||||||
if (data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
if (data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
||||||
let current = data[key];
|
let current = data[key];
|
||||||
@ -357,7 +357,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getAccountBalanceDifference: function (index, acct) {
|
getAccountBalanceDifference: function (index, acct) {
|
||||||
console.log('getAccountBalanceDifference(' + index + ')');
|
// console.log('getAccountBalanceDifference(' + index + ')');
|
||||||
// get account on day 0
|
// get account on day 0
|
||||||
let promises = [];
|
let promises = [];
|
||||||
|
|
||||||
|
@ -116,8 +116,8 @@ export default {
|
|||||||
this.drawChart();
|
this.drawChart();
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log('Has error!');
|
// console.log('Has error!');
|
||||||
console.log(error);
|
// console.log(error);
|
||||||
this.error = true;
|
this.error = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -164,7 +164,7 @@ export default {
|
|||||||
spent: spentData.sum
|
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,
|
id: currentId,
|
||||||
name: current.attributes.name,
|
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) {
|
for (let i in this.rawBudgets) {
|
||||||
if (this.rawBudgets.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
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) {
|
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);
|
this.rawBudgets.splice(parseInt(i), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:
|
methods:
|
||||||
{
|
{
|
||||||
getCategories() {
|
getCategories: function () {
|
||||||
this.categories = [];
|
this.categories = [];
|
||||||
this.sortedList = [];
|
this.sortedList = [];
|
||||||
this.spent = 0;
|
this.spent = 0;
|
||||||
@ -144,19 +144,32 @@ export default {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
let startStr = this.start.toISOString().split('T')[0];
|
let startStr = this.start.toISOString().split('T')[0];
|
||||||
let endStr = this.end.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 => {
|
.then(response => {
|
||||||
this.parseCategories(response.data);
|
let categories = response.data.data;
|
||||||
this.loading = false;
|
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 => {
|
).catch(error => {
|
||||||
this.error = true;
|
this.error = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
parseCategories(data) {
|
parseCategories(data) {
|
||||||
for (let i in data.data) {
|
for (let i in data) {
|
||||||
if (data.data.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
if (data.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||||
let current = data.data[i];
|
let current = data[i];
|
||||||
let entryKey = null;
|
let entryKey = null;
|
||||||
let categoryId = parseInt(current.id);
|
let categoryId = parseInt(current.id);
|
||||||
|
|
||||||
@ -207,7 +220,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.sortCategories();
|
|
||||||
},
|
},
|
||||||
sortCategories() {
|
sortCategories() {
|
||||||
// no longer care about keys:
|
// no longer care about keys:
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<alert :message="errorMessage" type="danger"/>
|
<alert :message="errorMessage" type="danger"/>
|
||||||
<alert :message="successMessage" type="success"/>
|
<alert :message="successMessage" type="success"/>
|
||||||
<form @submit="submitTransaction">
|
<form @submit="submitTransaction" autocomplete="off">
|
||||||
<SplitPills :transactions="transactions"/>
|
<SplitPills :transactions="transactions"/>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<!-- v-on:switch-accounts="switchAccounts($event)" -->
|
<!-- v-on:switch-accounts="switchAccounts($event)" -->
|
||||||
@ -804,8 +804,8 @@ export default {
|
|||||||
getAllowedOpposingTypes: function () {
|
getAllowedOpposingTypes: function () {
|
||||||
axios.get('./api/v1/configuration/firefly.allowed_opposing_types')
|
axios.get('./api/v1/configuration/firefly.allowed_opposing_types')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log('opposing types things.');
|
// console.log('opposing types things.');
|
||||||
console.log(response.data.data.value);
|
// console.log(response.data.data.value);
|
||||||
this.allowedOpposingTypes = response.data.data.value;
|
this.allowedOpposingTypes = response.data.data.value;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<Alert :message="errorMessage" type="danger"/>
|
<Alert :message="errorMessage" type="danger"/>
|
||||||
<Alert :message="successMessage" type="success"/>
|
<Alert :message="successMessage" type="success"/>
|
||||||
<Alert :message="warningMessage" type="warning"/>
|
<Alert :message="warningMessage" type="warning"/>
|
||||||
<form @submit="submitTransaction">
|
<form @submit="submitTransaction" autocomplete="off">
|
||||||
<SplitPills :transactions="transactions"/>
|
<SplitPills :transactions="transactions"/>
|
||||||
|
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
@ -389,8 +389,8 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
uploadedAttachment: function (payload) {
|
uploadedAttachment: function (payload) {
|
||||||
console.log('event: uploadedAttachment');
|
// console.log('event: uploadedAttachment');
|
||||||
console.log(payload);
|
// console.log(payload);
|
||||||
},
|
},
|
||||||
storeLocation: function (payload) {
|
storeLocation: function (payload) {
|
||||||
this.transactions[payload.index].zoom_level = payload.zoomLevel;
|
this.transactions[payload.index].zoom_level = payload.zoomLevel;
|
||||||
@ -459,7 +459,7 @@ export default {
|
|||||||
}
|
}
|
||||||
let transactionCount = this.originalTransactions.length;
|
let transactionCount = this.originalTransactions.length;
|
||||||
let newTransactionCount = this.transactions.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)) {
|
if (newTransactionCount > 1 && typeof submission.group_title === 'undefined' && (null === this.originalGroupTitle || '' === this.originalGroupTitle)) {
|
||||||
submission.group_title = this.transactions[0].description;
|
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_name = this.originalTransactions[0].source_account_name;
|
||||||
currentTransaction.source_account_id = this.originalTransactions[0].source_account_id;
|
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) {
|
for (let ii in basicFields) {
|
||||||
@ -596,15 +596,15 @@ export default {
|
|||||||
if (
|
if (
|
||||||
this.date !== this.originalDate
|
this.date !== this.originalDate
|
||||||
) {
|
) {
|
||||||
console.log('Date and/or time is changed');
|
// console.log('Date and/or time is changed');
|
||||||
// set date and time!
|
// set date and time!
|
||||||
shouldSubmit = true;
|
shouldSubmit = true;
|
||||||
diff.date = this.date;
|
diff.date = this.date;
|
||||||
}
|
}
|
||||||
console.log('Now at index ' + i);
|
// console.log('Now at index ' + i);
|
||||||
console.log(Object.keys(diff).length);
|
// console.log(Object.keys(diff).length);
|
||||||
if (Object.keys(diff).length === 0 && newTransactionCount > 1) {
|
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;
|
diff.transaction_journal_id = originalTransaction.transaction_journal_id;
|
||||||
submission.transactions.push(lodashClonedeep(diff));
|
submission.transactions.push(lodashClonedeep(diff));
|
||||||
shouldSubmit = true;
|
shouldSubmit = true;
|
||||||
@ -616,10 +616,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('submitTransaction');
|
// console.log('submitTransaction');
|
||||||
console.log('shouldUpload : ' + shouldUpload);
|
// console.log('shouldUpload : ' + shouldUpload);
|
||||||
console.log('shouldLinks : ' + shouldLinks);
|
// console.log('shouldLinks : ' + shouldLinks);
|
||||||
console.log('shouldSubmit : ' + shouldSubmit);
|
// console.log('shouldSubmit : ' + shouldSubmit);
|
||||||
if (shouldSubmit) {
|
if (shouldSubmit) {
|
||||||
this.submitUpdate(submission, shouldLinks, shouldUpload);
|
this.submitUpdate(submission, shouldLinks, shouldUpload);
|
||||||
}
|
}
|
||||||
@ -640,7 +640,7 @@ export default {
|
|||||||
// TODO
|
// TODO
|
||||||
//this.submittedAttachments();
|
//this.submittedAttachments();
|
||||||
}
|
}
|
||||||
console.log('Done with submit methd.');
|
// console.log('Done with submit methd.');
|
||||||
//console.log(submission);
|
//console.log(submission);
|
||||||
},
|
},
|
||||||
compareLinks: function (array) {
|
compareLinks: function (array) {
|
||||||
@ -664,24 +664,24 @@ export default {
|
|||||||
return JSON.stringify(compare);
|
return JSON.stringify(compare);
|
||||||
},
|
},
|
||||||
submitUpdate: function (submission, shouldLinks, shouldUpload) {
|
submitUpdate: function (submission, shouldLinks, shouldUpload) {
|
||||||
console.log('submitUpdate');
|
// console.log('submitUpdate');
|
||||||
this.inError = false;
|
this.inError = false;
|
||||||
const url = './api/v1/transactions/' + this.groupId;
|
const url = './api/v1/transactions/' + this.groupId;
|
||||||
console.log(JSON.stringify(submission));
|
// console.log(JSON.stringify(submission));
|
||||||
console.log(submission);
|
// console.log(submission);
|
||||||
axios.put(url, submission)
|
axios.put(url, submission)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log('Response is OK!');
|
// console.log('Response is OK!');
|
||||||
// report the transaction is submitted.
|
// report the transaction is submitted.
|
||||||
this.submittedTransaction = true;
|
this.submittedTransaction = true;
|
||||||
|
|
||||||
// submit links and attachments (can only be done when the transaction is created)
|
// submit links and attachments (can only be done when the transaction is created)
|
||||||
if (shouldLinks) {
|
if (shouldLinks) {
|
||||||
console.log('Need to update links.');
|
// console.log('Need to update links.');
|
||||||
this.submitTransactionLinks();
|
this.submitTransactionLinks();
|
||||||
}
|
}
|
||||||
if (!shouldLinks) {
|
if (!shouldLinks) {
|
||||||
console.log('No need to update links.');
|
// console.log('No need to update links.');
|
||||||
}
|
}
|
||||||
// TODO attachments:
|
// TODO attachments:
|
||||||
// this.submitAttachments(data, response);
|
// this.submitAttachments(data, response);
|
||||||
@ -800,7 +800,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
deleteOriginalLinks: function (transaction) {
|
deleteOriginalLinks: function (transaction) {
|
||||||
console.log(transaction.links);
|
// console.log(transaction.links);
|
||||||
for (let i in transaction.links) {
|
for (let i in transaction.links) {
|
||||||
if (transaction.links.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
if (transaction.links.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||||
let current = transaction.links[i];
|
let current = transaction.links[i];
|
||||||
@ -820,7 +820,7 @@ export default {
|
|||||||
let total = 0;
|
let total = 0;
|
||||||
let promises = [];
|
let promises = [];
|
||||||
|
|
||||||
console.log('submitTransactionLinks()');
|
// console.log('submitTransactionLinks()');
|
||||||
for (let i in this.transactions) {
|
for (let i in this.transactions) {
|
||||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||||
// original transaction present?
|
// original transaction present?
|
||||||
@ -834,7 +834,7 @@ export default {
|
|||||||
this.deleteOriginalLinks(originalTransaction);
|
this.deleteOriginalLinks(originalTransaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('links are different!');
|
// console.log('links are different!');
|
||||||
// console.log(newLinks);
|
// console.log(newLinks);
|
||||||
// console.log(originalLinks);
|
// console.log(originalLinks);
|
||||||
for (let ii in currentTransaction.links) {
|
for (let ii in currentTransaction.links) {
|
||||||
@ -855,7 +855,7 @@ export default {
|
|||||||
linkObject.outward_id = currentLink.transaction_journal_id;
|
linkObject.outward_id = currentLink.transaction_journal_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(linkObject);
|
// console.log(linkObject);
|
||||||
total++;
|
total++;
|
||||||
// submit transaction link:
|
// submit transaction link:
|
||||||
promises.push(axios.post('./api/v1/transaction_links', linkObject).then(response => {
|
promises.push(axios.post('./api/v1/transaction_links', linkObject).then(response => {
|
||||||
@ -877,20 +877,20 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
finalizeSubmit: function () {
|
finalizeSubmit: function () {
|
||||||
console.log('now in finalizeSubmit()');
|
// console.log('now in finalizeSubmit()');
|
||||||
console.log('submittedTransaction : ' + this.submittedTransaction);
|
// console.log('submittedTransaction : ' + this.submittedTransaction);
|
||||||
console.log('submittedLinks : ' + this.submittedLinks);
|
// console.log('submittedLinks : ' + this.submittedLinks);
|
||||||
console.log('submittedAttachments : ' + this.submittedAttachments);
|
// console.log('submittedAttachments : ' + this.submittedAttachments);
|
||||||
|
|
||||||
if (this.submittedTransaction && this.submittedAttachments && this.submittedLinks) {
|
if (this.submittedTransaction && this.submittedAttachments && this.submittedLinks) {
|
||||||
console.log('all true');
|
// console.log('all true');
|
||||||
console.log('inError = ' + this.inError);
|
// console.log('inError = ' + this.inError);
|
||||||
console.log('stayHere = ' + this.stayHere);
|
// console.log('stayHere = ' + this.stayHere);
|
||||||
console.log('returnedGroupId = ' + this.returnedGroupId);
|
// console.log('returnedGroupId = ' + this.returnedGroupId);
|
||||||
|
|
||||||
// no error + no changes + no redirect
|
// no error + no changes + no redirect
|
||||||
if (true === this.stayHere && false === this.inError && 0 === this.returnedGroupId) {
|
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:
|
// show message:
|
||||||
this.errorMessage = '';
|
this.errorMessage = '';
|
||||||
this.successMessage = '';
|
this.successMessage = '';
|
||||||
@ -900,12 +900,12 @@ export default {
|
|||||||
|
|
||||||
// no error + no changes + redirect
|
// no error + no changes + redirect
|
||||||
if (false === this.stayHere && false === this.inError && 0 === this.returnedGroupId) {
|
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';
|
window.location.href = (window.previousURL ?? '/') + '?transaction_group_id=' + this.groupId + '&message=no_change';
|
||||||
}
|
}
|
||||||
// no error + changes + no redirect
|
// no error + changes + no redirect
|
||||||
if (true === this.stayHere && false === this.inError && 0 !== this.returnedGroupId) {
|
if (true === this.stayHere && false === this.inError && 0 !== this.returnedGroupId) {
|
||||||
console.log('no error + changes + redirect');
|
// console.log('no error + changes + redirect');
|
||||||
// show message:
|
// show message:
|
||||||
this.errorMessage = '';
|
this.errorMessage = '';
|
||||||
this.warningMessage = '';
|
this.warningMessage = '';
|
||||||
@ -915,10 +915,10 @@ export default {
|
|||||||
|
|
||||||
// no error + changes + redirect
|
// no error + changes + redirect
|
||||||
if (false === this.stayHere && false === this.inError && 0 !== this.returnedGroupId) {
|
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';
|
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:
|
// enable flags:
|
||||||
this.enableSubmit = true;
|
this.enableSubmit = true;
|
||||||
this.submittedTransaction = false;
|
this.submittedTransaction = false;
|
||||||
|
@ -381,13 +381,13 @@ export default {
|
|||||||
return this.date;
|
return this.date;
|
||||||
},
|
},
|
||||||
sourceAccount: function () {
|
sourceAccount: function () {
|
||||||
console.log('computed::sourceAccount');
|
// console.log('computed::sourceAccount');
|
||||||
let value = {
|
let value = {
|
||||||
id: this.transaction.source_account_id,
|
id: this.transaction.source_account_id,
|
||||||
name: this.transaction.source_account_name,
|
name: this.transaction.source_account_name,
|
||||||
type: this.transaction.source_account_type,
|
type: this.transaction.source_account_type,
|
||||||
};
|
};
|
||||||
console.log(JSON.stringify(value));
|
// console.log(JSON.stringify(value));
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
destinationAccount: function () {
|
destinationAccount: function () {
|
||||||
|
@ -192,10 +192,10 @@ export default {
|
|||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
selectedAccount: function (value) {
|
selectedAccount: function (value) {
|
||||||
console.log('TransactionAccount::watch selectedAccount()');
|
// console.log('TransactionAccount::watch selectedAccount()');
|
||||||
console.log(value);
|
// console.log(value);
|
||||||
if (true === this.selectedAccountTrigger) {
|
if (true === this.selectedAccountTrigger) {
|
||||||
console.log('$emit alles!');
|
// console.log('$emit alles!');
|
||||||
this.$emit('set-account',
|
this.$emit('set-account',
|
||||||
{
|
{
|
||||||
index: this.index,
|
index: this.index,
|
||||||
@ -208,18 +208,18 @@ export default {
|
|||||||
currency_symbol: value.currency_symbol,
|
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;
|
this.accountName = value.name;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
accountName: function (value) {
|
accountName: function (value) {
|
||||||
console.log('now at watch accountName("' + value + '")');
|
// console.log('now at watch accountName("' + value + '")');
|
||||||
console.log(this.selectedAccountTrigger);
|
// console.log(this.selectedAccountTrigger);
|
||||||
if (true === this.selectedAccountTrigger) {
|
if (true === this.selectedAccountTrigger) {
|
||||||
console.log('Do nothing because selectedAccountTrigger = true');
|
// console.log('Do nothing because selectedAccountTrigger = true');
|
||||||
}
|
}
|
||||||
if (false === this.selectedAccountTrigger) {
|
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',
|
this.$emit('set-account',
|
||||||
{
|
{
|
||||||
index: this.index,
|
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};
|
// 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;
|
this.selectedAccountTrigger = false;
|
||||||
},
|
},
|
||||||
value: function (value) {
|
value: function (value) {
|
||||||
console.log('TransactionAccount::watch value(' + JSON.stringify(value) + ')');
|
// console.log('TransactionAccount::watch value(' + JSON.stringify(value) + ')');
|
||||||
this.systemReturnedAccount(value);
|
this.systemReturnedAccount(value);
|
||||||
|
|
||||||
// // console.log('Index ' + this.index + ' nwAct: ', value);
|
// // console.log('Index ' + this.index + ' nwAct: ', value);
|
||||||
|
@ -64,7 +64,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
this.localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||||
this.systemTimeZone = this.timezone;
|
this.systemTimeZone = this.timezone;
|
||||||
console.log('TransactionDate: ' + this.date);
|
// console.log('TransactionDate: ' + this.date);
|
||||||
// split date and time:
|
// split date and time:
|
||||||
let parts = this.date.split('T');
|
let parts = this.date.split('T');
|
||||||
this.dateStr = parts[0];
|
this.dateStr = parts[0];
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<form v-on:submit.prevent="search">
|
<form v-on:submit.prevent="search" autocomplete="off">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="query" v-model="query" autocomplete="off" class="form-control" maxlength="255" name="search"
|
<input id="query" v-model="query" autocomplete="off" class="form-control" maxlength="255" name="search"
|
||||||
placeholder="Search query" type="text">
|
placeholder="Search query" type="text">
|
||||||
|
@ -78,7 +78,7 @@ export default {
|
|||||||
this.tagList = value;
|
this.tagList = value;
|
||||||
},
|
},
|
||||||
tagList: function (value) {
|
tagList: function (value) {
|
||||||
console.log('watch tagList');
|
// console.log('watch tagList');
|
||||||
if (true === this.emitEvent) {
|
if (true === this.emitEvent) {
|
||||||
this.$emit('set-field', {field: 'tags', index: this.index, value: value});
|
this.$emit('set-field', {field: 'tags', index: this.index, value: value});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user