Skip to content

Firefly III: a personal finances manager

Remove comments.

James Cole3a3ae6db0f1e
diff --git a/resources/assets/v3/js/api/model/transaction-link/post.js b/resources/assets/v3/js/api/model/transaction-link/post.js
index d3c51f0cec..82d8dcedc7 100644
--- a/resources/assets/v3/js/api/model/transaction-link/post.js
+++ b/resources/assets/v3/js/api/model/transaction-link/post.js
@@ -2,7 +2,7 @@ import { api } from "../../../boot/axios";
export default class Post {
post(linkTypeId, inwardId, outwardId, notes) {
- console.log("POST!");
+ // console.log("POST!");
let url = "/api/v1/transaction-links";
return api.post(url, {
link_type_id: parseInt(linkTypeId),
diff --git a/resources/assets/v3/js/api/model/transaction-link/put.js b/resources/assets/v3/js/api/model/transaction-link/put.js
new file mode 100644
index 0000000000..cb15b0ea68
--- /dev/null
+++ b/resources/assets/v3/js/api/model/transaction-link/put.js
@@ -0,0 +1,28 @@
+/*
+ * post.js
+ * Copyright (c) 2023 [email protected]
+ *
+ * This file is part of Firefly III (https://github.com/firefly-iii).
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import { api } from "../../../boot/axios";
+
+export default class Put {
+ put(submission, params) {
+ let url = "/api/v1/transaction-links/" + parseInt(params.id);
+ return api.put(url, submission);
+ }
+}
diff --git a/resources/assets/v3/js/boot/bootstrap.js b/resources/assets/v3/js/boot/bootstrap.js
index b8b45ef922..20c6781a84 100644
--- a/resources/assets/v3/js/boot/bootstrap.js
+++ b/resources/assets/v3/js/boot/bootstrap.js
@@ -43,7 +43,7 @@ window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
getFreshVariable("lastActivity")
.then((serverValue) => {
if (null === serverValue) {
- console.log("Server value is null in getFreshVariable.");
+ // console.log("Server value is null in getFreshVariable.");
throw new Error("401 in getFreshVariable.");
}
const localValue = store.get("lastActivity");
@@ -78,12 +78,12 @@ getFreshVariable("lastActivity")
window.__localeId__ = values.locale;
store.set("language", values.language);
store.set("locale", values.locale);
- console.log(
- "Language is " +
- values.language +
- ", locale is " +
- values.locale,
- );
+ // console.log(
+ // "Language is " +
+ // values.language +
+ // ", locale is " +
+ // values.locale,
+ // );
loadTranslations(values.locale).then(() => {
const event = new Event("firefly-iii-bootstrapped");
document.dispatchEvent(event);
@@ -141,7 +141,7 @@ getFreshVariable("lastActivity")
});
}
if (i === hints.length - 1) {
- console.log("Add complete");
+ // console.log("Add complete");
buttons.push({
text: i18next.t("firefly.intro_done_label"),
action: tour.complete,
diff --git a/resources/assets/v3/js/pages/administrations/edit.js b/resources/assets/v3/js/pages/administrations/edit.js
index 43fc8782f9..7a9181ebb6 100644
--- a/resources/assets/v3/js/pages/administrations/edit.js
+++ b/resources/assets/v3/js/pages/administrations/edit.js
@@ -133,11 +133,11 @@ const comps = {
};
function loadPage(comps) {
- console.log("loadPage");
+ // console.log("loadPage");
Object.keys(comps).forEach((comp) => {
let data = comps[comp]();
Alpine.data(comp, () => data);
- console.log(comp);
+ // console.log(comp);
});
Alpine.start();
}
diff --git a/resources/assets/v3/js/pages/administrations/index.js b/resources/assets/v3/js/pages/administrations/index.js
index 648f658a12..f025dba7b9 100644
--- a/resources/assets/v3/js/pages/administrations/index.js
+++ b/resources/assets/v3/js/pages/administrations/index.js
@@ -74,11 +74,11 @@ const comps = {
};
function loadPage(comps) {
- console.log("loadPage");
+ // console.log("loadPage");
Object.keys(comps).forEach((comp) => {
let data = comps[comp]();
Alpine.data(comp, () => data);
- console.log(comp);
+ // console.log(comp);
});
Alpine.start();
}
diff --git a/resources/assets/v3/js/pages/dashboard/dashboard.js b/resources/assets/v3/js/pages/dashboard/dashboard.js
index 9389e385d3..00979124db 100644
--- a/resources/assets/v3/js/pages/dashboard/dashboard.js
+++ b/resources/assets/v3/js/pages/dashboard/dashboard.js
@@ -49,7 +49,7 @@ let index = function () {
value,
true,
);
-
+
// drawMultiCurrencyChart(
// "stacked-column",
// "api/v1/chart/budget/overview?start=" +
diff --git a/resources/assets/v3/js/pages/exchange-rates/rates.js b/resources/assets/v3/js/pages/exchange-rates/rates.js
index 5fd09547e6..7b9b47865d 100644
--- a/resources/assets/v3/js/pages/exchange-rates/rates.js
+++ b/resources/assets/v3/js/pages/exchange-rates/rates.js
@@ -104,12 +104,12 @@ let rates = function () {
if (0 === parts.length) {
return;
}
- console.log("These are the parts", parts);
+ // console.log("These are the parts", parts);
if ("" !== this.rates[index].rate) {
//console.log('[a] Rate info is', this.rates[index]);
this.updating = true;
if (0 === parseInt(this.rates[index].rate_id)) {
- console.log("[a] POST, not PUT.");
+ // console.log("[a] POST, not PUT.");
new Post()
.post({
from: this.from_code,
@@ -122,7 +122,7 @@ let rates = function () {
});
}
if (0 !== parseInt(this.rates[index].rate_id)) {
- console.log("[a] PUT, not POST.");
+ // console.log("[a] PUT, not POST.");
new Put()
.put(
{ rate: this.rates[index].rate },
@@ -137,7 +137,7 @@ let rates = function () {
//console.log('[b] Rate info is', this.rates[index]);
this.updating = true;
if (0 === parseInt(this.rates[index].inverse_id)) {
- console.log("[b] POST, not PUT.");
+ // console.log("[b] POST, not PUT.");
// post, not put
new Post()
.post({
@@ -152,7 +152,7 @@ let rates = function () {
});
}
if (0 !== parseInt(this.rates[index].inverse_id)) {
- console.log("[b] PUT, not POST.");
+ // console.log("[b] PUT, not POST.");
new Put()
.put(
{ rate: this.rates[index].inverse },
@@ -200,7 +200,7 @@ let rates = function () {
};
},
downloadCurrencies: function () {
- console.log("Now downloading currencies.");
+ // console.log("Now downloading currencies.");
this.loading = true;
new Get().get(this.from_code).then((response) => {
this.from = {
@@ -221,13 +221,13 @@ let rates = function () {
downloadRates: function (page) {
this.tempRates = {};
this.loading = true;
- console.log("Now downloading rates.", page);
+ // console.log("Now downloading rates.", page);
new GetRate()
.get(this.from_code, this.to_code, { page: page })
.then((response) => {
for (let i in response.data.data) {
if (Object.hasOwn(response.data.data, i)) {
- console.log("Downloaded entry #" + i);
+ // console.log("Downloaded entry #" + i);
let current = response.data.data[i];
let date = new Date(current.attributes.date);
let from_code =
@@ -244,7 +244,7 @@ let rates = function () {
to_code +
"_" +
format(date, "yyyy-MM-dd");
- console.log('Key is now "' + key + '"');
+ // console.log('Key is now "' + key + '"');
// perhaps the returned rate is actually the inverse rate.
if (
@@ -263,11 +263,11 @@ let rates = function () {
rate_id = "0";
inverse = current.attributes.rate;
inverse_id = current.id;
- console.log('Key updated to "' + key + '"');
+ // console.log('Key updated to "' + key + '"');
}
if (!Object.hasOwn(this.tempRates, key)) {
- console.log("New entry stored");
+ // console.log("New entry stored");
this.tempRates[key] = {
key: key,
date: date,
@@ -305,12 +305,12 @@ let rates = function () {
this.tempRates[key].rate = rate;
this.tempRates[key].rate_id = rate_id;
}
- console.log(
- "Found exchange rate #" +
- this.tempRates[key].rate_id +
- " with inverse #" +
- this.tempRates[key].inverse_id,
- );
+ // console.log(
+ // "Found exchange rate #" +
+ // this.tempRates[key].rate_id +
+ // " with inverse #" +
+ // this.tempRates[key].inverse_id,
+ // );
}
}
this.totalPages = parseInt(
@@ -331,11 +331,11 @@ const comps = {
};
function loadPage(comps) {
- console.log("loadPage");
+ // console.log("loadPage");
Object.keys(comps).forEach((comp) => {
let data = comps[comp]();
Alpine.data(comp, () => data);
- console.log(comp);
+ // console.log(comp);
});
Alpine.start();
}
diff --git a/resources/assets/v3/js/pages/profile/oauth.js b/resources/assets/v3/js/pages/profile/oauth.js
index 6113ebb19b..ff4c8533be 100644
--- a/resources/assets/v3/js/pages/profile/oauth.js
+++ b/resources/assets/v3/js/pages/profile/oauth.js
@@ -113,9 +113,9 @@ let index = function () {
* Get all of the personal access tokens for the user.
*/
getTokens() {
- console.log("getTokens()");
+ // console.log("getTokens()");
api.get("./oauth/personal-access-tokens").then((response) => {
- console.log(response.data);
+ // console.log(response.data);
this.tokens = response.data;
});
},
@@ -124,7 +124,7 @@ let index = function () {
* Show the form for creating new tokens.
*/
showCreateTokenForm() {
- console.log("showCreateTokenForm()");
+ // console.log("showCreateTokenForm()");
new Modal(document.getElementById("modal-create-token"), {}).show();
},
@@ -132,16 +132,16 @@ let index = function () {
* Create a new personal access token.
*/
storePat() {
- console.log("storePat()");
+ // console.log("storePat()");
this.accessToken = null;
this.form.errors = [];
api.post("./oauth/personal-access-tokens", this.form)
.then((response) => {
- console.log(
- "Successful POST new token, reset form content.",
- );
+ // console.log(
+ // "Successful POST new token, reset form content.",
+ // );
this.form.name = "";
this.form.scopes = [];
this.form.errors = [];
@@ -172,7 +172,7 @@ let index = function () {
* Show the given access token to the user.
*/
showAccessToken(accessToken) {
- console.log("showAccessToken");
+ // console.log("showAccessToken");
new Modal(document.getElementById("modal-create-token"), {}).hide();
this.accessToken = accessToken;
@@ -181,7 +181,7 @@ let index = function () {
},
getClients() {
api.get("./oauth/clients").then((response) => {
- console.log(response.data);
+ // console.log(response.data);
this.clients = response.data;
});
},
@@ -216,7 +216,7 @@ let index = function () {
for (const [key, value] of Object.entries(
error.response.data.errors,
)) {
- console.log(`${key}: ${value}`);
+ // console.log(`${key}: ${value}`);
form.errors.push(value);
}
} else {
@@ -224,7 +224,7 @@ let index = function () {
"Something went wrong. Please try again.",
];
}
- console.log(form.errors);
+ //console.log(form.errors);
});
},
/**
@@ -311,11 +311,11 @@ const comps = {
};
function loadPage(comps) {
- console.log("loadPage");
+ // console.log("loadPage");
Object.keys(comps).forEach((comp) => {
let data = comps[comp]();
Alpine.data(comp, () => data);
- console.log(comp);
+ // console.log(comp);
});
Alpine.start();
}
diff --git a/resources/assets/v3/js/pages/recurring/shared/create-button-switcher.js b/resources/assets/v3/js/pages/recurring/shared/create-button-switcher.js
index 1b53e68a89..9edf1bb23f 100644
--- a/resources/assets/v3/js/pages/recurring/shared/create-button-switcher.js
+++ b/resources/assets/v3/js/pages/recurring/shared/create-button-switcher.js
@@ -25,7 +25,7 @@ function createButtonSwitcher() {
for (let i = 0; i < list.length; i++) {
list[i].addEventListener("click", (event) => {
let transactionType = event.currentTarget.dataset.value;
- console.log("Clicked value is " + transactionType);
+ // console.log("Clicked value is " + transactionType);
switchTransactionType(transactionType);
return false;
});
diff --git a/resources/assets/v3/js/pages/recurring/shared/respond-to-first-date-change.js b/resources/assets/v3/js/pages/recurring/shared/respond-to-first-date-change.js
index ac0ae2164f..ab068134cb 100644
--- a/resources/assets/v3/js/pages/recurring/shared/respond-to-first-date-change.js
+++ b/resources/assets/v3/js/pages/recurring/shared/respond-to-first-date-change.js
@@ -27,9 +27,9 @@ function parseRepetitionSuggestions(response) {
let opt;
for (var k in data) {
if (Object.hasOwn(data, k)) {
- console.log(
- "label: " + data[k].label + ", selected: " + data[k].selected,
- );
+ // console.log(
+ // "label: " + data[k].label + ", selected: " + data[k].selected,
+ // );
opt = document.createElement("option");
opt.value = k;
opt.label = data[k].label;
diff --git a/resources/assets/v3/js/pages/shared/dates.js b/resources/assets/v3/js/pages/shared/dates.js
index 373aa1637a..8a6ae9ee39 100644
--- a/resources/assets/v3/js/pages/shared/dates.js
+++ b/resources/assets/v3/js/pages/shared/dates.js
@@ -40,8 +40,8 @@ export default () => ({
},
updateDates(e) {
let split = e.originalTarget._props.value.split("/");
- console.log("Start is now " + split[0]);
- console.log("End is now " + split[1]);
+ // console.log("Start is now " + split[0]);
+ // console.log("End is now " + split[1]);
window.store.set("start", split[0]);
window.store.set("end", split[1]);
this.submitForm();
@@ -67,7 +67,7 @@ export default () => ({
init() {
if (false === window.enableDates) {
- console.log("Date selection is disabled on this page.");
+ // console.log("Date selection is disabled on this page.");
document.getElementById("date-dropdown").style.display = "none";
}
@@ -223,7 +223,7 @@ export default () => ({
},
changeDateRange(e) {
- console.log("changeDateRange");
+ // console.log("changeDateRange");
e.preventDefault();
let target = e.currentTarget;
diff --git a/resources/assets/v3/js/pages/transactions/create.js b/resources/assets/v3/js/pages/transactions/create.js
index 3002b09acd..260f563262 100644
--- a/resources/assets/v3/js/pages/transactions/create.js
+++ b/resources/assets/v3/js/pages/transactions/create.js
@@ -232,18 +232,18 @@ let create = function () {
1 === list.length &&
list[0].code === this.entries[0].source_account.currency_code
) {
- console.log(
- "Foreign currency is same as source currency. Disable foreign amount.",
- );
+ // console.log(
+ // "Foreign currency is same as source currency. Disable foreign amount.",
+ // );
this.formBehaviour.foreignCurrencyEnabled = false;
}
if (
1 === list.length &&
list[0].code !== this.entries[0].source_account.currency_code
) {
- console.log(
- "Foreign currency is NOT same as source currency. Enable foreign amount.",
- );
+ // console.log(
+ // "Foreign currency is NOT same as source currency. Enable foreign amount.",
+ // );
this.formBehaviour.foreignCurrencyEnabled = true;
}
@@ -262,7 +262,7 @@ let create = function () {
},
processUpload() {
- console.log("Now in processUpload()");
+ // console.log("Now in processUpload()");
this.formStates.storedAttachments = true;
this.showMessageOrRedirectUser();
},
@@ -310,7 +310,7 @@ let create = function () {
});
document.addEventListener("upload-success", () => {
- console.log('Now in event listener "upload-success"');
+ // console.log('Now in event listener "upload-success"');
this.processUpload();
document
.querySelectorAll("input[type=file]")
@@ -318,11 +318,11 @@ let create = function () {
});
document.addEventListener("upload-error", (event) => {
- console.log('Now in event listener "upload-error"');
+ // console.log('Now in event listener "upload-error"');
this.processUploadError(event);
});
document.addEventListener("upload-failed", (event) => {
- console.log('Now in event listener "upload-failed"');
+ // console.log('Now in event listener "upload-failed"');
this.processUploadError(event);
});
},
@@ -393,9 +393,9 @@ let create = function () {
);
}
}
- console.log("Go to process transactions", transactions);
+ // console.log("Go to process transactions", transactions);
this.processTransactionLinks(transactions);
- console.log("Done with process transactions", transactions);
+ // console.log("Done with process transactions", transactions);
// process attachments, if any:
const attachmentCount = processAttachments(
this.groupProperties.id,
@@ -429,7 +429,7 @@ let comps = { create, sidebar, dates };
function loadPage() {
Object.keys(comps).forEach((comp) => {
- console.log(`Loading page component "${comp}"`);
+ // console.log(`Loading page component "${comp}"`);
let data = comps[comp]();
Alpine.data(comp, () => data);
});
diff --git a/resources/assets/v3/js/pages/transactions/edit.js b/resources/assets/v3/js/pages/transactions/edit.js
index aa52047c40..a8192d90fe 100644
--- a/resources/assets/v3/js/pages/transactions/edit.js
+++ b/resources/assets/v3/js/pages/transactions/edit.js
@@ -479,7 +479,7 @@ let transactions = function () {
this.showMessageOrRedirectUser();
})
.catch((error) => {
- console.log(error);
+ console.error(error);
this.formStates.isSubmitting = false;
if (typeof error.response !== "undefined") {
this.parseErrors(error.response.data);
@@ -500,7 +500,7 @@ let comps = { transactions, sidebar, dates };
function loadPage() {
Object.keys(comps).forEach((comp) => {
- console.log(`Loading page component "${comp}"`);
+ // console.log(`Loading page component "${comp}"`);
let data = comps[comp]();
Alpine.data(comp, () => data);
});
diff --git a/resources/assets/v3/js/pages/transactions/shared/auto-step.js b/resources/assets/v3/js/pages/transactions/shared/auto-step.js
index ae5e4f2eef..3614deb6c7 100644
--- a/resources/assets/v3/js/pages/transactions/shared/auto-step.js
+++ b/resources/assets/v3/js/pages/transactions/shared/auto-step.js
@@ -32,7 +32,7 @@ export function autoStep() {
) {
this.formStates.loadingLinks = true;
loadLinkTypes().then((data) => {
- console.log("done loadLinkTypes()");
+ // console.log("done loadLinkTypes()");
for (let i = 0; i < data.length; i++) {
if (Object.hasOwn(data, i)) {
let current = data[i];
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.js
index 5046c72b6b..2760a725ce 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
@@ -36,15 +36,15 @@ export function detectTransactionType() {
["Asset account", "Loan", "Debt", "Mortgage"].includes(sourceType)
) {
this.groupProperties.transactionType = "transfer";
- console.log(
- 'Transaction type is detected to be "' +
- this.groupProperties.transactionType +
- '".',
- );
+ // console.log(
+ // 'Transaction type is detected to be "' +
+ // this.groupProperties.transactionType +
+ // '".',
+ // );
// 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.");
+ // console.log("filter down currencies for transfer.");
this.determineAmountCurrency(
this.entries[0].source_account.currency_code,
);
@@ -60,11 +60,11 @@ export function detectTransactionType() {
["Expense account", "Debt", "Loan", "Mortgage"].includes(destType)
) {
this.groupProperties.transactionType = "withdrawal";
- console.log(
- '[a] Transaction type is detected to be "' +
- this.groupProperties.transactionType +
- '".',
- );
+ // console.log(
+ // '[a] Transaction type is detected to be "' +
+ // this.groupProperties.transactionType +
+ // '".',
+ // );
this.determineAmountCurrency(
this.entries[0].source_account.currency_code,
);
@@ -73,11 +73,11 @@ export function detectTransactionType() {
}
if ("Asset account" === sourceType && "unknown" === destType) {
this.groupProperties.transactionType = "withdrawal";
- console.log(
- '[b] Transaction type is detected to be "' +
- this.groupProperties.transactionType +
- '".',
- );
+ // console.log(
+ // '[b] Transaction type is detected to be "' +
+ // this.groupProperties.transactionType +
+ // '".',
+ // );
this.determineAmountCurrency(
this.entries[0].source_account.currency_code,
);
@@ -89,11 +89,11 @@ export function detectTransactionType() {
"Expense account" === destType
) {
this.groupProperties.transactionType = "withdrawal";
- console.log(
- '[c] Transaction type is detected to be "' +
- this.groupProperties.transactionType +
- '".',
- );
+ // console.log(
+ // '[c] Transaction type is detected to be "' +
+ // this.groupProperties.transactionType +
+ // '".',
+ // );
this.determineAmountCurrency(
this.entries[0].source_account.currency_code,
);
@@ -107,11 +107,11 @@ export function detectTransactionType() {
["Asset account", "Debt", "Loan", "Mortgage"].includes(destType)
) {
this.groupProperties.transactionType = "deposit";
- console.log(
- 'Transaction type is detected to be "' +
- this.groupProperties.transactionType +
- '".',
- );
+ // console.log(
+ // 'Transaction type is detected to be "' +
+ // this.groupProperties.transactionType +
+ // '".',
+ // );
this.disableSplitAccounts();
this.determineAmountCurrency(
this.entries[0].destination_account.currency_code,
@@ -123,11 +123,11 @@ export function detectTransactionType() {
["Asset account", "Debt", "Loan", "Mortgage"].includes(destType)
) {
this.groupProperties.transactionType = "deposit";
- console.log(
- 'Transaction type is detected to be "' +
- this.groupProperties.transactionType +
- '".',
- );
+ // console.log(
+ // 'Transaction type is detected to be "' +
+ // this.groupProperties.transactionType +
+ // '".',
+ // );
this.determineAmountCurrency(
this.entries[0].destination_account.currency_code,
);
@@ -156,11 +156,11 @@ export function detectTransactionType() {
"Asset account" === destType
) {
this.groupProperties.transactionType = "deposit";
- console.log(
- 'Transaction type is detected to be "' +
- this.groupProperties.transactionType +
- '".',
- );
+ // console.log(
+ // 'Transaction type is detected to be "' +
+ // this.groupProperties.transactionType +
+ // '".',
+ // );
this.determineAmountCurrency(
this.entries[0].destination_account.currency_code,
);
diff --git a/resources/assets/v3/js/pages/transactions/shared/load-transaction-links.js b/resources/assets/v3/js/pages/transactions/shared/load-transaction-links.js
index 70e5b21f83..4e0690ce05 100644
--- a/resources/assets/v3/js/pages/transactions/shared/load-transaction-links.js
+++ b/resources/assets/v3/js/pages/transactions/shared/load-transaction-links.js
@@ -1,22 +1,22 @@
import Get from "../../../api/model/transaction/get.js";
export function loadTransactionLinks(index, journalId) {
- console.log(
- "Get transaction links for index #" +
- index +
- " and journal #" +
- journalId,
- );
+ // console.log(
+ // "Get transaction links for index #" +
+ // index +
+ // " and journal #" +
+ // journalId,
+ // );
new Get().transactionLinks(journalId).then((data) => {
let links = data.data.data;
+ // console.log('Get link info for links.');
for (let i = 0; i < links.length; i++) {
if (Object.hasOwn(links, i)) {
let current = links[i];
- let direction =
- parseInt(journalId) ===
- parseInt(current.attributes.inward_id)
- ? "inward"
- : "outward";
+ // console.log('Get link info for link #' + current.id);
+ let direction = parseInt(journalId) === parseInt(current.attributes.inward_id)
+ ? "outward"
+ : "inward";
let otherJournal = parseInt(current.attributes.inward_id);
if (
parseInt(journalId) ===
@@ -44,7 +44,7 @@ export function loadTransactionLinks(index, journalId) {
}
if (null !== foundJournal) {
//console.log('Found other journal ', parseInt(foundJournal.transaction_journal_id));
- console.log("Current link is", parseInt(current.id));
+ // console.log("Current link is, found opposing. ", parseInt(current.id));
this.links[index].push({
id: parseInt(current.id),
link_type:
@@ -72,5 +72,6 @@ export function loadTransactionLinks(index, journalId) {
});
}
}
+ // console.log('Done, link list is now', this.links);
});
}
diff --git a/resources/assets/v3/js/pages/transactions/shared/parse-from-entries.js b/resources/assets/v3/js/pages/transactions/shared/parse-from-entries.js
index b2fe53934e..ab80c45dc9 100644
--- a/resources/assets/v3/js/pages/transactions/shared/parse-from-entries.js
+++ b/resources/assets/v3/js/pages/transactions/shared/parse-from-entries.js
@@ -91,20 +91,20 @@ export function parseFromEntries(entries, originals, transactionType) {
"" !== entry.foreign_currency_code.toString()
) {
current.foreign_currency_code = entry.foreign_currency_code;
- console.log(
- "There is a foreign currency code set, ",
- current.foreign_currency_code,
- );
+ // console.log(
+ // "There is a foreign currency code set, ",
+ // current.foreign_currency_code,
+ // );
if (
typeof entry.foreign_amount !== "undefined" &&
"" !== entry.foreign_amount.toString() &&
0.0 !== entry.foreign_amount
) {
current.foreign_amount = entry.foreign_amount;
- console.log(
- "There is also a foreign amount set, ",
- current.foreign_amount,
- );
+ // console.log(
+ // "There is also a foreign amount set, ",
+ // current.foreign_amount,
+ // );
}
}
if (
@@ -146,7 +146,7 @@ export function parseFromEntries(entries, originals, transactionType) {
current.destination_id = returnArray[0].destination_id;
current.destination_name = returnArray[0].destination_name;
}
- console.log("Overrule depending on ", transactionType);
+ // console.log("Overrule depending on ", transactionType);
}
current.type = transactionType;
diff --git a/resources/assets/v3/js/pages/transactions/shared/process-transaction-links.js b/resources/assets/v3/js/pages/transactions/shared/process-transaction-links.js
index 3bf4494f12..5187c32987 100644
--- a/resources/assets/v3/js/pages/transactions/shared/process-transaction-links.js
+++ b/resources/assets/v3/js/pages/transactions/shared/process-transaction-links.js
@@ -1,4 +1,5 @@
import PostLink from "../../../api/model/transaction-link/post.js";
+import PutLink from "../../../api/model/transaction-link/put.js";
export function processTransactionLinks(transactions) {
let count = 0;
@@ -9,30 +10,41 @@ export function processTransactionLinks(transactions) {
if (Object.hasOwn(this.links[i], j)) {
count++;
let link = this.links[i][j];
- let left = journalId;
- let right = parseInt(link.journal_id);
- console.log(
- "Left is now" +
- left +
- " and right is now " +
- right +
- " and existing ID is " +
- link.id,
- );
+ let inwardId = journalId;
+ let outwardId = parseInt(link.journal_id);
+ // console.log(
+ // "Inward ID is now" + inwardId + " and outward ID is now " + outwardId + " and existing ID is " + link.id,
+ // );
if ("inward" === link.link_type_direction) {
- left = parseInt(link.journal_id);
- right = journalId;
- console.log(
- "Switched because inward: left is now" +
- left +
- " and right is now " +
- right,
- );
+ inwardId = parseInt(link.journal_id);
+ outwardId = journalId;
+ // console.log(
+ // "Switched because inward: inward ID is now" +
+ // inwardId +
+ // " and outward ID is now " +
+ // outwardId,
+ // );
}
if (0 === link.id) {
+ // console.log('Link.id = ' + link.id + ' so we will create a new link with inwardId = ' + inwardId + ' and outwardId = ' + outwardId);
new PostLink()
- .post(link.link_type_id, left, right, null)
+ .post(link.link_type_id, inwardId, outwardId, null)
+ .then(() => {
+ this.redirectAfterTransactionLinks(i, j);
+ })
+ .catch(function (e) {
+ console.error(e);
+ });
+ }
+ if (link.id > 0) {
+ // console.log('Link.id = ' + link.id + ' so we will PUT link ' + link.id + ' with inwardId = ' + inwardId + ' and outwardId = ' + outwardId);
+ new PutLink()
+ .put({
+ 'link_type_id': link.link_type_id,
+ 'inward_id': inwardId,
+ 'outward_id': outwardId,
+ }, {id: link.id}, null)
.then(() => {
this.redirectAfterTransactionLinks(i, j);
})
diff --git a/resources/assets/v3/js/pages/transactions/shared/process-upload-error.js b/resources/assets/v3/js/pages/transactions/shared/process-upload-error.js
index 6bd98df9f5..a6072fc79f 100644
--- a/resources/assets/v3/js/pages/transactions/shared/process-upload-error.js
+++ b/resources/assets/v3/js/pages/transactions/shared/process-upload-error.js
@@ -26,7 +26,7 @@ export function processUploadError(event) {
this.notifications.error.show = true;
this.formStates.isSubmitting = false;
this.notifications.error.text = this.i18next.t("firefly.errors_upload");
- console.log(event.detail.error.response.status);
+ // console.error(event.detail.error.response.status);
if (413 === event.detail.error.response.status) {
this.notifications.error.text = this.i18next.t(
"firefly.upload_too_large",
diff --git a/resources/assets/v3/js/pages/transactions/shared/render-map.js b/resources/assets/v3/js/pages/transactions/shared/render-map.js
index 29bf6e4ddf..a31b9435be 100644
--- a/resources/assets/v3/js/pages/transactions/shared/render-map.js
+++ b/resources/assets/v3/js/pages/transactions/shared/render-map.js
@@ -29,7 +29,7 @@ export function renderMap(index, useDefault) {
let longitude = parseFloat(this.formBehaviour.defaultCoordinates.longitude);
let zoomLevel = parseInt(this.formBehaviour.defaultCoordinates.zoom_level);
if (!useDefault) {
- console.log("Using coordinates from data attributes");
+ // console.log("Using coordinates from data attributes");
latitude = parseFloat(el.dataset.latitude);
longitude = parseFloat(el.dataset.longitude);
zoomLevel = parseInt(el.dataset.zoomLevel);
diff --git a/resources/assets/v3/js/pages/transactions/shared/respond-to-tab-switch.js b/resources/assets/v3/js/pages/transactions/shared/respond-to-tab-switch.js
index a043d193b4..dde31041e5 100644
--- a/resources/assets/v3/js/pages/transactions/shared/respond-to-tab-switch.js
+++ b/resources/assets/v3/js/pages/transactions/shared/respond-to-tab-switch.js
@@ -22,7 +22,7 @@ export function respondToTabSwitch(event) {
// event.target // newly activated tab
// event.relatedTarget // previous active tab
let index = parseInt(event.currentTarget.dataset.index);
- console.log(this);
+ // console.log(this);
if (Object.hasOwn(this.maps, index)) {
this.maps[index].invalidateSize();
}
diff --git a/resources/assets/v3/js/pages/transactions/shared/save-new-link.js b/resources/assets/v3/js/pages/transactions/shared/save-new-link.js
index 53308fdbf4..c1fb4f9e5b 100644
--- a/resources/assets/v3/js/pages/transactions/shared/save-new-link.js
+++ b/resources/assets/v3/js/pages/transactions/shared/save-new-link.js
@@ -40,17 +40,17 @@ export function saveNewLink(e) {
}
// add entry to temporary table.
- console.log(
- "Link " +
- linkType +
- ' ("' +
- linkLabel +
- '") to transaction #' +
- hiddenField.value +
- '("' +
- searchBox.value +
- '")',
- );
+ // console.log(
+ // "Link " +
+ // linkType +
+ // ' ("' +
+ // linkLabel +
+ // '") to transaction #' +
+ // hiddenField.value +
+ // '("' +
+ // searchBox.value +
+ // '")',
+ // );
this.links[index].push({
id: 0,
diff --git a/resources/assets/v3/js/pages/transactions/shared/splice-errors-into-transactions.js b/resources/assets/v3/js/pages/transactions/shared/splice-errors-into-transactions.js
index 97ae949990..e78448ba2e 100644
--- a/resources/assets/v3/js/pages/transactions/shared/splice-errors-into-transactions.js
+++ b/resources/assets/v3/js/pages/transactions/shared/splice-errors-into-transactions.js
@@ -132,7 +132,7 @@ export function spliceErrorsIntoTransactions(errors, transactions) {
}
}
}
- console.log(transactions[0].errors);
+ // console.log(transactions[0].errors);
return transactions;
}
diff --git a/resources/assets/v3/js/pages/transactions/shared/switch-link.js b/resources/assets/v3/js/pages/transactions/shared/switch-link.js
index 232c1a3d63..a47abd32ee 100644
--- a/resources/assets/v3/js/pages/transactions/shared/switch-link.js
+++ b/resources/assets/v3/js/pages/transactions/shared/switch-link.js
@@ -32,7 +32,7 @@ export function switchLink(e) {
linkTypeDirection = "inward" === linkTypeDirection ? "outward" : "inward";
if (typeof linkType === "undefined") {
console.error("Link type not found for id " + linkTypeId);
- console.log(this.formData.linkTypes);
+ // console.log(this.formData.linkTypes);
return;
}
this.links[index][rowIndex].link_type =
diff --git a/resources/assets/v3/js/pages/webhooks/create.js b/resources/assets/v3/js/pages/webhooks/create.js
index fe9094c5eb..f8d72ad396 100644
--- a/resources/assets/v3/js/pages/webhooks/create.js
+++ b/resources/assets/v3/js/pages/webhooks/create.js
@@ -91,7 +91,7 @@ let create = function () {
this.options.deliveries = result;
this.form.deliveries.loading = false;
});
- console.log("Create webhook page.");
+ // console.log("Create webhook page.");
},
submit: function (e) {
@@ -153,7 +153,7 @@ let create = function () {
}
}
- console.log(this.errors);
+ // console.log(this.errors);
// enable button again
document.getElementById("submitButton").disabled = false;
@@ -172,11 +172,11 @@ const comps = {
};
function loadPage(comps) {
- console.log("loadPage");
+ // console.log("loadPage");
Object.keys(comps).forEach((comp) => {
let data = comps[comp]();
Alpine.data(comp, () => data);
- console.log(comp);
+ // console.log(comp);
});
Alpine.start();
}
diff --git a/resources/assets/v3/js/pages/webhooks/edit.js b/resources/assets/v3/js/pages/webhooks/edit.js
index ee0acdcae0..7d6dbeb00d 100644
--- a/resources/assets/v3/js/pages/webhooks/edit.js
+++ b/resources/assets/v3/js/pages/webhooks/edit.js
@@ -170,11 +170,11 @@ const comps = {
};
function loadPage(comps) {
- console.log("loadPage");
+ // console.log("loadPage");
Object.keys(comps).forEach((comp) => {
let data = comps[comp]();
Alpine.data(comp, () => data);
- console.log(comp);
+ // console.log(comp);
});
Alpine.start();
}
diff --git a/resources/assets/v3/js/pages/webhooks/index.js b/resources/assets/v3/js/pages/webhooks/index.js
index bb9feec7ec..a038a41015 100644
--- a/resources/assets/v3/js/pages/webhooks/index.js
+++ b/resources/assets/v3/js/pages/webhooks/index.js
@@ -144,11 +144,11 @@ const comps = {
};
function loadPage(comps) {
- console.log("loadPage");
+ // console.log("loadPage");
Object.keys(comps).forEach((comp) => {
let data = comps[comp]();
Alpine.data(comp, () => data);
- console.log(comp);
+ // console.log(comp);
});
Alpine.start();
}
diff --git a/resources/assets/v3/js/pages/webhooks/shared/load-triggers.js b/resources/assets/v3/js/pages/webhooks/shared/load-triggers.js
index 1d1f06e1e7..a8032c7c1e 100644
--- a/resources/assets/v3/js/pages/webhooks/shared/load-triggers.js
+++ b/resources/assets/v3/js/pages/webhooks/shared/load-triggers.js
@@ -38,7 +38,7 @@ export function loadTriggers() {
return result;
})
.catch((error) => {
- console.log(error);
+ console.error(error);
return result;
});
}
diff --git a/resources/assets/v3/js/pages/webhooks/show.js b/resources/assets/v3/js/pages/webhooks/show.js
index 3cae4c8209..347465fd28 100644
--- a/resources/assets/v3/js/pages/webhooks/show.js
+++ b/resources/assets/v3/js/pages/webhooks/show.js
@@ -146,7 +146,7 @@ let show = function () {
});
},
showWebhookAttempts: function (id) {
- console.log("showWebhookAttempts", id);
+ // console.log("showWebhookAttempts", id);
this.message_attempts = [];
new Get().attempts(this.id, id, {}).then((response) => {
for (let i in response.data.data) {
@@ -176,7 +176,7 @@ const comps = {
};
function loadPage(comps) {
- console.log("loadPage");
+ // console.log("loadPage");
Object.keys(comps).forEach((comp) => {
let data = comps[comp]();
Alpine.data(comp, () => data);
diff --git a/resources/assets/v3/js/shared/draw-chart.js b/resources/assets/v3/js/shared/draw-chart.js
index 5f6bb2efd6..b8234921f7 100644
--- a/resources/assets/v3/js/shared/draw-chart.js
+++ b/resources/assets/v3/js/shared/draw-chart.js
@@ -122,7 +122,7 @@ function drawMultiCurrencyStackedColumnChart(url, holder, anonymous) {
// add the data to the dataset.
// add spent and left to the dataset, if they exist.
- console.log('current', current);
+ // console.log('current', current);
if(parseFloat(current.entries.spent) * -1 < parseFloat(current.entries.budgeted)) {
let key = 'budgeted' + current.currency_code;
datasets[key].data.push(0);
@@ -170,8 +170,8 @@ function drawMultiCurrencyStackedColumnChart(url, holder, anonymous) {
// datasets[key].data.push(value);
// }
// }
- console.log('All generatred datasets.')
- console.log(datasets);
+ // console.log('All generatred datasets.')
+ // console.log(datasets);
// add it to the dataset collection.
//data.datasets.push(dataset);
data.datasets = Object.values(datasets);
@@ -203,8 +203,8 @@ function drawMultiCurrencyStackedColumnChart(url, holder, anonymous) {
// options.scales.y.stacked = true;
// add the new axes.
options.scales = {...options.scales, ...axes};
- console.log(options);
- console.log(data);
+ // console.log(options);
+ // console.log(data);
// add a callback for the label.
options.plugins.tooltip.callbacks.label = function (tooltipItem) {
diff --git a/resources/assets/v3/js/store/get-variable.js b/resources/assets/v3/js/store/get-variable.js
index 9714228ab6..33878b4be1 100644
--- a/resources/assets/v3/js/store/get-variable.js
+++ b/resources/assets/v3/js/store/get-variable.js
@@ -28,13 +28,13 @@ export function getVariable(name, defaultValue = null) {
// to make things available quicker than if the store has to grab it through the API.
// then again, it's not that slow.
if (validCache && Object.hasOwn(window, name)) {
- console.log('Returning "' + name + '" from window: ' + window[name]);
+ console.log('Returning "' + name + '" from window with value: ', window[name]);
return Promise.resolve(window[name]);
}
// load from store2, if it's present.
const fromStore = window.store.get(name);
if (validCache && typeof fromStore !== "undefined") {
- console.log('Returning "' + name + '" from store: ' + fromStore);
+ console.log('Returning "' + name + '" from store with value: ', fromStore);
return Promise.resolve(fromStore);
}
let getter = new Get();
@@ -45,7 +45,7 @@ export function getVariable(name, defaultValue = null) {
console.log(
'Returning "' +
name +
- '" from server: ' +
+ '" from server with value: ',
parseResponse(name, response),
);
return Promise.resolve(parseResponse(name, response));
@@ -63,7 +63,7 @@ export function getVariable(name, defaultValue = null) {
console.log(
'Returning "' +
name +
- '" from POST: ' +
+ '" from POST with value: ',
parseResponse(name, response),
);
return Promise.resolve(parseResponse(name, response));
diff --git a/resources/assets/v3/js/support/load-translations.js b/resources/assets/v3/js/support/load-translations.js
index 4d52f20444..44cab874c0 100644
--- a/resources/assets/v3/js/support/load-translations.js
+++ b/resources/assets/v3/js/support/load-translations.js
@@ -28,7 +28,7 @@ let loaded = false;
function loadTranslations(locale) {
// console.log('loadTranslations(' + locale + ')');
if (false === loaded) {
- console.log("Not yet loaded");
+ // console.log("Not yet loaded");
const replacedLocale = locale.replace("-", "_");
loaded = true;
const expireTime =
diff --git a/resources/assets/v3/js/util/format.js b/resources/assets/v3/js/util/format.js
index 4c916a0220..b72b6733ec 100644
--- a/resources/assets/v3/js/util/format.js
+++ b/resources/assets/v3/js/util/format.js
@@ -93,7 +93,7 @@ const locales = {
// it will format dates in whichever way is appropriate to the locale
export default function (date, formatStr = "PP") {
let locale = window.__localeId__.replace("_", "");
- console.log("Locale is " + locale);
+ // console.log("Locale is " + locale);
return format(date, formatStr, {
locale:
locales[locale] ?? locales[locale.slice(0, 2)] ?? locales["enUS"], // or global.__localeId__
diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php
index ddb70b13a1..5c9f7e0ea9 100644
--- a/resources/views/index.blade.php
+++ b/resources/views/index.blade.php
@@ -32,9 +32,11 @@
</div>
</div>
<div class="card-body">
+ <!--
<div>
<canvas id="budgets-chart" class="wide-chart" height="400" width="100%"></canvas>
</div>
+ -->
<div>
<canvas id="budgets-two-chart" class="wide-chart" height="400" width="100%"></canvas>
</div>