{"version":3,"sources":["webpack:///./src/pages/batch-credit/BatchCredit.vue?5b9d","webpack:///./src/pages/batch-credit/BatchCredit.vue","webpack:///./src/pages/batch-credit/BatchCredit.vue?f981","webpack:///./src/pages/batch-credit/BatchCredit.vue?0b11"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_m","attrs","_v","columns","rows","scopedSlots","_u","key","fn","props","column","field","_s","_batchCreatedDate","formattedRow","uploaddate","staticRenderFns","transactionsModule","use","isUploadFileVisible","searchTerm","batchTxns","label","sortable","getBatchList","getBatchTxns","result","batchList","e","console","error","message","map","txn","type","reference","created","seconds","amount","_generateTotalAmount","transactionsList","status","length","total","forEach","parseFloat","num","createdDate","unix","format","filter","Action","components","CustomTable","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,yBAAyB,CAACF,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,MAAM,CAACE,YAAY,6BAA6B,CAACN,EAAIO,GAAG,GAAGH,EAAG,MAAM,CAACA,EAAG,cAAc,CAACE,YAAY,2BAA2BE,MAAM,CAAC,GAAK,yBAAyB,CAACR,EAAIS,GAAG,oBAAoB,KAAKL,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,cAAc,CAACI,MAAM,CAAC,QAAUR,EAAIU,QAAQ,KAAOV,EAAIW,MAAMC,YAAYZ,EAAIa,GAAG,CAAC,CAACC,IAAI,YAAYC,GAAG,SAASC,GAAO,MAAO,CAAyB,eAAvBA,EAAMC,OAAOC,MAAwBd,EAAG,OAAO,CAACE,YAAY,WAAW,CAACN,EAAIS,GAAG,IAAIT,EAAImB,GAAGnB,EAAIoB,kBAAkBJ,EAAMK,aAAaC,aAAa,OAAOlB,EAAG,OAAO,CAACE,YAAY,WAAW,CAACN,EAAIS,GAAGT,EAAImB,GAAGH,EAA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,SAAkBI,GAChB,OAAKA,EACE,IAAOC,KAAKD,GAAaE,OAAO,+BADd,QAlF7B,2BAsFE,WACE,OAAOvD,KAAKS,QAAQ+C,QAAO,SAACxC,GAAD,QAAcA,EAAOa,gBAvFpD,GAAyC,QAEvC,gBADCN,EAAmBkC,OAAO,iB,mCADR,EAAW,gBAL/B,eAAU,CACTC,WAAY,CACVC,YAAA,WAGiB,WCnDquB,I,YCOtvBC,EAAY,eACd,EACA9D,EACAwB,GACA,EACA,KACA,KACA,MAIa,aAAAsC,E","file":"js/chunk-2d0b68ae.4effd170.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"p-8 lg:px-16 lg:py-10\"},[_c('div',{staticClass:\"flex flex-col\"},[_c('div',{staticClass:\"flex justify-between mb-6\"},[_vm._m(0),_c('div',[_c('router-link',{staticClass:\"btn btn-orange uppercase\",attrs:{\"to\":\"/batch-credit/upload\"}},[_vm._v(\" Upload File \")])],1)]),_c('div',{staticClass:\"w-full\"},[_c('CustomTable',{attrs:{\"columns\":_vm.columns,\"rows\":_vm.rows},scopedSlots:_vm._u([{key:\"table-row\",fn:function(props){return [(props.column.field === 'uploaddate')?_c('span',{staticClass:\"text-sm\"},[_vm._v(\" \"+_vm._s(_vm._batchCreatedDate(props.formattedRow.uploaddate))+\" \")]):_c('span',{staticClass:\"text-sm\"},[_vm._v(_vm._s(props.formattedRow[props.column.field]))])]}}])})],1)])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h2',{staticClass:\"text-2xl font-semibold text-blue-900\"},[_vm._v(\"Batch Credit\")])])}]\n\nexport { render, staticRenderFns }","\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\nimport { Vue, Component } from \"vue-property-decorator\";\nimport { namespace } from \"vuex-class\";\nimport VModal from \"vue-js-modal\";\nimport moment from \"moment\";\n\nimport { CustomTable } from \"@/components\";\nimport { Batch, ListBatchResponse } from \"@/proto/batch/all_pb\";\nimport { formatCurrency } from \"@/utils/common\";\n\nconst transactionsModule = namespace(\"transactions\");\n\nVue.use(VModal);\n\n@Component({\n components: {\n CustomTable,\n },\n})\nexport default class BatchCredit extends Vue {\n @transactionsModule.Action(\"getBatchTxns\")\n getBatchTxns!: (batch: Array) => ListBatchResponse.AsObject;\n\n isUploadFileVisible = false;\n columns = [] as any[];\n searchTerm = \"\";\n batchTxns: Array = [];\n\n created() {\n this.columns = [\n {\n field: \"type\",\n label: \"Transaction\",\n sortable: true,\n },\n {\n field: \"reference\",\n label: \"Reference\",\n sortable: true,\n },\n {\n field: \"uploaddate\",\n label: \"Upload Date\",\n sortable: true,\n },\n {\n field: \"amount\",\n label: \"Amount\",\n sortable: true,\n },\n {\n field: \"status\",\n label: \"Status\",\n sortable: false,\n },\n ];\n }\n\n mounted() {\n this.getBatchList();\n }\n\n async getBatchList() {\n try {\n const result = await this.getBatchTxns([]);\n this.batchTxns = result.batchList;\n } catch (error) {\n const e = error as Error;\n console.error(`Error on Batch Debit: ${e.message}`);\n }\n }\n\n get rows() {\n return this.batchTxns.map((txn) => {\n return {\n type: \"Payroll Exeutive\",\n reference: \"N/A\",\n uploaddate: txn.created.seconds,\n amount: `PHP ${this._generateTotalAmount(txn.transactionsList)}`,\n status: txn.status,\n };\n });\n }\n\n _generateTotalAmount(transactionsList: any[]): string {\n if (!transactionsList.length) {\n return \"0.00\";\n }\n\n let total = 0;\n\n transactionsList.forEach((txn) => {\n const amount = parseFloat(txn.amount.num) / 100;\n total += amount;\n });\n\n // return total.toFixed(2);\n return formatCurrency(total);\n }\n\n _batchCreatedDate(createdDate: number): string {\n if (!createdDate) return \"N/A\";\n return moment.unix(createdDate).format(\"DD MMM YYYY[\\n] kk:mm [GMT]\");\n }\n\n get sortableColumns() {\n return this.columns.filter((column) => !!column.sortable);\n }\n}\n","import mod from \"-!../../../node_modules/.pnpm/cache-loader@4.1.0_webpack@4.46.0/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../node_modules/.pnpm/thread-loader@2.1.3_webpack@4.46.0/node_modules/thread-loader/dist/cjs.js!../../../node_modules/.pnpm/babel-loader@8.2.3_7f185b6b63b1b293762538aa414d8c1b/node_modules/babel-loader/lib/index.js!../../../node_modules/.pnpm/ts-loader@6.2.2_typescript@3.9.10/node_modules/ts-loader/index.js??ref--15-3!../../../node_modules/.pnpm/cache-loader@4.1.0_webpack@4.46.0/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/.pnpm/vue-loader@15.9.8_679359cdb69c218f2f8f476b2ba08796/node_modules/vue-loader/lib/index.js??vue-loader-options!./BatchCredit.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/.pnpm/cache-loader@4.1.0_webpack@4.46.0/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../node_modules/.pnpm/thread-loader@2.1.3_webpack@4.46.0/node_modules/thread-loader/dist/cjs.js!../../../node_modules/.pnpm/babel-loader@8.2.3_7f185b6b63b1b293762538aa414d8c1b/node_modules/babel-loader/lib/index.js!../../../node_modules/.pnpm/ts-loader@6.2.2_typescript@3.9.10/node_modules/ts-loader/index.js??ref--15-3!../../../node_modules/.pnpm/cache-loader@4.1.0_webpack@4.46.0/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/.pnpm/vue-loader@15.9.8_679359cdb69c218f2f8f476b2ba08796/node_modules/vue-loader/lib/index.js??vue-loader-options!./BatchCredit.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./BatchCredit.vue?vue&type=template&id=5c09c338&\"\nimport script from \"./BatchCredit.vue?vue&type=script&lang=ts&\"\nexport * from \"./BatchCredit.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/.pnpm/vue-loader@15.9.8_679359cdb69c218f2f8f476b2ba08796/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"],"sourceRoot":""}