mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
2 lines
26 KiB
JavaScript
Executable File
Vendored
2 lines
26 KiB
JavaScript
Executable File
Vendored
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{168:function(t,e,s){s(233),t.exports=s(239)},171:function(t,e,s){"use strict";s(22)},172:function(t,e,s){(t.exports=s(173)(!1)).push([t.i,".dropdown-item[data-v-03e62f58],.dropdown-item[data-v-03e62f58]:hover{color:#212529}",""])},203:function(t,e,s){var a={"./af":31,"./af.js":31,"./ar":32,"./ar-dz":33,"./ar-dz.js":33,"./ar-kw":34,"./ar-kw.js":34,"./ar-ly":35,"./ar-ly.js":35,"./ar-ma":36,"./ar-ma.js":36,"./ar-sa":37,"./ar-sa.js":37,"./ar-tn":38,"./ar-tn.js":38,"./ar.js":32,"./az":39,"./az.js":39,"./be":40,"./be.js":40,"./bg":41,"./bg.js":41,"./bm":42,"./bm.js":42,"./bn":43,"./bn-bd":44,"./bn-bd.js":44,"./bn.js":43,"./bo":45,"./bo.js":45,"./br":46,"./br.js":46,"./bs":47,"./bs.js":47,"./ca":48,"./ca.js":48,"./cs":49,"./cs.js":49,"./cv":50,"./cv.js":50,"./cy":51,"./cy.js":51,"./da":52,"./da.js":52,"./de":53,"./de-at":54,"./de-at.js":54,"./de-ch":55,"./de-ch.js":55,"./de.js":53,"./dv":56,"./dv.js":56,"./el":57,"./el.js":57,"./en-au":58,"./en-au.js":58,"./en-ca":59,"./en-ca.js":59,"./en-gb":60,"./en-gb.js":60,"./en-ie":61,"./en-ie.js":61,"./en-il":62,"./en-il.js":62,"./en-in":63,"./en-in.js":63,"./en-nz":64,"./en-nz.js":64,"./en-sg":65,"./en-sg.js":65,"./eo":66,"./eo.js":66,"./es":67,"./es-do":68,"./es-do.js":68,"./es-mx":69,"./es-mx.js":69,"./es-us":70,"./es-us.js":70,"./es.js":67,"./et":71,"./et.js":71,"./eu":72,"./eu.js":72,"./fa":73,"./fa.js":73,"./fi":74,"./fi.js":74,"./fil":75,"./fil.js":75,"./fo":76,"./fo.js":76,"./fr":77,"./fr-ca":78,"./fr-ca.js":78,"./fr-ch":79,"./fr-ch.js":79,"./fr.js":77,"./fy":80,"./fy.js":80,"./ga":81,"./ga.js":81,"./gd":82,"./gd.js":82,"./gl":83,"./gl.js":83,"./gom-deva":84,"./gom-deva.js":84,"./gom-latn":85,"./gom-latn.js":85,"./gu":86,"./gu.js":86,"./he":87,"./he.js":87,"./hi":88,"./hi.js":88,"./hr":89,"./hr.js":89,"./hu":90,"./hu.js":90,"./hy-am":91,"./hy-am.js":91,"./id":92,"./id.js":92,"./is":93,"./is.js":93,"./it":94,"./it-ch":95,"./it-ch.js":95,"./it.js":94,"./ja":96,"./ja.js":96,"./jv":97,"./jv.js":97,"./ka":98,"./ka.js":98,"./kk":99,"./kk.js":99,"./km":100,"./km.js":100,"./kn":101,"./kn.js":101,"./ko":102,"./ko.js":102,"./ku":103,"./ku.js":103,"./ky":104,"./ky.js":104,"./lb":105,"./lb.js":105,"./lo":106,"./lo.js":106,"./lt":107,"./lt.js":107,"./lv":108,"./lv.js":108,"./me":109,"./me.js":109,"./mi":110,"./mi.js":110,"./mk":111,"./mk.js":111,"./ml":112,"./ml.js":112,"./mn":113,"./mn.js":113,"./mr":114,"./mr.js":114,"./ms":115,"./ms-my":116,"./ms-my.js":116,"./ms.js":115,"./mt":117,"./mt.js":117,"./my":118,"./my.js":118,"./nb":119,"./nb.js":119,"./ne":120,"./ne.js":120,"./nl":121,"./nl-be":122,"./nl-be.js":122,"./nl.js":121,"./nn":123,"./nn.js":123,"./oc-lnc":124,"./oc-lnc.js":124,"./pa-in":125,"./pa-in.js":125,"./pl":126,"./pl.js":126,"./pt":127,"./pt-br":128,"./pt-br.js":128,"./pt.js":127,"./ro":129,"./ro.js":129,"./ru":130,"./ru.js":130,"./sd":131,"./sd.js":131,"./se":132,"./se.js":132,"./si":133,"./si.js":133,"./sk":134,"./sk.js":134,"./sl":135,"./sl.js":135,"./sq":136,"./sq.js":136,"./sr":137,"./sr-cyrl":138,"./sr-cyrl.js":138,"./sr.js":137,"./ss":139,"./ss.js":139,"./sv":140,"./sv.js":140,"./sw":141,"./sw.js":141,"./ta":142,"./ta.js":142,"./te":143,"./te.js":143,"./tet":144,"./tet.js":144,"./tg":145,"./tg.js":145,"./th":146,"./th.js":146,"./tk":147,"./tk.js":147,"./tl-ph":148,"./tl-ph.js":148,"./tlh":149,"./tlh.js":149,"./tr":150,"./tr.js":150,"./tzl":151,"./tzl.js":151,"./tzm":152,"./tzm-latn":153,"./tzm-latn.js":153,"./tzm.js":152,"./ug-cn":154,"./ug-cn.js":154,"./uk":155,"./uk.js":155,"./ur":156,"./ur.js":156,"./uz":157,"./uz-latn":158,"./uz-latn.js":158,"./uz.js":157,"./vi":159,"./vi.js":159,"./x-pseudo":160,"./x-pseudo.js":160,"./yo":161,"./yo.js":161,"./zh-cn":162,"./zh-cn.js":162,"./zh-hk":163,"./zh-hk.js":163,"./zh-mo":164,"./zh-mo.js":164,"./zh-tw":165,"./zh-tw.js":165};function r(t){var e=n(t);return s(e)}function n(t){if(!s.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}r.keys=function(){return Object.keys(a)},r.resolve=n,t.exports=r,r.id=203},22:function(t,e,s){var a=s(172);"string"==typeof a&&(a=[[t.i,a,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};s(174)(a,r);a.locals&&(t.exports=a.locals)},233:function(t,e,s){"use strict";s.r(e);var a=s(11),r=s(13),n=s(12),i=s(14),o=s(15),c={name:"BudgetLimitRow",mounted: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{}}}}},l=s(1),d=Object(l.a)(c,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("tr",[s("td",{staticStyle:{width:"25%"}},[s("a",{attrs:{href:"./budgets/show/"+t.budgetLimit.budget_id}},[t._v(t._s(t.budgetLimit.budget_name))])]),t._v(" "),s("td",{staticStyle:{"vertical-align":"middle"}},[s("div",{staticClass:"progress progress active"},[s("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?s("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(" "),s("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?s("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(" "),s("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?s("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(" "),s("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(" "),s("td",{staticClass:"align-middle d-none d-lg-table-cell",staticStyle:{width:"10%"}},[parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)>0?s("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)?s("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?s("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,"20d55ede",null).exports,u={name:"BudgetRow",mounted: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:{}}}},m={name:"BudgetListGroup",components:{BudgetLimitRow:d,BudgetRow:Object(l.a)(u,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("tr",[s("td",{staticStyle:{width:"25%"}},[s("a",{attrs:{href:"./budgets/show/"+t.budget.id}},[t._v(t._s(t.budget.name))])]),t._v(" "),s("td",{staticClass:"align-middle text-right"},[s("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,"3e0b277e",null).exports},props:{title:String,budgetLimits:Array,budgets:Array}},p={name:"MainBudgetList",components:{BudgetListGroup:Object(l.a)(m,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"card"},[s("div",{staticClass:"card-header"},[s("h3",{staticClass:"card-title"},[t._v(t._s(t.title))])]),t._v(" "),s("div",{staticClass:"card-body table-responsive p-0"},[s("table",{staticClass:"table table-sm"},[s("tbody",[t._l(t.budgetLimits,(function(t,e){return s("BudgetLimitRow",{key:e,attrs:{budgetLimit:t}})})),t._v(" "),t._l(t.budgets,(function(t,e){return s("BudgetRow",{key:e,attrs:{budget:t}})}))],2)])]),t._v(" "),s("div",{staticClass:"card-footer"},[s("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./budgets"}},[s("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 s=t.data[e];for(var a in s.attributes.spent)if(s.attributes.spent.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294){var r=s.attributes.spent[a];this.rawBudgets.push({id:parseInt(s.id),name:s.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 s in t.data)if(t.data.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294){var a,r=0,n=0,i=0;this.filterBudgets(t.data[s].attributes.budget_id,t.data[s].attributes.currency_id),0!==parseFloat(t.data[s].attributes.spent)&&-1*parseFloat(t.data[s].attributes.spent)<parseFloat(t.data[s].attributes.amount)&&(r=-1*parseFloat(t.data[s].attributes.spent)/parseFloat(t.data[s].attributes.amount)*100),0!==parseFloat(t.data[s].attributes.spent)&&-1*parseFloat(t.data[s].attributes.spent)>parseFloat(t.data[s].attributes.amount)&&(i=100-(n=parseFloat(t.data[s].attributes.amount)/parseFloat(t.data[s].attributes.spent)*-1*100));var o={id:t.data[s].id,amount:t.data[s].attributes.amount,budget_id:t.data[s].attributes.budget_id,budget_name:this.budgets[t.data[s].attributes.budget_id].name,currency_id:t.data[s].attributes.currency_id,currency_code:t.data[s].attributes.currency_code,period:t.data[s].attributes.period,start:new Date(t.data[s].attributes.start),end:new Date(t.data[s].attributes.end),spent:t.data[s].attributes.spent,pctGreen:r,pctOrange:n,pctRed:i},c=null!==(a=t.data[s].attributes.period)&&void 0!==a?a:"other";this.budgetLimits[c].push(o)}},filterBudgets:function(t,e){for(var s in this.rawBudgets)this.rawBudgets.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294&&this.rawBudgets[s].currency_id===e&&this.rawBudgets[s].id===t&&this.rawBudgets.splice(s,1)}}},g=Object(l.a)(p,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("div",{staticClass:"row"},[t.budgetLimits.daily.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.daily_budgets"),budgetLimits:t.budgetLimits.daily}})],1):t._e(),t._v(" "),t.budgetLimits.weekly.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.weekly_budgets"),budgetLimits:t.budgetLimits.weekly}})],1):t._e(),t._v(" "),t.budgetLimits.monthly.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.monthly_budgets"),budgetLimits:t.budgetLimits.monthly}})],1):t._e(),t._v(" "),t.budgetLimits.quarterly.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.quarterly_budgets"),budgetLimits:t.budgetLimits.quarterly}})],1):t._e(),t._v(" "),t.budgetLimits.half_year.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.half_year_budgets"),budgetLimits:t.budgetLimits.half_year}})],1):t._e(),t._v(" "),t.budgetLimits.yearly.length>0?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("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?s("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[s("BudgetListGroup",{attrs:{title:t.$t("firefly.other_budgets"),budgetLimits:t.budgetLimits.other,budgets:t.rawBudgets}})],1):t._e()])])}),[],!1,null,"f0d512f0",null).exports,b={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 s=t[e];0===parseInt(e)&&(this.max=t[e].difference_float,s.pct=100),0!==parseInt(e)&&(s.pct=t[e].difference_float/this.max*100),this.income.push(s)}}}},f=Object(l.a)(b,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"card"},[s("div",{staticClass:"card-header"},[s("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.revenue_accounts")))])]),t._v(" "),s("div",{staticClass:"card-body table-responsive p-0"},[s("table",{staticClass:"table table-sm"},[s("tbody",t._l(t.income,(function(e){return s("tr",[s("td",{staticStyle:{width:"20%"}},[s("a",{attrs:{href:"./accounts/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),s("td",{staticClass:"align-middle"},[e.pct>0?s("div",{staticClass:"progress"},[s("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?s("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?s("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(" "),s("div",{staticClass:"card-footer"},[s("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./transactions/deposit"}},[s("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_deposits")))])])])}),[],!1,null,null,null).exports,y={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 s=t[e];0===parseInt(e)&&(this.max=t[e].difference_float,s.pct=100),0!==parseInt(e)&&(s.pct=t[e].difference_float/this.max*100),this.expenses.push(s)}}}},v=Object(l.a)(y,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"card"},[s("div",{staticClass:"card-header"},[s("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.expense_accounts")))])]),t._v(" "),s("div",{staticClass:"card-body table-responsive p-0"},[s("table",{staticClass:"table table-sm"},[s("tbody",t._l(t.expenses,(function(e){return s("tr",[s("td",{staticStyle:{width:"20%"}},[s("a",{attrs:{href:"./accounts/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),s("td",{staticClass:"align-middle"},[e.pct>0?s("div",{staticClass:"progress"},[s("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?s("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?s("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(" "),s("div",{staticClass:"card-footer"},[s("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./transactions/withdrawal"}},[s("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_withdrawals")))])])])}),[],!1,null,null,null).exports,_=s(16),h=s(17),j=s(18),w=s(19),C=s(167),L=s.n(C),x={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)}}}},F=(s(171),Object(l.a)(x,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("div",{staticClass:"row"},[s("div",{staticClass:"col"},[t._v("Start")]),t._v(" "),s("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(" "),s("div",{staticClass:"row"},[s("div",{staticClass:"col"},[t._v("End")]),t._v(" "),s("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(" "),s("date-picker",{attrs:{mode:"date",rows:"2","is-range":""},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.inputValue,r=e.inputEvents,n=e.isDragging,i=e.togglePopover;return[s("div",{staticClass:"row"},[s("div",{staticClass:"col"},[s("div",{staticClass:"btn-group btn-group-sm d-flex"},[s("button",{staticClass:"btn btn-secondary btn-sm",on:{click:function(t){return i({placement:"auto-start",positionFixed:!0})}}},[s("i",{staticClass:"fas fa-calendar-alt"})]),t._v(" "),s("button",{staticClass:"btn btn-secondary"},[s("i",{staticClass:"fas fa-history"})]),t._v(" "),s("button",{staticClass:"btn btn-secondary dropdown-toggle",attrs:{type:"button",id:"dropdownMenuButton","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[s("i",{staticClass:"fas fa-list"})]),t._v(" "),s("div",{staticClass:"dropdown-menu",attrs:{"aria-labelledby":"dropdownMenuButton"}},[s("a",{staticClass:"dropdown-item",attrs:{href:"#"}},[t._v("(prev period)")]),t._v(" "),s("a",{staticClass:"dropdown-item",attrs:{href:"#"}},[t._v("(next period)")]),t._v(" "),s("a",{staticClass:"dropdown-item",attrs:{href:"#"}},[t._v("(this week?)")])])]),t._v(" "),s("input",t._g({class:n?"text-gray-600":"text-gray-900",attrs:{type:"hidden"},domProps:{value:a.start}},r.start)),t._v(" "),s("input",t._g({class:n?"text-gray-600":"text-gray-900",attrs:{type:"hidden"},domProps:{value:a.end}},r.end))])])]}}]),model:{value:t.range,callback:function(e){t.range=e},expression:"range"}})],1)}),[],!1,null,"03e62f58",null).exports),S={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 s=t.data[e],a=null,r=parseInt(s.id);for(var n in s.attributes.spent)if(s.attributes.spent.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294){var i,o=s.attributes.spent[n];a=o.currency_id.toString()+"-"+s.id.toString(),this.categories[a]=null!==(i=this.categories[a])&&void 0!==i?i:{id:r,name:s.attributes.name,currency_code:o.currency_code,currency_symbol:o.currency_symbol,spent:0,earned:0,spentPct:0,earnedPct:0},this.categories[a].spent=parseFloat(o.sum),this.spent=parseFloat(o.sum)<this.spent?parseFloat(o.sum):this.spent}for(var c in s.attributes.earned)if(s.attributes.earned.hasOwnProperty(c)&&/^0$|^[1-9]\d*$/.test(c)&&c<=4294967294){var l,d=s.attributes.earned[c];a=d.currency_id.toString()+"-"+s.id.toString(),this.categories[a]=null!==(l=this.categories[a])&&void 0!==l?l:{id:r,name:s.attributes.name,currency_code:d.currency_code,currency_symbol:d.currency_symbol,spent:0,earned:0,spentPct:0,earnedPct:0},this.categories[a].earned=parseFloat(d.sum),this.earned=parseFloat(d.sum)>this.earned?parseFloat(d.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 s in t.sort((function(t,e){return t.spent+t.earned-(e.spent+e.earned)})),t)if(t.hasOwnProperty(s)){var a=t[s];a.spentPct=a.spent/this.spent*100,a.earnedPct=a.earned/this.earned*100,this.sortedList.push(a)}}}},k=Object(l.a)(S,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"card"},[s("div",{staticClass:"card-header"},[s("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.categories")))])]),t._v(" "),s("div",{staticClass:"card-body table-responsive p-0"},[s("table",{staticClass:"table table-sm"},[s("tbody",t._l(t.sortedList,(function(e){return s("tr",[s("td",{staticStyle:{width:"20%"}},[s("a",{attrs:{href:"./categories/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),s("td",{staticClass:"align-middle"},[e.spentPct>0?s("div",{staticClass:"progress"},[s("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?s("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?s("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?s("div",{staticClass:"progress justify-content-end",attrs:{title:"hello2"}},[e.earnedPct<=20?s("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.earned))+"\n ")]):t._e(),t._v(" "),s("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?s("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,$=s(2),P=s.n($),B=s(10);P.a.use(B.a);var I=new B.a.Store({modules:[],strict:!0,plugins:[],state:{currencyPreference:{},locale:"en-US"},mutations:{setCurrencyPreference:function(t,e){t.currencyPreference=e},initialiseStore:function(t){console.log("initialiseStore")}},getters:{currencyCode:function(t){return t.currencyPreference.code},currencyId:function(t){return t.currencyPreference.id}},actions:{updateCurrencyPreference:function(t){axios.get("./api/v1/currencies/default").then((function(e){t.commit("setCurrencyPreference",{id:parseInt(e.data.data.id),name:e.data.data.attributes.name,symbol:e.data.data.attributes.symbol,code:e.data.data.attributes.code,decimal_places:parseInt(e.data.data.attributes.decimal_places)})})).catch((function(e){console.log("Got error response."),console.error(e),t.commit("setCurrencyPreference",{id:1,name:"Euro",symbol:"€",code:"EUR",decimal_places:2})}))}}});s(7),s(201),P.a.component("transaction-list-large",h.a),P.a.component("transaction-list-medium",j.a),P.a.component("transaction-list-small",w.a),P.a.component("date-picker",L.a),P.a.component("dashboard",a.a),P.a.component("top-boxes",r.a),P.a.component("main-account",n.a),P.a.component("main-account-list",i.a),P.a.component("main-bills-list",o.a),P.a.component("main-budget-list",g),P.a.component("main-category-list",k),P.a.component("main-debit-list",v),P.a.component("main-credit-list",f),P.a.component("main-piggy-list",_.a),P.a.use(B.a);var O=s(9),E={};new P.a({i18n:O,store:I,el:"#dashboard",render:function(t){return t(a.a,{props:E})},beforeCreate:function(){this.$store.dispatch("updateCurrencyPreference")}}),new P.a({i18n:O,store:I,el:"#calendar",render:function(t){return t(F,{props:E})}})},239:function(t,e){}},[[168,0,1]]]);
|
||
//# sourceMappingURL=dashboard.js.map
|