Analytical account for the off-axis effects and undulator field harmonics in FELs