diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index a639fea53ea6346a2ddc79acdb247e95dc4b4e6e..d37cb327ec55c88e835aa765e3b92707f944245c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1007,7 +1007,15 @@ if ($id > 0) if (! empty($conf->facture->enabled)) { - if ($user->rights->facture->creer && $object->status==1) + if (empty($user->rights->facture->creer)) + { + print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>'; + } + else if ($object->status != 1) + { + print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a></div>'; + } + else { $langs->load("bills"); $langs->load("orders"); @@ -1022,10 +1030,6 @@ if ($id > 0) else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>'; } - else - { - print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>'; - } } } diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 553e4d884e82bfada93b3dc39670f188dad2647b..49c409d81e8491c97463c68f8036377bdcb02b3d 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -388,6 +388,7 @@ LastModifiedThirdParties=Latest %s modified third parties UniqueThirdParties=Total of unique third parties InActivity=Open ActivityCeased=Closed +ThirdPartyIsClosed=Third party is closed ProductsIntoElements=List of products/services into %s CurrentOutstandingBill=Current outstanding bill OutstandingBill=Max. for outstanding bill