{"version":3,"sources":["webpack:///./src/components/Invoices/InvoiceSummary.vue","webpack:///src/components/Invoices/InvoiceSummary.vue","webpack:///./src/components/Invoices/InvoiceSummary.vue?1e0e","webpack:///./src/components/Invoices/InvoiceSummary.vue?b696"],"names":["render","_vm","this","_c","_self","mInvoice","staticClass","domProps","_s","invoiceTitle","class","showSummary","on","setShowSummary","_v","$t","showMailLog","setShowMailLog","EmailsSent","attrs","invoiceId","_e","$event","goToInvoice","staticRenderFns","InvoiceDetail","InvoiceMail","components","props","default","type","Number","invoice","Object","data","computed","temp","StatusId","concat","IsDeposit","toLowerCase","Code","created","self","getInvoiceData","EventBus","$on","updateMailCount","callbackUpdatedInvoice","beforeDestroy","setInvoice","$off","methods","_objectSpread","mapMutations","mailCount","_this","invoiceProvider","getInvoiceById","then","response","status","$router","push","name","params","Id","setVisibleItem","item","component"],"mappings":"0HAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAQF,EAAII,SAAUF,EAAG,MAAM,CAACG,YAAY,+BAA+B,CAACH,EAAG,MAAM,CAACG,YAAY,aAAaC,SAAS,CAAC,YAAcN,EAAIO,GAAGP,EAAIQ,iBAAiBN,EAAG,MAAM,CAACG,YAAY,0BAA0B,CAACH,EAAG,KAAK,CAACG,YAAY,kBAAkB,CAACH,EAAG,KAAK,CAACO,MAAM,CAAE,YAAaT,EAAIU,cAAe,CAACR,EAAG,IAAI,CAACS,GAAG,CAAC,MAAQX,EAAIY,iBAAiB,CAACZ,EAAIa,GAAGb,EAAIO,GAAGP,EAAIc,GAAG,gEAAgEZ,EAAG,KAAK,CAACO,MAAM,CAAE,YAAaT,EAAIe,cAAe,CAACb,EAAG,IAAI,CAACS,GAAG,CAAC,MAAQX,EAAIgB,iBAAiB,CAAChB,EAAIa,GAAGb,EAAIO,GAAGP,EAAIc,GAAG,2DAA2D,KAAKd,EAAIO,GAAGP,EAAII,SAASa,YAAY,aAAaf,EAAG,aAAa,C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A,KAEAA,EAAAvB,UAAA,GACAuB,EAAAC,iBAGAC,OAAAC,IAAA,uBAAAC,iBACAF,OAAAC,IAAA,uBAAAE,wBACAH,OAAAC,IAAA,uBAAAE,yBAGAC,cAAA,WACA,KAAAC,WAAA,MACAL,OAAAM,KAAA,uBAAAJ,iBACAF,OAAAM,KAAA,uBAAAH,wBACAH,OAAAM,KAAA,uBAAAH,yBAGAI,QAAAC,8BAAA,GACAC,eAAA,oCAEAN,uBAAA,SAAAhB,GACA,KAAA3B,SAAA2B,GAGAe,gBAAA,WACA,IAAAQ,EAAAxB,OAAA,KAAA1B,SAAAa,YACA,KAAAb,SAAAa,WAAAqC,EAAA,GAGAX,eAAA,eAAAY,EAAA,KACAC,OAAAL,QACAM,eAAA,KAAAtC,WACAuC,MAAA,SAAAC,GACA,MAAAA,EAAAC,SACAL,EAAAnD,SAAAuD,EAAA1B,UAKAX,YAAA,WACA,KAAAuC,QAAAC,KAAA,CACAC,KAAA,uBACAC,OAAA,CAAA7C,UAAA,KAAAf,SAAA6D,OAIArD,eAAA,WACA,KAAAsD,eAAA,YAGAlD,eAAA,WACA,KAAAkD,eAAA,YAGAA,eAAA,SAAAC,GACA,KAAApD,YAAA,YAAAoD,EACA,KAAAzD,YAAA,YAAAyD,MCrLsW,I,YCOlWC,EAAY,eACd,EACArE,EACAwB,GACA,EACA,KACA,KACA,MAIa,aAAA6C,E","file":"js/chunk-74912fee.js?id=7c2138437ee7008a474d","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.mInvoice)?_c('div',{staticClass:\"is-size-7 is-size-6-desktop\"},[_c('div',{staticClass:\"title is-4\",domProps:{\"textContent\":_vm._s(_vm.invoiceTitle)}}),_c('div',{staticClass:\"tabs is-boxed is-small\"},[_c('ul',{staticClass:\"has-margin-top\"},[_c('li',{class:{ 'is-active': _vm.showSummary }},[_c('a',{on:{\"click\":_vm.setShowSummary}},[_vm._v(_vm._s(_vm.$t('Components.Reservation.ReservationSummary.List_Summary')))])]),_c('li',{class:{ 'is-active': _vm.showMailLog }},[_c('a',{on:{\"click\":_vm.setShowMailLog}},[_vm._v(_vm._s(_vm.$t('Components.Reservation.ReservationSummary.List_MailLog'))+\" (\"+_vm._s(_vm.mInvoice.EmailsSent)+\")\")])])])]),_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.showSummary)?_c('div',[(_vm.mInvoice)?_c('InvoiceDetail',{staticClass:\"mb-6\",attrs:{\"invoiceId\":_vm.invoiceId,\"invoice\":_vm.mInvoice,\"showInvoiceTitle\":false}}):_vm._e(),_c('div',{staticClass:\"mb-6 has-text-centered\"},[_c('a',{staticClass:\"button is-primary is-medium\",on:{\"click\":function($event){return _vm.goToInvoice()}}},[_vm._v(_vm._s(_vm.$t('Components.Invoices.InvoiceSummary.Label_OpenInvoice')))])])],1):_vm._e()]),(_vm.showMailLog)?_c('div',[_c('InvoiceMail',{attrs:{\"invoiceId\":_vm.invoiceId}})],1):_vm._e()],1):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div\n    v-if=\"mInvoice\"\n    class=\"is-size-7 is-size-6-desktop\"\n  >\n    <div\n      v-text=\"invoiceTitle\"\n      class=\"title is-4\"\n    ></div>\n    <div class=\"tabs is-boxed is-small\">\n      <ul class=\"has-margin-top\">\n        <li :class=\"{ 'is-active': showSummary }\">\n          <a @click=\"setShowSummary\">{{\n            $t('Components.Reservation.ReservationSummary.List_Summary')\n          }}</a>\n        </li>\n\n        <li :class=\"{ 'is-active': showMailLog }\">\n          <a @click=\"setShowMailLog\">{{  $t('Components.Reservation.ReservationSummary.List_MailLog') }} ({{ mInvoice.EmailsSent }})</a>\n        </li>\n      </ul>\n    </div>\n\n    <transition\n      name=\"fade\"\n      mode=\"out-in\"\n    >\n      <div v-if=\"showSummary\">\n        <InvoiceDetail\n          v-if=\"mInvoice\"\n          :invoiceId=\"invoiceId\"\n          :invoice=\"mInvoice\"\n          :showInvoiceTitle=\"false\"\n          class=\"mb-6\"\n        />\n\n        <div class=\"mb-6 has-text-centered\">\n          <a\n            @click=\"goToInvoice()\"\n            class=\"button is-primary is-medium\"\n          >{{\n            $t('Components.Invoices.InvoiceSummary.Label_OpenInvoice')\n          }}</a>\n        </div>\n      </div>\n    </transition>\n\n    <div v-if=\"showMailLog\">\n      <InvoiceMail :invoiceId=\"invoiceId\" />\n    </div>\n  </div>\n</template>\n\n<script>\nimport invoiceProvider from '@/providers/invoice'\nimport { mapMutations } from 'vuex'\nimport EventBus from '@/eventbus/event-bus';\n\nconst InvoiceDetail = () => import('@/components/Invoices/InvoiceDetail')\nconst InvoiceMail = () => import('@/components/Invoices/InvoiceMail')\n\nexport default {\n  components: {\n    InvoiceDetail,\n    InvoiceMail,\n  },\n\n  props: {\n    invoiceId: {\n      default: 0,\n      type: Number,\n    },\n\n    invoice: {\n      default: null,\n      type: Object,\n    },\n  },\n\n  data() {\n    return {\n      mInvoice: this.invoice,\n      showMailLog: false,\n      showSummary: true,\n    }\n  },\n\n  computed: {\n    invoiceTitle() {\n      let temp = ''\n      if (this.mInvoice) {\n        temp =\n          this.mInvoice.StatusId !== 1\n            ? this.$t(\n              `Views.Invoices.General.StatusLabels.id_${this.mInvoice.StatusId}`\n            ) + ' '\n            : ''\n\n        if (\n          (this.mInvoice.StatusId === 0 || this.mInvoice.StatusId === 1) &&\n          this.mInvoice.IsDeposit\n        ) {\n          temp += temp\n            ? this.$t(\n              `Views.Invoices.General.Label_InvoiceTypeDeposit`\n            ).toLowerCase()\n            : this.$t(`Views.Invoices.General.Label_InvoiceTypeDeposit`)\n        } else {\n          temp += temp\n            ? ` ${this.$t(\n              `Views.Invoices.General.Label_Invoice`\n            ).toLowerCase()}`\n            : this.$t(`Views.Invoices.General.Label_Invoice`)\n        }\n\n        if (this.mInvoice.StatusId > 0) {\n          temp += ': ' + this.mInvoice.Code\n        }\n      }\n      return temp\n    },\n  },\n\n  created() {\n    let self = this\n\n    if (self.invoiceId > 0) {\n      self.getInvoiceData();\n    }\n\n    EventBus.$on('invoiceMailSend', this.updateMailCount);\n    EventBus.$on('invoiceAccepted', this.callbackUpdatedInvoice)\n    EventBus.$on('invoiceRejected', this.callbackUpdatedInvoice)\n  },\n\n  beforeDestroy() {\n    this.setInvoice(null);\n    EventBus.$off('invoiceMailSend', this.updateMailCount);\n    EventBus.$off('invoiceAccepted', this.callbackUpdatedInvoice)\n    EventBus.$off('invoiceRejected', this.callbackUpdatedInvoice)\n  },\n\n  methods: {\n    ...mapMutations('invoiceStore', ['setInvoice']),\n\n    callbackUpdatedInvoice(invoice) {\n      this.mInvoice = invoice\n    },\n\n    updateMailCount() {\n      let mailCount = Number(this.mInvoice.EmailsSent);\n      this.mInvoice.EmailsSent = mailCount + 1;\n    },\n\n    getInvoiceData() {\n      invoiceProvider.methods\n        .getInvoiceById(this.invoiceId)\n        .then((response) => {\n          if (response.status === 200) {\n            this.mInvoice = response.data\n          }\n        })\n    },\n\n    goToInvoice() {\n      this.$router.push({\n        name: `invoices-list-detail`,\n        params: { invoiceId: this.mInvoice.Id },\n      })\n    },\n\n    setShowSummary() {\n      this.setVisibleItem('summary')\n    },\n\n    setShowMailLog() {\n      this.setVisibleItem('maillog')\n    },\n\n    setVisibleItem(item) {\n      this.showMailLog = item === 'maillog'\n      this.showSummary = item === 'summary'\n    },\n  },\n}\n</script>\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!./InvoiceSummary.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!./InvoiceSummary.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./InvoiceSummary.vue?vue&type=template&id=6d428380\"\nimport script from \"./InvoiceSummary.vue?vue&type=script&lang=js\"\nexport * from \"./InvoiceSummary.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"],"sourceRoot":""}