small InvoiceJob update
This commit is contained in:
@@ -904,23 +904,29 @@ class InvoiceController extends mfBaseController {
|
||||
try {
|
||||
$pdf_file = $pdf->getFullPath();
|
||||
} catch (Exception $e) {
|
||||
$this->log->error("File for Invoice ".$invoice->id." not found");
|
||||
$this->log->error(__METHOD__.": File for Invoice ".$invoice->id." not found");
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!file_exists($pdf_file)) {
|
||||
//echo "Datei ".$pdf->filename." nicht gefunden\n";
|
||||
$this->log->error(__METHOD__.": Datei ".$pdf->filename." nicht gefunden");
|
||||
continue;
|
||||
}
|
||||
|
||||
if($invoice->total == 0) {
|
||||
//echo "Skipping ".$invoice->invoice_number." because total is zero\n";
|
||||
$this->log->info(__METHOD__.": Skipping ".$invoice->invoice_number." because total is zero");
|
||||
$invoice->date_delivered = date("U");
|
||||
$invoice->save();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!$invoice->sendByEmail()) {
|
||||
$this->log->warning("Error sending ".$invoice->invoice_number." to ".$invoice->email);
|
||||
$this->log->warning(__METHOD__.": Error sending ".$invoice->invoice_number." to ".$invoice->email);
|
||||
$invoice->date_delivered = date("U");
|
||||
$invoice->save();
|
||||
continue;
|
||||
}
|
||||
|
||||
$invoice->date_delivered = date("U");
|
||||
$invoice->save();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user