Stock Ledger showing ledger for the Batch Wise

Stock Ledger Showing incorrect balance qty.

In Stock balance, it shows properly…

While making the transaction 38 Qty Batch says only 2 qty is available.