diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b39a87f646b..7c6d3891ddb 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -272,7 +272,7 @@ if ($_POST["action"] == 'addligne' && $user->rights->facture->creer) $_GET["facid"]=$_POST["facid"]; // Pour réaffichage de la fiche en cours d'édition } -if ($_POST["action"] == 'updateligne' && $user->rights->facture->creer) +if ($_POST["action"] == 'updateligne' && $user->rights->facture->creer && $_POST["save"] == $langs->trans("Save")) { $fac = new Facture($db,"",$_POST["facid"]); $fac->fetch($_POST["facid"]); @@ -297,6 +297,11 @@ if ($_POST["action"] == 'updateligne' && $user->rights->facture->creer) $_GET["facid"]=$_POST["facid"]; // Pour réaffichage de la fiche en cours d'édition } +if ($_POST["action"] == 'updateligne' && $user->rights->facture->creer && $_POST["cancel"] == $langs->trans("Cancel")) +{ + Header("Location: facture.php?facid=".$_POST["facid"]); // Pour réaffichage de la fiche en cours d'édition +} + if ($_GET["action"] == 'deleteline' && $user->rights->facture->creer) { $fac = new Facture($db,"",$_GET["facid"]); @@ -1037,17 +1042,18 @@ else print ''; print ''; print ' %'; - print ''; + print '
'; print '' . "\n"; - if ($conf->service->enabled) { - print ""; - print 'Si produit de type service à durée limitée: Du '; - print $html->select_date($objp->date_start,"date_start",0,0,$objp->date_start?0:1); - print ' au '; - print $html->select_date($objp->date_end,"date_end",0,0,$objp->date_end?0:1); - print ''; - print '' . "\n"; - } + if ($conf->service->enabled) + { + print ""; + print 'Si produit de type service à durée limitée: Du '; + print $html->select_date($objp->date_start,"date_start",0,0,$objp->date_start?0:1); + print ' au '; + print $html->select_date($objp->date_end,"date_end",0,0,$objp->date_end?0:1); + print ''; + print '' . "\n"; + } print "\n"; } @@ -1067,7 +1073,7 @@ else * Ajouter une ligne * */ - if ($fac->statut == 0 && $user->rights->facture->creer) + if ($fac->statut == 0 && $user->rights->facture->creer && $_GET["action"] <> 'editline' && $_GET["action"] <> 'valid') { print "
"; @@ -1109,7 +1115,7 @@ else * */ print ''; - if ($user->societe_id == 0 && $_GET["action"] <> 'valid') + if ($user->societe_id == 0 && $_GET["action"] <> 'valid' && $_GET["action"] <> 'editline') { print "
\n";