You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Marcus Peixoto <ma...@yahoo.com.br> on 2012/04/16 22:58:24 UTC

Problem when creating a Purchase Order from requirements

I need some advice with the following issue. Can somebody help me, please? 

 

I’m trying to generate a Purchase Order in USD currency from requirements generated by a store using BRL: 

 

-    A customer Buys in BRL in a Brazilian store (facility 1), through Sales Order. 

-    The Brazilian Store generates requirements for US store (facility 2). 

 

So far so good. 

But when I try to create a Purchase Order based on the requirements, the system gives me a message “SupplierProduct” not found. 

 

After check everything out, prices, facilities, range dates, having no success, I decided to debug it. 

 

And for my surprise, I realized that the Shopping Cart’s currency is being defined based on HTTP locale and not on the parties currencyUomId. 

 

Is this right? 

 

 

package org.ofbiz.order.shoppingcart;

public class ShoppingCartEvents {

    public static String quickInitPurchaseOrder(HttpServletRequest request, HttpServletResponse response) {

        Delegator delegator = (Delegator) request.getAttribute("delegator");

        LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");

        HttpSession session = request.getSession();

        Locale locale = UtilHttp.getLocale(request);

 

        ShoppingCart cart = new WebShoppingCart(request);

        // TODO: the code below here needs some cleanups

 

……

 

 

 

I tried with 9.04 version and now with the recently lauched 10.04.x.  

What else can I try? 

 

Thank you! 

 

 


RE: Problem when creating a Purchase Order from requirements

Posted by Marcus Peixoto <ma...@yahoo.com.br>.
Hi Deepika,   

Thanks for your answer, 
I had already done all these things. The products had a supplier and their correct prices associated, in USD and BRL. The products also had facilities associated. The range dates were correct. All roles had been set up as well. 

But the currency.uom.id.default in general.properties was set to BRL. 
When I commented it out the system started to work fine, I mean, using its multi-currency feature correctly. 

Best regards,

Marcus Peixoto



-----Original Message-----
From: Deepika1 S [mailto:deepika1.s@tcs.com] 
Sent: Tuesday, April 17, 2012 2:27 AM
To: Marcus Peixoto
Cc: user@ofbiz.apache.org
Subject: Re: Problem when creating a Purchase Order from requirements

Hi Marcus,

I think you need to add the product  in the SupplierProduct entity, since 
it has the mapping between the supplier partyId and the product. There you 
have a column called currencyUomId, make it USD or EUR depending on the 
currency in which the supplier is going to sell the product.
Let me know if any further queries.

Regards,
Deepika




From:
"Marcus Peixoto" <ma...@yahoo.com.br>
To:
<us...@ofbiz.apache.org>
Date:
04/17/2012 02:31 AM
Subject:
Problem when creating a Purchase Order from requirements



I need some advice with the following issue. Can somebody help me, please? 


 

I’m trying to generate a Purchase Order in USD currency from requirements 
generated by a store using BRL: 

 

-    A customer Buys in BRL in a Brazilian store (facility 1), through 
Sales Order. 

-    The Brazilian Store generates requirements for US store (facility 2). 


 

So far so good. 

But when I try to create a Purchase Order based on the requirements, the 
system gives me a message “SupplierProduct” not found. 

 

After check everything out, prices, facilities, range dates, having no 
success, I decided to debug it. 

 

And for my surprise, I realized that the Shopping Cart’s currency is being 
defined based on HTTP locale and not on the parties currencyUomId. 

 

Is this right? 

 

 

package org.ofbiz.order.shoppingcart;

public class ShoppingCartEvents {

    public static String quickInitPurchaseOrder(HttpServletRequest 
request, HttpServletResponse response) {

        Delegator delegator = (Delegator) 
request.getAttribute("delegator");

        LocalDispatcher dispatcher = (LocalDispatcher) 
request.getAttribute("dispatcher");

        HttpSession session = request.getSession();

        Locale locale = UtilHttp.getLocale(request);

 

        ShoppingCart cart = new WebShoppingCart(request);

        // TODO: the code below here needs some cleanups

 

……

 

 

 

I tried with 9.04 version and now with the recently lauched 10.04.x. 

What else can I try? 

 

Thank you! 

 

 




=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you




-----
Nenhum vírus encontrado nessa mensagem.
Verificado por AVG - www.avgbrasil.com.br
Versão: 2012.0.1913 / Banco de dados de vírus: 2411/4940 - Data de Lançamento: 04/16/12


Re: Problem when creating a Purchase Order from requirements

Posted by Deepika1 S <de...@tcs.com>.
Hi Marcus,

I think you need to add the product  in the SupplierProduct entity, since 
it has the mapping between the supplier partyId and the product. There you 
have a column called currencyUomId, make it USD or EUR depending on the 
currency in which the supplier is going to sell the product.
Let me know if any further queries.

Regards,
Deepika




From:
"Marcus Peixoto" <ma...@yahoo.com.br>
To:
<us...@ofbiz.apache.org>
Date:
04/17/2012 02:31 AM
Subject:
Problem when creating a Purchase Order from requirements



I need some advice with the following issue. Can somebody help me, please? 


 

I’m trying to generate a Purchase Order in USD currency from requirements 
generated by a store using BRL: 

 

-    A customer Buys in BRL in a Brazilian store (facility 1), through 
Sales Order. 

-    The Brazilian Store generates requirements for US store (facility 2). 


 

So far so good. 

But when I try to create a Purchase Order based on the requirements, the 
system gives me a message “SupplierProduct” not found. 

 

After check everything out, prices, facilities, range dates, having no 
success, I decided to debug it. 

 

And for my surprise, I realized that the Shopping Cart’s currency is being 
defined based on HTTP locale and not on the parties currencyUomId. 

 

Is this right? 

 

 

package org.ofbiz.order.shoppingcart;

public class ShoppingCartEvents {

    public static String quickInitPurchaseOrder(HttpServletRequest 
request, HttpServletResponse response) {

        Delegator delegator = (Delegator) 
request.getAttribute("delegator");

        LocalDispatcher dispatcher = (LocalDispatcher) 
request.getAttribute("dispatcher");

        HttpSession session = request.getSession();

        Locale locale = UtilHttp.getLocale(request);

 

        ShoppingCart cart = new WebShoppingCart(request);

        // TODO: the code below here needs some cleanups

 

……

 

 

 

I tried with 9.04 version and now with the recently lauched 10.04.x. 

What else can I try? 

 

Thank you! 

 

 




=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



RE: Problem when creating a Purchase Order from requirements

Posted by Marcus Peixoto <ma...@yahoo.com.br>.
With some more debugging I could understand how multi currency works in ofBiz. 
All that I had to do was comment out currency.uom.id.default in general.properties. 

Regards, 


Marcus Peixoto 



-----Original Message-----
From: Marcus Peixoto [mailto:marcuspeixoto@yahoo.com.br] 
Sent: Monday, April 16, 2012 5:58 PM
To: user@ofbiz.apache.org
Subject: Problem when creating a Purchase Order from requirements

I need some advice with the following issue. Can somebody help me, please? 

 

I’m trying to generate a Purchase Order in USD currency from requirements generated by a store using BRL: 

 

-    A customer Buys in BRL in a Brazilian store (facility 1), through Sales Order. 

-    The Brazilian Store generates requirements for US store (facility 2). 

 

So far so good. 

But when I try to create a Purchase Order based on the requirements, the system gives me a message “SupplierProduct” not found. 

 

After check everything out, prices, facilities, range dates, having no success, I decided to debug it. 

 

And for my surprise, I realized that the Shopping Cart’s currency is being defined based on HTTP locale and not on the parties currencyUomId. 

 

Is this right? 

 

 

package org.ofbiz.order.shoppingcart;

public class ShoppingCartEvents {

    public static String quickInitPurchaseOrder(HttpServletRequest request, HttpServletResponse response) {

        Delegator delegator = (Delegator) request.getAttribute("delegator");

        LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");

        HttpSession session = request.getSession();

        Locale locale = UtilHttp.getLocale(request);

 

        ShoppingCart cart = new WebShoppingCart(request);

        // TODO: the code below here needs some cleanups

 

……

 

 

 

I tried with 9.04 version and now with the recently lauched 10.04.x.  

What else can I try? 

 

Thank you! 

 

 




-----
Nenhum vírus encontrado nessa mensagem.
Verificado por AVG - www.avgbrasil.com.br
Versão: 2012.0.1913 / Banco de dados de vírus: 2411/4940 - Data de Lançamento: 04/16/12