Here If we have both type of medicine is there then 
For Batch wise medicine it takes quantity from batch
For Non Batch it takes Available quantity.
And It is working fine. we have checked that before.