[jira] Commented: (OFBIZ-1437) Modify the getProductOrgGlAccount service to also consider the new ProductCategoryGlAccount entity

Posted by Nicolas Malin (Jira) on
URL: http://ofbiz.116.s1.nabble.com/jira-Created-OFBIZ-1437-Modify-the-getProductOrgGlAccount-service-to-also-consider-the-new-ProductCay-tp186006p186014.html


    [ https://issues.apache.org/jira/browse/OFBIZ-1437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546573 ]

Jacopo Cappellato commented on OFBIZ-1437:
------------------------------------------

Anil, Ashish,

I was thinking to a slightly different approach: instead of looking the ProductCategoryGlAccount  by productCategoryId, we should verify if the parameters.productId is a member of the category that has the entry in ProductCategoryGlAccount.
So:

1) select the records in ProductCategoryGlAccount  that match the parameters.organizationPartyId and parameters.glAccountTypeId
2) iterate thru the list and for each category, verify if the product is a member of the category (ProductCategoryMember, also considering from/thru dates)
3) if we find a match then stop and return the ProductCategoryGlAccount.glAccountId

In this way the calling service will not have to bother to pass a categoryId together with the product.
What do you think?




> Modify the getProductOrgGlAccount service to also consider the new ProductCategoryGlAccount entity
> --------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-1437
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1437
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>            Reporter: Jacopo Cappellato
>            Assignee: Anil K Patel
>         Attachments: getProductOrgGlAccountService.patch
>
>
> Modify the getProductOrgGlAccount service to also consider the new ProductCategoryGlAccount entity: the information in this file will be considered if no specific mapping for the productId was found in the ProductGlAccount entity and before looking at the general GlAccountTypeDefault entity.
> As usual, a product is associated to the category thru the ProductCategoryMember entity.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.