diff --git a/htdocs/soc.php b/htdocs/soc.php index 414548e240a..b53cbeb8bdd 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -405,175 +405,224 @@ elseif ($_GET["action"] == 'edit') } else { - if ($no_reload <> 1) - { - $soc = new Societe($db); - $soc->id = $_GET["socid"]; - $soc->fetch($_GET["socid"]); - } - - $head[0][0] = 'soc.php?socid='.$soc->id; - $head[0][1] = $langs->trans("Company"); - $h = 1; - - if ($soc->client==1) + if ($no_reload <> 1) { - $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("Customer"); - $h++; + $soc = new Societe($db); + $soc->id = $_GET["socid"]; + $soc->fetch($_GET["socid"]); } - if ($soc->client==2) + + $h=0; + + $head[$h][0] = 'soc.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Company"); + $h++; + + if ($soc->client==1) { - $head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$soc->id; - $head[$h][1] = $langs->trans("Prospect"); - $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Customer"); + $h++; } - if ($soc->fournisseur) + if ($soc->client==2) { - $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("Supplier");; - $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$soc->id; + $head[$h][1] = $langs->trans("Prospect"); + $h++; } - - if ($conf->compta->enabled) { - $langs->load("compta"); - $head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("Accountancy"); - $h++; - } - - $head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("Note"); - $h++; - - if ($user->societe_id == 0) + if ($soc->fournisseur) { - $head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("Documents"); - $h++; + $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Supplier");; + $h++; } - $head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("Notifications"); + if ($conf->compta->enabled) { + $langs->load("compta"); + $head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Accountancy"); + $h++; + } - dolibarr_fiche_head($head, 0, $soc->nom); + $head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Note"); + $h++; - /* - * Fiche société en mode visu - */ - - // Confirmation de la suppression de la facture - if ($_GET["action"] == 'delete') + if ($user->societe_id == 0) { - $html = new Form($db); - $html->form_confirm("soc.php?socid=".$soc->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete"); - print "
\n"; + $head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Documents"); + $h++; } - - if ($soc->error) + $head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Notifications"); + + dolibarr_fiche_head($head, 0, $soc->nom); + + /* + * Fiche société en mode visu + */ + + // Confirmation de la suppression de la facture + if ($_GET["action"] == 'delete') { - print '
'; - print $soc->error; - print '
'; + $html = new Form($db); + $html->form_confirm("soc.php?socid=".$soc->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete"); + print "
\n"; } - print ''; - print ''; + if ($soc->error) + { + print '
'; + print $soc->error; + print '
'; + } - print ''; + print '
'.$langs->trans('Name').''.$soc->nom.'
'; - print $langs->trans('CustomerCode').''; - print $soc->code_client; - if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); - print ''.$langs->trans('Prefix').''.$soc->prefix_comm.'
'; - print ""; + print ''; - print '"; - print '"; + print ''; - print ''; + print ""; - print ''; - print ''; + print '"; + print '"; - print ''; - - print ''; + + print ''; + print ''; + + print ''; + + print ''; - print ''; + } + print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - $arr = $soc->typent_array($soc->typent_id); - $soc->typent= $arr[$soc->typent_id]; + $arr = $soc->typent_array($soc->typent_id); + $soc->typent= $arr[$soc->typent_id]; - print ''; + print ''; - print ''; + // RIB + print ''; + print ''; - print '
".$langs->trans('Address')."".nl2br($soc->adresse)."
'.$langs->trans('Name').''.$soc->nom.'
'.$langs->trans('Zip').''.$soc->cp."'.$langs->trans('Town').''.$soc->ville."
'; + print $langs->trans('CustomerCode').''; + print $soc->code_client; + if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); + print ''.$langs->trans('Prefix').''.$soc->prefix_comm.'
'.$langs->trans('Country').''.$soc->pays.'
".$langs->trans('Address')."".nl2br($soc->adresse)."
'.$langs->trans('Phone').''.dolibarr_print_phone($soc->tel).''.$langs->trans('Fax').''.dolibarr_print_phone($soc->fax).'
'.$langs->trans('Zip').''.$soc->cp."'.$langs->trans('Town').''.$soc->ville."
'.$langs->trans('Web').''; - if ($soc->url) { print 'http://'.$soc->url.''; } - print '
'.$langs->transcountry('ProfId1',$soc->pays_code).''; - // Si société FR et siren fourni, on le vérifie - if ($soc->pays_code == "FR" && $soc->siren) { - if ($soc->check_siren() == 0) + print '
'.$langs->trans('Country').''.$soc->pays.'
'.$langs->trans('Phone').''.dolibarr_print_phone($soc->tel).''.$langs->trans('Fax').''.dolibarr_print_phone($soc->fax).'
'.$langs->trans('Web').''; + if ($soc->url) { print 'http://'.$soc->url.''; } + print '
'.$langs->transcountry('ProfId1',$soc->pays_code).''; + // Si société FR et siren fourni, on le vérifie + if ($soc->pays_code == "FR" && $soc->siren) { + if ($soc->check_siren() == 0) { - print ''.$soc->siren.' '; + print ''.$soc->siren.' '; } - else + else { - print ''.$soc->siren; - // Siren invalide - print " Code Siren Invalide !"; + print ''.$soc->siren; + // Siren invalide + print " Code Siren Invalide !"; } - } - else { + } + else { print $soc->siren; - } - print ''.$langs->transcountry('ProfId2',$soc->pays_code).''.$soc->siret.'
'.$langs->transcountry('ProfId2',$soc->pays_code).''.$soc->siret.'
'.$langs->transcountry('ProfId3',$soc->pays_code).''.$soc->ape.' 
'.$langs->transcountry('ProfId3',$soc->pays_code).''.$soc->ape.' 
'.$langs->trans('TVAIntra').''; - print $soc->tva_intra; - print '
'.$langs->trans('TVAIntra').''; + print $soc->tva_intra; + print '
'.$langs->trans('Capital').''.$soc->capital.' '.$conf->monnaie.'
'.$langs->trans('Capital').''.$soc->capital.' '.$conf->monnaie.'
'.$langs->trans('JuridicalStatus').''.$soc->forme_juridique.'
'.$langs->trans('JuridicalStatus').''.$soc->forme_juridique.'
'.$langs->trans("Type").''.$soc->typent.''.$langs->trans("Staff").''.$soc->effectif.'
'.$langs->trans("Type").''.$soc->typent.''.$langs->trans("Staff").''.$soc->effectif.'
'.img_edit() ." "; - print $langs->trans('RIB').''; - print $soc->display_rib(); - print '
'; + print '
'; + print $langs->trans('RIB'); + print ''; + print ''.img_edit().''; + print '
'; + print '
'; + print $soc->display_rib(); + print '
'; - print "
\n"; - /* - * - */ - if ($_GET["action"] == '') + // Maison mère + print ''; + print '
'; + print $langs->trans('ParentCompany'); + print ''; + print ''.img_edit() .''; + print '
'; + print ''; + print ''; + if ($soc->parent) + { + $socm = new Societe($db); + $socm->fetch($soc->parent); + print ''.img_object($langs->trans("ShowCompany"),'company').' '.$socm->nom.''.($socm->code_client?"(".$socm->code_client.")":"").' - '.$socm->ville; + } + print ''; + + // Commerciaux + print ''; + print '
'; + print $langs->trans('SalesRepresentative'); + print ''; + print ''.img_edit().''; + print '
'; + print ''; + print ''; + + $sql = "SELECT count(sc.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE sc.fk_soc =".$soc->id; + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + print ''.$obj->nb.''; + } + else { + dolibarr_print_error($db); + } + print ''; + + + print ''; + print "
\n"; + /* + * + */ + if ($_GET["action"] == '') { - print '
'; - - print ''.$langs->trans("SalesRepresentative").''; + print '
'; - print ''.$langs->trans("ParentCompany").''; + print ''.$langs->trans("Edit").''; - print ''.$langs->trans("Edit").''; - - print ''.$langs->trans("AddContact").''; + print ''.$langs->trans("AddContact").''; - if ($user->rights->societe->supprimer) - { - print ''.$langs->trans("Delete").''; + if ($user->rights->societe->supprimer) + { + print ''.$langs->trans("Delete").''; - } - print '
'; + } + print '
'; } -/* - * - */ + } $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); + +llxFooter('$Date$ - $Revision$'); + ?> diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index a64ef6e2d2f..f4a901cd33b 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -85,174 +85,165 @@ llxHeader(); if($_GET["socid"]) { - - $soc = new Societe($db); - $soc->id = $_GET["socid"]; - $soc->fetch($_GET["socid"]); - - - $head[0][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id; - $head[0][1] = $langs->trans("Company"); - $h = 1; - - $head[$h][0] = 'lien.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("Links"); - $h++; - - $head[$h][0] = 'commerciaux.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("SalesRepresentative"); - $h++; - - $head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("Note"); - $h++; - - dolibarr_fiche_head($head, 2, $soc->nom); - - /* - * Fiche société en mode visu - */ - - print ''; - print ''; - - print ""; - - print '"; - print '"; - - print ''; - - print ''; - print ''; - + $soc = new Societe($db); + $soc->id = $_GET["socid"]; + $soc->fetch($_GET["socid"]); + + $h=0; + + $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Company"); + $h++; + + $head[$h][0] = DOL_URL_ROOT .'/societe/rib.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("BankAccount")." $account->number"; + $h++; + + $head[$h][0] = 'lien.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Links"); + $h++; + + $head[$h][0] = 'commerciaux.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("SalesRepresentative"); + $hselected=$h; + $h++; + + dolibarr_fiche_head($head, $hselected, $soc->nom); + + /* + * Fiche société en mode visu + */ + + print '
'.$langs->trans('Name').''.$soc->nom.''.$langs->trans('Prefix').''.$soc->prefix_comm.'
".$langs->trans('Address')."".nl2br($soc->adresse)."
'.$langs->trans('Zip').''.$soc->cp."'.$langs->trans('Town').''.$soc->ville."
'.$langs->trans('Country').''.$soc->pays.'
'.$langs->trans('Phone').''.dolibarr_print_phone($soc->tel).''.$langs->trans('Fax').''.dolibarr_print_phone($soc->fax).'
'; + print ''; + print ''; + if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); + print ''; - print ''; - - if ($soc->parent > 0) + print ""; + + print '"; + print '"; + + print ''; + + print ''; + print ''; + + print ''; + + // Liste les commerciaux + print ''; + print ''; + $num = $db->num_rows($resql); + $i = 0; + + while ($i < $num) + { + $obj = $db->fetch_object($resql); + print ''; + print img_object($langs->trans("ShowUser"),"user").' '; + print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n"; + print ' '; + print ''; + print img_delete(); + print '
'; + $i++; + } + + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } + if($i == 0) { print $langs->trans("NoSalesRepresentativeAffected"); } + + print ""; + + + print '
'.$langs->trans('Name').''.$soc->nom.'
'; - print $langs->trans('CustomerCode').''; + print $langs->trans('CustomerCode').''; print $soc->code_client; - if ($soc->check_codeclient() <> 0) - { - print $langs->trans("WrongCode"); - } - print '
'.$langs->trans('Prefix').''.$soc->prefix_comm.'
'.$langs->trans('Web').''; - if ($soc->url) { print 'http://'.$soc->url.''; } - print '
".$langs->trans('Address')."".nl2br($soc->adresse)."
'.$langs->trans('Zip').''.$soc->cp."'.$langs->trans('Town').''.$soc->ville."
'.$langs->trans('Country').''.$soc->pays.'
'.$langs->trans('Phone').''.dolibarr_print_phone($soc->tel).''.$langs->trans('Fax').''.dolibarr_print_phone($soc->fax).'
'.$langs->trans('Web').''; + if ($soc->url) { print 'http://'.$soc->url.''; } + print '
'.$langs->trans("SalesRepresentatives").''; + + $sql = "SELECT u.rowid, u.name, u.firstname"; + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; + $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE sc.fk_soc =".$soc->id; + $sql .= " AND sc.fk_user = u.rowid"; + $sql .= " ORDER BY u.name ASC "; + + $resql = $db->query($sql); + if ($resql) { - $socm = new Societe($db); - $socm->fetch($soc->parent); - - print '
'.$langs->trans("ParentCompany").''.$socm->nom_url.' ('.$socm->code_client.')
'.$socm->ville.'
'; + print "
\n"; + + + + if ($user->rights->societe->creer) + { + /* + * Liste + * + */ + + $langs->load("users"); + $title=$langs->trans("ListOfUsers"); + + $sql = "SELECT u.rowid, u.name, u.firstname, u.code"; + $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; + $sql .= " ORDER BY u.name ASC "; + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + + print_titre($title); + + // Lignes des titres + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + $var=True; + + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var=!$var; + print "'; + print ''; + + print ''."\n"; + $i++; + } + + print "
'.$langs->trans("Name").''.$langs->trans("Code").' 
"; + print ''; + print img_object($langs->trans("ShowUser"),"user").' '; + print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n"; + print ''; + print ''.$obj->code.''.$langs->trans("Add").'
"; + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } } - // Liste les commerciaux - $sql = "SELECT u.rowid, u.name, u.firstname"; - $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE sc.fk_soc =".$soc->id; - $sql .= " AND sc.fk_user = u.rowid"; - $sql .= " ORDER BY u.name ASC "; - - print ''.$langs->trans("SalesRepresentatives").''; - print ''; - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - - while ($i < $num) - { - $obj = $db->fetch_object($resql); - print ''; - print img_object($langs->trans("ShowUser"),"user").' '; - print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n"; - print ' '; - print ''; - print img_delete(); - print '
'; - $i++; - } - - $db->free($resql); - } - else - { - dolibarr_print_error($db); - } - if($i == 0) { print $langs->trans("NoSalesRepresentativeAffected"); } - print ""; - - - print ''; - print "
\n"; - - - - if ($user->rights->societe->creer) - { - /* - * Liste - * - */ - - $langs->load("users"); - $title=$langs->trans("ListOfUsers"); - - $sql = "SELECT u.rowid, u.name, u.firstname, u.code"; - $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql .= " ORDER BY u.name ASC "; - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - - print_titre($title); - - // Lignes des titres - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - $var=True; - - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var=!$var; - print "'; - print ''; - - print ''."\n"; - $i++; - } - - print "
'.$langs->trans("Name").''.$langs->trans("Code").' 
"; - print ''; - print img_object($langs->trans("ShowUser"),"user").' '; - print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n"; - print ''; - print ''.$obj->code.''.$langs->trans("Add").'
"; - $db->free($resql); - } - else - { - dolibarr_print_error($db); - } - } - } $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/societe/lien.php b/htdocs/societe/lien.php index 651962c82dc..64f037a4fca 100644 --- a/htdocs/societe/lien.php +++ b/htdocs/societe/lien.php @@ -67,202 +67,201 @@ llxHeader(); if($_GET["socid"]) { - - $soc = new Societe($db); - $soc->id = $_GET["socid"]; - $soc->fetch($_GET["socid"]); - - - $head[0][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id; - $head[0][1] = $langs->trans("Company"); - $h = 1; - - $head[$h][0] = 'lien.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("Links"); - $h++; - - $head[$h][0] = 'commerciaux.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("SalesRepresentative"); - $h++; - - $head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$soc->id; - $head[$h][1] = $langs->trans("Note"); - $h++; - - - - dolibarr_fiche_head($head, 1, $soc->nom); - - /* - * Fiche société en mode visu - */ - - print ''; - print ''; - - print ""; - - print ""; - print ""; - - print ""; - - print ''; - print ''; - + + $soc = new Societe($db); + $soc->id = $_GET["socid"]; + $soc->fetch($_GET["socid"]); + + $h=0; + + $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Company"); + $h++; + + $head[$h][0] = DOL_URL_ROOT .'/societe/rib.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("BankAccount")." $account->number"; + $h++; + + $head[$h][0] = 'lien.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("Links"); + $hselected=$h; + $h++; + + $head[$h][0] = 'commerciaux.php?socid='.$soc->id; + $head[$h][1] = $langs->trans("SalesRepresentative"); + $h++; + + + dolibarr_fiche_head($head, $hselected, $soc->nom); + + /* + * Fiche société en mode visu + */ + + print '
'.$langs->trans('Name').''.$soc->nom.''.$langs->trans('Prefix').''.$soc->prefix_comm.'
".$langs->trans('Address')."".nl2br($soc->adresse)."
".$langs->trans('Zip')."".$soc->cp."".$langs->trans('Town')."".$soc->ville."
".$langs->trans('Country')."".$soc->pays."
'.$langs->trans('Phone').''.dolibarr_print_phone($soc->tel).''.$langs->trans('Fax').''.dolibarr_print_phone($soc->fax).'
'; + print ''; + print ''; + + print ""; + + print ""; + print ""; + + print ""; + + print ''; + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + print ''; + + print ''; - - print ''; - - print ''; - - print ''; - - print ''; - print ''; - - if ($soc->parent > 0) + print ''; + + print '
'.$langs->trans('Name').''.$soc->nom.'
'; - print $langs->trans('Code client').''; + print $langs->trans('CustomerCode').''; print $soc->code_client; - if ($soc->check_codeclient() <> 0) + if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); + print ''.$langs->trans('Prefix').''.$soc->prefix_comm.'
".$langs->trans('Address')."".nl2br($soc->adresse)."
".$langs->trans('Zip')."".$soc->cp."".$langs->trans('Town')."".$soc->ville."
".$langs->trans('Country')."".$soc->pays."
'.$langs->trans('Phone').''.dolibarr_print_phone($soc->tel).''.$langs->trans('Fax').''.dolibarr_print_phone($soc->fax).'
'.$langs->trans('Web').''; + if ($soc->url) { print 'http://'.$soc->url.''; } + print '
'.$langs->transcountry('ProfId1',$soc->pays_code).''.$soc->siren.' '.$langs->transcountry('ProfId2',$soc->pays_code).''.$soc->siret.'
'.$langs->transcountry('ProfId3',$soc->pays_code).''.$soc->ape.' 
'.$langs->trans("Capital").''.$soc->capital.' '.$conf->monnaie.'
'.$langs->trans("ParentCompany").''; + if ($soc->parent) { - print $langs->trans("WrongCode"); + $socm = new Societe($db); + $socm->fetch($soc->parent); + print ''.img_object($langs->trans("ShowCompany"),'company').' '.$socm->nom.''.($socm->code_client?"(".$socm->code_client.")":"").' - '.$socm->ville; } - print '
'.$langs->trans('Web').''; - if ($soc->url) { print 'http://'.$soc->url.''; } - print '
'.$langs->transcountry('ProfId1',$soc->pays_code).''.$soc->siren.' '.$langs->transcountry('ProfId2',$soc->pays_code).''.$soc->siret.'
'.$langs->transcountry('ProfId3',$soc->pays_code).''.$soc->ape.' 
'.$langs->trans("Capital").''.$soc->capital.' '.$conf->monnaie.'
'; + print "
\n"; + + + if ($_GET["select"] > 0) { - $socm = new Societe($db); - $socm->fetch($soc->parent); - - print ''.$langs->trans("ParentCompany").''.$socm->nom_url.' '.($socm->code_client?"(".$socm->code_client.")":"").'
'.$socm->ville.''; + $socm = new Societe($db); + $socm->id = $_GET["select"]; + $socm->fetch($_GET["select"]); } - - print ''; - print "
\n"; - - - if ($_GET["select"] > 0) + else { - $socm = new Societe($db); - $socm->id = $_GET["select"]; - $socm->fetch($_GET["select"]); + if ($user->rights->societe->creer) + { + + $page=$_GET["page"]; + + if ($page == -1) { $page = 0 ; } + + $offset = $conf->liste_limit * $page ; + $pageprev = $page - 1; + $pagenext = $page + 1; + + /* + * Liste + * + */ + + $title=$langs->trans("CompanyList"); + + $sql = "SELECT s.idp, s.nom, s.ville, s.prefix_comm, s.client, s.fournisseur, te.libelle"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql .= " , ".MAIN_DB_PREFIX."c_typent as te"; + $sql .= " WHERE s.fk_typent = te.id"; + + if (strlen(trim($_GET["search_nom"]))) + { + $sql .= " AND s.nom LIKE '%".$_GET["search_nom"]."%'"; + } + + $sql .= " ORDER BY s.nom ASC " . $db->plimit($conf->liste_limit+1, $offset); + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows(); + $i = 0; + + $params = "&socid=".$_GET["socid"]; + + print_barre_liste($title, $page, "lien.php",$params,$sortfield,$sortorder,'',$num); + + // Lignes des titres + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + // Lignes des champs de filtre + print ''; + print ''; + print ''; + print ''; + print "\n"; + print ''; + + $var=True; + + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object(); + $var=!$var; + print "\n"; + print "\n"; + print "\n"; + print ''; + + print ''."\n"; + $i++; + } + + print "
'.$langs->trans("Company").''.$langs->trans("Town").'Type'; + print ' 
'; + print ''; + print ''; + print ''; + print '
"; + print stripslashes($obj->nom)."".$obj->ville." ".$obj->libelle." '; + if ($obj->client==1) + { + print $langs->trans("Customer")."\n"; + } + elseif ($obj->client==2) + { + print $langs->trans("Prospect")."\n"; + } + else + { + print " "; + } + print ""; + if ($obj->fournisseur) + { + print $langs->trans("Supplier"); + } + else + { + print " "; + } + + print ''.$langs->trans("Select").'
"; + $db->free(); + } + else + { + dolibarr_print_error($db); + } + } } - else - { - if ($user->rights->societe->creer) - { - - $page=$_GET["page"]; - - if ($page == -1) { $page = 0 ; } - - $offset = $conf->liste_limit * $page ; - $pageprev = $page - 1; - $pagenext = $page + 1; - - /* - * Liste - * - */ - - $title=$langs->trans("CompanyList"); - - $sql = "SELECT s.idp, s.nom, s.ville, s.prefix_comm, s.client, s.fournisseur, te.libelle"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql .= " , ".MAIN_DB_PREFIX."c_typent as te"; - $sql .= " WHERE s.fk_typent = te.id"; - - if (strlen(trim($_GET["search_nom"]))) - { - $sql .= " AND s.nom LIKE '%".$_GET["search_nom"]."%'"; - } - - $sql .= " ORDER BY s.nom ASC " . $db->plimit($conf->liste_limit+1, $offset); - - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows(); - $i = 0; - - $params = "&socid=".$_GET["socid"]; - - print_barre_liste($title, $page, "lien.php",$params,$sortfield,$sortorder,'',$num); - - // Lignes des titres - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - // Lignes des champs de filtre - print ''; - print ''; - print ''; - print ''; - print "\n"; - print ''; - - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object(); - $var=!$var; - print "\n"; - print "\n"; - print "\n"; - print ''; - - print ''."\n"; - $i++; - } - - print "
'.$langs->trans("Company").''.$langs->trans("Town").'Type'; - print ' 
'; - print ''; - print ''; - print ''; - print '
"; - print stripslashes($obj->nom)."".$obj->ville." ".$obj->libelle." '; - if ($obj->client==1) - { - print $langs->trans("Customer")."\n"; - } - elseif ($obj->client==2) - { - print $langs->trans("Prospect")."\n"; - } - else - { - print " "; - } - print ""; - if ($obj->fournisseur) - { - print $langs->trans("Supplier"); - } - else - { - print " "; - } - - print ''.$langs->trans("Select").'
"; - $db->free(); - } - else - { - dolibarr_print_error($db); - } - } - } } $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index aea896e27d1..67a275ae074 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -83,15 +83,24 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"]) */ $h = 0; -$head[0][0] = DOL_URL_ROOT .'/soc.php?socid='.$soc->id; -$head[0][1] = $langs->trans("Company"); -$h = 1; +$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id; +$head[$h][1] = $langs->trans("Company"); +$h++; $head[$h][0] = DOL_URL_ROOT .'/societe/rib.php?socid='.$soc->id; $head[$h][1] = $langs->trans("BankAccount")." $account->number"; +$hselected=$h; $h++; -dolibarr_fiche_head($head, 1, $soc->nom); +$head[$h][0] = 'lien.php?socid='.$soc->id; +$head[$h][1] = $langs->trans("Links"); +$h++; + +$head[$h][0] = 'commerciaux.php?socid='.$soc->id; +$head[$h][1] = $langs->trans("SalesRepresentative"); +$h++; + +dolibarr_fiche_head($head, $hselected, $soc->nom); $account = new CompanyBankAccount($db, $soc->id); $account->fetch(); @@ -103,126 +112,124 @@ $account->fetch(); /* */ /* ************************************************************************** */ - if ($_GET["socid"] && $_GET["action"] != 'edit') +if ($_GET["socid"] && $_GET["action"] != 'edit') +{ + if (!$account->verif()) { + print '
Le contrôle de la clé indique que les informations de ce compte bancaire sont incomplètes ou incorrectes.

'; + } - if (!$account->verif()) - { - print '
Le contrôle de la clé indique que les informations de ce compte bancaire sont incomplètes ou incorrectes.

'; - } + print ''; + + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + + print ''; + print ''; + + print '\n"; + + print '\n"; + + print '\n"; - print '
'.$langs->trans("Bank").''.$account->bank.'
'.$langs->trans("RIB").'Code BanqueCode GuichetNuméroClé RIB
 '.$account->code_banque.''.$account->code_guichet.''.$account->number.''.$account->cle_rib.'
'.$langs->trans("IBAN").''.$account->iban_prefix.'
'.$langs->trans("BIC").''.$account->bic.'
Domiciliation'; + print $account->domiciliation; + print "
Nom propriétaire du compte'; + print $account->proprio; + print "
Adresse propriétaire du compte'; + print $account->adresse_proprio; + print "
'; - - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - - print ''; - print ''; - - print '\n"; - - print '\n"; - - print '\n"; - print '
'.$langs->trans("Bank").''.$account->bank.'
'.$langs->trans("RIB").'Code BanqueCode GuichetNuméroClé RIB
 '.$account->code_banque.''.$account->code_guichet.''.$account->number.''.$account->cle_rib.'
'.$langs->trans("IBAN").''.$account->iban_prefix.'
'.$langs->trans("BIC").''.$account->bic.'
Domiciliation'; - print $account->domiciliation; - print "
Nom propriétaire du compte'; - print $account->proprio; - print "
Adresse propriétaire du compte'; - print $account->adresse_proprio; - print "
'; print '
'; - + print ''; - + /* - * Barre d'actions - * - */ + * Barre d'actions + * + */ print '
'; - if ($user->rights->societe->creer) - { - print ''.$langs->trans("Edit").''; - } + if ($user->rights->societe->creer) + { + print ''.$langs->trans("Edit").''; + } print '
'; - } +} - /* ************************************************************************** */ - /* */ - /* Edition */ - /* */ - /* ************************************************************************** */ - - if ($_GET["socid"] && $_GET["action"] == 'edit' && $user->rights->societe->creer) - { +/* ************************************************************************** */ +/* */ +/* Edition */ +/* */ +/* ************************************************************************** */ - $form = new Form($db); - - if ($message) { print "$message

\n"; } - - print '
'; - print ''; - print ''; - - print ''; - - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - - print ''; - print ''; - - print '"; - - print ''; - print ''; - print "\n"; - - print '"; - - print ''; +if ($_GET["socid"] && $_GET["action"] == 'edit' && $user->rights->societe->creer) +{ - print ''; - print '
'.$langs->trans("Bank").'
'.$langs->trans("RIB").'Code BanqueCode GuichetNuméroClé RIB
 
'.$langs->trans("IBAN").'
'.$langs->trans("BIC").'
Domiciliation'; - print "
Nom propriétaire du compte
Adresse propriétaire du compte'; - print "
'; - print '   '; - print '

'; - } - + $form = new Form($db); + if ($message) { print "$message

\n"; } + + print '
'; + print ''; + print ''; + + print ''; + + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + + print ''; + print ''; + + print '"; + + print ''; + print ''; + print "\n"; + + print '"; + + print ''; + + print ''; + print '
'.$langs->trans("Bank").'
'.$langs->trans("RIB").'Code BanqueCode GuichetNuméroClé RIB
 
'.$langs->trans("IBAN").'
'.$langs->trans("BIC").'
Domiciliation'; + print "
Nom propriétaire du compte
Adresse propriétaire du compte'; + print "
'; + print '   '; + print '

'; +} $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); + +llxFooter('$Date$ - $Revision$'); ?>