[ 
https://issues.apache.org/jira/browse/OFBIZ-2445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708455#action_12708455
 ] 

Pranay Pandey commented on OFBIZ-2445:
--------------------------------------

Sorry Vivek, after a testing and thorough review I found few more things which 
should be improved in this patch before it goes in trunk:

1) In BillingAccounts.groovy follwing code:
{code}
if (partyId) {
    billingAccountAndRoles = delegator.findByAnd("BillingAccountAndRole", 
[partyId : partyId]);
    if (billingAccountAndRoles)
        currencyUomId = billingAccountAndRoles.accountCurrencyUomId.get(0);
    if (currencyUomId)
        billingAccounts = 
BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, 
partyId, delegator, dispatcher);
    if (billingAccounts)
        context.billingAccounts = billingAccounts;
}
{code}
should be improved to:
{code}
billingAccounts = [];
if (partyId) {
    currencyUomId = 
EntityUtil.getFirst((delegator.findByAnd("BillingAccountAndRole", [partyId : 
partyId])).accountCurrencyUomId;
    if (currencyUomId)
        billingAccounts = 
BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, 
partyId, delegator, dispatcher);
}
 context.billingAccounts = billingAccounts;    
{code}

2) In ReturnHeader.groovy
{code}
returnHeaderTypeId = null;
fromPartyId = null;
statusId = null;
{code}
Above initializations can be removed as not used anywhere in your code and you 
added them
{code} 
partyId = parameters.get("partyId"); can be partyId = parameters.partyId;
returnRecords = []; should be  returns = [];
returns = [:] should be return = [:];
{code}

{code}
 condition = EntityCondition.makeCondition("fromPartyId", 
EntityOperator.EQUALS, partyId);
 returnHeaders = delegator.findList("ReturnHeader", condition, null, null, 
null, false);
{code}
can be improved to:
{code}
returnHeaders = delegator.findList("ReturnHeader", 
EntityCondition.makeCondition("fromPartyId", EntityOperator.EQUALS, partyId), 
null, null, null, false);
{code}

This is all from my side.



> Show Billing Account Info on the Party Profile
> ----------------------------------------------
>
>                 Key: OFBIZ-2445
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2445
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: party
>    Affects Versions: SVN trunk
>            Reporter: Pranay Pandey
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-2445.patch, OFBIZ-2445.patch, 
> ShowBillingAccountOnPartymgr.patch, ShowBillingAccountOnPartymgr.patch
>
>
> Show Billing Account Info and returns as well to show outstanding returns on 
> the Party Profile
> There is a Financial History ("Fin. History") tab on the profile in the Party 
> Manager but it only contains information about invoice and payments. Add 
> information about Billing Account(s) and available credit on this page. Add 
> section about returns as well to show outstanding returns with status.

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

Reply via email to