You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Nicolas Malin <ni...@nereide.fr> on 2017/05/02 06:59:58 UTC

Re: How to Filter Out Identical Billing and Shipping Addresses?

If you postalAddress creation respect the ContactMechPurpose partner, 
you have only one address with two purposes *billing* and *shipping*.

So the problem would don't exist.

:) please check you postal address creation

Nicolas


Le 28/04/2017 à 15:30, Prakhar Kumar a écrit :
> My requirement is to display billing and shipping addresses of the customer
> during checkout. But I want to avoid identical addresses from getting
> displayed. This can be simply achieved by putting some checks on the front
> end but it's not that elegant. So, Is there any way to do it more
> efficiently in Ofbiz?
>


Re: How to Filter Out Identical Billing and Shipping Addresses?

Posted by Prakhar Kumar <pr...@hotwaxsystems.com>.
Thanks, Nicolas and Aditya for pointing in the right direction :)

On Wed, May 3, 2017 at 10:43 AM, Aditya Sharma <
aditya.sharma@hotwaxsystems.com> wrote:

> Hi Prakhar,
>
> I think you can use methods of EntityUtil class here. There are many useful
> methods available there.
>
> <http://goog_1018801742>
> https://ci.apache.org/projects/ofbiz/site/javadocs/org/ofbiz/entity/util/
> EntityUtil.html
>
> For example, One way can be that
> 1. You get contactMechId of all the address associated with given partyId &
> with contactMechPurposeTypeId (Billing and Shipping location)
> 2. Filter them out according to its contactMechPurposeTypeId using
> filterByCondition() or filterByAnd() for the first list
> 3. FilterOutByCondition() to remove all those already in first list for the
> second one.
>
> It will avoid multiple entity hits and may serve the purpose.
>
> Though it is just an example, there may be some other possibility depending
> upon your exact scenario.
>
> Thanks & Regards,
> Aditya Sharma
> Enterprise Software Engineer
> HotWax Systems Pvt. Ltd.
> http://www.hotwaxsystems.com/
>
>       <https://www.linkedin.com/in/aditya-sharma-78291810a/>
>
> On Tue, May 2, 2017 at 12:29 PM, Nicolas Malin <ni...@nereide.fr>
> wrote:
>
> > If you postalAddress creation respect the ContactMechPurpose partner, you
> > have only one address with two purposes *billing* and *shipping*.
> >
> > So the problem would don't exist.
> >
> > :) please check you postal address creation
> >
> > Nicolas
> >
> >
> >
> > Le 28/04/2017 à 15:30, Prakhar Kumar a écrit :
> >
> >> My requirement is to display billing and shipping addresses of the
> >> customer
> >> during checkout. But I want to avoid identical addresses from getting
> >> displayed. This can be simply achieved by putting some checks on the
> front
> >> end but it's not that elegant. So, Is there any way to do it more
> >> efficiently in Ofbiz?
> >>
> >>
> >
>



-- 
Thanks and Regards
Prakhar Kumar
Enterprise Software Engineer
HotWax Systems

Re: How to Filter Out Identical Billing and Shipping Addresses?

Posted by Aditya Sharma <ad...@hotwaxsystems.com>.
Hi Prakhar,

I think you can use methods of EntityUtil class here. There are many useful
methods available there.

<http://goog_1018801742>
https://ci.apache.org/projects/ofbiz/site/javadocs/org/ofbiz/entity/util/
EntityUtil.html

For example, One way can be that
1. You get contactMechId of all the address associated with given partyId &
with contactMechPurposeTypeId (Billing and Shipping location)
2. Filter them out according to its contactMechPurposeTypeId using
filterByCondition() or filterByAnd() for the first list
3. FilterOutByCondition() to remove all those already in first list for the
second one.

It will avoid multiple entity hits and may serve the purpose.

Though it is just an example, there may be some other possibility depending
upon your exact scenario.

Thanks & Regards,
Aditya Sharma
Enterprise Software Engineer
HotWax Systems Pvt. Ltd.
http://www.hotwaxsystems.com/

      <https://www.linkedin.com/in/aditya-sharma-78291810a/>

On Tue, May 2, 2017 at 12:29 PM, Nicolas Malin <ni...@nereide.fr>
wrote:

> If you postalAddress creation respect the ContactMechPurpose partner, you
> have only one address with two purposes *billing* and *shipping*.
>
> So the problem would don't exist.
>
> :) please check you postal address creation
>
> Nicolas
>
>
>
> Le 28/04/2017 à 15:30, Prakhar Kumar a écrit :
>
>> My requirement is to display billing and shipping addresses of the
>> customer
>> during checkout. But I want to avoid identical addresses from getting
>> displayed. This can be simply achieved by putting some checks on the front
>> end but it's not that elegant. So, Is there any way to do it more
>> efficiently in Ofbiz?
>>
>>
>