\n \n \n \n \n \n \n \n \n \n \n | \n \n \n \n \n | \n \n \n \n \n | \n \n \n \n \n | \n \n \n \n \n | \n \n \n \n \n \n | \n \n \n \n \n | \n \n \n \n \n | \n \n \n \n \n \n | \n \n \n \n \n | \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TableTransactions.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TableTransactions.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./TableTransactions.vue?vue&type=template&id=3eb7d7be&\"\nimport script from \"./TableTransactions.vue?vue&type=script&lang=js&\"\nexport * from \"./TableTransactions.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export default {\n data() {\n return {\n startDateKey: \"startDateKey\",\n endDateKey: \"endDateKey\",\n radioKey: \"rdok\",\n showTransation: false,\n transactionTBkey: \"\",\n filterSelected: {},\n }\n },\n mounted() {\n this.lodash.appendRouteQuery(this.$router, {\n query: this.lodash.omit(this.$route.query, \"object_id_selected\"),\n });\n },\n watch: {\n filter: {\n immediate: true,\n deep: true,\n handler(filter) {\n if (filter.start_day > filter.end_day) {\n this.filter = {\n ...this.filter,\n start_day: this.lodash.toTimeStamp(filter.end_day * 1000, \"start\"),\n end_day: this.lodash.toTimeStamp(filter.start_day * 1000, \"end\"),\n };\n this.startDateKey = this.lodash.resetKey(\"startDateKey\");\n this.endDateKey = this.lodash.resetKey(\"endDateKey\");\n }\n },\n },\n queryRoute: {\n immediate: true,\n deep: true,\n handler(query) {\n if (!this.lodash.isEmpty(query)) {\n this.filter = {\n ...query,\n start_day: +query.start_day || this.lodash.toTimeStamp(Date.now(), \"start\"),\n end_day: +query.end_day || this.lodash.toTimeStamp(Date.now(), \"end\"),\n };\n }\n },\n },\n \"filter.walletable_type\": {\n immediate: true,\n handler() {\n this.filter.walletable_id = \"\";\n },\n },\n },\n computed: {\n list() {\n return this.$store.getters[this.store + \".list\"]\n },\n detail() {\n return this.$store.getters[this.store + \".detail\"]\n },\n loading() {\n return this.$store.getters[this.store + \".loading\"]\n },\n\n selected() {\n return {\n [this.keySelected]: this.queryRoute[this.keySelected],\n };\n },\n queryRoute() {\n return this.$route.query || {};\n },\n },\n methods: {\n clearFilter() {\n this.lodash.appendRouteQuery(this.$router, { query: {} });\n this.filter = {\n currency_id: \"\",\n start_day: this.lodash.toTimeStamp(Date.now(), \"start\"),\n end_day: this.lodash.toTimeStamp(Date.now(), \"end\"),\n walletable_type: \"\",\n };\n this.showTransation = false;\n this.radioKey = this.lodash.resetKey(\"radioKey\");\n },\n changeWalletableType(type) {\n this.filter.walletable_type = type;\n this.filter.walletable_id = \"\";\n },\n exportExcel() {\n this.$store\n .dispatch(\"helper.exports.export-transactions\", {\n id: this.id,\n \"filter_between[voucher_date]\": `${this.filterSelected.start_day},${this.filterSelected.end_day}`,\n \"filter[currency_id]\": this.filterSelected.currency_id,\n \"filter[debit_or_credit]\":\n this.filterSelected?.account_id || this.detail?.account_id || \"\",\n \"filter[transactionable_id]\": this.selected?.object_id_selected || \"\",\n \"filter[card_id]\": this.selected?.id || \"\",\n })\n .then((data) => {\n const intlDate = new Intl.DateTimeFormat(\"en-GB\");\n const startDateFm = intlDate.format(\n new Date(1000 * this.filterSelected.start_day)\n );\n const endDateFm = intlDate.format(\n new Date(1000 * this.filterSelected.end_day)\n );\n const name =\n this.detail?.object?.name ||\n this.detail?.walletable_id ||\n this.detail?.transactionable_id ||\n this.detail?.name;\n const link = document.createElement(\"a\");\n link.href = window.URL.createObjectURL(data);\n link.download = `Transactions-${name}-${this.detail?.currency_id}-${startDateFm}-${endDateFm}.xlsx`;\n link.click();\n });\n },\n },\n destroyed() {\n this.$store.commit(this.store + \".purge\");\n },\n}\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('CRow',{staticClass:\"mb-5\"},[_c('CCol',{attrs:{\"lg\":\"4\",\"xl\":\"3\"}},[_c('TAside',{staticClass:\"card\"},[_c('CListGroup',[_c('CListGroupItem',[_c('CRow',[_c('CCol',{attrs:{\"col\":\"12\",\"lg\":\"12\",\"xl\":\"6\"}},[_c('TMessage',{staticClass:\"mb-2\",attrs:{\"content\":\"From date\",\"bold\":\"\"}}),_c('TInputDateTime',{key:_vm.startDateKey,staticClass:\"mb-2\",attrs:{\"value\":_vm.filter.start_day,\"timeline\":\"start\",\"placeholder\":\"Start date\"},on:{\"update:value\":function($event){return _vm.$set(_vm.filter, \"start_day\", $event)}}})],1),_c('CCol',{attrs:{\"col\":\"12\",\"lg\":\"12\",\"xl\":\"6\"}},[_c('TMessage',{staticClass:\"mb-2\",attrs:{\"content\":\"To date\",\"bold\":\"\"}}),_c('TInputDateTime',{key:_vm.endDateKey,staticClass:\"mb-2\",attrs:{\"value\":_vm.filter.end_day,\"timeline\":\"end\",\"placeholder\":\"End date\"},on:{\"update:value\":function($event){return _vm.$set(_vm.filter, \"end_day\", $event)}}})],1),_c('CCol',{attrs:{\"col\":\"12\"}},[_c('SSelectCurrency',{staticClass:\"mb-2\",attrs:{\"value\":_vm.filter.currency_id,\"label\":\"Currency\",\"prepend\":[]},on:{\"update:value\":function($event){return _vm.$set(_vm.filter, \"currency_id\", $event)}}})],1)],1),_c('hr'),_c('CRow',[_c('CCol',{attrs:{\"col\":\"12\"}},[_c('TInputRadio',{key:_vm.radioKey,staticClass:\"h-auto\",attrs:{\"label\":\"Object\",\"list\":_vm.walletable_types,\"value\":_vm.filter.walletable_type,\"custom\":\"\"},on:{\"update:value\":[function($event){return _vm.$set(_vm.filter, \"walletable_type\", $event)},_vm.changeWalletableType]}}),(_vm.filter.walletable_type == 'user')?_c('SSelectCustomer',{staticClass:\"mb-2\",attrs:{\"value\":_vm.filter.walletable_id,\"label\":\"Customer\"},on:{\"update:value\":function($event){return _vm.$set(_vm.filter, \"walletable_id\", $event)}}}):_vm._e(),(_vm.filter.walletable_type == 'supplier')?_c('SSelectSupplier',{staticClass:\"mb-2\",attrs:{\"value\":_vm.filter.walletable_id,\"label\":\"Supplier\"},on:{\"update:value\":function($event){return _vm.$set(_vm.filter, \"walletable_id\", $event)}}}):_vm._e()],1),_c('CCol',{staticClass:\"d-flex mt-2\",attrs:{\"col\":\"12\"}},[_c('TButton',{staticClass:\"w-100\",attrs:{\"content\":\"Filter\",\"disabled\":_vm.loading || !_vm.filter.end_day || !_vm.filter.start_day},on:{\"click\":_vm.onFilter}}),_c('TButtonClear',{staticClass:\"ml-1\",attrs:{\"variant\":\"outline\",\"size\":\"\"},on:{\"click\":_vm.clearFilter}})],1)],1)],1),(_vm.loading)?_c('CListGroupItem',[_c('TSpinner',{attrs:{\"loading\":_vm.loading}})],1):_vm._e(),_vm._l((_vm.list),function(object,index){return _c('CListGroupItem',{key:`${index}`,attrs:{\"color\":_vm.selected.object_id_selected == object.walletable_id\n ? 'primary'\n : 'secondary',\"to\":!_vm.loading\n ? _vm._.getAppendRouteQuery(_vm.$route, {\n object_id_selected: object.walletable_id,\n })\n : ''}},[_c('div',{staticClass:\"d-flex\"},[_c('SMessageWallet',{attrs:{\"data\":object}}),_c('TMessageMoney',{staticClass:\"ml-auto\",attrs:{\"amount\":object.balance,\"currency\":object.currency_id}})],1)])}),(!_vm.list.length && !_vm.loading)?_c('CListGroupItem',[_c('TMessageNotFound')],1):_vm._e(),(!_vm.loading && _vm.list.length)?_c('SButtonLoadmore',{staticClass:\"mt-2 mb-3\",attrs:{\"store\":\"accounting.statistics_accounting_period\"}}):_vm._e()],2)],1)],1),_c('CCol',{attrs:{\"lg\":\"8\",\"xl\":\"9\"}},[(!_vm.lodash.isEmpty(_vm.detail) && _vm.selected.object_id_selected)?_c('CCard',[_c('CCardBody',[_c('CRow',{staticClass:\"mb-2\"},[_c('CCol',{staticClass:\"d-flex align-items-center\"},[_c('SMessageWallet',{attrs:{\"data\":_vm.detail}}),_c('TButton',{staticClass:\"ml-auto\",attrs:{\"content\":\"Export excel\",\"icon\":\"cid-cloud-download\",\"size\":\"sm\",\"disabled\":_vm.export_loading},on:{\"click\":_vm.exportExcel}})],1)],1),_c('CRow',[_c('CCol',{attrs:{\"col\":\"12\",\"lg\":\"5\"}},[_c('CRow',[_c('CCol',{staticClass:\"mb-2\",attrs:{\"col\":\"12\"}},[_c('TWidgetSimple',{staticClass:\"m-0\",attrs:{\"title\":\"Opening balance\",\"color\":\"primary\",\"alignment\":\"left\"},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('TMessageMoney',{staticClass:\"h3\",attrs:{\"amount\":_vm.detail.opening_balance,\"currency\":_vm.filterSelected.currency_id,\"color\":\"primary\"}})]},proxy:true}],null,false,425390019)})],1),_c('CCol',{staticClass:\"mb-2\",attrs:{\"col\":\"12\"}},[_c('TWidgetSimple',{staticClass:\"m-0\",attrs:{\"title\":\"During balance\",\"color\":\"primary\",\"alignment\":\"left\",\"number\":_vm.detail.during_balance},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('TMessageMoney',{staticClass:\"h3\",attrs:{\"amount\":_vm.detail.during_balance,\"currency\":_vm.filterSelected.currency_id,\"color\":\"primary\"}})]},proxy:true}],null,false,1895765044)})],1),_c('CCol',{staticClass:\"mb-2\",attrs:{\"col\":\"12\"}},[_c('TWidgetSimple',{staticClass:\"m-0\",attrs:{\"title\":\"Closing balance\",\"color\":\"primary\",\"alignment\":\"left\",\"number\":_vm.detail.closing_balance},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('TMessageMoney',{staticClass:\"h3\",attrs:{\"amount\":_vm.detail.closing_balance,\"currency\":_vm.filterSelected.currency_id,\"color\":\"primary\"}})]},proxy:true}],null,false,2720332676)})],1)],1)],1),_c('CCol',{attrs:{\"col\":\"12\",\"lg\":\"7\"}},[_c('CListGroup',{staticClass:\"scroll-y\",staticStyle:{\"max-height\":\"320px\"}},_vm._l((_vm.tatistics_transaction_types),function(type,index){return _c('CListGroupItem',{key:`${index}`},[_c('div',{staticClass:\"d-flex align-items-center\"},[(type.type)?_c('SMessageTransactionType',{staticClass:\"mb-0 h6\",attrs:{\"value\":type.type.id}}):_vm._e(),_c('TMessageMoney',{staticClass:\"ml-auto\",attrs:{\"amount\":type.amount,\"currency\":type.currency_id}})],1)])}),1)],1)],1)],1)],1):_vm._e(),(\n !_vm.lodash.isEmpty(_vm.detail) &&\n _vm.showTransation &&\n _vm.selected.object_id_selected\n )?_c('TableTransactions',{key:_vm.transactionTBkey,staticClass:\"mb-4\",attrs:{\"showVoucherDateFilter\":false,\"store\":\"accounting.transactions\",\"showReference\":\"\",\"default_filter\":{\n 'filter[transactionable_id]': _vm.selected.object_id_selected,\n 'filter[currency_id]': _vm.filterSelected.currency_id,\n 'filter_between[voucher_date]': `${_vm.filterSelected.start_day},${_vm.filterSelected.end_day}`,\n sort: '-id',\n append: 'object,wallet,references',\n include: 'preparedBy',\n }}}):_vm._e()],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","