shipping address on P.O. uses first not current

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

shipping address on P.O. uses first not current

joelfradkin@gmail.com
I think this might be a bug?
If I modify the facility address it does not change on the P.O.

It is using orderview.groovy.
and gets the shipping address as shippingAddress = orderReadHelper.getShippingAddress();

Having just done a front end for editing this address I found it a bit of a challenge because I had to have the most current contachmech for the facility (I cheated and just called the facility page so it could load the proper contactmechID for me).

I am not sure where or what these helpers are? I guess they are services, but thought I would ask if there is some generic helper class, or if each one is specific to it use, for example I should be able to find some java where the getshipping is implemented and see if I can figure out how to get the proper mechId. I should of done that for my edit screen as its pretty cheesy having it go to another screen and use java script to press the button to update the address. AL I would have to do is get the latest mech ID and I could call the edit screen directly.

Any how if any one else confirms this is an issue (I have not messed up the data or the screens in some way) it should probably be written up in jirra.
Joel Fradkin
Reply | Threaded
Open this post in threaded view
|

Re: shipping address on P.O. uses first not current

joelfradkin@gmail.com
Okay I figured out part of my issue.
It is self inflicted. In my Purchase order I do not call the  screen setting the ship group.
I tried in Ofbiz and it works fine. I looked at java code and could see it was just pulling by mechid.
I figured I must have the wrong ID. I did not realize that it keeps the ID from when it is created.
I am not sure that is a great idea. If the user changes the facility address, you would want the P.O. to reflect the latest. I was not even sure why we were keeping history of addresses (not sure there is a GUI to review them etc, but obviously needed for this type of functionality, just not sure I am buying it as the proper way to deal with address updates).
Joel Fradkin
Reply | Threaded
Open this post in threaded view
|

Re: shipping address on P.O. uses first not current

Adrian Crum-3
The reason for the history is to model the real world. A contact
mechanism remains constant, but the party related to that contact
mechanism changes over time.

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 10/2/2014 3:44 PM, [hidden email] wrote:

> Okay I figured out part of my issue.
> It is self inflicted. In my Purchase order I do not call the  screen setting
> the ship group.
> I tried in Ofbiz and it works fine. I looked at java code and could see it
> was just pulling by mechid.
> I figured I must have the wrong ID. I did not realize that it keeps the ID
> from when it is created.
> I am not sure that is a great idea. If the user changes the facility
> address, you would want the P.O. to reflect the latest. I was not even sure
> why we were keeping history of addresses (not sure there is a GUI to review
> them etc, but obviously needed for this type of functionality, just not sure
> I am buying it as the proper way to deal with address updates).
>
>
>
> -----
> Joel Fradkin
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/shipping-address-on-P-O-uses-first-not-current-tp4656407p4656410.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: shipping address on P.O. uses first not current

joelfradkin@gmail.com
In reply to this post by joelfradkin@gmail.com
I found I had hard coded the ID.
I did not realize it changed every time it was updated, so I figured since I was not exposing facility and had the number in seed I could use it.
I changed it to.
           facilityId = "WebStoreWarehouse";
           List<Map<String,Object>> valueMaps =         ContactMechWorker.getFacilityContactMechValueMaps(delegator, facilityId, false, null);
           for (Map<String, Object> thisMap: valueMaps) {
                GenericValue contactMech = (GenericValue) thisMap.get("contactMech");
                shippingContactMechId = contactMech.getString("contactMechId");
           }
Not sure if this is the easiest way, I put this together looking at the screen and mixing groovy code ideas but using java in the end.
I might go fix my edit address screens since I now can get the mechid, but I would have to lookup how to do it for the company mechid as well since I did two seperate edit screens, one for facility I called shipping address and one for company I called company address.
Joel Fradkin