{"version":3,"sources":["webpack:///./src/pages/reports/cancellation/cancellation.shell.vue?0ae7","webpack:///./src/pages/reports/cancellation/cancellation.shell.vue","webpack:///./src/pages/reports/cancellation/cancellation.shell.vue?5d85","webpack:///./src/pages/reports/cancellation/cancellation.shell.vue?5fe3"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","ref","staticClass","columns","filters","query","on","$event","updateTotals","scopedSlots","_u","key","fn","props","_v","_s","row","orderNumber","permissions","includes","exportLoading","exportData","_e","proxy","_l","product","id","staticStyle","$tc","type","getProductName","staticRenderFns","CancellationShell","_Mixins","_inherits","_super","_createSuper","_this","_classCallCheck","label","$i18n","t","value","start","Date","setHours","end","fieldName","optionName","optionValue","useChips","multiple","namespace","action","totals","cost","profit","pax","productsCount","ordersCount","turnover","_createClass","_product$property","productCategory","property","name","_this2","$nextTick","$refs","table","refresh","_step","data","arguments","length","undefined","result","_iterator","_createForOfIteratorHelper","s","n","done","report","err","e","f","company","_exportData","_asyncToGenerator","_regeneratorRuntime","mark","_callee","workbook","worksheet","buffer","link","_this3","wrap","_context","prev","next","tableData","Workbook","addWorksheet","header","forEach","o","_o$agent","_o$agent2","_o$company","_o$cancellingAgent","_o$cancellingAgent2","addRow","voucher","customer","_row$customer","_row$customer2","concat","surname","agent","isOnlineBooking","bookingDate","moment","format","cancellationDate","cancellingAgent","salesAmount","_row$totalAmount","_row$totalAmount2","totalAmount","$formatMoney","currency","deductionAmount","_row$deductionAmount","_row$deductionAmount2","xlsx","writeBuffer","sent","document","createElement","href","URL","createObjectURL","Blob","setAttribute","body","appendChild","click","stop","apply","map","get","_this4","style","sortable","field","_row$customer3","_row$customer4","_row$products","products","_product$property2","_row$agent","_row$agent2","_row$company","align","_row$totalAmount3","_row$totalAmount4","_row$deductionAmount3","_row$deductionAmount4","_row$returnAmount","_row$returnAmount2","returnAmount","select","sort","Mixins","TableMixin","__decorate","Getter","Ref","Watch","Component","components","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,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SACPX,MAAO,YACPE,MAAO,SAAC3I,GAAY,IAAAyJ,EAAAC,EACdhI,GAAwB,QAAhB+H,EAAAzJ,EAAI2J,oBAAY,IAAAF,OAAA,EAAhBA,EAAkB/H,QAAS,EACvC,MAAO,GAAP2E,OAAUmC,EAAKtB,aAAaxF,GAAM,KAAA2E,QAAoB,QAAhBqD,EAAA1J,EAAI2J,oBAAY,IAAAD,OAAA,EAAhBA,EAAkBvC,WAAY,SAI3E,CAAAxH,IAAA,QAAA4I,IAAA,WAoCC,MAAO,CACLqB,OAAQ,CAAC,iBACTC,KAAM,CAAE5J,YAAa,QACrBkH,SAAUxI,KAAKwI,cAElBnG,EApJmC,CAAS8I,eAAOC,SACpBC,eAAA,CAA/BC,eAAO,yB,+BACuBD,eAAA,CAA9BC,eAAO,wB,8BACyBD,eAAA,CAAhCC,eAAO,0B,kCACMD,eAAA,CAAbE,eAAI,U,4BA0LLF,eAAA,CADCG,eAAM,mB,qCA7LYnJ,EAAiBgJ,eAAA,CAHrCI,eAAU,CACTC,WAAY,MAEOrJ,WCtF4pB,I,YCO7qBsJ,EAAY,eACd,EACA7L,EACAsC,GACA,EACA,KACA,WACA,MAIa,aAAAuJ,E","file":"js/chunk-2d0d7c91.60774378.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('layout',{attrs:{\"name\":\"default\"}},[_c('toolbar'),_c('q-data-table',{ref:\"table\",staticClass:\"q-px-md\",attrs:{\"columns\":_vm.columns,\"filters\":_vm.filters,\"query\":_vm.query,\"action\":\"cancellation\",\"namespace\":\"reports\"},on:{\"update-data\":function($event){return _vm.updateTotals($event)}},scopedSlots:_vm._u([{key:\"body-cell-orderNumber\",fn:function(props){return [_c('q-td',{attrs:{\"auto-width\":true,\"props\":props}},[_c('q-badge',{attrs:{\"color\":\"negative\"}},[_vm._v(\" \"+_vm._s(props.row.orderNumber)+\" \")])],1)]}},{key:\"top-right\",fn:function(){return [(_vm.permissions.includes('VIEW_COST'))?_c('q-btn',{attrs:{\"color\":\"green\",\"icon-right\":\"mdi-file-excel\",\"label\":\"Excel\",\"no-caps\":\"\",\"loading\":_vm.exportLoading},on:{\"click\":_vm.exportData}}):_vm._e()]},proxy:true},{key:\"body-cell-products\",fn:function(props){return [_c('q-td',{attrs:{\"auto-width\":true,\"props\":props}},_vm._l((props.row.products),function(product){return _c('div',{key:product.id},[_c('q-badge',{staticStyle:{\"font-size\":\"10px\"}},[_vm._v(\" \"+_vm._s(_vm.$tc('GENERAL.' + product.type))+\" : \"+_vm._s(_vm.getProductName(product))+\" \")])],1)}),0)]}}])})],1)}\nvar staticRenderFns = []\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\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\nimport { Component, Mixins, Ref, Watch } from 'vue-property-decorator';\nimport { Getter } from 'vuex-class';\nimport moment from 'moment';\nimport { Workbook } from 'exceljs';\n\nimport TableMixin from '@/mixins/table.mixin';\n\nimport { QDataTable } from '@resclick/crs-ui';\nimport { IProductType } from '@resclick/data-access';\n\n@Component({\n components: {},\n})\nexport default class CancellationShell extends Mixins(TableMixin) {\n @Getter('user/defaultCurrency') currency!: string;\n @Getter('user/currentCompany') company!: string;\n @Getter('user/ownedPermissions') permissions!: string;\n @Ref('table') table!: QDataTable;\n\n exportLoading = false;\n\n get columns() {\n return [\n {\n label: 'GENERAL.VOUCHER',\n name: 'orderNumber',\n style: 'width:1px',\n },\n {\n label: 'GENERAL.CUSTOMER',\n name: 'customer',\n sortable: true,\n field: (row: any) => `${row.customer?.name || ''} ${row.customer?.surname || ''}`,\n },\n {\n label: 'GENERAL.PRODUCTS',\n name: 'products',\n sortable: true,\n field: (row: any) =>\n row.products?.map((product: IProductType) => {\n if (product.productCategory === 'PROPERTY') {\n return (product as any).property?.name;\n }\n }),\n },\n {\n label: 'GENERAL.PAX',\n name: 'pax',\n style: 'width:1px',\n },\n {\n label: 'GENERAL.AGENT',\n name: 'agent',\n style: 'width:1px',\n field: (row: any) => (row.isOnlineBooking ? 'ONLINE' : `${row.agent?.name} ${row.agent?.surname}`),\n },\n {\n label: 'GENERAL.COMPANY',\n name: 'company',\n sortable: true,\n field: (row: any) => row.company?.name,\n },\n {\n label: 'GENERAL.BOOKING_DATE',\n name: 'bookingDate',\n sortable: true,\n style: 'width:1px',\n align: 'center',\n field: (row: any) => row.bookingDate && moment(row.bookingDate).format('DD/MM/YYYY HH:mm'),\n },\n {\n label: 'GENERAL.CANCELLATION_DATE',\n name: 'cancellationDate',\n sortable: true,\n style: 'width:1px',\n align: 'center',\n field: (row: any) => row.cancellationDate && moment(row.cancellationDate).format('DD/MM/YYYY HH:mm'),\n },\n {\n label: 'GENERAL.CANCELLING_AGENT',\n name: 'cancellingAgent',\n sortable: true,\n align: 'center',\n style: 'width:1px',\n field: (row: any) => (row?.cancellingAgent ? `${row.cancellingAgent.name} ${row.cancellingAgent.surname}` : ''),\n },\n {\n label: 'GENERAL.SALES_AMOUNT',\n name: 'total',\n sortable: true,\n align: 'center',\n style: 'width:1px',\n field: (row: any) => {\n let value = row.totalAmount?.value || 0;\n return `${this.$formatMoney(value)} ${row.totalAmount?.currency || ''}`;\n },\n },\n {\n label: 'GENERAL.DEDUCTION_AMOUNT',\n name: 'deduction',\n sortable: true,\n align: 'center',\n style: 'width:1px',\n field: (row: any) => {\n let value = row.deductionAmount?.value || 0;\n return `${this.$formatMoney(value)} ${row.deductionAmount?.currency || ''}`;\n },\n },\n {\n label: 'GENERAL.RETURN_AMOUNT',\n name: 'return',\n sortable: true,\n align: 'center',\n style: 'width:1px',\n field: (row: any) => {\n let value = row.returnAmount?.value || 0;\n return `${this.$formatMoney(value)} ${row.returnAmount?.currency || ''}`;\n },\n },\n ];\n }\n\n filters = [\n {\n label: this.$i18n.t('GENERAL.BOOKING_DATE'),\n type: 'date-range',\n value: { start: new Date().setHours(0, 0, 0, 0), end: new Date().setHours(23, 59, 59, 999) },\n fieldName: 'bookingDate',\n },\n {\n label: this.$i18n.t('GENERAL.COMPANY'),\n type: 'selectDynamic',\n value: [],\n optionName: 'name',\n optionValue: 'id',\n useChips: true,\n multiple: true,\n fieldName: 'company',\n namespace: 'companies',\n action: 'find',\n },\n {\n label: this.$i18n.t('GENERAL.PROPERTY'),\n type: 'selectDynamic',\n value: [],\n optionName: 'name',\n optionValue: 'id',\n useChips: true,\n multiple: true,\n fieldName: 'products.property',\n namespace: 'properties',\n action: 'find',\n },\n ];\n\n get query() {\n return {\n select: ['+calculations'],\n sort: { orderNumber: 'desc' },\n currency: this.currency,\n };\n }\n\n // get totals() {\n // const table = this.$refs.table as any;\n // const data: any[] = table.tableData || [];\n\n // const result = {\n // cost: 0,\n // profit: 0,\n // pax: 0,\n // productsCount: 0,\n // ordersCount: 0,\n // turnover: 0,\n // };\n\n // for (const report of data) {\n // result.turnover += report.turnover;\n // result.cost += report.cost;\n // result.profit += report.profit;\n // result.pax += report.pax;\n // result.productsCount += report.productsCount;\n // result.ordersCount += report.ordersCount;\n // }\n // return result;\n // }\n\n getProductName(product: IProductType) {\n if (product.productCategory === 'PROPERTY') {\n return (product as any).property?.name;\n }\n }\n\n totals = {\n cost: 0,\n profit: 0,\n pax: 0,\n productsCount: 0,\n ordersCount: 0,\n turnover: 0,\n };\n\n @Watch('query.currency')\n onCurrencyChange() {\n this.$nextTick(() => {\n this.$refs.table.refresh();\n });\n }\n\n updateTotals(data: any = []) {\n const result = {\n cost: 0,\n profit: 0,\n pax: 0,\n productsCount: 0,\n ordersCount: 0,\n turnover: 0,\n };\n\n for (const report of data) {\n result.turnover += report.turnover;\n result.cost += report.cost;\n result.profit += report.profit;\n result.pax += report.pax;\n result.productsCount += report.productsCount;\n result.ordersCount += report.ordersCount;\n }\n\n this.totals = result;\n }\n\n created() {\n this.filters[1].value = [this.company] as any;\n }\n\n async exportData() {\n this.exportLoading = true;\n const data = this.table.tableData;\n\n const workbook = new Workbook();\n const worksheet = workbook.addWorksheet('cancels');\n\n let columns = [\n { header: 'Voucher', key: 'voucher' },\n { header: 'Customer', key: 'customer' },\n { header: 'Agent', key: 'agent' },\n { header: 'Pax', key: 'pax' },\n { header: 'Company', key: 'company' },\n { header: 'Booking Date', key: 'bookingDate' },\n { header: 'Cancellation Date', key: 'cancellationDate' },\n { header: 'Cancelled Agent', key: 'cancellingAgent' },\n { header: 'Sales Amount', key: 'salesAmount' },\n { header: 'Deduction Amount', key: 'deductionAmount' },\n ];\n\n worksheet.columns = columns;\n\n data.forEach((o: any) => {\n worksheet.addRow({\n voucher: o.orderNumber,\n customer: ((row: any) => `${row.customer?.name || ''} ${row.customer?.surname || ''}`)(o),\n // products\n pax: o.pax,\n agent: o.isOnlineBooking ? 'ONLINE' : `${o.agent?.name} ${o.agent?.surname}`,\n company: o.company?.name,\n bookingDate: o.bookingDate && moment(o.bookingDate).format('DD/MM/YYYY HH:mm'),\n cancellationDate: o.cancellationDate && moment(o.cancellationDate).format('DD/MM/YYYY HH:mm'),\n cancellingAgent: o?.cancellingAgent\n ? `${o.cancellingAgent?.name || ''} ${o.cancellingAgent?.surname || ''}`\n : '',\n salesAmount: ((row: any) => {\n let value = row.totalAmount?.value || 0;\n return `${this.$formatMoney(value)} ${row.totalAmount?.currency || ''}`;\n })(o),\n deductionAmount: ((row) => {\n let value = row.deductionAmount?.value || 0;\n return `${this.$formatMoney(value)} ${row.deductionAmount?.currency || ''}`;\n })(o),\n });\n });\n\n const buffer = await workbook.xlsx.writeBuffer();\n\n const link = document.createElement('a');\n\n link.href = URL.createObjectURL(\n new Blob([buffer], {\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n }),\n );\n\n link.setAttribute('download', `export-${moment().format('DD-MM-YYYY-HH-mm')}.xlsx`);\n\n document.body.appendChild(link);\n\n link.click();\n\n this.exportLoading = false;\n }\n\n cleanFilters() {\n this.filters = this.filters.map((f: any) => {\n switch (f.type) {\n case 'number':\n f.value = null;\n return f;\n case 'string':\n f.value = '';\n return f;\n case 'date-range':\n f.value = { start: '', end: '' };\n return f;\n case 'date':\n f.value = { start: '', end: '' };\n return f;\n default:\n return f;\n }\n });\n }\n}\n","import mod from \"-!../../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/babel-loader/lib/index.js!../../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-3!../../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./cancellation.shell.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/babel-loader/lib/index.js!../../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-3!../../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./cancellation.shell.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./cancellation.shell.vue?vue&type=template&id=3796cbde&scoped=true&\"\nimport script from \"./cancellation.shell.vue?vue&type=script&lang=ts&\"\nexport * from \"./cancellation.shell.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"3796cbde\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}