mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-06 01:45:22 +00:00
Merge branch 'develop' into feature/credit_calc
# Conflicts: # app/Factory/TransactionJournalMetaFactory.php # app/Repositories/Account/AccountRepository.php # app/Transformers/AccountTransformer.php # config/firefly.php # frontend/src/components/accounts/Create.vue
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<div>
|
||||
<Alert :message="errorMessage" type="danger"/>
|
||||
<Alert :message="successMessage" type="success"/>
|
||||
<form @submit="submitForm">
|
||||
<form @submit="submitForm" autocomplete="off">
|
||||
<div class="row">
|
||||
<div class="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="card card-primary">
|
||||
@@ -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,8 +232,8 @@ 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)
|
||||
@@ -250,7 +250,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';
|
||||
@@ -277,7 +277,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];
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -133,6 +133,7 @@
|
||||
|
||||
import {mapGetters} from "vuex";
|
||||
import Sortable from "sortablejs";
|
||||
import format from "date-fns/format";
|
||||
|
||||
export default {
|
||||
name: "Index",
|
||||
@@ -259,9 +260,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 +270,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 +289,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 +297,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 +305,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 +331,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 +358,7 @@ export default {
|
||||
}
|
||||
},
|
||||
getAccountBalanceDifference: function (index, acct) {
|
||||
console.log('getAccountBalanceDifference(' + index + ')');
|
||||
// console.log('getAccountBalanceDifference(' + index + ')');
|
||||
// get account on day 0
|
||||
let promises = [];
|
||||
|
||||
@@ -370,9 +371,10 @@ export default {
|
||||
}
|
||||
);
|
||||
}));
|
||||
|
||||
promises.push(axios.get('./api/v1/accounts/' + acct.id + '?date=' + this.start.toISOString().split('T')[0]));
|
||||
promises.push(axios.get('./api/v1/accounts/' + acct.id + '?date=' + this.end.toISOString().split('T')[0]));
|
||||
let startStr = format(this.start, 'y-MM-dd');
|
||||
let endStr = format(this.end, 'y-MM-dd');
|
||||
promises.push(axios.get('./api/v1/accounts/' + acct.id + '?date=' + startStr));
|
||||
promises.push(axios.get('./api/v1/accounts/' + acct.id + '?date=' + endStr));
|
||||
|
||||
Promise.all(promises).then(responses => {
|
||||
let index = responses[0].index;
|
||||
|
||||
@@ -102,11 +102,9 @@ export default {
|
||||
},
|
||||
ticks: {
|
||||
callback: function (value, index, values) {
|
||||
//return this.getLabelForValue(value);
|
||||
let dateObj = new Date(this.getLabelForValue(value));
|
||||
let options = {year: 'numeric', month: 'long', day: 'numeric'};
|
||||
let str = new Intl.DateTimeFormat(localStorage.locale, options).format(dateObj);
|
||||
return str;
|
||||
let dateObj = new Date(this.getLabelForValue(value).split('T')[0]);
|
||||
return new Intl.DateTimeFormat(localStorage.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(dateObj);
|
||||
//return str;
|
||||
// // //console.log();
|
||||
// // //return self.formatLabel(value, 20);
|
||||
// // return self.formatLabel(str, 20);
|
||||
|
||||
@@ -46,7 +46,8 @@
|
||||
class="btn btn-secondary"
|
||||
@click="resetDate"
|
||||
><i class="fas fa-history"></i></button>
|
||||
<button id="dropdownMenuButton" :title="$t('firefly.select_period')" aria-expanded="false" aria-haspopup="true" class="btn btn-secondary dropdown-toggle"
|
||||
<button id="dropdownMenuButton" :title="$t('firefly.select_period')" aria-expanded="false" aria-haspopup="true"
|
||||
class="btn btn-secondary dropdown-toggle"
|
||||
data-toggle="dropdown"
|
||||
type="button">
|
||||
<i class="fas fa-list"></i>
|
||||
@@ -78,8 +79,23 @@
|
||||
import {createNamespacedHelpers} from "vuex";
|
||||
import Vue from "vue";
|
||||
import DatePicker from "v-calendar/lib/components/date-picker.umd";
|
||||
const {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')
|
||||
import subDays from 'date-fns/subDays';
|
||||
import addDays from 'date-fns/addDays';
|
||||
import addMonths from 'date-fns/addMonths';
|
||||
import startOfDay from 'date-fns/startOfDay';
|
||||
import endOfDay from 'date-fns/endOfDay';
|
||||
import startOfWeek from 'date-fns/startOfWeek';
|
||||
import endOfWeek from 'date-fns/endOfWeek';
|
||||
import endOfMonth from 'date-fns/endOfMonth';
|
||||
import format from 'date-fns/format';
|
||||
import startOfQuarter from 'date-fns/startOfQuarter';
|
||||
import subMonths from 'date-fns/subMonths';
|
||||
import endOfQuarter from 'date-fns/endOfQuarter';
|
||||
import subQuarters from 'date-fns/subQuarters';
|
||||
import addQuarters from 'date-fns/addQuarters';
|
||||
import startOfMonth from 'date-fns/startOfMonth';
|
||||
|
||||
const {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')
|
||||
|
||||
Vue.component('date-picker', DatePicker)
|
||||
|
||||
@@ -130,50 +146,400 @@ export default {
|
||||
this.generatePeriods()
|
||||
return false;
|
||||
},
|
||||
generatePeriods: function () {
|
||||
this.periods = [];
|
||||
// create periods.
|
||||
let today;
|
||||
let end;
|
||||
|
||||
today = new Date(this.range.start);
|
||||
|
||||
// previous month
|
||||
firstDayOfMonth = new Date(today.getFullYear(), today.getMonth()-1, 1);
|
||||
lastDayOfMonth = new Date(today.getFullYear(), today.getMonth(), 0);
|
||||
generateDaily: function () {
|
||||
let today = new Date(this.range.start);
|
||||
// yesterday
|
||||
this.periods.push(
|
||||
{
|
||||
start: firstDayOfMonth.toDateString(),
|
||||
end: lastDayOfMonth.toDateString(),
|
||||
title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(firstDayOfMonth)
|
||||
start: startOfDay(subDays(today, 1)).toDateString(),
|
||||
end: endOfDay(subDays(today, 1)).toDateString(),
|
||||
title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(subDays(today, 1))
|
||||
}
|
||||
);
|
||||
|
||||
// today
|
||||
this.periods.push(
|
||||
{
|
||||
start: startOfDay(today).toDateString(),
|
||||
end: endOfDay(today).toDateString(),
|
||||
title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(today)
|
||||
}
|
||||
);
|
||||
|
||||
// tomorrow:
|
||||
this.periods.push(
|
||||
{
|
||||
start: startOfDay(addDays(today, 1)).toDateString(),
|
||||
end: endOfDay(addDays(today, 1)).toDateString(),
|
||||
title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(addDays(today, 1))
|
||||
}
|
||||
);
|
||||
|
||||
// The Day After Tomorrow dun-dun-dun!
|
||||
this.periods.push(
|
||||
{
|
||||
start: startOfDay(addDays(today, 2)).toDateString(),
|
||||
end: endOfDay(addDays(today, 2)).toDateString(),
|
||||
title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(addDays(today, 2))
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
generateWeekly: function () {
|
||||
//console.log('weekly');
|
||||
let today = new Date(this.range.start);
|
||||
//console.log('Today is ' + today);
|
||||
let start = startOfDay(startOfWeek(subDays(today, 7), {weekStartsOn: 1}));
|
||||
let end = endOfDay(endOfWeek(subDays(today, 7), {weekStartsOn: 1}));
|
||||
let dateFormat = this.$t('config.week_in_year_fns');
|
||||
//console.log('Date format: "'+dateFormat+'"');
|
||||
let title = format(start, dateFormat);
|
||||
|
||||
// last week
|
||||
// console.log('Last week');
|
||||
// console.log(start);
|
||||
// console.log(end);
|
||||
// console.log(title);
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
|
||||
// this week
|
||||
start = startOfDay(startOfWeek(today, {weekStartsOn: 1}));
|
||||
end = endOfDay(endOfWeek(today, {weekStartsOn: 1}));
|
||||
title = format(start, dateFormat);
|
||||
// console.log('This week');
|
||||
// console.log(start);
|
||||
// console.log(end);
|
||||
// console.log(title);
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
|
||||
// next week
|
||||
start = startOfDay(startOfWeek(addDays(today, 7), {weekStartsOn: 1}));
|
||||
end = endOfDay(endOfWeek(addDays(today, 7), {weekStartsOn: 1}));
|
||||
title = format(start, dateFormat);
|
||||
// console.log('Next week');
|
||||
// console.log(start);
|
||||
// console.log(end);
|
||||
// console.log(title);
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
},
|
||||
generateMonthly: function () {
|
||||
let today = new Date(this.range.start);
|
||||
// previous month
|
||||
let start = startOfDay(startOfMonth(subMonths(today, 1)));
|
||||
let end = endOfDay(endOfMonth(subMonths(today, 1)));
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(start)
|
||||
}
|
||||
);
|
||||
|
||||
// this month
|
||||
firstDayOfMonth = new Date(today.getFullYear(), today.getMonth(), 1);
|
||||
lastDayOfMonth = new Date(today.getFullYear(), today.getMonth()+1, 0);
|
||||
start = startOfDay(startOfMonth(today));
|
||||
end = endOfDay(endOfMonth(today));
|
||||
this.periods.push(
|
||||
{
|
||||
start: firstDayOfMonth.toDateString(),
|
||||
end: lastDayOfMonth.toDateString(),
|
||||
title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(firstDayOfMonth)
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(start)
|
||||
}
|
||||
);
|
||||
|
||||
// next month
|
||||
let firstDayOfMonth = new Date(today.getFullYear(), today.getMonth()+1, 1);
|
||||
let lastDayOfMonth = new Date(today.getFullYear(), today.getMonth()+2, 0);
|
||||
start = startOfDay(startOfMonth(addMonths(today, 1)));
|
||||
end = endOfDay(endOfMonth(addMonths(today, 1)));
|
||||
this.periods.push(
|
||||
{
|
||||
start: firstDayOfMonth.toDateString(),
|
||||
end: lastDayOfMonth.toDateString(),
|
||||
title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(firstDayOfMonth)
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(start)
|
||||
}
|
||||
);
|
||||
|
||||
},
|
||||
generateQuarterly: function () {
|
||||
let today = new Date(this.range.start);
|
||||
|
||||
// last quarter
|
||||
let start = startOfDay(startOfQuarter(subQuarters(today, 1)));
|
||||
let end = endOfDay(endOfQuarter(subQuarters(today, 1)));
|
||||
let dateFormat = this.$t('config.quarter_fns');
|
||||
let title = format(start, dateFormat);
|
||||
|
||||
// last week
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// this quarter
|
||||
start = startOfDay(startOfQuarter(today));
|
||||
end = endOfDay(endOfQuarter(today));
|
||||
title = format(start, dateFormat);
|
||||
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
// next quarter
|
||||
start = startOfDay(startOfQuarter(addQuarters(today, 1)));
|
||||
end = endOfDay(endOfQuarter(addQuarters(today, 1)));
|
||||
title = format(start, dateFormat);
|
||||
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
},
|
||||
generateHalfYearly: function () {
|
||||
let today = new Date(this.range.start);
|
||||
let start;
|
||||
let end;
|
||||
let title = 'todo';
|
||||
let half = 1;
|
||||
|
||||
|
||||
// its currently first half of year:
|
||||
if (today.getMonth() <= 5) {
|
||||
// previous year, last half:
|
||||
start = today;
|
||||
start.setFullYear(start.getFullYear() - 1);
|
||||
start.setMonth(6);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
end = start;
|
||||
end.setMonth(11);
|
||||
end.setDate(31);
|
||||
end = endOfDay(end);
|
||||
half = 2;
|
||||
title = format(start, this.$t('config.half_year_fns', {half: half}));
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
|
||||
// this year, first half:
|
||||
start = today;
|
||||
start.setMonth(0);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
end = today;
|
||||
end.setMonth(5);
|
||||
end.setDate(30);
|
||||
end = endOfDay(start);
|
||||
half = 1;
|
||||
title = format(start, this.$t('config.half_year_fns', {half: half}));
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
|
||||
// this year, second half:
|
||||
start = today;
|
||||
start.setMonth(6);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
end = start;
|
||||
end.setMonth(11);
|
||||
end.setDate(31);
|
||||
end = endOfDay(end);
|
||||
half = 2;
|
||||
title = format(start, this.$t('config.half_year_fns', {half: half}));
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
// this year, first half:
|
||||
start = today;
|
||||
start.setMonth(0);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
end = start;
|
||||
end.setMonth(5);
|
||||
end.setDate(30);
|
||||
end = endOfDay(end);
|
||||
half = 1;
|
||||
title = format(start, this.$t('config.half_year_fns', {half: half}));
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
|
||||
// this year, current (second) half:
|
||||
start = today;
|
||||
start.setMonth(6);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
end = today;
|
||||
end.setMonth(11);
|
||||
end.setDate(31);
|
||||
end = endOfDay(start);
|
||||
half = 2;
|
||||
title = format(start, this.$t('config.half_year_fns', {half: half}));
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
|
||||
// next year, first half:
|
||||
start = today;
|
||||
start.setMonth(0);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
end = start;
|
||||
end.setMonth(5);
|
||||
end.setDate(30);
|
||||
end = endOfDay(end);
|
||||
half = 1;
|
||||
title = format(start, this.$t('config.half_year_fns', {half: half}));
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: title
|
||||
}
|
||||
);
|
||||
},
|
||||
generateYearly: function () {
|
||||
let today = new Date(this.range.start);
|
||||
let start;
|
||||
let end;
|
||||
let title;
|
||||
|
||||
// last year
|
||||
start = new Date(today);
|
||||
start.setFullYear(start.getFullYear() - 1);
|
||||
start.setMonth(0);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
|
||||
end = new Date(today);
|
||||
end.setFullYear(end.getFullYear() - 1);
|
||||
end.setMonth(11);
|
||||
end.setDate(31);
|
||||
end = endOfDay(end);
|
||||
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: start.getFullYear()
|
||||
}
|
||||
);
|
||||
|
||||
// this year
|
||||
start = new Date(today);
|
||||
start.setMonth(0);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
|
||||
end = new Date(today);
|
||||
end.setMonth(11);
|
||||
end.setDate(31);
|
||||
end = endOfDay(end);
|
||||
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: start.getFullYear()
|
||||
}
|
||||
);
|
||||
// next year
|
||||
start = new Date(today);
|
||||
start.setFullYear(start.getFullYear() + 1);
|
||||
start.setMonth(0);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
|
||||
end = new Date(today);
|
||||
end.setFullYear(end.getFullYear() + 1);
|
||||
end.setMonth(11);
|
||||
end.setDate(31);
|
||||
end = endOfDay(end);
|
||||
|
||||
this.periods.push(
|
||||
{
|
||||
start: start.toDateString(),
|
||||
end: end.toDateString(),
|
||||
title: start.getFullYear()
|
||||
}
|
||||
);
|
||||
},
|
||||
generatePeriods: function () {
|
||||
this.periods = [];
|
||||
//console.log('The view range is "' + this.viewRange + '".');
|
||||
switch (this.viewRange) {
|
||||
case '1D':
|
||||
this.generateDaily();
|
||||
break;
|
||||
case '1W':
|
||||
this.generateWeekly();
|
||||
break;
|
||||
case '1M':
|
||||
this.generateMonthly();
|
||||
break;
|
||||
case '3M':
|
||||
this.generateQuarterly();
|
||||
break;
|
||||
case '6M':
|
||||
this.generateHalfYearly();
|
||||
break;
|
||||
case '1Y':
|
||||
this.generateYearly();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// last 7 days
|
||||
today = new Date;
|
||||
end = new Date;
|
||||
let today = new Date;
|
||||
let end = new Date;
|
||||
end.setDate(end.getDate() - 7);
|
||||
this.periods.push(
|
||||
{
|
||||
|
||||
@@ -49,12 +49,11 @@ import DataConverter from "../charts/DataConverter";
|
||||
import DefaultLineOptions from "../charts/DefaultLineOptions";
|
||||
import {mapGetters} from "vuex";
|
||||
import * as ChartJs from 'chart.js'
|
||||
import format from "date-fns/format";
|
||||
|
||||
ChartJs.Chart.register.apply(null, Object.values(ChartJs).filter((chartClass) => (chartClass.id)));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
name: "MainAccount",
|
||||
components: {}, // MainAccountChart
|
||||
@@ -63,6 +62,7 @@ export default {
|
||||
loading: true,
|
||||
error: false,
|
||||
ready: false,
|
||||
initialised: false,
|
||||
dataCollection: {},
|
||||
chartOptions: {},
|
||||
_chart: null,
|
||||
@@ -71,18 +71,18 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.ready = true;
|
||||
this.chartOptions = DefaultLineOptions.methods.getDefaultOptions();
|
||||
this.localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
this.systemTimeZone = this.timezone;
|
||||
this.ready = true;
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('dashboard/index',['start', 'end']),
|
||||
...mapGetters('root',['timezone']),
|
||||
...mapGetters('dashboard/index', ['start', 'end']),
|
||||
...mapGetters('root', ['timezone']),
|
||||
'datesReady': function () {
|
||||
return null !== this.start && null !== this.end && this.ready;
|
||||
},
|
||||
timezoneDifference: function() {
|
||||
timezoneDifference: function () {
|
||||
return this.localTimeZone !== this.systemTimeZone;
|
||||
}
|
||||
},
|
||||
@@ -93,18 +93,20 @@ export default {
|
||||
}
|
||||
},
|
||||
start: function () {
|
||||
//this.initialiseChart();
|
||||
this.updateChart();
|
||||
},
|
||||
end: function () {
|
||||
//this.initialiseChart();
|
||||
this.updateChart();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
initialiseChart: function () {
|
||||
this.loading = true;
|
||||
this.error = false;
|
||||
let startStr = this.start.toISOString().split('T')[0];
|
||||
let endStr = this.end.toISOString().split('T')[0];
|
||||
//let startStr = this.start.toISOString().split('T')[0];
|
||||
//let endStr = this.end.toISOString().split('T')[0];
|
||||
let startStr = format(this.start, 'y-MM-dd');
|
||||
let endStr = format(this.end, 'y-MM-dd');
|
||||
let url = './api/v1/chart/account/overview?start=' + startStr + '&end=' + endStr;
|
||||
axios.get(url)
|
||||
.then(response => {
|
||||
@@ -122,12 +124,33 @@ export default {
|
||||
});
|
||||
},
|
||||
drawChart: function () {
|
||||
this._chart = new ChartJs.Chart(this.$refs.canvas.getContext('2d'), {
|
||||
type: 'line',
|
||||
data: this.dataCollection,
|
||||
options: this.chartOptions
|
||||
}
|
||||
);
|
||||
//console.log('drawChart');
|
||||
if ('undefined' !== typeof this._chart) {
|
||||
// console.log('update!');
|
||||
this._chart.data = this.dataCollection;
|
||||
this._chart.update();
|
||||
this.initialised = true;
|
||||
}
|
||||
|
||||
if ('undefined' === typeof this._chart) {
|
||||
// console.log('new!');
|
||||
this._chart = new ChartJs.Chart(this.$refs.canvas.getContext('2d'), {
|
||||
type: 'line',
|
||||
data: this.dataCollection,
|
||||
options: this.chartOptions
|
||||
}
|
||||
);
|
||||
this.initialised = true;
|
||||
}
|
||||
},
|
||||
updateChart: function () {
|
||||
// console.log('updateChart');
|
||||
if (this.initialised) {
|
||||
// console.log('MUST Update chart!');
|
||||
// reset some vars so it wont trigger again:
|
||||
this.initialised = false;
|
||||
this.initialiseChart();
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
|
||||
<script>
|
||||
import {createNamespacedHelpers} from "vuex";
|
||||
import format from "date-fns/format";
|
||||
|
||||
const {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')
|
||||
|
||||
@@ -123,7 +124,7 @@ export default {
|
||||
initialiseList: function () {
|
||||
this.loading = true;
|
||||
this.accounts = [];
|
||||
axios.get('./api/v1/preferences/frontpageAccounts')
|
||||
axios.get('./api/v1/preferences/frontPageAccounts')
|
||||
.then(response => {
|
||||
this.loadAccounts(response);
|
||||
}
|
||||
@@ -162,8 +163,10 @@ export default {
|
||||
);
|
||||
},
|
||||
loadTransactions(key, accountId) {
|
||||
let startStr = this.start.toISOString().split('T')[0];
|
||||
let endStr = this.end.toISOString().split('T')[0];
|
||||
// let startStr = this.start.toISOString().split('T')[0];
|
||||
// let endStr = this.end.toISOString().split('T')[0];
|
||||
let startStr = format(this.start, 'y-MM-dd');
|
||||
let endStr = format(this.end, 'y-MM-dd');
|
||||
axios.get('./api/v1/accounts/' + accountId + '/transactions?page=1&limit=10&start=' + startStr + '&end=' + endStr)
|
||||
.then(response => {
|
||||
this.accounts[key].transactions = response.data.data;
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import {createNamespacedHelpers} from "vuex";
|
||||
import format from "date-fns/format";
|
||||
|
||||
const {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')
|
||||
export default {
|
||||
@@ -125,8 +126,10 @@ export default {
|
||||
initialiseBills: function () {
|
||||
this.loading = true;
|
||||
this.bills = [];
|
||||
let startStr = this.start.toISOString().split('T')[0];
|
||||
let endStr = this.end.toISOString().split('T')[0];
|
||||
// let startStr = this.start.toISOString().split('T')[0];
|
||||
// let endStr = this.end.toISOString().split('T')[0];
|
||||
let startStr = format(this.start, 'y-MM-dd');
|
||||
let endStr = format(this.end, 'y-MM-dd');
|
||||
|
||||
axios.get('./api/v1/bills?start=' + startStr + '&end=' + endStr)
|
||||
.then(response => {
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
<script>
|
||||
import BudgetListGroup from "./BudgetListGroup";
|
||||
import {createNamespacedHelpers} from "vuex";
|
||||
import format from "date-fns/format";
|
||||
|
||||
const {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')
|
||||
|
||||
@@ -136,8 +137,10 @@ export default {
|
||||
other: [],
|
||||
};
|
||||
this.loading = true;
|
||||
let startStr = this.start.toISOString().split('T')[0];
|
||||
let endStr = this.end.toISOString().split('T')[0];
|
||||
// let startStr = this.start.toISOString().split('T')[0];
|
||||
// let endStr = this.end.toISOString().split('T')[0];
|
||||
let startStr = format(this.start, 'y-MM-dd');
|
||||
let endStr = format(this.end, 'y-MM-dd');
|
||||
axios.get('./api/v1/budgets?start=' + startStr + '&end=' + endStr)
|
||||
.then(response => {
|
||||
this.parseBudgets(response.data);
|
||||
@@ -164,7 +167,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 + ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,8 +175,10 @@ export default {
|
||||
this.getBudgetLimits();
|
||||
},
|
||||
getBudgetLimits() {
|
||||
let startStr = this.start.toISOString().split('T')[0];
|
||||
let endStr = this.end.toISOString().split('T')[0];
|
||||
// let startStr = this.start.toISOString().split('T')[0];
|
||||
// let endStr = this.end.toISOString().split('T')[0];
|
||||
let startStr = format(this.start, 'y-MM-dd');
|
||||
let endStr = format(this.end, 'y-MM-dd');
|
||||
axios.get('./api/v1/budget-limits?start=' + startStr + '&end=' + endStr)
|
||||
.then(response => {
|
||||
this.parseBudgetLimits(response.data);
|
||||
@@ -192,7 +197,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 +255,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
|
||||
<script>
|
||||
import {createNamespacedHelpers} from "vuex";
|
||||
import format from "date-fns/format";
|
||||
|
||||
const {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')
|
||||
|
||||
@@ -136,27 +137,42 @@ export default {
|
||||
},
|
||||
methods:
|
||||
{
|
||||
getCategories() {
|
||||
getCategories: function () {
|
||||
this.categories = [];
|
||||
this.sortedList = [];
|
||||
this.spent = 0;
|
||||
this.earned = 0;
|
||||
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)
|
||||
// let startStr = this.start.toISOString().split('T')[0];
|
||||
// let endStr = this.end.toISOString().split('T')[0];
|
||||
let startStr = format(this.start, 'y-MM-dd');
|
||||
let endStr = format(this.end, 'y-MM-dd');
|
||||
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 +223,6 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.sortCategories();
|
||||
},
|
||||
sortCategories() {
|
||||
// no longer care about keys:
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
<script>
|
||||
|
||||
import {createNamespacedHelpers} from "vuex";
|
||||
import format from "date-fns/format";
|
||||
|
||||
const {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')
|
||||
|
||||
@@ -126,8 +127,10 @@ export default {
|
||||
this.loading = true;
|
||||
this.income = [];
|
||||
this.error = false;
|
||||
let startStr = this.start.toISOString().split('T')[0];
|
||||
let endStr = this.end.toISOString().split('T')[0];
|
||||
// let startStr = this.start.toISOString().split('T')[0];
|
||||
// let endStr = this.end.toISOString().split('T')[0];
|
||||
let startStr = format(this.start, 'y-MM-dd');
|
||||
let endStr = format(this.end, 'y-MM-dd');
|
||||
axios.get('./api/v1/insight/income/revenue?start=' + startStr + '&end=' + endStr)
|
||||
.then(response => {
|
||||
// do something with response.
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
<script>
|
||||
|
||||
import {createNamespacedHelpers} from "vuex";
|
||||
import format from "date-fns/format";
|
||||
|
||||
const {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')
|
||||
|
||||
@@ -125,8 +126,10 @@ export default {
|
||||
this.loading = true;
|
||||
this.error = false;
|
||||
this.expenses = [];
|
||||
let startStr = this.start.toISOString().split('T')[0];
|
||||
let endStr = this.end.toISOString().split('T')[0];
|
||||
// let startStr = this.start.toISOString().split('T')[0];
|
||||
// let endStr = this.end.toISOString().split('T')[0];
|
||||
let startStr = format(this.start, 'y-MM-dd');
|
||||
let endStr = format(this.end, 'y-MM-dd');
|
||||
axios.get('./api/v1/insight/expense/expense?start=' + startStr + '&end=' + endStr)
|
||||
.then(response => {
|
||||
// do something with response.
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<span v-if="error" class="info-box-text"><i class="fas fa-exclamation-triangle text-danger"></i></span>
|
||||
<!-- balance in preferred currency -->
|
||||
<span v-for="balance in prefCurrencyBalances" :title="balance.sub_title" class="info-box-number">{{ balance.value_parsed }}</span>
|
||||
|
||||
<span v-if="0 === prefCurrencyBalances.length" class="info-box-number"> </span>
|
||||
<div class="progress bg-info">
|
||||
<div class="progress-bar" style="width: 0"></div>
|
||||
</div>
|
||||
@@ -55,6 +55,7 @@
|
||||
<span v-if="error" class="info-box-text"><i class="fas fa-exclamation-triangle text-danger"></i></span>
|
||||
<!-- bills unpaid, in preferred currency. -->
|
||||
<span v-for="balance in prefBillsUnpaid" class="info-box-number">{{ balance.value_parsed }}</span>
|
||||
<span v-if="0===prefBillsUnpaid.length" class="info-box-number"> </span>
|
||||
|
||||
<div class="progress bg-teal">
|
||||
<div class="progress-bar" style="width: 0"></div>
|
||||
@@ -80,6 +81,7 @@
|
||||
<span v-if="error" class="info-box-text"><i class="fas fa-exclamation-triangle text-danger"></i></span>
|
||||
<!-- left to spend in preferred currency -->
|
||||
<span v-for="left in prefLeftToSpend" :title="left.sub_title" class="info-box-number">{{ left.value_parsed }}</span>
|
||||
<span v-if="0 === prefLeftToSpend.length" class="info-box-number"> </span>
|
||||
|
||||
<div class="progress bg-success">
|
||||
<div class="progress-bar" style="width: 0"></div>
|
||||
@@ -105,7 +107,7 @@
|
||||
<span v-if="loading && !error" class="info-box-text"><i class="fas fa-spinner fa-spin"></i></span>
|
||||
<span v-if="error" class="info-box-text"><i class="fas fa-exclamation-triangle text-danger"></i></span>
|
||||
<span v-for="nw in prefNetWorth" :title="nw.sub_title" class="info-box-number">{{ nw.value_parsed }}</span>
|
||||
|
||||
<span v-if="0===prefNetWorth.length"> </span>
|
||||
<div class="progress bg-success">
|
||||
<div class="progress-bar" style="width: 0"></div>
|
||||
</div>
|
||||
@@ -124,6 +126,7 @@
|
||||
|
||||
<script>
|
||||
import {createNamespacedHelpers} from "vuex";
|
||||
import format from 'date-fns/format';
|
||||
|
||||
const {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')
|
||||
export default {
|
||||
@@ -249,8 +252,12 @@ export default {
|
||||
this.billsUnpaid = [];
|
||||
this.leftToSpend = [];
|
||||
this.netWorth = [];
|
||||
let startStr = this.start.toISOString().split('T')[0];
|
||||
let endStr = this.end.toISOString().split('T')[0];
|
||||
let startStr = format(this.start, 'y-MM-dd');
|
||||
let endStr = format(this.end, 'y-MM-dd');
|
||||
//let startStr = this.start.toISOString().split('T')[0];
|
||||
//let endStr = this.end.toISOString().split('T')[0];
|
||||
//console.log(startStr);
|
||||
//console.log(endStr);
|
||||
axios.get('./api/v1/summary/basic?start=' + startStr + '&end=' + endStr)
|
||||
.then(response => {
|
||||
this.summary = response.data;
|
||||
|
||||
@@ -19,12 +19,20 @@
|
||||
*/
|
||||
|
||||
// initial state
|
||||
import startOfDay from "date-fns/startOfDay";
|
||||
import endOfDay from 'date-fns/endOfDay'
|
||||
import startOfWeek from 'date-fns/startOfWeek'
|
||||
import endOfWeek from 'date-fns/endOfWeek'
|
||||
import startOfQuarter from 'date-fns/startOfQuarter';
|
||||
import endOfQuarter from 'date-fns/endOfQuarter';
|
||||
import endOfMonth from "date-fns/endOfMonth";
|
||||
import startOfMonth from 'date-fns/startOfMonth';
|
||||
|
||||
const state = () => (
|
||||
{
|
||||
viewRange: 'default',
|
||||
start: null,
|
||||
end: null,
|
||||
// default range:
|
||||
defaultStart: null,
|
||||
defaultEnd: null,
|
||||
}
|
||||
@@ -53,24 +61,32 @@ const getters = {
|
||||
// actions
|
||||
const actions = {
|
||||
initialiseStore(context) {
|
||||
if ('default' === context.state.viewRange) {
|
||||
axios.get('./api/v1/preferences/viewRange')
|
||||
.then(response => {
|
||||
let viewRange = response.data.data.attributes.data;
|
||||
context.commit('setViewRange', viewRange);
|
||||
// call another action:
|
||||
// console.log('initialiseStore');
|
||||
|
||||
// restore from local storage:
|
||||
context.dispatch('restoreViewRange');
|
||||
|
||||
axios.get('./api/v1/preferences/viewRange')
|
||||
.then(response => {
|
||||
let viewRange = response.data.data.attributes.data;
|
||||
let oldViewRange = context.getters.viewRange;
|
||||
context.commit('setViewRange', viewRange);
|
||||
if (viewRange !== oldViewRange) {
|
||||
// console.log('View range changed from "' + oldViewRange + '" to "' + viewRange + '"');
|
||||
context.dispatch('setDatesFromViewRange');
|
||||
}
|
||||
).catch(error => {
|
||||
// console.log(error);
|
||||
context.commit('setViewRange', '1M');
|
||||
// call another action:
|
||||
context.dispatch('setDatesFromViewRange');
|
||||
});
|
||||
}
|
||||
if (viewRange === oldViewRange) {
|
||||
// console.log('Restore view range dates');
|
||||
context.dispatch('restoreViewRangeDates');
|
||||
}
|
||||
}
|
||||
).catch(() => {
|
||||
context.commit('setViewRange', '1M');
|
||||
context.dispatch('setDatesFromViewRange');
|
||||
});
|
||||
|
||||
},
|
||||
setDatesFromViewRange(context) {
|
||||
// console.log('Must set dates from viewRange "' + context.state.viewRange + '"');
|
||||
restoreViewRangeDates: function (context) {
|
||||
// check local storage first?
|
||||
if (localStorage.viewRangeStart) {
|
||||
// console.log('view range start set from local storage.');
|
||||
@@ -91,89 +107,76 @@ const actions = {
|
||||
// console.log(localStorage.viewRangeDefaultEnd);
|
||||
context.commit('setDefaultEnd', new Date(localStorage.viewRangeDefaultEnd));
|
||||
}
|
||||
|
||||
if (null !== context.getters.end && null !== context.getters.start) {
|
||||
return;
|
||||
},
|
||||
restoreViewRange: function (context) {
|
||||
// console.log('restoreViewRange');
|
||||
let viewRange = localStorage.getItem('viewRange');
|
||||
if (null !== viewRange) {
|
||||
// console.log('restored restoreViewRange ' + viewRange );
|
||||
context.commit('setViewRange', viewRange);
|
||||
}
|
||||
},
|
||||
setDatesFromViewRange(context) {
|
||||
let start;
|
||||
let end;
|
||||
let viewRange = context.getters.viewRange;
|
||||
let today = new Date;
|
||||
// console.log('Will recreate view range on ' + viewRange);
|
||||
switch (viewRange) {
|
||||
case '1D':
|
||||
// one day:
|
||||
start = new Date;
|
||||
end = new Date(start.getTime());
|
||||
start.setHours(0, 0, 0, 0);
|
||||
end.setHours(23, 59, 59, 999);
|
||||
// today:
|
||||
start = startOfDay(today);
|
||||
end = endOfDay(today);
|
||||
break;
|
||||
case '1W':
|
||||
// this week:
|
||||
start = new Date;
|
||||
end = new Date(start.getTime());
|
||||
// start of week
|
||||
let diff = start.getDate() - start.getDay() + (start.getDay() === 0 ? -6 : 1);
|
||||
start.setDate(diff);
|
||||
start.setHours(0, 0, 0, 0);
|
||||
|
||||
// end of week
|
||||
let lastday = end.getDate() - (end.getDay() - 1) + 6;
|
||||
end.setDate(lastday);
|
||||
end.setHours(23, 59, 59, 999);
|
||||
start = startOfDay(startOfWeek(today, {weekStartsOn: 1}));
|
||||
end = endOfDay(endOfWeek(today, {weekStartsOn: 1}));
|
||||
break;
|
||||
case '1M':
|
||||
// this month:
|
||||
start = new Date;
|
||||
start = new Date(start.getFullYear(), start.getMonth(), 1);
|
||||
start.setHours(0, 0, 0, 0);
|
||||
end = new Date(start.getFullYear(), start.getMonth() + 1, 0);
|
||||
end.setHours(23, 59, 59, 999);
|
||||
start = startOfDay(startOfMonth(today));
|
||||
end = endOfDay(endOfMonth(today));
|
||||
break;
|
||||
case '3M':
|
||||
// this quarter
|
||||
start = new Date;
|
||||
end = new Date;
|
||||
let quarter = Math.floor((start.getMonth() + 3) / 3) - 1;
|
||||
// start and end months? I'm sure this could be better:
|
||||
let startMonths = [0, 3, 6, 9];
|
||||
let endMonths = [2, 5, 8, 11];
|
||||
// set start to the correct month, day one:
|
||||
start = new Date(start.getFullYear(), startMonths[quarter], 1);
|
||||
start.setHours(0, 0, 0, 0);
|
||||
|
||||
// set end to the correct month, day one
|
||||
end = new Date(end.getFullYear(), endMonths[quarter], 1);
|
||||
// then to the last day of the month:
|
||||
end = new Date(end.getFullYear(), end.getMonth() + 1, 0);
|
||||
end.setHours(23, 59, 59, 999);
|
||||
start = startOfDay(startOfQuarter(today));
|
||||
end = endOfDay(endOfQuarter(today));
|
||||
break;
|
||||
case '6M':
|
||||
// this half-year
|
||||
start = new Date;
|
||||
end = new Date;
|
||||
let half = start.getMonth() <= 5 ? 0 : 1;
|
||||
|
||||
let startHalf = [0, 6];
|
||||
let endHalf = [5, 11];
|
||||
// set start to the correct month, day one:
|
||||
start = new Date(start.getFullYear(), startHalf[half], 1);
|
||||
start.setHours(0, 0, 0, 0);
|
||||
|
||||
// set end to the correct month, day one
|
||||
end = new Date(end.getFullYear(), endHalf[half], 1);
|
||||
// then to the last day of the month:
|
||||
end = new Date(end.getFullYear(), end.getMonth() + 1, 0);
|
||||
end.setHours(23, 59, 59, 999);
|
||||
if (today.getMonth() <= 5) {
|
||||
start = new Date(today);
|
||||
start.setMonth(0);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
end = new Date(today);
|
||||
end.setMonth(5);
|
||||
end.setDate(30);
|
||||
end = endOfDay(start);
|
||||
}
|
||||
if (today.getMonth() > 5) {
|
||||
start = new Date(today);
|
||||
start.setMonth(6);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
end = new Date(today);
|
||||
end.setMonth(11);
|
||||
end.setDate(31);
|
||||
end = endOfDay(start);
|
||||
}
|
||||
break;
|
||||
case '1Y':
|
||||
// this year
|
||||
start = new Date;
|
||||
end = new Date;
|
||||
start = new Date(start.getFullYear(), 0, 1);
|
||||
start = new Date(today);
|
||||
start.setMonth(0);
|
||||
start.setDate(1);
|
||||
start = startOfDay(start);
|
||||
|
||||
end = new Date(end.getFullYear(), 11, 31);
|
||||
start.setHours(0, 0, 0, 0);
|
||||
end.setHours(23, 59, 59, 999);
|
||||
end = new Date(today);
|
||||
end.setMonth(11);
|
||||
end.setDate(31);
|
||||
end = endOfDay(end);
|
||||
break;
|
||||
}
|
||||
// console.log('Range is ' + viewRange);
|
||||
@@ -206,6 +209,7 @@ const mutations = {
|
||||
},
|
||||
setViewRange(state, range) {
|
||||
state.viewRange = range;
|
||||
window.localStorage.setItem('viewRange', range);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ const getters = {
|
||||
transactions: state => {
|
||||
return state.transactions;
|
||||
},
|
||||
defaultErrors: state => {
|
||||
return state.defaultErrors;
|
||||
},
|
||||
groupTitle: state => {
|
||||
return state.groupTitle;
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<div>
|
||||
<alert :message="errorMessage" type="danger"/>
|
||||
<alert :message="successMessage" type="success"/>
|
||||
<form @submit="submitTransaction">
|
||||
<form @submit="submitTransaction" autocomplete="off">
|
||||
<SplitPills :transactions="transactions"/>
|
||||
<div class="tab-content">
|
||||
<!-- v-on:switch-accounts="switchAccounts($event)" -->
|
||||
@@ -40,6 +40,7 @@
|
||||
:transaction="transaction"
|
||||
:transaction-type="transactionType"
|
||||
v-on:uploaded-attachments="uploadedAttachment($event)"
|
||||
v-on:selected-attachments="selectedAttachment($event)"
|
||||
v-on:set-marker-location="storeLocation($event)"
|
||||
v-on:set-account="storeAccountValue($event)"
|
||||
v-on:set-date="storeDate($event)"
|
||||
@@ -118,6 +119,7 @@ import SplitPills from "./SplitPills";
|
||||
import TransactionGroupTitle from "./TransactionGroupTitle";
|
||||
import SplitForm from "./SplitForm";
|
||||
import {mapGetters, mapMutations} from "vuex";
|
||||
import {getDefaultErrors} from "../../shared/transactions";
|
||||
|
||||
|
||||
export default {
|
||||
@@ -138,8 +140,9 @@ export default {
|
||||
let type = parts[parts.length - 1];
|
||||
|
||||
// set a basic date-time string:
|
||||
let date = new Date;
|
||||
this.date = [date.getFullYear(), ('0' + (date.getMonth() + 1)).slice(-2), ('0' + date.getDate()).slice(-2)].join('-') + 'T00:00';
|
||||
|
||||
this.date = (new Date).toISOString().split('T')[0] + 'T00:00';
|
||||
//console.log('Date is set to "' + this.date + '"');
|
||||
|
||||
this.setTransactionType(type[0].toUpperCase() + type.substring(1));
|
||||
@@ -165,7 +168,7 @@ export default {
|
||||
// things the process is done working on (3 phases):
|
||||
submittedTransaction: false,
|
||||
submittedLinks: false,
|
||||
submittedAttachments: false,
|
||||
submittedAttachments: -1, // -1 (no attachments), 0 = uploading, 1 = uploaded
|
||||
|
||||
// transaction was actually submitted?
|
||||
inError: false,
|
||||
@@ -196,18 +199,12 @@ export default {
|
||||
/**
|
||||
* Grabbed from the store.
|
||||
*/
|
||||
...mapGetters('transactions/create', ['transactionType', 'transactions', 'groupTitle']),
|
||||
...mapGetters('transactions/create', ['transactionType', 'transactions', 'groupTitle','defaultErrors']),
|
||||
...mapGetters('root', ['listPageSize'])
|
||||
},
|
||||
watch: {
|
||||
submittedTransaction: function () {
|
||||
this.finalizeSubmit();
|
||||
},
|
||||
submittedLinks: function () {
|
||||
this.finalizeSubmit();
|
||||
},
|
||||
submittedAttachments: function () {
|
||||
this.finalizeSubmit();
|
||||
this.finaliseSubmission();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -237,58 +234,152 @@ export default {
|
||||
// console.log('Triggered to remove transaction ' + payload.index);
|
||||
this.$store.commit('transactions/create/deleteTransaction', payload);
|
||||
},
|
||||
/**
|
||||
* Submitting a transaction consists of 3 steps: submitting the transaction, uploading attachments
|
||||
* and creating links. Only once all three steps are executed may the message be shown or the user be
|
||||
* forwarded.
|
||||
*/
|
||||
finalizeSubmit() {
|
||||
// console.log('finalizeSubmit (' + this.submittedTransaction + ', ' + this.submittedAttachments + ', ' + this.submittedLinks + ')');
|
||||
if (this.submittedTransaction && this.submittedAttachments && this.submittedLinks) {
|
||||
// console.log('all true');
|
||||
// console.log('createAnother = ' + this.createAnother);
|
||||
// console.log('inError = ' + this.inError);
|
||||
if (false === this.createAnother && false === this.inError) {
|
||||
// console.log('redirect');
|
||||
window.location.href = (window.previousURL ?? '/') + '?transaction_group_id=' + this.returnedGroupId + '&message=created';
|
||||
return;
|
||||
submitData: function (url, data) {
|
||||
return axios.post(url, data);
|
||||
},
|
||||
handleSubmissionResponse: function (response) {
|
||||
//console.log('In handleSubmissionResponse()');
|
||||
// save some meta data:
|
||||
this.returnedGroupId = parseInt(response.data.data.id);
|
||||
this.returnedGroupTitle = null === response.data.data.attributes.group_title ? response.data.data.attributes.transactions[0].description : response.data.data.attributes.group_title;
|
||||
let journals = [];
|
||||
|
||||
// save separate journal ID's (useful ahead in the process):
|
||||
let result = response.data.data.attributes.transactions
|
||||
for (let i in result) {
|
||||
if (result.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
journals.push(parseInt(result[i].transaction_journal_id));
|
||||
}
|
||||
}
|
||||
|
||||
if (false === this.inError) {
|
||||
// show message:
|
||||
this.errorMessage = '';
|
||||
this.successMessage = this.$t('firefly.transaction_stored_link', {ID: this.returnedGroupId, title: this.returnedGroupTitle});
|
||||
}
|
||||
|
||||
// enable flags:
|
||||
this.enableSubmit = true;
|
||||
this.submittedTransaction = false;
|
||||
this.submittedLinks = false;
|
||||
this.submittedAttachments = false;
|
||||
this.inError = false;
|
||||
|
||||
|
||||
// reset attachments (always do this)
|
||||
for (let i in this.transactions) {
|
||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
if (this.transactions.hasOwnProperty(i)) {
|
||||
// console.log('Reset attachment #' + i);
|
||||
this.updateField({index: i, field: 'transaction_journal_id', value: 0});
|
||||
return new Promise((resolve) => {
|
||||
resolve(
|
||||
{
|
||||
journals: journals,
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
submitLinks: function (response, submission) {
|
||||
let promises = [];
|
||||
// for
|
||||
for (let i in response.journals) {
|
||||
if (response.journals.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
let journalId = response.journals[i];
|
||||
let links = submission.transactions[i].links;
|
||||
for (let ii in links) {
|
||||
if (links.hasOwnProperty(ii) && /^0$|^[1-9]\d*$/.test(ii) && ii <= 4294967294) {
|
||||
let currentLink = links[ii];
|
||||
if (0 === currentLink.outward_id) {
|
||||
currentLink.outward_id = journalId;
|
||||
}
|
||||
if (0 === currentLink.inward_id) {
|
||||
currentLink.inward_id = journalId;
|
||||
}
|
||||
promises.push(axios.post('./api/v1/transaction_links', currentLink));
|
||||
}
|
||||
}
|
||||
}
|
||||
this.submittedAttCount = [];
|
||||
|
||||
// reset the form:
|
||||
if (this.resetFormAfter) {
|
||||
this.resetTransactions();
|
||||
// do a short time out?
|
||||
setTimeout(() => this.addTransaction(), 50);
|
||||
}
|
||||
// console.log('Done with finalizeSubmit!');
|
||||
// return;
|
||||
}
|
||||
// console.log('Did nothing in finalizeSubmit');
|
||||
if (0 === promises.length) {
|
||||
return new Promise((resolve) => {
|
||||
resolve(
|
||||
{
|
||||
response: 'from submitLinks'
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
return Promise.all(promises);
|
||||
},
|
||||
submitAttachments: function (response, submission) {
|
||||
let anyAttachments = false;
|
||||
for (let i in response.journals) {
|
||||
if (response.journals.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
let journalId = response.journals[i];
|
||||
let hasAttachments = submission.transactions[i].attachments;
|
||||
// console.log('Decided that ' + journalId);
|
||||
// console.log(hasAttachments);
|
||||
if (hasAttachments) {
|
||||
// console.log('upload!');
|
||||
this.updateField({index: i, field: 'transaction_journal_id', value: journalId});
|
||||
anyAttachments = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (true === anyAttachments) {
|
||||
this.submittedAttachments = 0;
|
||||
}
|
||||
|
||||
return new Promise((resolve) => {
|
||||
resolve(
|
||||
{
|
||||
response: 'from submitAttachments'
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
selectedAttachment: function (payload) {
|
||||
this.updateField({index: payload.index, field: 'attachments', value: true});
|
||||
},
|
||||
finaliseSubmission: function () {
|
||||
if (0 === this.submittedAttachments) {
|
||||
// console.log('submittedAttachments = ' + this.submittedAttachments);
|
||||
return;
|
||||
}
|
||||
//console.log('In finaliseSubmission');
|
||||
if (false === this.createAnother) {
|
||||
window.location.href = (window.previousURL ?? '/') + '?transaction_group_id=' + this.returnedGroupId + '&message=created';
|
||||
return;
|
||||
}
|
||||
//console.log('Is in error?');
|
||||
//console.log(this.inError);
|
||||
if (false === this.inError) {
|
||||
// show message:
|
||||
this.errorMessage = '';
|
||||
this.successMessage = this.$t('firefly.transaction_stored_link', {ID: this.returnedGroupId, title: this.returnedGroupTitle});
|
||||
}
|
||||
|
||||
// enable flags:
|
||||
this.enableSubmit = true;
|
||||
this.submittedTransaction = false;
|
||||
this.submittedAttachments = -1;
|
||||
|
||||
// reset attachments + errors
|
||||
if (!this.resetFormAfter) {
|
||||
for (let i in this.transactions) {
|
||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
if (this.transactions.hasOwnProperty(i)) {
|
||||
//this.
|
||||
// console.log('Reset attachment #' + i);
|
||||
this.updateField({index: i, field: 'transaction_journal_id', value: 0});
|
||||
this.updateField({index: i, field: 'errors', value: this.defaultErrors})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// reset the form:
|
||||
if (this.resetFormAfter) {
|
||||
this.resetTransactions();
|
||||
this.addTransaction();
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
resolve(
|
||||
{
|
||||
response: 'from finaliseSubmission'
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
handleSubmissionError: function (error) {
|
||||
//console.log('in handleSubmissionError');
|
||||
// oh noes Firefly III has something to bitch about.
|
||||
this.enableSubmit = true;
|
||||
|
||||
// but report an error because error:
|
||||
this.inError = true;
|
||||
this.parseErrors(error.response.data);
|
||||
},
|
||||
/**
|
||||
* Actually submit the transaction to Firefly III. This is a fairly complex beast of a thing because multiple things
|
||||
@@ -300,64 +391,26 @@ export default {
|
||||
// disable the submit button:
|
||||
this.enableSubmit = false;
|
||||
|
||||
// assume nothing breaks
|
||||
this.inError = false;
|
||||
|
||||
// remove old warnings etc.
|
||||
this.successMessage = '';
|
||||
this.errorMessage = '';
|
||||
|
||||
// convert the data so its ready to be submitted:
|
||||
const url = './api/v1/transactions';
|
||||
const data = this.convertData();
|
||||
|
||||
// console.log('Will submit:');
|
||||
// console.log(data);
|
||||
|
||||
// POST the transaction.
|
||||
axios.post(url, data)
|
||||
this.submitData(url, data)
|
||||
.then(this.handleSubmissionResponse)
|
||||
.then(response => {
|
||||
// console.log('Response is OK!');
|
||||
// report the transaction is submitted.
|
||||
this.submittedTransaction = true;
|
||||
return Promise.all([this.submitLinks(response, data), this.submitAttachments(response, data)]);
|
||||
}
|
||||
)
|
||||
.then(this.finaliseSubmission)
|
||||
.catch(this.handleSubmissionError);
|
||||
|
||||
// submit links and attachments (can only be done when the transaction is created)
|
||||
this.submitTransactionLinks(data, response);
|
||||
this.submitAttachments(data, response);
|
||||
|
||||
// meanwhile, store the ID and the title in some easy to access variables.
|
||||
this.returnedGroupId = parseInt(response.data.data.id);
|
||||
this.returnedGroupTitle = null === response.data.data.attributes.group_title ? response.data.data.attributes.transactions[0].description : response.data.data.attributes.group_title;
|
||||
// console.log('Group title is now "' + this.groupTitle + '"');
|
||||
})
|
||||
.catch(error => {
|
||||
// oh noes Firefly III has something to bitch about.
|
||||
this.enableSubmit = true;
|
||||
// console.log('enable submit = true');
|
||||
// report the transaction is submitted.
|
||||
this.submittedTransaction = true;
|
||||
// also report attachments and links are submitted:
|
||||
this.submittedAttachments = true;
|
||||
this.submittedLinks = true;
|
||||
|
||||
// but report an error because error:
|
||||
this.inError = true;
|
||||
this.parseErrors(error.response.data);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Submitting transactions means we will give each TransactionAttachment component
|
||||
* the ID of the transaction journal (so it works for multiple splits). Each component
|
||||
* will then start uploading their transactions (so its a separated concern) and report
|
||||
* back to the "uploadedAttachment" function below via an event emitter.
|
||||
*
|
||||
* The ID is set via the store.
|
||||
*/
|
||||
submitAttachments: function (data, response) {
|
||||
// console.log('submitAttachments()');
|
||||
let result = response.data.data.attributes.transactions
|
||||
for (let i in data.transactions) {
|
||||
if (data.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
if (result.hasOwnProperty(i)) {
|
||||
// console.log('updateField(' + i + ', transaction_journal_id, ' + result[i].transaction_journal_id + ')');
|
||||
this.updateField({index: i, field: 'transaction_journal_id', value: result[i].transaction_journal_id});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* When a attachment component is done uploading it ends up here. We create an object where we count how many
|
||||
@@ -367,6 +420,7 @@ export default {
|
||||
* Once the number of components matches the number of splits we know all attachments have been uploaded.
|
||||
*/
|
||||
uploadedAttachment: function (journalId) {
|
||||
this.submittedAttachments = 0;
|
||||
// console.log('Triggered uploadedAttachment(' + journalId + ')');
|
||||
let key = 'str' + journalId;
|
||||
this.submittedAttCount[key] = 1;
|
||||
@@ -374,9 +428,9 @@ export default {
|
||||
// console.log('Count is now ' + count);
|
||||
// console.log('Length is ' + this.transactions.length);
|
||||
if (count === this.transactions.length) {
|
||||
// mark the attachments as stored:
|
||||
this.submittedAttachments = true;
|
||||
// console.log('Got them all!');
|
||||
// mark the attachments as stored:
|
||||
this.submittedAttachments = 1;
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -457,11 +511,13 @@ export default {
|
||||
this.submittedLinks = true;
|
||||
});
|
||||
},
|
||||
|
||||
parseErrors: function (errors) {
|
||||
for (let i in this.transactions) {
|
||||
this.resetErrors({index: i});
|
||||
if (this.transactions.hasOwnProperty(i)) {
|
||||
this.resetErrors({index: i});
|
||||
}
|
||||
}
|
||||
|
||||
this.successMessage = '';
|
||||
this.errorMessage = this.$t('firefly.errors_submission');
|
||||
if (typeof errors.errors === 'undefined') {
|
||||
@@ -470,12 +526,6 @@ export default {
|
||||
}
|
||||
|
||||
let payload;
|
||||
//payload = {index: 0, field: 'description', errors: ['Test error index 0']};
|
||||
//this.setTransactionError(payload);
|
||||
|
||||
//payload = {index: 1, field: 'description', errors: ['Test error index 1']};
|
||||
//this.setTransactionError(payload);
|
||||
|
||||
let transactionIndex;
|
||||
let fieldName;
|
||||
|
||||
@@ -558,6 +608,7 @@ export default {
|
||||
//console.log('Group title is: "' + this.groupTitle + '"');
|
||||
if (this.groupTitle.length > 0) {
|
||||
data.group_title = this.groupTitle;
|
||||
//console.log('1) data.group_title is now "'+data.group_title+'"');
|
||||
}
|
||||
|
||||
for (let i in this.transactions) {
|
||||
@@ -565,8 +616,9 @@ export default {
|
||||
data.transactions.push(this.convertSplit(i, this.transactions[i]));
|
||||
}
|
||||
}
|
||||
if (data.transactions.length > 1 && '' !== data.transactions[0].description) {
|
||||
if (data.transactions.length > 1 && '' !== data.transactions[0].description && (null === data.group_title || '' === data.group_title)) {
|
||||
data.group_title = data.transactions[0].description;
|
||||
//console.log('2) data.group_title is now "'+data.group_title+'"');
|
||||
}
|
||||
|
||||
// depending on the transaction type for this thing, we need to
|
||||
@@ -616,27 +668,6 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
// switchAccounts: function (index) {
|
||||
// // console.log('user wants to switch Accounts');
|
||||
// let origSourceId = this.transactions[index].source_account_id;
|
||||
// let origSourceName = this.transactions[index].source_account_name;
|
||||
// let origSourceType = this.transactions[index].source_account_type;
|
||||
//
|
||||
// let origDestId = this.transactions[index].destination_account_id;
|
||||
// let origDestName = this.transactions[index].destination_account_name;
|
||||
// let origDestType = this.transactions[index].destination_account_type;
|
||||
//
|
||||
// this.updateField({index: 0, field: 'source_account_id', value: origDestId});
|
||||
// this.updateField({index: 0, field: 'source_account_name', value: origDestName});
|
||||
// this.updateField({index: 0, field: 'source_account_type', value: origDestType});
|
||||
//
|
||||
// this.updateField({index: 0, field: 'destination_account_id', value: origSourceId});
|
||||
// this.updateField({index: 0, field: 'destination_account_name', value: origSourceName});
|
||||
// this.updateField({index: 0, field: 'destination_account_type', value: origSourceType});
|
||||
// this.calculateTransactionType(0);
|
||||
// },
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param key
|
||||
@@ -700,6 +731,7 @@ export default {
|
||||
// from thing:
|
||||
order: 0,
|
||||
reconciled: false,
|
||||
attachments: array.attachments,
|
||||
};
|
||||
|
||||
if (0 !== array.tags.length) {
|
||||
@@ -804,8 +836,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;
|
||||
});
|
||||
},
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
<Alert :message="errorMessage" type="danger"/>
|
||||
<Alert :message="successMessage" type="success"/>
|
||||
<Alert :message="warningMessage" type="warning"/>
|
||||
<form @submit="submitTransaction">
|
||||
|
||||
<form @submit="submitTransaction" autocomplete="off">
|
||||
<SplitPills :transactions="transactions"/>
|
||||
|
||||
<div class="tab-content">
|
||||
@@ -40,7 +41,6 @@
|
||||
:destination-allowed-types="destinationAllowedTypes"
|
||||
:source-allowed-types="sourceAllowedTypes"
|
||||
:allow-switch="false"
|
||||
:submitted-transaction="submittedTransaction"
|
||||
v-on:uploaded-attachments="uploadedAttachment($event)"
|
||||
v-on:set-marker-location="storeLocation($event)"
|
||||
v-on:set-account="storeAccountValue($event)"
|
||||
@@ -74,7 +74,8 @@
|
||||
<div class="text-xs d-none d-lg-block d-xl-block">
|
||||
|
||||
</div>
|
||||
<button type="button" class="btn btn-outline-primary btn-block" @click="addTransaction"><i class="far fa-clone"></i> {{ $t('firefly.add_another_split') }}
|
||||
<button type="button" class="btn btn-outline-primary btn-block" @click="addTransaction"><i class="far fa-clone"></i>
|
||||
{{ $t('firefly.add_another_split') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
@@ -109,12 +110,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const lodashClonedeep = require('lodash.clonedeep');
|
||||
import {mapMutations} from "vuex";
|
||||
import Alert from '../partials/Alert';
|
||||
import SplitPills from "./SplitPills";
|
||||
import SplitForm from "./SplitForm";
|
||||
import TransactionGroupTitle from "./TransactionGroupTitle";
|
||||
import {getDefaultErrors, getDefaultTransaction, toW3CString} from '../../shared/transactions';
|
||||
import {getDefaultErrors, getDefaultTransaction} from '../../shared/transactions';
|
||||
|
||||
const lodashClonedeep = require('lodash.clonedeep');
|
||||
|
||||
export default {
|
||||
name: "Edit",
|
||||
@@ -156,10 +159,15 @@ export default {
|
||||
|
||||
// things the process is done working on (3 phases):
|
||||
submittedTransaction: false,
|
||||
submittedLinks: false,
|
||||
submittedAttachments: false,
|
||||
// submittedLinks: false,
|
||||
submittedAttachments: -1, // -1 = no attachments, 0 = uploading, 1 = uploaded
|
||||
inError: false,
|
||||
|
||||
// number of uploaded attachments
|
||||
// its an object because we count per transaction journal (which can have multiple attachments)
|
||||
// and array doesn't work right.
|
||||
submittedAttCount: {},
|
||||
|
||||
// meta data for accounts
|
||||
allowedOpposingTypes: {},
|
||||
destinationAllowedTypes: [],
|
||||
@@ -179,21 +187,13 @@ export default {
|
||||
},
|
||||
|
||||
watch: {
|
||||
submittedTransaction: function () {
|
||||
// see finalizeSubmit()
|
||||
this.finalizeSubmit();
|
||||
},
|
||||
submittedLinks: function () {
|
||||
// see finalizeSubmit()
|
||||
this.finalizeSubmit();
|
||||
},
|
||||
submittedAttachments: function () {
|
||||
// see finalizeSubmit()
|
||||
this.finalizeSubmit();
|
||||
this.finaliseSubmission();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations('transactions/create', ['updateField',]),
|
||||
/**
|
||||
* Grap transaction group from URL and submit GET.
|
||||
*/
|
||||
@@ -203,8 +203,8 @@ export default {
|
||||
this.parseTransactionGroup(response.data);
|
||||
}
|
||||
).catch(error => {
|
||||
// console.log('I failed :(');
|
||||
// console.log(error);
|
||||
console.log('I failed :(');
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
/**
|
||||
@@ -219,6 +219,10 @@ export default {
|
||||
this.groupTitle = attributes.group_title;
|
||||
this.originalGroupTitle = attributes.group_title;
|
||||
|
||||
//this.returnedGroupId = parseInt(response.data.id);
|
||||
this.returnedGroupTitle = null === this.originalGroupTitle ? response.data.attributes.transactions[0].description : this.originalGroupTitle;
|
||||
|
||||
|
||||
for (let i in transactions) {
|
||||
if (transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
let result = this.parseTransaction(parseInt(i), transactions[i]);
|
||||
@@ -239,6 +243,8 @@ export default {
|
||||
//console.log('index: ' + index);
|
||||
if (0 === index) {
|
||||
this.transactionType = array.type.charAt(0).toUpperCase() + array.type.slice(1);
|
||||
|
||||
// TODO here you may need to catch stuff like loan/debt/mortgage
|
||||
this.sourceAllowedTypes = [array.source_type];
|
||||
this.destinationAllowedTypes = [array.destination_type];
|
||||
this.date = array.date.substring(0, 16);
|
||||
@@ -292,7 +298,6 @@ export default {
|
||||
result.zoom_level = array.zoom_level;
|
||||
result.longitude = array.longitude;
|
||||
result.latitude = array.latitude;
|
||||
|
||||
// error handling
|
||||
result.errors = getDefaultErrors();
|
||||
return result;
|
||||
@@ -370,14 +375,12 @@ export default {
|
||||
});
|
||||
},
|
||||
/**
|
||||
* TODO same method as Create
|
||||
* Get API value.
|
||||
*/
|
||||
getAllowedOpposingTypes: function () {
|
||||
axios.get('./api/v1/configuration/firefly.allowed_opposing_types')
|
||||
.then(response => {
|
||||
this.allowedOpposingTypes = response.data.data.value;
|
||||
// console.log('Set allowedOpposingTypes');
|
||||
});
|
||||
},
|
||||
/**
|
||||
@@ -389,8 +392,20 @@ export default {
|
||||
});
|
||||
},
|
||||
uploadedAttachment: function (payload) {
|
||||
console.log('event: uploadedAttachment');
|
||||
console.log(payload);
|
||||
//console.log('event: uploadedAttachment');
|
||||
//console.log(payload);
|
||||
this.submittedAttachments = 0;
|
||||
// console.log('Triggered uploadedAttachment(' + journalId + ')');
|
||||
let key = 'str' + payload;
|
||||
this.submittedAttCount[key] = 1;
|
||||
let count = Object.keys(this.submittedAttCount).length;
|
||||
//console.log('Count is now ' + count);
|
||||
//console.log('Length is ' + this.transactions.length);
|
||||
if (count === this.transactions.length) {
|
||||
//console.log('Got them all!');
|
||||
// mark the attachments as stored:
|
||||
this.submittedAttachments = 1;
|
||||
}
|
||||
},
|
||||
storeLocation: function (payload) {
|
||||
this.transactions[payload.index].zoom_level = payload.zoomLevel;
|
||||
@@ -405,26 +420,25 @@ export default {
|
||||
this.transactions[index][direction + '_account_name'] = payload.name;
|
||||
},
|
||||
storeDate: function (payload) {
|
||||
// console.log('event: storeDate');
|
||||
// console.log(payload);
|
||||
this.date = payload.date;
|
||||
},
|
||||
storeTime: function (payload) {
|
||||
this.time = payload.time;
|
||||
// console.log('event: storeTime');
|
||||
// console.log(payload);
|
||||
},
|
||||
storeField: function (payload) {
|
||||
let field = payload.field;
|
||||
if ('category' === field) {
|
||||
field = 'category_name';
|
||||
}
|
||||
// console.log('event: storeField(' + field + ')');
|
||||
this.transactions[payload.index][field] = payload.value;
|
||||
|
||||
},
|
||||
removeTransaction: function (payload) {
|
||||
//console.log('removeTransaction()');
|
||||
//console.log(payload);
|
||||
//console.log('length: ' + this.transactions.length);
|
||||
this.transactions.splice(payload.index, 1);
|
||||
//console.log('length: ' + this.transactions.length);
|
||||
|
||||
|
||||
//this.originalTransactions.splice(payload.index, 1);
|
||||
// this kills the original transactions.
|
||||
this.originalTransactions = [];
|
||||
},
|
||||
@@ -432,9 +446,12 @@ export default {
|
||||
this.groupTitle = payload;
|
||||
},
|
||||
selectedAttachments: function (payload) {
|
||||
//console.log('Now in selectedAttachments()');
|
||||
for (let i in this.transactions) {
|
||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
if (parseInt(this.transactions[i].transaction_journal_id) === parseInt(payload)) {
|
||||
// console.log('Payload is');
|
||||
// console.log(payload);
|
||||
if (parseInt(this.transactions[i].transaction_journal_id) === parseInt(payload.id)) {
|
||||
// console.log('selectedAttachments ' + payload);
|
||||
this.transactions[i].selectedAttachments = true;
|
||||
}
|
||||
@@ -450,56 +467,55 @@ export default {
|
||||
submitTransaction: function (event) {
|
||||
event.preventDefault();
|
||||
let submission = {transactions: []};
|
||||
|
||||
// parse data to see if we should submit anything at all:
|
||||
let shouldSubmit = false;
|
||||
let shouldLinks = false;
|
||||
let shouldUpload = false;
|
||||
|
||||
// if the group title has changed, should submit:
|
||||
if (this.groupTitle !== this.originalGroupTitle) {
|
||||
submission.group_title = this.groupTitle;
|
||||
shouldSubmit = true;
|
||||
}
|
||||
let transactionCount = this.originalTransactions.length;
|
||||
let newTransactionCount = this.transactions.length;
|
||||
console.log('Found ' + this.transactions.length + ' split(s).');
|
||||
|
||||
// if something with the group title:
|
||||
let newTransactionCount = this.transactions.length;
|
||||
if (newTransactionCount > 1 && typeof submission.group_title === 'undefined' && (null === this.originalGroupTitle || '' === this.originalGroupTitle)) {
|
||||
submission.group_title = this.transactions[0].description;
|
||||
shouldSubmit = true;
|
||||
}
|
||||
|
||||
// loop each transaction (edited by the user):
|
||||
for (let i in this.transactions) {
|
||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
// original transaction present?
|
||||
|
||||
// original transaction present:
|
||||
let currentTransaction = this.transactions[i];
|
||||
let originalTransaction = this.originalTransactions.hasOwnProperty(i) ? this.originalTransactions[i] : {};
|
||||
|
||||
// the difference:
|
||||
let diff = {};
|
||||
|
||||
// compare basic fields:
|
||||
let basicFields = [
|
||||
'description',
|
||||
'source_account_id', 'source_account_name',
|
||||
'destination_account_id', 'destination_account_name',
|
||||
'amount', 'foreign_amount', 'foreign_currency_id',
|
||||
'category_name', 'budget_id', 'bill_id',
|
||||
'interest_date', 'book_date', 'due_date', 'payment_date', 'invoice_date',
|
||||
'external_url', 'internal_reference', 'external_id', 'notes',
|
||||
'zoom_level', 'longitude', 'latitude'
|
||||
];
|
||||
let basicFields = ['description', 'source_account_id', 'source_account_name', 'destination_account_id', 'destination_account_name', 'amount', 'foreign_amount', 'foreign_currency_id', 'category_name', 'budget_id', 'bill_id', 'interest_date', 'book_date', 'due_date', 'payment_date', 'invoice_date', 'external_url', 'internal_reference', 'external_id', 'notes', 'zoom_level', 'longitude', 'latitude'];
|
||||
|
||||
// source and destination may be overruled:
|
||||
// source and destination are overruled in some cases:
|
||||
if (i > 0) {
|
||||
diff.type = this.transactionType.toLowerCase();
|
||||
if ('Deposit' === this.transactionType || 'Transfer' === this.transactionType) {
|
||||
if ('deposit' === this.transactionType.toLowerCase() || 'transfer' === this.transactionType.toLowerCase()) {
|
||||
// set destination to be whatever is in transaction zero:
|
||||
currentTransaction.destination_account_name = this.originalTransactions[0].destination_account_name;
|
||||
currentTransaction.destination_account_id = this.originalTransactions[0].destination_account_id;
|
||||
}
|
||||
if ('Withdrawal' === this.transactionType || 'Transfer' === this.transactionType) {
|
||||
|
||||
if ('withdrawal' === this.transactionType.toLowerCase() || 'transfer' === this.transactionType.toLowerCase()) {
|
||||
// set source to be whatever is in transaction zero:
|
||||
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);
|
||||
}
|
||||
|
||||
// loop the basic fields and verify
|
||||
for (let ii in basicFields) {
|
||||
if (basicFields.hasOwnProperty(ii) && /^0$|^[1-9]\d*$/.test(ii) && ii <= 4294967294) {
|
||||
let fieldName = basicFields[ii];
|
||||
@@ -519,13 +535,7 @@ export default {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// console.log('Index ' + i + ': Field ' + fieldName + ' updated ("' + originalTransaction[fieldName] + '" > "' + currentTransaction[fieldName] + '")');
|
||||
// console.log(originalTransaction[fieldName]);
|
||||
// console.log(currentTransaction[fieldName]);
|
||||
|
||||
// some field names may need to be different. little basic but it works:
|
||||
// console.log('pre: ' + submissionFieldName);
|
||||
if ('source_account_id' === submissionFieldName) {
|
||||
submissionFieldName = 'source_id';
|
||||
}
|
||||
@@ -539,26 +549,19 @@ export default {
|
||||
submissionFieldName = 'destination_name';
|
||||
}
|
||||
|
||||
|
||||
// otherwise save them and remember them for submission:
|
||||
diff[submissionFieldName] = currentTransaction[fieldName];
|
||||
shouldSubmit = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (0 !== currentTransaction.piggy_bank_id) {
|
||||
diff.piggy_bank_id = currentTransaction.piggy_bank_id;
|
||||
shouldSubmit = true;
|
||||
}
|
||||
if (JSON.stringify(currentTransaction.tags) !== JSON.stringify(originalTransaction.tags)) {
|
||||
// console.log('tags are different');
|
||||
// console.log(currentTransaction.tags);
|
||||
// console.log(originalTransaction.tags);
|
||||
diff.tags = [];//currentTransaction.tags;
|
||||
|
||||
// tags different?
|
||||
if (JSON.stringify(currentTransaction.tags) !== JSON.stringify(originalTransaction.tags)) {
|
||||
diff.tags = [];
|
||||
if (0 !== currentTransaction.tags.length) {
|
||||
for (let ii in currentTransaction.tags) {
|
||||
if (currentTransaction.tags.hasOwnProperty(ii) && /^0$|^[1-9]\d*$/.test(ii) && ii <= 4294967294) {
|
||||
// array.tags
|
||||
let currentTag = currentTransaction.tags[ii];
|
||||
if (typeof currentTag === 'object' && null !== currentTag) {
|
||||
diff.tags.push(currentTag.text);
|
||||
@@ -569,79 +572,258 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
shouldSubmit = true;
|
||||
}
|
||||
|
||||
// compare links:
|
||||
let newLinks = this.compareLinks(currentTransaction.links);
|
||||
let originalLinks = this.compareLinks(originalTransaction.links);
|
||||
// console.log('links are?');
|
||||
// console.log(newLinks);
|
||||
// console.log(originalLinks);
|
||||
if (newLinks !== originalLinks) {
|
||||
// console.log('links are different!');
|
||||
// console.log(newLinks);
|
||||
// console.log(originalLinks);
|
||||
shouldLinks = true;
|
||||
}
|
||||
// this.transactions[i].selectedAttachments
|
||||
// console.log(typeof currentTransaction.selectedAttachments);
|
||||
// console.log(currentTransaction.selectedAttachments);
|
||||
if (typeof currentTransaction.selectedAttachments !== 'undefined' && true === currentTransaction.selectedAttachments) {
|
||||
// must upload!
|
||||
shouldUpload = true;
|
||||
}
|
||||
|
||||
if (
|
||||
this.date !== this.originalDate
|
||||
) {
|
||||
console.log('Date and/or time is changed');
|
||||
// set date and time!
|
||||
if (this.date !== this.originalDate) {
|
||||
shouldSubmit = true;
|
||||
diff.date = this.date;
|
||||
}
|
||||
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!');
|
||||
// Will submit just the ID!
|
||||
diff.transaction_journal_id = originalTransaction.transaction_journal_id;
|
||||
submission.transactions.push(lodashClonedeep(diff));
|
||||
shouldSubmit = true;
|
||||
} else if (Object.keys(diff).length !== 0) {
|
||||
// will submit all:
|
||||
diff.transaction_journal_id = originalTransaction.transaction_journal_id ?? 0;
|
||||
submission.transactions.push(lodashClonedeep(diff));
|
||||
shouldSubmit = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.submitUpdate(submission, shouldSubmit, shouldLinks, shouldUpload);
|
||||
},
|
||||
|
||||
console.log('submitTransaction');
|
||||
console.log('shouldUpload : ' + shouldUpload);
|
||||
console.log('shouldLinks : ' + shouldLinks);
|
||||
console.log('shouldSubmit : ' + shouldSubmit);
|
||||
if (shouldSubmit) {
|
||||
this.submitUpdate(submission, shouldLinks, shouldUpload);
|
||||
}
|
||||
submitData: function (shouldSubmit, submission) {
|
||||
//console.log('submitData');
|
||||
if (!shouldSubmit) {
|
||||
this.submittedTransaction = true;
|
||||
//console.log('No need!');
|
||||
return new Promise((resolve) => {
|
||||
resolve({});
|
||||
});
|
||||
}
|
||||
if (!shouldLinks) {
|
||||
this.submittedLinks = true;
|
||||
const url = './api/v1/transactions/' + this.groupId;
|
||||
return axios.put(url, submission);
|
||||
|
||||
},
|
||||
handleSubmissionResponse: function (response) {
|
||||
//console.log('handleSubmissionResponse()');
|
||||
// report the transaction is submitted.
|
||||
this.submittedTransaction = true;
|
||||
let journals = [];
|
||||
|
||||
// meanwhile, store the ID and the title in some easy to access variables.
|
||||
if (typeof response.data !== 'undefined') {
|
||||
this.returnedGroupId = parseInt(response.data.data.id) ?? null;
|
||||
this.returnedGroupTitle = null === response.data.data.attributes.group_title ? response.data.data.attributes.transactions[0].description : response.data.data.attributes.group_title;
|
||||
|
||||
let result = response.data.data.attributes.transactions
|
||||
for (let i in result) {
|
||||
if (result.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
journals.push(parseInt(result[i].transaction_journal_id));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i in this.transactions) {
|
||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
journals.push(this.transactions[i].transaction_journal_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!shouldUpload) {
|
||||
this.submittedAttachments = true;
|
||||
journals = journals.reverse();
|
||||
return new Promise((resolve) => {
|
||||
resolve(
|
||||
{
|
||||
journals: journals,
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
submitLinks: function (shouldSubmit) {
|
||||
//console.log('submitLinks()');
|
||||
if (!shouldSubmit) {
|
||||
//console.log('no need!');
|
||||
return new Promise((resolve) => {
|
||||
resolve({});
|
||||
});
|
||||
}
|
||||
if (!shouldSubmit && shouldLinks) {
|
||||
this.submitTransactionLinks();
|
||||
return this.deleteAllOriginalLinks().then(() => this.submitNewLinks());
|
||||
},
|
||||
submitAttachments: function (shouldSubmit, response) {
|
||||
//console.log('submitAttachments');
|
||||
if (!shouldSubmit) {
|
||||
//console.log('no need!');
|
||||
return new Promise((resolve) => {
|
||||
resolve({});
|
||||
});
|
||||
}
|
||||
//console.log('Do upload thing!');
|
||||
//console.log(response);
|
||||
let anyAttachments = false;
|
||||
for (let i in this.transactions) {
|
||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
let transaction = this.transactions[i];
|
||||
let journalId = transaction.transaction_journal_id;
|
||||
//console.log(journalId);
|
||||
if (typeof response !== 'undefined') {
|
||||
journalId = response.journals[i]
|
||||
}
|
||||
|
||||
let hasAttachments = transaction.selectedAttachments;
|
||||
this.transactions[i].transaction_journal_id = journalId;
|
||||
this.transactions[i].uploadTrigger = true;
|
||||
//console.log('Decided that ' + journalId);
|
||||
//console.log('upload index ' + i);
|
||||
//console.log(hasAttachments);
|
||||
if (hasAttachments) {
|
||||
anyAttachments = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (true === anyAttachments) {
|
||||
this.submittedAttachments = 0;
|
||||
}
|
||||
},
|
||||
finaliseSubmission: function () {
|
||||
//console.log('finaliseSubmission');
|
||||
if (0 === this.submittedAttachments) {
|
||||
return;
|
||||
}
|
||||
//console.log('continue (' + this.submittedAttachments + ')');
|
||||
if (true === this.stayHere && false === this.inError) {
|
||||
//console.log('no error + no changes + no redirect');
|
||||
// show message:
|
||||
this.errorMessage = '';
|
||||
this.warningMessage = '';
|
||||
this.successMessage = this.$t('firefly.transaction_updated_link', {ID: this.groupId, title: this.returnedGroupTitle});
|
||||
}
|
||||
// no error + changes + redirect
|
||||
if (false === this.stayHere && false === this.inError) {
|
||||
//console.log('no error + changes + redirect');
|
||||
window.location.href = (window.previousURL ?? '/') + '?transaction_group_id=' + this.groupId + '&message=updated';
|
||||
}
|
||||
|
||||
if (!shouldSubmit && shouldLinks) {
|
||||
// TODO
|
||||
//this.submittedAttachments();
|
||||
this.enableSubmit = true;
|
||||
this.submittedAttachments = -1;
|
||||
this.inError = false;
|
||||
|
||||
for (let i in this.transactions) {
|
||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
if (this.transactions.hasOwnProperty(i)) {
|
||||
this.transactions[i].clearTrigger = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log('Done with submit methd.');
|
||||
//console.log(submission);
|
||||
},
|
||||
submitUpdate: function (submission, shouldSubmit, shouldLinks, shouldUpload) {
|
||||
//console.log('submitUpdate()');
|
||||
this.inError = false;
|
||||
|
||||
this.submitData(shouldSubmit, submission)
|
||||
.then(this.handleSubmissionResponse) // error or OK
|
||||
.then(response => {
|
||||
return Promise.all([
|
||||
this.submitLinks(shouldLinks, response),
|
||||
this.submitAttachments(shouldUpload, response)]);
|
||||
}
|
||||
)
|
||||
.then(this.finaliseSubmission)
|
||||
.catch(this.handleSubmissionError);
|
||||
|
||||
|
||||
// if (shouldLinks) {
|
||||
// promises.push(this.submitTransactionLinks())
|
||||
// }
|
||||
// if (!shouldLinks) {
|
||||
// promises.push(new Promise((resolve) => {
|
||||
// resolve({});
|
||||
// }));
|
||||
// }
|
||||
// if (shouldUpload) {
|
||||
// console.log('Attachments = Respond to promise from shouldSubmit/!shouldSubmit');
|
||||
// promises.push(submissionPromise.then(result => this.uploadAttachments(result)));
|
||||
// }
|
||||
// if (!shouldUpload) {
|
||||
// promises.push(new Promise((resolve) => {
|
||||
// resolve({});
|
||||
// }));
|
||||
// }
|
||||
|
||||
// all promises fulfilled:
|
||||
// console.log('All promises done, process results?');
|
||||
// Promise.all(promises).then(function (responses) {
|
||||
// console.log('I believe all ' + promises.length + ' promises fulfilled!');
|
||||
// }).catch(function (errors) {
|
||||
// console.log('Somebody errored?');
|
||||
// });
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
// if (shouldSubmit) {
|
||||
// console.log('shouldSubmit');
|
||||
// // do submission:
|
||||
// // console.log(JSON.stringify(submission));
|
||||
// // console.log(submission);
|
||||
// axios.put(url, submission)
|
||||
// .then(response => {
|
||||
// // 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('Submit links using return from server:');
|
||||
// this.submitTransactionLinks();
|
||||
// }
|
||||
// if (shouldUpload) {
|
||||
// // console.log('Need to upload.');
|
||||
// this.submitAttachments(response.data.data.attributes.transactions);
|
||||
// }
|
||||
// // meanwhile, store the ID and the title in some easy to access variables.
|
||||
// this.returnedGroupId = parseInt(response.data.data.id);
|
||||
// this.returnedGroupTitle = null === response.data.data.attributes.group_title ? response.data.data.attributes.transactions[0].description : response.data.data.attributes.group_title;
|
||||
// }
|
||||
// )
|
||||
// .catch(error => {
|
||||
// console.log('error :(');
|
||||
// console.log(error.response.data);
|
||||
// // oh noes Firefly III has something to bitch about.
|
||||
// this.enableSubmit = true;
|
||||
// // report the transaction is submitted.
|
||||
// this.submittedTransaction = true;
|
||||
// // // also report attachments and links are submitted:
|
||||
// this.submittedAttachments = true;
|
||||
// this.submittedLinks = true;
|
||||
// //
|
||||
// // but report an error because error:
|
||||
// this.inError = true;
|
||||
// this.parseErrors(error.response.data);
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// if (!shouldSubmit && shouldLinks) {
|
||||
// // update links
|
||||
// console.log('Submit links using whatever is here:');
|
||||
// this.submitTransactionLinks();
|
||||
// }
|
||||
// if (!shouldSubmit && shouldUpload) {
|
||||
// // upload
|
||||
// // console.log('Need to upload.');
|
||||
// this.submitAttachments(this.transactions);
|
||||
// }
|
||||
},
|
||||
compareLinks: function (array) {
|
||||
let compare = [];
|
||||
@@ -659,55 +841,26 @@ export default {
|
||||
);
|
||||
}
|
||||
}
|
||||
// console.log('compareLinks');
|
||||
// console.log(compare);
|
||||
return JSON.stringify(compare);
|
||||
},
|
||||
submitUpdate: function (submission, shouldLinks, shouldUpload) {
|
||||
console.log('submitUpdate');
|
||||
this.inError = false;
|
||||
const url = './api/v1/transactions/' + this.groupId;
|
||||
console.log(JSON.stringify(submission));
|
||||
console.log(submission);
|
||||
axios.put(url, submission)
|
||||
.then(response => {
|
||||
console.log('Response is OK!');
|
||||
// report the transaction is submitted.
|
||||
this.submittedTransaction = true;
|
||||
uploadAttachments: function (result) {
|
||||
//console.log('TODO, upload attachments.');
|
||||
if (0 === Object.keys(result).length) {
|
||||
|
||||
// submit links and attachments (can only be done when the transaction is created)
|
||||
if (shouldLinks) {
|
||||
console.log('Need to update links.');
|
||||
this.submitTransactionLinks();
|
||||
}
|
||||
if (!shouldLinks) {
|
||||
console.log('No need to update links.');
|
||||
}
|
||||
// TODO attachments:
|
||||
// this.submitAttachments(data, response);
|
||||
//
|
||||
// // meanwhile, store the ID and the title in some easy to access variables.
|
||||
this.returnedGroupId = parseInt(response.data.data.id);
|
||||
this.returnedGroupTitle = null === response.data.data.attributes.group_title ? response.data.data.attributes.transactions[0].description : response.data.data.attributes.group_title;
|
||||
}
|
||||
)
|
||||
.catch(error => {
|
||||
console.log('error :(');
|
||||
console.log(error.response.data);
|
||||
// oh noes Firefly III has something to bitch about.
|
||||
this.enableSubmit = true;
|
||||
// report the transaction is submitted.
|
||||
this.submittedTransaction = true;
|
||||
// // also report attachments and links are submitted:
|
||||
this.submittedAttachments = true;
|
||||
this.submittedLinks = true;
|
||||
//
|
||||
// but report an error because error:
|
||||
this.inError = true;
|
||||
this.parseErrors(error.response.data);
|
||||
}
|
||||
);
|
||||
for (let i in this.transactions) {
|
||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
|
||||
//console.log('updateField(' + i + ', transaction_journal_id, ' + result[i].transaction_journal_id + ')');
|
||||
this.updateField({index: i, field: 'transaction_journal_id', value: result[i].transaction_journal_id});
|
||||
}
|
||||
}
|
||||
//console.log('Transactions not changed, use original objects.');
|
||||
} else {
|
||||
//console.log('Transactions changed!');
|
||||
}
|
||||
this.submittedAttachments = true;
|
||||
},
|
||||
|
||||
parseErrors: function (errors) {
|
||||
for (let i in this.transactions) {
|
||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
@@ -800,97 +953,92 @@ export default {
|
||||
},
|
||||
|
||||
deleteOriginalLinks: function (transaction) {
|
||||
console.log(transaction.links);
|
||||
let promises = [];
|
||||
for (let i in transaction.links) {
|
||||
if (transaction.links.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
let current = transaction.links[i];
|
||||
let url = '/api/v1/transaction_links/' + current.id;
|
||||
axios.delete(url).then(response => {
|
||||
// TODO response
|
||||
});
|
||||
promises.push(axios.delete(url));
|
||||
}
|
||||
}
|
||||
return Promise.all(promises);
|
||||
},
|
||||
|
||||
/**
|
||||
* Submit transaction links.
|
||||
* TODO same method as CREATE
|
||||
*/
|
||||
submitTransactionLinks() {
|
||||
let total = 0;
|
||||
deleteAllOriginalLinks: function () {
|
||||
//console.log('deleteAllOriginalLinks()');
|
||||
// loop to delete old transaction links.
|
||||
let promises = [];
|
||||
|
||||
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?
|
||||
let currentTransaction = this.transactions[i];
|
||||
let originalTransaction = this.originalTransactions.hasOwnProperty(i) ? this.originalTransactions[i] : {};
|
||||
// compare links:
|
||||
let newLinks = this.compareLinks(currentTransaction.links);
|
||||
let originalLinks = this.compareLinks(originalTransaction.links);
|
||||
if (newLinks !== originalLinks) {
|
||||
if ('[]' !== originalLinks) {
|
||||
this.deleteOriginalLinks(originalTransaction);
|
||||
promises.push(this.deleteOriginalLinks(originalTransaction));
|
||||
}
|
||||
|
||||
console.log('links are different!');
|
||||
// console.log(newLinks);
|
||||
// console.log(originalLinks);
|
||||
for (let ii in currentTransaction.links) {
|
||||
if (currentTransaction.links.hasOwnProperty(ii) && /^0$|^[1-9]\d*$/.test(ii) && ii <= 4294967294) {
|
||||
let currentLink = currentTransaction.links[ii];
|
||||
let linkObject = {
|
||||
inward_id: currentTransaction.transaction_journal_id,
|
||||
outward_id: currentTransaction.transaction_journal_id,
|
||||
link_type_id: 'something'
|
||||
};
|
||||
|
||||
let parts = currentLink.link_type_id.split('-');
|
||||
linkObject.link_type_id = parts[0];
|
||||
if ('inward' === parts[1]) {
|
||||
linkObject.inward_id = currentLink.transaction_journal_id;
|
||||
}
|
||||
if ('outward' === parts[1]) {
|
||||
linkObject.outward_id = currentLink.transaction_journal_id;
|
||||
}
|
||||
|
||||
console.log(linkObject);
|
||||
total++;
|
||||
// submit transaction link:
|
||||
promises.push(axios.post('./api/v1/transaction_links', linkObject).then(response => {
|
||||
// TODO error handling.
|
||||
}));
|
||||
}
|
||||
}
|
||||
// shouldLinks = true;
|
||||
} else {
|
||||
promises.push(new Promise((resolve) => {
|
||||
resolve({});
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (0 === total) {
|
||||
this.submittedLinks = true;
|
||||
return;
|
||||
}
|
||||
Promise.all(promises).then(function () {
|
||||
this.submittedLinks = true;
|
||||
});
|
||||
return Promise.all(promises);
|
||||
},
|
||||
finalizeSubmit: function () {
|
||||
console.log('now in finalizeSubmit()');
|
||||
console.log('submittedTransaction : ' + this.submittedTransaction);
|
||||
console.log('submittedLinks : ' + this.submittedLinks);
|
||||
console.log('submittedAttachments : ' + this.submittedAttachments);
|
||||
submitNewLinks: function () {
|
||||
//console.log('submitNewLinks()');
|
||||
let promises = [];
|
||||
for (let i in this.transactions) {
|
||||
if (this.transactions.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
let currentTransaction = this.transactions[i];
|
||||
for (let ii in currentTransaction.links) {
|
||||
if (currentTransaction.links.hasOwnProperty(ii) && /^0$|^[1-9]\d*$/.test(ii) && ii <= 4294967294) {
|
||||
let currentLink = currentTransaction.links[ii];
|
||||
let linkObject = {
|
||||
inward_id: currentTransaction.transaction_journal_id,
|
||||
outward_id: currentTransaction.transaction_journal_id,
|
||||
link_type_id: 'something'
|
||||
};
|
||||
|
||||
let parts = currentLink.link_type_id.split('-');
|
||||
linkObject.link_type_id = parts[0];
|
||||
if ('inward' === parts[1]) {
|
||||
linkObject.inward_id = currentLink.transaction_journal_id;
|
||||
}
|
||||
if ('outward' === parts[1]) {
|
||||
linkObject.outward_id = currentLink.transaction_journal_id;
|
||||
}
|
||||
promises.push(axios.post('./api/v1/transaction_links', linkObject));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Promise.all(promises);
|
||||
},
|
||||
/**
|
||||
* Submit transaction links.
|
||||
*/
|
||||
submitTransactionLinksX: function () {
|
||||
//return this.deleteAllOriginalLinks().then(() => this.submitNewLinks());
|
||||
},
|
||||
finalizeSubmitX: function () {
|
||||
// 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 +1048,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 +1063,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;
|
||||
|
||||
@@ -267,8 +267,9 @@
|
||||
v-on="$listeners"
|
||||
:custom-fields.sync="customFields"
|
||||
:index="index"
|
||||
:submitted_transaction="submittedTransaction"
|
||||
:transaction_journal_id="transaction.transaction_journal_id"
|
||||
:upload-trigger="transaction.uploadTrigger"
|
||||
:clear-trigger="transaction.clearTrigger"
|
||||
/>
|
||||
<TransactionLocation
|
||||
v-model="transaction.location"
|
||||
@@ -347,11 +348,6 @@ export default {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
submittedTransaction: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}, // need to know if transaction is submitted.
|
||||
sourceAllowedTypes: {
|
||||
type: Array,
|
||||
required: false,
|
||||
@@ -381,21 +377,24 @@ export default {
|
||||
return this.date;
|
||||
},
|
||||
sourceAccount: function () {
|
||||
console.log('computed::sourceAccount');
|
||||
//console.log('computed::sourceAccount(' + this.index + ')');
|
||||
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 () {
|
||||
return {
|
||||
//console.log('computed::destinationAccount(' + this.index + ')');
|
||||
let value = {
|
||||
id: this.transaction.destination_account_id,
|
||||
name: this.transaction.destination_account_name,
|
||||
type: this.transaction.destination_account_type,
|
||||
};
|
||||
//console.log(JSON.stringify(value));
|
||||
return value;
|
||||
},
|
||||
hasMetaFields: function () {
|
||||
let requiredFields = [
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<div v-if="visible" class="text-xs d-none d-lg-block d-xl-block">
|
||||
<span v-if="0 === this.index">{{ $t('firefly.' + this.direction + '_account') }}</span>
|
||||
<span v-if="this.index > 0" class="text-warning">{{ $t('firefly.first_split_overrules_' + this.direction) }}</span>
|
||||
<!-- <br><span>{{ selectedAccount }}</span> -->
|
||||
<!--<br><span>{{ selectedAccount }}</span>-->
|
||||
</div>
|
||||
<div v-if="!visible" class="text-xs d-none d-lg-block d-xl-block">
|
||||
|
||||
@@ -127,8 +127,8 @@ export default {
|
||||
this.selectedAccount = event;
|
||||
},
|
||||
systemReturnedAccount: function (event) {
|
||||
// console.log('systemReturnedAccount!');
|
||||
// console.log('To prevent invalid propogation, set selectedAccountTrigger = false');
|
||||
//console.log('systemReturnedAccount!');
|
||||
//console.log('To prevent invalid propogation, set selectedAccountTrigger = false');
|
||||
this.selectedAccountTrigger = false;
|
||||
this.selectedAccount = event;
|
||||
},
|
||||
@@ -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,27 @@ 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;
|
||||
}
|
||||
if (false === this.selectedAccountTrigger) {
|
||||
//console.log('watch::selectedAccount() will NOT set accountName because selectedAccountTrigger = false');
|
||||
}
|
||||
if (false === this.selectedAccountTrigger && this.accountName !== value.name && null !== value.name) {
|
||||
//console.log('watch::selectedAccount() will set accountName. selectedAccountTrigger = false but name is different ("' + this.accountName + '" > "' + value.name + '")');
|
||||
this.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 +243,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(' + this.index + ')::watch value(' + JSON.stringify(value) + ')');
|
||||
this.systemReturnedAccount(value);
|
||||
|
||||
// // console.log('Index ' + this.index + ' nwAct: ', value);
|
||||
|
||||
@@ -39,27 +39,29 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "TransactionAttachments",
|
||||
props: ['transaction_journal_id', 'customFields'],
|
||||
props: ['transaction_journal_id', 'customFields', 'index', 'uploadTrigger', 'clearTrigger'],
|
||||
data() {
|
||||
return {
|
||||
availableFields: this.customFields
|
||||
availableFields: this.customFields,
|
||||
uploads: 0,
|
||||
created: 0,
|
||||
uploaded: 0,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
customFields: function (value) {
|
||||
this.availableFields = value;
|
||||
},
|
||||
uploadTrigger: function () {
|
||||
//console.log('uploadTrigger(' + this.transaction_journal_id + ',' + this.index + ')');
|
||||
this.doUpload();
|
||||
},
|
||||
clearTrigger: function () {
|
||||
//console.log('clearTrigger(' + this.transaction_journal_id + ',' + this.index + ')');
|
||||
this.$refs.att.value = null;
|
||||
},
|
||||
transaction_journal_id: function (value) {
|
||||
if (!this.showField) {
|
||||
// console.log('Field is hidden. Emit event!');
|
||||
this.$emit('uploaded-attachments', value);
|
||||
return;
|
||||
}
|
||||
// console.log('transaction_journal_id changed to ' + value);
|
||||
// do upload!
|
||||
if (0 !== value) {
|
||||
this.doUpload();
|
||||
}
|
||||
//console.log('watch transaction_journal_id: ' + value + ' (index ' + this.index + ')');
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -71,47 +73,65 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectedFile: function() {
|
||||
this.$emit('selected-attachments', this.transaction_journal_id);
|
||||
selectedFile: function () {
|
||||
this.$emit('selected-attachments', {index: this.index, id: this.transaction_journal_id});
|
||||
},
|
||||
createAttachment: function (name) {
|
||||
// console.log('Now in createAttachment()');
|
||||
const uri = './api/v1/attachments';
|
||||
const data = {
|
||||
filename: name,
|
||||
attachable_type: 'TransactionJournal',
|
||||
attachable_id: this.transaction_journal_id,
|
||||
};
|
||||
// create new attachment:
|
||||
return axios.post(uri, data);
|
||||
},
|
||||
uploadAttachment: function (attachmentId, data) {
|
||||
this.created++;
|
||||
// console.log('Now in uploadAttachment()');
|
||||
const uploadUri = './api/v1/attachments/' + attachmentId + '/upload';
|
||||
return axios.post(uploadUri, data)
|
||||
},
|
||||
countAttachment: function () {
|
||||
this.uploaded++;
|
||||
//console.log('Uploaded ' + this.uploaded + ' / ' + this.uploads);
|
||||
if (this.uploaded >= this.uploads) {
|
||||
//console.log('All files uploaded. Emit event for ' + this.transaction_journal_id + '(' + this.index + ')');
|
||||
this.$emit('uploaded-attachments', this.transaction_journal_id);
|
||||
}
|
||||
},
|
||||
doUpload: function () {
|
||||
// console.log('Now in doUpload() for ' + this.$refs.att.files.length + ' files.');
|
||||
for (let i in this.$refs.att.files) {
|
||||
if (this.$refs.att.files.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
let current = this.$refs.att.files[i];
|
||||
let files = this.$refs.att.files;
|
||||
this.uploads = files.length;
|
||||
// loop all files and create attachments.
|
||||
for (let i in files) {
|
||||
if (files.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||
// console.log('Now at file ' + (parseInt(i) + 1) + ' / ' + files.length);
|
||||
// read file into file reader:
|
||||
let current = files[i];
|
||||
let fileReader = new FileReader();
|
||||
let theParent = this; // dont ask me why i need to do this.
|
||||
fileReader.onloadend = function (evt) {
|
||||
fileReader.onloadend = evt => {
|
||||
if (evt.target.readyState === FileReader.DONE) {
|
||||
// do upload here
|
||||
const uri = './api/v1/attachments';
|
||||
const data = {
|
||||
filename: current.name,
|
||||
attachable_type: 'TransactionJournal',
|
||||
attachable_id: theParent.transaction_journal_id,
|
||||
};
|
||||
// create new attachment:
|
||||
axios.post(uri, data).then(response => {
|
||||
// upload actual file:
|
||||
const uploadUri = './api/v1/attachments/' + response.data.data.id + '/upload';
|
||||
axios
|
||||
.post(uploadUri, new Blob([evt.target.result]))
|
||||
.then(attachmentResponse => {
|
||||
// TODO feedback etc.
|
||||
// console.log('Uploaded a file. Emit event!');
|
||||
// console.log(attachmentResponse);
|
||||
theParent.$emit('uploaded-attachments', this.transaction_journal_id);
|
||||
});
|
||||
});
|
||||
// console.log('I am done reading file ' + (parseInt(i) + 1));
|
||||
this.createAttachment(current.name).then(response => {
|
||||
// console.log('Created attachment. Now upload (1)');
|
||||
return theParent.uploadAttachment(response.data.data.id, new Blob([evt.target.result]));
|
||||
}).then(theParent.countAttachment);
|
||||
}
|
||||
}
|
||||
fileReader.readAsArrayBuffer(current);
|
||||
}
|
||||
}
|
||||
if (0 === this.$refs.att.files.length) {
|
||||
// console.log('No files to upload. Emit event!');
|
||||
if (0 === files.length) {
|
||||
//console.log('No files to upload. Emit event!');
|
||||
this.$emit('uploaded-attachments', this.transaction_journal_id);
|
||||
}
|
||||
// Promise.all(promises).then(response => {
|
||||
// console.log('All files uploaded. Emit event!');
|
||||
// this.$emit('uploaded-attachments', this.transaction_journal_id);
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,13 +61,12 @@ export default {
|
||||
return {
|
||||
categories: [],
|
||||
initialSet: [],
|
||||
category: this.value,
|
||||
emitEvent: true
|
||||
category: this.value
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
|
||||
//console.log('Created category(' + this.index + ') "' + this.value + '"');
|
||||
// initial list of accounts:
|
||||
axios.get(this.getACURL(''))
|
||||
.then(response => {
|
||||
@@ -82,11 +81,13 @@ export default {
|
||||
},
|
||||
getACURL: function (query) {
|
||||
// update autocomplete URL:
|
||||
// console.log('getACURL("' + query + '")');
|
||||
return document.getElementsByTagName('base')[0].href + 'api/v1/autocomplete/categories?query=' + query;
|
||||
},
|
||||
lookupCategory: debounce(function () {
|
||||
// update autocomplete URL:
|
||||
axios.get(this.getACURL(this.value))
|
||||
//console.log('Do a search for "'+this.category+'"');
|
||||
axios.get(this.getACURL(this.category))
|
||||
.then(response => {
|
||||
this.categories = response.data;
|
||||
})
|
||||
@@ -94,7 +95,6 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
value: function (value) {
|
||||
this.emitEvent = false;
|
||||
this.category = value ?? '';
|
||||
},
|
||||
category: function (value) {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="form-group">
|
||||
<div class="form-group" v-if="0===index">
|
||||
<div class="text-xs d-none d-lg-block d-xl-block">
|
||||
{{ $t('firefly.date_and_time') }}
|
||||
</div>
|
||||
@@ -28,7 +28,6 @@
|
||||
ref="date"
|
||||
v-model="dateStr"
|
||||
:class="errors.length > 0 ? 'form-control is-invalid' : 'form-control'"
|
||||
:disabled="index > 0"
|
||||
:placeholder="dateStr"
|
||||
:title="$t('firefly.date')"
|
||||
autocomplete="off"
|
||||
@@ -39,7 +38,6 @@
|
||||
ref="time"
|
||||
v-model="timeStr"
|
||||
:class="errors.length > 0 ? 'form-control is-invalid' : 'form-control'"
|
||||
:disabled="index > 0"
|
||||
:placeholder="timeStr"
|
||||
:title="$t('firefly.time')"
|
||||
autocomplete="off"
|
||||
@@ -64,7 +62,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];
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<form v-on:submit.prevent="search">
|
||||
<form v-on:submit.prevent="search" autocomplete="off">
|
||||
<div class="input-group">
|
||||
<input id="query" v-model="query" autocomplete="off" class="form-control" maxlength="255" name="search"
|
||||
placeholder="Search query" type="text">
|
||||
|
||||
@@ -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});
|
||||
}
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "\u0421\u043b\u0435\u0434\u0432\u0430\u0449o \u043e\u0447\u0430\u043a\u0432\u0430\u043do \u0441\u044a\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "bg"
|
||||
"html_language": "bg",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "\u0421\u0443\u043c\u0430 \u0432\u044a\u0432 \u0432\u0430\u043b\u0443\u0442\u0430",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Dal\u0161\u00ed o\u010dek\u00e1van\u00e1 shoda"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "cs"
|
||||
"html_language": "cs",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "\u010c\u00e1stka v ciz\u00ed m\u011bn\u011b",
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
"edit": "Bearbeiten",
|
||||
"account_type_Loan": "Darlehen",
|
||||
"account_type_Mortgage": "Hypothek",
|
||||
"timezone_difference": "Your browser reports time zone \"{local}\". Firefly III is configured for time zone \"{system}\". This chart may drift.",
|
||||
"timezone_difference": "Ihr Browser meldet die Zeitzone \u201e{local}\u201d. Firefly III ist aber f\u00fcr die Zeitzone \u201e{system}\u201d konfiguriert. Diese Karte kann deshalb abweichen.",
|
||||
"stored_new_account_js": "Neues Konto \"<a href=\"accounts\/show\/{ID}\">\u201e{name}\u201d<\/a>\" gespeichert!",
|
||||
"account_type_Debt": "Schuld",
|
||||
"delete": "L\u00f6schen",
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "N\u00e4chste erwartete \u00dcbereinstimmung"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "de"
|
||||
"html_language": "de",
|
||||
"week_in_year_fns": "'Woche' ww\/yyyy",
|
||||
"quarter_fns": "'Q'QQQ, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Ausl\u00e4ndischer Betrag",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "\u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03b7 \u03b1\u03bd\u03b1\u03bc\u03b5\u03bd\u03cc\u03bc\u03b5\u03bd\u03b7 \u03b1\u03bd\u03c4\u03b9\u03c3\u03c4\u03bf\u03af\u03c7\u03b9\u03c3\u03b7"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "el"
|
||||
"html_language": "el",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "\u03a0\u03bf\u03c3\u03cc \u03c3\u03b5 \u03be\u03ad\u03bd\u03bf \u03bd\u03cc\u03bc\u03b9\u03c3\u03bc\u03b1",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Next expected match"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "en-gb"
|
||||
"html_language": "en-gb",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Foreign amount",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Next expected match"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "en"
|
||||
"html_language": "en",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Foreign amount",
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
"edit": "Editar",
|
||||
"account_type_Loan": "Pr\u00e9stamo",
|
||||
"account_type_Mortgage": "Hipoteca",
|
||||
"timezone_difference": "Your browser reports time zone \"{local}\". Firefly III is configured for time zone \"{system}\". This chart may drift.",
|
||||
"timezone_difference": "Su navegador reporta la zona horaria \"{local}\". Firefly III est\u00e1 configurado para la zona horaria \"{system}\". Este gr\u00e1fico puede cambiar.",
|
||||
"stored_new_account_js": "Nueva cuenta \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" guardada!",
|
||||
"account_type_Debt": "Deuda",
|
||||
"delete": "Eliminar",
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Pr\u00f3xima coincidencia esperada"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "es"
|
||||
"html_language": "es",
|
||||
"week_in_year_fns": "'Semana' w, yyyy",
|
||||
"quarter_fns": "'Trimestre' Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Cantidad extranjera",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Seuraava lasku odotettavissa"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "fi"
|
||||
"html_language": "fi",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Ulkomaan summa",
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
"edit": "Modifier",
|
||||
"account_type_Loan": "Pr\u00eat",
|
||||
"account_type_Mortgage": "Pr\u00eat hypoth\u00e9caire",
|
||||
"timezone_difference": "Your browser reports time zone \"{local}\". Firefly III is configured for time zone \"{system}\". This chart may drift.",
|
||||
"timezone_difference": "Votre navigateur signale le fuseau horaire \"{local}\". Firefly III est configur\u00e9 pour le fuseau horaire \"{system}\". Ce graphique peut \u00eatre d\u00e9cal\u00e9.",
|
||||
"stored_new_account_js": "Nouveau compte \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" enregistr\u00e9 !",
|
||||
"account_type_Debt": "Dette",
|
||||
"delete": "Supprimer",
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Prochaine association attendue"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "fr"
|
||||
"html_language": "fr",
|
||||
"week_in_year_fns": "'Semaine' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Montant en devise \u00e9trang\u00e8re",
|
||||
@@ -165,7 +168,7 @@
|
||||
"currency_id": "Devise",
|
||||
"liability_type": "Type de passif",
|
||||
"account_role": "R\u00f4le du compte",
|
||||
"liability_direction": "Liability in\/out",
|
||||
"liability_direction": "Sens du passif",
|
||||
"book_date": "Date de r\u00e9servation",
|
||||
"permDeleteWarning": "Supprimer quelque chose dans Firefly est permanent et ne peut pas \u00eatre annul\u00e9.",
|
||||
"account_areYouSure_js": "\u00cates-vous s\u00fbr de vouloir supprimer le compte nomm\u00e9 \"{name}\" ?",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "K\u00f6vetkez\u0151 v\u00e1rhat\u00f3 egyez\u00e9s"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "hu"
|
||||
"html_language": "hu",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "K\u00fclf\u00f6ldi \u00f6sszeg",
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
"edit": "Modifica",
|
||||
"account_type_Loan": "Prestito",
|
||||
"account_type_Mortgage": "Mutuo",
|
||||
"timezone_difference": "Your browser reports time zone \"{local}\". Firefly III is configured for time zone \"{system}\". This chart may drift.",
|
||||
"timezone_difference": "Il browser segnala \"{local}\" come fuso orario. Firefly III \u00e8 configurato con il fuso orario \"{system}\". Questo grafico potrebbe non \u00e8 essere corretto.",
|
||||
"stored_new_account_js": "Nuovo conto \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" salvato!",
|
||||
"account_type_Debt": "Debito",
|
||||
"delete": "Elimina",
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Prossimo abbinamento previsto"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "it"
|
||||
"html_language": "it",
|
||||
"week_in_year_fns": "'Settimana' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Importo estero",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Neste forventede treff"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "nb"
|
||||
"html_language": "nb",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Utenlandske bel\u00f8p",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Volgende verwachte match"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "nl"
|
||||
"html_language": "nl",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Bedrag in vreemde valuta",
|
||||
|
||||
@@ -109,8 +109,8 @@
|
||||
"edit": "Modyfikuj",
|
||||
"account_type_Loan": "Po\u017cyczka",
|
||||
"account_type_Mortgage": "Hipoteka",
|
||||
"timezone_difference": "Your browser reports time zone \"{local}\". Firefly III is configured for time zone \"{system}\". This chart may drift.",
|
||||
"stored_new_account_js": "New account \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" stored!",
|
||||
"timezone_difference": "Twoja przegl\u0105darka raportuje stref\u0119 czasow\u0105 \"{local}\". Firefly III ma skonfigurowan\u0105 stref\u0119 czasow\u0105 \"{system}\". W zwi\u0105zku z t\u0105 r\u00f3\u017cnic\u0105, ten wykres mo\u017ce pokazywa\u0107 inne dane, ni\u017c oczekujesz.",
|
||||
"stored_new_account_js": "Nowe konto \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" zapisane!",
|
||||
"account_type_Debt": "D\u0142ug",
|
||||
"delete": "Usu\u0144",
|
||||
"store_new_asset_account": "Zapisz nowe konto aktyw\u00f3w",
|
||||
@@ -120,13 +120,13 @@
|
||||
"mandatoryFields": "Pola wymagane",
|
||||
"optionalFields": "Pola opcjonalne",
|
||||
"reconcile_this_account": "Uzgodnij to konto",
|
||||
"interest_calc_weekly": "Per week",
|
||||
"interest_calc_weekly": "Tygodniowo",
|
||||
"interest_calc_monthly": "Co miesi\u0105c",
|
||||
"interest_calc_quarterly": "Per quarter",
|
||||
"interest_calc_half-year": "Per half year",
|
||||
"interest_calc_quarterly": "Kwartalnie",
|
||||
"interest_calc_half-year": "Co p\u00f3\u0142 roku",
|
||||
"interest_calc_yearly": "Co rok",
|
||||
"liability_direction_credit": "I am owed this debt",
|
||||
"liability_direction_debit": "I owe this debt to somebody else",
|
||||
"liability_direction_credit": "Zad\u0142u\u017cenie wobec mnie",
|
||||
"liability_direction_debit": "Zad\u0142u\u017cenie wobec kogo\u015b innego",
|
||||
"save_transactions_by_moving_js": "Brak transakcji|Zapisz t\u0119 transakcj\u0119, przenosz\u0105c j\u0105 na inne konto.|Zapisz te transakcje przenosz\u0105c je na inne konto.",
|
||||
"none_in_select_list": "(\u017cadne)"
|
||||
},
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Nast\u0119pne oczekiwane dopasowanie"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "pl"
|
||||
"html_language": "pl",
|
||||
"week_in_year_fns": "w 'tydzie\u0144' yyyy",
|
||||
"quarter_fns": "Q 'kwarta\u0142' yyyy",
|
||||
"half_year_fns": "'{half} po\u0142owa' yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Kwota zagraniczna",
|
||||
@@ -163,7 +166,7 @@
|
||||
"interest": "Odsetki",
|
||||
"interest_period": "Okres odsetkowy",
|
||||
"currency_id": "Waluta",
|
||||
"liability_type": "Liability type",
|
||||
"liability_type": "Rodzaj zobowi\u0105zania",
|
||||
"account_role": "Rola konta",
|
||||
"liability_direction": "Liability in\/out",
|
||||
"book_date": "Data ksi\u0119gowania",
|
||||
|
||||
@@ -109,8 +109,8 @@
|
||||
"edit": "Editar",
|
||||
"account_type_Loan": "Empr\u00e9stimo",
|
||||
"account_type_Mortgage": "Hipoteca",
|
||||
"timezone_difference": "Your browser reports time zone \"{local}\". Firefly III is configured for time zone \"{system}\". This chart may drift.",
|
||||
"stored_new_account_js": "New account \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" stored!",
|
||||
"timezone_difference": "Seu navegador reporta o fuso hor\u00e1rio \"{local}\". O Firefly III est\u00e1 configurado para o fuso hor\u00e1rio \"{system}\". Este gr\u00e1fico pode variar.",
|
||||
"stored_new_account_js": "Nova conta \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" armazenada!",
|
||||
"account_type_Debt": "D\u00edvida",
|
||||
"delete": "Apagar",
|
||||
"store_new_asset_account": "Armazenar nova conta de ativo",
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Pr\u00f3ximo correspondente esperado"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "pt-br"
|
||||
"html_language": "pt-br",
|
||||
"week_in_year_fns": "'Semana' w, yyyy",
|
||||
"quarter_fns": "'T'Q, yyyy",
|
||||
"half_year_fns": "'S{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Montante em moeda estrangeira",
|
||||
@@ -165,7 +168,7 @@
|
||||
"currency_id": "Moeda",
|
||||
"liability_type": "Tipo de passivo",
|
||||
"account_role": "Fun\u00e7\u00e3o de conta",
|
||||
"liability_direction": "Liability in\/out",
|
||||
"liability_direction": "Passivo entrada\/sa\u00edda",
|
||||
"book_date": "Data reserva",
|
||||
"permDeleteWarning": "Exclus\u00e3o de dados do Firefly III s\u00e3o permanentes e n\u00e3o podem ser desfeitos.",
|
||||
"account_areYouSure_js": "Tem certeza que deseja excluir a conta \"{name}\"?",
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"no_currency": "(sem moeda)",
|
||||
"date": "Data",
|
||||
"time": "Hora",
|
||||
"no_budget": "(sem orcamento)",
|
||||
"no_budget": "(sem or\u00e7amento)",
|
||||
"destination_account": "Conta de destino",
|
||||
"source_account": "Conta de origem",
|
||||
"single_split": "Dividir",
|
||||
@@ -16,12 +16,12 @@
|
||||
"transaction_journal_extra": "Informa\u00e7\u00f5es extra",
|
||||
"transaction_journal_meta": "Meta informa\u00e7\u00e3o",
|
||||
"basic_journal_information": "Informa\u00e7\u00f5es b\u00e1sicas de transa\u00e7\u00e3o",
|
||||
"bills_to_pay": "Contas por pagar",
|
||||
"bills_to_pay": "Faturas a pagar",
|
||||
"left_to_spend": "Restante para gastar",
|
||||
"attachments": "Anexos",
|
||||
"net_worth": "Patrimonio liquido",
|
||||
"bill": "Conta",
|
||||
"no_bill": "(sem contas)",
|
||||
"bill": "Fatura",
|
||||
"no_bill": "(sem fatura)",
|
||||
"tags": "Etiquetas",
|
||||
"internal_reference": "Refer\u00eancia interna",
|
||||
"external_url": "URL Externo",
|
||||
@@ -46,8 +46,8 @@
|
||||
"go_to_categories": "Ir para categorias",
|
||||
"expense_accounts": "Conta de despesas",
|
||||
"go_to_expenses": "Ir para despesas",
|
||||
"go_to_bills": "Ir para contas",
|
||||
"bills": "Contas",
|
||||
"go_to_bills": "Ir para as faturas",
|
||||
"bills": "Faturas",
|
||||
"last_thirty_days": "\u00daltimos trinta dias",
|
||||
"last_seven_days": "\u00daltimos sete dias",
|
||||
"go_to_piggies": "Ir para mealheiros",
|
||||
@@ -109,7 +109,7 @@
|
||||
"edit": "Alterar",
|
||||
"account_type_Loan": "Emprestimo",
|
||||
"account_type_Mortgage": "Hipoteca",
|
||||
"timezone_difference": "Your browser reports time zone \"{local}\". Firefly III is configured for time zone \"{system}\". This chart may drift.",
|
||||
"timezone_difference": "Seu navegador de Internet reporta o fuso hor\u00e1rio \"{local}\". O Firefly III est\u00e1 configurado para o fuso hor\u00e1rio \"{system}\". Esta tabela pode derivar.",
|
||||
"stored_new_account_js": "Nova conta \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" armazenada!",
|
||||
"account_type_Debt": "Debito",
|
||||
"delete": "Apagar",
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Proxima correspondencia esperada"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "pt"
|
||||
"html_language": "pt",
|
||||
"week_in_year_fns": "'Semana' w, yyyy",
|
||||
"quarter_fns": "'Trimestre' Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Montante estrangeiro",
|
||||
|
||||
@@ -3,49 +3,49 @@
|
||||
"Transfer": "Transfer",
|
||||
"Withdrawal": "Retragere",
|
||||
"Deposit": "Depozit",
|
||||
"date_and_time": "Date and time",
|
||||
"date_and_time": "Data \u0219i ora",
|
||||
"no_currency": "(nici o moned\u0103)",
|
||||
"date": "Dat\u0103",
|
||||
"time": "Time",
|
||||
"time": "Timp",
|
||||
"no_budget": "(nici un buget)",
|
||||
"destination_account": "Contul de destina\u021bie",
|
||||
"source_account": "Contul surs\u0103",
|
||||
"single_split": "\u00cemparte",
|
||||
"create_new_transaction": "Create a new transaction",
|
||||
"create_new_transaction": "Crea\u021bi o tranzac\u021bie nou\u0103",
|
||||
"balance": "Balant\u0103",
|
||||
"transaction_journal_extra": "Extra information",
|
||||
"transaction_journal_extra": "Informa\u021bii suplimentare",
|
||||
"transaction_journal_meta": "Informa\u021bii meta",
|
||||
"basic_journal_information": "Basic transaction information",
|
||||
"basic_journal_information": "Informa\u021bii de baz\u0103 despre tranzac\u021bie",
|
||||
"bills_to_pay": "Facturile de plat\u0103",
|
||||
"left_to_spend": "Ramas de cheltuit",
|
||||
"attachments": "Ata\u0219amente",
|
||||
"net_worth": "Valoarea net\u0103",
|
||||
"bill": "Factur\u0103",
|
||||
"no_bill": "(no bill)",
|
||||
"no_bill": "(f\u0103r\u0103 factur\u0103)",
|
||||
"tags": "Etichete",
|
||||
"internal_reference": "Internal reference",
|
||||
"external_url": "External URL",
|
||||
"internal_reference": "Referin\u021b\u0103 intern\u0103",
|
||||
"external_url": "URL extern",
|
||||
"no_piggy_bank": "(nicio pu\u0219culi\u021b\u0103)",
|
||||
"paid": "Pl\u0103tit",
|
||||
"notes": "Noti\u021be",
|
||||
"yourAccounts": "Conturile dvs.",
|
||||
"go_to_asset_accounts": "Vizualiza\u021bi conturile de active",
|
||||
"delete_account": "\u0218terge account",
|
||||
"transaction_table_description": "A table containing your transactions",
|
||||
"transaction_table_description": "Un tabel care con\u021bine tranzac\u021biile tale",
|
||||
"account": "Cont",
|
||||
"description": "Descriere",
|
||||
"amount": "Sum\u0103",
|
||||
"budget": "Buget",
|
||||
"category": "Categorie",
|
||||
"opposing_account": "Opposing account",
|
||||
"opposing_account": "Cont opus",
|
||||
"budgets": "Buget",
|
||||
"categories": "Categorii",
|
||||
"go_to_budgets": "Mergi la bugete",
|
||||
"income": "Venituri",
|
||||
"go_to_deposits": "Go to deposits",
|
||||
"go_to_deposits": "Du-te la depozite",
|
||||
"go_to_categories": "Mergi la categorii",
|
||||
"expense_accounts": "Conturi de cheltuieli",
|
||||
"go_to_expenses": "Go to expenses",
|
||||
"go_to_expenses": "Mergi la cheltuieli",
|
||||
"go_to_bills": "Mergi la facturi",
|
||||
"bills": "Facturi",
|
||||
"last_thirty_days": "Ultimele 30 de zile",
|
||||
@@ -54,7 +54,7 @@
|
||||
"saved": "Salvat",
|
||||
"piggy_banks": "Pu\u0219culi\u021b\u0103",
|
||||
"piggy_bank": "Pu\u0219culi\u021b\u0103",
|
||||
"amounts": "Amounts",
|
||||
"amounts": "Sume",
|
||||
"left": "R\u0103mas",
|
||||
"spent": "Cheltuit",
|
||||
"Default asset account": "Cont de active implicit",
|
||||
@@ -67,50 +67,50 @@
|
||||
"clear_location": "\u0218terge\u021bi loca\u021bia",
|
||||
"account_role_ccAsset": "Card de credit",
|
||||
"account_role_cashWalletAsset": "Cash - Numerar",
|
||||
"daily_budgets": "Daily budgets",
|
||||
"weekly_budgets": "Weekly budgets",
|
||||
"monthly_budgets": "Monthly budgets",
|
||||
"quarterly_budgets": "Quarterly budgets",
|
||||
"daily_budgets": "Bugete zilnice",
|
||||
"weekly_budgets": "Bugete s\u0103pt\u0103m\u00e2nale",
|
||||
"monthly_budgets": "Bugete lunare",
|
||||
"quarterly_budgets": "Bugete trimestriale",
|
||||
"create_new_expense": "Crea\u021bi un nou cont de cheltuieli",
|
||||
"create_new_revenue": "Crea\u021bi un nou cont de venituri",
|
||||
"create_new_liabilities": "Create new liability",
|
||||
"half_year_budgets": "Half-yearly budgets",
|
||||
"yearly_budgets": "Yearly budgets",
|
||||
"create_new_liabilities": "Creare provizion nou",
|
||||
"half_year_budgets": "Bugete semestriale",
|
||||
"yearly_budgets": "Bugete anuale",
|
||||
"split_transaction_title": "Descrierea tranzac\u021biei divizate",
|
||||
"errors_submission": "There was something wrong with your submission. Please check out the errors.",
|
||||
"errors_submission": "A fost ceva \u00een neregul\u0103 cu depunerea ta. Te rug\u0103m s\u0103 verifici erorile.",
|
||||
"flash_error": "Eroare!",
|
||||
"store_transaction": "Store transaction",
|
||||
"store_transaction": "Tranzac\u021bie magazin",
|
||||
"flash_success": "Succes!",
|
||||
"create_another": "Dup\u0103 stocare, reveni\u021bi aici pentru a crea alta.",
|
||||
"update_transaction": "Actualiza\u021bi tranzac\u021bia",
|
||||
"after_update_create_another": "Dup\u0103 actualizare, reveni\u021bi aici pentru a continua editarea.",
|
||||
"transaction_updated_no_changes": "<a href=\"transactions\/show\/{ID}\">Transaction #{ID}<\/a> (\"{title}\") did not receive any changes.",
|
||||
"transaction_updated_link": "<a href=\"transactions\/show\/{ID}\">Transaction #{ID}<\/a> (\"{title}\") has been updated.",
|
||||
"spent_x_of_y": "Spent {amount} of {total}",
|
||||
"transaction_updated_no_changes": "<a href=\"transactions\/show\/{ID}\">Tranzac\u021bia #{ID}<\/a> (\"{title}\") nu a primit nicio modificare.",
|
||||
"transaction_updated_link": "<a href=\"transactions\/show\/{ID}\">Tranzac\u021bia #{ID}<\/a> (\"{title}\") a fost actualizat\u0103.",
|
||||
"spent_x_of_y": "Cheltuit {amount} din {total}",
|
||||
"search": "Caut\u0103",
|
||||
"create_new_asset": "Crea\u021bi un nou cont de active",
|
||||
"asset_accounts": "Conturile de active",
|
||||
"reset_after": "Reseta\u021bi formularul dup\u0103 trimitere",
|
||||
"bill_paid_on": "Paid on {date}",
|
||||
"first_split_decides": "The first split determines the value of this field",
|
||||
"first_split_overrules_source": "The first split may overrule the source account",
|
||||
"first_split_overrules_destination": "The first split may overrule the destination account",
|
||||
"bill_paid_on": "Pl\u0103tit pe {date}",
|
||||
"first_split_decides": "Prima \u00eemp\u0103r\u021bire determin\u0103 valoarea acestui c\u00e2mp",
|
||||
"first_split_overrules_source": "Prima \u00eemp\u0103r\u021bire poate suprascrie contul surs\u0103",
|
||||
"first_split_overrules_destination": "Prima \u00eemp\u0103r\u021bire poate suprascrie contul de destina\u021bie",
|
||||
"transaction_stored_link": "<a href=\"transactions\/show\/{ID}\">Tranzac\u021bia #{ID} (\"{title}\")<\/a> a fost stocat\u0103.",
|
||||
"custom_period": "Custom period",
|
||||
"reset_to_current": "Reset to current period",
|
||||
"select_period": "Select a period",
|
||||
"custom_period": "Perioad\u0103 personalizat\u0103",
|
||||
"reset_to_current": "Resetare la perioada curent\u0103",
|
||||
"select_period": "Selecta\u021bi o perioad\u0103",
|
||||
"location": "Loca\u021bie",
|
||||
"other_budgets": "Custom timed budgets",
|
||||
"other_budgets": "Bugete personalizate temporale",
|
||||
"journal_links": "Link-uri de tranzac\u021bii",
|
||||
"go_to_withdrawals": "Go to your withdrawals",
|
||||
"go_to_withdrawals": "Mergi la retragerile tale",
|
||||
"revenue_accounts": "Conturi de venituri",
|
||||
"add_another_split": "Ad\u0103uga\u021bi o divizare",
|
||||
"actions": "Ac\u021biuni",
|
||||
"edit": "Editeaz\u0103",
|
||||
"account_type_Loan": "\u00cemprumut",
|
||||
"account_type_Mortgage": "Credit ipotecar",
|
||||
"timezone_difference": "Your browser reports time zone \"{local}\". Firefly III is configured for time zone \"{system}\". This chart may drift.",
|
||||
"stored_new_account_js": "New account \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" stored!",
|
||||
"timezone_difference": "Browser-ul raporteaz\u0103 fusul orar \"{local}\". Firefly III este configurat pentru fusul orar \"{system}\". Acest grafic poate s\u0103 dispar\u0103.",
|
||||
"stored_new_account_js": "Cont nou \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" stocat!",
|
||||
"account_type_Debt": "Datorie",
|
||||
"delete": "\u0218terge",
|
||||
"store_new_asset_account": "Salva\u021bi un nou cont de active",
|
||||
@@ -120,14 +120,14 @@
|
||||
"mandatoryFields": "C\u00e2mpuri obligatorii",
|
||||
"optionalFields": "C\u00e2mpuri op\u021bionale",
|
||||
"reconcile_this_account": "Reconcilia\u021bi acest cont",
|
||||
"interest_calc_weekly": "Per week",
|
||||
"interest_calc_weekly": "Pe s\u0103pt\u0103m\u00e2n\u0103",
|
||||
"interest_calc_monthly": "Pe lun\u0103",
|
||||
"interest_calc_quarterly": "Per quarter",
|
||||
"interest_calc_half-year": "Per half year",
|
||||
"interest_calc_quarterly": "Pe trimestru",
|
||||
"interest_calc_half-year": "Pe jum\u0103tate de an",
|
||||
"interest_calc_yearly": "Pe an",
|
||||
"liability_direction_credit": "I am owed this debt",
|
||||
"liability_direction_debit": "I owe this debt to somebody else",
|
||||
"save_transactions_by_moving_js": "No transactions|Save this transaction by moving it to another account. |Save these transactions by moving them to another account.",
|
||||
"liability_direction_credit": "Sunt datorat acestei datorii",
|
||||
"liability_direction_debit": "Dator\u0103m aceast\u0103 datorie altcuiva",
|
||||
"save_transactions_by_moving_js": "F\u0103r\u0103 tranzac\u021bii* Salva\u021bi aceast\u0103 tranzac\u021bie mut\u00e2nd-o \u00een alt cont. | Salva\u021bi aceste tranzac\u021bii mut\u00e2ndu-le \u00eentr-un alt cont.",
|
||||
"none_in_select_list": "(nici unul)"
|
||||
},
|
||||
"list": {
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Urm\u0103toarea potrivire a\u0219teptat\u0103"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "ro"
|
||||
"html_language": "ro",
|
||||
"week_in_year_fns": "'S\u0103pt\u0103m\u00e2n\u0103' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Sum\u0103 str\u0103in\u0103",
|
||||
@@ -163,14 +166,14 @@
|
||||
"interest": "Interes",
|
||||
"interest_period": "Perioad\u0103 de interes",
|
||||
"currency_id": "Moned\u0103",
|
||||
"liability_type": "Liability type",
|
||||
"liability_type": "Tipul de provizion",
|
||||
"account_role": "Rolul contului",
|
||||
"liability_direction": "Liability in\/out",
|
||||
"liability_direction": "R\u0103spundere \u00een\/afar\u0103",
|
||||
"book_date": "Rezerv\u0103 dat\u0103",
|
||||
"permDeleteWarning": "\u0218tergerea este permanent\u0103 \u0219i nu poate fi anulat\u0103.",
|
||||
"account_areYouSure_js": "Are you sure you want to delete the account named \"{name}\"?",
|
||||
"also_delete_piggyBanks_js": "No piggy banks|The only piggy bank connected to this account will be deleted as well.|All {count} piggy banks connected to this account will be deleted as well.",
|
||||
"also_delete_transactions_js": "No transactions|The only transaction connected to this account will be deleted as well.|All {count} transactions connected to this account will be deleted as well.",
|
||||
"account_areYouSure_js": "Sunte\u0163i sigur c\u0103 dori\u0163i s\u0103 \u015fterge\u0163i contul numit \"{name}\"?",
|
||||
"also_delete_piggyBanks_js": "Nici o pu\u0219culi\u021b\u0103 | Singura pu\u0219culi\u021b\u0103 conectat\u0103 la acest cont va fi de asemenea \u0219tears\u0103. Toate cele {count} pu\u0219culi\u021be conectate la acest cont vor fi \u0219terse, de asemenea.",
|
||||
"also_delete_transactions_js": "Nicio tranzac\u021bie | Singura tranzac\u021bie conectat\u0103 la acest cont va fi de asemenea \u0219tears\u0103. | Toate cele {count} tranzac\u021bii conectate la acest cont vor fi \u0219terse, de asemenea.",
|
||||
"process_date": "Data proces\u0103rii",
|
||||
"due_date": "Data scadent\u0103",
|
||||
"payment_date": "Data de plat\u0103",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "ru"
|
||||
"html_language": "ru",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "\u0421\u0443\u043c\u043c\u0430 \u0432 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0439 \u0432\u0430\u043b\u044e\u0442\u0435",
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
"spent": "Utraten\u00e9",
|
||||
"Default asset account": "Prednastaven\u00fd \u00fa\u010det akt\u00edv",
|
||||
"search_results": "V\u00fdsledky vyh\u013ead\u00e1vania",
|
||||
"include": "Include?",
|
||||
"include": "Zahrn\u00fa\u0165?",
|
||||
"transaction": "Transakcia",
|
||||
"account_role_defaultAsset": "Predvolen\u00fd \u00fa\u010det akt\u00edv",
|
||||
"account_role_savingAsset": "\u0160etriaci \u00fa\u010det",
|
||||
@@ -73,7 +73,7 @@
|
||||
"quarterly_budgets": "\u0160tvr\u0165ro\u010dn\u00e9 rozpo\u010dty",
|
||||
"create_new_expense": "Vytvori\u0165 v\u00fddavko\u00fd \u00fa\u010det",
|
||||
"create_new_revenue": "Vytvori\u0165 nov\u00fd pr\u00edjmov\u00fd \u00fa\u010det",
|
||||
"create_new_liabilities": "Create new liability",
|
||||
"create_new_liabilities": "Vytvori\u0165 nov\u00fd z\u00e1v\u00e4zok",
|
||||
"half_year_budgets": "Polro\u010dn\u00e9 rozpo\u010dty",
|
||||
"yearly_budgets": "Ro\u010dn\u00e9 rozpo\u010dty",
|
||||
"split_transaction_title": "Popis roz\u00fa\u010dtovania",
|
||||
@@ -84,17 +84,17 @@
|
||||
"create_another": "Po ulo\u017een\u00ed sa vr\u00e1ti\u0165 sp\u00e4\u0165 sem a vytvori\u0165 \u010fal\u0161\u00ed.",
|
||||
"update_transaction": "Upravi\u0165 transakciu",
|
||||
"after_update_create_another": "Po aktualiz\u00e1cii sa vr\u00e1ti\u0165 sp\u00e4\u0165 a pokra\u010dova\u0165 v \u00faprav\u00e1ch.",
|
||||
"transaction_updated_no_changes": "<a href=\"transactions\/show\/{ID}\">Transaction #{ID}<\/a> (\"{title}\") did not receive any changes.",
|
||||
"transaction_updated_link": "<a href=\"transactions\/show\/{ID}\">Transaction #{ID}<\/a> (\"{title}\") has been updated.",
|
||||
"spent_x_of_y": "Spent {amount} of {total}",
|
||||
"transaction_updated_no_changes": "<a href=\"transactions\/show\/{ID}\">Transakcia #{ID}<\/a> (\"{title}\") sa nezmenila.",
|
||||
"transaction_updated_link": "<a href=\"transactions\/show\/{ID}\">Transakcia #{ID}<\/a> (\"{title}\") bola upraven\u00e1.",
|
||||
"spent_x_of_y": "Utraten\u00e9 {amount} z {total}",
|
||||
"search": "H\u013eada\u0165",
|
||||
"create_new_asset": "Vytvori\u0165 nov\u00fd \u00fa\u010det akt\u00edv",
|
||||
"asset_accounts": "\u00da\u010dty akt\u00edv",
|
||||
"reset_after": "Po odoslan\u00ed vynulova\u0165 formul\u00e1r",
|
||||
"bill_paid_on": "Uhraden\u00e9 {date}",
|
||||
"first_split_decides": "The first split determines the value of this field",
|
||||
"first_split_overrules_source": "The first split may overrule the source account",
|
||||
"first_split_overrules_destination": "The first split may overrule the destination account",
|
||||
"first_split_decides": "Hodnotu tohto atrib\u00fatu ur\u010duje prv\u00e9 rozdelenie",
|
||||
"first_split_overrules_source": "Prv\u00e9 rozdelenie m\u00f4\u017ee pozmeni\u0165 zdrojov\u00fd \u00fa\u010det",
|
||||
"first_split_overrules_destination": "Prv\u00e9 rozdelenie m\u00f4\u017ee pozmeni\u0165 cie\u013eov\u00fd \u00fa\u010det",
|
||||
"transaction_stored_link": "<a href=\"transactions\/show\/{ID}\">Transakcia #{ID} (\"{title}\")<\/a> bola ulo\u017een\u00e1.",
|
||||
"custom_period": "Vlastn\u00e9 obdobie",
|
||||
"reset_to_current": "Obnovi\u0165 na aktu\u00e1lne obdobie",
|
||||
@@ -109,8 +109,8 @@
|
||||
"edit": "Upravi\u0165",
|
||||
"account_type_Loan": "P\u00f4\u017ei\u010dka",
|
||||
"account_type_Mortgage": "Hypot\u00e9ka",
|
||||
"timezone_difference": "Your browser reports time zone \"{local}\". Firefly III is configured for time zone \"{system}\". This chart may drift.",
|
||||
"stored_new_account_js": "New account \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" stored!",
|
||||
"timezone_difference": "V\u00e1\u0161 prehliada\u010d je nastaven\u00fd na \u010dasov\u00fa z\u00f3nu \"{local}\". Firefly III je nakonfigurovan\u00fd na z\u00f3nu \"{system}\". Zobrazenie \u00fadajov v grafe m\u00f4\u017ee by\u0165 posunut\u00e9.",
|
||||
"stored_new_account_js": "Nov\u00fd \u00fa\u010det \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" vytvoren\u00fd!",
|
||||
"account_type_Debt": "Dlh",
|
||||
"delete": "Odstr\u00e1ni\u0165",
|
||||
"store_new_asset_account": "Ulo\u017ei\u0165 nov\u00fd \u00fa\u010det akt\u00edv",
|
||||
@@ -120,14 +120,14 @@
|
||||
"mandatoryFields": "Povinn\u00e9 \u00fadaje",
|
||||
"optionalFields": "Volite\u013en\u00e9 \u00fadaje",
|
||||
"reconcile_this_account": "Vy\u00fa\u010dtovat tento \u00fa\u010det",
|
||||
"interest_calc_weekly": "Per week",
|
||||
"interest_calc_weekly": "Za t\u00fd\u017ede\u0148",
|
||||
"interest_calc_monthly": "Za mesiac",
|
||||
"interest_calc_quarterly": "Per quarter",
|
||||
"interest_calc_half-year": "Per half year",
|
||||
"interest_calc_quarterly": "Za \u0161tvr\u0165rok",
|
||||
"interest_calc_half-year": "Za polrok",
|
||||
"interest_calc_yearly": "Za rok",
|
||||
"liability_direction_credit": "I am owed this debt",
|
||||
"liability_direction_debit": "I owe this debt to somebody else",
|
||||
"save_transactions_by_moving_js": "No transactions|Save this transaction by moving it to another account. |Save these transactions by moving them to another account.",
|
||||
"liability_direction_credit": "T\u00fato sumu mi dl\u017eia",
|
||||
"liability_direction_debit": "Tento dlh m\u00e1m vo\u010di niekomu in\u00e9mu",
|
||||
"save_transactions_by_moving_js": "\u017diadne transakcie|Zachova\u0165 t\u00fato transakciu presunom pod in\u00fd \u00fa\u010det.|Zachova\u0165 tieto transakcie presunom pod in\u00fd \u00fa\u010det.",
|
||||
"none_in_select_list": "(\u017eiadne)"
|
||||
},
|
||||
"list": {
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "\u010eal\u0161ia o\u010dak\u00e1van\u00e1 zhoda"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "sk"
|
||||
"html_language": "sk",
|
||||
"week_in_year_fns": "'T\u00fd\u017ede\u0148' tt, rrrr",
|
||||
"quarter_fns": "'Q'Q, rrrr",
|
||||
"half_year_fns": "'H{half}', rrrr"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Suma v cudzej mene",
|
||||
@@ -163,14 +166,14 @@
|
||||
"interest": "\u00darok",
|
||||
"interest_period": "\u00darokov\u00e9 obdobie",
|
||||
"currency_id": "Mena",
|
||||
"liability_type": "Liability type",
|
||||
"liability_type": "Typ z\u00e1v\u00e4zku",
|
||||
"account_role": "Rola \u00fa\u010dtu",
|
||||
"liability_direction": "Liability in\/out",
|
||||
"liability_direction": "Z\u00e1v\u00e4zky pr\u00edjem\/v\u00fddaj",
|
||||
"book_date": "D\u00e1tum rezerv\u00e1cie",
|
||||
"permDeleteWarning": "Odstr\u00e1nenie \u00fadajov z Firefly III je trval\u00e9 a nie je mo\u017en\u00e9 ich vr\u00e1ti\u0165 sp\u00e4\u0165.",
|
||||
"account_areYouSure_js": "Are you sure you want to delete the account named \"{name}\"?",
|
||||
"also_delete_piggyBanks_js": "No piggy banks|The only piggy bank connected to this account will be deleted as well.|All {count} piggy banks connected to this account will be deleted as well.",
|
||||
"also_delete_transactions_js": "No transactions|The only transaction connected to this account will be deleted as well.|All {count} transactions connected to this account will be deleted as well.",
|
||||
"account_areYouSure_js": "Skuto\u010dne chcete odstr\u00e1ni\u0165 \u00fa\u010det s n\u00e1zvom \"{name}\"?",
|
||||
"also_delete_piggyBanks_js": "\u017diadne prasiatko|Odstr\u00e1ni sa tie\u017e jedin\u00e9 prasiatko prepojen\u00e9 s t\u00fdmto \u00fa\u010dtom.|Odstr\u00e1ni sa tie\u017e {count} prasiatok prepojen\u00fdch s t\u00fdmto \u00fa\u010dtom.",
|
||||
"also_delete_transactions_js": "\u017diadne transakcie|Odstr\u00e1ni sa aj jedin\u00e1 transakcia spojen\u00e1 s t\u00fdmto \u00fa\u010dtom.|Odstr\u00e1ni sa tie\u017e {count} transakci\u00ed spojen\u00fdch s t\u00fdmto \u00fa\u010dtom.",
|
||||
"process_date": "D\u00e1tum spracovania",
|
||||
"due_date": "D\u00e1tum splatnosti",
|
||||
"payment_date": "D\u00e1tum \u00fahrady",
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
"edit": "Redigera",
|
||||
"account_type_Loan": "L\u00e5n",
|
||||
"account_type_Mortgage": "Bol\u00e5n",
|
||||
"timezone_difference": "Your browser reports time zone \"{local}\". Firefly III is configured for time zone \"{system}\". This chart may drift.",
|
||||
"timezone_difference": "Din webbl\u00e4sare rapporterar tidszonen \"{local}\". Firefly III \u00e4r konfigurerad f\u00f6r tidszonen \"{system}\". Detta diagram kan glida.",
|
||||
"stored_new_account_js": "Nytt konto \"<a href=\"accounts\/show\/{ID}\">{name}<\/a>\" lagrat!",
|
||||
"account_type_Debt": "Skuld",
|
||||
"delete": "Ta bort",
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "N\u00e4sta f\u00f6rv\u00e4ntade tr\u00e4ff"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "sv"
|
||||
"html_language": "sv",
|
||||
"week_in_year_fns": "'Vecka' w, yyyy",
|
||||
"quarter_fns": "'kvartal'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Utl\u00e4ndskt belopp",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "Tr\u1eadn \u0111\u1ea5u d\u1ef1 ki\u1ebfn ti\u1ebfp theo"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "vi"
|
||||
"html_language": "vi",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "Ngo\u1ea1i t\u1ec7",
|
||||
|
||||
@@ -120,13 +120,13 @@
|
||||
"mandatoryFields": "\u5fc5\u586b\u5b57\u6bb5",
|
||||
"optionalFields": "\u9009\u586b\u5b57\u6bb5",
|
||||
"reconcile_this_account": "\u5bf9\u8d26\u6b64\u8d26\u6237",
|
||||
"interest_calc_weekly": "Per week",
|
||||
"interest_calc_weekly": "\u6bcf\u5468",
|
||||
"interest_calc_monthly": "\u6bcf\u6708",
|
||||
"interest_calc_quarterly": "Per quarter",
|
||||
"interest_calc_half-year": "Per half year",
|
||||
"interest_calc_quarterly": "\u6bcf\u5b63\u5ea6",
|
||||
"interest_calc_half-year": "\u6bcf\u534a\u5e74",
|
||||
"interest_calc_yearly": "\u6bcf\u5e74",
|
||||
"liability_direction_credit": "I am owed this debt",
|
||||
"liability_direction_debit": "I owe this debt to somebody else",
|
||||
"liability_direction_credit": "\u6211\u6b20\u4e86\u8fd9\u7b14\u503a\u52a1",
|
||||
"liability_direction_debit": "\u6211\u6b20\u522b\u4eba\u8fd9\u7b14\u94b1",
|
||||
"save_transactions_by_moving_js": "No transactions|Save this transaction by moving it to another account. |Save these transactions by moving them to another account.",
|
||||
"none_in_select_list": "(\u7a7a)"
|
||||
},
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "\u9884\u671f\u4e0b\u6b21\u652f\u4ed8"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "zh-cn"
|
||||
"html_language": "zh-cn",
|
||||
"week_in_year_fns": "'\u5468' w\uff0cyyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "\u5916\u5e01\u91d1\u989d",
|
||||
@@ -163,7 +166,7 @@
|
||||
"interest": "\u5229\u606f",
|
||||
"interest_period": "\u5229\u606f\u671f",
|
||||
"currency_id": "\u8d27\u5e01",
|
||||
"liability_type": "Liability type",
|
||||
"liability_type": "\u503a\u52a1\u7c7b\u578b",
|
||||
"account_role": "\u8d26\u6237\u89d2\u8272",
|
||||
"liability_direction": "Liability in\/out",
|
||||
"book_date": "\u767b\u8bb0\u65e5\u671f",
|
||||
|
||||
@@ -141,7 +141,10 @@
|
||||
"next_expected_match": "\u4e0b\u4e00\u500b\u9810\u671f\u7684\u914d\u5c0d"
|
||||
},
|
||||
"config": {
|
||||
"html_language": "zh-tw"
|
||||
"html_language": "zh-tw",
|
||||
"week_in_year_fns": "'Week' w, yyyy",
|
||||
"quarter_fns": "'Q'Q, yyyy",
|
||||
"half_year_fns": "'H{half}', yyyy"
|
||||
},
|
||||
"form": {
|
||||
"foreign_amount": "\u5916\u5e63\u91d1\u984d",
|
||||
|
||||
5
frontend/src/shared/transactions.js
vendored
5
frontend/src/shared/transactions.js
vendored
@@ -62,6 +62,10 @@ export function getDefaultTransaction() {
|
||||
destination_account_currency_id: null,
|
||||
destination_account_currency_code: null,
|
||||
destination_account_currency_symbol: null,
|
||||
attachments: false,
|
||||
selectedAttachments: false,
|
||||
uploadTrigger: false,
|
||||
clearTrigger: false,
|
||||
|
||||
source_account: {
|
||||
id: 0,
|
||||
@@ -112,7 +116,6 @@ export function getDefaultTransaction() {
|
||||
|
||||
// transaction links:
|
||||
links: [],
|
||||
attachments: [],
|
||||
// location:
|
||||
zoom_level: null,
|
||||
longitude: null,
|
||||
|
||||
Reference in New Issue
Block a user