diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index c4bb0ace2f2..4d8bc4335e5 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1513,7 +1513,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '';
} else {
print '
';
- print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 'SelectThirdParty');
+ print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3)', 'SelectThirdParty');
// reload page to retrieve customer informations
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
{
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index b1a17f0a1e8..c8e31e78b4f 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -629,19 +629,40 @@ if ($object->id > 0)
if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer)
{
$langs->load("supplier_proposal");
- print ''.$langs->trans("AddSupplierProposal").'';
+ if ($object->status == 1)
+ {
+ print ''.$langs->trans("AddSupplierProposal").'';
+ }
+ else
+ {
+ print ''.$langs->trans("AddSupplierProposal").'';
+ }
}
- if ($user->rights->fournisseur->commande->creer)
+ if ($user->rights->fournisseur->commande->creer)
{
$langs->load("orders");
- print ''.$langs->trans("AddOrder").'';
+ if ($object->status == 1)
+ {
+ print ''.$langs->trans("AddOrder").'';
+ }
+ else
+ {
+ print ''.$langs->trans("AddOrder").'';
+ }
}
if ($user->rights->fournisseur->facture->creer)
{
$langs->load("bills");
- print ''.$langs->trans("AddBill").'';
+ if ($object->status == 1)
+ {
+ print ''.$langs->trans("AddBill").'';
+ }
+ else
+ {
+ print ''.$langs->trans("AddBill").'';
+ }
}
if ($user->rights->fournisseur->facture->creer)
|