Linear and nonlinear optical properties of borate crystals as calculated from the first principles