The Transactions should be item 1 qty 1 have batch IV_101231a, item 1 qty 1 have batch IV_101231b, but there are human error in Sales Order user picked same batch number IV_101231a for 2 (quantity) item 1 (which should item 1 qty 1 with batch number IV_101231a and item 1 qty 1 with batch number IV_101231b)
and the question is why there is no validation pick item with negative quantity? and about the cost price? cause the item was sold
You can restrict this - in the Inventory Dimension Group attached to that item
In Dimension Group - for batch number - select Physical Inventory and Financial Inventory.
then system will take only onhand of that particular batch number and it will validate.
If you don’t use this setup the system will only check whether the qty is available at the site/warehouse (if the setup is done for warehouse) level and it will not validate for individual batch number.
To rectify this entry go to Items Master - Functions - Edit Dimensions - in the issues grid - change the batch number to the original
(or) transfer the qty from one batch number to another batch number by using transfer journal.
You will have to do some changes to the dimension group and there will be restrictions because of the transactions, you could create a new one and change it but you would need to test the impact, as this is not recommended, what would be is to remove all stock, all open transactions, change the dimension group and reload.
Go the Sales Order Line which you want to reverse - then Quantity column.
In the Receive now column - put the quantity in negative - now the invoice button will be enabled - post the invoice by changing the Quantity parameter to receive now. The system will post required reverse entries into finance. The status will be changed to open order. Now create sales order lines with correct data and post the invoice.