Implement service to return an aggregated PartyAcctgPreference map containing information for all the preferences in a internal organization tree -------------------------------------------------------------------------------------------------------------------------------------------------
Key: OFBIZ-1630 URL: https://issues.apache.org/jira/browse/OFBIZ-1630 Project: OFBiz Issue Type: Sub-task Components: accounting Reporter: Jacopo Cappellato 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) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.