From c132120dabc6228cb3b2048df5029d6b8e78f86e Mon Sep 17 00:00:00 2001 From: Andrew Yu Date: Wed, 12 Oct 2022 11:21:26 -0700 Subject: [PATCH 001/318] add new global API to process opp and allocation --- .../main/default/classes/CallableApiParameters.cls | 1 + force-app/main/default/classes/Callable_API.cls | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/force-app/main/default/classes/CallableApiParameters.cls b/force-app/main/default/classes/CallableApiParameters.cls index 8b3b5aa2d0c..a06a3cb416b 100644 --- a/force-app/main/default/classes/CallableApiParameters.cls +++ b/force-app/main/default/classes/CallableApiParameters.cls @@ -56,6 +56,7 @@ public class CallableApiParameters { public static final String PARAM_START_DATE = 'StartDate'; public static final String PARAM_END_DATE = 'EndDate'; public static final String PARAM_PAUSE_DATA = 'PauseData'; + public static final String PARAM_REFUND_RECORDS = 'RefundRecords'; private Map params; diff --git a/force-app/main/default/classes/Callable_API.cls b/force-app/main/default/classes/Callable_API.cls index 0ef445ce99f..e094404d658 100644 --- a/force-app/main/default/classes/Callable_API.cls +++ b/force-app/main/default/classes/Callable_API.cls @@ -169,7 +169,16 @@ global with sharing class Callable_API implements System.Callable { // If you do so, your functionality can break without any warning or liability from Salesforce. return ALLO_AllocationsSettings.getSettings().validatePaymentAllocationsConfiguration(); - } when 'settings.enablecustomizablerollups' { + } when 'pmt.procressrefundallocations' { + List refunds = paramService.getSObjects(CallableApiParameters.PARAM_REFUND_RECORDS); + PMT_RefundService refundService = new PMT_RefundService() + .withRefundRecords(refunds); + refundService.adjustAllocationsAndOpportunities(); + refundService.updateAllocationsAndOpportunities(); + + return null; + } + when 'settings.enablecustomizablerollups' { Boolean scheduleJobsWhenComplete = paramService.getBoolean(CallableApiParameters.PARAM_SCHEDULE_JOBS, true); return new CRLP_EnablementService().enable(scheduleJobsWhenComplete); From 66901a3978a76a5303166c870c4222ecc8517d1f Mon Sep 17 00:00:00 2001 From: screcco-sfdo Date: Thu, 13 Oct 2022 12:39:42 -0400 Subject: [PATCH 002/318] Customizable Rollup Recalculation batch job fails if no Allocations in a given batch look up to an Opportunity record --- .../default/classes/CRLP_Batch_Base_Skew.cls | 12 +++++++----- .../default/classes/CRLP_GAU_BATCH_TEST.cls | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/force-app/main/default/classes/CRLP_Batch_Base_Skew.cls b/force-app/main/default/classes/CRLP_Batch_Base_Skew.cls index 30835543b29..9d22c1ce7d0 100644 --- a/force-app/main/default/classes/CRLP_Batch_Base_Skew.cls +++ b/force-app/main/default/classes/CRLP_Batch_Base_Skew.cls @@ -232,7 +232,7 @@ public abstract class CRLP_Batch_Base_Skew extends CRLP_Batch_Base { * @param parentObjectField * @param detailRecords * @param parentKeyField - * @return Boolean true if lastParentId has no associated detail records in a GAU rollup + * @return Boolean false if lastParentId has no associated detail records in a GAU rollup */ @TestVisible private Boolean hasLastParentDetails( @@ -241,14 +241,16 @@ public abstract class CRLP_Batch_Base_Skew extends CRLP_Batch_Base { List detailRecords, String parentKeyField ) { - if (this.jobType == CRLP_RollupProcessingOptions.RollupType.GAU && + Integer drSize = detailRecords.size(); + if (drSize == 0 || (this.jobType == CRLP_RollupProcessingOptions.RollupType.GAU && lastParentId != CRLP_Rollup_SVC.getParentIdFromRecord( - detailRecords[detailRecords.size() - 1], parentKeyField, parentObjectField + detailRecords[drSize - 1], parentKeyField, parentObjectField ) - ) { + )) { return false; + } else { + return true; } - return true; } /******************************************************************************************************** diff --git a/force-app/main/default/classes/CRLP_GAU_BATCH_TEST.cls b/force-app/main/default/classes/CRLP_GAU_BATCH_TEST.cls index 85f71123155..ca794d780ad 100644 --- a/force-app/main/default/classes/CRLP_GAU_BATCH_TEST.cls +++ b/force-app/main/default/classes/CRLP_GAU_BATCH_TEST.cls @@ -57,6 +57,23 @@ private with sharing class CRLP_GAU_BATCH_TEST { System.assertEquals(false, gauBatch.hasLastParentDetails(lastParentId, null, detailRecords, parentKeyField)); } + + @IsTest + private static void shouldDetermineLastParentIdHasNoDetailsEmptyDetailRecords() { + String parentKeyField = 'General_Accounting_Unit__c'; + + General_Accounting_Unit__c gau = new General_Accounting_Unit__c( + Id = UTIL_UnitTestData_TEST.mockId(General_Accounting_Unit__c.SObjectType)); + General_Accounting_Unit__c gau2 = new General_Accounting_Unit__c( + Id = UTIL_UnitTestData_TEST.mockId(General_Accounting_Unit__c.SObjectType)); + + List detailRecords = new List(); + + CRLP_GAU_BATCH gauBatch = new CRLP_GAU_BATCH(CRLP_RollupProcessingOptions.RollupTypeFilter.All); + Id lastParentId = gau2.Id; + System.assertEquals(false, + gauBatch.hasLastParentDetails(lastParentId, null, detailRecords, parentKeyField)); + } @IsTest private static void shouldDetermineLastParentIdHasDetails() { From 0a1690f23a0280a0e38ace8c309970fa47f9fa3d Mon Sep 17 00:00:00 2001 From: Balsam Hindi Date: Thu, 13 Oct 2022 15:33:15 -0400 Subject: [PATCH 003/318] Update remaining POU links in NPSP --- .../main/default/labels/CustomLabels.labels-meta.xml | 2 +- .../default/translations/en_GB.translation-meta.xml | 8 ++++---- .../main/default/translations/fr.translation-meta.xml | 2 +- .../main/default/translations/iw.translation-meta.xml | 2 -- .../default/translations/nl_NL.translation-meta.xml | 6 +++--- .../default/translations/pt_BR.translation-meta.xml | 11 +++++------ .../trial_tso/prompts/NPSPContactMergeGuidance.prompt | 2 +- .../config/trial_tso/prompts/ReportGuidance.prompt | 2 +- 8 files changed, 16 insertions(+), 19 deletions(-) diff --git a/force-app/main/default/labels/CustomLabels.labels-meta.xml b/force-app/main/default/labels/CustomLabels.labels-meta.xml index 65ecbe4839f..4f21b5d6986 100644 --- a/force-app/main/default/labels/CustomLabels.labels-meta.xml +++ b/force-app/main/default/labels/CustomLabels.labels-meta.xml @@ -14355,7 +14355,7 @@ IMPORTANT: Both of these fields must have the same data type. en_US false stgHelpPowerOfUsHub - Got questions? Try the <a href="https://powerofus.force.com/HUB_NPSP_Group" target="_blank">Nonprofit Success Pack</a> group for questions about NPSP and the <a href="https://powerofus.force.com/HUB_System_Admin_Group" target="_blank">System Administrators</a> group for questions about Salesforce administration and configuration.<br/><br/>Keep up with the latest NPSP release notes in the <a href="https://powerofus.force.com/HUB_NPSP_Release_Group" target="_blank">NPSP Release Announcements</a> group. + Got questions? Try the <a href="https://trailhead.salesforce.com/trailblazer-community/groups/0F94S000000kHitSAE" target="_blank">Nonprofit Success Pack</a> group for questions about NPSP and the <a href="https://trailhead.salesforce.com/trailblazer-community/groups/0F94S000000kHiLSAU?tab=discussion" target="_blank">System Administrators</a> group for questions about Salesforce administration and configuration.<br/><br/>Keep up with the latest NPSP release notes in the <a href="https://trailhead.salesforce.com/trailblazer-community/groups/0F94S000000kHOXSA2?tab=discussion&sort=LAST_MODIFIED_DATE_DESC.htm" target="_blank">NPSP Release Announcements</a> group. stgHelpPrimaryContactBatch diff --git a/force-app/main/default/translations/en_GB.translation-meta.xml b/force-app/main/default/translations/en_GB.translation-meta.xml index d8c1b1d16af..35d6b3f3c84 100644 --- a/force-app/main/default/translations/en_GB.translation-meta.xml +++ b/force-app/main/default/translations/en_GB.translation-meta.xml @@ -2105,7 +2105,7 @@ To check your GAU Allocation settings, go to Donations | GAU Allocations. bdeRetirementWarningBody - + bdeRetirementWarningHeader @@ -3006,7 +3006,7 @@ To check your GAU Allocation settings, go to Donations | GAU Allocations. bgeRetirementWarningBody - + bgeRetirementWarningHeader @@ -6843,7 +6843,7 @@ Selecting Don't Auto Schedule Default NPSP Jobs tells NPSP not to check for + We couldn't convert some of your existing Help Text mappings because they're invalid. We recommend disabling Advanced Mapping, correcting the invalid Help Text mappings, then re-enabling Advanced Mapping. Alternatively, you could add these mappings when you configure Advanced Mapping on the next screen, but these additional mappings will revert to the original invalid Help Text if you disable Advanced Mapping. stgHelpAdvancedMappingInvalidHelpText @@ -7143,7 +7143,7 @@ IMPORTANT: Both of these fields must have the same data type. stgHelpOCR - + stgHelpOCRDefaultRole diff --git a/force-app/main/default/translations/fr.translation-meta.xml b/force-app/main/default/translations/fr.translation-meta.xml index a7a9a223ece..568fc1f1e93 100644 --- a/force-app/main/default/translations/fr.translation-meta.xml +++ b/force-app/main/default/translations/fr.translation-meta.xml @@ -2105,7 +2105,7 @@ Pour vérifier vos paramètres d’affectations UCG, accédez à Dons | Affectat bdeRetirementWarningBody - + bdeRetirementWarningHeader diff --git a/force-app/main/default/translations/iw.translation-meta.xml b/force-app/main/default/translations/iw.translation-meta.xml index fb5709e226a..252b666c085 100644 --- a/force-app/main/default/translations/iw.translation-meta.xml +++ b/force-app/main/default/translations/iw.translation-meta.xml @@ -764,7 +764,6 @@ ErrorEmailMessage @@ -6624,7 +6623,6 @@ stgHelpOppNamingDateFormat - stgHelpOppNamingFormat diff --git a/force-app/main/default/translations/nl_NL.translation-meta.xml b/force-app/main/default/translations/nl_NL.translation-meta.xml index 78bbd05fd6c..851863c72c3 100644 --- a/force-app/main/default/translations/nl_NL.translation-meta.xml +++ b/force-app/main/default/translations/nl_NL.translation-meta.xml @@ -3006,7 +3006,7 @@ Om uw instellingen voor GAU-toewijzingen te controleren, gaat u naar Donaties | bgeRetirementWarningBody - + bgeRetirementWarningHeader @@ -6842,7 +6842,7 @@ Door Standaard NPSP-taken niet automatisch plannen te selecteren, laat u NPSP we + We kunnen enkele van uw bestaande toewijzingen voor Help-tekst niet converteren, omdat ze ongeldig zijn. U wordt aangeraden om Geavanceerd toewijzen uit te schakelen, de ongeldige toewijzingen van Help-tekst te corrigeren en vervolgens Geavanceerd toewijzen opnieuw in te schakelen. Of anders kunt u deze toewijzingen toevoegen wanneer u Geavanceerd toewijzen configureert op het volgende scherm, maar deze extra toewijzingen zetten alles terug naar de oorspronkelijke ongeldig Help-tekst als u Geavanceerd toewijzen uitschakelt. stgHelpAdvancedMappingInvalidHelpText @@ -7142,7 +7142,7 @@ BELANGRIJK: Beide velden moeten van hetzelfde gegevenstype zijn. stgHelpOCR - + stgHelpOCRDefaultRole diff --git a/force-app/main/default/translations/pt_BR.translation-meta.xml b/force-app/main/default/translations/pt_BR.translation-meta.xml index 39c104a59fa..26f719b8ebc 100644 --- a/force-app/main/default/translations/pt_BR.translation-meta.xml +++ b/force-app/main/default/translations/pt_BR.translation-meta.xml @@ -1153,8 +1153,7 @@ RD2_EnablementPrepTasks +<li>Faça backup do seu banco de dados, incluindo todas as Doações recorrentes e seus registros relacionados.</li> RD2_EnablementPrepTitle @@ -2106,7 +2105,7 @@ Para verificar as configurações de Alocação de GAU, acesse Doações | Aloca bdeRetirementWarningBody - + bdeRetirementWarningHeader @@ -3007,7 +3006,7 @@ Para verificar as configurações de Alocação de GAU, acesse Doações | Aloca bgeRetirementWarningBody - + bgeRetirementWarningHeader @@ -6844,7 +6843,7 @@ A escolha de Não agendar automaticamente trabalhos do NPSP padrão diz ao NPSP + Não pudemos converter alguns dos seus mapeamentos de Texto de ajuda existentes porque eles são inválidos. Recomendamos desativar o Mapeamento avançado, corrigir os mapeamentos inválidos do Texto de ajuda e reativar o Mapeamento avançado. Alternativamente, você pode adicionar esses mapeamentos quando configurar o Mapeamento avançado na próxima tela, mas esses mapeamentos adicionais serão revertidos para o Texto de ajuda original inválido se você desativar o Mapeamento avançado. stgHelpAdvancedMappingInvalidHelpText @@ -7144,7 +7143,7 @@ IMPORTANTE: ambos os campos precisam ter o mesmo tipo de dados. stgHelpOCR - + stgHelpOCRDefaultRole diff --git a/unpackaged/config/trial_tso/prompts/NPSPContactMergeGuidance.prompt b/unpackaged/config/trial_tso/prompts/NPSPContactMergeGuidance.prompt index 22737b9b9dc..011151909dd 100644 --- a/unpackaged/config/trial_tso/prompts/NPSPContactMergeGuidance.prompt +++ b/unpackaged/config/trial_tso/prompts/NPSPContactMergeGuidance.prompt @@ -3,7 +3,7 @@ NPSP Contact Merge Guidance Find and Merge Duplicates - https://powerofus.force.com/s/article/NPSP-Merging-Contacts + https://help.salesforce.com/s/articleView?id=sf.contacts_merge.htm&type=5 <p>Keeping your data clean and reliable is one of the most important ways to instill confidence in your system. </p><p><br></p><p>Use NPSP Duplicate rules to identify duplicate contacts. Then use NPSP Contact Merge to merge duplicates into a single record without losing data from any related households, activities or opportunities. </p> Nonprofit_Success_Pack 1 diff --git a/unpackaged/config/trial_tso/prompts/ReportGuidance.prompt b/unpackaged/config/trial_tso/prompts/ReportGuidance.prompt index ba0ab5848e3..03d2109c2ab 100644 --- a/unpackaged/config/trial_tso/prompts/ReportGuidance.prompt +++ b/unpackaged/config/trial_tso/prompts/ReportGuidance.prompt @@ -4,7 +4,7 @@ Learn About Reports https://sfdc.co/QVnrG - <p>Bring your data to life by leveraging Reports. NPSP comes with a number of reports you can take advantage of immediately. </p><p><br></p><p>To get started, select ‘All Reports’ from the menu on the left to see which reports are available to you. Learn more about these specific reports in the <a href="https://powerofus.force.com/s/article/NPSP-Reports-Workbook" rel="noopener noreferrer" target="_blank">Power of Us Hub</a>. </p> + <p>Bring your data to life by leveraging Reports. NPSP comes with a number of reports you can take advantage of immediately. </p><p><br></p><p>To get started, select ‘All Reports’ from the menu on the left to see which reports are available to you. </p> Nonprofit_Success_Pack 1 Prompt for new Admins with information around Reporting From df728cc40cf6b2c7e92efebdc6b2d2050f459fe5 Mon Sep 17 00:00:00 2001 From: Balsam Hindi Date: Thu, 13 Oct 2022 15:44:08 -0400 Subject: [PATCH 004/318] clean up changes --- force-app/main/default/translations/iw.translation-meta.xml | 3 --- force-app/main/default/translations/pt_BR.translation-meta.xml | 2 +- unpackaged/config/trial_tso/prompts/ReportGuidance.prompt | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/force-app/main/default/translations/iw.translation-meta.xml b/force-app/main/default/translations/iw.translation-meta.xml index 252b666c085..cab8001ae53 100644 --- a/force-app/main/default/translations/iw.translation-meta.xml +++ b/force-app/main/default/translations/iw.translation-meta.xml @@ -6622,9 +6622,6 @@ stgHelpOppNamingDateFormat - - stgHelpOppNamingFormat - stgHelpOppNamingRecTypes diff --git a/force-app/main/default/translations/pt_BR.translation-meta.xml b/force-app/main/default/translations/pt_BR.translation-meta.xml index 26f719b8ebc..0e61692719d 100644 --- a/force-app/main/default/translations/pt_BR.translation-meta.xml +++ b/force-app/main/default/translations/pt_BR.translation-meta.xml @@ -3006,7 +3006,7 @@ Para verificar as configurações de Alocação de GAU, acesse Doações | Aloca bgeRetirementWarningBody - + bgeRetirementWarningHeader diff --git a/unpackaged/config/trial_tso/prompts/ReportGuidance.prompt b/unpackaged/config/trial_tso/prompts/ReportGuidance.prompt index 03d2109c2ab..fa8ad8bc75e 100644 --- a/unpackaged/config/trial_tso/prompts/ReportGuidance.prompt +++ b/unpackaged/config/trial_tso/prompts/ReportGuidance.prompt @@ -4,7 +4,7 @@ Learn About Reports https://sfdc.co/QVnrG - <p>Bring your data to life by leveraging Reports. NPSP comes with a number of reports you can take advantage of immediately. </p><p><br></p><p>To get started, select ‘All Reports’ from the menu on the left to see which reports are available to you. </p> + <p>Bring your data to life by leveraging Reports. NPSP comes with a number of reports you can take advantage of immediately. </p><p><br></p><p>To get started, select ‘All Reports’ from the menu on the left to see which reports are available to you. Nonprofit_Success_Pack 1 Prompt for new Admins with information around Reporting From 8837978454ad5b874a2f8dab2fbf44b88eabed7a Mon Sep 17 00:00:00 2001 From: balsamhindi <105941702+balsamhindi@users.noreply.github.com> Date: Thu, 13 Oct 2022 16:51:31 -0400 Subject: [PATCH 005/318] Update NPSPContactMergeGuidance.prompt --- .../config/trial_tso/prompts/NPSPContactMergeGuidance.prompt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpackaged/config/trial_tso/prompts/NPSPContactMergeGuidance.prompt b/unpackaged/config/trial_tso/prompts/NPSPContactMergeGuidance.prompt index 011151909dd..23dfc0097bc 100644 --- a/unpackaged/config/trial_tso/prompts/NPSPContactMergeGuidance.prompt +++ b/unpackaged/config/trial_tso/prompts/NPSPContactMergeGuidance.prompt @@ -3,7 +3,7 @@ NPSP Contact Merge Guidance Find and Merge Duplicates - https://help.salesforce.com/s/articleView?id=sf.contacts_merge.htm&type=5 + https://help.salesforce.com/s/articleView?id=sfdo.NPSP_Merge_Contacts.htm&type=5 <p>Keeping your data clean and reliable is one of the most important ways to instill confidence in your system. </p><p><br></p><p>Use NPSP Duplicate rules to identify duplicate contacts. Then use NPSP Contact Merge to merge duplicates into a single record without losing data from any related households, activities or opportunities. </p> Nonprofit_Success_Pack 1 From f8e64e75cfb4b3d92782ebf238c9903e3a8c3770 Mon Sep 17 00:00:00 2001 From: Andrew Yu Date: Fri, 14 Oct 2022 14:53:31 -0700 Subject: [PATCH 006/318] change callable api name --- force-app/main/default/classes/Callable_API.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/force-app/main/default/classes/Callable_API.cls b/force-app/main/default/classes/Callable_API.cls index e094404d658..c6b1c119b39 100644 --- a/force-app/main/default/classes/Callable_API.cls +++ b/force-app/main/default/classes/Callable_API.cls @@ -169,7 +169,7 @@ global with sharing class Callable_API implements System.Callable { // If you do so, your functionality can break without any warning or liability from Salesforce. return ALLO_AllocationsSettings.getSettings().validatePaymentAllocationsConfiguration(); - } when 'pmt.procressrefundallocations' { + } when 'pmt.procressrefunds' { List refunds = paramService.getSObjects(CallableApiParameters.PARAM_REFUND_RECORDS); PMT_RefundService refundService = new PMT_RefundService() .withRefundRecords(refunds); From 40a4ede509791b3e1de0ca32db2bb490680acada Mon Sep 17 00:00:00 2001 From: Luke Parrott Date: Fri, 14 Oct 2022 17:13:16 -0500 Subject: [PATCH 007/318] Fix for loading Elevate Widget in Enhanced URL scratch orgs --- .../lwc/psElevateTokenHandler/psElevateTokenHandler.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/force-app/main/default/lwc/psElevateTokenHandler/psElevateTokenHandler.js b/force-app/main/default/lwc/psElevateTokenHandler/psElevateTokenHandler.js index 868eddcc54f..255ed0ac252 100644 --- a/force-app/main/default/lwc/psElevateTokenHandler/psElevateTokenHandler.js +++ b/force-app/main/default/lwc/psElevateTokenHandler/psElevateTokenHandler.js @@ -56,6 +56,9 @@ class psElevateTokenHandler { const sandboxEnhancedUrl = `https://${domainInfo.orgDomain}--${namespace}.sandbox.vf.force.com`; const sandboxEnhancedLightning = `https://${domainInfo.orgDomain}--${namespace}.sandbox.lightning.force.com`; const sandboxEnhancedCanon = `https://${domainInfo.orgDomain}--${namespace}.sandbox.my.salesforce.com`; + const scratchEnhancedUrl = `https://${domainInfo.orgDomain}--${namespace}.scratch.vf.force.com`; + const scratchEnhancedLightning = `https://${domainInfo.orgDomain}--${namespace}.scratch.lightning.force.com`; + const scratchEnhancedCanon = `https://${domainInfo.orgDomain}--${namespace}.scratch.my.salesforce.com`; const originURLs = [ {value: url}, @@ -66,6 +69,9 @@ class psElevateTokenHandler { {value: productionEnhancedUrlLogin}, {value: sandboxEnhancedLightning}, {value: sandboxEnhancedCanon}, + {value: scratchEnhancedUrl}, + {value: scratchEnhancedLightning}, + {value: scratchEnhancedCanon}, ]; if (!isBlank(domainInfo.communityBaseURL)) { return [...originURLs, { value: domainInfo.communityBaseURL }]; From 18bcc10ee4008db859b939e32477fe92283777a8 Mon Sep 17 00:00:00 2001 From: Luke Parrott Date: Mon, 17 Oct 2022 12:03:47 -0500 Subject: [PATCH 008/318] Batch Gift Entry ACH fixes, loading Elevate Widget in read-only mode and allowing cancel --- .../labels/CustomLabels.labels-meta.xml | 8 +++ .../geFormWidgetTokenizeCard.html | 54 ++++++++++++------- .../geFormWidgetTokenizeCard.js | 50 ++++++++++++++--- .../lwc/geLabelService/geLabelService.js | 2 + 4 files changed, 87 insertions(+), 27 deletions(-) diff --git a/force-app/main/default/labels/CustomLabels.labels-meta.xml b/force-app/main/default/labels/CustomLabels.labels-meta.xml index 65ecbe4839f..c707332f1df 100644 --- a/force-app/main/default/labels/CustomLabels.labels-meta.xml +++ b/force-app/main/default/labels/CustomLabels.labels-meta.xml @@ -6140,6 +6140,14 @@ To check your GAU Allocation settings, go to Donations | GAU Allocations.Common label for Account Number Account Number + + commonACHLast4 + Gift Entry + en_US + true + Common label for ach last 4 + ACH Last 4 + commonActivate Auto Number diff --git a/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.html b/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.html index 89ccf8ccd8a..8ef07d9beda 100755 --- a/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.html +++ b/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.html @@ -124,26 +124,40 @@

diff --git a/force-app/main/default/lwc/utilInput/utilInput.js b/force-app/main/default/lwc/utilInput/utilInput.js index cf494b9236e..139e9601340 100755 --- a/force-app/main/default/lwc/utilInput/utilInput.js +++ b/force-app/main/default/lwc/utilInput/utilInput.js @@ -46,6 +46,7 @@ export default class utilInput extends LightningElement { @api value; @api widgetName; @api picklistOptionsOverride; + @api disabled; @track isRichTextValid = true; @track defaultRecordTypeId; @@ -183,6 +184,9 @@ export default class utilInput extends LightningElement { get isRequired() { return this.required === YES || this.required === true; } + get isDisabled() { + return this.disabled; + } get lookupFormElementClass() { if(this.variant === LABEL_INLINE) { From 04e7c88c6fe3fca40ecff9181afabe3d67710c0f Mon Sep 17 00:00:00 2001 From: Andrew Yu Date: Mon, 17 Oct 2022 15:05:42 -0700 Subject: [PATCH 010/318] callable api test --- .../main/default/classes/Callable_API.cls | 14 ++++++- .../default/classes/Callable_API_TEST.cls | 40 +++++++++++++++++++ .../classes/PMT_RefundService_TEST.cls | 6 +-- 3 files changed, 55 insertions(+), 5 deletions(-) diff --git a/force-app/main/default/classes/Callable_API.cls b/force-app/main/default/classes/Callable_API.cls index c6b1c119b39..d99ef1b7a90 100644 --- a/force-app/main/default/classes/Callable_API.cls +++ b/force-app/main/default/classes/Callable_API.cls @@ -65,6 +65,17 @@ global with sharing class Callable_API implements System.Callable { set; } + @TestVisible + PMT_RefundService refundService { + get { + if (refundService == null) { + refundService = new PMT_RefundService(); + } + return refundService; + } + set; + } + /******************************************************************************************************* * @description call function implementation of the callable Interface will dispatch to the appropriate * action handler based on the action text @@ -171,8 +182,7 @@ global with sharing class Callable_API implements System.Callable { } when 'pmt.procressrefunds' { List refunds = paramService.getSObjects(CallableApiParameters.PARAM_REFUND_RECORDS); - PMT_RefundService refundService = new PMT_RefundService() - .withRefundRecords(refunds); + refundService.withRefundRecords(refunds); refundService.adjustAllocationsAndOpportunities(); refundService.updateAllocationsAndOpportunities(); diff --git a/force-app/main/default/classes/Callable_API_TEST.cls b/force-app/main/default/classes/Callable_API_TEST.cls index 113fec396e7..58e7d832584 100644 --- a/force-app/main/default/classes/Callable_API_TEST.cls +++ b/force-app/main/default/classes/Callable_API_TEST.cls @@ -45,6 +45,7 @@ private with sharing class Callable_API_TEST { private static final String RD2_PAUSE_ACTION = 'rd2.pause'; private static final String ADVANCED_MAPPING_ACTION = 'settings.enableadvancedmapping'; private static final String GIFT_ENTRY_ACTION = 'settings.enablegiftentry'; + private static final String PROCESS_REFUNDS = 'pmt.procressrefunds'; /** * @description verify the TDTM Callable action returns an Object @@ -254,6 +255,45 @@ private with sharing class Callable_API_TEST { System.assertEquals(expectedErrorMessage, returnPause.error, 'An error with unexpected Id should be return'); } + @isTest + private static void shouldProcessRefundAllocationsAndOpportunity() { + Opportunity oppRecord = PMT_RefundService_TEST.getOpportunityRecord(); + npe01__OppPayment__c originalPayment = PMT_RefundService_TEST.getPaymentRecord(oppRecord.Id); + List allocations = PMT_RefundService_TEST.getAllocationRecords(oppRecord); + + PMT_RefundService refundService = PMT_RefundService_TEST.setupRefundServiceWithStubs( + new List{originalPayment}, + new List{oppRecord}, + allocations + ); + + Callable_API callableApi = new Callable_API(); + callableApi.refundService = refundService; + + Decimal refundAmount = originalPayment.npe01__Payment_Amount__c / 2; + Decimal expectedPercentage = allocations[0].Amount__c / oppRecord.Amount * 100; + + + Map args = new Map{ + 'RefundRecords' => new List {refundService.buildRefundRecord(originalPayment, refundAmount)} + }; + + + Test.startTest(); + callableApi.call(PROCESS_REFUNDS, args); + Test.stopTest(); + + List updatedAllocations = callableApi.refundService.allocationsToUpdate; + Opportunity parentOpp = refundService.opportunityMap.values()?.get(0); + for (Allocation__c allo : updatedAllocations) { + System.assertEquals(expectedPercentage , allo.Percent__c, + 'Fixed Amount should be convet into percentage'); + } + System.assertNotEquals(null, parentOpp, 'The parent opportunity should be proccessed'); + System.assertEquals(originalPayment.npe01__Payment_Amount__c - refundAmount, parentOpp.Amount, + 'Partial Refund Amount should be deducted from the opportunity amount'); + } + private static GiftEntryEnablementService stubFor(GiftEntryEnablementServiceMock giftEntryEnablementServiceMock) { return (GiftEntryEnablementService) Test.createStub( GiftEntryEnablementService.class, giftEntryEnablementServiceMock); diff --git a/force-app/main/default/classes/PMT_RefundService_TEST.cls b/force-app/main/default/classes/PMT_RefundService_TEST.cls index 3ba4470578b..803990a7101 100644 --- a/force-app/main/default/classes/PMT_RefundService_TEST.cls +++ b/force-app/main/default/classes/PMT_RefundService_TEST.cls @@ -270,7 +270,7 @@ public with sharing class PMT_RefundService_TEST { } } - private static npe01__OppPayment__c getPaymentRecord(Id oppId) { + public static npe01__OppPayment__c getPaymentRecord(Id oppId) { npe01__OppPayment__c payment = new npe01__OppPayment__c( Id = UTIL_UnitTestData_TEST.mockId(npe01__OppPayment__c.SObjectType), npe01__Opportunity__c = oppId, @@ -281,14 +281,14 @@ public with sharing class PMT_RefundService_TEST { return payment; } - private static Opportunity getOpportunityRecord() { + public static Opportunity getOpportunityRecord() { return new Opportunity( Id = UTIL_UnitTestData_TEST.mockId(Opportunity.SObjectType), Amount = 1000 ); } - private static List getAllocationRecords(Opportunity opp) { + public static List getAllocationRecords(Opportunity opp) { return new List { new Allocation__c( Opportunity__c = opp.Id, From a5e42efa5e2b51161785b587dd71529ea525d4bf Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Mon, 17 Oct 2022 16:35:51 -0700 Subject: [PATCH 011/318] W-11552158 - Adding 'Failing' as Recurring Donation Status - Added 'Failing' to the Status Picklist - Added mapping for 'Failing' to 'Active' in the RD Status Mapper --- force-app/main/default/classes/RD2_Constants.cls | 1 + force-app/main/default/classes/RD2_StatusMapper.cls | 3 ++- .../fields/Status__c.field-meta.xml | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/force-app/main/default/classes/RD2_Constants.cls b/force-app/main/default/classes/RD2_Constants.cls index 41d13424ba1..169e841119a 100644 --- a/force-app/main/default/classes/RD2_Constants.cls +++ b/force-app/main/default/classes/RD2_Constants.cls @@ -86,6 +86,7 @@ public inherited sharing class RD2_Constants { public static final String STATUS_LAPSED = 'Lapsed'; public static final String STATUS_CLOSED = 'Closed'; public static final String STATUS_PAUSED = 'Paused'; + public static final String STATUS_FAILING = 'Failing'; /** * @description Recurring Donation "Recurring Type" picklist API values diff --git a/force-app/main/default/classes/RD2_StatusMapper.cls b/force-app/main/default/classes/RD2_StatusMapper.cls index c90dcf5a14a..02a6d72a755 100755 --- a/force-app/main/default/classes/RD2_StatusMapper.cls +++ b/force-app/main/default/classes/RD2_StatusMapper.cls @@ -39,7 +39,8 @@ public with sharing class RD2_StatusMapper { RD2_Constants.STATUS_ACTIVE => RD2_Constants.STATUS_ACTIVE, RD2_Constants.STATUS_LAPSED => RD2_Constants.STATUS_LAPSED, RD2_Constants.STATUS_CLOSED => RD2_Constants.STATUS_CLOSED, - RD2_Constants.STATUS_PAUSED => RD2_Constants.STATUS_ACTIVE + RD2_Constants.STATUS_PAUSED => RD2_Constants.STATUS_ACTIVE, + RD2_Constants.STATUS_FAILING => RD2_Constants.STATUS_ACTIVE }; /** diff --git a/force-app/main/default/objects/npe03__Recurring_Donation__c/fields/Status__c.field-meta.xml b/force-app/main/default/objects/npe03__Recurring_Donation__c/fields/Status__c.field-meta.xml index f6a93935b97..538ab40ec66 100644 --- a/force-app/main/default/objects/npe03__Recurring_Donation__c/fields/Status__c.field-meta.xml +++ b/force-app/main/default/objects/npe03__Recurring_Donation__c/fields/Status__c.field-meta.xml @@ -33,6 +33,11 @@ false + + Failing + false + + From 1779e36cc0322e89bb24f252fea240ad0273508c Mon Sep 17 00:00:00 2001 From: Daniel Fuller Date: Tue, 18 Oct 2022 14:52:12 -0400 Subject: [PATCH 012/318] don't display warning modal for adding a schedule to a one-time gift --- .../__tests__/geFormRenderer.test.js | 70 ------------------- .../lwc/geFormRenderer/geFormRenderer.js | 7 +- 2 files changed, 1 insertion(+), 76 deletions(-) diff --git a/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js b/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js index 28874b1ef42..bcabe7cd549 100644 --- a/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js +++ b/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js @@ -187,39 +187,6 @@ describe('c-ge-form-renderer', () => { expect(componentName).toBe('geModalRecurringDonation'); }); - it('dispatches an event to display a warning modal when adding schedule for gift matched to existing opportunity', async () => { - retrieveDefaultSGERenderWrapper.mockResolvedValue(mockWrapperWithNoNames); - getAllocationsSettings.mockResolvedValue(allocationsSettingsNoDefaultGAU); - const element = createElement('c-ge-form-renderer', {is: GeFormRenderer }); - const DUMMY_BATCH_ID = 'a0T11000007F8WQEA0'; - - element.batchId = DUMMY_BATCH_ID; - - document.body.appendChild(element); - - await flushPromises(); - - // simulate getting back data for DUMMY_CONTACT_ID - getRecord.emit(dataImportBatchRecord, config => { - return config.recordId === DUMMY_BATCH_ID; - }); - element.giftInView = { - fields: { [donationImported.fieldApiName]: 'dummy_opportunity_id' } - }; - - await flushPromises(); - - const dispatchEventSpy = jest.spyOn(element, 'dispatchEvent'); - const button = element.shadowRoot.querySelector('[data-id="recurringButton"]'); - button.click(); - - await flushPromises(); - - expect(dispatchEventSpy).toHaveBeenCalledTimes(1); - const componentName = dispatchEventSpy.mock.calls[0][0].detail.modalProperties.componentName; - expect(componentName).toBe('geModalPrompt'); - }); - it('dispatches an event to display a warning modal when adding schedule for gift with net new soft credits', async () => { retrieveDefaultSGERenderWrapper.mockResolvedValue(mockWrapperWithNoNames); getAllocationsSettings.mockResolvedValue(allocationsSettingsNoDefaultGAU); @@ -256,43 +223,6 @@ describe('c-ge-form-renderer', () => { const componentName = dispatchEventSpy.mock.calls[0][0].detail.modalProperties.componentName; expect(componentName).toBe('geModalPrompt'); }); - - it('dispatches an event to display a warning modal when adding schedule for gift with elevate authorization', async () => { - retrieveDefaultSGERenderWrapper.mockResolvedValue(mockWrapperWithNoNames); - getAllocationsSettings.mockResolvedValue(allocationsSettingsNoDefaultGAU); - const element = createElement('c-ge-form-renderer', {is: GeFormRenderer }); - const DUMMY_BATCH_ID = 'a0T11000007F8WQEA0'; - - element.batchId = DUMMY_BATCH_ID; - - document.body.appendChild(element); - - await flushPromises(); - - // simulate getting back data for DUMMY_CONTACT_ID - getRecord.emit(dataImportBatchRecord, config => { - return config.recordId === DUMMY_BATCH_ID; - }); - element.giftInView = { - fields: { - 'Payment_Method__c': 'Credit Card', - 'Donation_Amount__c': '0.01', - 'Payment_Status__c': 'AUTHORIZED' - } - }; - - await flushPromises(); - - const dispatchEventSpy = jest.spyOn(element, 'dispatchEvent'); - const button = element.shadowRoot.querySelector('[data-id="recurringButton"]'); - button.click(); - - await flushPromises(); - - expect(dispatchEventSpy).toHaveBeenCalledTimes(1); - const componentName = dispatchEventSpy.mock.calls[0][0].detail.modalProperties.componentName; - expect(componentName).toBe('geModalPrompt'); - }); }); it('loads a template with four sections', async () => { diff --git a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js index 75c94465a34..11c0e4ebdfd 100644 --- a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js +++ b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js @@ -445,12 +445,7 @@ export default class GeFormRenderer extends LightningElement{ } shouldDisplayWarningForRecurringGiftModal() { - const isReviewingOpportunity = !isEmptyObject(this.giftInView?.fields[DATA_IMPORT_DONATION_IMPORTED_FIELD.fieldApiName]); - const isReviewingPayment = !isEmptyObject(this.giftInView?.fields[DATA_IMPORT_PAYMENT_IMPORTED_FIELD.fieldApiName]); - const hasSoftCredits = this.hasSoftCredits(); - const isGiftAuthorized = this.isGiftAuthorized(); - - return isGiftAuthorized || isReviewingOpportunity || isReviewingPayment || hasSoftCredits; + return this.hasSoftCredits(); } displayWarningForRecurringGiftModal() { From 14a382ec935dc4ba596e4b32fddeccd11d2a94ce Mon Sep 17 00:00:00 2001 From: Daniel Fuller Date: Tue, 18 Oct 2022 15:26:40 -0400 Subject: [PATCH 013/318] disable Make Recurring button when imported gift is opened from the batch table --- force-app/main/default/lwc/geFormRenderer/geFormRenderer.html | 1 + force-app/main/default/lwc/geFormRenderer/geFormRenderer.js | 1 + .../default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.html | 1 + .../main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js | 4 ++++ 4 files changed, 7 insertions(+) diff --git a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.html b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.html index 18991aabe30..1f20fafd9d5 100644 --- a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.html +++ b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.html @@ -178,6 +178,7 @@ label={CUSTOM_LABELS.geMakeRecurring} data-id='recurringButton' onclick={handleMakeGiftRecurring} + disabled={isMakeRecurringButtonDisabled} > diff --git a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js index 11c0e4ebdfd..ebfb7056b53 100644 --- a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js +++ b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js @@ -190,6 +190,7 @@ export default class GeFormRenderer extends LightningElement{ @api batchCurrencyIsoCode; @api isElevateCustomer = false; @api saveDisabled = false; + @api isMakeRecurringButtonDisabled = false; @track isPermissionError = false; @track permissionErrorTitle; diff --git a/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.html b/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.html index 8dc37b7a95a..00919084bb6 100644 --- a/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.html +++ b/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.html @@ -68,6 +68,7 @@

onnavigate={handleNavigateEvent} loading-text={loadingText} save-disabled={isFormSaveDisabled} + is-make-recurring-button-disabled={shouldDisableMakeRecurringButton} batch-currency-iso-code={batchCurrencyIsoCode} > diff --git a/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js b/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js index 6787085a841..ca3ec1db8d2 100644 --- a/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js +++ b/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js @@ -83,6 +83,10 @@ export default class GeGiftEntryFormApp extends NavigationMixin(LightningElement } } + get shouldDisableMakeRecurringButton() { + return this.gift.isImported(); + } + handleLoadData(event) { try { this.isFormRendering = true; From 00094cd06f65068fac4db0c6bae63d1da164fe43 Mon Sep 17 00:00:00 2001 From: screcco-sfdo Date: Tue, 18 Oct 2022 17:04:29 -0400 Subject: [PATCH 014/318] Decimal Comma Currency Locales cause Amount to be Inflated by two zeros --- force-app/main/default/classes/GE_GiftEntryController.cls | 7 ++++--- .../main/default/lwc/geFormRenderer/geFormRenderer.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/force-app/main/default/classes/GE_GiftEntryController.cls b/force-app/main/default/classes/GE_GiftEntryController.cls index 851f8af74c0..1d4e6ccb778 100644 --- a/force-app/main/default/classes/GE_GiftEntryController.cls +++ b/force-app/main/default/classes/GE_GiftEntryController.cls @@ -422,11 +422,12 @@ public with sharing class GE_GiftEntryController { * @return The DataImport__c record that was saved */ @AuraEnabled - public static DataImport__c upsertDataImport(DataImport__c dataImport) { + public static DataImport__c upsertDataImport(String dataImport) { + DataImport__c dataImportObject = (DataImport__c)JSON.deserialize(dataImport, DataImport__c.class); try { - upsert dataImport Id; + upsert dataImportObject Id; - return dataImport; + return dataImportObject; } catch (Exception e) { String JSONExceptionData = ERR_ExceptionData.createExceptionWrapperJSONString(e); diff --git a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js index 75c94465a34..7bf358a8ee1 100644 --- a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js +++ b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js @@ -2594,7 +2594,7 @@ export default class GeFormRenderer extends LightningElement{ : this.CUSTOM_LABELS.geTextSaving; delete dataImportFromFormState[apiNameFor(PAYMENT_AUTHORIZE_TOKEN)]; const upsertResponse = await upsertDataImport({ - dataImport: dataImportFromFormState + dataImport: JSON.stringify(dataImportFromFormState) }); this.updateFormState(upsertResponse); }; From c8aac53cf912b0df8defe0b76d7ffac026daaec1 Mon Sep 17 00:00:00 2001 From: screcco-sfdo Date: Tue, 18 Oct 2022 17:22:09 -0400 Subject: [PATCH 015/318] fix broken test --- .../main/default/classes/GE_GiftEntryController_TEST.cls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/force-app/main/default/classes/GE_GiftEntryController_TEST.cls b/force-app/main/default/classes/GE_GiftEntryController_TEST.cls index abfeb8cf7f1..77611ff434f 100755 --- a/force-app/main/default/classes/GE_GiftEntryController_TEST.cls +++ b/force-app/main/default/classes/GE_GiftEntryController_TEST.cls @@ -541,11 +541,11 @@ ElevateBatchItemType.ONE_TIME, TEST_PAYMENT_METHOD_CARD); @IsTest static void shouldUpsertDataImportRecord() { DataImport__c inMemoryDataImport = BDI_DataImport_TEST.newDI('First', 'Last', 100); - DataImport__c dataImportRecord = GE_GiftEntryController.upsertDataImport(inMemoryDataImport); + DataImport__c dataImportRecord = GE_GiftEntryController.upsertDataImport(JSON.serialize(inMemoryDataImport)); System.assert(dataImportRecord.Id != null); dataImportRecord.Payment_Authorization_Token__c = 'TEST_TOKEN'; - DataImport__c updatedDataImportRecord = GE_GiftEntryController.upsertDataImport(dataImportRecord); + DataImport__c updatedDataImportRecord = GE_GiftEntryController.upsertDataImport(JSON.serialize(dataImportRecord)); System.assertEquals(dataImportRecord.Id, updatedDataImportRecord.Id); System.assertEquals('TEST_TOKEN', updatedDataImportRecord.Payment_Authorization_Token__c); } From ff5fd9830ef985b69680ebfe6c148f1890da8e5b Mon Sep 17 00:00:00 2001 From: Luke Parrott Date: Tue, 18 Oct 2022 16:22:37 -0500 Subject: [PATCH 016/318] Gift Entry Batch, fix for opening imported gifts, elevate widget should be read-only --- .../default/lwc/geFormRenderer/geFormRenderer.js | 14 +++++++++----- .../main/default/lwc/geFormWidget/geFormWidget.js | 2 ++ .../geFormWidgetTokenizeCard.js | 12 +++++++++--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js index 75c94465a34..4f058a55199 100644 --- a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js +++ b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js @@ -488,7 +488,7 @@ export default class GeFormRenderer extends LightningElement{ } handleNullPaymentFieldsInFormState() { - if (this.shouldNullPaymentRelatedFields()) { + if (this.shouldNullPaymentRelatedFields() || this.shouldNullFormerAchPayment()) { this.nullPaymentFieldsInFormState([ apiNameFor(PAYMENT_AUTHORIZE_TOKEN), apiNameFor(PAYMENT_DECLINED_REASON), @@ -951,6 +951,10 @@ export default class GeFormRenderer extends LightningElement{ && this.selectedPaymentMethod() !== PAYMENT_METHOD_CREDIT_CARD; } + shouldNullFormerAchPayment() { + return this.isGiftPending() && this.selectedPaymentMethod() !== PAYMENT_METHOD_ACH; + } + async handleRemoveFromElevateBatch(tokenizedGift) { const gift = new Gift(this.giftInView); const result = {hasError: false, wasRemoved: false}; @@ -1098,13 +1102,13 @@ export default class GeFormRenderer extends LightningElement{ return this.formState[apiNameFor(PAYMENT_STATUS)] === this.PAYMENT_TRANSACTION_STATUS_ENUM.AUTHORIZED; } + isGiftPending() { + return this.formState[apiNameFor(PAYMENT_STATUS)] === this.PAYMENT_TRANSACTION_STATUS_ENUM.PENDING; + } + isGiftExpired() { return this.formState[apiNameFor(PAYMENT_STATUS)] === this.PAYMENT_TRANSACTION_STATUS_ENUM.EXPIRED; } - - shouldNotNullPaymentFields() { - return (this.isGiftAuthorized() || this.isGiftExpired()); - } shouldTokenizeCard() { return Settings.isElevateCustomer() diff --git a/force-app/main/default/lwc/geFormWidget/geFormWidget.js b/force-app/main/default/lwc/geFormWidget/geFormWidget.js index c5965796483..93675f3013f 100644 --- a/force-app/main/default/lwc/geFormWidget/geFormWidget.js +++ b/force-app/main/default/lwc/geFormWidget/geFormWidget.js @@ -10,6 +10,7 @@ import DATA_IMPORT_ACCOUNT_NAME from '@salesforce/schema/DataImport__c.Account1_ import DATA_IMPORT_PAYMENT_STATUS from '@salesforce/schema/DataImport__c.Payment_Status__c'; import DATA_IMPORT_PARENT_BATCH_LOOKUP from '@salesforce/schema/DataImport__c.NPSP_Data_Import_Batch__c'; import DATA_IMPORT_ID from '@salesforce/schema/DataImport__c.Id'; +import DATA_IMPORT_STATUS from '@salesforce/schema/DataImport__c.Status__c'; const ALLOCATION_WIDGET = 'geFormWidgetAllocation'; const SOFT_CREDIT_WIDGET = 'geFormWidgetSoftCredit'; @@ -40,6 +41,7 @@ export default class GeFormWidget extends LightningElement { apiNameFor(DATA_IMPORT_DONATION_DONOR), apiNameFor(DATA_IMPORT_ACCOUNT_NAME), apiNameFor(DATA_IMPORT_PAYMENT_STATUS), + apiNameFor(DATA_IMPORT_STATUS), apiNameFor(DATA_IMPORT_ID) ]; diff --git a/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.js b/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.js index 18e97150547..f07f258f260 100755 --- a/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.js +++ b/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.js @@ -27,6 +27,7 @@ import DATA_IMPORT_PAYMENT_STATUS_FIELD from '@salesforce/schema/DataImport__c.P import DATA_IMPORT_PAYMENT_METHOD from '@salesforce/schema/DataImport__c.Payment_Method__c'; import DATA_IMPORT_CONTACT_FIRSTNAME from '@salesforce/schema/DataImport__c.Contact1_Firstname__c'; import DATA_IMPORT_CONTACT_LASTNAME from '@salesforce/schema/DataImport__c.Contact1_Lastname__c'; +import DATA_IMPORT_STATUS from '@salesforce/schema/DataImport__c.Status__c'; import DATA_IMPORT_DONATION_DONOR from '@salesforce/schema/DataImport__c.Donation_Donor__c'; import DATA_IMPORT_ACCOUNT_NAME from '@salesforce/schema/DataImport__c.Account1_Name__c'; @@ -191,7 +192,7 @@ export default class geFormWidgetTokenizeCard extends LightningElement { return Settings.isElevateCustomer() && this.isReadOnly && (this.isExpiredTransaction || this.isPaymentStatusInReadOnlyMode() || - this._widgetDataFromState[apiNameFor(DATA_IMPORT_RECURRING_DONATION_INSTALLMENT_PERIOD)]); + !!this._widgetDataFromState[apiNameFor(DATA_IMPORT_RECURRING_DONATION_INSTALLMENT_PERIOD)]); } get shouldDisplayDoNotEnterPaymentInformation() { @@ -305,8 +306,9 @@ export default class geFormWidgetTokenizeCard extends LightningElement { this.display.transitionTo('resetToDeactivated'); } - if (this.isPaymentStatusInReadOnlyMode() && this.isValidBatchElevatePaymentMethod()) { - this.display.transitionTo('readOnly'); + if ((this.isPaymentStatusInReadOnlyMode() && this.isValidBatchElevatePaymentMethod()) + || this.isDataImportStatusImported()) { + this.display.transitionTo('readOnly'); } else if (this.isValidBatchElevatePaymentMethod()) { this.display.transitionTo('charge'); if (this.isMounted) { @@ -379,6 +381,10 @@ export default class geFormWidgetTokenizeCard extends LightningElement { this.display.transitionTo('readOnly'); } + isDataImportStatusImported() { + return this._widgetDataFromState[apiNameFor(DATA_IMPORT_STATUS)] === 'Imported'; + } + isPaymentStatusInReadOnlyMode() { return this.isPaymentStatusAuthorized() || this.isPaymentStatusPending(); } From 859723954fc658909b382a871ab177147563b93e Mon Sep 17 00:00:00 2001 From: screcco-sfdo Date: Tue, 18 Oct 2022 18:23:28 -0400 Subject: [PATCH 017/318] fix broken jest test --- .../geFormRenderer/__tests__/geFormRenderer.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js b/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js index 28874b1ef42..c529d46a824 100644 --- a/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js +++ b/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js @@ -375,12 +375,12 @@ describe('c-ge-form-renderer', () => { "paymentMethodType": "CARD" }); const EXPECTED_UPSERT_DATAIMPORT_FIELDS = { - Donation_Donor__c: 'Contact', + Payment_Method__c: "Credit Card", + Donation_Amount__c: '0.01', Contact1Imported__c: '003J000001zoYLGIA2', - Contact1_Lastname__c: 'DummyLastName', Donation_Date__c: '2021-02-23', - Donation_Amount__c: '0.01', - Payment_Method__c: "Credit Card", + Donation_Donor__c: 'Contact', + Contact1_Lastname__c: 'DummyLastName', }; const DUMMY_CONTACT_ID = '003J000001zoYLGIA2'; @@ -448,7 +448,7 @@ describe('c-ge-form-renderer', () => { requestBodyParameters: EXPECTED_PURCHASE_BODY_PARAMS }); expect(upsertDataImport).toHaveBeenLastCalledWith({ - dataImport: expect.objectContaining(EXPECTED_UPSERT_DATAIMPORT_FIELDS) + dataImport: JSON.stringify(EXPECTED_UPSERT_DATAIMPORT_FIELDS) }); }); }); From 315c2e08af632c348de65825c4c57650f378a770 Mon Sep 17 00:00:00 2001 From: Luke Parrott Date: Wed, 19 Oct 2022 11:35:20 -0500 Subject: [PATCH 018/318] Fix for trailhead links --- force-app/main/default/classes/UTIL_HtmlOutput_CTRL.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/force-app/main/default/classes/UTIL_HtmlOutput_CTRL.cls b/force-app/main/default/classes/UTIL_HtmlOutput_CTRL.cls index 3d378012a3e..6d46d1554f5 100644 --- a/force-app/main/default/classes/UTIL_HtmlOutput_CTRL.cls +++ b/force-app/main/default/classes/UTIL_HtmlOutput_CTRL.cls @@ -53,7 +53,7 @@ public with sharing class UTIL_HtmlOutput_CTRL { /** @description The map of allowed urls and their temporary substitution values */ private static final Map SUBSTITUTION_BY_ALLOWED_URL = new Map { - ' '|hubURL|', ' '|lightningSetupURL|', '
diff --git a/force-app/main/default/lwc/geBatchWizard/geBatchWizard.js b/force-app/main/default/lwc/geBatchWizard/geBatchWizard.js index e1ffcf75e96..e4266cea233 100755 --- a/force-app/main/default/lwc/geBatchWizard/geBatchWizard.js +++ b/force-app/main/default/lwc/geBatchWizard/geBatchWizard.js @@ -89,9 +89,6 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) { third: 2 } - _allowFirstInstallment = false; - _allowFirstInstallmentDisabled; - get allowRecurringDonations() { return this ?.dataImportBatchRecord @@ -108,36 +105,6 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) { return Settings.canMakeGiftsRecurring(); } - calculateAllowFirstInstallmentState() { - if (this.allowRecurringDonations) { - this._allowFirstInstallmentDisabled = false; - } else if (!this.canAllowRecurringDonations || !this.allowRecurringDonations) { - this._allowFirstInstallmentDisabled = true; - } - - const batchLevelDefaults = - JSON.parse(this.dataImportBatchRecord.fields[DATA_IMPORT_BATCH_DEFAULTS_INFO.fieldApiName].value); - this._allowFirstInstallment = batchLevelDefaults['AllowFirstInstallment__f']?.value; - } - - handleAllowRecurringDonationsOnChange(event) { - const isChecked = event.detail.value - if (!isChecked) { - this._allowFirstInstallment = false; - this._allowFirstInstallmentDisabled = true; - } else if (!this._allowFirstInstallment && isChecked) { - this._allowFirstInstallmentDisabled = false; - } - } - - handleAllowFirstInstallmentOnChange(event) { - this._allowFirstInstallment = event.detail.value; - } - - get allowFirstInstallmentDisabled() { - return this._allowFirstInstallmentDisabled; - } - get showBackButton() { if (this.step === 1 && this.isEditMode) { return false; @@ -240,10 +207,6 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) { this.builderTemplateComboboxOptions(this.templates); this.dataImportBatchRecord = response.data; - this.calculateAllowFirstInstallmentState(); - - console.log(JSON.stringify(this.dataImportBatchRecord)); - let templateId = this .dataImportBatchRecord .fields[DATA_IMPORT_BATCH_FORM_TEMPLATE_INFO.fieldApiName] @@ -262,14 +225,6 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) { } } - - setAllowFirstInstallmentValue(batchLevelDefaults) { - let allowFirstInstallmentElement = this.template.querySelectorAll( - '[data-id="allowFirstInstallmentsField"]'); - allowFirstInstallmentElement.value = batchLevelDefaults['AllowFirstInstallment__f'].value; - } - - setFormFieldsBatchLevelDefaults() { let batchLevelDefaults = JSON.parse(this.dataImportBatchRecord.fields[DATA_IMPORT_BATCH_DEFAULTS_INFO.fieldApiName].value); @@ -280,16 +235,9 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) { if (batchLevelDefaults[element.fieldApiName]) { element.value = batchLevelDefaults[element.fieldApiName].value; } - - if (batchLevelDefaults[element.fieldApiName] === 'AllowFirstInstallment__f') { - element.value - } - }); } }); - this.setAllowFirstInstallmentValue(batchLevelDefaults); - } appendTrueFalsePicklistToElement() { diff --git a/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js b/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js index 6787085a841..cc1dc248b7d 100644 --- a/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js +++ b/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js @@ -480,6 +480,7 @@ export default class GeGiftEntryFormApp extends NavigationMixin(LightningElement } async handleProcessedBatch() { + await this.refreshBatchTable(); this.isFormCollapsed = true; this._isBatchProcessing = this.giftBatchState.isProcessingGifts; this.shouldLoadSpinner = this._isBatchProcessing @@ -796,4 +797,6 @@ export default class GeGiftEntryFormApp extends NavigationMixin(LightningElement this.gift.removeSchedule(); this.giftInView = this.gift.state(); } + + } From 56976f473582f6ab05fed80e32f1381310c48a25 Mon Sep 17 00:00:00 2001 From: Victor Oduyemi Date: Thu, 20 Oct 2022 09:51:36 -0600 Subject: [PATCH 023/318] Reverted Changes; Fixed batchIsoCode bug --- .../main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js | 4 ++++ force-app/main/default/lwc/utilInput/utilInput.html | 1 - force-app/main/default/lwc/utilInput/utilInput.js | 4 ---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js b/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js index cc1dc248b7d..0a4c8d09204 100644 --- a/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js +++ b/force-app/main/default/lwc/geGiftEntryFormApp/geGiftEntryFormApp.js @@ -154,6 +154,10 @@ export default class GeGiftEntryFormApp extends NavigationMixin(LightningElement await Settings.init(); } + get batchCurrencyIsoCode() { + return this.giftBatchState.currencyIsoCode; + } + disconnectedCallback() { unregisterListener('geBatchGiftEntryTableChangeEvent', this.retrieveBatchTotals, this); } diff --git a/force-app/main/default/lwc/utilInput/utilInput.html b/force-app/main/default/lwc/utilInput/utilInput.html index 82cd67ad650..ac7cb133372 100755 --- a/force-app/main/default/lwc/utilInput/utilInput.html +++ b/force-app/main/default/lwc/utilInput/utilInput.html @@ -65,7 +65,6 @@ onclick={stopPropagation} variant={variant} type="checkbox" - disabled={isDisabled} data-qa-locator={qaLocatorCheckbox}> diff --git a/force-app/main/default/lwc/utilInput/utilInput.js b/force-app/main/default/lwc/utilInput/utilInput.js index 139e9601340..cf494b9236e 100755 --- a/force-app/main/default/lwc/utilInput/utilInput.js +++ b/force-app/main/default/lwc/utilInput/utilInput.js @@ -46,7 +46,6 @@ export default class utilInput extends LightningElement { @api value; @api widgetName; @api picklistOptionsOverride; - @api disabled; @track isRichTextValid = true; @track defaultRecordTypeId; @@ -184,9 +183,6 @@ export default class utilInput extends LightningElement { get isRequired() { return this.required === YES || this.required === true; } - get isDisabled() { - return this.disabled; - } get lookupFormElementClass() { if(this.variant === LABEL_INLINE) { From fcf382781a629393918fe52014f9a3a04ee62b7e Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Thu, 20 Oct 2022 12:26:50 -0700 Subject: [PATCH 024/318] W-11552158 - Code review changes - This changes the new "Failing" status to only be added when enabling RD2 since it doesn't have a purpose for RD1. - Also added the new status to the existing unit test --- force-app/main/default/classes/RD2_StatusMapper_TEST.cls | 4 +++- .../fields/Status__c.field-meta.xml | 5 ----- .../objects/npe03__Recurring_Donation__c.object | 5 +++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/force-app/main/default/classes/RD2_StatusMapper_TEST.cls b/force-app/main/default/classes/RD2_StatusMapper_TEST.cls index 5f965d9f260..3497355853a 100755 --- a/force-app/main/default/classes/RD2_StatusMapper_TEST.cls +++ b/force-app/main/default/classes/RD2_StatusMapper_TEST.cls @@ -295,7 +295,9 @@ public with sharing class RD2_StatusMapper_TEST { return new Map{ RD2_Constants.STATUS_ACTIVE => RD2_Constants.STATUS_ACTIVE, RD2_Constants.STATUS_LAPSED => RD2_Constants.STATUS_LAPSED, - RD2_Constants.STATUS_CLOSED => RD2_Constants.STATUS_CLOSED + RD2_Constants.STATUS_CLOSED => RD2_Constants.STATUS_CLOSED, + RD2_Constants.STATUS_PAUSED => RD2_Constants.STATUS_ACTIVE, + RD2_Constants.STATUS_FAILING => RD2_Constants.STATUS_ACTIVE }; } diff --git a/force-app/main/default/objects/npe03__Recurring_Donation__c/fields/Status__c.field-meta.xml b/force-app/main/default/objects/npe03__Recurring_Donation__c/fields/Status__c.field-meta.xml index 538ab40ec66..f6a93935b97 100644 --- a/force-app/main/default/objects/npe03__Recurring_Donation__c/fields/Status__c.field-meta.xml +++ b/force-app/main/default/objects/npe03__Recurring_Donation__c/fields/Status__c.field-meta.xml @@ -33,11 +33,6 @@ false - - Failing - false - - diff --git a/unpackaged/config/rd2_post_config/objects/npe03__Recurring_Donation__c.object b/unpackaged/config/rd2_post_config/objects/npe03__Recurring_Donation__c.object index 79a003a3104..2c6e2e1b11a 100644 --- a/unpackaged/config/rd2_post_config/objects/npe03__Recurring_Donation__c.object +++ b/unpackaged/config/rd2_post_config/objects/npe03__Recurring_Donation__c.object @@ -367,6 +367,11 @@ false + + Failing + false + + From bfcea5b2c96b5d7c5f954b0067ef0a3eb6082279 Mon Sep 17 00:00:00 2001 From: Luke Parrott Date: Thu, 20 Oct 2022 15:57:19 -0500 Subject: [PATCH 025/318] PR feedback for ACH read-only updates --- .../default/lwc/geFormRenderer/geFormRenderer.js | 6 +++++- .../geFormWidgetTokenizeCard.html | 12 +++++++----- .../geFormWidgetTokenizeCard.js | 14 +++++++------- .../psElevateTokenHandler/psElevateTokenHandler.js | 6 ------ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js index 4f058a55199..0103a3dc090 100644 --- a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js +++ b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.js @@ -488,7 +488,7 @@ export default class GeFormRenderer extends LightningElement{ } handleNullPaymentFieldsInFormState() { - if (this.shouldNullPaymentRelatedFields() || this.shouldNullFormerAchPayment()) { + if (this.shouldNullPaymentRelatedFields()) { this.nullPaymentFieldsInFormState([ apiNameFor(PAYMENT_AUTHORIZE_TOKEN), apiNameFor(PAYMENT_DECLINED_REASON), @@ -947,6 +947,10 @@ export default class GeFormRenderer extends LightningElement{ } shouldNullPaymentRelatedFields() { + return this.shouldNullFormerCreditCardPayment() || this.shouldNullFormerAchPayment(); + } + + shouldNullFormerCreditCardPayment() { return (this.isGiftAuthorized() || this.isGiftExpired()) && this.selectedPaymentMethod() !== PAYMENT_METHOD_CREDIT_CARD; } diff --git a/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.html b/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.html index 8ef07d9beda..19738e900d0 100755 --- a/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.html +++ b/force-app/main/default/lwc/geFormWidgetTokenizeCard/geFormWidgetTokenizeCard.html @@ -122,9 +122,9 @@