Hi,
I really think we should refactor the OrderItemAssociation entity, in
order to make it more generic.
Right now the entity has the following fields:
<field name="salesOrderId" type="id-ne"/>
<field name="soItemSeqId" type="id-ne"/>
<field name="purchaseOrderId" type="id-ne"/>
<field name="poItemSeqId" type="id-ne"/>
I think that we should at least modify them in this way:
<field name="orderId" type="id-ne"/>
<field name="orderItemSeqId" type="id-ne"/>
<field name="orderIdTo" type="id-ne"/>
<field name="orderItemSeqIdTo" type="id-ne"/>
<field name="orderItemAssocTypeId" type="id-ne"/>
We should also rename it to "OrderItemAssoc" and create the new entity
"OrderItemAssocType".
In this way we could link not just a sales order to a purchase order,
but also two sales orders together (for example a replacement order).
I think we should also add the ability to associate sub-item quantities,
maybe adding an OrderItemAssoc.quantity field and adding two
OrderItemAssoc.shipGroupSeqId and OrderItemAssoc.shipGroupSeqIdTo.
So the final entity should look like:
OrderItemAssoc
<field name="orderId" type="id-ne"/> PK
<field name="orderItemSeqId" type="id-ne"/> PK
<field name="shipGroupSeqId" type="id-ne"/> PK
<field name="orderIdTo" type="id-ne"/> PK
<field name="orderItemSeqIdTo" type="id-ne"/> PK
<field name="shipGroupSeqIdTo" type="id-ne"/> PK
<field name="orderItemAssocTypeId" type="id-ne"/> PK
<field name="quantity" type="floating-point"/>
Does it make sense?
If it's ok for all of you, I could take care of this migration since I'm
working on the return of type "replacement" and on drop shipments and
I'll need some of this features soon.
Jacopo