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.
In software development terms those 'specialities' are called 'Business Rules' .
Address Added / Changed
Defaults for New Addresses
- Mailing Address 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'. --Christiankatict (talk) 14:07, 23 February 2016 (UTC) Tested OK
- for a new Address: 'Yes', unless this is a PERSON partner, in which case 'No'. --Christiankatict (talk) 14:01, 23 February 2016 (UTC) Latter case was not working on Feb. 23rd, 2015 but will get fixed by Alan's change for Bug 4534
- set in Method
NewRowManual
in C# fileUC_PartnerAddresses.ManualCode.cs
.
- set in Method
- Valid from: 'Today's date' --Christiankatict (talk) 14:01, 23 February 2016 (UTC) Tested OK
- Valid to:
- for a new Partner
- PartnerClass PERSON: copy over from FAMILY address, but only if it doesn't lie in the past. --Christiankatict (talk) 14:07, 23 February 2016 (UTC) Tested OK
- other PartnerClass: "" --Christiankatict (talk) 09:15, 24 February 2016 (UTC) Tested OK
- for a new Address: "" --Christiankatict (talk) 14:01, 23 February 2016 (UTC) Tested OK
- for a new Partner
- Country
- For a new Partner...
- when created from the Partner Edit screen with either the 'New Partner' functionality (ToolBarButton or File Menu MenuItem by that name) or by clicking the 'Create new Person for this Family' Button on the 'Family Members' Tab (only available when current Partner is of Partner Class FAMILY):
- if current Partner is of Partner Class FAMILY:
- when the user chooses to create a Partner of Parnter Class PERSON in the 'New Partner' Dialog: The current FAMILY and currently selected Address are preset in the 'New Partner' Dialog - the FAMILY itself can be seen once 'PERSON' gets selected in the 'Partner Class' ComboBox (the Address not, however - but see feature Bug 3746 that requests that to be changed). If the user accepts those by choosing 'OK', the Country Code from the currently selected Address is taken over because the whole Address of the FAMILY is taken over as the first Address of the PERSON. (But see Feature Bug 4961 for a requested new option of optionally copying all Addresses of the FAMILY over to the new PERSON). --Christiankatict (talk) 09:15, 24 February 2016 (UTC) Tested OK
- when the user chooses to create a Partner of any Partner Class other than PERSON in the 'New Partner' Dialog: the Country Code from the currently selected Address should get taken over. --Christiankatict (talk) 09:08, 24 February 2016 (UTC) NOT WORKING
- if current Partner is of any Partner Class other than FAMILY: takes over the Country Code from the currently selected Address. --Christiankatict (talk) 09:15, 24 February 2016 (UTC) Tested OK
- if current Partner is of Partner Class FAMILY:
- when created from anywhere else than from the Partner Edit screen (e.g. from Partner Find, or directly from the Main Menu):
- if current Partner is of Partner Class FAMILY: TODO
- if current Partner is of any Partner Class other than FAMILY:
- The Country Code from a 'random' Address of the UNIT Partner (if that UNIT has got more than one Address; if not then from the one Address of the UNIT) that the OpenPetra 'Site Key' identifies gets taken over. (This should be OK though ideally the 'Best Address' of the UNIT Partner that the OpenPetra 'Site Key' identifies should be taken instead.) --Christiankatict (talk) 09:15, 24 February 2016 (UTC) Tested OK
- when created from the Partner Edit screen with either the 'New Partner' functionality (ToolBarButton or File Menu MenuItem by that name) or by clicking the 'Create new Person for this Family' Button on the 'Family Members' Tab (only available when current Partner is of Partner Class FAMILY):
- For a new Address: uses the same as the currently selected Address. --Christiankatict (talk) 14:01, 23 February 2016 (UTC) Tested OK
- For a new Partner...
- Location Type: Depends on PartnerClass of the Partner: BANK->BUSINESS, CHURCH->CHURCH, ORGANISATION->BUSINESS, FAMILY->HOME, PERSON->HOME, UNIT->FIELD, VENUE->BUSINESS. --Christiankatict (talk) 14:01, 23 February 2016 (UTC) Tested OK
- Partner Status: Set to 'ACTIVE' if it wasn't. --Christiankatict (talk) 14:01, 23 February 2016 (UTC) NOT WORKING
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. --Christiankatict (talk) 13:42, 23 February 2016 (UTC) Tested OK
- If an Address got added:
- Make sure that Location 0 is no longer mapped to the Partner (this happens silently 'under the hood'). --Christiankatict (talk) 13:42, 23 February 2016 (UTC) Tested OK
- Done in Method
MakeSureLocation0IsNotPresent
in C# fileDataAggregates.PPartnerAddress.cs
.
- Done in Method
- If the Partner Find screen is shown: The Partner Find screen gets refreshed to show it. --Christiankatict (talk) 13:42, 23 February 2016 (UTC) Tested OK
- Make sure that Location 0 is no longer mapped to the Partner (this happens silently 'under the hood'). --Christiankatict (talk) 13:42, 23 February 2016 (UTC) Tested OK
- 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. If the user chose 'No' then the Address doesn't get added to any Family Member. --Christiankatict (talk) 13:42, 23 February 2016 (UTC) Tested OK
- 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. --Christiankatict (talk) 13:42, 23 February 2016 (UTC) Tested OK
- 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. --Christiankatict (talk) 13:42, 23 February 2016 (UTC) Tested OK
- 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). --Christiankatict (talk) 13:42, 23 February 2016 (UTC) Tested OK
- 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, plus to any of the selected Partners, too (if applicable). The originally edited p_location record doesn't get updated at all! --Christiankatict (talk) 13:42, 23 February 2016 (UTC) Tested OK
- 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). --Christiankatict (talk) 13:42, 23 February 2016 (UTC) Tested OK
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'). --Christiankatict (talk) 13:40, 23 February 2016 (UTC) Tested OK - but see Bug 5084.
- 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. --Christiankatict (talk) 13:40, 23 February 2016 (UTC) Tested OK
- If the last Address of a Partner is about to being deleted: Assign Location with LocationKey 0 to the p_partner_location record. --Christiankatict (talk) 13:40, 23 February 2016 (UTC) Tested OK
- If the Partner Find screen is shown: Refresh the Partner Find screen to show that the Address is gone. --Christiankatict (talk) 13:40, 23 February 2016 (UTC) Tested OK