Equation for calculate available to promise is,
Available to Promise (ATP) = On hand + supply - demand