{"version":3,"sources":["webpack:///./src/components/Dashboards/InvoicePaidSplit.vue","webpack:///src/components/Dashboards/InvoicePaidSplit.vue","webpack:///./src/components/Dashboards/InvoicePaidSplit.vue?b5b1","webpack:///./src/components/Dashboards/InvoicePaidSplit.vue?5686"],"names":["render","_vm","this","_c","_self","scopedSlots","_u","key","fn","_v","_s","$t","proxy","dataLoaded","noData","attrs","chartData","options","_e","staticClass","staticRenderFns","Doughnut","Message","components","props","companyId","default","type","Number","locationId","endDate","Date","startDate","data","isLoading","labels","datasets","plugins","legend","display","position","cutout","responsive","maintainAspectRatio","aspectRatio","watch","immediate","handler","getLocationInvoicePaidSplitData","created","methods","self","statsProvider","getLocationInvoicePaidSplit","$options","filters","dateObjectIsoDateString","then","response","status","prepData","finally","NrOfInvoicesPaid","NrOfInvoicesUnPaid","push","borderWidth","borderColor","backgroundColor","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACA,EAAG,oBAAoB,CAACE,YAAYJ,EAAIK,GAAG,CAAC,CAACC,IAAI,QAAQC,GAAG,WAAW,MAAO,CAACP,EAAIQ,GAAGR,EAAIS,GAAGT,EAAIU,GAAG,oEAAoEC,OAAM,OAAWX,EAAIY,aAAeZ,EAAIa,OAAQX,EAAG,WAAW,CAACY,MAAM,CAAC,UAAYd,EAAIe,UAAU,QAAUf,EAAIgB,WAAWhB,EAAIiB,KAAMjB,EAAIY,YAAcZ,EAAIa,OAAQX,EAAG,UAAU,CAACgB,YAAY,WAAWJ,MAAM,CAAC,QAAU,aAAad,EAAIiB,MAAM,IAE/dE,EAAkB,G,gECsBtBC,EAAA,wGACAC,EAAA,qFAEe,GACfC,WAAA,CACAF,WACAC,WAGAE,MAAA,CACAC,UAAA,CACAC,QAAA,EACAC,KAAAC,QAGAC,WAAA,CACAH,QAAA,EACAC,KAAAC,QAGAE,QAAA,CACAJ,QAAA,WACA,WAAAK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EACApE,EACAoB,GACA,EACA,KACA,KACA,MAIa,aAAAgD,E","file":"js/chunk-2d0af430.js?id=51299c1ff5e9629de05c","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('ui-section-header',{scopedSlots:_vm._u([{key:\"title\",fn:function(){return [_vm._v(_vm._s(_vm.$t('Components.Dashboards.InvoicePaidSplit.Subtitle_InvoicesPaid')))]},proxy:true}])}),(_vm.dataLoaded && !_vm.noData)?_c('Doughnut',{attrs:{\"chartdata\":_vm.chartData,\"options\":_vm.options}}):_vm._e(),(_vm.dataLoaded && _vm.noData)?_c('Message',{staticClass:\"is-small\",attrs:{\"message\":'No data'}}):_vm._e()],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div>\n    <ui-section-header>\n      <template v-slot:title>{{\n        $t('Components.Dashboards.InvoicePaidSplit.Subtitle_InvoicesPaid')\n      }}</template>\n    </ui-section-header>\n\n    <Doughnut\n      v-if=\"dataLoaded && !noData\"\n      :chartdata=\"chartData\"\n      :options=\"options\"\n    />\n\n    <Message\n      v-if=\"dataLoaded && noData\"\n      :message=\"'No data'\"\n      class=\"is-small\"\n    />\n  </div>\n</template>\n<script>\nimport statsProvider from '@/providers/stats'\n\nconst Doughnut = () => import('@/components/UI/Charts/Doughnut')\nconst Message = () => import('@/components/UI/Message')\n\nexport default {\n  components: {\n    Doughnut,\n    Message,\n  },\n\n  props: {\n    companyId: {\n      default: 0,\n      type: Number,\n    },\n\n    locationId: {\n      default: 0,\n      type: Number,\n    },\n\n    endDate: {\n      default: () => {\n        return new Date(1900, 0, 1)\n      },\n      type: Date,\n    },\n\n    startDate: {\n      default: () => {\n        return new Date(1900, 0, 1)\n      },\n      type: Date,\n    },\n  },\n\n  data() {\n    return {\n      dataLoaded: false,\n      noData: false,\n      data: null,\n      isLoading: false,\n\n      chartData: {\n        labels: [\n          this.$t('Components.Dashboards.InvoicePaidSplit.Legend_Paid'),\n          this.$t('Components.Dashboards.InvoicePaidSplit.Legend_NotPaid'),\n        ],\n        datasets: [],\n      },\n      options: {\n        plugins: {\n          legend: {\n            display: true,\n            position: 'bottom',\n          },\n        },\n        cutout: '75%',\n        responsive: true,\n        maintainAspectRatio: true,\n        aspectRatio: 16 / 9,\n      },\n    }\n  },\n\n  watch: {\n    endDate: {\n      immediate: true,\n      handler: function () {\n        this.getLocationInvoicePaidSplitData()\n      },\n    },\n\n    startDate: {\n      immediate: true,\n      handler: function () {\n        this.getLocationInvoicePaidSplitData()\n      },\n    },\n  },\n\n  created() {\n    this.getLocationInvoicePaidSplitData()\n  },\n\n  methods: {\n    getLocationInvoicePaidSplitData() {\n      let self = this\n\n      self.dataLoaded = false\n\n      if (!self.isLoading) {\n        self.isLoading = true\n\n        statsProvider.methods\n          .getLocationInvoicePaidSplit(\n            self.locationId,\n            self.companyId,\n            self.$options.filters.dateObjectIsoDateString(self.startDate),\n            self.$options.filters.dateObjectIsoDateString(self.endDate)\n          )\n          .then((response) => {\n            if (response.status === 200) {\n              self.data = response.data\n              self.prepData()\n            }\n          })\n          .finally(() => {\n            self.isLoading = false\n          })\n      }\n    },\n\n    prepData() {\n      let self = this\n\n      self.noData = false\n      self.chartData.datasets = []\n\n      if (self.data.NrOfInvoicesPaid > 0 || self.data.NrOfInvoicesUnPaid > 0) {\n        self.chartData.datasets.push({\n          borderWidth: 1,\n          borderColor: ['rgba(149, 193, 30, 1)', 'rgba(252, 60, 99, 1)'],\n          backgroundColor: [\n            'rgba(149, 193, 30, 0.3)',\n            'rgba(252, 60, 99, 0.2)',\n          ],\n          data: [self.data.NrOfInvoicesPaid, self.data.NrOfInvoicesUnPaid],\n        })\n      } else {\n        self.noData = true\n      }\n\n      self.dataLoaded = true\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!./InvoicePaidSplit.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!./InvoicePaidSplit.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./InvoicePaidSplit.vue?vue&type=template&id=6eaeca6a\"\nimport script from \"./InvoicePaidSplit.vue?vue&type=script&lang=js\"\nexport * from \"./InvoicePaidSplit.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":""}