In your exact situation (transfers between two divisions of an organisation
where the same Ofbiz system is used by both), there is really no such thing
as a "purchase" or a "sales" order, just an order. Whether it is a purchase
or a sale depends on the perspective of the user.

Fundamentally, the Ofbiz data model has this right. There is just one Order
entity. However, there are several places in Ofbiz that give different
behaviour depending on the order type. A quick way to see this is to grep
for SALES_ORDER. One that has been a specific problem for me is that sales
tax only applies to sales orders. In countries that have a VAT or GST, tax
applies to purchases as well. To my mind, looking at the order type for a
purchase or sales is just a proxy for who the parties are - in other words,
is this order an input or an output for our organization?

In your case, you might infer that the order is a transfer if *both* parties
are internal organizations. You can determine if the order is a "sales" or a
"purchase" from the perspective of the current user by checking what
relationship that user has with one or the other of the parties.

I have written some code in a customised version of the calcTax service to
infer if an order is a purchase or sale based om which of the two parties is
an internal organisation. I don't have to worry about transfers, so I
haven't done anything about the "both internal" situation. I can send you my
code if that's of interest.

I suspect you will have to customise Ofbiz to make transfers work. If you
do, bear in mind that some organizations might use real money for transfers
between divisions, where if I understand you correctly your doesn't.

Cheers

Paul Foxworthy
-- 
View this message in context: 
http://ofbiz.135035.n4.nabble.com/Transfer-Orders-TOs-tp153639p3250452.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Reply via email to