Files
firefly-iii/public/v2/js/accounts/edit.js

2 lines
264 KiB
JavaScript
Raw Normal View History

2021-08-07 12:14:48 +02:00
(self.webpackChunk=self.webpackChunk||[]).push([[436],{232:(e,t,a)=>{"use strict";a.r(t);var n=a(7760),i=a.n(n),o=a(7152),r=a(4605);window.$=window.jQuery=a(9755),window.axios=a(9669),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var s=document.head.querySelector('meta[name="csrf-token"]');s?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=s.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token");var l=document.head.querySelector('meta[name="locale"]');localStorage.locale=l?l.content:"en_US",a(6891),a(3734),a(7632),a(5432),window.vuei18n=o.Z,window.uiv=r,i().use(vuei18n),i().use(r),window.Vue=i()},157:(e,t,a)=>{e.exports=new vuei18n({locale:document.documentElement.lang,fallbackLocale:"en",messages:{bg:a(4901),cs:a(9789),de:a(9929),en:a(790),"en-us":a(790),"en-gb":a(4632),es:a(8563),el:a(7498),fr:a(844),hu:a(4626),it:a(504),nl:a(3055),nb:a(4870),pl:a(5143),fi:a(2276),"pt-br":a(2055),"pt-pt":a(9898),ro:a(4691),ru:a(9672),"zh-tw":a(7742),"zh-cn":a(4813),sk:a(1941),sv:a(3244),vi:a(245)}})},2794:(t,a,n)=>{"use strict";var i=n(8035),o=n(3465),r=n.n(o),s=n(5653),l=n(5486),_=n(9162),c=n(362),d=n(6129),u=n(8580),p=n(1607),y=n(4397),m=n(3759),h=n(1707),b=n(6611);const g={name:"Edit",created:function(){var e=window.location.pathname.split("/");this.accountId=parseInt(e[e.length-1]),this.uploadObjectId=parseInt(e[e.length-1]),this.getAccount()},components:{Alert:i.Z,GenericTextInput:s.Z,GenericCurrency:l.Z,AssetAccountRole:_.Z,LiabilityDirection:d.Z,LiabilityType:c.Z,Interest:u.Z,InterestPeriod:p.Z,GenericTextarea:y.Z,GenericCheckbox:m.Z,GenericAttachments:h.Z,GenericLocation:b.Z},data:function(){return{successMessage:"",errorMessage:"",stayHere:!1,accountId:0,submitting:!1,account:{},originalAccount:{},hasAttachments:!1,uploadTrigger:!1,uploadObjectId:0,uploadObjectType:"Account",errors:{currency_id:[],account_role:[],liability_type:[],location:[]},defaultErrors:{}}},methods:{selectedAttachments:function(e){this.hasAttachments=!0},selectedNoAttachments:function(e){this.hasAttachments=!1},uploadedAttachments:function(e){this.finishSubmission()},submitForm:function(){e.preventDefault(),this.submitting=!0},finishSubmission:function(){},getAccount:function(){var e=this;axios.get("./api/v1/accounts/"+this.accountId).then((function(t){e.parseAccount(t.data)})).catch((function(e){console.log("I failed :("),console.log(e)}))},storeField:function(e){if(console.log(e),"location"===e.field)return!0===e.value.hasMarker?void(this.location=e.value):void(this.location={});this.account[e.field]=e.value},parseAccount:function(e){console.log("Will now parse"),console.log(e);var t=e.data.attributes,a={};a.account_number=t.account_number,a.account_role=t.account_role,a.active=t.active,a.bic=t.bic,a.credit_card_type=t.credit_card_type,a.currency_code=t.currency_code,a.currency_decimal_places=parseInt(t.currency_decimal_places),a.currency_id=parseInt(t.currency_id),a.currency_symbol=t.currency_symbol,a.iban=t.iban,a.include_net_worth=t.include_net_worth,a.interest=t.interest,a.interest_period=t.interest_period,a.liability_direction=t.liability_direction,a.liability_type=t.liability_type,a.monthly_payment_date=t.monthly_payment_date,a.name=t.name,a.notes=t.notes,a.opening_balance=t.opening_balance,a.opening_balance_date=t.opening_balance_date,a.type=t.type,a.virtual_balance=t.virtual_balance,a.location={latitude:t.latitude,longitude:t.longitude,zoom_level:t.zoom_level},this.account=a,this.originalAccount=r()(this.account)}}};const f=(0,n(1900).Z)(g,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("Alert",{attrs:{message:e.errorMessage,type:"danger"}}),e._v(" "),a("Alert",{attrs:{message:e.successMessage,type:"success"}}),e._v(" "),a("form",{attrs:{autocomplete:"off"},on:{submit:e.submitForm}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12"},[a("div",{staticClass:"card card-primary"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[e._v("\n "+e._s(e.$t("firefly.mandato
//# sourceMappingURL=edit.js.map