Missing Billing Accounts in Dropdown
------------------------------------ Key: OFBIZ-1101 URL: https://issues.apache.org/jira/browse/OFBIZ-1101 Project: OFBiz Issue Type: Bug Components: accounting Affects Versions: SVN trunk Reporter: Guido Amarilla Priority: Minor The dropdown list for billing account selection in Order payment method selection is not populated with all the billing accounts for the customer. There are missing billing accounts in the selection dropdown. I think this happens when the available value in the accounts is the same for two or more billing accounts of the same party. -- 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-1101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507876 ] Guido Amarilla commented on OFBIZ-1101: --------------------------------------- The code that generates the list, uses accountAvailable as a key (accountAvailable = accountLimit - accountBalance) , so if the value repeats in more than one billing accounts, it is overwritten, and only the last one is added to the list. in BillingAccountWorker.java line 100: billingAccount.put("accountBalance", new Double(accountBalance)); double accountAvailable = accountLimit - accountBalance; totalAvailable += accountAvailable; sortedAccounts.put(new Double(accountAvailable), billingAccount); .... billingAccountList.addAll(sortedAccounts.values()); ..... return billingAccountList; > Missing Billing Accounts in Dropdown > ------------------------------------ > > Key: OFBIZ-1101 > URL: https://issues.apache.org/jira/browse/OFBIZ-1101 > Project: OFBiz > Issue Type: Bug > Components: accounting > Affects Versions: SVN trunk > Reporter: Guido Amarilla > Priority: Minor > > The dropdown list for billing account selection in Order payment method selection is not populated with all the billing accounts for the customer. There are missing billing accounts in the selection dropdown. > I think this happens when the available value in the accounts is the same for two or more billing accounts of the same party. -- 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-1101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508071 ] Wickersheimer Jeremy commented on OFBIZ-1101: --------------------------------------------- Indeed, and this could be verified easily by doing something like: if (sortedAccounts.put(new Double(accountAvailable), billingAccount) != null) { throw new GeneralException("You trampled a billing account!"); } Unless there is a specific reason for such a behaviour, i guess it should be fixed by using a List, implementing a Comparator, and using Collections.sort(). > Missing Billing Accounts in Dropdown > ------------------------------------ > > Key: OFBIZ-1101 > URL: https://issues.apache.org/jira/browse/OFBIZ-1101 > Project: OFBiz > Issue Type: Bug > Components: accounting > Affects Versions: SVN trunk > Reporter: Guido Amarilla > Priority: Minor > > The dropdown list for billing account selection in Order payment method selection is not populated with all the billing accounts for the customer. There are missing billing accounts in the selection dropdown. > I think this happens when the available value in the accounts is the same for two or more billing accounts of the same party. -- 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-1101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508071 ] Wickersheimer Jeremy edited comment on OFBIZ-1101 at 6/25/07 11:18 PM: ----------------------------------------------------------------------- Indeed, and this could be verified easily by doing something like: if (sortedAccounts.put(new Double(accountAvailable), billingAccount) != null) { throw new GeneralException("You trampled a billing account!"); } Unless there is a specific reason for such a behaviour, i guess it should be fixed by using a List, implementing a Comparator, and using Collections.sort(). PS: preparing a patch with a sortedlist. was: Indeed, and this could be verified easily by doing something like: if (sortedAccounts.put(new Double(accountAvailable), billingAccount) != null) { throw new GeneralException("You trampled a billing account!"); } Unless there is a specific reason for such a behaviour, i guess it should be fixed by using a List, implementing a Comparator, and using Collections.sort(). > Missing Billing Accounts in Dropdown > ------------------------------------ > > Key: OFBIZ-1101 > URL: https://issues.apache.org/jira/browse/OFBIZ-1101 > Project: OFBiz > Issue Type: Bug > Components: accounting > Affects Versions: SVN trunk > Reporter: Guido Amarilla > Priority: Minor > > The dropdown list for billing account selection in Order payment method selection is not populated with all the billing accounts for the customer. There are missing billing accounts in the selection dropdown. > I think this happens when the available value in the accounts is the same for two or more billing accounts of the same party. -- 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-1101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Wickersheimer Jeremy updated OFBIZ-1101: ---------------------------------------- Attachment: ofbiz-1101.patch Here is a patch that may work, i did not test because i don't have any test case... but i guess you have so maybe you can try. > Missing Billing Accounts in Dropdown > ------------------------------------ > > Key: OFBIZ-1101 > URL: https://issues.apache.org/jira/browse/OFBIZ-1101 > Project: OFBiz > Issue Type: Bug > Components: accounting > Affects Versions: SVN trunk > Reporter: Guido Amarilla > Priority: Minor > Attachments: ofbiz-1101.patch > > > The dropdown list for billing account selection in Order payment method selection is not populated with all the billing accounts for the customer. There are missing billing accounts in the selection dropdown. > I think this happens when the available value in the accounts is the same for two or more billing accounts of the same party. -- 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-1101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508115 ] Guido Amarilla commented on OFBIZ-1101: --------------------------------------- Thank you Jeremy! It works fine in this special case. Someone should test with a more standard test case to see if the sorting works fine, but the code looks OK. > Missing Billing Accounts in Dropdown > ------------------------------------ > > Key: OFBIZ-1101 > URL: https://issues.apache.org/jira/browse/OFBIZ-1101 > Project: OFBiz > Issue Type: Bug > Components: accounting > Affects Versions: SVN trunk > Reporter: Guido Amarilla > Priority: Minor > Attachments: ofbiz-1101.patch > > > The dropdown list for billing account selection in Order payment method selection is not populated with all the billing accounts for the customer. There are missing billing accounts in the selection dropdown. > I think this happens when the available value in the accounts is the same for two or more billing accounts of the same party. -- 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-1101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacopo Cappellato reassigned OFBIZ-1101: ---------------------------------------- Assignee: Jacopo Cappellato > Missing Billing Accounts in Dropdown > ------------------------------------ > > Key: OFBIZ-1101 > URL: https://issues.apache.org/jira/browse/OFBIZ-1101 > Project: OFBiz > Issue Type: Bug > Components: accounting > Affects Versions: SVN trunk > Reporter: Guido Amarilla > Assignee: Jacopo Cappellato > Priority: Minor > Attachments: ofbiz-1101.patch > > > The dropdown list for billing account selection in Order payment method selection is not populated with all the billing accounts for the customer. There are missing billing accounts in the selection dropdown. > I think this happens when the available value in the accounts is the same for two or more billing accounts of the same party. -- 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-1101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacopo Cappellato closed OFBIZ-1101. ------------------------------------ Resolution: Fixed Thanks Jeremy, it looks good. Rev. 552487 > Missing Billing Accounts in Dropdown > ------------------------------------ > > Key: OFBIZ-1101 > URL: https://issues.apache.org/jira/browse/OFBIZ-1101 > Project: OFBiz > Issue Type: Bug > Components: accounting > Affects Versions: SVN trunk > Reporter: Guido Amarilla > Assignee: Jacopo Cappellato > Priority: Minor > Attachments: ofbiz-1101.patch > > > The dropdown list for billing account selection in Order payment method selection is not populated with all the billing accounts for the customer. There are missing billing accounts in the selection dropdown. > I think this happens when the available value in the accounts is the same for two or more billing accounts of the same party. -- 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 |