@@ -176,9 +67,11 @@ import sub from "date-fns/sub";
import startOfMonth from "date-fns/startOfMonth";
import endOfMonth from "date-fns/endOfMonth";
import {configureAxios} from "../../shared/forageStore";
+import TransactionListLarge from "./TransactionListLarge";
export default {
name: "Index",
+ components: {TransactionListLarge},
data() {
return {
transactions: [],
@@ -187,7 +80,6 @@ export default {
downloaded: false,
loading: false,
ready: false,
- fields: [],
currentPage: 1,
perPage: 5,
total: 1,
@@ -244,7 +136,6 @@ export default {
let params = new URLSearchParams(window.location.search);
this.currentPage = params.get('page') ? parseInt(params.get('page')) : 1;
- this.updateFieldList();
this.ready = true;
// make object thing:
@@ -268,18 +159,6 @@ export default {
},
methods: {
...mapMutations('root', ['refreshCacheKey',]),
- updateFieldList: function () {
- this.fields = [
- {key: 'type', label: ' ', sortable: false},
- {key: 'description', label: this.$t('list.description'), sortable: true},
- {key: 'amount', label: this.$t('list.amount'), sortable: true},
- {key: 'date', label: this.$t('list.date'), sortable: true},
- {key: 'source_account', label: this.$t('list.source_account'), sortable: true},
- {key: 'destination_account', label: this.$t('list.destination_account'), sortable: true},
- {key: 'category_name', label: this.$t('list.category'), sortable: true},
- {key: 'menu', label: ' ', sortable: false},
- ];
- },
newCacheKey: function () {
this.refreshCacheKey();
this.downloaded = false;
@@ -323,14 +202,13 @@ export default {
let endStr = format(this.end, 'y-MM-dd');
// console.log(this.urlEnd);
// console.log(this.urlStart);
- if(null !== this.urlEnd && null !== this.urlStart) {
+ if (null !== this.urlEnd && null !== this.urlStart) {
startStr = format(this.urlStart, 'y-MM-dd');
endStr = format(this.urlEnd, 'y-MM-dd');
}
api.get('./api/v1/transactions?type=' + this.type + '&page=' + page + "&start=" + startStr + "&end=" + endStr + '&cache=' + this.cacheKey)
.then(response => {
-
//let currentPage = parseInt(response.data.meta.pagination.current_page);
//let totalPages = parseInt(response.data.meta.pagination.total_pages);
this.total = parseInt(response.data.meta.pagination.total);
@@ -417,51 +295,7 @@ export default {
}
this.createTransactionRows();
},
- tableSortCompare: function (aRow, bRow, key, sortDesc, formatter, compareOptions, compareLocale) {
- let a = aRow[key]
- let b = bRow[key]
- if (aRow.id === bRow.id) {
- // Order split transactions normally when compared to each other, except always put the header first
- if (aRow.split_parent === null) {
- return sortDesc ? 1 : -1;
- } else if (bRow.split_parent === null) {
- return sortDesc ? -1 : 1;
- }
- } else {
- // Sort split transactions based on their parent when compared to other transactions
- if (aRow.split && aRow.split_parent !== null) {
- a = aRow.split_parent[key]
- }
- if (bRow.split && bRow.split_parent !== null) {
- b = bRow.split_parent[key]
- }
- }
-
- if (
- (typeof a === 'number' && typeof b === 'number') ||
- (a instanceof Date && b instanceof Date)
- ) {
- // If both compared fields are native numbers or both are native dates
- return a < b ? -1 : a > b ? 1 : 0
- } else {
- // Otherwise stringify the field data and use String.prototype.localeCompare
- return toString(a).localeCompare(toString(b), compareLocale, compareOptions)
- }
-
- function toString(value) {
- if (value === null || typeof value === 'undefined') {
- return ''
- } else if (value instanceof Object) {
- return Object.keys(value)
- .sort()
- .map(key => toString(value[key]))
- .join(' ')
- } else {
- return String(value)
- }
- }
- },
},
}
\ No newline at end of file
diff --git a/frontend/src/components/transactions/TransactionListLarge.vue b/frontend/src/components/transactions/TransactionListLarge.vue
index 8d169c6bf4..5162aecff4 100644
--- a/frontend/src/components/transactions/TransactionListLarge.vue
+++ b/frontend/src/components/transactions/TransactionListLarge.vue
@@ -19,84 +19,366 @@
-->
-
- {{ $t('firefly.transaction_table_description') }}
-
-
- {{ $t('firefly.description') }} |
- {{ $t('firefly.opposing_account') }} |
- {{ $t('firefly.amount') }} |
- {{ $t('firefly.category') }} |
- {{ $t('firefly.budget') }} |
-
-
-
-
-
-
- {{ transaction.attributes.group_title }}
- {{ transaction.attributes.transactions[0].description }}
-
- |
-
-
- {{ tr.destination_name }}
- {{ tr.source_name }}
- {{ tr.destination_name }}
- {{ tr.source_name }}
-
+ |
-
-
-
- {{ Intl.NumberFormat(locale, {style: 'currency', currency: tr.currency_code}).format(tr.amount * -1) }}
-
-
- {{ Intl.NumberFormat(locale, {style: 'currency', currency: tr.currency_code}).format(tr.amount) }}
-
-
- {{ Intl.NumberFormat(locale, {style: 'currency', currency: tr.currency_code}).format(tr.amount * -1) }}
-
-
- {{ Intl.NumberFormat(locale, {style: 'currency', currency: tr.currency_code}).format(tr.amount) }}
-
+
+
+
+ {{
+ data.value
+ }}
+
+
+
+ {{ Intl.NumberFormat(locale, {style: 'currency', currency: data.item.currency_code}).format(data.item.amount) }}
- |
-
-
- {{ tr.category_name }}
+
+
+ {{ Intl.NumberFormat(locale, {style: 'currency', currency: data.item.currency_code}).format(-data.item.amount) }}
- |
-
-
- {{ tr.budget_name }}
+
+
+ {{ Intl.NumberFormat(locale, {style: 'currency', currency: data.item.currency_code}).format(data.item.amount) }}
- |
-
-
-
+
+
+ {{ data.item.date_formatted }}
+
+
+ {{ data.item.source_name }}
+
+
+ {{ data.item.destination_name }}
+
+
+
+
+
+
+
+
+
+
+ {{ $t('firefly.transaction_expand_split') }}
+
+
+
+ {{ $t('firefly.transaction_collapse_split') }}
+
+
+
+ {{ data.item.category_name }}
+
+
+
+