diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 00353678624..d91ff28b6d9 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -182,9 +182,7 @@ if ($_GET["action"] == 'add_ligne') /* * */ -llxHeader(); -if ($mesg) { print "
$mesg
"; } /* @@ -195,6 +193,10 @@ if ($mesg) { print "
$mesg
"; } if ($_GET["action"] == 'create' or $_GET["action"] == 'copy') { + + llxHeader(); + if ($mesg) { print "
$mesg
"; } + if ($_GET["action"] == 'copy') { $fac_ori = new FactureFournisseur($db); @@ -301,6 +303,17 @@ else $fac = new FactureFournisseur($db); $fac->fetch($_GET["facid"]); + $societe = new Fournisseur($db); + + if ( $societe->fetch($fac->socidp) ) + { + $addons[0][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$fac->socidp; + $addons[0][1] = $societe->nom; + } + llxHeader('','', $addons); + + if ($mesg) { print "
$mesg
"; } + if ($_GET["action"] == "edit") { @@ -603,14 +616,11 @@ else print "id&action=copy&socid=$fac->socidp\">".$langs->trans('Copy').""; } - if ($fac->statut == 0 && $user->societe_id == 0) + if ($_GET["action"] != "edit" && $fac->statut == 0 && $user->rights->fournisseur->facture->creer) { - if ($_GET["action"] != "edit") - { print ''.$langs->trans("Delete").''; - } } - + print ""; }