Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The final goal is to (from a message to the dev list by David Jones):
"[...] for most settings have child organizations use parent organization settings if that setting is not present for the child. These should be considered on a granular level, like fields on the PartyAcctgPreference entity rather than looking for the entire record."
Implement a service that, given an organizationPartyId, create an in memory GenericValue for the PartyAccountingPreference entity.
The contents of the fields of the GenericValue are composed following this logic:
1) an empty GenericValue for the PartyAccountingPreference entity, is created (in memory)
2) select the PartyAccountingPreference entity, associated to the organizationPartyId (organizationPartyId = PartyAccountingPreference.partyId), if it exists, and copy all its fields into the GenericValue created at point 1.
3) if, in the GenericValue created at point 1, there are some fields that are empty, then:
3.a) select the parent organization associated to the organizationPartyId; here is an example of the association:
<PartyRelationship partyIdFrom="Company" partyIdTo="MARKETING" partyRelationshipTypeId="GROUP_ROLLUP" roleTypeIdFrom="NA" roleTypeIdTo="NA" fromDate="2001-05-13 00:00:00.000"/>
where "Company" is the parent organization of the "MARKETING" organizationPartyId
3.b) if the parent organization exists, select its PartyAccountingPreference entity; if it exists, copy its fields to the GenericValue created at point 1, but don't override existing content; you have only to copy fields that are null in the destination map
4) repeat step 3: if, in the GenericValue created at point 1, there are still some fields that are empty, then continue with 3.a and 3.b
To summarize:
proposed name of the service: "getPartyAccountingPreferences"
IN parameter: organizationPartyId
OUT parameter: partyAccountingPreference (a GenericValue for the PartyAccountingPreference entity)
Attachments
Attachments
Issue Links
- blocks
-
OFBIZ-1631 Replace all the code that directly retrieves from the db a PartyAcctgPreference for an organizationPartyId with a call to the service implemented in OFBIZ-1630
- Closed