Don't generate invoice if file already exists

This commit is contained in:
Chris Lowis 2022-05-25 11:43:09 +01:00
parent 798c769ddf
commit be00aefb4c
1 changed files with 2 additions and 0 deletions

View File

@ -60,6 +60,8 @@ members.each_with_index do |member, index|
output_html_fn = File.join(output_dir, invoice.basename + '.html')
output_pdf_fn = File.join(output_dir, invoice.basename + '.pdf')
next if File.exist?(output_html_fn)
File.write(output_html_fn, result)
system("wkhtmltopdf #{output_html_fn} #{output_pdf_fn}")