Skip to content

Commit

Permalink
+ (Finance) Fixed an issue causing transactions entered in the Transa…
Browse files Browse the repository at this point in the history
…ction Entry V2 block to overwrite existing phone numbers. (Fixes #5524)
  • Loading branch information
shauncummings committed Nov 2, 2023
1 parent 56be7e6 commit 2065370
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion RockWeb/Blocks/Finance/TransactionEntryV2.ascx.cs
Expand Up @@ -2185,7 +2185,8 @@ private bool SetInitialTargetPersonControls()
acAddressIndividual.SetValues( null );
}

if ( GetAttributeValue( AttributeKey.PromptForPhone ).AsBoolean() )
var promptForPhone = GetAttributeValue( AttributeKey.PromptForPhone ).AsBoolean();
if ( promptForPhone )
{
var personPhoneNumber = targetPerson.GetPhoneNumber( Rock.SystemGuid.DefinedValue.PERSON_PHONE_TYPE_HOME.AsGuid() );

Expand All @@ -2195,6 +2196,26 @@ private bool SetInitialTargetPersonControls()
{
personPhoneNumber = targetPerson.GetPhoneNumber( Rock.SystemGuid.DefinedValue.PERSON_PHONE_TYPE_MOBILE.AsGuid() );
}

PhoneNumberBox pnbPhone = pnbPhoneIndividual;
if ( targetPerson.IsBusiness() )
{
pnbPhone = pnbPhoneBusiness;
}

if ( personPhoneNumber != null )
{
if ( !personPhoneNumber.IsUnlisted )
{
pnbPhone.CountryCode = personPhoneNumber.CountryCode;
pnbPhone.Number = personPhoneNumber.ToString();
}
}
else
{
pnbPhone.CountryCode = PhoneNumber.DefaultCountryCode();
pnbPhone.Number = string.Empty;
}
}

cblSelectBusiness.Items.Clear();
Expand Down

0 comments on commit 2065370

Please sign in to comment.