Partner Edit - Details of Advanced Address Tab Functionality
Jump to navigation
Jump to search
Overview
The Address Tab on the Partner Edit screen has got several advanced and specific functionalities that aren't found anywhere else in OpenPetra - and the appearance of the Tab doesn't indicate the presence of those at all! Additionally, some of these functionalities are run only 'under the hood' and hence are not easily noticed.
The purpose of this page is to document those 'specialities' so more people than just WolfgangB and I know about them, and that they can get tested as needed.
Address Added / Changed
Defaults for new Addresses
- Mailing flag
- for a new Partner: For partners with PartnerClass PERSON: while a FAMILY address gets taken over, the Mailing flag must get set to 'No'.
- for a new Address: 'Yes', unless this is a PERSON partner, in which case 'No'.
- Date Effective: 'Today'
- Date until:
- for a new Partner
- PartnerClass PERSON: copy over from FAMILY address, but only if it doesn't lie in the past.
- other PartnerClass: ""
- for a new Address: ""
- for a new Partner
- Country Code
- For a new Partner: takes over the Country Code from the currently selected Address (or the 'Best Address' if 'New Partner' was chosen from anywhere but the Partner Edit screen, I suppose).
- For a new Address: uses the same as the currently selected Address.
- Location type: Depends on PartnerClass of the Partner: BANK->BUSINESS, CHURCH->CHURCH, ORGANISATION->BUSINESS, FAMILY->HOME, PERSON->HOME, UNIT->FIELD, VENUE->BUSINESS.
- Partner Status: Set to 'ACTIVE' if it wasn't.
If an Address got added or changed
- Both when added or changed: check if a 'similar' Location exists and give user the option to use the existing Location. On choosing 'Yes' the existing Location replaces the Location that was previously held in the screen, if 'No' is chosen the added / changed address gets saved normally.
- If an Address got added:
- Make sure that Location 0 is no longer mapped to the Partner (this happens silently 'under the hood').
- Done in Method
MakeSureLocation0IsNotPresent
in C# fileDataAggregates.PPartnerAddress.cs
.
- Done in Method
- Refresh the Partner Find screen to show it.
- Make sure that Location 0 is no longer mapped to the Partner (this happens silently 'under the hood').
- If an Address got added to a FAMILY Partner: A question gets shown whether to add that Address to all Family Members; the address in question gets shown in that MessageBox. On choosing 'Yes' the Address gets added to all Family Members that don't have that Address yet. Nothing gets done if 'No' is chosen by the user.
- If the 'Valid To'-Date of an Address of a FAMILY Partner got changed:
- The changed 'Valid To'-Date gets automatically applied to all Family Members that have that Address (no question or dialog gets brought up for that, it happens 'under the hood'). Nothing gets done if there are no Family Members.
- Done in Method
PromoteToFamilyMembersDateGoodUntilChange
in C# fileDataAggregates.PPartnerAddress.cs
.
- If an Address of a Partner (of any Partner Class) got changed and that Address is used by any other Partners (of any Partner Class): A Dialog gets brought up ('Change Location for selected Partners') that allows the promotion of that change to all, selected or none of the shown Partners.
- If all Partners are selected and the user presses 'OK': the shared p_location record that got edited in the Address Tab simply gets updated (and hence this change will get reflected for all Partners as they all reference this p_location record).
- If some, or no Partners are selected and the user presses 'OK': a new p_location record gets created that holds the data of the edited Address and this record gets assigned to the current Partner, and to any of the selected Partners, too (if applicable). The originally edited p_location record doesn't get updated at all!
- If the user chooses 'Cancel' in this Dialog the whole data saving operation gets cancelled and the user gets told that this is what happened. The screen then still holds the changed Address data (and any other changed data).
Address Deletion
- If the Location behind the Address is no longer in use by any other Partners: OpenPetra automatically finds all Extract records (m_extract DB Table) that are referencing this p_partner_location and sets the p_location_key_i Column to 0 for those Extract records (no question or dialog gets brought up for that, it happens 'under the hood').
- Done in Method
RemoveLocationFromExtracts
in C# fileDataAggregates.PPartnerAddress.cs
.
- Done in Method
- If the Location behind the Address is not in use by other Partners then delete it from the p_location DB Table.
- If the last Address of a Partner is about to being deleted: Assign Location with LocationKey 0 to the p_partner_location record.
- If the Partner Find screen is shown: Refresh the Partner Find screen to show that the Address is gone.