Fixes for Invoice Email
This commit is contained in:
@@ -103,7 +103,8 @@ class InvoiceController extends mfBaseController {
|
||||
$pdf = $ifile->file;
|
||||
}
|
||||
|
||||
$filename = $pdf->getFullPath();
|
||||
$pdf_path = $pdf->getFullPath();
|
||||
$filename = $pdf->filename;
|
||||
|
||||
if(!file_exists($filename)) {
|
||||
$this->layout()->setFlash("PDF-Datei nicht gefunden");
|
||||
@@ -113,10 +114,10 @@ class InvoiceController extends mfBaseController {
|
||||
header('Content-disposition: attachment; filename="'.$filename.'"');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||
header('Content-Type: ' . mime_content_type($filename));
|
||||
header("Content-Length: " . filesize($filename));
|
||||
header('Content-Type: ' . mime_content_type($pdf_path));
|
||||
header("Content-Length: " . filesize($pdf_path));
|
||||
|
||||
readfile($filename);
|
||||
readfile($pdf_path);
|
||||
exit;
|
||||
|
||||
/*$vat = [];
|
||||
@@ -725,6 +726,11 @@ class InvoiceController extends mfBaseController {
|
||||
continue;
|
||||
}
|
||||
|
||||
if($invoice->total == 0) {
|
||||
echo "Skipping ".$invoice->invoice_number." because total is zero\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!$invoice->sendByEmail()) {
|
||||
echo "Error sending ".$invoice->invoice_number." to ".$invoice->email."\n";
|
||||
continue;
|
||||
|
||||
@@ -315,6 +315,21 @@ class InvoiceModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("billing_type", $filter)) {
|
||||
$billing_type = $db->escape($filter['billing_type']);
|
||||
if($billing_type) {
|
||||
$where .= " AND Invoice.billing_type LIKE '$billing_type'";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("billing_delivery", $filter)) {
|
||||
$billing_delivery = $db->escape($filter['billing_delivery']);
|
||||
if($billing_delivery) {
|
||||
$where .= " AND Invoice.billing_delivery LIKE '$billing_delivery'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (array_key_exists("company", $filter)) {
|
||||
$company = FronkDB::singleton()->escape($filter["company"]);
|
||||
if ($company) {
|
||||
|
||||
Reference in New Issue
Block a user