!$opt->{resend}?' invoices.sent_date is null ':(),
@ -403,7 +404,7 @@ sub generate_invoice_data{
$logger->debug("generated data for invoice.id=".$invoice->{id}."; invoice.serial=".$invoice->{serial}.";\n");
$invoice->{data}=$pdf;
#set sent_date to null after each data regeneration
$dbh->do('update invoices set sent_date=?,data=?,amount_net=?,amount_vat=?,amount_total=? where id=?',undef,undef,@$invoice{qw/data amount_net amount_vat amount_total id/});
$dbh->do('update invoices set sent_date=?,data=?,amount_net=?,amount_vat=?,amount_total=? where id=?',undef,undef,@$invoice{qw/data amount_net amount_vat amount_total id/});
return$invoice;
}
@ -534,7 +535,10 @@ sub get_email_template{
}
return$res;
}
subget_invoice_data{
my($invoice,$data_ref)=@_;
$$data_ref=$dbh->selectrow_array('select data from invoices where id=?',undef,$invoice->{id});
}
subemail{
#todo: repeat my old function based on templates and store into utils