Le niveau de potentiel des prospects est pleinement gr.

This commit is contained in:
Laurent Destailleur 2008-03-02 19:55:43 +00:00
parent 6462c6229d
commit 2558694ea6
10 changed files with 114 additions and 35 deletions

View File

@ -46,7 +46,7 @@ $active = 1;
// Mettre ici tous les caractéristiques des dictionnaires
// Ordres d'affichage des dictionnaires (0 pour espace)
$taborder=array(9,0,4,3,2,0,1,8,0,5,11,0,6,0,10,12,13,0,14,0,7,0,15);
$taborder=array(9,0,4,3,2,0,1,8,16,0,5,11,0,6,0,10,12,13,0,14,0,7,0,15);
// Nom des tables des dictionnaires
$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
@ -64,6 +64,7 @@ $tabname[12]= MAIN_DB_PREFIX."cond_reglement";
$tabname[13]= MAIN_DB_PREFIX."c_paiement";
$tabname[14]= MAIN_DB_PREFIX."c_ecotaxe";
$tabname[15]= MAIN_DB_PREFIX."c_paper_format";
$tabname[16]= MAIN_DB_PREFIX."c_prospectlevel";
// Libellé des dictionnaires
$tablib[1] = $langs->trans("DictionnaryCompanyJuridicalType");
@ -81,6 +82,7 @@ $tablib[12]= $langs->trans("DictionnaryPaymentConditions");
$tablib[13]= $langs->trans("DictionnaryPaymentModes");
$tablib[14]= $langs->trans("DictionnaryEcotaxe");
$tablib[15]= $langs->trans("DictionnaryPaperFormat");
$tablib[16]= $langs->trans("DictionnaryProspectLevel");
// Requete pour extraction des données des dictionnaires
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
@ -98,6 +100,7 @@ $tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_fac
$tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c";
$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as pays_id, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1";
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
$tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
// Critere de tri du dictionnaire
$tabsqlsort[1] ="pays, code ASC";
@ -115,6 +118,7 @@ $tabsqlsort[12]="sortorder ASC, code ASC";
$tabsqlsort[13]="code ASC";
$tabsqlsort[14]="pays, e.organization ASC, code ASC";
$tabsqlsort[15]="rowid ASC";
$tabsqlsort[16]="sortorder ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield[1] = "code,libelle,pays";
@ -132,6 +136,7 @@ $tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfield[13]= "code,libelle,type";
$tabfield[14]= "code,libelle,price,organization,pays_id,pays";
$tabfield[15]= "code,libelle,width,height,unit";
$tabfield[16]= "code,libelle";
// Nom des champs d'édition pour modification du dictionnaire
$tabfieldvalue[1] = "code,libelle,pays";
@ -149,6 +154,7 @@ $tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfieldvalue[13]= "code,libelle,type";
$tabfieldvalue[14]= "code,libelle,price,organization,pays";
$tabfieldvalue[15]= "code,libelle,width,height,unit";
$tabfieldvalue[16]= "code,libelle";
// Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert[1] = "code,libelle,fk_pays";
@ -166,6 +172,7 @@ $tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfieldinsert[13]= "code,libelle,type";
$tabfieldinsert[14]= "code,libelle,price,organization,fk_pays";
$tabfieldinsert[15]= "code,label,width,height,unit";
$tabfieldinsert[16]= "code,label";
// Nom du rowid si le champ n'est pas de type autoincrément
$tabrowid[1] = "";
@ -183,6 +190,7 @@ $tabrowid[12]= "rowid";
$tabrowid[13]= "id";
$tabrowid[14]= "";
$tabrowid[15]= "";
$tabrowid[16]= "code";
// Condition to show dictionnary in setup page
$tabcond[1] = true;
@ -200,6 +208,7 @@ $tabcond[12]= $conf->facture->enabled||$conf->fournisseur->enabled;
$tabcond[13]= $conf->facture->enabled||$conf->fournisseur->enabled;
$tabcond[14]= $conf->produit->enabled&&$conf->global->PRODUIT_USE_ECOTAXE;
$tabcond[15]= true;
$tabcond[16]= $conf->societe->enabled;
$msg='';

View File

@ -51,6 +51,17 @@ if ($_GET["action"] == 'cstc')
$sql .= " WHERE rowid = ".$_GET["socid"];
$db->query($sql);
}
// set prospect level
if ($_POST["action"] == 'setprospectlevel' && $user->rights->societe->creer)
{
$societe = new Societe($db, $_GET["socid"]);
$societe->fk_prospectlevel=$_POST['prospect_level_id'];
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_prospectlevel='".$_POST['prospect_level_id'];
$sql.= "' WHERE rowid='".$_GET["socid"]."'";
$result = $db->query($sql);
if (! $result) dolibarr_print_error($result);
}
/*********************************************************************************
@ -60,6 +71,7 @@ if ($_GET["action"] == 'cstc')
*********************************************************************************/
llxHeader();
$form=new Form($db);
if ($socid > 0)
{
@ -99,21 +111,25 @@ if ($socid > 0)
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">'.$societe->forme_juridique.'</td></tr>';
// Level
// print '<tr><td>'.$langs->trans('ProspectLevel').'</td><td colspan="3">'.$societe->getLibLevel().'</td></tr>';
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('ProspectLevel');
print '<td><td align="right">';
if ($user->rights->societe->creer)
print '<a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$societe->id.'">'.img_edit().'</a>';
else
print '&nbsp;';
print '</td></tr></table>';
print '</td>';
print '<td colspan="3">';
print $societe->getLibLevel();
print '</td></tr>';
// Level
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans('ProspectLevelShort');
print '<td>';
if (($_GET['action'] != 'editlevel') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&amp;socid='.$societe->id.'">'.img_edit($langs->trans('SetLevel'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'editlevel')
{
$form->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$societe->id,$societe->fk_prospectlevel,'prospect_level_id',1);
}
else
{
print $societe->getLibLevel();
//$html->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->mode_reglement,'none');
}
print "</td>";
print '</tr>';
// Status
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">'.$societe->getLibStatut(4).'</td>';

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
@ -18,15 +18,13 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/
/**
\file htdocs/conf/conf.class.php
\brief Fichier de la classe de stockage de la config courante
\remarks La config est stockee dans le fichier conf/conf.php
\version $Revision$
\file htdocs/conf/conf.class.php
\brief Fichier de la classe de stockage de la config courante
\remarks La config est stockee dans le fichier conf/conf.php
\version $Id$
*/

View File

@ -1964,6 +1964,56 @@ class Form
}
/**
* \brief Affiche formulaire de selection des modes de reglement
* \param page Page
* \param selected Id or code preselected
* \param htmlname Nom du formulaire select
* \param empty Add empty value in list
*/
function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0)
{
global $langs;
print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="action" value="setprospectlevel">';
print '<table class="noborder" cellpadding="0" cellspacing="0">';
print '<tr><td>';
print '<select class="flat" name="'.$htmlname.'">';
if ($empty) print '<option value="">&nbsp;</option>';
dolibarr_syslog('Form::form_prospect_level',LOG_DEBUG);
$sql = "SELECT code, label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
$sql.= " WHERE active > 0";
$sql.= " ORDER BY label";
$resql = $this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
print '<option value="'.$obj->code.'"';
if ($selected == $obj->code) print ' selected="true"';
print '>';
print $obj->label;
print '</option>';
$i++;
}
}
print '</select>';
print '</td>';
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';
}
/**
* \brief Affiche formulaire de selection de la remise relative
* \param page Page

View File

@ -406,6 +406,7 @@ Permission2405=Create/modify/delete actions/tasks of others
Permission2410=Read Dolibarr audit events
DictionnaryCompanyType=Company types
DictionnaryCompanyJuridicalType=Juridical kinds of company
DictionnaryProspectLevel=Prospect potential level
DictionnaryCanton=Cantons
DictionnaryRegion=Regions
DictionnaryCountry=Countries

View File

@ -405,6 +405,7 @@ Permission2405=Creer/modifier/supprimer les actions/taches pour les autres
Permission2410=Voir l'audit des évenements Dolibarr
DictionnaryCompanyType=Types de sociétés
DictionnaryCompanyJuridicalType=Formes juridiques
DictionnaryProspectLevel=Niveau de potentiel des prospects
DictionnaryCanton=Départements/Provinces/Cantons
DictionnaryRegion=Régions
DictionnaryCountry=Pays
@ -426,7 +427,7 @@ VATIsUsedDesc=Le taux de TVA propos
VATIsNotUsedDesc=Le taux de TVA proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés.
VATIsUsedExampleFR=En France, il s'agit des sociétés ou organismes ayant choisi un régime fiscale réel (Réel simplifié ou Réel normal), régime dans lequel la TVA est déclarée.
VATIsNotUsedExampleFR=En France, il s'agit des associations ne déclarant pas de TVA ou sociétés, organismes ou professions libérales ayant choisi le régime fiscal micro entreprise (TVA en franchise) et payant une TVA en franchise sans faire de déclaration de TVA. Ce choix fait de plus apparaitre la mention "TVA non applicable - art-293B du CGI" sur les factures.
LabelUsedByDefault=Libellé qui sera utilisé si aucune traduction n'est trouvé pour ce code
LabelUsedByDefault=Libellé qui sera utilisé si aucune traduction n'est trouvée pour ce code
LabelOnDocuments=Libellé sur documents
NbOfDays=Nbre de jours
AtEndOfMonth=En fin de mois

View File

@ -495,9 +495,10 @@ class Societe extends CommonObject
global $langs;
global $conf;
/* Lecture des permissions */
if ($user <> 0)
// Init data for telephonie module
if ($this->telephonie->enabled && $user && $user->id)
{
/* Lecture des permissions */
$sql = "SELECT p.pread, p.pwrite, p.pperms";
$sql .= " FROM ".MAIN_DB_PREFIX."societe_perms as p";
$sql .= " WHERE p.fk_user = '".$user->id."'";
@ -514,19 +515,20 @@ class Societe extends CommonObject
}
}
$sql = 'SELECT s.rowid, s.nom, s.address,'.$this->db->pdate('s.datec').' as dc, prefix_comm';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES == 1)
$sql .= ', s.price_level';
$sql = 'SELECT s.rowid, s.nom, s.address,'.$this->db->pdate('s.datec').' as dc, s.prefix_comm';
if ($conf->global->PRODUIT_MULTIPRICES == 1) $sql .= ', s.price_level';
$sql .= ','. $this->db->pdate('s.tms').' as date_update';
$sql .= ', s.tel, s.fax, s.email, s.url, s.cp, s.ville, s.note, client, fournisseur';
$sql .= ', s.tel, s.fax, s.email, s.url, s.cp, s.ville, s.note, s.client, s.fournisseur';
$sql .= ', s.siren, s.siret, s.ape, s.idprof4';
$sql .= ', s.capital, s.tva_intra, s.rubrique';
$sql .= ', s.fk_typent as typent_id';
$sql .= ', s.fk_effectif as effectif_id, e.libelle as effectif';
$sql .= ', s.fk_forme_juridique as forme_juridique_code, fj.libelle as forme_juridique';
$sql .= ', s.fk_effectif as effectif_id';
$sql .= ', s.fk_forme_juridique as forme_juridique_code';
$sql .= ', s.code_client, s.code_compta, s.code_fournisseur, s.parent';
$sql .= ', s.fk_departement, s.fk_pays, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj';
$sql .= ', s.fk_prospectlevel';
$sql .= ', fj.libelle as forme_juridique';
$sql .= ', e.libelle as effectif';
$sql .= ', p.code as pays_code, p.libelle as pays';
$sql .= ', d.code_departement as departement_code, d.nom as departement';
$sql .= ', st.libelle as stcomm';
@ -603,6 +605,8 @@ class Societe extends CommonObject
$this->forme_juridique_code= $obj->forme_juridique_code;
$this->forme_juridique = $obj->forme_juridique_code?$obj->forme_juridique:'';
$this->fk_prospectlevel = $obj->fk_prospectlevel;
$this->prefix_comm = $obj->prefix_comm;
$this->remise_client = $obj->remise_client;

View File

@ -1369,4 +1369,4 @@ delete from llx_c_prospectlevel;
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_UNKOWN', 'Unknown', 1);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_LOW', 'Low', 2);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_MEDIUM', 'Medium', 3);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_HIGH', 'Eleve', 4);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_HIGH', 'High', 4);

View File

@ -214,7 +214,7 @@ create table llx_c_prospectlevel
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_UNKOWN', 'Unknown', 1);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_LOW', 'Low', 2);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_MEDIUM', 'Medium', 3);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_HIGH', 'Eleve', 4);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_HIGH', 'High', 4);
alter table llx_societe add column fk_prospectlevel varchar(12) after fournisseur;