I wanted to bring batch number selection to be in sales module and to enforce any sales done according to the expire date associated to product automatically. The idea is a user select product and quantity to sale,and the system expected to do selection from the right batch, if there is no enough stock available it must does splitting
So far what I managed to do:
- product are sorted by expired date and it automatically selects a product with recent expiry date without any user intervention and notify if not enough stock available
- creates delivery slip to warehouse and sales invoice to finance with that batch number from sales order
However, I am facing these problems
- if current stock quantity of specific product in batch is not enough it should go to second batch and creates to sales order line somehow similar to splitting mechanism exist in warehouse.
- confirmed sales orders doesn't deduct sold product stock quantity from warehouse