#287|Sandeep| calculating max stock quantity first before as it is required for calculating order quantity .