1(self["webpackChunkerp_frontend"]=self["webpackChunkerp_frontend"]||[]).push([[2517],{71059:function(t,e,i){"use strict";i.d(e,{A:function(){return m}});var o=function(){var t=this,e=t._self._c;return e("b-autocomplete",t._g(t._b({ref:"autocomplete",attrs:{"custom-formatter":e=>t.customFormatter(e),data:t.loading?null:t.choicesSearchResults,expanded:"",field:"id",loading:t.loading,"keep-first":!t.value,"open-on-focus":"",clearable:t.clearable,placeholder:t.placeholder||(t.optionAll?t.$tc("All",2):t.$tc("SelectCostCenter")),title:t.selectedChoice&&t.customFormatter(t.selectedChoice)},scopedSlots:t._u([{key:"default",fn:function(i){return e("div",{},[e("strong",[t._v(t._s(i.option.name))]),e("div",[i.option.code?e("small",[t._v("Código: "+t._s(i.option.code))]):t._e()])])}},t.loading?{key:"empty",fn:function(){return[t._v(" "+t._s(t.$tc("Loading"))+"... ")]},proxy:!0}:t.searchTerm?{key:"empty",fn:function(){return[t._v(" "+t._s(t.$tc("RecordNotFound",2))+" ")]},proxy:!0}:{key:"empty",fn:function(){return[t._v(" "+t._s(t.$tc("SearchPlaceholder"))+" ")]},proxy:!0},t._l(t.$scopedSlots,function(e,i){return{key:i,fn:function(e){return[t._t(i,null,null,e)]}}})],null,!0)},"b-autocomplete",t.$attrs,!1),{...t.$listeners,input:()=>{},select:t.onSelect,typing:e=>{t.searchTerm=e||null}}),[t._l(t.$slots,function(e,i){return t._t(i,null,{slot:i})})],2)},s=[],a=(i(74423),i(44114),i(18111),i(22489),i(20116),i(93011)),n=i(7309),l=i.n(n),c=i(50551),r=i(38285),u=i(2718),d={name:"AutocompleteCostCenters",inheritAttrs:!1,props:{clearable:Boolean,optionAll:Boolean,defaultValue:Boolean,isParent:Boolean,placeholder:{type:String,default:null},value:{type:String,default:null}},data(){return{choicesInternal:null,loading:!1,searchTerm:null,selectedChoice:null}},computed:{choicesComputed:{get(){return this.choicesInternal},set(t){this.choicesInternal=t,this.$emit("update:choices",[...t])}},choicesSearchResults(){if(!this.searchTerm)return this.choicesComputed;const t=(0,c.Lx)(this.searchTerm.toLowerCase());return this.choicesComputed.filter(e=>(0,c.Lx)(this.customFormatter(e)).toLowerCase().indexOf(t)>=0)}},watch:{choicesComputed:{immediate:!0,handler(t){if(t){if(this.value){const e=l()(t,{id:this.value});e?this.selectedChoice=e:this.selectedChoice&&this.choicesInternal&&this.$emit("update:choices",[this.selectedChoice,...this.choicesInternal])}this.$nextTick(()=>this.$refs.autocomplete&&this.$refs.autocomplete.hasFocus&&this.$refs.autocomplete.$nextTick(()=>setTimeout(()=>{this.$refs.autocomplete.isActive=!0,this.selectedChoice&&(this.$refs.autocomplete.keyArrows("down"),this.$refs.autocomplete.setHovered(this.selectedChoice))})))}}},loading(t){t||this.$nextTick(()=>{if(!this.selectedChoice&&this.value)return this.selectedChoiceGet()})},selectedChoice(t){return this.setSelected(t||null)},value:{immediate:!0,handler(t){if(!t)return void(this.searchTerm=this.selectedChoice=null);if(!this.choicesComputed||this.loading)return;const e=l()(this.choicesComputed,{id:t});if(!e)return this.selectedChoiceGet();this.selectedChoice=e}}},created(){this.choicesGet()},methods:{async choicesGet(){this.loading=!0;try{let t=await(0,r.W7)(this.isParent);if(this.isParent||((0,u.tl)().costCenters.length?(t=t.filter(t=>(0,u.tl)().costCenters.includes(t.id)),this.$emit("update:option-all",!1)):1!==t.length&&this.optionAll&&t.unshift({id:"",code:"",name:"Todos",enabled:!0,isDefault:!1})),this.choicesComputed=t,this.value&&(await this.$nextTick(),!this.selectedChoice&&await this.selectedChoiceGet()),this.defaultValue&&!this.selectedChoice){const t=this.choicesComputed.find(t=>t.isDefault);t?this.setSelected(t):this.choicesComputed.length&&this.setSelected(this.choicesComputed[0])}}catch(t){console.error(`${this.$options.name} > methods > choicesGet > axios.get > error`,t)}finally{this.loading=!1}},customFormatter(t){return`${t.name} (${t.code})`},focus(){this.$refs.autocomplete.focus.apply(this.$refs.autocomplete,arguments)},onSelect(t){if(!t)return this.$emit("input",null),this.$emit("select",null);this.searchTerm=null,this.$emit("input",t.id),this.$emit("select",t)},async selectedChoiceGet(){this.loading=!0,await a.A.get(`costCenters/${this.value}`).then(t=>{this.loading=!1,this.selectedChoice=t.data||null,t.data&&((this.choicesComputed||[]).length?this.choicesComputed.find(e=>e.id===t.data.id)||this.choicesComputed.push(t.data):this.choicesComputed=[t.data])}).catch(t=>{console.error(`${this.$options.name} > methods > selectedChoiceGet > axios.get > error`,"\n error =",t)}).finally(()=>{this.loading=!1})},setSelected(){if(this.$refs.autocomplete)return this.$refs.autocomplete.setSelected(...arguments),void(this.$refs.autocomplete.selected||(this.searchTerm=this.$refs.autocomplete.newValue=null));this.$nextTick(()=>{this.$refs.autocomplete&&(this.searchTerm=this.$refs.autocomplete.newValue=null,this.$refs.autocomplete.setSelected(...arguments))})}}},h=d,p=i(81656),f=(0,p.A)(h,o,s,!1,null,null,null),m=f.exports}
1,1561:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return f}});var o=function(){var t=this,e=t._self._c;return e("div",[e("app-view-header",{attrs:{title:t.$tc("BankConciliationRule",2),icon:"balance-scale"},scopedSlots:t._u([{key:"breadcrumb",fn:function(){return[e("app-breadcrumb",{attrs:{"current-view":"BankConciliationRule","previous-view":"Setting","previous-route-name":"settings-index"}})]},proxy:!0}])}),e("div",{staticClass:"card"},[e("div",{staticClass:"card-content p-0 pb-4 pt-1"},[e("b-notification",{staticClass:"m-4",attrs:{type:"is-info",size:"is-medium","icon-size":"is-medium","has-icon":"",role:"alert"}},[e("span",{staticClass:"has-text-weight-semibold"},[t._v(t._s(t.$tc("BankConciliationRuleInfoTitle")))]),e("br"),t._v(" "+t._s(t.$tc("BankConciliationRuleInfoMessage"))+" ")]),e("nav",{staticClass:"level m-4"},[e("div",{staticClass:"level-left is-flex-wrap-wrap"},[e("div",{staticClass:"level-item"},[e("b-field",{staticClass:"mb-0"},[e("b-input",{attrs:{icon:"search",type:"search",placeholder:t.$tc("SearchName")},on:{input:t.onFilterChange},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})],1)],1),e("div",{staticClass:"level-item"},[e("b-field",{staticClass:"mb-0"},[e("b-select",{on:{input:t.onFilterChange},model:{value:t.statusFilter,callback:function(e){t.statusFilter=e},expression:"statusFilter"}},[e("option",{attrs:{value:"all"}},[t._v(" Todos los estados ")]),e("option",{attrs:{value:"active"}},[t._v(" "+t._s(t.$tc("Active",3))+" ")]),e("option",{attrs:{value:"inactive"}},[t._v(" "+t._s(t.$tc("Inactive",3))+" ")])])],1)],1)]),e("div",{staticClass:"level-right"},[e("div",{staticClass:"level-item"},[e("b-button",{attrs:{type:"is-primary"},on:{click:t.openCreateModal}},[t._v(" "+t._s(t.$tc("Create"))+" ")])],1)])]),e("b-table",{attrs:{data:t.data,loading:t.loading,striped:"",narrowed:"",hoverable:""},scopedSlots:t._u([{key:"empty",fn:function(){return[e("app-table-empty-state",{attrs:{title:t.$tc("NoBankConciliationRules"),subtitle:t.$tc("BankConciliationRuleEmptyStateSubtitle"),loading:t.loading,"action-label":t.$tc("Create")},on:{action:t.openCreateModal}})]},proxy:!0}])},[e("b-table-column",{attrs:{width:"32px",centered:""},scopedSlots:t._u([{key:"default",fn:function(i){return[e("b-tooltip",{attrs:{label:i.row.isActive?t.$tc("Active",3):t.$tc("Inactive",3),position:"is-right",type:"is-dark"}},[e("app-icon-enabled",{attrs:{active:i.row.isActive}})],1)]}}])}),e("b-table-column",{attrs:{label:t.$tc("Name")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.name)+" ")]}}])}),e("b-table-column",{attrs:{label:t.$tc("MovementNature")},scopedSlots:t._u([{key:"default",fn:function(i){return["Credit"===i.row.movementType?e("span",[e("b-icon",{attrs:{icon:"arrow-up",type:"is-success"}}),t._v(" "+t._s(t.$tc("BankMovementEntry"))+" ")],1):e("span",[e("b-icon",{attrs:{icon:"arrow-down",type:"is-danger"}}),t._v(" "+t._s(t.$tc("BankMovementExit"))+" ")],1)]}}])}),e("b-table-column",{attrs:{label:t.$tc("BankConcept")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.bankingConceptName)+" ")]}}])}),e("b-table-column",{scopedSlots:t._u([{key:"header",fn:function(){return[e("b-tooltip",{attrs:{"append-to-body":"",multilined:"",dashed:"",position:"is-bottom"},scopedSlots:t._u([{key:"default",fn:function(){return[e("span",{staticClass:"is-inline-block"},[t._v(" "+t._s(t.$tc("DescriptionCondition"))+" ")])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"has-text-left"},[t._v(" "+t._s(t.$tc("DescriptionConditionHelp"))+" ")])]},proxy:!0}])})]},proxy:!0},{key:"default",fn:function(e){return[t._v(" "+t._s(t.getConditionLabel(e.row.descriptionCondition))+": "+t._s(e.row.descriptionPattern)+" ")]}}])}),e("b-table-column",{attrs:{label:t.$tc("ExecutionMode")},scopedSlots:t._u([{key:"default",fn:function(i){return[e("b-tag",{attrs:{type:"Automatic"===i.row.executionMode?"is-success is-light":"is-info is-light"}},[t._v(" "+t._s(t.getExecutionModeLabel(i.row.executionMode))+" ")])]}}])}),e("b-table-column",{attrs:{width:"72px",centered:""},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",{staticClass:"is-flex is-justify-content-center is-align-items-center"},[e("b-tooltip",{attrs:{label:t.$tc("Edit"),position:"is-left"}},[e("a",{staticClass:"mx-1",on:{click:function(e){return t.openEditModal(i.row)}}},[e("b-icon",{staticClass:"has-text-black",attrs:{icon:"pencil",size:"is-medium"}})],1)]),e("b-tooltip",{attrs:{label:t.$tc("Delete"),position:"is-left"}},[e("a",{staticClass:"mx-1",on:{click:function(e){return t.onDelete(i.row.id)}}},[e("b-icon",{staticClass:"has-text-black",attrs:{icon:"trash-alt",size:"is-medium"}})],1)])],1)]}}])}
1)],1)],1),e("footer",[e("app-pagination",{attrs:{limit:t.perPage,"records-count":t.data.length,"has-more":t.hasMore,total:t.totalRows,loading:t.loading},on:{"update:limit":t.onPerPageChange,paginate:t.getData},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)]),e("modal-rule",{attrs:{visible:t.modal.isVisible,record:t.modal.entity,loading:t.modal.loading},on:{close:t.closeModal,save:t.saveRule}})],1)},s=[],a=i(90488),n=i(95170),l=i(64025),c=i(14804),r=i(24632),u={name:"BankConciliationRulesIndex",components:{AppPagination:c.A,ModalRule:r.A},data(){return{loading:!1,data:[],hasMore:!1,totalRows:0,search:"",statusFilter:"all",page:1,perPage:10,modal:{isVisible:!1,loading:!1,entity:null}}},created(){this.getData()},methods:{openCreateModal(){this.modal.entity=null,this.modal.isVisible=!0},openEditModal(t){this.modal.entity={...t},this.modal.isVisible=!0},closeModal(){this.modal.isVisible=!1,this.modal.entity=null},onDelete(t){this.$buefy.dialog.confirm({title:n.R.tc("SureDeleteRecord"),message:n.R.tc("WishToContinue"),type:"is-danger",hasIcon:!0,iconPack:"fa fa-exclamation-circle fa-3x alert-circle",confirmText:n.R.tc("Yes"),cancelText:n.R.tc("No"),onConfirm:async()=>{this.loading=!0;try{await(0,l.Ui)(t),(0,a.Q$)(n.R.tc("RecordSuccessfullyRemoved")),await this.getData()}catch(e){console.error("BankConciliationRulesIndex >>> onDelete >>> ",e)}finally{this.loading=!1}}})},onFilterChange(){this.page=1,this.getData()},searchOnClear(){this.search="",this.onFilterChange()},onPerPageChange(t){this.perPage=t,this.page=1},async getData(){this.loading=!0;try{const t=await(0,l.AB)({includeInactive:!0,limit:this.perPage,page:this.page,search:this.search,status:this.statusFilter});this.data=t?.data||[],this.hasMore=Boolean(t?.hasMore),this.totalRows=t?.count||0}catch(t){console.error("BankConciliationRulesIndex >>> getData >>> ",t)}finally{this.loading=!1}},async saveRule(t){this.modal.loading=!0;try{t.id?await(0,l.I$)(t.id,t):await(0,l.bH)(t),(0,a.Q$)(n.R.tc("RecordSuccessfullySaved")),this.closeModal(),await this.getData()}catch(e){console.error("BankConciliationRulesIndex >>> saveRule >>> ",e)}finally{this.modal.loading=!1}},getConditionLabel(t){return"StartsWith"===t?n.R.tc("DescriptionStartsWith"):"Equals"===t?n.R.tc("DescriptionEquals"):n.R.tc("DescriptionContains")},getExecutionModeLabel(t){return"Automatic"===t?n.R.tc("AutomaticCreation"):n.R.tc("SuggestCreation")}}},d=u,h=i(81656),p=(0,h.A)(d,o,s,!1,null,null,null),f=p.exports},51873:function(t,e,i){var o=i(9325),s=o.Symbol;t.exports=s},2523:function(t){function e(t,e,i,o){var s=t.length,a=i+(o?1:-1);while(o?a--:++a<s)if(e(t[a],a,t))return a;return-1}t.exports=e},72552:function(t,e,i){var o=i(51873),s=i(659),a=i(59350),n="[object Null]",l="[object Undefined]",c=o?o.toStringTag:void 0;function r(t){return null==t?void 0===t?l:n:c&&c in Object(t)?s(t):a(t)}t.exports=r},34840:function(t,e,i){var o="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;t.exports=o},659:function(t,e,i){var o=i(51873),s=Object.prototype,a=s.hasOwnProperty,n=s.toString,l=o?o.toStringTag:void 0;function c(t){var e=a.call(t,l),i=t[l];try{t[l]=void 0;var o=!0}catch(c){}var s=n.call(t);return o&&(e?t[l]=i:delete t[l]),s}t.exports=c},59350:function(t){var e=Object.prototype,i=e.toString;function o(t){return i.call(t)}t.exports=o},9325:function(t,e,i){var o=i(34840),s="object"==typeof self&&self&&self.Object===Object&&self,a=o||s||Function("return this")();t.exports=a},23805:function(t){function e(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=e},40346:function(t){function e(t){return null!=t&&"object"==typeof t}t.exports=e},44394:function(t,e,i){var o=i(72552),s=i(40346),a="[object Symbol]";function n(t){return"symbol"==typeof t||s(t)&&o(t)==a}t.exports=n}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.