Corrected invoice generation issue