Stock deduction error

Withdrawing stock irrespective of batch.

Explanation : In few cases while entering sales invoices System is withdrawing stock from the warehouse irrespective of the batch and purchase timing