Boundary transfer matrices and boundary quantum KZ equations