(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7f0df19d"],{"3ba2":function(t,e,n){"use strict";var o=function(){var t=this,e=t._self._c;return e("router-link",{attrs:{to:t.to},nativeOn:{click:function(e){return t.routeToAnchor.apply(null,arguments)}}},[t._t("default")],2)},r=[],i=(n("c5f6"),n("2b0e")),a=n("8c4f"),c=n("f13c"),s=n.n(c);i["default"].use(a["a"]),i["default"].use(s.a);var u={name:"vue-anchor-router-link",props:{to:Object,scrollOptions:{type:[Object,Number],default:1}},data:function(){return{previousRoute:this.$route}},methods:{routeToAnchor:function(){this.$route.fullPath===this.previousRoute.fullPath&&this.$scrollTo(this.to.hash,this.scrollOptions)}},watch:{$route:function(t,e){this.previousRoute=t}}},l=u,f=n("2877"),d=Object(f["a"])(l,o,r,!1,null,null,null),p=d.exports;e["a"]=p},"45a3":function(t,e,n){"use strict";var o=function(){var t=this,e=t._self._c;return e("v-dialog",{attrs:{"max-width":"500px",persistent:""},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.cancelAction()}},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},[e("v-card",[e("v-card-title",{staticClass:"headline"},[t._v("\n      "+t._s(t.title)+"\n    ")]),e("v-card-text",[t._v("\n      "+t._s(t.text)+"\n    ")]),e("v-card-actions",[e("v-spacer"),this.loading?t._e():e("v-btn",{attrs:{color:"red",flat:"",loading:this.loading},on:{click:t.cancelAction}},[t._v(t._s(t.cancelText))]),e("v-btn",{attrs:{color:"green",flat:"",loading:this.loading},on:{click:t.confirmAction,keydown:function(e){if(!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;e.preventDefault()}}},[t._v(t._s(t.confirmText)+" ")])],1)],1)],1)},r=[],i={props:["title","text","cancelText","confirmText","value"],data:function(){return{loading:!1}},watch:{value:function(){this.resetState()}},methods:{resetState:function(){this.loading=!1},confirmAction:function(){this.loading=!0,this.$emit("confirmAction")},cancelAction:function(){this.loading=!0,this.$emit("cancelAction")}}},a=i,c=n("2877"),s=Object(c["a"])(a,o,r,!1,null,null,null);e["a"]=s.exports},"5e44":function(t,e,n){"use strict";var o=function(){var t=this,e=t._self._c;return e("v-toolbar",{attrs:{flat:"",color:t.color?t.color:"white"}},[e("v-breadcrumbs",{attrs:{divider:"/",items:t.breadcrumbs},scopedSlots:t._u([{key:"item",fn:function(n){return[n.item.to?[e("vue-anchor-router-link",{attrs:{to:n.item.to}},[t._v(t._s(n.item.text))])]:[t._v("\n        "+t._s(n.item.text)+"\n      ")]]}}])}),e("v-spacer"),t._t("default")],2)},r=[],i=n("3ba2"),a={props:["breadcrumbs","color"],computed:{},components:{VueAnchorRouterLink:i["a"]}},c=a,s=n("2877"),u=Object(s["a"])(c,o,r,!1,null,null,null);e["a"]=u.exports},"7fb5":function(t,e,n){var o,r;(function(n,i){n||(n={}),o=[],r=function(){return n.jsonToFormData=i()}.apply(e,o),void 0===r||(t.exports=r)})(this,(function(){function t(t,e){return[t,e].reduce((function(t,e){return Object.keys(e).forEach((function(n){t[n]=e[n]})),t}),{})}function e(t){return"[object Array]"==={}.toString.call(t)}function n(t){return!e(t)&&"object"===typeof t&&!!t&&!(t instanceof Blob)&&!(t instanceof Date)}function o(t){return"function"===typeof t.append}function r(){return"function"===typeof FormData}function i(){if(r())return new FormData}function a(e,n){if(n&&n.initialFormData){if(!o(n.initialFormData))throw"initialFormData must have an append function."}else if(!r())throw"This environment does not have global form data. options.initialFormData must be specified.";var a={initialFormData:i(),showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(t){return"boolean"===typeof t?+t?"1":"0":t}},s=t(a,n||{});return c(e,s,s.initialFormData)}function c(t,o,r,i){var a=0;for(var s in t){if(t.hasOwnProperty(s)){var u=i||s,l=o.mapping(t[s]);if(i&&n(t)&&(u=i+"["+s+"]"),i&&e(t)&&(u=e(l)||o.showLeafArrayIndexes?i+"["+a+"]":i+"[]"),e(l)||n(l))c(l,o,r,u);else if(l instanceof FileList)for(var f=0;f<l.length;f++)r.append(u+"["+f+"]",l.item(f));else l instanceof Blob?r.append(u,l,l.name):l instanceof Date?r.append(u,l.toISOString()):(null===l&&o.includeNullValues||null!==l)&&void 0!==l&&r.append(u,l)}a++}return r}return a}))},f13c:function(t,e,n){(function(e,n){t.exports=n()})(0,(function(){"use strict";var t=4,e=.001,n=1e-7,o=10,r=11,i=1/(r-1),a="function"===typeof Float32Array;function c(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function u(t){return 3*t}function l(t,e,n){return((c(e,n)*t+s(e,n))*t+u(e))*t}function f(t,e,n){return 3*c(e,n)*t*t+2*s(e,n)*t+u(e)}function d(t,e,r,i,a){var c,s,u=0;do{s=e+(r-e)/2,c=l(s,i,a)-t,c>0?r=s:e=s}while(Math.abs(c)>n&&++u<o);return s}function p(e,n,o,r){for(var i=0;i<t;++i){var a=f(n,o,r);if(0===a)return n;var c=l(n,o,r)-e;n-=c/a}return n}var m=function(t,n,o,c){if(!(0<=t&&t<=1&&0<=o&&o<=1))throw new Error("bezier x values must be in [0, 1] range");var s=a?new Float32Array(r):new Array(r);if(t!==n||o!==c)for(var u=0;u<r;++u)s[u]=l(u*i,t,o);function m(n){for(var a=0,c=1,u=r-1;c!==u&&s[c]<=n;++c)a+=i;--c;var l=(n-s[c])/(s[c+1]-s[c]),m=a+l*i,v=f(m,t,o);return v>=e?p(n,m,t,o):0===v?m:d(n,a,a+i,t,o)}return function(e){return t===n&&o===c?e:0===e?0:1===e?1:l(m(e),n,c)}},v={ease:[.25,.1,.25,1],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},h=!1;try{var b=Object.defineProperty({},"passive",{get:function(){h=!0}});window.addEventListener("test",null,b)}catch(F){}var y={$:function(t){return"string"!==typeof t?t:document.querySelector(t)},on:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!1};e instanceof Array||(e=[e]);for(var r=0;r<e.length;r++)t.addEventListener(e[r],n,!!h&&o)},off:function(t,e,n){e instanceof Array||(e=[e]);for(var o=0;o<e.length;o++)t.removeEventListener(e[o],n)},cumulativeOffset:function(t){var e=0,n=0;do{e+=t.offsetTop||0,n+=t.offsetLeft||0,t=t.offsetParent}while(t);return{top:e,left:n}}},g="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},O=["mousedown","wheel","DOMMouseScroll","mousewheel","keyup","touchmove"],j={container:"body",duration:500,easing:"ease",offset:0,force:!0,cancelable:!0,onStart:!1,onDone:!1,onCancel:!1,x:!1,y:!0};function k(t){j=w({},j,t)}var x=function(){var t=void 0,e=void 0,n=void 0,o=void 0,r=void 0,i=void 0,a=void 0,c=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,p=void 0,h=void 0,b=void 0,w=void 0,k=void 0,x=void 0,_=void 0,D=function(t){a&&(_=t,x=!0)},$=void 0,S=void 0,T=void 0,C=void 0;function A(t){var e=t.scrollTop;return"body"===t.tagName.toLowerCase()&&(e=e||document.documentElement.scrollTop),e}function I(t){var e=t.scrollLeft;return"body"===t.tagName.toLowerCase()&&(e=e||document.documentElement.scrollLeft),e}function F(t){if(x)return P();S||(S=t),T=t-S,C=Math.min(T/n,1),C=$(C),L(e,h+k*C,d+w*C),T<n?window.requestAnimationFrame(F):P()}function P(){x||L(e,b,p),S=!1,y.off(e,O,D),x&&u&&u(_,t),!x&&s&&s(t)}function L(t,e,n){f&&(t.scrollTop=e),l&&(t.scrollLeft=n),"body"===t.tagName.toLowerCase()&&(f&&(document.documentElement.scrollTop=e),l&&(document.documentElement.scrollLeft=n))}function E(S,T){var C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"===("undefined"===typeof T?"undefined":g(T))?C=T:"number"===typeof T&&(C.duration=T),t=y.$(S),!t)return console.warn("[vue-scrollto warn]: Trying to scroll to an element that is not on the page: "+S);e=y.$(C.container||j.container),n=C.duration||j.duration,o=C.easing||j.easing,r=C.offset||j.offset,i=C.hasOwnProperty("force")?!1!==C.force:j.force,a=C.hasOwnProperty("cancelable")?!1!==C.cancelable:j.cancelable,c=C.onStart||j.onStart,s=C.onDone||j.onDone,u=C.onCancel||j.onCancel,l=void 0===C.x?j.x:C.x,f=void 0===C.y?j.y:C.y;var P=y.cumulativeOffset(e),L=y.cumulativeOffset(t);if("function"===typeof r&&(r=r()),h=A(e),b=L.top-P.top+r,d=I(e),p=L.left-P.left+r,x=!1,k=b-h,w=p-d,!i){var E=h,R=E+e.offsetHeight,V=b,N=V+t.offsetHeight;if(V>=E&&N<=R)return}return"string"===typeof o&&(o=v[o]||v["ease"]),$=m.apply(m,o),k||w?(c&&c(t),y.on(e,O,D,{passive:!0}),window.requestAnimationFrame(F),function(){_=null,x=!0}):void 0}return E},_=x(),D=[];function $(t){for(var e=0;e<D.length;++e)if(D[e].el===t)return D.splice(e,1),!0;return!1}function S(t){for(var e=0;e<D.length;++e)if(D[e].el===t)return D[e]}function T(t){var e=S(t);return e||(D.push(e={el:t,binding:{}}),e)}function C(t){t.preventDefault();var e=T(this).binding;if("string"===typeof e.value)return _(e.value);_(e.value.el||e.value.element,e.value)}var A={bind:function(t,e){T(t).binding=e,y.on(t,"click",C)},unbind:function(t){$(t),y.off(t,"click",C)},update:function(t,e){T(t).binding=e},scrollTo:_,bindings:D},I=function(t,e){e&&k(e),t.directive("scroll-to",A),t.prototype.$scrollTo=A.scrollTo};return"undefined"!==typeof window&&window.Vue&&(window.VueScrollTo=A,window.VueScrollTo.setDefaults=k,window.Vue.use(I)),A.install=I,A}))},f269a:function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=this,n=e._self._c;return n("div",[n("v-container",{staticClass:"pt-0",attrs:{fluid:""}},[n("v-card",{attrs:{flat:""}},[n("v-toolbar",{staticClass:"primary lighten-2",attrs:{flat:"",dark:""}},[n("v-toolbar-title",{staticClass:"font-weight-light"},[e._v(e._s(e.$t("message.unallocatedOpenCredit")))])],1),n("v-tabs",{attrs:{"slider-color":"info","show-arrows":""},model:{value:e.tabs,callback:function(t){e.tabs=t},expression:"tabs"}},[n("v-tab",{key:"receipt",staticClass:"subheading font-weight-light",attrs:{to:{name:"admin.financial-ar.collection.open-credit.receipt",params:{pagination:e.getValue(e.$route.params.pagination)}}}},[e._v(e._s(e.$t("message.receipt")))]),n("v-tab",{key:"credit-note",staticClass:"subheading font-weight-light",attrs:{to:{name:"admin.financial-ar.collection.open-credit.credit-note",params:{pagination:e.getValue(e.$route.params.pagination)}}}},[e._v(e._s(e.$t("message.creditNote")))])],1),n("router-view",{model:{value:e.record,callback:function(t){e.record=t},expression:"record"}})],1)],1),n("snackbar",{attrs:{snackbar:e.snackbar}}),n("confirm-dialog",{attrs:{title:"Are you sure ?",text:e.$t("message.confirmDelete"),cancelText:"Cancel",confirmText:"Confirm"},on:{cancelAction:function(){return t.showConfirmDeleteRecord=!1},confirmAction:function(){return e.deleteData()}},model:{value:e.showConfirmDeleteRecord,callback:function(t){e.showConfirmDeleteRecord=t},expression:"showConfirmDeleteRecord"}})],1)},r=[],i=(n("8e6e"),n("ac6a"),n("456d"),n("a481"),n("ade3")),a=n("365c"),c=n("2f62"),s=n("4da1"),u=n("323e"),l=n.n(u),f=(n("7fb5"),n("1dce")),d=n("45a3"),p=n("5e44"),m=n("8106");function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){Object(i["a"])(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var b={mixins:[f["validationMixin"]],validations:{},created:function(){this.record=this.defaultRecord},components:{Breadcrumbs:p["a"],Snackbar:m["a"],ConfirmDialog:d["a"]},computed:h(h({},Object(c["b"])(["adminScope"])),{},{defaultRecord:function(){return Object.assign({},{})},breadcrumbs:function(){var t=[{text:this.$t("message.openCredit"),disabled:!1,to:{name:"admin.financial-ar.collection.open-credit",params:{pagination:Object(s["j"])(this.$route.params.pagination)}}}];return t.push({text:"new"==this.recordId?"New":Object(s["j"])(this.record,"unit_no"),disabled:!0}),t},locked:function(){return this.record.locked}}),watch:{$route:function(t,e){this.recordId=Object(s["j"])(t.params,"unitId"),this.record=this.defaultRecord,"new"==this.recordId&&(this.mode="new"),this.getData()}},methods:{getValue:function(t,e){return Object(s["j"])(t,e)},getDateTimeFromISO:function(t,e){return Object(s["g"])(t,e)},getDateFromISO:function(t,e){return Object(s["e"])(t,e)},convertDateToISO:function(t,e){return Object(s["a"])(t,e)},allowedTo:function(t){switch(t){case"add":return!this.$can.not("add","acl.admin.property.properties.units")||!this.$can.not("add","acl.admin.financial-ar.properties.units");case"delete":if(this.$can.not("add","acl.admin.property.properties.units")&&this.$can.not("delete","acl.admin.property.properties.units")&&this.$can.not("add","acl.admin.financial-ar.properties.units")&&this.$can.not("delete","acl.admin.financial-ar.properties.units"))return!1;if("new"!=this.recordId)return!this.record.locked;break;case"save":if(this.$can.not("add","acl.admin.property.properties.units")&&this.$can.not("edit","acl.admin.property.properties.units")&&this.$can.not("add","acl.admin.financial-ar.properties.units")&&this.$can.not("edit","acl.admin.financial-ar.properties.units"))return!1;if("new"==this.mode||"edit"==this.mode)return!0;break}return!1},getData:function(){var t=this;"new"!=this.recordId&&(this.form.fetching=!0,l.a.start(),a["a"].get("admin/property/property/unit/"+this.recordId,{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(e){t.record=Object(s["j"])(e,"data.data")})).catch((function(t){})).then((function(){l.a.done(),t.form.fetching=!1})))},deleteData:function(){var t=this;this.form.loading=!0,this.form.action="delete",this.errorMessages=null;var e="admin/property/property/unit/"+this.recordId;a["a"].delete(e,{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(e){t.$router.replace({name:"admin.property.property.unit"})})).catch((function(t){})).then((function(){l.a.done(),t.form.loading=!1,t.form.action=null}))}},data:function(){return{recordId:this.$route.params.unitId,record:null,mode:"view",showConfirmDeleteRecord:!1,tabs:null,form:{fetching:!1,loading:!1,action:null},snackbar:{show:!1,type:null,message:null},errorMessages:null}}},y=b,g=n("2877"),w=Object(g["a"])(y,o,r,!1,null,null,null);e["default"]=w.exports}}]);