[OFBiz] Users - BSH help?
Chris Howe
cjhowe76013 at yahoo.com
Mon Apr 4 18:24:58 EDT 2005
Both add and put give errors.
put gives
order.put (UtilMisc.toMap("orderList", orderList))
Sourced file (file location) Error in method
invocation: Method put
(org.ofbiz.base.util.utilMisc$SimpleMap) not found in
class'java.util.HashMap
add gives
order.add (UtilMisc.toMap("orderList", orderList))
Sourced file (file location) Error in method
invocation: Method put
(org.ofbiz.base.util.utilMisc$SimpleMap) not found in
class'java.util.HashMap
===========================================
Good catch Jacopo...
Chris: this should have resulted in an error message,
was there one?
-David
On Apr 4, 2005, at 11:31 AM, Jacopo Cappellato wrote:
> Chris,
>
> In the last line, use 'put' instead of 'add':
>
> order.put(UtilMisc.toMap("orderList", orderList));
>
> Jacopo
>
> Chris Howe wrote:
>> I am having the toughest time getting the syntax
>> correct on this. for orderList, I can't get the
>> iterated result to add to the Hashmap.
>> import org.ofbiz.base.util.*;
>> import org.ofbiz.entity.*;
>> import org.ofbiz.entity.util.*;
>> import org.ofbiz.accounting.payment.*;
>> import org.ofbiz.party.contact.*;
>> import org.ofbiz.product.store.*;
>> requestParams = UtilHttp.getParameterMap(request);
>> delegator = request.getAttribute("delegator");
>> userLogin = session.getAttribute("userLogin");
>> if (userLogin != null && userLogin != "") {
>> billingAccountRoleList =
>> delegator.findByAnd("BillingAccountRole",
>> UtilMisc.toMap("partyId",
>> userLogin.getString("partyId"), "roleTypeId",
>> "APPROVING_CUSTOMER"));
>> billingAccountRoleList =
>> EntityUtil.filterByDate(billingAccountRoleList);
>> if (billingAccountRoleList != null &&
>> billingAccountRoleList.size() > 0) {
>> totalAvailable = 0.00;
>> sortedAccounts = new TreeMap();
>> billingAcctIter =
>> billingAccountRoleList.iterator();
>> while (billingAcctIter.hasNext()) {
>> billingAccountRole =
billingAcctIter.next();
>> billingAccountVO =
>> billingAccountRole.getRelatedOne("BillingAccount");
>> accountBalance =
>>
BillingAccountWorker.getBillingAccountBalance(billingAccountVO);
>>
>> billingAccount = new
>> HashMap(billingAccountVO);
>> accountLimit =
>>
billingAccountVO.getDouble("accountLimit").doubleValue();
>>
billingAccount.put("accountBalance", new
>> Double(accountBalance));
accountAvailable = accountLimit -
>> accountBalance;
>> totalAvailable += accountAvailable;
>> sortedAccounts.put(new
>> Double(accountAvailable), billingAccount);
>> }
>> billingAccountList = new
>> ArrayList(sortedAccounts.values());
>> context.put("billingAccountList",
>> billingAccountList); }
>> if (billingAccountList.size() > 0){
>> accountListIter = billingAccountList.iterator();
>> order = new HashMap();
>> while (accountListIter.hasNext()){
>> orderLists = accountListIter.next();
>> billingAccountId =
>> orderLists.get("billingAccountId");
>> orderList = delegator.findByAnd("OrderHeader",
>> UtilMisc.toMap("billingAccountId",
billingAccountId,
>> "statusId", "ORDER_CREATED"));
>> context.put("orderList", orderList);
>> order.add(UtilMisc.toMap("orderList",
orderList));
>> }
>> }
>> }
>> }
>> ===========================
>> any help would be greatly apprciated
>>
>> __________________________________ Yahoo! Messenger
Show us what our
>> next emoticon should look like. Join the fun.
>>
http://www.advision.webevents.yahoo.com/emoticontest
>> _______________________________________________
>> Users mailing list
>> Users at lists.ofbiz.org
>> http://lists.ofbiz.org/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.ofbiz.org
> http://lists.ofbiz.org/mailman/listinfo/users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2363 bytes
Desc: not available
__________________________________
Do you Yahoo!?
Yahoo! Personals - Better first dates. More second dates.
http://personals.yahoo.com
More information about the Users
mailing list