diff --git a/htdocs/telephonie/contrat/fiche.php b/htdocs/telephonie/contrat/fiche.php
index fd2e60b5fdf..afbb4b069bd 100644
--- a/htdocs/telephonie/contrat/fiche.php
+++ b/htdocs/telephonie/contrat/fiche.php
@@ -52,6 +52,37 @@ if ($_POST["action"] == 'add')
}
+if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
+{
+ $contrat = new TelephonieContrat($db);
+ $contrat->id = $_GET["id"];
+
+ $contrat->client_comm = $_POST["client_comm"];
+ $contrat->client = $_POST["client"];
+ $contrat->client_facture = $_POST["client_facture"];
+ $contrat->fournisseur = $_POST["fournisseur"];
+ $contrat->commercial = $_POST["commercial"];
+ $contrat->concurrent = $_POST["concurrent"];
+ $contrat->note = $_POST["note"];
+ $contrat->mode_paiement = $_POST["mode_paiement"];
+
+ $contrat->commercial_suiv_id = $_POST["commercial_suiv"];
+
+ if ( $contrat->update($user) == 0)
+ {
+ $action = '';
+ $mesg = 'Fiche mise à jour';
+ Header("Location: fiche.php?id=".$contrat->id);
+ }
+ else
+ {
+ $action = 're-edit';
+ $mesg = 'Fiche non mise à jour !' . "
" . $entrepot->mesg_error;
+ }
+}
+
+
+
if ($_POST["action"] == 'addcontact')
{
$ligne = new LigneTel($db);
@@ -86,35 +117,6 @@ if ($_GET["action"] == 'delcontact')
}
-if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
-{
- $ligne = new LigneTel($db);
- $ligne->id = $_GET["id"];
-
- $ligne->numero = $_POST["numero"];
- $ligne->client_comm = $_POST["client_comm"];
- $ligne->client = $_POST["client"];
- $ligne->client_facture = $_POST["client_facture"];
- $ligne->fournisseur = $_POST["fournisseur"];
- $ligne->commercial = $_POST["commercial"];
- $ligne->concurrent = $_POST["concurrent"];
- $ligne->remise = $_POST["remise"];
- $ligne->note = $_POST["note"];
-
- if ( $ligne->update($user) )
-
- {
- $action = '';
- $mesg = 'Fiche mise à jour';
- }
- else
- {
- $action = 're-edit';
- $mesg = 'Fiche non mise à jour !' . "
" . $entrepot->mesg_error;
- }
-}
-
-
llxHeader("","","Fiche Contrat");
if ($cancel == $langs->trans("Cancel"))
@@ -542,7 +544,7 @@ else
print_fiche_titre('Edition du contrat', $mesg);
- print "