How to create E-invoice using E-way bill details?

If you first create an E-invoice and later generate the E-way bill for the same transaction, the system will automatically fetch the E-way bill details and reflect both E-way bill and E-invoice details in the invoice PDF.