{"version":3,"sources":["webpack:///./src/utilities/Date/parse.js","webpack:///./src/pages/Management/vendors/tabs/Invoices/List.vue?4857","webpack:///./src/services/Vendors/VendorInvoices/store.js","webpack:///./src/pages/Management/vendors/tabs/Invoices/components/Download.vue?9a5b","webpack:///src/pages/Management/vendors/tabs/Invoices/components/Download.vue","webpack:///./src/pages/Management/vendors/tabs/Invoices/components/Download.vue?5c06","webpack:///./src/pages/Management/vendors/tabs/Invoices/components/Download.vue","webpack:///./src/pages/Management/vendors/tabs/Invoices/keys/methods.js","webpack:///./src/pages/Management/vendors/tabs/Invoices/keys/data.js","webpack:///src/pages/Management/vendors/tabs/Invoices/List.vue","webpack:///./src/pages/Management/vendors/tabs/Invoices/List.vue?8788","webpack:///./src/pages/Management/vendors/tabs/Invoices/List.vue","webpack:///./src/services/blobutility.js"],"names":["parseDate","date","format","console","debug","parsed","moment","isValid","exception","message","error","render","_vm","this","_h","$createElement","_c","_self","attrs","$t","region","filters","rows","columns","perPage","loading","scopedSlots","_u","key","fn","style","width","height","class","show","float","background","border","on","$event","staticStyle","_v","proxy","staticRenderFns","isDebug","actions","getPayeeById","vendorID","kms","get","params","apPayeeID","ownerID","vendor","JSON","stringify","result","getVendorInvoiceList","payeeID","log","list","results","notifyProblem","createVendorInvoice","dispatch","payload","done","post","hoaID","vendorGlobalID","invoiceNumber","startDate","endDate","undefined","apInvoiceID","details","notifyError","updateVendorInvoice","put","cancelVendorInvoice","Vue","use","Vuex","vendorInvoice","Store","state","mutations","getters","documentID","staticClass","preventDefault","downloadPdf","props","Number","String","Function","component","methods","determineRows","Array","isArray","map","entry","dateFormat","_get","payeeInformation","postingDate","document","Download","getPayeeID","then","loadVendorInvoices","loadingComponent","$buefy","open","container","close","reload","$route","id","asBase64","path","returned","contentType","blob","base64toBlob","showPdf","notifyMessage","notifyWarning","data","formatDateFn","value","field","label","aria","sortable","searchable","styles","filterButton","marginTop","name","components","PageContentLayoutOnly","ModernTable","computed","watch","mounted","i18n","messages","en","b64Data","sliceSize","byteCharacters","atob","byteArrays","offset","length","slice","byteNumbers","i","charCodeAt","byteArray","Uint8Array","push","Blob","type","newBlob","window","navigator","msSaveOrOpenBlob","URL","createObjectURL","link","createElement","download","setAttribute","href","click","setTimeout","revokeObjectURL","showAnyType","mimeType"],"mappings":"0HAAA,2DAQaA,EAAY,SAACC,GAAwB,IAAlBC,EAAkB,uDAAT,KACvC,GAAoB,kBAATD,EAET,OADAE,QAAQC,MAAR,+CAA8D,CAAEH,SACzDA,EAGT,IACE,IAAMI,EAASC,IAAOL,GAClBI,EAAOE,YACTN,EAAOK,IAAOL,GAAMC,OAAOA,IAE7B,MAAOM,GACHA,GAAaA,EAAUC,QACzBN,QAAQO,MAAMF,EAAUC,SAExBN,QAAQO,MAAMF,GAIlB,OAAOP,I,2CC3BT,IAAIU,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,wBAAwB,CAACE,MAAM,CAAC,aAAaN,EAAIO,GAAG,uBAAuB,KAAO,WAAW,CAACH,EAAG,cAAc,CAACE,MAAM,CAAC,OAASN,EAAIQ,OAAO,QAAUR,EAAIS,QAAQ,KAAOT,EAAIU,KAAK,QAAUV,EAAIW,QAAQ,WAAa,CACjTC,QAAS,IACT,QAAUZ,EAAIa,QAAQ,YAAc,OAAO,UAAY,IAAIC,YAAYd,EAAIe,GAAG,CAAC,CAACC,IAAI,SAASC,GAAG,WAAW,MAAO,CAACb,EAAG,MAAM,CAACc,MAAM,CAAGC,MAAO,OAAQC,OAAQ,SAAW,CAAChB,EAAG,WAAW,CAACiB,MAAM,kBAAoBrB,EAAIS,QAAQa,KAAO,SAAW,IAAIJ,MAAM,CAAGK,MAAO,QAASC,WAAY,OAAQC,OAAQ,GAAKnB,MAAM,CAAC,KAAO,YAAYoB,GAAG,CAAC,MAAQ,SAASC,GAAQ3B,EAAIS,QAAQa,MAAQtB,EAAIS,QAAQa,QAA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AAOrD,KAAKe,EAAM,UAElBiD,YAAW,WACTX,OAAOG,IAAIS,gBAAgBlD","file":"js/vendors.vendorInvoices.b9d5d0d8.js","sourcesContent":["/*\r\n Example:\r\n import { parseDate } from '@/utilities/Date/parse'\r\n\r\n const parsedDate = parseDate (date, 'LL');\r\n*/\r\nimport moment from 'moment'\r\n\r\nexport const parseDate = (date, format = 'LL') => {\r\n if (typeof date !== 'string') {\r\n console.debug(`parseDate can only parse a date string. got:`, { date })\r\n return date\r\n }\r\n\r\n try {\r\n const parsed = moment(date)\r\n if (parsed.isValid()) {\r\n date = moment(date).format(format)\r\n }\r\n } catch (exception) {\r\n if (exception && exception.message) {\r\n console.error(exception.message)\r\n } else {\r\n console.error(exception)\r\n }\r\n }\r\n\r\n return date\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('PageContentLayoutOnly',{attrs:{\"aria-label\":_vm.$t('vendorInvoice.title'),\"role\":\"region\"}},[_c('ModernTable',{attrs:{\"region\":_vm.region,\"filters\":_vm.filters,\"rows\":_vm.rows,\"columns\":_vm.columns,\"pagination\":{\n perPage: 12\n },\"loading\":_vm.loading,\"headerColor\":\"#FFF\",\"condensed\":\"\"},scopedSlots:_vm._u([{key:\"header\",fn:function(){return [_c('div',{style:({ width: '100%', height: '60px' })},[_c('b-button',{class:'filter-button ' + (_vm.filters.show ? 'active' : ''),style:({ float: 'right', background: 'none', border: 0 }),attrs:{\"type\":\"is-ghost\"},on:{\"click\":function($event){_vm.filters.show = !_vm.filters.show}}},[_c('b-icon',{staticStyle:{\"display\":\"inline-block\"},attrs:{\"pack\":\"mdi\",\"icon\":\"filter-outline\",\"size\":\"is-small\"}}),_c('div',{staticStyle:{\"display\":\"inline-block\"}},[_vm._v(\"Filter\")])],1)],1)]},proxy:true}])})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/*\r\n import { vendorInvoice } from '@/services/Vendors/VendorInvoices/store'\r\n*/\r\n\r\nimport Vue from 'vue'\r\nimport Vuex from 'vuex'\r\n\r\nimport { notifyProblem, notifyError } from '@/services/notify'\r\nimport kms from '@/services/kms'\r\n\r\nconst isDebug = true\r\n\r\n/* eslint-disable no-empty-pattern */\r\nconst actions = {\r\n /*\r\n const { list } = await vendorInvoice.dispatch ('getPayeeById', {\r\n vendorID\r\n });\r\n */\r\n\r\n //Payee by Vendor Id\r\n async getPayeeById({}, { vendorID }) {\r\n try {\r\n console.debug('in getPayeeById...' + vendorID)\r\n const vendor = await kms.get('/AccountsPayable/APPayee', {\r\n params: {\r\n apPayeeID: null,\r\n ownerID: null,\r\n vendorID: vendorID\r\n }\r\n })\r\n\r\n if (isDebug == true) console.debug('getPayeeById=' + JSON.stringify(vendor))\r\n\r\n return {\r\n result: vendor\r\n }\r\n } catch (exception) {\r\n console.debug(exception)\r\n }\r\n\r\n return {\r\n vendor: {}\r\n }\r\n },\r\n\r\n async getVendorInvoiceList({}, { payeeID }) {\r\n console.log('in getVendorInvoiceList...')\r\n try {\r\n const result = await kms.get('/AccountsPayable/APInvoice/List', {\r\n params: {\r\n payeeID\r\n }\r\n })\r\n\r\n if (isDebug == true) console.debug('getVendorInvoiceList log=' + JSON.stringify(result))\r\n\r\n return {\r\n list: result.results\r\n }\r\n } catch (exception) {\r\n notifyProblem(`The vendor invoice list could not be retrieved.`)\r\n console.error(exception)\r\n }\r\n\r\n return {\r\n list: []\r\n }\r\n },\r\n\r\n // Add Vendor Invoice\r\n async createVendorInvoice({ dispatch }, { payload, done }) {\r\n if (isDebug == true) console.debug('...in createVendorInvoice=' + JSON.stringify(payload))\r\n try {\r\n const results = await kms.post(`/AccountsPayable/APInvoice/CreateVendorInvoice`, {\r\n hoaID: payload.hoaID,\r\n vendorGlobalID: payload.vendorGlobalID,\r\n invoiceNumber: payload.invoiceNumber,\r\n startDate: payload.startDate,\r\n endDate: payload.endDate\r\n })\r\n\r\n if (this.isDebug == true) console.debug('results=' + JSON.stringify(results))\r\n\r\n if (dispatch && dispatch != undefined) console.debug(dispatch)\r\n\r\n if (results.apInvoiceID > 0) {\r\n console.debug(`Successfully created a vendor invoice.`)\r\n done({ details: results })\r\n } else {\r\n notifyError('There was a problem creating this vendor invoice.')\r\n }\r\n } catch (exception) {\r\n notifyError(`There was a problem creating this vendor invoice.`)\r\n console.error(exception)\r\n }\r\n },\r\n\r\n async updateVendorInvoice({ dispatch }, { payload = {}, done }) {\r\n if (isDebug == true) console.debug('...in updateVendorInvoice')\r\n try {\r\n const results = await kms.put(`/AccountsPayable/APInvoice/UpdateVendorInvoice`, payload)\r\n\r\n if (this.isDebug == true) console.debug('results=' + JSON.stringify(results))\r\n\r\n if (dispatch && dispatch != undefined) console.debug(dispatch)\r\n\r\n if (results.apInvoiceID > 0) {\r\n console.debug(`Successfully updated this vendor invoice.`)\r\n done({ details: results })\r\n } else {\r\n console.debug('There was a problem updating this vendor invoice.')\r\n }\r\n } catch (exception) {\r\n notifyError(`There was a problem processing the update for this vendor invoice.`)\r\n console.error(exception)\r\n }\r\n },\r\n\r\n async cancelVendorInvoice({ dispatch }, { payload = {}, done }) {\r\n if (isDebug == true) console.debug('...in cancelVendorInvoice')\r\n try {\r\n const results = await kms.put(`/AccountsPayable/APInvoice/CancelVendorInvoice`, payload)\r\n\r\n if (this.isDebug == true) console.debug('results=' + JSON.stringify(results))\r\n\r\n if (dispatch && dispatch != undefined) console.debug(dispatch)\r\n\r\n if (results.apInvoiceID > 0) {\r\n console.debug(`Successfully cancelled this vendor invoice.`)\r\n done({ details: results })\r\n } else {\r\n console.debug('There was a problem cancelling this vendor invoice.')\r\n }\r\n } catch (exception) {\r\n notifyError(`There was a problem processing the cancel for this vendor invoice.`)\r\n console.error(exception)\r\n }\r\n }\r\n}\r\n/* eslint-enable no-empty-pattern */\r\n\r\nVue.use(Vuex)\r\nexport const vendorInvoice = new Vuex.Store({\r\n state: {},\r\n mutations: {},\r\n getters: {},\r\n actions\r\n})\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[((typeof _vm.apInvoiceID === 'string' || typeof _vm.apInvoiceID === 'number') && _vm.documentID > 0)?_c('span',[_c('button',{staticClass:\"button is-info is-light is-small is-outline is-rounded\",on:{\"click\":function($event){$event.preventDefault();return _vm.downloadPdf(_vm.apInvoiceID)}}},[_vm._v(\" Pdf \")])]):_c('span',[_vm._v(\"   \")])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n","import mod from \"-!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Download.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Download.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Download.vue?vue&type=template&id=5888a77f&\"\nimport script from \"./Download.vue?vue&type=script&lang=js&\"\nexport * from \"./Download.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","import _get from 'lodash/get'\r\nimport { vendorInvoice } from '@/services/Vendors/VendorInvoices/store'\r\nimport kms from '@/services/kms'\r\nimport { parseDate } from '@/utilities/Date/parse'\r\nimport Download from '../components/Download'\r\nimport { base64toBlob, showPdf } from '@/services/blobutility'\r\nimport { notifyProblem, notifyMessage, notifyWarning } from '@/services/notify'\r\n\r\nexport const methods = {\r\n determineRows: function(list) {\r\n if (!Array.isArray(list)) {\r\n return\r\n }\r\n\r\n var rows = list.map(entry => {\r\n var dateFormat = 'LL'\r\n\r\n const invoiceNumber = _get(entry, 'invoiceNumber', '')\r\n const payeeInformation = _get(entry, 'payeeInformation', '')\r\n const postingDate = parseDate(_get(entry, 'postingDate', null), dateFormat)\r\n\r\n return {\r\n invoiceNumber: invoiceNumber,\r\n payeeInformation: payeeInformation,\r\n postingDate: postingDate,\r\n document: {\r\n component: Download,\r\n props: {\r\n documentID: _get(entry, ['invoiceDocumentID'], 0),\r\n apInvoiceID: _get(entry, 'apInvoiceID', 0),\r\n downloadPdf: apInvoiceID => {\r\n this.downloadPdf(apInvoiceID)\r\n }\r\n }\r\n }\r\n }\r\n })\r\n\r\n this.rows = rows\r\n },\r\n\r\n async getPayeeID() {\r\n await vendorInvoice\r\n .dispatch('getPayeeById', {\r\n vendorID: this.vendorID\r\n })\r\n .then(({ result }) => {\r\n if (result) {\r\n this.payeeID = result.apPayeeID\r\n if (this.isDebug == true) console.debug('getPayeeById=' + this.payeeID)\r\n }\r\n })\r\n },\r\n\r\n async loadVendorInvoices() {\r\n if (this.isDebug == true) console.debug('in loadVendorInvoices()...')\r\n\r\n const loadingComponent = this.$buefy.loading.open({\r\n container: null\r\n })\r\n\r\n await this.getPayeeID()\r\n\r\n await vendorInvoice\r\n .dispatch('getVendorInvoiceList', {\r\n payeeID: this.payeeID\r\n })\r\n .then(({ list }) => {\r\n this.determineRows(list)\r\n })\r\n\r\n loadingComponent.close()\r\n },\r\n\r\n reload() {\r\n this.loading = true\r\n\r\n this.vendorID = this.$route.params.id || 0\r\n\r\n if (this.isDebug == true) console.debug('params vendorID=' + this.vendorID)\r\n\r\n this.rows = []\r\n\r\n this.loadVendorInvoices()\r\n\r\n this.loading = false\r\n },\r\n\r\n async downloadPdf(apInvoiceID) {\r\n if (this.isDebug == true) console.debug('downloadPdf...')\r\n\r\n if (!apInvoiceID || apInvoiceID == undefined) {\r\n notifyProblem('The vendor invoice is invalid for the download.')\r\n }\r\n\r\n try {\r\n const params = {\r\n apInvoiceID: apInvoiceID,\r\n asBase64: true\r\n }\r\n\r\n const path = `/AccountsPayable/APInvoice/GetInvoiceFile`\r\n const returned = await kms.get(path, {\r\n params\r\n })\r\n\r\n if (this.isDebug == true)\r\n console.debug(\r\n 'path base64 path=' +\r\n path +\r\n ' - params' +\r\n JSON.stringify(params) +\r\n ' - returned=' +\r\n JSON.stringify(returned)\r\n )\r\n if (returned && returned != undefined) {\r\n if (this.isDebug == true) console.debug('base64pdf........................' + returned)\r\n const contentType = 'application/pdf'\r\n const blob = base64toBlob(returned, contentType)\r\n showPdf(blob)\r\n notifyMessage(`Successfully downloaded the vendor invoice.`)\r\n return\r\n }\r\n } catch (e) {\r\n if (this.isDebug == true) console.debug(e)\r\n notifyWarning('There was a problem downloading the vendor invoice.')\r\n }\r\n }\r\n}\r\n","import moment from 'moment'\r\n\r\nexport const data = () => ({\r\n isDebug: true,\r\n loading: false,\r\n vendorID: 0,\r\n payeeID: 0,\r\n apInvoiceID: 0,\r\n formatDateFn: function(value) {\r\n return value != null ? moment(value, 'YYYY/MM/DD HH:mm:ss').format('MM-DD-YYYY') : ''\r\n },\r\n\r\n filters: {\r\n show: false\r\n },\r\n\r\n region: {},\r\n\r\n rows: [],\r\n\r\n columns: [\r\n {\r\n field: 'invoiceNumber',\r\n label: 'Invoice #',\r\n aria: 'Invoice #',\r\n width: '15%',\r\n sortable: true,\r\n searchable: true\r\n },\r\n {\r\n field: 'payeeInfo',\r\n label: 'Payee Info',\r\n aria: 'Payee Info',\r\n width: '60%',\r\n sortable: true,\r\n searchable: true\r\n },\r\n {\r\n field: 'postingDate',\r\n label: 'Posting Date',\r\n aria: 'Posting Date',\r\n width: '15%',\r\n sortable: true,\r\n searchable: true\r\n }\r\n ],\r\n\r\n styles: {\r\n filterButton: {\r\n float: 'right',\r\n marginTop: '4px'\r\n }\r\n }\r\n})\r\n","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./List.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./List.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./List.vue?vue&type=template&id=c88fd4d2&\"\nimport script from \"./List.vue?vue&type=script&lang=js&\"\nexport * from \"./List.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","/*\r\n import { base64toBlob, showPdf } from '@/services/blobutility'\r\n*/\r\n\r\nexport const base64toBlob = (b64Data, contentType) => {\r\n const sliceSize = 512\r\n const byteCharacters = atob(b64Data)\r\n const byteArrays = []\r\n\r\n for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {\r\n const slice = byteCharacters.slice(offset, offset + sliceSize)\r\n\r\n const byteNumbers = new Array(slice.length)\r\n for (let i = 0; i < slice.length; i++) {\r\n byteNumbers[i] = slice.charCodeAt(i)\r\n }\r\n\r\n const byteArray = new Uint8Array(byteNumbers)\r\n byteArrays.push(byteArray)\r\n }\r\n\r\n const blob = new Blob(byteArrays, { type: contentType })\r\n return blob\r\n}\r\n\r\nexport const showPdf = blob => {\r\n var newBlob = new Blob([blob], { type: 'application/pdf' })\r\n\r\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\r\n window.navigator.msSaveOrOpenBlob(newBlob)\r\n } else {\r\n const data = window.URL.createObjectURL(newBlob)\r\n\r\n var link = document.createElement('a')\r\n link.download = 'download.pdf'\r\n link.setAttribute('download', 'download.pdf')\r\n link.href = data\r\n\r\n window.open(link, '_blank')\r\n }\r\n\r\n return\r\n}\r\n\r\nexport const downloadPdf = blob => {\r\n var newBlob = new Blob([blob], { type: 'application/pdf' })\r\n\r\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\r\n window.navigator.msSaveOrOpenBlob(newBlob)\r\n } else {\r\n const data = window.URL.createObjectURL(newBlob)\r\n var link = document.createElement('a')\r\n link.download = 'download.pdf'\r\n link.setAttribute('download', 'download.pdf')\r\n link.href = data\r\n link.click()\r\n\r\n setTimeout(function() {\r\n window.URL.revokeObjectURL(data)\r\n 100\r\n })\r\n }\r\n\r\n return\r\n}\r\n\r\nexport const showAnyType = (blob, mimeType) => {\r\n console.debug('showAnyType...')\r\n var newBlob = new Blob([blob], { type: mimeType })\r\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\r\n window.navigator.msSaveOrOpenBlob(newBlob)\r\n } else {\r\n const data = window.URL.createObjectURL(newBlob)\r\n var link = document.createElement('a')\r\n link.href = data\r\n\r\n window.open(data, '_blank')\r\n\r\n setTimeout(function() {\r\n window.URL.revokeObjectURL(data)\r\n 100\r\n })\r\n }\r\n\r\n return\r\n}\r\n"],"sourceRoot":""}