mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
2 lines
54 KiB
JavaScript
Executable File
Vendored
2 lines
54 KiB
JavaScript
Executable File
Vendored
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{235:function(t,e,a){a(409),t.exports=a(413)},238:function(t,e,a){"use strict";a(52)},239:function(t,e,a){(t.exports=a(24)(!1)).push([t.i,".dropdown-item[data-v-03e62f58],.dropdown-item[data-v-03e62f58]:hover{color:#212529}",""])},267:function(t,e,a){var s={"./af":61,"./af.js":61,"./ar":62,"./ar-dz":63,"./ar-dz.js":63,"./ar-kw":64,"./ar-kw.js":64,"./ar-ly":65,"./ar-ly.js":65,"./ar-ma":66,"./ar-ma.js":66,"./ar-sa":67,"./ar-sa.js":67,"./ar-tn":68,"./ar-tn.js":68,"./ar.js":62,"./az":69,"./az.js":69,"./be":70,"./be.js":70,"./bg":71,"./bg.js":71,"./bm":72,"./bm.js":72,"./bn":73,"./bn-bd":74,"./bn-bd.js":74,"./bn.js":73,"./bo":75,"./bo.js":75,"./br":76,"./br.js":76,"./bs":77,"./bs.js":77,"./ca":78,"./ca.js":78,"./cs":79,"./cs.js":79,"./cv":80,"./cv.js":80,"./cy":81,"./cy.js":81,"./da":82,"./da.js":82,"./de":83,"./de-at":84,"./de-at.js":84,"./de-ch":85,"./de-ch.js":85,"./de.js":83,"./dv":86,"./dv.js":86,"./el":87,"./el.js":87,"./en-au":88,"./en-au.js":88,"./en-ca":89,"./en-ca.js":89,"./en-gb":90,"./en-gb.js":90,"./en-ie":91,"./en-ie.js":91,"./en-il":92,"./en-il.js":92,"./en-in":93,"./en-in.js":93,"./en-nz":94,"./en-nz.js":94,"./en-sg":95,"./en-sg.js":95,"./eo":96,"./eo.js":96,"./es":97,"./es-do":98,"./es-do.js":98,"./es-mx":99,"./es-mx.js":99,"./es-us":100,"./es-us.js":100,"./es.js":97,"./et":101,"./et.js":101,"./eu":102,"./eu.js":102,"./fa":103,"./fa.js":103,"./fi":104,"./fi.js":104,"./fil":105,"./fil.js":105,"./fo":106,"./fo.js":106,"./fr":107,"./fr-ca":108,"./fr-ca.js":108,"./fr-ch":109,"./fr-ch.js":109,"./fr.js":107,"./fy":110,"./fy.js":110,"./ga":111,"./ga.js":111,"./gd":112,"./gd.js":112,"./gl":113,"./gl.js":113,"./gom-deva":114,"./gom-deva.js":114,"./gom-latn":115,"./gom-latn.js":115,"./gu":116,"./gu.js":116,"./he":117,"./he.js":117,"./hi":118,"./hi.js":118,"./hr":119,"./hr.js":119,"./hu":120,"./hu.js":120,"./hy-am":121,"./hy-am.js":121,"./id":122,"./id.js":122,"./is":123,"./is.js":123,"./it":124,"./it-ch":125,"./it-ch.js":125,"./it.js":124,"./ja":126,"./ja.js":126,"./jv":127,"./jv.js":127,"./ka":128,"./ka.js":128,"./kk":129,"./kk.js":129,"./km":130,"./km.js":130,"./kn":131,"./kn.js":131,"./ko":132,"./ko.js":132,"./ku":133,"./ku.js":133,"./ky":134,"./ky.js":134,"./lb":135,"./lb.js":135,"./lo":136,"./lo.js":136,"./lt":137,"./lt.js":137,"./lv":138,"./lv.js":138,"./me":139,"./me.js":139,"./mi":140,"./mi.js":140,"./mk":141,"./mk.js":141,"./ml":142,"./ml.js":142,"./mn":143,"./mn.js":143,"./mr":144,"./mr.js":144,"./ms":145,"./ms-my":146,"./ms-my.js":146,"./ms.js":145,"./mt":147,"./mt.js":147,"./my":148,"./my.js":148,"./nb":149,"./nb.js":149,"./ne":150,"./ne.js":150,"./nl":151,"./nl-be":152,"./nl-be.js":152,"./nl.js":151,"./nn":153,"./nn.js":153,"./oc-lnc":154,"./oc-lnc.js":154,"./pa-in":155,"./pa-in.js":155,"./pl":156,"./pl.js":156,"./pt":157,"./pt-br":158,"./pt-br.js":158,"./pt.js":157,"./ro":159,"./ro.js":159,"./ru":160,"./ru.js":160,"./sd":161,"./sd.js":161,"./se":162,"./se.js":162,"./si":163,"./si.js":163,"./sk":164,"./sk.js":164,"./sl":165,"./sl.js":165,"./sq":166,"./sq.js":166,"./sr":167,"./sr-cyrl":168,"./sr-cyrl.js":168,"./sr.js":167,"./ss":169,"./ss.js":169,"./sv":170,"./sv.js":170,"./sw":171,"./sw.js":171,"./ta":172,"./ta.js":172,"./te":173,"./te.js":173,"./tet":174,"./tet.js":174,"./tg":175,"./tg.js":175,"./th":176,"./th.js":176,"./tk":177,"./tk.js":177,"./tl-ph":178,"./tl-ph.js":178,"./tlh":179,"./tlh.js":179,"./tr":180,"./tr.js":180,"./tzl":181,"./tzl.js":181,"./tzm":182,"./tzm-latn":183,"./tzm-latn.js":183,"./tzm.js":182,"./ug-cn":184,"./ug-cn.js":184,"./uk":185,"./uk.js":185,"./ur":186,"./ur.js":186,"./uz":187,"./uz-latn":188,"./uz-latn.js":188,"./uz.js":187,"./vi":189,"./vi.js":189,"./x-pseudo":190,"./x-pseudo.js":190,"./yo":191,"./yo.js":191,"./zh-cn":192,"./zh-cn.js":192,"./zh-hk":193,"./zh-hk.js":193,"./zh-mo":194,"./zh-mo.js":194,"./zh-tw":195,"./zh-tw.js":195};function r(t){var e=n(t);return a(e)}function n(t){if(!a.o(s,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return s[t]}r.keys=function(){return Object.keys(s)},r.resolve=n,t.exports=r,r.id=267},409:function(t,e,a){"use strict";a.r(e);var s={name:"Dashboard",created:function(){},computed:{},methods:{}},r=a(1),n=Object(r.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("top-boxes"),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("main-account")],1)]),t._v(" "),a("main-account-list"),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("main-budget-list")],1)]),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("main-category-list")],1)]),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-lg-6 col-md-12 col-sm-12 col-xs-12"},[a("main-debit-list")],1),t._v(" "),a("div",{staticClass:"col-lg-6 col-md-12 col-sm-12 col-xs-12"},[a("main-credit-list")],1)]),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-lg-6 col-md-12 col-sm-12 col-xs-12"},[a("main-piggy-list")],1),t._v(" "),a("div",{staticClass:"col-lg-6 col-md-12 col-sm-12 col-xs-12"},[a("main-bills-list")],1)])],1)}),[],!1,null,null,null).exports,i={name:"TopBoxes",props:{},data:function(){return{summary:[],balances:[],billsPaid:[],billsUnpaid:[],leftToSpend:[],netWorth:[]}},computed:{prefCurrencyBalances:function(){return this.filterOnCurrency(this.balances)},notPrefCurrencyBalances:function(){return this.filterOnNotCurrency(this.balances)},prefBillsUnpaid:function(){return this.filterOnCurrency(this.billsUnpaid)},notPrefBillsUnpaid:function(){return this.filterOnNotCurrency(this.billsUnpaid)},prefLeftToSpend:function(){return this.filterOnCurrency(this.leftToSpend)},notPrefLeftToSpend:function(){return this.filterOnNotCurrency(this.leftToSpend)},prefNetWorth:function(){return this.filterOnCurrency(this.netWorth)},notPrefNetWorth:function(){return this.filterOnNotCurrency(this.netWorth)},currencyCode:function(){return this.$store.getters.currencyCode},currencyId:function(){return this.$store.getters.currencyId}},created:function(){this.prepareComponent()},methods:{filterOnCurrency:function(t){var e=[];for(var a in t)t.hasOwnProperty(a)&&t[a].currency_id===this.currencyId&&e.push(t[a]);return 0===e.length&&t.hasOwnProperty(0)&&e.push(t[0]),e},filterOnNotCurrency:function(t){var e=[];for(var a in t)t.hasOwnProperty(a)&&t[a].currency_id!==this.currencyId&&e.push(t[a]);return e},prepareComponent:function(){var t=this;axios.get("./api/v1/summary/basic?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.summary=e.data,t.buildComponent()}))},buildComponent:function(){this.getBalanceEntries(),this.getBillsEntries(),this.getLeftToSpend(),this.getNetWorth()},hasCurrency:function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].currency_id===this.currencyId)return!0;return!1},getBalanceEntries:function(){this.balances=this.getKeyedEntries("balance-in-")},getNetWorth:function(){this.netWorth=this.getKeyedEntries("net-worth-in-")},getLeftToSpend:function(){this.leftToSpend=this.getKeyedEntries("left-to-spend-in-")},getBillsEntries:function(){this.billsPaid=this.getKeyedEntries("bills-paid-in-"),this.billsUnpaid=this.getKeyedEntries("bills-unpaid-in-")},getKeyedEntries:function(t){var e=[];for(var a in this.summary)this.summary.hasOwnProperty(a)&&t===a.substr(0,t.length)&&e.push(this.summary[a]);return e}}},c=Object(r.a)(i,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("div",{staticClass:"info-box"},[t._m(0),t._v(" "),a("div",{staticClass:"info-box-content"},[a("span",{staticClass:"info-box-text"},[t._v(t._s(t.$t("firefly.balance")))]),t._v(" "),t._l(t.prefCurrencyBalances,(function(e){return a("span",{staticClass:"info-box-number",attrs:{title:e.sub_title}},[t._v(t._s(e.value_parsed))])})),t._v(" "),t._m(1),t._v(" "),a("span",{staticClass:"progress-description"},[t._l(t.notPrefCurrencyBalances,(function(e,s){return a("span",{attrs:{title:e.sub_title}},[t._v("\n "+t._s(e.value_parsed)),s+1!==t.notPrefCurrencyBalances.length?a("span",[t._v(", ")]):t._e()])})),t._v(" "),0===t.notPrefCurrencyBalances.length?a("span",[t._v(" ")]):t._e()],2)],2)])]),t._v(" "),a("div",{staticClass:"col"},[a("div",{staticClass:"info-box"},[t._m(2),t._v(" "),a("div",{staticClass:"info-box-content"},[a("span",{staticClass:"info-box-text"},[t._v(t._s(t.$t("firefly.bills_to_pay")))]),t._v(" "),t._l(t.prefBillsUnpaid,(function(e){return a("span",{staticClass:"info-box-number"},[t._v(t._s(e.value_parsed))])})),t._v(" "),t._m(3),t._v(" "),a("span",{staticClass:"progress-description"},[t._l(t.notPrefBillsUnpaid,(function(e,s){return a("span",[t._v("\n "+t._s(e.value_parsed)),s+1!==t.notPrefBillsUnpaid.length?a("span",[t._v(", ")]):t._e()])})),t._v(" "),0===t.notPrefBillsUnpaid.length?a("span",[t._v(" ")]):t._e()],2)],2)])]),t._v(" "),a("div",{staticClass:"col"},[a("div",{staticClass:"info-box"},[t._m(4),t._v(" "),a("div",{staticClass:"info-box-content"},[a("span",{staticClass:"info-box-text"},[t._v(t._s(t.$t("firefly.left_to_spend")))]),t._v(" "),t._l(t.prefLeftToSpend,(function(e){return a("span",{staticClass:"info-box-number",attrs:{title:e.sub_title}},[t._v(t._s(e.value_parsed))])})),t._v(" "),t._m(5),t._v(" "),a("span",{staticClass:"progress-description"},[t._l(t.notPrefLeftToSpend,(function(e,s){return a("span",[t._v("\n "+t._s(e.value_parsed)),s+1!==t.notPrefLeftToSpend.length?a("span",[t._v(", ")]):t._e()])})),t._v(" "),0===t.notPrefLeftToSpend.length?a("span",[t._v(" ")]):t._e()],2)],2)])]),t._v(" "),a("div",{staticClass:"col"},[a("div",{staticClass:"info-box"},[t._m(6),t._v(" "),a("div",{staticClass:"info-box-content"},[a("span",{staticClass:"info-box-text"},[a("span",[t._v(t._s(t.$t("firefly.net_worth")))])]),t._v(" "),t._l(t.prefNetWorth,(function(e){return a("span",{staticClass:"info-box-number",attrs:{title:e.sub_title}},[t._v(t._s(e.value_parsed))])})),t._v(" "),t._m(7),t._v(" "),a("span",{staticClass:"progress-description"},[t._l(t.notPrefNetWorth,(function(e,s){return a("span",[t._v("\n "+t._s(e.value_parsed)),s+1!==t.notPrefNetWorth.length?a("span",[t._v(", ")]):t._e()])})),t._v(" "),0===t.notPrefNetWorth.length?a("span",[t._v(" ")]):t._e()],2)],2)])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"info-box-icon"},[e("i",{staticClass:"far fa-bookmark text-info"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"progress bg-info"},[e("div",{staticClass:"progress-bar",staticStyle:{width:"0"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"info-box-icon"},[e("i",{staticClass:"far fa-calendar-alt text-teal"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"progress bg-teal"},[e("div",{staticClass:"progress-bar",staticStyle:{width:"0"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"info-box-icon"},[e("i",{staticClass:"fas fa-money-bill text-success"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"progress bg-success"},[e("div",{staticClass:"progress-bar",staticStyle:{width:"0"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"info-box-icon"},[e("i",{staticClass:"fas fa-money-bill text-success"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"progress bg-success"},[e("div",{staticClass:"progress-bar",staticStyle:{width:"0"}})])}],!1,null,null,null).exports,o={name:"DataConverter",data:function(){return{dataSet:null,newDataSet:null,locale:localStorage.local}},methods:{convertChart:function(t){return this.dataSet=t,this.newDataSet={count:0,labels:[],datasets:[]},this.getLabels(),this.getDataSets(),this.newDataSet.count=this.newDataSet.datasets.length,this.newDataSet},colorizeBarData:function(t){this.dataSet=t,this.newDataSet={count:0,labels:[],datasets:[]};for(var e=[[53,124,165],[0,141,76],[219,139,11],[202,25,90],[85,82,153],[66,133,244],[219,68,55],[244,180,0],[15,157,88],[171,71,188],[0,172,193],[255,112,67],[158,157,36],[92,107,192],[240,98,146],[0,121,107],[194,24,91]],a=[],s=0;s<e.length;s++)a.push("rgba("+e[s][0]+", "+e[s][1]+", "+e[s][2]+", 0.5)");for(var r in this.newDataSet.labels=this.dataSet.labels,this.newDataSet.count=this.dataSet.count,this.dataSet.datasets)if(this.dataSet.datasets.hasOwnProperty(r)){var n=this.dataSet.datasets[r];n.fill=!1,n.backgroundColor=n.borderColor=a[r],this.newDataSet.datasets.push(n)}return this.newDataSet},colorizeLineData:function(t){this.dataSet=t,this.newDataSet={count:0,labels:[],datasets:[]};for(var e=[[53,124,165],[0,141,76],[219,139,11],[202,25,90],[85,82,153],[66,133,244],[219,68,55],[244,180,0],[15,157,88],[171,71,188],[0,172,193],[255,112,67],[158,157,36],[92,107,192],[240,98,146],[0,121,107],[194,24,91]],a=[],s=0;s<e.length;s++)a.push("rgba("+e[s][0]+", "+e[s][1]+", "+e[s][2]+", 0.5)");for(var r in this.newDataSet.labels=this.dataSet.labels,this.newDataSet.count=this.dataSet.count,this.dataSet.datasets)if(this.dataSet.datasets.hasOwnProperty(r)){var n=this.dataSet.datasets[r];n.fill=!1,n.backgroundColor=n.borderColor=a[r],this.newDataSet.datasets.push(n)}return this.newDataSet},convertLabelsToDate:function(t){for(var e in t.labels)if(t.labels.hasOwnProperty(e)){var a=Date.parse(t.labels[e]);t.labels[e]=new Intl.DateTimeFormat(this.locale).format(a)}return t},getLabels:function(){var t=this.dataSet[0];if(void 0!==t)for(var e in t.entries)t.entries.hasOwnProperty(e)&&this.newDataSet.labels.push(e)},getDataSets:function(){for(var t in this.dataSet)if(this.dataSet.hasOwnProperty(t)){var e={},a=this.dataSet[t];if(void 0!==a){for(var s in e.label=a.label,e.type=a.type,e.currency_symbol=a.currency_symbol,e.currency_code=a.currency_code,e.yAxisID=a.yAxisID,e.data=[],a.entries)a.entries.hasOwnProperty(s)&&e.data.push(a.entries[s]);this.newDataSet.datasets.push(e)}}}}},l=Object(r.a)(o,void 0,void 0,!1,null,null,null).exports,u={name:"DefaultLineOptions",data:function(){return{}},methods:{formatLabel:function(t,e){var a=[],s=(t=String(t)).split(" "),r="";return s.forEach((function(t,n){if(r.length>0){var i=r+" "+t;if(!(i.length>e))return n===s.length-1?void a.push(i):void(r=i);a.push(r),r=""}n!==s.length-1&&t.length<e?r=t:a.push(t)})),a},getDefaultOptions:function(){var t=this;return{legend:{display:!1},animation:{duration:0},responsive:!0,maintainAspectRatio:!1,elements:{line:{cubicInterpolationMode:"monotone"}},scales:{xAxes:[{gridLines:{display:!1},ticks:{callback:function(e,a,s){var r=new Date(e),n=new Intl.DateTimeFormat(localStorage.locale,{year:"numeric",month:"long",day:"numeric"}).format(r);return t.formatLabel(n,20)}}}],yAxes:[{display:!0,ticks:{callback:function(t){var e=this.chart.data.datasets[0].currency_code?this.chart.data.datasets[0].currency_code:"EUR";return new Intl.NumberFormat(localStorage.locale,{style:"currency",currency:e}).format(t)},beginAtZero:!0}}]},tooltips:{mode:"index",callbacks:{label:function(t,e){var a=e.datasets[t.datasetIndex].currency_code?e.datasets[t.datasetIndex].currency_code:"EUR",s=new Intl.NumberFormat(localStorage.locale,{style:"currency",currency:a}).format(t.yLabel);return e.datasets[t.datasetIndex].label+": "+s}}}}}}},d=Object(r.a)(u,(function(){var t=this.$createElement;return(this._self._c||t)("div")}),[],!1,null,"55cd0635",null).exports,_={name:"MainAccount",created:function(){axios.get("./api/v1/chart/account/overview?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(t){var e=l.methods.convertChart(t.data);e=l.methods.colorizeLineData(e);var a=$("#mainAccountsChart").get(0).getContext("2d");new Chart(a,{type:"line",data:e,options:d.methods.getDefaultOptions()})}))}},p=Object(r.a)(_,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.yourAccounts")))])]),t._v(" "),t._m(0),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./accounts/asset"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_asset_accounts")))])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"card-body"},[e("div",[e("canvas",{staticStyle:{"min-height":"400px",height:"400px","max-height":"400px","max-width":"100%"},attrs:{id:"mainAccountsChart"}})])])}],!1,null,null,null).exports,f={name:"MainAccountList",data:function(){return{accounts:[],locale:"en-US"}},created:function(){var t,e=this;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",axios.get("./api/v1/preferences/frontpageAccounts").then((function(t){e.loadAccounts(t)}))},methods:{loadAccounts:function(t){var e=t.data.data.attributes.data;for(var a in e)e.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294&&(this.accounts.push({id:e[a],title:"",url:"",current_balance:"",currency_code:"",transactions:[]}),this.loadSingleAccount(a,e[a]))},loadSingleAccount:function(t,e){var a=this;axios.get("./api/v1/accounts/"+e).then((function(s){a.accounts[t].title=s.data.data.attributes.name,a.accounts[t].url="./accounts/show/"+s.data.data.id,a.accounts[t].current_balance=s.data.data.attributes.current_balance,a.accounts[t].currency_code=s.data.data.attributes.currency_code,a.loadTransactions(t,e)}))},loadTransactions:function(t,e){var a=this;axios.get("./api/v1/accounts/"+e+"/transactions?page=1&limit=10").then((function(e){a.accounts[t].transactions=e.data.data}))}}},m=Object(r.a)(f,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"row"},t._l(t.accounts,(function(e){return a("div",{class:{"col-lg-12":1===t.accounts.length,"col-lg-6":2===t.accounts.length,"col-lg-4":t.accounts.length>2}},[a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[a("a",{attrs:{href:e.url}},[t._v(t._s(e.title))])]),t._v(" "),a("div",{staticClass:"card-tools"},[a("span",{class:parseFloat(e.current_balance)<0?"text-danger":"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(parseFloat(e.current_balance)))+"\n ")])])]),t._v(" "),a("div",{staticClass:"card-body table-responsive p-0"},[1===t.accounts.length?a("transaction-list-large",{attrs:{transactions:e.transactions,account_id:e.id}}):t._e(),t._v(" "),2===t.accounts.length?a("transaction-list-medium",{attrs:{transactions:e.transactions,account_id:e.id}}):t._e(),t._v(" "),t.accounts.length>2?a("transaction-list-small",{attrs:{transactions:e.transactions,account_id:e.id}}):t._e()],1)])])})),0)}),[],!1,null,"2561f762",null).exports,b={name:"MainBillsList",created:function(){var t,e=this;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",axios.get("./api/v1/bills?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(t){e.loadBills(t.data.data)}))},components:{},methods:{renderPaidDate:function(t){console.log(t);var e=new Intl.DateTimeFormat(this.locale,{year:"numeric",month:"long",day:"numeric"}).format(new Date(t.date)),a=this.$t("firefly.bill_paid_on",{date:e});return'<a href="./transactions/show/'+t.transaction_group_id+'" title="'+a+'">'+a+"</a>"},loadBills:function(t){for(var e in t)if(t.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t[e],s=a.attributes.active;a.attributes.pay_dates.length>0&&s&&this.bills.push(a)}}},data:function(){return{bills:[],locale:"en-US"}}},v=Object(r.a)(b,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.bills")))])]),t._v(" "),a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-striped"},[a("caption",{staticStyle:{display:"none"}},[t._v(t._s(t.$t("firefly.bills")))]),t._v(" "),a("thead",[a("tr",[a("th",{staticStyle:{width:"35%"},attrs:{scope:"col"}},[t._v(t._s(t.$t("list.name")))]),t._v(" "),a("th",{staticStyle:{width:"25%"},attrs:{scope:"col"}},[t._v(t._s(t.$t("list.next_expected_match")))])])]),t._v(" "),a("tbody",t._l(this.bills,(function(e){return a("tr",[a("td",[a("a",{attrs:{href:"./bills/show/"+e.id,title:e.attributes.name}},[t._v(t._s(e.attributes.name))]),t._v("\n (~ "),a("span",{staticClass:"text-danger"},[t._v(t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.attributes.currency_code}).format((parseFloat(e.attributes.amount_min)+parseFloat(e.attributes.amount_max))/-2)))]),t._v(")\n "),e.attributes.object_group_title?a("small",{staticClass:"text-muted"},[a("br"),t._v("\n "+t._s(e.attributes.object_group_title)+"\n ")]):t._e()]),t._v(" "),a("td",[t._l(e.attributes.paid_dates,(function(e){return a("span",[a("span",{domProps:{innerHTML:t._s(t.renderPaidDate(e))}}),a("br")])})),t._v(" "),t._l(e.attributes.pay_dates,(function(s){return 0===e.attributes.paid_dates.length?a("span",[t._v("\n "+t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(new Date(s)))),a("br")]):t._e()}))],2)])})),0)])]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./bills"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_bills")))])])])}),[],!1,null,null,null).exports,h={name:"BudgetLimitRow",created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},data:function(){return{locale:"en-US"}},props:{budgetLimit:{type:Object,default:function(){return{}}},budget:{type:Object,default:function(){return{}}}}},g=Object(r.a)(h,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("tr",[a("td",{staticStyle:{width:"25%"}},[a("a",{attrs:{href:"./budgets/show/"+t.budgetLimit.budget_id}},[t._v(t._s(t.budgetLimit.budget_name))])]),t._v(" "),a("td",{staticStyle:{"vertical-align":"middle"}},[a("div",{staticClass:"progress progress active"},[a("div",{staticClass:"progress-bar bg-success progress-bar-striped",style:"width: "+t.budgetLimit.pctGreen+"%;",attrs:{role:"progressbar","aria-valuenow":t.budgetLimit.pctGreen,"aria-valuemin":"0","aria-valuemax":"100"}},[t.budgetLimit.pctGreen>35?a("span",[t._v("\n Spent\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.spent))+"\n of\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.amount))+"\n ")]):t._e()]),t._v(" "),a("div",{staticClass:"progress-bar bg-warning progress-bar-striped",style:"width: "+t.budgetLimit.pctOrange+"%;",attrs:{role:"progressbar","aria-valuenow":t.budgetLimit.pctOrange,"aria-valuemin":"0","aria-valuemax":"100"}},[t.budgetLimit.pctRed<=50&&t.budgetLimit.pctOrange>35?a("span",[t._v("\n Spent\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.spent))+"\n of\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.amount))+"\n ")]):t._e()]),t._v(" "),a("div",{staticClass:"progress-bar bg-danger progress-bar-striped",style:"width: "+t.budgetLimit.pctRed+"%;",attrs:{role:"progressbar","aria-valuenow":t.budgetLimit.pctRed,"aria-valuemin":"0","aria-valuemax":"100"}},[t.budgetLimit.pctOrange<=50&&t.budgetLimit.pctRed>35?a("span",[t._v("\n Spent\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.spent))+"\n of\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.amount))+"\n ")]):t._e()])]),t._v(" "),a("small",{staticClass:"d-none d-lg-block"},[t._v("\n "+t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(t.budgetLimit.start))+"\n →\n "+t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(t.budgetLimit.end))+"\n ")])]),t._v(" "),a("td",{staticClass:"align-middle d-none d-lg-table-cell",staticStyle:{width:"10%"}},[parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)>0?a("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)))+"\n ")]):t._e(),t._v(" "),0===parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)?a("span",{staticClass:"text-muted"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(0))+"\n ")]):t._e(),t._v(" "),parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)<0?a("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)))+"\n ")]):t._e()])])}),[],!1,null,"3f6fd164",null).exports,y={name:"BudgetRow",created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},data:function(){return{locale:"en-US"}},props:{budget:{type:Object,default:{}}}},C={name:"BudgetListGroup",components:{BudgetLimitRow:g,BudgetRow:Object(r.a)(y,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("tr",[a("td",{staticStyle:{width:"25%"}},[a("a",{attrs:{href:"./budgets/show/"+t.budget.id}},[t._v(t._s(t.budget.name))])]),t._v(" "),a("td",{staticClass:"align-middle text-right"},[a("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budget.currency_code}).format(parseFloat(t.budget.spent)))+"\n ")])])])}),[],!1,null,"d11bf024",null).exports},props:{title:String,budgetLimits:Array,budgets:Array}},w={name:"MainBudgetList",components:{BudgetListGroup:Object(r.a)(C,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.title))])]),t._v(" "),a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-sm"},[a("tbody",[t._l(t.budgetLimits,(function(t,e){return a("BudgetLimitRow",{key:e,attrs:{budgetLimit:t}})})),t._v(" "),t._l(t.budgets,(function(t,e){return a("BudgetRow",{key:e,attrs:{budget:t}})}))],2)])]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./budgets"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_budgets")))])])])}),[],!1,null,"1480b15a",null).exports},data:function(){return{budgetList:["daily","weekly","monthly","quarterly","half_year","yearly","other"],budgetLimits:{daily:[],weekly:[],monthly:[],quarterly:[],half_year:[],yearly:[],other:[]},budgets:{},rawBudgets:[],locale:"en-US"}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.collectData()},methods:{collectData:function(){this.getBudgets()},getBudgets:function(){var t=this;axios.get("./api/v1/budgets?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.parseBudgets(e.data)}))},parseBudgets:function(t){for(var e in t.data)if(t.data.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t.data[e];for(var s in a.attributes.spent)if(a.attributes.spent.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294){var r=a.attributes.spent[s];this.rawBudgets.push({id:parseInt(a.id),name:a.attributes.name,currency_id:parseInt(r.currency_id),currency_code:r.currency_code,spent:r.sum})}}this.getBudgetLimits()},getBudgetLimits:function(){var t=this;axios.get("./api/v1/budgets/limits?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.parseBudgetLimits(e.data)}))},parseBudgetLimits:function(t){for(var e in t.included)t.included.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294&&(this.budgets[t.included[e].id]={id:t.included[e].id,name:t.included[e].attributes.name});for(var a in t.data)if(t.data.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294){var s,r=0,n=0,i=0;this.filterBudgets(t.data[a].attributes.budget_id,t.data[a].attributes.currency_id),0!==parseFloat(t.data[a].attributes.spent)&&-1*parseFloat(t.data[a].attributes.spent)<parseFloat(t.data[a].attributes.amount)&&(r=-1*parseFloat(t.data[a].attributes.spent)/parseFloat(t.data[a].attributes.amount)*100),0!==parseFloat(t.data[a].attributes.spent)&&-1*parseFloat(t.data[a].attributes.spent)>parseFloat(t.data[a].attributes.amount)&&(i=100-(n=parseFloat(t.data[a].attributes.amount)/parseFloat(t.data[a].attributes.spent)*-1*100));var c={id:t.data[a].id,amount:t.data[a].attributes.amount,budget_id:t.data[a].attributes.budget_id,budget_name:this.budgets[t.data[a].attributes.budget_id].name,currency_id:t.data[a].attributes.currency_id,currency_code:t.data[a].attributes.currency_code,period:t.data[a].attributes.period,start:new Date(t.data[a].attributes.start),end:new Date(t.data[a].attributes.end),spent:t.data[a].attributes.spent,pctGreen:r,pctOrange:n,pctRed:i},o=null!==(s=t.data[a].attributes.period)&&void 0!==s?s:"other";this.budgetLimits[o].push(c)}},filterBudgets:function(t,e){for(var a in this.rawBudgets)this.rawBudgets.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294&&this.rawBudgets[a].currency_id===e&&this.rawBudgets[a].id===t&&this.rawBudgets.splice(a,1)}}},x=Object(r.a)(w,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"row"},[t.budgetLimits.daily.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{title:t.$t("firefly.daily_budgets"),budgetLimits:t.budgetLimits.daily}})],1):t._e(),t._v(" "),t.budgetLimits.weekly.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{title:t.$t("firefly.weekly_budgets"),budgetLimits:t.budgetLimits.weekly}})],1):t._e(),t._v(" "),t.budgetLimits.monthly.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{title:t.$t("firefly.monthly_budgets"),budgetLimits:t.budgetLimits.monthly}})],1):t._e(),t._v(" "),t.budgetLimits.quarterly.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{title:t.$t("firefly.quarterly_budgets"),budgetLimits:t.budgetLimits.quarterly}})],1):t._e(),t._v(" "),t.budgetLimits.half_year.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{title:t.$t("firefly.half_year_budgets"),budgetLimits:t.budgetLimits.half_year}})],1):t._e(),t._v(" "),t.budgetLimits.yearly.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{title:t.$t("firefly.yearly_budgets"),budgetLimits:t.budgetLimits.yearly}})],1):t._e(),t._v(" "),t.budgetLimits.other.length>0||t.rawBudgets.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{title:t.$t("firefly.other_budgets"),budgetLimits:t.budgetLimits.other,budgets:t.rawBudgets}})],1):t._e()])])}),[],!1,null,"f0d512f0",null).exports,j={name:"MainCreditList",data:function(){return{locale:"en-US",income:[],max:0}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.getExpenses()},methods:{getExpenses:function(){var t=this;axios.get("./api/v1/insight/income/date/basic?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.parseExpenses(e.data)}))},parseExpenses:function(t){for(var e in t)if(t.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t[e];0===parseInt(e)&&(this.max=t[e].difference_float,a.pct=100),0!==parseInt(e)&&(a.pct=t[e].difference_float/this.max*100),this.income.push(a)}}}},S=Object(r.a)(j,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.revenue_accounts")))])]),t._v(" "),a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-sm"},[a("tbody",t._l(t.income,(function(e){return a("tr",[a("td",{staticStyle:{width:"20%"}},[a("a",{attrs:{href:"./accounts/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),a("td",{staticClass:"align-middle"},[e.pct>0?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar progress-bar-striped bg-success",style:{width:e.pct+"%"},attrs:{role:"progressbar","aria-valuenow":e.pct,"aria-valuemin":"0","aria-valuemax":"100"}},[e.pct>20?a("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]),t._v(" "),e.pct<=20?a("span",[t._v(" \n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]):t._e()])])})),0)])]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./transactions/deposit"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_deposits")))])])])}),[],!1,null,null,null).exports,L={name:"MainDebitList",data:function(){return{locale:"en-US",expenses:[],max:0}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.getExpenses()},methods:{getExpenses:function(){var t=this;axios.get("./api/v1/insight/expense/date/basic?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.parseExpenses(e.data)}))},parseExpenses:function(t){for(var e in t)if(t.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t[e];0===parseInt(e)&&(this.max=t[e].difference_float,a.pct=100),0!==parseInt(e)&&(a.pct=t[e].difference_float/this.max*100),this.expenses.push(a)}}}},F=Object(r.a)(L,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.expense_accounts")))])]),t._v(" "),a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-sm"},[a("tbody",t._l(t.expenses,(function(e){return a("tr",[a("td",{staticStyle:{width:"20%"}},[a("a",{attrs:{href:"./accounts/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),a("td",{staticClass:"align-middle"},[e.pct>0?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar progress-bar-striped bg-danger",style:{width:e.pct+"%"},attrs:{role:"progressbar","aria-valuenow":e.pct,"aria-valuemin":"0","aria-valuemax":"100"}},[e.pct>20?a("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]),t._v(" "),e.pct<=20?a("span",[t._v(" \n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]):t._e()])])})),0)])]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./transactions/withdrawal"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_withdrawals")))])])])}),[],!1,null,null,null).exports,O={name:"MainPiggyList",created:function(){var t=this;axios.get("./api/v1/piggy_banks").then((function(e){t.loadPiggyBanks(e.data.data)}))},computed:{locale:function(){return this.$store.getters.locale}},methods:{loadPiggyBanks:function(t){for(var e in t)if(t.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t[e];0!==parseFloat(a.attributes.left_to_save)&&(a.attributes.pct=parseFloat(a.attributes.current_amount)/parseFloat(a.attributes.target_amount)*100,this.piggy_banks.push(a))}this.piggy_banks.sort((function(t,e){return e.attributes.pct-t.attributes.pct}))}},data:function(){return{piggy_banks:[]}}},P=Object(r.a)(O,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.piggy_banks")))])]),t._v(" "),a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-striped"},[a("caption",{staticStyle:{display:"none"}},[t._v(t._s(t.$t("firefly.piggy_banks")))]),t._v(" "),a("thead",[a("tr",[a("th",{staticStyle:{width:"35%"},attrs:{scope:"col"}},[t._v(t._s(t.$t("list.piggy_bank")))]),t._v(" "),a("th",{staticStyle:{width:"40%"},attrs:{scope:"col"}},[t._v(t._s(t.$t("list.percentage"))+" "),a("small",[t._v("/ "+t._s(t.$t("list.amount")))])])])]),t._v(" "),a("tbody",t._l(this.piggy_banks,(function(e){return a("tr",[a("td",[a("a",{attrs:{href:"./piggy-banks/show/"+e.id,title:e.attributes.name}},[t._v(t._s(e.attributes.name))]),t._v(" "),e.attributes.object_group_title?a("small",{staticClass:"text-muted"},[a("br"),t._v("\n "+t._s(e.attributes.object_group_title)+"\n ")]):t._e()]),t._v(" "),a("td",[a("div",{staticClass:"progress-group"},[a("div",{staticClass:"progress progress-sm"},[e.attributes.pct<100?a("div",{staticClass:"progress-bar progress-bar-striped primary",style:{width:e.attributes.pct+"%"}}):t._e(),t._v(" "),100===e.attributes.pct?a("div",{staticClass:"progress-bar progress-bar-striped bg-success",style:{width:e.attributes.pct+"%"}}):t._e()])]),t._v(" "),a("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.attributes.currency_code}).format(e.attributes.current_amount))+"\n ")]),t._v("\n of\n "),a("span",{staticClass:"text-success"},[t._v(t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.attributes.currency_code}).format(e.attributes.target_amount)))])])])})),0)])]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./piggy-banks"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_piggies")))])])])}),[],!1,null,"23063114",null).exports,k={name:"TransactionListLarge",data:function(){return{locale:"en-US"}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},props:{transactions:{type:Array,default:function(){return[]}},account_id:{type:Number,default:function(){return 0}}}},I=Object(r.a)(k,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",{staticClass:"table table-striped table-sm"},[a("caption",{staticStyle:{display:"none"}},[t._v(t._s(t.$t("firefly.transaction_table_description")))]),t._v(" "),a("thead",[a("tr",[a("th",{staticClass:"text-left",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.description")))]),t._v(" "),a("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.opposing_account")))]),t._v(" "),a("th",{staticClass:"text-right",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.amount")))]),t._v(" "),a("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.category")))]),t._v(" "),a("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.budget")))])])]),t._v(" "),a("tbody",t._l(this.transactions,(function(e){return a("tr",[a("td",[a("a",{attrs:{href:"transactions/show/"+e.id,title:e.date}},[e.attributes.transactions.length>1?a("span",[t._v(t._s(e.attributes.group_title))]):t._e(),t._v(" "),1===e.attributes.transactions.length?a("span",[t._v(t._s(e.attributes.transactions[0].description))]):t._e()])]),t._v(" "),a("td",t._l(e.attributes.transactions,(function(e){return a("span",["withdrawal"===e.type?a("a",{attrs:{href:"accounts/show/"+e.destination_id}},[t._v(t._s(e.destination_name))]):t._e(),t._v(" "),"deposit"===e.type?a("a",{attrs:{href:"accounts/show/"+e.source_id}},[t._v(t._s(e.source_name))]):t._e(),t._v(" "),"transfer"===e.type&&e.source_id===t.account_id?a("a",{attrs:{href:"accounts/show/"+e.destination_id}},[t._v(t._s(e.destination_name))]):t._e(),t._v(" "),"transfer"===e.type&&e.destination_id===t.account_id?a("a",{attrs:{href:"accounts/show/"+e.source_id}},[t._v(t._s(e.source_name))]):t._e(),t._v(" "),a("br")])})),0),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},t._l(e.attributes.transactions,(function(e){return a("span",["withdrawal"===e.type?a("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"deposit"===e.type?a("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&e.source_id===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&e.destination_id===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e()])})),0),t._v(" "),a("td",t._l(e.attributes.transactions,(function(e){return a("span",[0!==e.category_id?a("a",{attrs:{href:"categories/show/"+e.category_id}},[t._v(t._s(e.category_name))]):t._e(),a("br")])})),0),t._v(" "),a("td",t._l(e.attributes.transactions,(function(e){return a("span",[0!==e.budget_id?a("a",{attrs:{href:"budgets/show/"+e.budget_id}},[t._v(t._s(e.budget_name))]):t._e(),a("br")])})),0)])})),0)])}),[],!1,null,"34d0e586",null).exports,E={name:"TransactionListMedium",data:function(){return{locale:"en-US"}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},props:{transactions:{type:Array,default:function(){return[]}},account_id:{type:Number,default:function(){return 0}}}},B=Object(r.a)(E,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",{staticClass:"table table-striped table-sm"},[a("caption",{staticStyle:{display:"none"}},[t._v(t._s(t.$t("firefly.transaction_table_description")))]),t._v(" "),a("thead",[a("tr",[a("th",{staticClass:"text-left",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.description")))]),t._v(" "),a("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.opposing_account")))]),t._v(" "),a("th",{staticClass:"text-right",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.amount")))])])]),t._v(" "),a("tbody",t._l(this.transactions,(function(e){return a("tr",[a("td",[a("a",{attrs:{href:"transactions/show/"+e.id,title:e.date}},[e.attributes.transactions.length>1?a("span",[t._v(t._s(e.attributes.group_title))]):t._e(),t._v(" "),1===e.attributes.transactions.length?a("span",[t._v(t._s(e.attributes.transactions[0].description))]):t._e()])]),t._v(" "),a("td",t._l(e.attributes.transactions,(function(e){return a("span",["withdrawal"===e.type?a("a",{attrs:{href:"accounts/show/"+e.destination_id}},[t._v(t._s(e.destination_name))]):t._e(),t._v(" "),"deposit"===e.type?a("a",{attrs:{href:"accounts/show/"+e.source_id}},[t._v(t._s(e.source_name))]):t._e(),t._v(" "),"transfer"===e.type&&e.source_id===t.account_id?a("a",{attrs:{href:"accounts/show/"+e.destination_id}},[t._v(t._s(e.destination_name))]):t._e(),t._v(" "),"transfer"===e.type&&e.destination_id===t.account_id?a("a",{attrs:{href:"accounts/show/"+e.source_id}},[t._v(t._s(e.source_name))]):t._e(),t._v(" "),a("br")])})),0),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},t._l(e.attributes.transactions,(function(e){return a("span",["withdrawal"===e.type?a("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"deposit"===e.type?a("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&e.source_id===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&e.destination_id===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e()])})),0)])})),0)])}),[],!1,null,"0529228f",null).exports,D={name:"TransactionListSmall",data:function(){return{locale:"en-US"}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},methods:{},props:{transactions:{type:Array,default:function(){return[]}},account_id:{type:Number,default:function(){return 0}}}},N=Object(r.a)(D,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",{staticClass:"table table-striped table-sm"},[a("caption",{staticStyle:{display:"none"}},[t._v(t._s(t.$t("firefly.transaction_table_description")))]),t._v(" "),a("thead",[a("tr",[a("th",{staticClass:"text-left",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.description")))]),t._v(" "),a("th",{staticClass:"text-right",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.amount")))])])]),t._v(" "),a("tbody",t._l(this.transactions,(function(e){return a("tr",[a("td",[a("a",{attrs:{href:"transactions/show/"+e.id,title:new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(new Date(e.attributes.transactions[0].date))}},[e.attributes.transactions.length>1?a("span",[t._v(t._s(e.attributes.group_title))]):t._e(),t._v(" "),1===e.attributes.transactions.length?a("span",[t._v(t._s(e.attributes.transactions[0].description))]):t._e()])]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},t._l(e.attributes.transactions,(function(e){return a("span",["withdrawal"===e.type?a("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"deposit"===e.type?a("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&e.source_id===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&e.destination_id===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e()])})),0)])})),0)])}),[],!1,null,"fae12aa6",null).exports,U=a(227),T=a.n(U),z={name:"Calendar",created:function(){},data:function(){return{locale:"en-US",range:{start:new Date(window.sessionStart),end:new Date(window.sessionEnd)},defaultRange:{start:new Date(window.sessionStart),end:new Date(window.sessionEnd)}}}},A=(a(238),Object(r.a)(z,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[t._v("Start")]),t._v(" "),a("div",{staticClass:"col-8"},[t._v(t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(t.range.start)))])]),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[t._v("End")]),t._v(" "),a("div",{staticClass:"col-8"},[t._v(t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(t.range.end)))])]),t._v(" "),a("date-picker",{attrs:{mode:"date",rows:"2","is-range":""},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.inputValue,r=e.inputEvents,n=e.isDragging,i=e.togglePopover;return[a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("div",{staticClass:"btn-group btn-group-sm d-flex"},[a("button",{staticClass:"btn btn-secondary btn-sm",on:{click:function(t){return i({placement:"auto-start",positionFixed:!0})}}},[a("i",{staticClass:"fas fa-calendar-alt"})]),t._v(" "),a("button",{staticClass:"btn btn-secondary"},[a("i",{staticClass:"fas fa-history"})]),t._v(" "),a("button",{staticClass:"btn btn-secondary dropdown-toggle",attrs:{type:"button",id:"dropdownMenuButton","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[a("i",{staticClass:"fas fa-list"})]),t._v(" "),a("div",{staticClass:"dropdown-menu",attrs:{"aria-labelledby":"dropdownMenuButton"}},[a("a",{staticClass:"dropdown-item",attrs:{href:"#"}},[t._v("(prev period)")]),t._v(" "),a("a",{staticClass:"dropdown-item",attrs:{href:"#"}},[t._v("(next period)")]),t._v(" "),a("a",{staticClass:"dropdown-item",attrs:{href:"#"}},[t._v("(this week?)")])])]),t._v(" "),a("input",t._g({class:n?"text-gray-600":"text-gray-900",attrs:{type:"hidden"},domProps:{value:s.start}},r.start)),t._v(" "),a("input",t._g({class:n?"text-gray-600":"text-gray-900",attrs:{type:"hidden"},domProps:{value:s.end}},r.end))])])]}}]),model:{value:t.range,callback:function(e){t.range=e},expression:"range"}})],1)}),[],!1,null,"03e62f58",null).exports),R={name:"MainCategoryList",created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.getCategories()},data:function(){return{locale:"en-US",categories:[],sortedList:[],spent:0,earned:0}},methods:{getCategories:function(){var t=this;axios.get("./api/v1/categories?start="+window.sessionStart+"&end="+window.sessionEnd).then((function(e){t.parseCategories(e.data)}))},parseCategories:function(t){for(var e in t.data)if(t.data.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t.data[e],s=null,r=parseInt(a.id);for(var n in a.attributes.spent)if(a.attributes.spent.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294){var i,c=a.attributes.spent[n];s=c.currency_id.toString()+"-"+a.id.toString(),this.categories[s]=null!==(i=this.categories[s])&&void 0!==i?i:{id:r,name:a.attributes.name,currency_code:c.currency_code,currency_symbol:c.currency_symbol,spent:0,earned:0,spentPct:0,earnedPct:0},this.categories[s].spent=parseFloat(c.sum),this.spent=parseFloat(c.sum)<this.spent?parseFloat(c.sum):this.spent}for(var o in a.attributes.earned)if(a.attributes.earned.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294){var l,u=a.attributes.earned[o];s=u.currency_id.toString()+"-"+a.id.toString(),this.categories[s]=null!==(l=this.categories[s])&&void 0!==l?l:{id:r,name:a.attributes.name,currency_code:u.currency_code,currency_symbol:u.currency_symbol,spent:0,earned:0,spentPct:0,earnedPct:0},this.categories[s].earned=parseFloat(u.sum),this.earned=parseFloat(u.sum)>this.earned?parseFloat(u.sum):this.earned}}this.sortCategories()},sortCategories:function(){var t=[];for(var e in this.categories)this.categories.hasOwnProperty(e)&&t.push(this.categories[e]);for(var a in t.sort((function(t,e){return t.spent+t.earned-(e.spent+e.earned)})),t)if(t.hasOwnProperty(a)){var s=t[a];s.spentPct=s.spent/this.spent*100,s.earnedPct=s.earned/this.earned*100,this.sortedList.push(s)}}}},M=Object(r.a)(R,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.categories")))])]),t._v(" "),a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-sm"},[a("tbody",t._l(t.sortedList,(function(e){return a("tr",[a("td",{staticStyle:{width:"20%"}},[a("a",{attrs:{href:"./categories/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),a("td",{staticClass:"align-middle"},[e.spentPct>0?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar progress-bar-striped bg-danger",style:{width:e.spentPct+"%"},attrs:{role:"progressbar","aria-valuenow":e.spentPct,"aria-valuemin":"0","aria-valuemax":"100"}},[e.spentPct>20?a("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.spent))+"\n ")]):t._e()]),t._v(" "),e.spentPct<=20?a("span",[t._v(" \n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.spent))+"\n ")]):t._e()]):t._e(),t._v(" "),e.earnedPct>0?a("div",{staticClass:"progress justify-content-end",attrs:{title:"hello2"}},[e.earnedPct<=20?a("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.earned))+"\n ")]):t._e(),t._v(" "),a("div",{staticClass:"progress-bar progress-bar-striped bg-success",style:{width:e.earnedPct+"%"},attrs:{role:"progressbar","aria-valuenow":e.earnedPct,"aria-valuemin":"0","aria-valuemax":"100",title:"hello"}},[e.earnedPct>20?a("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.earned))+"\n ")]):t._e()])]):t._e()])])})),0)])])])}),[],!1,null,"00bc733f",null).exports,G=a(3),W=a.n(G),q=a(2),K=a(23);a(17),a(266),W.a.component("transaction-list-large",I),W.a.component("transaction-list-medium",B),W.a.component("transaction-list-small",N),W.a.component("date-picker",T.a),W.a.component("dashboard",n),W.a.component("top-boxes",c),W.a.component("main-account",p),W.a.component("main-account-list",m),W.a.component("main-bills-list",v),W.a.component("main-budget-list",x),W.a.component("main-category-list",M),W.a.component("main-debit-list",F),W.a.component("main-credit-list",S),W.a.component("main-piggy-list",P),W.a.use(q.c);var J=a(19),H={};new W.a({i18n:J,store:K.a,el:"#dashboard",render:function(t){return t(n,{props:H})},beforeCreate:function(){this.$store.commit("initialiseStore"),this.$store.dispatch("updateCurrencyPreference")}}),new W.a({i18n:J,store:K.a,el:"#calendar",render:function(t){return t(A,{props:H})}})},413:function(t,e){},52:function(t,e,a){var s=a(239);"string"==typeof s&&(s=[[t.i,s,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};a(25)(s,r);s.locals&&(t.exports=s.locals)}},[[235,0,1]]]);
|
||
//# sourceMappingURL=dashboard.js.map
|