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. |
[ https://issues.apache.org/jira/browse/OFBIZ-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rashko Rejmer updated OFBIZ-1630: --------------------------------- Attachment: getPartyAccountingPreferences.patch This patch is implemented according to the description of the issue. The only thing that I am concerned is if copying invoiceIdPrefix and lastInvoiceNumber fields from the parent organization preferences, is a good approach. This is also applicable for quote and order numbers(ids). If it is better to not copy this fields, I can change the patch. All suggestions are welcome. > 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 > Attachments: getPartyAccountingPreferences.patch > > > 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. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacopo Cappellato reassigned OFBIZ-1630: ---------------------------------------- Assignee: Jacopo Cappellato > 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 > Assignee: Jacopo Cappellato > Attachments: getPartyAccountingPreferences.patch > > > 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. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583903#action_12583903 ] Jacopo Cappellato commented on OFBIZ-1630: ------------------------------------------ Excellent, thanks Rashko! I will review and commit the patch tomorrow (if no ones beats me before). Jacopo > 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 > Attachments: getPartyAccountingPreferences.patch > > > 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. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacopo Cappellato closed OFBIZ-1630. ------------------------------------ Resolution: Fixed > 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 > Assignee: Jacopo Cappellato > Attachments: getPartyAccountingPreferences.patch > > > 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. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584600#action_12584600 ] Jacopo Cappellato commented on OFBIZ-1630: ------------------------------------------ Rashko, your patch looks reaaly good and I have committed it in rev. 643923. You are probably right about last*Number fields (not sure about the *Prefix fields, however we may leave the service as is now and just don't call the service when we need to lookup the ids for invoices etc. If you could work on the associated task (so that we will have a chance to really use your service) this would be great. Thanks, Jacopo > 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 > Assignee: Jacopo Cappellato > Attachments: getPartyAccountingPreferences.patch > > > 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. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584629#action_12584629 ] Rashko Rejmer commented on OFBIZ-1630: -------------------------------------- Thanks Jacopo! I am already working on OFBIZ-1630, so we will be able to discuss the use of this service. Regards, Rashko Rejmer > 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 > Assignee: Jacopo Cappellato > Attachments: getPartyAccountingPreferences.patch > > > 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. |
Free forum by Nabble | Edit this page |