(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7ece3227"],{"105d":function(e,t,o){"use strict";o.r(t);var a=function(){var e=this,t=this,o=t._self._c;return o("div",[o("breadcrumbs",{staticClass:"mb-3",attrs:{breadcrumbs:t.breadcrumbs}},[t.allowedTo("delete")?o("v-btn",{attrs:{color:"error",depressed:""},on:{click:function(e){t.showConfirmDeleteRecord=!0}}},[t._v(t._s(t.$t("message.delete")))]):t._e(),t.allowedTo("add")?o("v-btn",{attrs:{color:"primary",depressed:"",to:{name:"admin.financial-gl.general-ledger.journal-voucher.view",params:{journalVoucherId:"new",pagination:t.getValue(t.$route.params.pagination)}}}},[t._v(t._s(t.$t("message.new")))]):t._e()],1),o("v-container",{staticClass:"pt-0",attrs:{fluid:""}},[o("v-card",{attrs:{flat:""}},[o("v-toolbar",{staticClass:"primary lighten-2",attrs:{flat:"",dark:""}},[o("v-toolbar-title",{staticClass:"font-weight-light"},[t._v(t._s(t.$t("message.journalVoucher")))])],1),o("v-card-actions",{staticStyle:{"background-color":"#E0E0E0"}},[o("v-spacer"),t.form.fetching?[o("v-btn",{attrs:{depressed:"",color:"transparent",loading:t.form.fetching}})]:[t.allowedTo("save")&&"0"==this.closingStatus?o("v-btn",{attrs:{color:"info",depressed:"",loading:"save"==t.form.action},on:{click:t.saveData}},[t._v(t._s(t.$t("message.save")))]):t._e(),t.allowedTo("edit")&&"0"==this.closingStatus?o("v-btn",{attrs:{color:"info",depressed:""},on:{click:function(e){t.mode="edit"}}},[t._v(t._s(t.$t("message.edit")))]):t._e(),t.allowedTo("print")?o("v-btn",{attrs:{color:"info",depressed:"",href:t.printLink,target:"_blank"}},[t._v(t._s(t.$t("message.print")))]):t._e(),t.allowedTo("duplicate")?o("v-btn",{attrs:{color:"info",depressed:""},on:{click:t.duplicate}},[t._v(t._s(t.$t("message.duplicate")))]):t._e()]],2),"1"==this.closingStatus?o("v-layout",{attrs:{row:"",wrap:""}},[o("v-flex",[o("v-container",{staticClass:"pa-0 px-3",attrs:{fluid:""}},[o("v-alert",{attrs:{value:!0,type:"error"}},[t._v("\n              This financial month has already been closed. You are not allowed to create new, or to edit transaction for this month. Please contact your administrator if further action is required.\n            ")])],1)],1)],1):t._e(),o("v-layout",{attrs:{row:"",wrap:""}},[o("v-flex",{attrs:{xl8:"",lg8:"",md8:"",sm12:""}},[o("v-container",{staticClass:"pa-3"},[o("v-layout",{attrs:{column:"",wrap:""}},[t.canEdit("date")?o("v-menu",{attrs:{"close-on-content-click":!1,"nudge-right":40,lazy:"",transition:"scale-transition","offset-y":"","full-width":"","min-width":"290px"},model:{value:t.record.post_date_picker,callback:function(e){t.$set(t.record,"post_date_picker",e)},expression:"record.post_date_picker"}},[o("v-text-field",{attrs:{slot:"activator",value:t.getDateFromISO(t.record.post_date),label:t.$t("message.postingDate")+" *",placeholder:" ","append-icon":"event",box:"",readonly:"",clearable:"","error-messages":t.getValue(t.errorMessages,"post_date")},on:{input:function(e){t.record.post_date=""}},slot:"activator"}),o("v-date-picker",{attrs:{color:"primary lighten-2"},on:{input:function(e){t.record.post_date_picker=!1,t.getMonthlyClosingStatus(e,!0)}},model:{value:t.record.post_date_model,callback:function(e){t.$set(t.record,"post_date_model",e)},expression:"record.post_date_model"}})],1):o("v-text-field",{attrs:{label:t.$t("message.postingDate"),value:t.getDateFromISO(t.record.post_date),placeholder:" ",box:"","background-color":"transparent",readonly:"","error-messages":t.getValue(t.errorMessages,"post_date")}}),t.canEdit("transaction_type")?o("v-autocomplete",{attrs:{label:t.$t("message.jvTransactionType"),placeholder:" ",box:"",items:t.transactionTypeLookupItems,loading:t.loadingTransactionTypeLookupOptions,"search-input":t.searchTransactionTypeLookupOptions,attach:"",clearable:"",dense:"","return-object":"","item-value":"id","item-text":"name","error-messages":t.getValue(t.errorMessages,"jv_transaction_type.id")},on:{"update:searchInput":function(e){t.searchTransactionTypeLookupOptions=e},"update:search-input":function(e){t.searchTransactionTypeLookupOptions=e}},model:{value:t.record.jv_transaction_type,callback:function(e){t.$set(t.record,"jv_transaction_type",e)},expression:"record.jv_transaction_type"}}):o("v-text-field",{attrs:{value:t.getValue(t.record.jv_transaction_type,"name"),label:t.$t("message.jvTransactionType"),placeholder:" ",box:"","background-color":"transparent",readonly:""}}),t.canEdit("journalType")?o("v-select",{attrs:{label:t.$t("message.journalType"),placeholder:" ",box:"",items:[{id:"JV",label:"Journal Voucher"},{id:"BA",label:"Bank Advice"}],attach:"",clearable:"",dense:"","return-object":"","item-value":"id","item-text":"label","error-messages":t.getValue(t.errorMessages,"journal_type")},model:{value:t.record.journal_type,callback:function(e){t.$set(t.record,"journal_type",e)},expression:"record.journal_type"}}):o("v-text-field",{attrs:{value:t.getValue(t.record.journal_type,"label"),label:t.$t("message.journalType"),placeholder:" ",box:"","background-color":"transparent",readonly:""}}),o("v-text-field",{attrs:{label:t.$t("message.referenceNo"),placeholder:" ",box:"","background-color":t.canEdit("referenceNo")?"":"transparent",readonly:!t.canEdit("referenceNo"),"error-messages":t.getValue(t.errorMessages,"reference_no")},model:{value:t.record.reference_no,callback:function(e){t.$set(t.record,"reference_no",e)},expression:"record.reference_no"}})],1)],1)],1),"new"!=t.mode?o("v-flex",{attrs:{xl4:"",lg4:"",md4:"",sm12:""}},[o("v-container",{staticClass:"pa-3"},[o("v-layout",{attrs:{column:"",wrap:""}},[o("v-text-field",{attrs:{label:t.$t("message.postingNo"),placeholder:" ",box:"","background-color":t.canEdit("documentNo")?"":"transparent",readonly:"","error-messages":t.getValue(t.errorMessages,"batchpost_no")},model:{value:t.record.batchpost_no,callback:function(e){t.$set(t.record,"batchpost_no",e)},expression:"record.batchpost_no"}}),o("v-text-field",{attrs:{label:t.$t("message.documentNo"),placeholder:" ",box:"","background-color":t.canEdit("documentNo")?"":"transparent",readonly:"","error-messages":t.getValue(t.errorMessages,"journal_no")},model:{value:t.record.journal_no,callback:function(e){t.$set(t.record,"journal_no",e)},expression:"record.journal_no"}})],1)],1)],1):t._e()],1),t.getValue(t.errorMessages,"journal_voucher_items")?o("v-layout",{attrs:{row:"",wrap:""}},[o("v-flex",[o("v-container",{staticClass:"pa-0 px-3",attrs:{fluid:""}},[o("v-alert",{attrs:{value:!0,type:"error"}},[t._v("\n              Oops! Amount in Debit and Credit side does not balance\n            ")])],1)],1)],1):t._e(),o("v-layout",{attrs:{row:"",wrap:""}},[o("v-flex",[o("v-container",{staticClass:"pa-0 px-3",attrs:{fluid:""}},[o("h4",[t._v(t._s(t.$t("message.journalVoucherItem")))]),o("v-divider"),o("v-data-table",{attrs:{headers:t.computedHeaders,items:t.itemRecords,"hide-actions":""},scopedSlots:t._u([{key:"items",fn:function(e){return[o("tr",{key:e.index},[o("td",{staticClass:"pa-1",staticStyle:{"vertical-align":"top"}},[t.canEdit("ledgerAccount")?t._e():o("v-textarea",{staticClass:"thin-border",attrs:{value:t.getLedgerAccountHint(e.item.coa),placeholder:" ",box:"",outline:"","single-line":"",readonly:"","auto-grow":!0,rows:"1"}}),t.canEdit("ledgerAccount")?o("chart-of-account-lookup",t._b({model:{value:e.item.coa,callback:function(o){t.$set(e.item,"coa",o)},expression:"props.item.coa"}},"chart-of-account-lookup",{dense:!0,box:!0,outline:!0,singleLine:!0,persistentHint:!0,classStyle:"thin-border",returnObject:!0,error:t.getValue(t.errorMessages,"journal_voucher_items."+e.index+".coa.id")},!1)):t._e()],1),o("td",{staticClass:"pa-1",staticStyle:{"vertical-align":"top"}},[t.canEdit("type")?o("v-select",{staticClass:"thin-border",attrs:{placeholder:" ",box:"",outline:"","single-line":"",items:[{id:"DB",label:"Debit"},{id:"CR",label:"Credit"}],attach:"",dense:"","return-object":"","item-value":"id","item-text":"label","error-messages":t.getValue(t.errorMessages,"journal_voucher_items."+e.index+".type.id")},model:{value:e.item.type,callback:function(o){t.$set(e.item,"type",o)},expression:"props.item.type"}}):o("v-text-field",{staticClass:"thin-border",attrs:{value:t.getValue(e.item.type,"label"),placeholder:" ",box:"",outline:"","single-line":"",readonly:""}})],1),o("td",{staticClass:"pa-1",staticStyle:{"vertical-align":"top"}},[o("v-text-field",{staticClass:"thin-border",attrs:{placeholder:" ",box:"",outline:"","single-line":"",readonly:!t.canEdit("amount"),"error-messages":t.getValue(t.errorMessages,"journal_voucher_items."+e.index+".paid_amount")},on:{keypress:function(e){return t.isNumeric(e)}},model:{value:e.item.paid_amount,callback:function(o){t.$set(e.item,"paid_amount",o)},expression:"props.item.paid_amount"}})],1),o("td",{staticClass:"pa-1",staticStyle:{"vertical-align":"top"}},[o("v-textarea",{staticClass:"thin-border",attrs:{placeholder:" ",box:"",outline:"","single-line":"",readonly:!t.canEdit("description"),"error-messages":t.getValue(t.errorMessages,"description"),"auto-grow":!0,rows:"1"},model:{value:e.item.reference,callback:function(o){t.$set(e.item,"reference",o)},expression:"props.item.reference"}})],1),t.accountingType&&"BYCOMPANY"==t.accountingType||"Sunway"==t.appName?o("td",[t.canEdit("cluster_id")?t._e():o("v-text-field",{staticClass:"thin-border",attrs:{value:t.getValue(e.item.cluster_id,"code"),placeholder:" ",box:"",outline:"","single-line":"",readonly:""}}),t.canEdit("cluster_id")?o("project-cluster-lookup",t._b({model:{value:e.item.cluster_id,callback:function(o){t.$set(e.item,"cluster_id",o)},expression:"props.item.cluster_id"}},"project-cluster-lookup",{dense:!0,box:!0,outline:!0,singleLine:!0,returnObject:!0,classStyle:"thin-border"},!1)):t._e()],1):t._e(),o("td",{staticClass:"pa-1",staticStyle:{"vertical-align":"top"}},["view"!=t.mode?o("v-btn",{attrs:{flat:"",icon:"",color:"pink"},on:{click:function(o){return t.onDeleteClick(e.item,e.index)}}},[o("v-icon",[t._v("delete")])],1):t._e()],1)])]}}])},["view"!=t.mode?o("template",{slot:"footer"},[t.accountingType&&"BYCOMPANY"==t.accountingType||"Sunway"==t.appName?o("td",{staticClass:"pa-0 pr-3 grey lighten-4",attrs:{colspan:"6",align:"right"}},[o("v-btn",{attrs:{color:"info",outline:"",depressed:""},on:{click:function(e){return t.onAddMoreClick()}}},[t._v(t._s(t.$t("message.addMore")))])],1):o("td",{staticClass:"pa-0 pr-3 grey lighten-4",attrs:{colspan:"5",align:"right"}},[o("v-btn",{attrs:{color:"info",outline:"",depressed:""},on:{click:function(e){return t.onAddMoreClick()}}},[t._v(t._s(t.$t("message.addMore")))])],1)]):t._e()],2)],1)],1)],1),o("v-card-actions",{staticStyle:{"background-color":"#E0E0E0"}},[o("v-spacer"),t.form.fetching?[o("v-btn",{attrs:{depressed:"",color:"transparent",loading:t.form.fetching}})]:[t.allowedTo("save")&&"0"==this.closingStatus?o("v-btn",{attrs:{color:"info",depressed:"",loading:"save"==t.form.action},on:{click:t.saveData}},[t._v(t._s(t.$t("message.save")))]):t._e(),t.allowedTo("edit")&&"0"==this.closingStatus?o("v-btn",{attrs:{color:"info",depressed:""},on:{click:function(e){t.mode="edit"}}},[t._v(t._s(t.$t("message.edit")))]):t._e()]],2)],1)],1),o("snackbar",{attrs:{snackbar:t.snackbar}}),o("confirm-dialog",{attrs:{title:"Are you sure ?",text:t.$t("message.confirmDelete"),cancelText:"Cancel",confirmText:"Confirm"},on:{cancelAction:function(){return e.showConfirmDeleteRecord=!1},confirmAction:function(){return t.deleteData()}},model:{value:t.showConfirmDeleteRecord,callback:function(e){t.showConfirmDeleteRecord=e},expression:"showConfirmDeleteRecord"}})],1)},n=[],r=(o("8e6e"),o("456d"),o("7514"),o("a481"),o("ac6a"),o("7f7f"),o("ade3")),i=o("365c"),s=o("2f62"),c=o("4da1"),l=o("323e"),d=o.n(l),u=(o("7fb5"),o("1dce")),p=o("c1df"),m=o.n(p),h=o("45a3"),g=o("5e44"),f=o("8106"),b=o("35a2"),v=o("1acc");function y(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function _(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?y(Object(o),!0).forEach((function(t){Object(r["a"])(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):y(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var j={mixins:[u["validationMixin"]],validations:{},constants:{},created:function(){this.record=Object.assign({},this.defaultRecord),"new"==this.recordId&&(this.mode="new"),this.closingStatus="0",this.getCurrencyOptions(),this.getData(),this.getAccountTypeEnv(),this.getTransactionTypeLookupOptions()},mounted:function(){this.getLedgerAccountOptions()},components:{Breadcrumbs:g["a"],Snackbar:f["a"],ConfirmDialog:h["a"],ChartOfAccountLookup:b["a"],ProjectClusterLookup:v["a"]},computed:_(_({},Object(s["b"])(["adminScope","mySession"])),{},{computedHeaders:function(){var e=this;return"BYPROJECT"==this.accountingType&&"Sunway"!=this.appName?this.headers.filter((function(t){return t.text!==e.$t("message.project")})):this.headers},defaultRecord:function(){return Object.assign({},{})},breadcrumbs:function(){var e=[{text:this.$t("message.journalVoucher"),disabled:!1,to:{name:"admin.financial-gl.general-ledger.journal-voucher",params:{pagination:Object(c["j"])(this.$route.params.pagination)}}}];return e.push({text:"new"==this.recordId?"New":Object(c["j"])(this.record,"journal_no"),disabled:!0}),e},locked:function(){return this.record.locked},itemCurrencyOptions:function(){return this.entryCurrencyOptions.map((function(e){var t=e.id;return Object.assign({},e,{name:t})}))},itemLedgerAccountOptions:function(){return this.entryLedgerAccountOptions},transactionTypeLookupItems:function(){var e=this;return this.filteredLookupOptions=this.entryTransactionTypeLookupOptions,this.filteredLookupOptions.map((function(t){var o="";1==t.show_in_cash_statement&&(o="( "+e.$t("message.showTransactionInCashFlowStatement")+" )");var a=t.name+" "+o;return Object.assign({},t,{name:a})}))},printLink:function(){var e=this.adminScope.projectId,t=this.adminScope.companyId,o=this.mySession.username;return"https://pms.putericoveresidences.net/service/api/admin/financial/gl/journal-voucher/"+this.recordId+"/print?project_id="+e+"&company_id="+t+"&my_username="+o}}),watch:{$route:function(e,t){this.recordId=Object(c["j"])(e.params,"journalVoucherId"),this.record=Object.assign({},this.defaultRecord),"new"==this.recordId&&(this.mode="new"),this.closingStatus="0",this.getData()},searchCurrencyOptions:function(e){this.itemCurrencyOptions.length>0||this.loadingCurrencyOptions||(this.loadingCurrencyOptions=!0,this.getCurrencyOptions())},searchTransactionTypeLookupOptions:function(e){this.transactionTypeLookupItems.length>0||this.loadingTransactionTypeLookupOptions||(this.loadingTransactionTypeLookupOptions=!0,this.getTransactionTypeLookupOptions())},"record.post_date_model":function(e){e&&(this.record.post_date=m()(e).format())}},methods:{getValue:function(e,t){return Object(c["j"])(e,t)},getDateTimeFromISO:function(e,t){return Object(c["g"])(e,t)},getDateFromISO:function(e,t){return Object(c["e"])(e,t)},convertDateToISO:function(e,t){return Object(c["a"])(e,t)},formatNumber:function(e,t){return Object(c["c"])(e,t)},removeFormatNumber:function(e){return Object(c["l"])(e)},allowedTo:function(e){switch(e){case"add":return!this.$can.not("add","acl.admin.financial-gl.general-ledgers.journal-voucher");case"delete":if(this.$can.not("delete","acl.admin.financial-gl.general-ledgers.journal-voucher"))return!1;if("new"==this.mode)return!1;if("new"!=this.recordId)return!this.record.locked;break;case"save":if(this.$can.not("add","acl.admin.financial-gl.general-ledgers.journal-voucher")&&this.$can.not("edit","acl.admin.financial-gl.general-ledgers.journal-voucher"))return!1;if("new"==this.mode||"edit"==this.mode)return!0;break;case"edit":return!this.$can.not("edit","acl.admin.financial-gl.general-ledgers.journal-voucher")&&("new"!=this.recordId&&"edit"!=this.mode);case"cancel":if(this.$can.not("add","acl.admin.financial-gl.general-ledgers.journal-voucherd")&&this.$can.not("edit","acl.admin.financial-gl.general-ledgers.journal-voucher"))return!1;if("new"!=this.recordId&&"edit"==this.mode)return!0;break;case"print":return"new"!=this.recordId;case"duplicate":return!this.$can.not("duplicate","acl.admin.financial-gl.general-ledgers.journal-voucher")&&"new"!=this.recordId}return!1},canEdit:function(e){var t=!1;switch(t="edit"==this.mode||"new"==this.mode,e){default:break}return t},onCancel:function(){this.errorMessages=null,this.getData(),this.mode="view"},onDeleteClick:function(e,t){var o=this;this.itemRecords.splice(this.itemRecords.indexOf(e),1),this.mode="view",this.$nextTick((function(){o.mode="edit"}))},onAddMoreClick:function(){this.itemRecords.push(Object.assign({},this.defaultItemRecord))},getData:function(){var e=this;this.record=Object.assign({},this.defaultRecord),this.itemRecords=[],"new"!=this.recordId&&(this.form.fetching=!0,d.a.start(),i["a"].get("admin/financial/gl/journal-voucher/"+this.recordId,{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){e.record=Object(c["j"])(t,"data.data"),e.itemRecords=e.record.journal_voucher_items,e.itemRecords=e.reformatAmount(e.itemRecords),e.getMonthlyClosingStatus(e.record.post_date,!1)})).catch((function(e){})).then((function(){d.a.done(),e.form.fetching=!1})))},getAccountTypeEnv:function(){var e=this;i["a"].get("admin/lookup/get-api-env",{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){e.accountingType=Object(c["j"])(t,"data.accountingType"),e.appName=Object(c["j"])(t,"data.appName")})).catch((function(e){})).then((function(){}))},duplicate:function(){var e=this;this.record=Object.assign({},this.defaultRecord),this.itemRecords=[],"new"!=this.recordId&&(this.form.fetching=!0,d.a.start(),i["a"].get("admin/financial/gl/journal-voucher/"+this.recordId,{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){e.closingStatus="0",e.record=Object(c["j"])(t,"data.data"),e.recordId="new",e.mode="edit",e.itemRecords=e.record.journal_voucher_items,e.itemRecords=e.reformatAmount(e.itemRecords),e.record.batch_no="",e.record.batchpost_no="",e.record.created_at="",e.record.created_by="",e.record.id="",e.record.post_date="",e.record.posting_no="",e.record.updated_at="",e.record.updated_by="",e.record.journal_no="",e.itemRecords=e.resetItemId(e.itemRecords)})).catch((function(e){})).then((function(){d.a.done(),e.form.fetching=!1})))},reformatAmount:function(e){var t=e.map((function(e){return e.paid_amount=Object(c["c"])(e.paid_amount).format("0,0.00"),e}));return t},resetItemId:function(e){var t=e.map((function(e){return e.id="",e}));return t},validateAmount:function(){var e=0,t=0;this.itemRecords.forEach((function(o){"CR"==o.type.id&&(t+=Object(c["l"])(o.paid_amount)),"DB"==o.type.id&&(e+=Object(c["l"])(o.paid_amount))})),this.totalDebit=Object(c["c"])(e).format("0.00"),this.totalCredit=Object(c["c"])(t).format("0.00"),this.saveData("validateAmount")},saveData:function(){var e=this;d.a.start(),this.form.loading=!0,this.form.action="save",this.errorMessages=null,this.record.project_id||(this.record.project_id=this.adminScope.projectId),this.record.company_id||(this.record.company_id=this.adminScope.companyId),this.record.my_username=this.mySession.username,this.record.journal_voucher_items=this.itemRecords.length>0?this.itemRecords:[];var t="admin/financial/gl/journal-voucher";"new"!==this.recordId&&(t=t+"/"+this.recordId,this.record._method="PATCH"),i["a"].post(t,this.record).then((function(t){e.record=Object(c["j"])(t,"data.data"),e.snackbar.message=Object(c["j"])(t,"data.message"),e.snackbar.type="success",e.snackbar.show=!0,e.mode="edit",e.$router.replace({name:"admin.financial-gl.general-ledger.journal-voucher.view",params:{journalVoucherId:e.record.id}})})).catch((function(t){e.snackbar.message=Object(c["j"])(t,"response.data.message"),e.snackbar.type="error",e.snackbar.show=!0,e.errorMessages=Object(c["j"])(t,"response.data.errors")})).then((function(){d.a.done(),e.form.loading=!1,e.form.action=null}))},deleteData:function(){var e=this;this.form.loading=!0,this.form.action="delete",this.errorMessages=null;var t="admin/financial/gl/journal-voucher/"+this.recordId;i["a"].delete(t,{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){e.$router.replace({name:"admin.financial-gl.general-ledger.journal-voucher"})})).catch((function(e){})).then((function(){d.a.done(),e.form.loading=!1,e.form.action=null}))},getLedgerAccountHint:function(e){if(this.itemLedgerAccountOptions.length>0&&e){var t=this.itemLedgerAccountOptions.find((function(t){return t.id==e.id}));if(t)return t.code+" - "+t.name}return""},getCurrencyOptions:function(){var e=this;i["a"].get("admin/lookup/currency",{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){var o=t.data.data;e.entryCurrencyOptions=o})).catch((function(e){})).finally((function(){return e.loadingCurrencyOptions=!1}))},getLedgerAccountOptions:function(){var e=this;i["a"].get("admin/lookup/chart-of-account",{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){var o=t.data.data;e.entryLedgerAccountOptions=o})).catch((function(e){})).finally((function(){return e.loadingLedgerAccountOptions=!1}))},getTransactionTypeLookupOptions:function(){var e=this;i["a"].get("admin/lookup/jv-transaction-type/",{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){var o=t.data.data;e.entryTransactionTypeLookupOptions=o})).catch((function(e){})).finally(this.loadingTransactionTypeLookupOptions=!1)},getMonthlyClosingStatus:function(e){var t=this;i["a"].get("admin/lookup/get-monthly-closing-status",{params:{date:e,project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(e){var o=e.data.data;t.closingStatus=o})).catch((function(e){})).finally()},isNumeric:function(e){var t=String.fromCharCode(e.keyCode);if(/^[\d.]+$/.test(t))return!0;e.preventDefault()}},data:function(){var e;return e={recordId:this.$route.params.journalVoucherId,record:{},itemRecords:[],defaultItemRecord:{coa:{},type:{},paid_amount:0,reference:""},totalDebit:0,totalCredit:0,closingStatus:"0",accountingType:"",appName:"",mode:"view",showConfirmDeleteRecord:!1,hideDepartmentHeader:!1,errorMessages:null,form:{fetching:!1,loading:!1,action:null},snackbar:{show:!1,type:null,message:null}},Object(r["a"])(e,"errorMessages",null),Object(r["a"])(e,"entryCurrencyOptions",[]),Object(r["a"])(e,"loadingCurrencyOptions",!1),Object(r["a"])(e,"searchCurrencyOptions",null),Object(r["a"])(e,"entryLedgerAccountOptions",[]),Object(r["a"])(e,"loadingLedgerAccountOptions",!1),Object(r["a"])(e,"entryTransactionTypeLookupOptions",[]),Object(r["a"])(e,"loadingTransactionTypeLookupOptions",!1),Object(r["a"])(e,"searchTransactionTypeLookupOptions",null),Object(r["a"])(e,"headers",[{text:this.$t("message.ledgerAccount")+" *",align:"left",sortable:!1},{text:this.$t("message.type")+" *",align:"left",sortable:!1},{text:this.$t("message.amount"),align:"left",sortable:!1},{text:this.$t("message.remarks"),align:"left",sortable:!1},{text:this.$t("message.project"),align:"left",sortable:!1},{text:"",sortable:!1}]),e}},O=j,k=o("2877"),w=Object(k["a"])(O,a,n,!1,null,null,null);t["default"]=w.exports},"1acc":function(e,t,o){"use strict";var a=function(){var e=this,t=e._self._c;return t("div",[t("v-autocomplete",{class:e.classStyle,attrs:{label:e.label,items:e.itemLookupOptions,loading:e.loadingLookupOptions,"search-input":e.searchLookupOptions,clearable:"","item-text":"name","item-value":"id",placeholder:" ","return-object":e.returnObject,"error-messages":e.error,"menu-props":{fixed:!0,nudgeBottom:10,maxHeight:300},dense:e.dense,box:e.box,solo:e.solo,flat:e.flat,outline:e.outline,"hide-details":e.hideDetails,"single-line":e.singleLine},on:{"update:searchInput":function(t){e.searchLookupOptions=t},"update:search-input":function(t){e.searchLookupOptions=t}},model:{value:e.internalValue,callback:function(t){e.internalValue=t},expression:"internalValue"}})],1)},n=[],r=(o("8e6e"),o("ac6a"),o("456d"),o("ade3")),i=o("365c"),s=o("2f62");function c(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function l(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?c(Object(o),!0).forEach((function(t){Object(r["a"])(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):c(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var d={props:{value:[String,Object],itemOptions:{type:Array,default:function(){return[]}},label:String,error:Array,returnObject:{type:Boolean,default:!0},dense:{type:Boolean,default:!1},solo:{type:Boolean,default:!1},box:{type:Boolean,default:!1},flat:{type:Boolean,default:!1},outline:{type:Boolean,default:!1},hideDetails:{type:Boolean,default:!1},classStyle:String,singleLine:{type:Boolean,default:!1}},created:function(){this.internalValue=this.value},mounted:function(){0==this.itemOptions.length&&this.getLookupOptions()},computed:l(l({},Object(s["b"])(["adminScope"])),{},{itemLookupOptions:function(){return this.filteredLookupOptions=this.entryLookupOptions,this.filteredLookupOptions.map((function(e){var t=e.code;return Object.assign({},e,{name:t})}))}}),watch:{searchLookupOptions:function(e){this.itemLookupOptions.length>0||this.loadingLookupOptions||(this.loadingLookupOptions=!0,this.getLookupOptions())},internalValue:function(){this.$emit("input",this.internalValue)}},methods:{getLookupOptions:function(){var e=this;i["a"].get("admin/lookup/project-cluster",{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){var o=t.data.data;e.entryLookupOptions=o})).catch((function(e){})).finally((function(){return e.loadingLookupOptions=!1}))}},data:function(){return{internalValue:{},entryLookupOptions:this.itemOptions,loadingLookupOptions:!1,searchLookupOptions:null}}},u=d,p=o("2877"),m=Object(p["a"])(u,a,n,!1,null,null,null);t["a"]=m.exports}}]);