From 0080821dc5b4a3c40f7f5ddf5b8cd12f267c4983 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Apr 2017 16:05:54 +0200 Subject: [PATCH] Fix no invoice if not a customer --- htdocs/comm/card.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 4d4d50a1979..d5d11941b23 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1030,11 +1030,14 @@ if ($id > 0) if (! empty($conf->commande->enabled)) { - if (! empty($orders2invoice) && $orders2invoice > 0) print '
'.$langs->trans("CreateInvoiceForThisCustomer").'
'; - else print '
'.$langs->trans("CreateInvoiceForThisCustomer").'
'; + if ($object->client != 0 && $object->client != 2) + { + if (! empty($orders2invoice) && $orders2invoice > 0) print '
'.$langs->trans("CreateInvoiceForThisCustomer").'
'; + else print '
'.$langs->trans("CreateInvoiceForThisCustomer").'
'; + } + else print '
'.$langs->trans("AddBill").'
'; } - - if ($object->client != 0) print '
'.$langs->trans("AddBill").'
'; + if ($object->client != 0 && $object->client != 2) print '
'.$langs->trans("AddBill").'
'; else print '
'.$langs->trans("AddBill").'
'; }