The dynamical scattering amplitude of an imperfect crystal