From 580940d02f4d60c0c5f7b832a8a75a74e8fa89c8 Mon Sep 17 00:00:00 2001 From: Suyash More Date: Fri, 8 Nov 2024 15:47:53 +0530 Subject: [PATCH 1/2] Added a check to distinguish whether a DI Batch was processed through Gift Entry Added a check to skip clearing the Donation Amount when a DI Batch is not processed through Gift Entry. --- force-app/main/default/classes/BDI_DataImportService.cls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/force-app/main/default/classes/BDI_DataImportService.cls b/force-app/main/default/classes/BDI_DataImportService.cls index 116715ceae8..4f5949cdfaf 100644 --- a/force-app/main/default/classes/BDI_DataImportService.cls +++ b/force-app/main/default/classes/BDI_DataImportService.cls @@ -626,9 +626,9 @@ global with sharing class BDI_DataImportService { if (apexJobId != null && listDI.size() > 0) { List listBatch = [SELECT Name, Batch_Number__c, Batch_Status__c, Batch_Defaults__c, Form_Template__c, RequireTotalMatch__c, Expected_Count_of_Gifts__c, - Expected_Total_Batch_Amount__c, Batch_Table_Columns__c, LastModifiedDate + Expected_Total_Batch_Amount__c, Batch_Table_Columns__c, LastModifiedDate, GiftBatch__c FROM DataImportBatch__c WHERE Id= :listDI[0].NPSP_Data_Import_Batch__c LIMIT 1]; - if (listBatch.size() > 0 ) { + if (listBatch.size() > 0 && listBatch[0].GiftBatch__c) { GiftBatch giftBatch = new GiftBatch(listBatch[0]); Boolean firstInstallmentPaid = giftBatch.shouldPayFirstInstallment(); From cc95c0d30fc6301eefe9e5361dbbef0176ed1066 Mon Sep 17 00:00:00 2001 From: Suyash More Date: Mon, 11 Nov 2024 16:07:11 +0530 Subject: [PATCH 2/2] Update GiftEntryProcessorQueue_TEST to ensure DI Batch is created as a Gift Entry Batch --- force-app/main/default/classes/GiftEntryProcessorQueue_TEST.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/force-app/main/default/classes/GiftEntryProcessorQueue_TEST.cls b/force-app/main/default/classes/GiftEntryProcessorQueue_TEST.cls index 16c86f1e588..d1a8e798863 100644 --- a/force-app/main/default/classes/GiftEntryProcessorQueue_TEST.cls +++ b/force-app/main/default/classes/GiftEntryProcessorQueue_TEST.cls @@ -46,7 +46,7 @@ private class GiftEntryProcessorQueue_TEST { BDI_MappingServiceAdvanced.DEFAULT_DATA_IMPORT_FIELD_MAPPING_SET_NAME; UTIL_CustomSettingsFacade.setDataImportSettings(dataImportSettings); - DataImportBatch__c giftBatch = new DataImportBatch__c(); + DataImportBatch__c giftBatch = new DataImportBatch__c(GiftBatch__c = true); insert giftBatch; List giftsToInsert = new List();