Preparation of biofertilizers