Go to customize form,select that doctype (Sales Invoice/ Purchase Invoice) and tick hidden check-box of particular field which you want to hide from form and update form.
Please consider attached screen shot for reference . In customize form i have selected Sales Invoice form and open the row of field which you want to hide, in permissions section hidden check-box is there just check this box and update form.