From 9e8dd69ec4c4b4bc45696e56f80fe29328135ebc Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 26 Jan 2005 16:51:02 +0000 Subject: [PATCH] Gestion de la modification du mode de paiement --- htdocs/telephonie/contrat/fiche.php | 104 ++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 30 deletions(-) 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 "
id\" method=\"post\">\n"; + print ''; print ''; print ''; @@ -553,6 +555,8 @@ else $client_comm = new Societe($db, $contrat->client_comm_id); $client_comm->fetch($contrat->client_comm_id); + print ''; + print ''; + + /* + * + */ + print ''; + print ''; + /* * Commercial
Client'; print ''; @@ -619,6 +623,46 @@ else } print '
Mode de réglement'; + + if ($user->rights->telephonie->contrat->paiement) + { + print ''; + } + else + { + print ''; + + if ($contrat->mode_paiement == 'pre') + { + print 'Prélèvement'; + } + else + { + print 'Virement'; + } + } + + + print '