Added Child ID on receive and dispatch detail separately. Now the allocation commodity ID is the child commodity ID and and the parent is searched and saved as commodity ID on both tables.