diff --git a/adm/pdf.php b/adm/pdf.php index b1494b1f..4ec5cef6 100755 --- a/adm/pdf.php +++ b/adm/pdf.php @@ -148,14 +148,18 @@ function generateInvoicesPDFPrivateSales48hBis() AND (s.delivery_delay != 2 AND s.delivery_delay != 6) '); if (!empty($orders2)) { - foreach ($orders2 as $key => $order) { + foreach ($orders as $key => $order) { if (in_array($order, $orders)) { - unset($orders2[$key]); + unset($orders[$key]); } } } - PDF::multipleInvoices2($orders, $orders2, true, true); + if (!empty($orders2)) { + PDF::multipleInvoices2($orders, $orders2, true, true); + } else { + PDF::multipleInvoices($orders, false, true, true); + } } } }