diff --git a/htdocs/telephonie/ligne/fiche.php b/htdocs/telephonie/ligne/fiche.php index 16e00277e71..2c39da23ebc 100644 --- a/htdocs/telephonie/ligne/fiche.php +++ b/htdocs/telephonie/ligne/fiche.php @@ -54,8 +54,22 @@ if ($_POST["action"] == 'add') { $_GET["action"] = 'create'; $_GET["contratid"] = $_POST["contrat"]; + } +} + +if ($_POST["action"] == 'updateremise') +{ + $ligne = new LigneTel($db); + $ligne->id = $_GET["id"]; + + if ( $ligne->SetRemise($user, $_POST["remise"], $_POST["comment"]) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); } - + else + { + $_GET["action"] = 'editremise'; + } } if ($_POST["action"] == 'addcontact') @@ -590,7 +604,7 @@ else print ''; - print 'Fournisseur'; + print 'Fournisseur'; $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."telephonie_fournisseur"; $sql .= " WHERE commande_active = 1 AND rowid = ".$ligne->fournisseur_id; @@ -607,7 +621,8 @@ else } print ''; - print 'Remise LMN'.$ligne->remise.' %'; + print 'Remise LMN'.$ligne->remise.' %'; + print 'historique'; $commercial = new User($db, $ligne->commercial_id); $commercial->fetch(); @@ -662,17 +677,33 @@ else /* Fin Contacts */ - if ($_GET["action"] <> 'edit' && 0) + + print "
"; + + if ($_GET["action"] == "editremise" && $ligne->statut <> 6) { - print 'Point de rentabilité'; + /** + * Edition de la remise + */ - - print ''; - + print '
'; + print ''; + print ''; + print ''; + print ''; + + print ''; + + print ''; + + print '
Modification de la remise Local/Mobile/National
Nouvelle remise LMN'; + print ' %'; print '
Commentaire

'; + + print '
'; } - print ""; + } @@ -870,7 +901,7 @@ else */ - print 'Remise LMN %'; + print 'Remise LMN'.$ligne->remise.' %'; print 'Note'; @@ -1089,10 +1120,18 @@ if ($_GET["action"] == '') { print "id\">".$langs->trans("Annuler la demande de résiliation").""; } - + + if ( $user->rights->telephonie->ligne_activer && $ligne->statut <> 6) + { print "id\">".$langs->trans("Contact").""; + } - print "id\">".$langs->trans("Edit").""; + print "id\">".$langs->trans("Changer la remise").""; + + if ( $user->rights->telephonie->ligne_activer && $ligne->statut == -1) + { + print "id\">".$langs->trans("Edit").""; + } }