From b4a6827e5e6e79a056385689813b0c2be244045f Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 15 Jun 2005 14:01:55 +0000 Subject: [PATCH] Gestion des transferts --- .../fournisseur/commande/commande.tableur.class.php | 7 ++++++- .../fournisseur/commande/commande.text.class.php | 6 +++++- htdocs/telephonie/ligne/commande/fiche.php | 5 +++-- htdocs/telephonie/lignetel.class.php | 8 +++++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/htdocs/telephonie/fournisseur/commande/commande.tableur.class.php b/htdocs/telephonie/fournisseur/commande/commande.tableur.class.php index 54957c75abd..47e45cdaf59 100644 --- a/htdocs/telephonie/fournisseur/commande/commande.tableur.class.php +++ b/htdocs/telephonie/fournisseur/commande/commande.tableur.class.php @@ -206,7 +206,7 @@ class CommandeMethodeTableur extends CommandeMethode $sql = $sqlall; - $sql .= " AND l.statut in (1,4)"; + $sql .= " AND l.statut in (1,4,8)"; $sql .= " ORDER BY l.statut ASC"; $result = $this->db->query($sql); @@ -343,6 +343,11 @@ class CommandeMethodeTableur extends CommandeMethode { $lint->set_statut($this->user, 5); } + + if ($lint->statut == 8) + { + $lint->set_statut($this->user, 2); + } } return 0; diff --git a/htdocs/telephonie/fournisseur/commande/commande.text.class.php b/htdocs/telephonie/fournisseur/commande/commande.text.class.php index 76a7a7c5fe0..b08b37560c7 100644 --- a/htdocs/telephonie/fournisseur/commande/commande.text.class.php +++ b/htdocs/telephonie/fournisseur/commande/commande.text.class.php @@ -158,7 +158,7 @@ class CommandeMethodeText extends CommandeMethode */ $sql = $sqlall; - $sql .= " AND l.statut in (1,4)"; + $sql .= " AND l.statut in (1,4,8)"; $sql .= " ORDER BY l.statut ASC"; $result = $this->db->query($sql); @@ -216,6 +216,10 @@ class CommandeMethodeText extends CommandeMethode { $lint->set_statut($this->user, 5); } + if ($lint->statut == 8) + { + $lint->set_statut($this->user, 2); + } } return 0; diff --git a/htdocs/telephonie/ligne/commande/fiche.php b/htdocs/telephonie/ligne/commande/fiche.php index 77a9e699460..914755a74fc 100644 --- a/htdocs/telephonie/ligne/commande/fiche.php +++ b/htdocs/telephonie/ligne/commande/fiche.php @@ -68,7 +68,8 @@ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ",".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; $sql .= ",".MAIN_DB_PREFIX."telephonie_fournisseur as f"; $sql .= ",".MAIN_DB_PREFIX."societe as sf"; -$sql .= " WHERE l.fk_soc = s.idp AND l.fk_fournisseur = f.rowid AND l.statut IN (1,4) "; +$sql .= " WHERE l.fk_soc = s.idp AND l.fk_fournisseur = f.rowid "; +$sql .= " AND l.statut IN (1,4,8) "; $sql .= " AND l.fk_soc_facture = sf.idp"; $sql .= " GROUP BY f.rowid, f.nom ASC"; @@ -133,7 +134,7 @@ $sql .= " , ".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; $sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f"; $sql .= " , ".MAIN_DB_PREFIX."societe as sf"; $sql .= " WHERE l.fk_soc = s.idp AND l.fk_fournisseur = f.rowid"; -$sql .= " AND l.statut IN (1,4) "; +$sql .= " AND l.statut IN (1,4,8) "; $sql .= " AND l.fk_soc_facture = sf.idp"; $sql .= " ORDER BY s.nom ASC "; diff --git a/htdocs/telephonie/lignetel.class.php b/htdocs/telephonie/lignetel.class.php index f6cdea31c66..295a2911d9f 100644 --- a/htdocs/telephonie/lignetel.class.php +++ b/htdocs/telephonie/lignetel.class.php @@ -387,12 +387,18 @@ class LigneTel { { $sql = "UPDATE ".MAIN_DB_PREFIX."telephonie_societe_ligne"; $sql .= " SET statut = ".$statut ; - $sql .= ", date_commande = now()"; + $sql .= " WHERE rowid =".$this->id; + + $this->db->query($sql); + + $sql = "UPDATE ".MAIN_DB_PREFIX."telephonie_societe_ligne"; + $sql .= " SET date_commande = now()"; $sql .= ", fk_user_commande=".$user->id; $sql .= " WHERE rowid =".$this->id; $sql .= " AND date_commande IS NULL"; $this->db->query($sql); + } if ($datea)