diff --git a/htdocs/telephonie/ligne/fiche.php b/htdocs/telephonie/ligne/fiche.php index 2c39da23ebc..6f0cbf5cebe 100644 --- a/htdocs/telephonie/ligne/fiche.php +++ b/htdocs/telephonie/ligne/fiche.php @@ -35,16 +35,17 @@ $s = strftime("%S",$dt); if ($_POST["action"] == 'add') { $ligne = new LigneTel($db); - $ligne->contrat = $_POST["contrat"]; - $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"]; + $ligne->contrat = $_POST["contrat"]; + $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_sign = $_POST["commercial_sign"]; + $ligne->commercial_suiv = $_POST["commercial_suiv"]; + $ligne->concurrent = $_POST["concurrent"]; + $ligne->remise = $_POST["remise"]; + $ligne->note = $_POST["note"]; if ( $ligne->create($user) == 0) { @@ -217,13 +218,8 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) $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) ) @@ -355,8 +351,13 @@ elseif ($_GET["action"] == 'create' && $_GET["contratid"] > 0) print ''; print ''."\n"; print ''."\n"; + print ''."\n"; + print ''."\n"; print '
| Contrat | '.$contrat->ref_url.' | |
| Client | '; print $socc->nom; print ' | |
| Commercial | '; - $ff = array(); - $sql = "SELECT rowid, name, firstname FROM ".MAIN_DB_PREFIX."user ORDER BY name "; - if ( $db->query( $sql) ) - { - $num = $db->num_rows(); - if ( $num > 0 ) + print ' | |
| Fournisseur précédent | '; + $ff = array(); + $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."telephonie_concurrents ORDER BY rowid "; + if ( $db->query( $sql) ) { - $i = 0; - while ($i < $num) + $num = $db->num_rows(); + if ( $num > 0 ) { - $row = $db->fetch_row($i); - $ff[$row[0]] = $row[1] . " " . $row[2]; - $i++; + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row($i); + $ff[$row[0]] = $row[1]; + $i++; + } } + $db->free(); + } - $db->free(); + $form->select_array("concurrent",$ff,$ligne->concurrent); + print ' | |
| Fournisseur précédent | '; - $ff = array(); - $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."telephonie_concurrents ORDER BY rowid "; - if ( $db->query( $sql) ) - { - $num = $db->num_rows(); - if ( $num > 0 ) - { - $i = 0; - while ($i < $num) - { - $row = $db->fetch_row($i); - $ff[$row[0]] = $row[1]; - $i++; - } - } - $db->free(); + print ' | |
| Remise LMN | % | |
| Note | '."\n"; + print ' | |