Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix various QoL things.
James Cole262443205058
diff --git a/resources/assets/v3/js/pages/transactions/shared/add-autocomplete.js b/resources/assets/v3/js/pages/transactions/shared/add-autocomplete.jsindex fa1b90da6e..3d801c68c8 100644--- a/resources/assets/v3/js/pages/transactions/shared/add-autocomplete.js+++ b/resources/assets/v3/js/pages/transactions/shared/add-autocomplete.js@@ -63,6 +63,7 @@ export function addAllAutocompleteToForm() {filters.destination = [this.entries[0].source_account.type];}}+ console.log("Filters for autocomplete: ", filters);const urls = getUrls();setTimeout(() => {diff --git a/resources/assets/v3/js/pages/transactions/shared/detect-transaction-type.js b/resources/assets/v3/js/pages/transactions/shared/detect-transaction-type.jsindex 54852deca1..5c3d2323d9 100644--- a/resources/assets/v3/js/pages/transactions/shared/detect-transaction-type.js+++ b/resources/assets/v3/js/pages/transactions/shared/detect-transaction-type.js@@ -37,6 +37,9 @@ export function detectTransactionType() {// this also locks the amount into the amount of the source account// and the foreign amount (if different) in that of the destination account.console.log("filter down currencies for transfer:");+++this.determineAmountCurrency(this.entries[0].source_account.account_currency_code);this.filterForeignCurrencies(this.entries[0].destination_account.account_currency_code);this.disableSplitInputs();diff --git a/resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.js b/resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.jsindex 0795a68d66..efde69db9b 100644--- a/resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.js+++ b/resources/assets/v3/js/pages/transactions/shared/disable-split-inputs.js@@ -19,28 +19,62 @@*/// what happens when a user adds more than one split?+import Autocomplete from "bootstrap5-autocomplete";+export function disableSplitInputs() {- //console.log('Call disableSplitInputs');- if (this.entries.length > 1) {- //console.log('Activate disableSplitInputs');- // disable source and/or destination, based on account type.- for (let i = 1; i < this.entries.length; i++) {+ let isTransferOrWithdrawal = "transfer" === this.groupProperties.transactionType || "withdrawal" === this.groupProperties.transactionType;+ let isTransferOrDeposit = "transfer" === this.groupProperties.transactionType || "deposit" === this.groupProperties.transactionType;+ //console.log('Activate disableSplitInputs');+ // disable source and/or destination, based on account type.+ for (let i = 0; i < this.entries.length; i++) {+ // is withdrawal? limit destination types to expense, loan debt mortgage+ if("withdrawal" === this.groupProperties.transactionType) {+ const el = document.getElementById("dest_" + i);+ const inst = Autocomplete.getInstance(el);+ if(null !== inst) {+ let params = inst.getConfig('serverParams');+ params.types = ["Expense account", "Loan", "Debt", "Mortgage"];+ inst.setConfig('serverParams', params);+ }+ }+ // is deposit? limit destination types.+ if("deposit" === this.groupProperties.transactionType) {+ const el = document.getElementById("dest_" + i);+ const inst = Autocomplete.getInstance(el);+ if(null !== inst) {+ let params = inst.getConfig('serverParams');+ params.types = ["Asset account", "Loan", "Debt", "Mortgage"];+ inst.setConfig('serverParams', params);+ }+ }+ // is transfer? No limit to source types.+ if("deposit" !== this.groupProperties.transactionType && "withdrawal" === this.groupProperties.transactionType) {+ const el = document.getElementById("dest_" + i);+ const inst = Autocomplete.getInstance(el);+ if(null !== inst) {+ let params = inst.getConfig('serverParams');+ params.types = [];+ inst.setConfig('serverParams', params);+ }+ }++ if (i > 0) {// disable datesthis.entries[i].date_disabled = true;+ // if is withdrawal, pre-fill the destination account with the first entry's destination account.+ if ("withdrawal" === this.groupProperties.transactionType) {+ this.entries[i].destination_account = this.entries[i-1].destination_account;+ }+// disable source when withdrawal or transfer- if (- "transfer" === this.groupProperties.transactionType ||- "withdrawal" === this.groupProperties.transactionType- ) {+ if (isTransferOrWithdrawal) {this.entries[i].source_account.disabled = true;// console.log('Disable source account #' + i + 1);}+// disable destination when deposit or transfer- if (- "transfer" === this.groupProperties.transactionType ||- "deposit" === this.groupProperties.transactionType- ) {+ if (isTransferOrDeposit) {this.entries[i].destination_account.disabled = true;// console.log('Disable destination account #' + i + 1);}diff --git a/resources/assets/v3/js/shared/draw-chart.js b/resources/assets/v3/js/shared/draw-chart.jsindex e47296d11f..2b90ebf546 100644--- a/resources/assets/v3/js/shared/draw-chart.js+++ b/resources/assets/v3/js/shared/draw-chart.js@@ -553,23 +553,42 @@ function drawSingleCurrencyLineChart(url, holder, anonymous) {});}+const colors = [+ [18, 124, 175], // bg-sky, 0+ [179, 71, 190], // fuchsia, 1+ [18, 130, 125], // bg-teal, 2+ [165, 103, 16], // bg-amber, 3+ [95, 127, 15], // bg-olive, 4+ [200, 78, 16], // bg-orange, 5+ [111, 96, 234], // indigo, 6+ [205, 56, 141], // bg-pink, 7+];+function colorizeAllData(data) {+ let transparency = 0.8;for (let i in data.datasets) {if (Object.hasOwn(data.datasets, i)) {+ let index = i % colors.length;if (data.datasets[i].label.startsWith("budgeted")) {- // data.datasets[i].backgroundColor = 'rgba(13, 110, 253, 0.8)'; // bg-primary- data.datasets[i].backgroundColor = "rgba(18, 124, 175, 0.8)"; // bg-sky+ index = 0;+ transparency =0.5;}if (data.datasets[i].label.startsWith("overspent")) {- data.datasets[i].backgroundColor = "rgba(200, 78, 16, 0.6)"; // bg-orange+ index = 5;+ transparency =0.5;}if (data.datasets[i].label.startsWith("spent")) {- data.datasets[i].backgroundColor = "rgba(200, 78, 16, 0.6)"; // bg-orange+ index = 5;+ transparency =0.5;}if (data.datasets[i].label.startsWith("left")) {- // data.datasets[i].backgroundColor = 'rgba(20, 107, 66, 0.8)'; // bg-success- data.datasets[i].backgroundColor = "rgba(18, 130, 125, 0.8)"; // bg-teal+ index = 2;+ transparency =0.5;}+ let color = colors[index];+ // grab color from colors, use modulo to make sure we don't go out of bounds.+ data.datasets[i].backgroundColor = "rgba(" + color.join(",") + ", " + transparency + ")";+ data.datasets[i].borderColor = "rgba(" + color.join(",") + ", 1)";}}return data;diff --git a/resources/views/components/lists/groups-large.blade.php b/resources/views/components/lists/groups-large.blade.phpindex 97ec54044c..e924805e74 100644--- a/resources/views/components/lists/groups-large.blade.php+++ b/resources/views/components/lists/groups-large.blade.php@@ -1,4 +1,4 @@-<table class="table table-valign-middle table-sm">+<table class="table table-valign-middle table-sm table-hover"><thead><tr>@if($showCategory || $showBudget)