|
@@ -707,27 +707,58 @@ if ($object->id > 0)
|
|
|
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("ThirdPartyIsClosed").'</a></div>';
|
|
|
}
|
|
|
|
|
|
- if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer && $object->status==1)
|
|
|
+ if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer)
|
|
|
{
|
|
|
$langs->load("supplier_proposal");
|
|
|
- print '<a class="butAction" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddSupplierProposal").'</a>';
|
|
|
+ if ($object->status == 1)
|
|
|
+ {
|
|
|
+ print '<a class="butAction" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddSupplierProposal").'</a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ print '<a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddSupplierProposal").'</a>';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if ($user->rights->fournisseur->commande->creer && $object->status==1)
|
|
|
+ if ($user->rights->fournisseur->commande->creer)
|
|
|
{
|
|
|
$langs->load("orders");
|
|
|
- print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
|
|
+ if ($object->status == 1)
|
|
|
+ {
|
|
|
+ print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ print '<a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddOrder").'</a>';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if ($user->rights->fournisseur->facture->creer && $object->status==1)
|
|
|
+ if ($user->rights->fournisseur->facture->creer)
|
|
|
{
|
|
|
$langs->load("bills");
|
|
|
- print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
|
|
|
+ if ($object->status == 1)
|
|
|
+ {
|
|
|
+ print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ print '<a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a>';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if ($user->rights->fournisseur->facture->creer && $object->status==1)
|
|
|
+ if ($user->rights->fournisseur->facture->creer)
|
|
|
{
|
|
|
- if (! empty($orders2invoice) && $orders2invoice > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/orderstoinvoice.php?socid='.$object->id.'">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
|
|
+ if (! empty($orders2invoice) && $orders2invoice > 0)
|
|
|
+ {
|
|
|
+ if ($object->status == 1)
|
|
|
+ {
|
|
|
+ print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/orderstoinvoice.php?socid='.$object->id.'">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
|
|
+ }
|
|
|
+ }
|
|
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NoOrdersToInvoice")).'" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
|
|
}
|
|
|
|