If I delete a template will it delete all the invoices generated using that template to flats?
No, deleting a template will not delete the invoices generated for flats. The invoices that have already been created are separate from the template and will remain in the system. Deleting the template only removes the predefined structure or layout used for generating new invoices, but it does not affect the data or records of previously issued invoices.