diff --git a/classes/order/OrderInvoice.php b/classes/order/OrderInvoice.php index 9c4d4ebbf907c..c0ef8303f0b25 100644 --- a/classes/order/OrderInvoice.php +++ b/classes/order/OrderInvoice.php @@ -163,7 +163,7 @@ public static function getInvoiceByNumber($invoiceNumber, $orderId = null) $id_order_invoice = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue( 'SELECT `id_order_invoice` FROM `' . _DB_PREFIX_ . 'order_invoice` - WHERE `number` = ' . (int) $invoiceNumber . (!empty($id_order) ? ' && `id_order` = ' . (int) $id_order : '') + WHERE `number` = ' . (int) $invoiceNumber . (!empty($orderId) ? ' AND `id_order` = ' . (int) $orderId : '') ); return $id_order_invoice ? new OrderInvoice((int) $id_order_invoice) : false;