Extended kinetic theory for granular flow over and within an inclined erodible bed