I agree with Si. I implemented something quite similar.

Adding billingAcountId to OrderPaymentPreference should be the easiest way to 
go about it.

In fact, I've added similar fields to achieve similar relations to OrderHeader:

1. Multiple invoices for each order.

2. Multiple billing account for each order.

I can't remember what I added for OrderPaymentPreference. But I do remember that I REALLY liked how there can be multiple OrderPaymentPreference(s) per OrderHeader, multiple ways to pay for an order.

And that actually set me thinking about why there were fields like OrderHeader.billingAccountId, which negates the flexibility provided by the OrderHeader-OrderPaymentPreference relation. My thoughts were almost exactly the same as Si Chen's in https://issues.apache.org/jira/browse/OFBIZ-682 .

I can't see any disadvantage to this solution. You will likely have to do some core/important changes to PaymentGatewayServices.java, I think. The only disadvantage, possibly, is that there might be considerable "change propagation" effort if there are a lot of other codes that ASSUME there's only one billing account per order.

Still, I believe it's high time to extend this part of OFBiz to its fullest potential. Nice to be able to pay with multiple billing accounts, since we can already pay with multiple credit cards.

Oh, by the way, there are quite a number of other bugs related to "paying with multiple payment methods" in this area, IIRC. Same as what Si Chen spotted in the JIRA issue. I fixed a lot in the past. Hmm... this one is fresh in my mind: there's a problem with calculating "open amount" for an order.

Jonathon

Rashko Rejmer wrote:
Hi all,

I wanted to ask the community for opinion about ability orders/invoices to
be payed with multiple billing accounts. I research the ml and jira and
found that there are different points of view on this
topic(https://issues.apache.org/jira/browse/OFBIZ-682).
Now I have to implement ability to pay order with more then one billing
accounts and to be able to create invoice from orders that are payed with
different billing accounts.
Now I have to implement ability to pay order with more then one billing
accounts and to be able to create invoice from orders that are payed with
different billing accounts. Personally, I am inclined to agree with Si's opinion that it is be better if
billingAccountId field is located at OrderPaymentPreference entity to
achieve this ability.
I was wondering what are the disadvantages of this idea. I will be happy if
you share your opinion on this with me.

Regards,
Rashko Rejmer

Reply via email to