Expand v2 layout with experimental view.

This commit is contained in:
James Cole 2024-01-07 12:51:42 +01:00
parent 70b60f756b
commit 75a32b2f94
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
66 changed files with 770 additions and 134 deletions

View File

@ -63,6 +63,9 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
* @method static Builder|Location whereUpdatedAt($value)
* @method static Builder|Location whereZoomLevel($value)
*
* @property Collection<int, \FireflyIII\Models\TransactionJournal> $transactionJournals
* @property null|int $transaction_journals_count
*
* @mixin Eloquent
*/
class Location extends Model

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{f as n}from"./vendor-fca45885.js";function e(){return{id:"",name:"",alpine_name:""}}function o(){return{description:[],amount:[],currency_code:[],foreign_amount:[],foreign_currency_code:[],source_account:[],destination_account:[],budget_id:[],category_name:[],piggy_bank_id:[],bill_id:[],tags:[],notes:[],internal_reference:[],external_url:[],latitude:[],longitude:[],zoom_level:[],date:[],interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[]}}function d(){let t=n(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",currency_code:"EUR",foreign_amount:"",foreign_currency_code:"",source_account:e(),destination_account:e(),budget_id:null,category_name:"",piggy_bank_id:null,bill_id:null,tags:[],notes:"",internal_reference:"",external_url:"",hasLocation:!1,latitude:null,longitude:null,zoomLevel:null,date:t,interest_date:"",book_date:"",process_date:"",due_date:"",payment_date:"",invoice_date:"",errors:o()}}export{d as c,o as d};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{a as s}from"./format-money-e259f5e4.js";class p{list(a){return s.get("/api/v2/transactions",{params:a})}show(a,t){return s.get("/api/v2/transactions/"+a,{params:t})}}export{p as G};

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{a as s}from"./get-51a7c3ed.js";class p{list(a){return s.get("/api/v2/transactions",{params:a})}show(a,t){return s.get("/api/v2/transactions/"+a,{params:t})}}export{p as G};

View File

@ -0,0 +1 @@
import{a as s}from"./format-money-e259f5e4.js";let t=class{list(a){return s.get("/api/v2/subscriptions",{params:a})}paid(a){return s.get("/api/v2/subscriptions/sum/paid",{params:a})}unpaid(a){return s.get("/api/v2/subscriptions/sum/unpaid",{params:a})}};class e{list(a){return s.get("/api/v2/piggy-banks",{params:a})}}export{t as G,e as a};

View File

@ -0,0 +1 @@
import{c as r}from"./create-empty-split-fb5bda92.js";import{f as o}from"./vendor-fca45885.js";function c(n){let a=[];for(let i in n)if(n.hasOwnProperty(i)){let e=n[i],t=r();t.bill_id=e.bill_id,t.budget_id=e.budget_id,t.category_name=e.category_name,t.piggy_bank_id=e.piggy_bank_id,t.book_date=e.book_date,t.due_date=e.due_date,t.interest_date=e.interest_date,t.invoice_date=e.invoice_date,t.payment_date=e.payment_date,t.process_date=e.process_date,t.external_url=e.external_url,t.internal_reference=e.internal_reference,t.notes=e.notes,t.tags=e.tags,t.amount=parseFloat(e.amount).toFixed(e.currency_decimal_places),t.currency_code=e.currency_code,e.foreign_amount!==null&&(t.forein_currency_code=e.foreign_currency_code,t.foreign_amount=parseFloat(e.foreign_amount).toFixed(e.foreign_currency_decimal_places)),t.date=o(new Date(e.date),"yyyy-MM-dd HH:mm"),t.description=e.description,t.destination_account={id:e.destination_id,name:e.destination_name,type:e.destination_type,alpine_name:e.destination_name},t.source_account={id:e.source_id,name:e.source_name,type:e.source_type,alpine_name:e.source_name},e.latitude!==null&&(t.hasLocation=!0,t.latitude=e.latitude,t.longitude=e.longitude,t.zoomLevel=e.zoom_level),a.push(t)}return a}export{c as p};

View File

@ -0,0 +1 @@
import{d as p,f as u}from"./format-money-e259f5e4.js";import{f as h,i as r}from"./vendor-fca45885.js";import{G as c}from"./get-3bb14de5.js";import{p as d}from"./parse-downloaded-splits-7d781ebe.js";import"./create-empty-split-fb5bda92.js";let l=function(){return{notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},groupProperties:{id:0,transactionType:"",transactionTypeTranslated:"",title:"",totalAmount:0,date:new Date},amounts:{},entries:[],pageProperties:{},formatMoney(e,o){return u(e,o)},format(e){return h(e,r.t("config.date_time_fns"))},init(){this.notifications.wait.show=!0,this.notifications.wait.text=r.t("firefly.wait_loading_data");const e=window.location.href.split("/"),o=parseInt(e[e.length-1]);new c().show(o,{}).then(t=>{const i=t.data.data;this.groupProperties.id=parseInt(i.id),this.groupProperties.transactionType=i.attributes.transactions[0].type,this.groupProperties.transactionTypeTranslated=r.t("firefly."+i.attributes.transactions[0].type),this.groupProperties.title=i.attributes.title??i.attributes.transactions[0].description,this.groupProperties.totalAmount=0,this.entries=d(i.attributes.transactions),this.notifications.wait.show=!1}).then(()=>{for(let t in this.entries)if(this.entries.hasOwnProperty(t)){const i=this.entries[t].currency_code,s=this.entries[t].foreign_currency_code;this.amounts[i]===void 0&&(this.amounts[i]=0,this.amounts[i]+=parseFloat(this.entries[t].amount)),s!==null&&s!==""&&this.amounts[s]===void 0&&(this.amounts[s]=0,this.amounts[s]+=parseFloat(this.entries[t].foreign_amount)),this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[t].amount),parseInt(t)===0&&(this.groupProperties.date=this.entries[t].date)}}).catch(t=>{this.notifications.error.show=!0,this.notifications.error.text=t.message})}}},n={show:l,dates:p};function a(){Object.keys(n).forEach(e=>{console.log(`Loading page component "${e}"`);let o=n[e]();Alpine.data(e,()=>o)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),a()});window.bootstrapped&&(console.log("Loaded through window variable."),a());

File diff suppressed because one or more lines are too long

View File

@ -1,27 +1,50 @@
{
"_autocomplete-functions-3410a57d.js": {
"file": "assets/autocomplete-functions-3410a57d.js",
"_autocomplete-functions-ac0d2cb1.js": {
"file": "assets/autocomplete-functions-ac0d2cb1.js",
"imports": [
"_vendor-824d08a0.js",
"_get-51a7c3ed.js"
"_format-money-e259f5e4.js",
"_get-da167d5b.js",
"_vendor-fca45885.js"
],
"integrity": "sha384-o/3mERLcLYjxsZqqIwGnF4iaDtYbfp0p6ywZUw3LzaEKs8KenuVNJFbHEL+QvvF/"
"integrity": "sha384-ylbI7yXfy5qc0QwMwNSdc4QMHKM1eXXR6R2zLxLUSccW3OCkFCc5pEm1ZpCDbdXh"
},
"_get-51a7c3ed.js": {
"file": "assets/get-51a7c3ed.js",
"_create-empty-split-fb5bda92.js": {
"file": "assets/create-empty-split-fb5bda92.js",
"imports": [
"_vendor-824d08a0.js"
"_vendor-fca45885.js"
],
"integrity": "sha384-7rQLc8vRYEfvzGJkZK4O3GueHV9DYBPIONbhz38NdBNUvDS0FkwZGKW8C5ioVYx1"
"integrity": "sha384-hhKUcZf3xSLJgwkzufZGpLjOUeD5gulL71KQu72SoGIUVLPU3EIBT+ICT/znc01b"
},
"_get-c23f6e9c.js": {
"file": "assets/get-c23f6e9c.js",
"_format-money-e259f5e4.js": {
"file": "assets/format-money-e259f5e4.js",
"imports": [
"_get-51a7c3ed.js"
"_vendor-fca45885.js"
],
"integrity": "sha384-6GHrZICih75U9uAcpCdc9hKOJB1YOlJA0U4pthxpKBXg0PiuI144yADGDatP8qWc"
"integrity": "sha384-zfi6/58+Nb5L5Ryx5WARPOstXPNq+qioNeeQB0XP4V9ZAPg4Bi9bdC3+fVmNsE/M"
},
"_vendor-824d08a0.js": {
"_get-3bb14de5.js": {
"file": "assets/get-3bb14de5.js",
"imports": [
"_format-money-e259f5e4.js"
],
"integrity": "sha384-ZgD+gbjUNu1QpP5ZH5WE8+bJmZsLQOx73UT9vPxPRzBwxtGignJ2BC8h9WYdJxU3"
},
"_get-da167d5b.js": {
"file": "assets/get-da167d5b.js",
"imports": [
"_format-money-e259f5e4.js"
],
"integrity": "sha384-ADxhKsFImio/UdUojkpvUHQ9lKqGcHbhsvCj5TEYLNuefhUlz0RIyWX/0/cFcasS"
},
"_parse-downloaded-splits-7d781ebe.js": {
"file": "assets/parse-downloaded-splits-7d781ebe.js",
"imports": [
"_create-empty-split-fb5bda92.js",
"_vendor-fca45885.js"
],
"integrity": "sha384-aS2TUV4WV3MjjDkrhzSNLC2/qY5Y7aQnY9qYvhLIWiM464BEtuHS2KHKsyonykna"
},
"_vendor-fca45885.js": {
"assets": [
"assets/layers-1dbbe9d0.png",
"assets/layers-2x-066daca8.png",
@ -30,8 +53,8 @@
"css": [
"assets/vendor-49001d3f.css"
],
"file": "assets/vendor-824d08a0.js",
"integrity": "sha384-RHD07rOX8oczLoy+ZfMln6IKmzXw0EUoyln808Rf9vNiUpXfO9dYspU2ugHkgnqE"
"file": "assets/vendor-fca45885.js",
"integrity": "sha384-xc7wHYzykc3pL46xJ1C3dJ/yReuYh0aAcdywRaE8sPW9QiKDkmpdip8ksd8qWp4b"
},
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf": {
"file": "assets/fa-brands-400-5656d596.ttf",
@ -79,38 +102,57 @@
"integrity": "sha384-wg83fCOXjBtqzFAWhTL9Sd9vmLUNhfEEzfmNUX9zwv2igKlz/YQbdapF4ObdxF+R"
},
"resources/assets/v2/pages/dashboard/dashboard.js": {
"file": "assets/dashboard-1d6bb3a8.js",
"file": "assets/dashboard-d274a3dc.js",
"imports": [
"_get-51a7c3ed.js",
"_vendor-824d08a0.js",
"_get-c23f6e9c.js"
"_format-money-e259f5e4.js",
"_vendor-fca45885.js",
"_get-3bb14de5.js",
"_get-da167d5b.js"
],
"isEntry": true,
"src": "resources/assets/v2/pages/dashboard/dashboard.js",
"integrity": "sha384-GI5sC1ea2MZL7jEH7nTxh0XeVPfvGXqLgMBSqnWJt5MCKuhPK8/J6+ptF46PE054"
"integrity": "sha384-yhbUCvDl5ePrqXSXJu1jJ6eGLWzC137n7Ee3gHZDaO9kOKqtajG3KbILBpYlM5u9"
},
"resources/assets/v2/pages/transactions/create.js": {
"file": "assets/create-8992c704.js",
"file": "assets/create-9af1982c.js",
"imports": [
"_get-51a7c3ed.js",
"_autocomplete-functions-3410a57d.js",
"_vendor-824d08a0.js"
"_format-money-e259f5e4.js",
"_create-empty-split-fb5bda92.js",
"_autocomplete-functions-ac0d2cb1.js",
"_vendor-fca45885.js",
"_get-da167d5b.js"
],
"isEntry": true,
"src": "resources/assets/v2/pages/transactions/create.js",
"integrity": "sha384-F/oCKa2N6RMta8+C5lQ81oYNoKB6BUE4sbxJrpjixfBPNf3rwzXotyi+/mHL6ePE"
"integrity": "sha384-f1FX2idAuYuItQyu41hCRa1AtE+65Pqky4Dwn2+u+5Vmsm2gw1uoZp2sODAfpiS5"
},
"resources/assets/v2/pages/transactions/edit.js": {
"file": "assets/edit-ab5008f2.js",
"file": "assets/edit-84831b47.js",
"imports": [
"_get-51a7c3ed.js",
"_vendor-824d08a0.js",
"_get-c23f6e9c.js",
"_autocomplete-functions-3410a57d.js"
"_format-money-e259f5e4.js",
"_get-3bb14de5.js",
"_parse-downloaded-splits-7d781ebe.js",
"_autocomplete-functions-ac0d2cb1.js",
"_vendor-fca45885.js",
"_create-empty-split-fb5bda92.js",
"_get-da167d5b.js"
],
"isEntry": true,
"src": "resources/assets/v2/pages/transactions/edit.js",
"integrity": "sha384-mkNpSNt8PSuqNxyiOObOFTfcaNuOapa+Snw8Ufj8GkuLQXHZXBXqyol2Qx1j0FwD"
"integrity": "sha384-Ummn9Rx5ZUkO+v3kL5fP+Djw6oSdbrKhxMc5hIhoDyZhsgNHm6BzKnouwzd+NHDF"
},
"resources/assets/v2/pages/transactions/show.js": {
"file": "assets/show-18e47a07.js",
"imports": [
"_format-money-e259f5e4.js",
"_vendor-fca45885.js",
"_get-3bb14de5.js",
"_parse-downloaded-splits-7d781ebe.js",
"_create-empty-split-fb5bda92.js"
],
"isEntry": true,
"src": "resources/assets/v2/pages/transactions/show.js",
"integrity": "sha384-MLeDab/u+23tspn2M/cCjTtFIXNbIuMGeErOwjGMC5vKGOfLNcD3NUA1rXip9PQH"
},
"resources/assets/v2/sass/app.scss": {
"file": "assets/app-fb7b26ec.css",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "bg"
"html_language": "bg",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "\u041f\u043e\u0445\u0430\u0440\u0447\u0435\u043d\u0438",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "\u041f\u0440\u0435\u0445\u0432\u044a\u0440\u043b\u044f\u043d\u0435",
"Withdrawal": "\u0422\u0435\u0433\u043b\u0435\u043d\u0435",
"Deposit": "\u0414\u0435\u043f\u043e\u0437\u0438\u0442",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "\u0411\u044e\u0434\u0436\u0435\u0442",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "ca"
"html_language": "ca",
"date_time_fns": "D [de\/d'] MMMM yyyy [a les] HH:mm:ss"
},
"firefly": {
"spent": "Gastat",
@ -22,6 +23,12 @@
"unknown_any_plain": "Compte desconegut",
"unknown_budget_plain": "Cap pressupost",
"stored_journal_js": "S'ha creat la transacci\u00f3 \"%{description}\" correctament",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Transfer\u00e8ncia",
"Withdrawal": "Retirada",
"Deposit": "Ingr\u00e9s",
"expense_account": "Compte de despeses",
"revenue_account": "Compte d'ingressos",
"budget": "Pressupost",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "cs"
"html_language": "cs",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Utraceno",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "P\u0159evod",
"Withdrawal": "V\u00fdb\u011br",
"Deposit": "Vklad",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Rozpo\u010det",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "da"
"html_language": "da",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Spent",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Overf\u00f8rsel",
"Withdrawal": "H\u00e6vet",
"Deposit": "Indbetaling",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Budget",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "de"
"html_language": "de",
"date_time_fns": "dd. MMM. yyyy um HH:mm:ss"
},
"firefly": {
"spent": "Ausgegeben",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unbekanntes Konto",
"unknown_budget_plain": "Kein Budget",
"stored_journal_js": "Neue Buchung \u201e%{description}\u201d erfolgreich erstellt",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Umbuchung",
"Withdrawal": "Ausgabe",
"Deposit": "Einnahme",
"expense_account": "Ausgabenkonto",
"revenue_account": "Einnahmekonto",
"budget": "Budget",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "el"
"html_language": "el",
"date_time_fns": "do MMMM yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "\u0394\u03b1\u03c0\u03b1\u03bd\u03ae\u03b8\u03b7\u03ba\u03b1\u03bd",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "\u0394\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03ae\u03b8\u03b7\u03ba\u03b5 \u03b5\u03c0\u03b9\u03c4\u03c5\u03c7\u03ce\u03c2 \u03b7 \u03bd\u03ad\u03b1 \u03c3\u03c5\u03bd\u03b1\u03bb\u03bb\u03b1\u03b3\u03ae \u00ab%{description}\u00bb",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "\u039c\u03b5\u03c4\u03b1\u03c6\u03bf\u03c1\u03ac",
"Withdrawal": "\u0391\u03bd\u03ac\u03bb\u03b7\u03c8\u03b7",
"Deposit": "\u039a\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "\u03a0\u03c1\u03bf\u03cb\u03c0\u03bf\u03bb\u03bf\u03b3\u03b9\u03c3\u03bc\u03cc\u03c2",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "en-gb"
"html_language": "en-gb",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Spent",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Transfer",
"Withdrawal": "Withdrawal",
"Deposit": "Deposit",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Budget",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "en"
"html_language": "en",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Spent",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Transfer",
"Withdrawal": "Withdrawal",
"Deposit": "Deposit",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Budget",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "es"
"html_language": "es",
"date_time_fns": "El MMMM hacer, yyyy a las HH:mm:ss"
},
"firefly": {
"spent": "Gastado",
@ -22,6 +23,12 @@
"unknown_any_plain": "Cuenta desconocida",
"unknown_budget_plain": "Sin presupuesto",
"stored_journal_js": "Nueva transacci\u00f3n creada con \u00e9xito \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Transferencia",
"Withdrawal": "Gasto",
"Deposit": "Ingreso",
"expense_account": "Cuenta de gastos",
"revenue_account": "Cuenta de ingresos",
"budget": "Presupuesto",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "fi"
"html_language": "fi",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "K\u00e4ytetty",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Siirto",
"Withdrawal": "Nosto",
"Deposit": "Talletus",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Budjetti",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "fr"
"html_language": "fr",
"date_time_fns": "do MMMM, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "D\u00e9pens\u00e9",
@ -22,6 +23,12 @@
"unknown_any_plain": "Compte inconnu",
"unknown_budget_plain": "Pas de budget",
"stored_journal_js": "Op\u00e9ration \"%{description}\" cr\u00e9\u00e9e avec succ\u00e8s",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Transfert",
"Withdrawal": "D\u00e9pense",
"Deposit": "D\u00e9p\u00f4t",
"expense_account": "Compte de d\u00e9penses",
"revenue_account": "Compte de recettes",
"budget": "Budget",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "hu"
"html_language": "hu",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Elk\u00f6lt\u00f6tt",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "\u00c1tvezet\u00e9s",
"Withdrawal": "K\u00f6lts\u00e9g",
"Deposit": "Bev\u00e9tel",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "K\u00f6lts\u00e9gkeret",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "id"
"html_language": "id",
"date_time_fns": "do MMMM yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Menghabiskan",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Transfer",
"Withdrawal": "Penarikan",
"Deposit": "Deposit",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Anggaran",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "it"
"html_language": "it",
"date_time_fns": "do MMMM yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Speso",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Trasferimento",
"Withdrawal": "Prelievo",
"Deposit": "Entrata",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Budget",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "ja"
"html_language": "ja",
"date_time_fns": "yyyy\u5e74MMMM\u6708do\u65e5 HH:mm:ss"
},
"firefly": {
"spent": "\u652f\u51fa",
@ -22,6 +23,12 @@
"unknown_any_plain": "\u4e0d\u660e\u306a\u53e3\u5ea7",
"unknown_budget_plain": "\u4e88\u7b97\u306a\u3057",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "\u9001\u91d1",
"Withdrawal": "\u51fa\u91d1",
"Deposit": "\u9810\u91d1",
"expense_account": "\u652f\u51fa\u53e3\u5ea7",
"revenue_account": "\u53ce\u5165\u53e3\u5ea7",
"budget": "\u4e88\u7b97",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "ko"
"html_language": "ko",
"date_time_fns": "YYYY\ub144 M\uc6d4 D\uc77c HH:mm:ss"
},
"firefly": {
"spent": "\uc9c0\ucd9c",
@ -22,6 +23,12 @@
"unknown_any_plain": "\uc54c \uc218 \uc5c6\ub294 \uacc4\uc815",
"unknown_budget_plain": "\uc608\uc0b0 \uc5c6\uc74c",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "\uc774\uccb4",
"Withdrawal": "\ucd9c\uae08",
"Deposit": "\uc785\uae08",
"expense_account": "\uc9c0\ucd9c \uacc4\uc815",
"revenue_account": "\uc218\uc775 \uacc4\uc815",
"budget": "\uc608\uc0b0",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "nb"
"html_language": "nb",
"date_time_fns": "do MMMM, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Brukt",
@ -22,6 +23,12 @@
"unknown_any_plain": "Ukjent konto",
"unknown_budget_plain": "Mangler budsjett",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Overf\u00f8ring",
"Withdrawal": "Uttak",
"Deposit": "Innskudd",
"expense_account": "Utgiftskonto",
"revenue_account": "Inntektskonto",
"budget": "Budsjett",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "nl"
"html_language": "nl",
"date_time_fns": "d MMMM yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Uitgegeven",
@ -22,6 +23,12 @@
"unknown_any_plain": "Onbekende rekening",
"unknown_budget_plain": "Geen budget",
"stored_journal_js": "Nieuw transactie \"%{description}\" opgeslagen",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Overschrijving",
"Withdrawal": "Uitgave",
"Deposit": "Inkomsten",
"expense_account": "Crediteur",
"revenue_account": "Debiteur",
"budget": "Budget",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "nn"
"html_language": "nn",
"date_time_fns": "do MMMM, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Brukt",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Transaksjonen \u00ab%{description}\u00bb vart oppretta",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Overf\u00f8ring",
"Withdrawal": "Uttak",
"Deposit": "Innskudd",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Budsjett",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "pl"
"html_language": "pl",
"date_time_fns": "do MMMM yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Wydano",
@ -22,6 +23,12 @@
"unknown_any_plain": "Nieznane konto",
"unknown_budget_plain": "Brak bud\u017cetu",
"stored_journal_js": "Pomy\u015blnie utworzono now\u0105 transakcj\u0119 \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Transfer",
"Withdrawal": "Wyp\u0142ata",
"Deposit": "Wp\u0142ata",
"expense_account": "Konto wydatk\u00f3w",
"revenue_account": "Konto przychod\u00f3w",
"budget": "Bud\u017cet",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "pt-br"
"html_language": "pt-br",
"date_time_fns": "dd 'de' MMMM 'de' yyyy, '\u00e0s' HH:mm:ss"
},
"firefly": {
"spent": "Gasto",
@ -22,6 +23,12 @@
"unknown_any_plain": "Conta desconhecida",
"unknown_budget_plain": "Nenhum or\u00e7amento",
"stored_journal_js": "Transa\u00e7\u00e3o \"%{description}\" criada com sucesso",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Transfer\u00eancia",
"Withdrawal": "Retirada",
"Deposit": "Dep\u00f3sito",
"expense_account": "Conta de despesas",
"revenue_account": "Conta de Receitas",
"budget": "Or\u00e7amento",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "pt"
"html_language": "pt",
"date_time_fns": "DO [de] MMMM YYYY, @ HH:mm:ss"
},
"firefly": {
"spent": "Gasto",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Transfer\u00eancia",
"Withdrawal": "Levantamento",
"Deposit": "Dep\u00f3sito",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Or\u00e7amento",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "ro"
"html_language": "ro",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Cheltuit",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Transfer",
"Withdrawal": "Retragere",
"Deposit": "Depozit",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Buget",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "ru"
"html_language": "ru",
"date_time_fns": "Do MMMM yyyy, @ HH:mm:ss"
},
"firefly": {
"spent": "\u0420\u0430\u0441\u0445\u043e\u0434",
@ -22,6 +23,12 @@
"unknown_any_plain": "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442",
"unknown_budget_plain": "\u0411\u0435\u0437 \u0431\u044e\u0434\u0436\u0435\u0442\u0430",
"stored_journal_js": "\u041d\u043e\u0432\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \"%{description}\" \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0430",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "\u041f\u0435\u0440\u0435\u0432\u043e\u0434",
"Withdrawal": "\u0420\u0430\u0441\u0445\u043e\u0434",
"Deposit": "\u0414\u043e\u0445\u043e\u0434",
"expense_account": "\u0421\u0447\u0435\u0442 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432",
"revenue_account": "\u0421\u0447\u0435\u0442 \u0434\u043e\u0445\u043e\u0434\u043e\u0432",
"budget": "\u0411\u044e\u0434\u0436\u0435\u0442",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "sk"
"html_language": "sk",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Utraten\u00e9",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Prevod",
"Withdrawal": "V\u00fdber",
"Deposit": "Vklad",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Rozpo\u010det",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "sl"
"html_language": "sl",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Porabljeno",
@ -22,6 +23,12 @@
"unknown_any_plain": "Neznan ra\u010dun",
"unknown_budget_plain": "Ni prora\u010duna",
"stored_journal_js": "Nova transakcija \"%{description}\" je uspe\u0161no ustvarjena",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Prenos",
"Withdrawal": "Dvig",
"Deposit": "Polog",
"expense_account": "Ra\u010dun stro\u0161kov",
"revenue_account": "Ra\u010dun prihodkov",
"budget": "Prora\u010dun",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "sv"
"html_language": "sv",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Spenderat",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "\u00d6verf\u00f6ring",
"Withdrawal": "Uttag",
"Deposit": "Ins\u00e4ttning",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Budget",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "tr"
"html_language": "tr",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Harcanan",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Havale",
"Withdrawal": "Para \u00c7ekme",
"Deposit": "Mevduat",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "B\u00fct\u00e7e",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "uk"
"html_language": "uk",
"date_time_fns": "MMMM do, yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "Spent",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "\u041f\u0435\u0440\u0435\u043a\u0430\u0437",
"Withdrawal": "\u0412\u0438\u0442\u0440\u0430\u0442\u0430",
"Deposit": "Deposit",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Budget",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "vi"
"html_language": "vi",
"date_time_fns": "d MMMM yyyy @ HH:mm:ss"
},
"firefly": {
"spent": "\u0110\u00e3 chi",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "Chuy\u1ec3n kho\u1ea3n",
"Withdrawal": "R\u00fat ti\u1ec1n",
"Deposit": "Ti\u1ec1n g\u1eedi",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "Ng\u00e2n s\u00e1ch",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "zh-cn"
"html_language": "zh-cn",
"date_time_fns": "YYYY\u5e74M\u6708D\u65e5 HH:mm:ss"
},
"firefly": {
"spent": "\u652f\u51fa",
@ -22,6 +23,12 @@
"unknown_any_plain": "\u672a\u77e5\u8d26\u6237",
"unknown_budget_plain": "\u65e0\u9884\u7b97",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "\u8f6c\u8d26",
"Withdrawal": "\u652f\u51fa",
"Deposit": "\u6536\u5165",
"expense_account": "\u652f\u51fa\u8d26\u6237",
"revenue_account": "\u6536\u5165\u8d26\u6237",
"budget": "\u9884\u7b97",

View File

@ -1,6 +1,7 @@
{
"config": {
"html_language": "zh-tw"
"html_language": "zh-tw",
"date_time_fns": "YYYY\u5e74 M\u6708 D\u65e5 dddd \u65bc HH:mm:ss"
},
"firefly": {
"spent": "\u652f\u51fa",
@ -22,6 +23,12 @@
"unknown_any_plain": "Unknown account",
"unknown_budget_plain": "No budget",
"stored_journal_js": "Successfully created new transaction \"%{description}\"",
"wait_loading_transaction": "Please wait for the form to load",
"nothing_found": "(nothing found)",
"wait_loading_data": "Please wait for your information to load...",
"Transfer": "\u8f49\u5e33",
"Withdrawal": "\u63d0\u6b3e",
"Deposit": "\u5b58\u6b3e",
"expense_account": "Expense account",
"revenue_account": "Revenue account",
"budget": "\u9810\u7b97",

View File

@ -31,13 +31,12 @@ import observePlugin from 'store/plugins/observe';
import Alpine from "alpinejs";
import * as bootstrap from 'bootstrap';
import {getFreshVariable} from "../store/get-fresh-variable.js";
store.addPlugin(observePlugin);
// import even more
import {getVariable} from "../store/get-variable.js";
import {getViewRange} from "../support/get-viewrange.js";
import {loadTranslations} from "../support/load-translations.js";
store.addPlugin(observePlugin);
window.bootstrapped = false;
window.store = store;
@ -69,16 +68,13 @@ getFreshVariable('lastActivity').then((serverValue) => {
window.__localeId__ = values[2];
store.set('language', values[3]);
store.set('locale', values[3]);
const event = new Event('firefly-iii-bootstrapped');
document.dispatchEvent(event);
window.bootstrapped = true;
loadTranslations(values[3]).then(() => {
const event = new Event('firefly-iii-bootstrapped');
document.dispatchEvent(event);
window.bootstrapped = true;
});
});
});
// wait for 3 promises, because we need those later on.
window.axios = axios;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
window.Alpine = Alpine

View File

@ -45,9 +45,6 @@ import {
Tooltip
} from "chart.js";
import 'chartjs-adapter-date-fns';
import {loadTranslations} from "../../support/load-translations.js";
import {getVariable} from "../../store/get-variable.js";
import i18next from "i18next";
// register things
Chart.register({
@ -81,26 +78,20 @@ const comps = {
//let i18n;
function loadPage(comps) {
Promise.all([getVariable('language', 'en_US')]).then((values) => {
loadTranslations(values[0]).then(() => {
Object.keys(comps).forEach(comp => {
let data = comps[comp]();
Alpine.data(comp, () => data);
});
Alpine.start();
});
Object.keys(comps).forEach(comp => {
let data = comps[comp]();
Alpine.data(comp, () => data);
});
Alpine.start();
}
// wait for load until bootstrapped event is received.
document.addEventListener('firefly-iii-bootstrapped', () => {
//console.log('Loaded through event listener.');
console.log('Loaded through event listener.');
loadPage(comps);
});
// or is bootstrapped before event is triggered.
if (window.bootstrapped) {
//console.log('Loaded through window variable.');
console.log('Loaded through window variable.');
loadPage(comps);
}

View File

@ -22,7 +22,6 @@ import Get from "../../api/v2/model/transaction/get.js";
import {getDefaultChartSettings} from "../../support/default-chart-settings.js";
import {Chart} from 'chart.js';
import {Flow, SankeyController} from 'chartjs-chart-sankey';
import {loadTranslations} from "../../support/load-translations.js";
import {getCacheKey} from "../../support/get-cache-key.js";
import {format} from "date-fns";
import i18next from "i18next";

View File

@ -45,7 +45,6 @@ export default () => ({
language: 'en_US',
init() {
console.log(`Loading page component "DATES" with language "${i18next.t('key')}".`);
this.range = {
start: new Date(window.store.get('start')),
end: new Date(window.store.get('end'))

View File

@ -0,0 +1,58 @@
/*
* template.js
* Copyright (c) 2024 james@firefly-iii.org.
*
* 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 '../../boot/bootstrap.js';
import dates from "./shared/dates.js";
let somethings = function() {
return {
pageProperties: {},
functionName() {
},
init() {
}
}
}
let comps = {somethings, dates};
function loadPage() {
Object.keys(comps).forEach(comp => {
console.log(`Loading page component "${comp}"`);
let data = comps[comp]();
Alpine.data(comp, () => data);
});
Alpine.start();
}
// wait for load until bootstrapped event is received.
document.addEventListener('firefly-iii-bootstrapped', () => {
console.log('Loaded through event listener.');
loadPage();
});
// or is bootstrapped before event is triggered.
if (window.bootstrapped) {
console.log('Loaded through window variable.');
loadPage();
}

View File

@ -24,8 +24,6 @@ import {createEmptySplit, defaultErrorSet} from "./shared/create-empty-split.js"
import {parseFromEntries} from "./shared/parse-from-entries.js";
import formatMoney from "../../util/format-money.js";
import Post from "../../api/v2/model/transaction/post.js";
import {getVariable} from "../../store/get-variable.js";
import {loadTranslations} from "../../support/load-translations.js";
import {loadCurrencies} from "./shared/load-currencies.js";
import {loadBudgets} from "./shared/load-budgets.js";
import {loadPiggyBanks} from "./shared/load-piggy-banks.js";

View File

@ -20,8 +20,6 @@
import '../../boot/bootstrap.js';
import dates from '../../pages/shared/dates.js';
import {getVariable} from "../../store/get-variable.js";
import {loadTranslations} from "../../support/load-translations.js";
import formatMoney from "../../util/format-money.js";
import Get from "../../api/v2/model/transaction/get.js";
import {parseDownloadedSplits} from "./shared/parse-downloaded-splits.js";

View File

@ -83,21 +83,8 @@ export function parseDownloadedSplits(downloads) {
current.longitude = download.longitude;
current.zoomLevel = download.zoom_level;
}
// hasLocation: false
// latitude: null
// longitude: null
// piggy_bank_id: null
// zoomLevel: null
// console.log('download:');
// console.log(download);
// console.log('current:');
// console.log(current);
console.log(current.tags);
returnArray.push(current);
}
}
return returnArray;
}

View File

@ -0,0 +1,129 @@
/*
* show.js
* Copyright (c) 2024 james@firefly-iii.org.
*
* 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 '../../boot/bootstrap.js';
import dates from "../shared/dates.js";
import i18next from "i18next";
import Get from "../../api/v2/model/transaction/get.js";
import {parseDownloadedSplits} from "./shared/parse-downloaded-splits.js";
import {format} from "date-fns";
import formatMoney from "../../util/format-money.js";
let show = function () {
return {
// notifications
notifications: {
error: {
show: false, text: '', url: '',
}, success: {
show: false, text: '', url: '',
}, wait: {
show: false, text: '',
}
},
groupProperties: {
id: 0,
transactionType: '',
transactionTypeTranslated: '',
title: '',
totalAmount: 0,
date: new Date,
},
// parse amounts per currency
amounts: {},
entries: [],
pageProperties: {},
formatMoney(amount, currencyCode) {
return formatMoney(amount, currencyCode);
},
format(date) {
return format(date, i18next.t('config.date_time_fns'));
},
init() {
this.notifications.wait.show = true;
this.notifications.wait.text = i18next.t('firefly.wait_loading_data')
const page = window.location.href.split('/');
const groupId = parseInt(page[page.length - 1]);
const getter = new Get();
getter.show(groupId, {}).then((response) => {
const data = response.data.data;
this.groupProperties.id = parseInt(data.id);
this.groupProperties.transactionType = data.attributes.transactions[0].type;
this.groupProperties.transactionTypeTranslated = i18next.t('firefly.' + data.attributes.transactions[0].type);
this.groupProperties.title = data.attributes.title ?? data.attributes.transactions[0].description;
this.groupProperties.totalAmount = 0;
this.entries = parseDownloadedSplits(data.attributes.transactions);
// remove waiting thing.
this.notifications.wait.show = false;
}).then(() => {
for (let i in this.entries) {
if (this.entries.hasOwnProperty(i)) {
const currencyCode = this.entries[i].currency_code;
const foreignCurrencyCode = this.entries[i].foreign_currency_code;
if (undefined === this.amounts[currencyCode]) {
this.amounts[currencyCode] = 0;
this.amounts[currencyCode] += parseFloat(this.entries[i].amount);
}
if (null !== foreignCurrencyCode && '' !== foreignCurrencyCode && undefined === this.amounts[foreignCurrencyCode]) {
this.amounts[foreignCurrencyCode] = 0;
this.amounts[foreignCurrencyCode] += parseFloat(this.entries[i].foreign_amount);
}
this.groupProperties.totalAmount = this.groupProperties.totalAmount + parseFloat(this.entries[i].amount);
if(0 === parseInt(i)) {
this.groupProperties.date = this.entries[i].date;
}
}
}
}).catch((error) => {
// todo auto generated.
this.notifications.error.show = true;
this.notifications.error.text = error.message;
});
}
}
}
let comps = {show, dates};
function loadPage() {
Object.keys(comps).forEach(comp => {
console.log(`Loading page component "${comp}"`);
let data = comps[comp]();
Alpine.data(comp, () => data);
});
Alpine.start();
}
// wait for load until bootstrapped event is received.
document.addEventListener('firefly-iii-bootstrapped', () => {
console.log('Loaded through event listener.');
loadPage();
});
// or is bootstrapped before event is triggered.
if (window.bootstrapped) {
console.log('Loaded through window variable.');
loadPage();
}

View File

@ -28,21 +28,19 @@ import LocalStorageBackend from "i18next-localstorage-backend";
let loaded = false;
let count = 0;
function loadTranslations(locale) {
if (false === loaded && 0 === count) {
console.log('Loading translations: ' + count);
if (false === loaded) {
const replacedLocale = locale.replace('-', '_');
loaded = true;
count++;
console.log(import.meta.env.MODE);
const expireTime = import.meta.env.MODE === 'development' ? 1 : 7 * 24 * 60 * 60 * 1000;
return i18next
.use(ChainedBackend)
.init({
fallbackLng: "en_US",
lng: replacedLocale,
debug: true,
debug: import.meta.env.MODE === 'development',
// ... your i18next config
backend: {
backends: [
@ -50,7 +48,7 @@ function loadTranslations(locale) {
HttpBackend
],
backendOptions: [{
expirationTime: 7 * 24 * 60 * 60 * 1000 // 7 days
expirationTime: expireTime
}, {
// const response = await fetch(`./v2/i18n/${locale}.json`);
loadPath: './v2/i18n/{{lng}}.json'
@ -58,8 +56,7 @@ function loadTranslations(locale) {
}
});
}
count++;
console.warn('Loading translations skipped because count is:' + count);
console.warn('Loading translations skipped.');
return Promise.resolve();
}

View File

@ -1898,6 +1898,7 @@ return [
// transactions:
'wait_loading_transaction' => 'Please wait for the form to load',
'wait_loading_data' => 'Please wait for your information to load...',
'wait_attachments' => 'Please wait for the attachments to upload.',
'errors_upload' => 'The upload has failed. Please check your browser console for the error.',
'amount_foreign_if' => 'Amount in foreign currency, if any',

View File

@ -1,7 +1,7 @@
<div class="row mb-3">
<label :for="'dest_' + index"
class="col-sm-1 col-form-label d-none d-sm-block">
<em title="{{ __('firefly.destination_account') }}" class="fa-solid fa-arrow-left"></em>
<em title="{{ __('firefly.destination_account') }}" class="fa-solid fa-arrow-right"></em>
</label>
<div class="col-sm-10">
<input type="text"

View File

@ -1,7 +1,7 @@
<div class="row mb-3">
<label :for="'source_' + index"
class="col-sm-1 col-form-label d-none d-sm-block">
<em title="{{ __('firefly.source_account') }}" class="fa-solid fa-arrow-right"></em>
<em title="{{ __('firefly.source_account') }}" class="fa-solid fa-arrow-left"></em>
</label>
<div class="col-sm-10">
<input type="text"

View File

@ -0,0 +1,207 @@
@extends('layout.v2')
@section('vite')
@vite(['resources/assets/v2/sass/app.scss', 'resources/assets/v2/pages/transactions/show.js'])
@endsection
@section('content')
<div class="app-content">
<div class="container-fluid" x-data="show">
<x-messages></x-messages>
<div class="row">
<div class="col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.basic_journal_information') }}</h3>
</div>
<div class="card-body p-0">
<table class="table table-x table-hover">
<tbody>
<tr>
<th style="width:10%;">
<template x-if="'Withdrawal' === groupProperties.transactionType">
<em class="fa fa-solid fa-arrow-left"
:title="groupProperties.transactionTypeTranslated"></em>
</template>
<template x-if="'Deposit' === groupProperties.transactionType">
<em class="fa-solid fa-arrow-right"
:title="groupProperties.transactionTypeTranslated"></em>
</template>
<template x-if="'Transfer' === groupProperties.transactionType">
<em class="fa-solid fa-rotate"
:title="groupProperties.transactionTypeTranslated"></em>
</template>
<template
x-if="'Transfer' !== groupProperties.transactionType && 'Deposit' !== groupProperties.transactionType && 'Withdrawal' !== groupProperties.transactionType">
<span>TODO missing ICON</span>
</template>
</th>
<td><span x-text="groupProperties.title"></span></td>
</tr>
<tr>
<th><em class="fa-solid fa-calendar-alt" title="{{ __('list.date') }}"/></th>
<td><span x-text="format(groupProperties.date)"></span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.transaction_journal_meta') }}</h3>
</div>
<div class="card-body p-0">
<table class="table table-x table-hover">
<tbody>
<tr>
<th style="width:10%;">
<em class="fa-solid fa-money-bill-wave" title="{{ __('firefly.amount') }}"></em>
</th>
<td>
<template x-if="'Withdrawal' === groupProperties.transactionType">
<template x-for="(amount, code) in amounts">
<span class="text-danger" x-text="formatMoney(amount*-1, code)"></span>
</template>
</template>
<template x-if="'Deposit' === groupProperties.transactionType">
<template x-for="(amount, code) in amounts">
<span class="text-success" x-text="formatMoney(amount, code)"></span>
</template>
</template>
<template x-if="'Transfer' === groupProperties.transactionType">
<template x-for="(amount, code) in amounts">
<span class="text-info" x-text="formatMoney(amount, code)"></span>
</template>
</template>
<template
x-if="'Transfer' !== groupProperties.transactionType && 'Deposit' !== groupProperties.transactionType && 'Withdrawal' !== groupProperties.transactionType">
<span>TODO PARSE MISSING AMOUNT</span>
</template>
</td>
</tr>
<tr>
<th>
<em title="{{ __('firefly.source_account') }}"
class="fa-solid fa-arrow-left"></em>
</th>
<td>
<template x-for="entry in entries">
<a :href="'./accounts/show/' + entry.source_account.id" :title="entry.source_account.name" x-text="entry.source_account.name"></a>
</template>
</td>
</tr>
<tr>
<th>
<em title="{{ __('firefly.destination_account') }}"
class="fa-solid fa-arrow-right"></em>
</th>
<td>
<template x-for="entry in entries">
<a :href="'./accounts/show/' + entry.destination_account.id" :title="entry.destination_account.name" x-text="entry.destination_account.name"></a>
</template>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col">
<h4>{{ __('firefly.transaction_journal_information') }}</h4>
</div>
</div>
<div class="row">
<div class="col-xl-4 col-lg-6 col-md-12 col-sm-12 col-xs-12">
<div class="card mb-3">
<div class="card-header">
<h3 class="card-title">Description (X from X)</h3>
</div>
<div class="card-body p-0">
<table class="table table-x table-hover">
<tbody>
<tr>
<td colspan="2">
center
From A to B (summary)
</td>
</tr>
<tr>
<th>category icon</th>
<td>category</td>
</tr>
<tr>
<th>budget icon</th>
<td>budget</td>
</tr>
<tr>
<th>subscription icon</th>
<td>subscription</td>
</tr>
<tr>
<th>dates (x6) icon</th>
<td>subscription</td>
</tr>
<tr>
<th>meta fields</th>
<td>meta</td>
</tr>
<tr>
<th>recurring things</th>
<td>meta</td>
</tr>
<tr>
<th>tags</th>
<td>meta</td>
</tr>
<tr>
<td colspan="2">notes</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="card mb-3">
<div class="card-header">
<h3 class="card-title">Transaction links</h3>
</div>
<div class="card-body p-0">
</div>
</div>
<div class="card mb-3">
<div class="card-header">
<h3 class="card-title">Piggy bank events.</h3>
</div>
<div class="card-body p-0">
</div>
</div>
<div class="card mb-3">
<div class="card-header">
<h3 class="card-title">Attachments</h3>
</div>
<div class="card-body p-0">
</div>
</div>
<div class="card mb-3">
<div class="card-header">
<h3 class="card-title">Audit log entries</h3>
</div>
<div class="card-body p-0">
</div>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col">
<h3>{{ __('firefly.audit_log_entries') }}</h3>
</div>
</div>
</div>
</div>
@endsection

View File

@ -43,8 +43,11 @@ export default defineConfig({
input: [
'resources/assets/v2/sass/app.scss',
'resources/assets/v2/pages/dashboard/dashboard.js',
// transactions
'resources/assets/v2/pages/transactions/create.js',
'resources/assets/v2/pages/transactions/edit.js',
'resources/assets/v2/pages/transactions/show.js',
],
refresh: true,
}),