From d0ab543716ccfe5fb548c76c412c6cea159652e6 Mon Sep 17 00:00:00 2001 From: David Papp Date: Wed, 1 Feb 2023 15:10:38 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Handling=20non-categories=20csv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/integrations/csv-import/csvImportIntegration.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/integrations/csv-import/csvImportIntegration.ts b/src/integrations/csv-import/csvImportIntegration.ts index 7ae9f036..9a73a375 100644 --- a/src/integrations/csv-import/csvImportIntegration.ts +++ b/src/integrations/csv-import/csvImportIntegration.ts @@ -76,6 +76,16 @@ export class CSVImportIntegration { ) } + if (!outputRow.hasOwnProperty('category')) { + outputRow.category = 'Uncategorized' + } + + if (outputRow.hasOwnProperty('category')) { + if(outputRow.category === '' || outputRow.category === 'null' || outputRow.category === 'undefined') { + outputRow.category = 'Uncategorized' + } + } + if (CSVAccountConfig.negateValues === true && outputRow.hasOwnProperty('amount')) { outputRow['amount'] = -outputRow['amount'] }