From ebe72b68e0c489e338f3962e475839fa94a6505b Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Thu, 13 Apr 2023 10:20:05 -0400 Subject: [PATCH] tidying --- app.ts | 8 -------- helpers/functions.dynamicsGP.js | 4 ++-- helpers/functions.dynamicsGP.ts | 4 ++-- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/app.ts b/app.ts index 8de7a5db..22991d7b 100644 --- a/app.ts +++ b/app.ts @@ -24,8 +24,6 @@ import routerWorkOrders from './routes/workOrders.js' import routerReports from './routes/reports.js' import routerAdmin from './routes/admin.js' -import { preloadCaches } from './helpers/functions.cache.js' - import * as configFunctions from './helpers/functions.config.js' import * as printFunctions from './helpers/functions.print.js' import * as dateTimeFns from '@cityssm/utils-datetime' @@ -50,12 +48,6 @@ const debug = Debug(`lot-occupancy-system:app:${process.pid}`) databaseInitializer.initializeDatabase() -/* - * PRELOAD CACHES - */ - -// await preloadCaches() - /* * INITIALIZE APP */ diff --git a/helpers/functions.dynamicsGP.js b/helpers/functions.dynamicsGP.js index a3fc7f13..fc0e86c9 100644 --- a/helpers/functions.dynamicsGP.js +++ b/helpers/functions.dynamicsGP.js @@ -10,7 +10,7 @@ async function _getDynamicsGPDocument(documentNumber, lookupType) { switch (lookupType) { case 'invoice': { const invoice = await gp.getInvoiceByInvoiceNumber(documentNumber); - if (invoice) { + if (invoice !== undefined) { document = { documentType: 'Invoice', documentNumber: invoice.invoiceNumber, @@ -28,7 +28,7 @@ async function _getDynamicsGPDocument(documentNumber, lookupType) { } case 'diamond/cashReceipt': { const receipt = await diamond.getCashReceiptByDocumentNumber(documentNumber); - if (receipt) { + if (receipt !== undefined) { document = { documentType: 'Cash Receipt', documentNumber: receipt.documentNumber.toString(), diff --git a/helpers/functions.dynamicsGP.ts b/helpers/functions.dynamicsGP.ts index dcc1fcaa..b386b79b 100644 --- a/helpers/functions.dynamicsGP.ts +++ b/helpers/functions.dynamicsGP.ts @@ -27,7 +27,7 @@ async function _getDynamicsGPDocument( case 'invoice': { const invoice = await gp.getInvoiceByInvoiceNumber(documentNumber) - if (invoice) { + if (invoice !== undefined) { document = { documentType: 'Invoice', documentNumber: invoice.invoiceNumber, @@ -49,7 +49,7 @@ async function _getDynamicsGPDocument( documentNumber ) - if (receipt) { + if (receipt !== undefined) { document = { documentType: 'Cash Receipt', documentNumber: receipt.documentNumber.toString(),