{"version":3,"sources":["webpack:///src/components/Dashboards/InvoicePaidSplit.vue","webpack:///./src/components/Dashboards/InvoicePaidSplit.vue","webpack:///./src/components/Dashboards/InvoicePaidSplit.vue?5686","webpack:///./src/components/Dashboards/InvoicePaidSplit.vue?9477","webpack:///./src/components/Dashboards/InvoicePaidSplit.vue?d728"],"names":["Doughnut","Message","components","props","companyId","default","type","Number","locationId","endDate","Date","startDate","data","dataLoaded","noData","isLoading","chartData","labels","$t","datasets","options","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","render","_vm","_c","_self","scopedSlots","_u","key","fn","_v","_s","proxy","attrs","chartdata","_e","staticClass","message","staticRenderFns","_withStripped"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA;AAEA,IAAAA,QAAA,YAAAA,SAAA;EAAA;AAAA;AACA,IAAAC,OAAA,YAAAA,QAAA;EAAA;AAAA;AAEe;EACfC,UAAA;IACAF,QAAA,EAAAA,QAAA;IACAC,OAAA,EAAAA;EACA;EAEAE,KAAA;IACAC,SAAA;MACAC,OAAA;MACAC,IAAA,EAAAC;IACA;IAEAC,UAAA;MACAH,OAAA;MACAC,IAAA,EAAAC;IACA;IAEAE,OAAA;MACAJ,OAAA,WAAAA,SAAA;QACA,WAAAK,IAAA;MACA;MACAJ,IAAA,EAAAI;IACA;IAEAC,SAAA;MACAN,OAAA,WAAAA,SAAA;QACA,WAAAK,IAAA;MACA;MACAJ,IAAA,EAAAI;IACA;EACA;EAEAE,IAAA,WAAAA,KAAA;IACA;MACAC,UAAA;MACAC,MAAA;MACAF,IAAA;MACAG,SAAA;MAEAC,SAAA;QACAC,MAAA,GACA,KAAAC,EAAA,wDACA,KAAAA,EAAA,0DACA;QACAC,QA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,CAAC,CAAC,CACb,EACD,CACF,CAAC;AACH,CAAC;AACD,IAAIG,eAAe,GAAG,EAAE;AACxBhB,MAAM,CAACiB,aAAa,GAAG,IAAI;;;;;;;;;;;;;;ACzC3B;AAAA;AAAA;AAAA;AAA8F;AAC3B;AACL;;;AAG9D;AAC6F;AAC7F,gBAAgB,mHAAU;AAC1B,EAAE,6FAAM;AACR,EAAE,kGAAM;AACR,EAAE,2GAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;;ACtCf;AAAwS,CAAgB,kVAAG,EAAC,C;;;;;;;;;;;;;ACA5T;AAAA;AAAA;AAAA;AAAA","file":"js/142.js?id=8e1a20a1c6dcf3d65187","sourcesContent":["<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","var render = function render() {\n  var _vm = this,\n    _c = _vm._self._c\n  return _c(\n    \"div\",\n    [\n      _c(\"ui-section-header\", {\n        scopedSlots: _vm._u([\n          {\n            key: \"title\",\n            fn: function () {\n              return [\n                _vm._v(\n                  _vm._s(\n                    _vm.$t(\n                      \"Components.Dashboards.InvoicePaidSplit.Subtitle_InvoicesPaid\"\n                    )\n                  )\n                ),\n              ]\n            },\n            proxy: true,\n          },\n        ]),\n      }),\n      _vm.dataLoaded && !_vm.noData\n        ? _c(\"Doughnut\", {\n            attrs: { chartdata: _vm.chartData, options: _vm.options },\n          })\n        : _vm._e(),\n      _vm.dataLoaded && _vm.noData\n        ? _c(\"Message\", {\n            staticClass: \"is-small\",\n            attrs: { message: \"No data\" },\n          })\n        : _vm._e(),\n    ],\n    1\n  )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./InvoicePaidSplit.vue?vue&type=template&id=650a275e\"\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\n/* hot reload */\nif (module.hot) {\n  var api = require(\"/github/workspace/node_modules/vue-hot-reload-api/dist/index.js\")\n  api.install(require('vue'))\n  if (api.compatible) {\n    module.hot.accept()\n    if (!api.isRecorded('650a275e')) {\n      api.createRecord('650a275e', component.options)\n    } else {\n      api.reload('650a275e', component.options)\n    }\n    module.hot.accept(\"./InvoicePaidSplit.vue?vue&type=template&id=650a275e\", function () {\n      api.rerender('650a275e', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"src/components/Dashboards/InvoicePaidSplit.vue\"\nexport default component.exports","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../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/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 * from \"-!../../../node_modules/cache-loader/dist/cjs.js?{\\\"cacheDirectory\\\":\\\"node_modules/.cache/vue-loader\\\",\\\"cacheIdentifier\\\":\\\"d2a26fb4-vue-loader-template\\\"}!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InvoicePaidSplit.vue?vue&type=template&id=650a275e\""],"sourceRoot":""}