Page 1 of 1

Merging 2 items

PostPosted: Wed Aug 31, 2016 5:14 pm
by perry
Hi,

Jiwa 7.0.157

The task is to merge 2 items into 1.
We built SQL script that updates all inventory ID field on transactional tables (soh, so_lines, po_lines etc etc) from A to B.
Then user can delete the item A from inventory maintenance screen.

Currently I'm having issue with "PO_Lines.IN_SupplierWarehouse_RecID". Ideally I will need to update that with item B's IN_SupplierWarehouse_RecID, however, I'm not sure what logic should I use or it even matters if I just set it to Null...

The logic I'm thinking is (from Item B)
- find region the PO is in,
- find creditor on PO
- find the default supplier warehouse record

I can think of all sorts of exceptions from logic above, e.g. region order not enabled, no default supplier setup etc etc. In those case, I would just have use NULL.

My question how PO is using that ID and what if, the field value is NULL on open POs.

Re: Merging 2 items  Topic is solved

PostPosted: Sat Nov 12, 2016 4:07 pm
by Mike.Sheen
perry wrote:My question how PO is using that ID and what if, the field value is NULL on open POs.


When items are added to a PO we use the IN_SupplierWarehouse record to work out the cost to use and the order units. Also some reports may rely on that being a valid (non-null). Modifying an order quantity on a saved PO will refer back to the IN_SupplierWarehouse_RecID.

In your case, I'd update it to be the IN_SupplierWarehouse.RecID of the new item where the creditor (IN_Creditor.CreditorID) matches that of the old item - if none match, then use the default IN_SupplierWarehouse record for the default IN_Creditor record of the new item.

I advise against NULLs. I believe we allow NULLs on that column of PO_Lines to cater for Warehouse PO's - Supplier PO's probably need that, however.

Mike

Re: Merging 2 items

PostPosted: Mon Nov 14, 2016 3:59 pm
by perry
Great!! I knew I raised this issue somewhere but just couldn't remember where.

We had an error on activation of a purchase invoice recently and the issue is caused by IN_SupplierWarehouse_RecID being NULL.