{"version":3,"sources":["webpack:///./src/views/PIApprovals.vue?bc67","webpack:///src/views/PIApprovals.vue","webpack:///./src/views/PIApprovals.vue?351a","webpack:///./src/views/PIApprovals.vue","webpack:///./node_modules/@babel/runtime-corejs2/helpers/esm/createClass.js","webpack:///./src/services/DateService.js","webpack:///./src/services/ReportService.js"],"names":["render","_vm","this","_h","$createElement","_c","_self","_m","staticClass","loaded","_e","attrs","response","scopedSlots","_u","key","fn","data","domProps","_s","value","item","_v","_f","parseFloat","ReimbursementTotal","toFixed","staticRenderFns","component","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","_createClass","Constructor","protoProps","staticProps","prototype","DateService","undefined","moment","utc","e","filterLocalDateAtMidnight","cellValue","cellDate","startOf","toDate","getTime","ReportsAPI","APIFactory","get","ExpenseReportAPI","getPIApprovals","console","log","map","report","YourProject","projects","p","projectNumber","projectName","join","SubmitterName","submittedByName","ReportName","getAreaLink","expenseReportId","getExpenseReportName","Type","getExpenseReportType","Status","statusType","displayName","YourProjectTotal","reduce","total","reimbursementTotal","IsPercentAmountAllocation","isPercentAmountAllocation","getReportsInProgress","isAdmin","getMyReport","ExpenseReportId","StatusId","id","CreatedBy","createdByName","CreatedByUserId","createdByUserId","getPaidReports","getMyPaidReport","SubmittedDate","normalizeDateTime","submittedDate","PaidDate","paidDate","Approvals","approvals","filter","a","approvedByName","n","Project","getAdminOneApprovals","getAdminTwoApprovals","Selected","isMiscReport","ExpenseReportID","getPendingPayments","isApproved","approvedDate","Pay","getAnalysisReport","searchCriteria","ReportLink","Projects","ProjectTotal","projectTotal","AirfareTotal","totals","airfareTotal","LodgingTotal","lodgingTotal","MealsTotal","mealsTotal","POVMileageTotal","povMileageTotal","MiscTotal","miscTotal","CarRentalTotal","carRentalTotal","GroundTransportationTotal","groundTransportationTotal","MiscReportItemTotal","miscReportItemTotal","reportItem","reportName","tripName","deleteExpenseReport","erID"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAA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OAAShE,EAAOgE,OAAOW,eAAiB,KAC/DC,0BAA2B5E,EAAOgE,OAAShE,EAAOgE,OAAOa,0BAA4B,KACrFC,oBAAqB9E,EAAOgE,OAAShE,EAAOgE,OAAOe,oBAAsB,SAnItE,kGAwIXnE,qBAxIW,SAwIUoE,GACjB,OAAOA,EAAW7B,aAAe6B,EAAWC,WAAaD,EAAWE,UAGxEpE,qBA5IW,SA4IUkE,GACjB,OAAOA,EAAW7B,aAAe,OAAS,OAG9CzC,YAhJW,SAgJCsE,GACR,OAAOA,EAAW7B,aAAe,sBAAwB,iBAEvDgC,oBAnJK,mEAmJeC,GAnJf,wGAoJgBzF,EAAiBwF,oBAAoBC,GApJrD,uBAoJCjI,EApJD,EAoJCA,KApJD,kBAqJAA,GArJA","file":"js/chunk-01d6d75e.968e2102.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_vm._m(0),_c('div',{staticClass:\"py-5\"},[_c('div',{staticClass:\"container\"},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-md-12\"},[(!_vm.loaded)?_c('b-spinner',{staticClass:\"center-spinner\",attrs:{\"variant\":\"primary\",\"label\":\"Spinning\"}}):_vm._e(),(_vm.loaded)?_c('b-table',{attrs:{\"striped\":\"\",\"hover\":\"\",\"items\":_vm.response,\"show-empty\":true,\"empty-text\":\"There are no records to show\",\"fields\":['YourProject','SubmitterName','ReportName','Type','Status','YourProjectTotal','ReimbursementTotal']},scopedSlots:_vm._u([{key:\"cell(ReportName)\",fn:function(data){return [_c('span',{domProps:{\"innerHTML\":_vm._s(data.value)}})]}},{key:\"cell(YourProjectTotal)\",fn:function(data){return [(data.item.IsPercentAmountAllocation)?_c('div',[_vm._v(\"\\n \"+_vm._s(_vm._f(\"currency\")(parseFloat((data.value / 100) * data.item.ReimbursementTotal).toFixed(2)))+\"\\n \")]):_c('div',[_vm._v(\"\\n \"+_vm._s(_vm._f(\"currency\")(data.value))+\"\\n \")])]}},{key:\"cell(ReimbursementTotal)\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(_vm._f(\"currency\")(data.value))+\"\\n \")]}}],null,false,3591419225)}):_vm._e()],1)])])])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"py-3\"},[_c('div',{staticClass:\"container\"},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-md-12\"},[_c('h1',{staticClass:\"d-flex justify-content-center\"},[_vm._v(\"PI Approvals\")])])])])])}]\n\nexport { render, staticRenderFns }","\n \n \n \n \n \n PI Approvals\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{parseFloat((data.value / 100) * data.item.ReimbursementTotal).toFixed(2) | currency}}\n \n \n {{data.value | currency}}\n \n \n \n {{data.value | currency}}\n \n \n \n \n \n \n \n\n\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!./PIApprovals.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!./PIApprovals.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./PIApprovals.vue?vue&type=template&id=42b4cf33&\"\nimport script from \"./PIApprovals.vue?vue&type=script&lang=js&\"\nexport * from \"./PIApprovals.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 _Object$defineProperty from \"../../core-js/object/define-property\";\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n\n _Object$defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","import moment from 'moment'\n\n/**\n *Date util class used to normalize dates\n * @export\n * @class DateService\n */\nexport default class DateService {\n\n\n /**\n * Takes in date returns back date with time set to 12 noon to avoid time zone change conflicts between UTC/MST etc.\n * @static\n * @param {Date} value\n * @returns Javascript Date\n * @memberof DateService\n */\n static normalizeDateTime(value) {\n //console.log('dateservice.normalizeDateTime')\n let response = null;\n \n try {\n if (value == undefined || value == null) { return null; }\n \n response = moment.utc(value);\n return response;\n\n } catch (e) {\n return response;\n }\n }\n\n static dateFilterComparator = (filterLocalDateAtMidnight, cellValue) => {\n const cellDate = moment(cellValue).startOf(\"day\").toDate();\n\n if (filterLocalDateAtMidnight.getTime() == cellDate.getTime()) {\n return 0;\n }\n\n if (cellDate < filterLocalDateAtMidnight) {\n return -1;\n }\n\n if (cellDate > filterLocalDateAtMidnight) {\n return 1;\n }\n }\n}","import { APIFactory } from '../api/api.factory'\nimport DateService from '@/services/DateService'\nconst ReportsAPI = APIFactory.get('reports');\nconst ExpenseReportAPI = APIFactory.get('expenseReport')\n\n\nexport default {\n async getPIApprovals() {\n console.log('reportsservice.getReports')\n\n const { data } = await ReportsAPI.get('?statusTypeIds=2&canApprove=true&includeTotal=true');\n \n return data.map(report => ({\n YourProject: report.projects.map(function (p) { return `${p.projectNumber}-${p.projectName}` }).join(\", \"),\n SubmitterName: report.submittedByName,\n ReportName: `${this.getExpenseReportName(report)}`,\n Type: this.getExpenseReportType(report),\n //RequiredApprovers: '', TODO:Comment out for now as not working\n Status: report.statusType.displayName,\n YourProjectTotal: report.projects.reduce((total,p) => total + p.total, 0),\n ReimbursementTotal: report.reimbursementTotal,\n IsPercentAmountAllocation: report.isPercentAmountAllocation,\n }\n ));\n },\n\n async getReportsInProgress(isAdmin) {\n console.log('reportsservice.getReportsInProgress')\n const { data } = await ReportsAPI.getMyReport(isAdmin);\n // return data;\n return data.map(report => ({\n ExpenseReportId: report.expenseReportId,\n StatusId: report.statusType.id,\n ReportName: `${this.getExpenseReportName(report)}`, \n Type: this.getExpenseReportType(report),\n Status: report.statusType.displayName,\n ReimbursementTotal: report.reimbursementTotal,\n CreatedBy: report.createdByName,\n CreatedByUserId: report.createdByUserId\n }\n ));\n },\n\n async getPaidReports() {\n console.log('reportsservice.getMyPaidReport')\n const { data } = await ReportsAPI.getMyPaidReport();\n // return data;\n return data.map(report => ({\n SubmittedDate: DateService.normalizeDateTime(report.submittedDate),\n PaidDate: DateService.normalizeDateTime(report.paidDate),\n Approvals: report.approvals.filter((a) => a.approvedByName).map((n) => n.approvedByName).join(\",\"),\n ReportName: `${this.getExpenseReportName(report)}`,\n Project: report.projects.map(function (p) { return `${p.projectNumber}-${p.projectName}`}).join(\", \"),\n Type: this.getExpenseReportType(report),\n Status: report.statusType.displayName,\n ReimbursementTotal: report.reimbursementTotal\n }\n ));\n },\n\n async getAdminOneApprovals() {\n console.log('reportsservice.getAdminApporvals')\n const { data } = await ReportsAPI.get('?statusTypeIds=3&includeTotal=true');\n\n return data.map(report => ({\n SubmittedDate: DateService.normalizeDateTime(report.submittedDate),\n SubmitterName: report.submittedByName,\n Approvals: report.approvals.filter((a) => a.approvedByName).map((n) => n.approvedByName).join(\",\"),\n ReportName: `${this.getExpenseReportName(report)}`,\n Project: report.projects.map(function (p) { return `${p.projectNumber}-${p.projectName}` }).join(\", \"),\n Type: this.getExpenseReportType(report),\n Status: report.statusType.displayName,\n ReimbursementTotal: report.reimbursementTotal\n }\n ));\n },\n\n async getAdminTwoApprovals() {\n console.log('reportsservice.getAdminTwoApporvals')\n const { data } = await ReportsAPI.get('?statusTypeIds=4&includeTotal=true');\n\n return data.map(report => ({\n Selected: false,\n SubmittedDate: DateService.normalizeDateTime(report.submittedDate),\n SubmitterName: report.submittedByName,\n Approvals: report.approvals.filter((a) => a.approvedByName).map((n) => n.approvedByName).join(\",\"),\n ReportName: `${this.getExpenseReportName(report)}`,\n Project: report.projects.map(function (p) { return `${p.projectNumber}-${p.projectName}` }).join(\", \"),\n Type: report.isMiscReport ? 'MISC' : 'TER',\n Status: report.statusType.displayName,\n ReimbursementTotal: report.reimbursementTotal,\n ExpenseReportID: report.expenseReportId\n }\n ));\n },\n\n async getPendingPayments() {\n console.log('reportsservice.getPendingPayments')\n const { data } = await ReportsAPI.get('?statusTypeIds=7&includeTotal=true');\n\n return data.map(report => ({\n Selected: false,\n SubmitterName: report.submittedByName,\n SubmittedDate: report.approvals[0].isApproved ? DateService.normalizeDateTime(report.approvals[0].approvedDate) : '',\n Type: this.getExpenseReportType(report),\n ReportName: `${this.getExpenseReportName(report)}`,\n Project: report.projects.map(function (p) { return `${p.projectNumber}-${p.projectName}` }).join(\", \"),\n Approvals: report.approvals.filter((a) => a.approvedByName).map((n) => n.approvedByName).join(\",\"),\n Status: report.statusType.displayName,\n ReimbursementTotal: report.reimbursementTotal,\n PaidDate: \"\",\n Pay: report.expenseReportId\n }\n ));\n },\n\n async getAnalysisReport(searchCriteria) {\n const { data } = await ReportsAPI.getAnalysisReport(searchCriteria);\n return data.map(report => ({\n ReportName: this.getExpenseReportName(report),\n ReportLink: `/${this.getAreaLink(report)}/${report.expenseReportId}`,\n PaidDate: report.paidDate,\n SubmittedDate: report.submittedDate,\n SubmitterName: report.submittedByName,\n Approvals: report.approvals.filter((a) => a.approvedByName).map((n) => n.approvedByName).join(\", \"),\n Projects: report.projects.map(function (p) { return `${p.projectNumber}-${p.projectName}` }).join(\", \"),\n Type: this.getExpenseReportType(report),\n Status: report.statusType.displayName,\n ProjectTotal: report.projectTotal,\n ReimbursementTotal: report.reimbursementTotal,\n AirfareTotal: report.totals ? report.totals.airfareTotal : null,\n LodgingTotal: report.totals ? report.totals.lodgingTotal : null,\n MealsTotal: report.totals ? report.totals.mealsTotal : null,\n POVMileageTotal: report.totals ? report.totals.povMileageTotal : null,\n MiscTotal: report.totals ? report.totals.miscTotal : null,\n CarRentalTotal: report.totals ? report.totals.carRentalTotal : null,\n GroundTransportationTotal: report.totals ? report.totals.groundTransportationTotal : null,\n MiscReportItemTotal: report.totals ? report.totals.miscReportItemTotal : null\n }\n ));\n },\n\n getExpenseReportName(reportItem) {\n return reportItem.isMiscReport ? reportItem.reportName : reportItem.tripName;\n },\n\n getExpenseReportType(reportItem) {\n return reportItem.isMiscReport ? \"MISC\" : 'TER';\n },\n\n getAreaLink(reportItem) {\n return reportItem.isMiscReport ? 'misc-expense-report' : 'review-submit'\n },\n async deleteExpenseReport(erID) {\n const { data } = await ExpenseReportAPI.deleteExpenseReport(erID)\n return data;\n },\n}"],"sourceRoot":""}