diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php
index f582c6c9048..dab72713639 100644
--- a/htdocs/comm/fiche.php
+++ b/htdocs/comm/fiche.php
@@ -453,7 +453,7 @@ if ($socid > 0)
*
*/
print '
';
- print 'Actions à faire [Nouvelle action ] ';
+ print 'Actions à faire Nouvelle action ';
print '';
print '';
@@ -531,7 +531,7 @@ if ($socid > 0)
* Listes des actions effectuees
*
*/
- print '';
+ print '';
print 'Actions effectuées ';
print '';
print '';
@@ -585,11 +585,11 @@ if ($socid > 0)
if ($obj->propalrowid)
{
- print ' '.$obj->libelle.' ';
+ print ''.$obj->libelle.' ';
}
else
{
- print ''.$obj->libelle.' ';
+ print ''.$obj->libelle.' ';
}
/*
* Contact pour cette action
diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php
index 651bad43c9c..80a7dbe8f60 100644
--- a/htdocs/compta/fiche.php
+++ b/htdocs/compta/fiche.php
@@ -415,20 +415,18 @@ if ($socid > 0)
$i++;
$tag = !$tag;
}
- print "
";
+ print "
";
- print "\n \n";
/*
+ *
+ * Listes des actions effectuées
*
*/
print '';
+ print 'Actions effectuées ';
print '';
print '';
- /*
- *
- * Listes des actions
- *
- */
+
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
$sql .= " WHERE a.fk_soc = $objsoc->idp ";
@@ -465,11 +463,15 @@ if ($socid > 0)
print ' ';
- if ($obj->propalrowid) {
- print ''.$obj->libelle.' ';
- } else {
- print ''.$obj->libelle.' ';
- }
+ if ($obj->propalrowid)
+ {
+ print ''.$obj->libelle.' ';
+ }
+ else
+ {
+ print ''.$obj->libelle.' ';
+ }
+
/*
* Contact pour cette action
*
@@ -494,6 +496,7 @@ if ($socid > 0)
print $db->error();
}
print "
";
+
/*
*
* Notes sur la societe
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 0af58872457..48c46d169cb 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -38,7 +38,7 @@ class Form {
* avec un affichage avec rupture sur le pays
*
*/
- Function select_departement($selected='', $addnsp=0)
+ Function select_departement($selected='')
{
print '';
@@ -90,7 +90,7 @@ class Form {
* Retourne la liste déroulante des pays actifs
*
*/
- Function select_pays($selected='', $addnsp=0)
+ Function select_pays($selected='')
{
print '';
@@ -121,6 +121,59 @@ class Form {
print ' ';
}
+ /*
+ * Retourne la liste déroulante des formes juridiques
+ * avec un affichage avec rupture sur le pays
+ *
+ */
+ Function select_forme_juridique($selected='')
+ {
+ print '';
+
+ // On recherche les formes juridiques actives des pays actifs
+ $sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as libelle_pays, p.code as code_pays FROM llx_c_forme_juridique as f, llx_c_pays as p";
+ $sql .= " WHERE f.fk_pays=p.rowid";
+ $sql .= " AND f.active = 1 AND p.active = 1 ORDER BY code_pays, code ASC";
+
+ if ($this->db->query($sql))
+ {
+ $num = $this->db->num_rows();
+ $i = 0;
+ if ($num)
+ {
+ $pays='';
+ while ($i < $num)
+ {
+ $obj = $this->db->fetch_object( $i);
+ if ($obj->code == 0) {
+ print ' ';
+ }
+ else {
+ if ($pays == '' || $pays != $obj->libelle_pays) {
+ // Affiche la rupture
+ print '----- '.$obj->libelle_pays.' ----- ';
+ $pays=$obj->libelle_pays;
+ }
+
+ if ($selected > 0 && $selected == $obj->rowid)
+ {
+ print '['.$obj->code.'] '.$obj->nom.' ';
+ }
+ else
+ {
+ print '['.$obj->code.'] '.$obj->nom.' ';
+ }
+ }
+ $i++;
+ }
+ }
+ }
+ else {
+ print "Erreur : $sql : ".$this->db->error();
+ }
+ print ' ';
+ }
+
/*
*
*
diff --git a/htdocs/soc.php b/htdocs/soc.php
index 791eb2adc25..091c146399a 100644
--- a/htdocs/soc.php
+++ b/htdocs/soc.php
@@ -75,6 +75,9 @@ $form = new Form($db);
if ($action == 'create')
{
+ /*
+ * Fiche societe en mode création
+ */
$soc = new Societe($db);
print 'Nouvelle société (prospect, client, fournisseur)
';
print ' ';
print 'Département ';
- print $form->select_departement(0);
+ print $form->select_departement($soc->departement_id);
print ' ';
print 'Pays ';
@@ -108,7 +111,7 @@ if ($action == 'create')
print ' Capital '.MAIN_MONNAIE.' ';
print 'Forme juridique ';
- print $form->select_array("forme_juridique_id",$soc->forme_juridique_array(), $soc->forme_juridique, 0, 1);
+ print $form->select_forme_juridique($soc->forme_juridique_id);
print ' ';
print 'Effectif ';
@@ -123,7 +126,7 @@ if ($action == 'create')
print ' ';
print 'Prospect / Client ';
- print 'Prospect';
+ print ' Prospect';
print ' Client';
print ' Ni client, ni prospect';
print ' ';
@@ -138,6 +141,10 @@ if ($action == 'create')
}
elseif ($action == 'edit')
{
+ /*
+ * Fiche societe en mode edition
+ */
+
print_titre("Edition de la société");
if ($socid)
@@ -177,12 +184,11 @@ elseif ($action == 'edit')
print 'Forme juridique ';
- $html = new Form($db);
- print $html->select_array("forme_juridique_id",$soc->forme_juridique_array(), $soc->forme_juridique_id,0,1);
+ print $form->select_forme_juridique($soc->forme_juridique_id);
print ' ';
print 'Effectif ';
- print $html->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id);
+ print $form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id);
print ' ';
print 'Numéro de TVA Intracommunautaire ';
@@ -195,21 +201,21 @@ elseif ($action == 'edit')
print ' Prospect / Client ';
if ($soc->client == 2)
{
- print 'Prospect ';
+ print 'Prospect ';
print 'Client ';
print 'Ni client, ni prospect ';
}
elseif ($soc->client == 1)
{
print 'Prospect ';
- print 'Client ';
+ print 'Client ';
print 'Ni client, ni prospect ';
}
else
{
print 'Prospect ';
print 'Client ';
- print 'Ni client, ni prospect ';
+ print 'Ni client, ni prospect ';
}
print ' ';
diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php
index d365767636c..2bfac8b15bb 100644
--- a/htdocs/societe.class.php
+++ b/htdocs/societe.class.php
@@ -31,10 +31,13 @@ class Societe {
var $adresse;
var $cp;
var $ville;
+ var $departement_id;
+ var $pays_id;
var $tel;
var $fax;
var $url;
var $siren;
+ var $forme_juridique_id;
var $client;
var $note;
var $fournisseur;