New: Ajout du lien dition rib, maison mre, commerciaux sur fiche socit.
This commit is contained in:
parent
3acef1fd50
commit
e5f0dc9efb
293
htdocs/soc.php
293
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 "<br />\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 '<div class="error">';
|
||||
print $soc->error;
|
||||
print '</div>';
|
||||
$html = new Form($db);
|
||||
$html->form_confirm("soc.php?socid=".$soc->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete");
|
||||
print "<br />\n";
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans('Name').'</td><td colspan="3">'.$soc->nom.'</td></tr>';
|
||||
if ($soc->error)
|
||||
{
|
||||
print '<div class="error">';
|
||||
print $soc->error;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CustomerCode').'</td><td width="20%">';
|
||||
print $soc->code_client;
|
||||
if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode");
|
||||
print '</td><td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td></tr>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>";
|
||||
print '<tr><td width="20%">'.$langs->trans('Name').'</td><td colspan="3">'.$soc->nom.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>'.$soc->cp."</td>";
|
||||
print '<td>'.$langs->trans('Town').'</td><td>'.$soc->ville."</td></tr>";
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CustomerCode').'</td><td width="20%">';
|
||||
print $soc->code_client;
|
||||
if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode");
|
||||
print '</td><td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->pays.'</td>';
|
||||
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel).'</td>';
|
||||
print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>'.$soc->cp."</td>";
|
||||
print '<td>'.$langs->trans('Town').'</td><td>'.$soc->ville."</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
|
||||
if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->transcountry('ProfId1',$soc->pays_code).'</td><td>';
|
||||
// Si société FR et siren fourni, on le vérifie
|
||||
if ($soc->pays_code == "FR" && $soc->siren) {
|
||||
if ($soc->check_siren() == 0)
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->pays.'</td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel).'</td>';
|
||||
print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
|
||||
if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->transcountry('ProfId1',$soc->pays_code).'</td><td>';
|
||||
// Si société FR et siren fourni, on le vérifie
|
||||
if ($soc->pays_code == "FR" && $soc->siren) {
|
||||
if ($soc->check_siren() == 0)
|
||||
{
|
||||
print '<a target="_blank" href="http://www.societe.com/cgi-bin/recherche?rncs='.$soc->siren.'">'.$soc->siren.'</a> ';
|
||||
print '<a target="_blank" href="http://www.societe.com/cgi-bin/recherche?rncs='.$soc->siren.'">'.$soc->siren.'</a> ';
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print '<a class="error">'.$soc->siren;
|
||||
// Siren invalide
|
||||
print " Code Siren Invalide !</a>";
|
||||
print '<a class="error">'.$soc->siren;
|
||||
// Siren invalide
|
||||
print " Code Siren Invalide !</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {
|
||||
print $soc->siren;
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$langs->transcountry('ProfId2',$soc->pays_code).'</td><td>'.$soc->siret.'</td></tr>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$langs->transcountry('ProfId2',$soc->pays_code).'</td><td>'.$soc->siret.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td>'.$soc->ape.'</td><td colspan="2"> </td></tr>';
|
||||
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td>'.$soc->ape.'</td><td colspan="2"> </td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('TVAIntra').'</td><td colspan="3">';
|
||||
print $soc->tva_intra;
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('TVAIntra').'</td><td colspan="3">';
|
||||
print $soc->tva_intra;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3">'.$soc->capital.' '.$conf->monnaie.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3">'.$soc->capital.' '.$conf->monnaie.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">'.$soc->forme_juridique.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">'.$soc->forme_juridique.'</td></tr>';
|
||||
|
||||
$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 '<tr><td>'.$langs->trans("Type").'</td><td>'.$soc->typent.'</td><td>'.$langs->trans("Staff").'</td><td>'.$soc->effectif.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td>'.$soc->typent.'</td><td>'.$langs->trans("Staff").'</td><td>'.$soc->effectif.'</td></tr>';
|
||||
|
||||
print '<tr><td><a href="'.DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id.'">'.img_edit() ."</a> ";
|
||||
print $langs->trans('RIB').'</td><td colspan="3">';
|
||||
print $soc->display_rib();
|
||||
print '</td></tr>';
|
||||
// RIB
|
||||
print '<tr><td>';
|
||||
print '<table width="100%" class="noborder" cellpadding="0" cellspacing="0" border="0"><tr><td>';
|
||||
print $langs->trans('RIB');
|
||||
print '<td><td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id.'">'.img_edit().'</a>';
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="3">';
|
||||
print $soc->display_rib();
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print "<br></div>\n";
|
||||
/*
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == '')
|
||||
// Maison mère
|
||||
print '<tr><td>';
|
||||
print '<table width="100%" class="noborder" cellpadding="0" cellspacing="0" border="0"><tr><td>';
|
||||
print $langs->trans('ParentCompany');
|
||||
print '<td><td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/societe/lien.php?socid='.$soc->id.'">'.img_edit() .'</a>';
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="3">';
|
||||
if ($soc->parent)
|
||||
{
|
||||
$socm = new Societe($db);
|
||||
$socm->fetch($soc->parent);
|
||||
print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$socm->idp.'">'.img_object($langs->trans("ShowCompany"),'company').' '.$socm->nom.'</a>'.($socm->code_client?"(".$socm->code_client.")":"").' - '.$socm->ville;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Commerciaux
|
||||
print '<tr><td>';
|
||||
print '<table width="100%" class="noborder" cellpadding="0" cellspacing="0" border="0"><tr><td>';
|
||||
print $langs->trans('SalesRepresentative');
|
||||
print '<td><td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$soc->id.'">'.img_edit().'</a>';
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="3">';
|
||||
|
||||
$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 '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$soc->id.'">'.$obj->nb.'</a>';
|
||||
}
|
||||
else {
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
print "<br></div>\n";
|
||||
/*
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == '')
|
||||
{
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$soc->id.'">'.$langs->trans("SalesRepresentative").'</a>';
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/societe/lien.php?socid='.$soc->id.'">'.$langs->trans("ParentCompany").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/soc.php?socid='.$soc->id.'&action=edit">'.$langs->trans("Edit").'</a>';
|
||||
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/soc.php?socid='.$soc->id.'&action=edit">'.$langs->trans("Edit").'</a>';
|
||||
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddContact").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddContact").'</a>';
|
||||
|
||||
if ($user->rights->societe->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.DOL_URL_ROOT.'/soc.php?socid='.$soc->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
if ($user->rights->societe->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.DOL_URL_ROOT.'/soc.php?socid='.$soc->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@ -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 '<table class="border" width="100%">';
|
||||
print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td></tr>';
|
||||
|
||||
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>'.$soc->cp."</td>";
|
||||
print '<td>'.$langs->trans('Town').'</td><td>'.$soc->ville."</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->pays.'</td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel).'</td>';
|
||||
print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax).'</td></tr>';
|
||||
|
||||
$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 '<table class="border" width="100%">';
|
||||
print '<tr><td width="20%">'.$langs->trans('Name').'</td><td colspan="3">'.$soc->nom.'</td></tr>';
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
||||
print $langs->trans('CustomerCode').'</td><td width="20%">';
|
||||
print $soc->code_client;
|
||||
if ($soc->check_codeclient() <> 0)
|
||||
{
|
||||
print $langs->trans("WrongCode");
|
||||
}
|
||||
print '</td></tr>';
|
||||
if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode");
|
||||
print '</td><td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
|
||||
if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
|
||||
print '</td></tr>';
|
||||
|
||||
if ($soc->parent > 0)
|
||||
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>'.$soc->cp."</td>";
|
||||
print '<td>'.$langs->trans('Town').'</td><td>'.$soc->ville."</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->pays.'</td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel).'</td>';
|
||||
print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
|
||||
if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
|
||||
print '</td></tr>';
|
||||
|
||||
// Liste les commerciaux
|
||||
print '<tr><td valign="top">'.$langs->trans("SalesRepresentatives").'</td>';
|
||||
print '<td colspan="3">';
|
||||
|
||||
$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 '<tr><td>'.$langs->trans("ParentCompany").'</td><td>'.$socm->nom_url.' ('.$socm->code_client.')<br />'.$socm->ville.'</td></tr>';
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">';
|
||||
print img_object($langs->trans("ShowUser"),"user").' ';
|
||||
print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n";
|
||||
print '</a> ';
|
||||
print '<a href="commerciaux.php?socid='.$_GET["socid"].'&delcommid='.$obj->rowid.'">';
|
||||
print img_delete();
|
||||
print '</a><br>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
if($i == 0) { print $langs->trans("NoSalesRepresentativeAffected"); }
|
||||
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
print '</table>';
|
||||
print "<br></div>\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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Code").'</td>';
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">';
|
||||
print img_object($langs->trans("ShowUser"),"user").' ';
|
||||
print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n";
|
||||
print '</a>';
|
||||
print '</td><td>'.$obj->code.'</td>';
|
||||
print '<td><a href="commerciaux.php?socid='.$_GET["socid"].'&commid='.$obj->rowid.'">'.$langs->trans("Add").'</a></td>';
|
||||
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
$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 '<tr><td valign="top">'.$langs->trans("SalesRepresentatives").'</td>';
|
||||
print '<td colspan="3">';
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">';
|
||||
print img_object($langs->trans("ShowUser"),"user").' ';
|
||||
print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n";
|
||||
print '</a> ';
|
||||
print '<a href="commerciaux.php?socid='.$_GET["socid"].'&delcommid='.$obj->rowid.'">';
|
||||
print img_delete();
|
||||
print '</a><br>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
if($i == 0) { print $langs->trans("NoSalesRepresentativeAffected"); }
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
print '</table>';
|
||||
print "<br></div>\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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Code").'</td>';
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">';
|
||||
print img_object($langs->trans("ShowUser"),"user").' ';
|
||||
print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n";
|
||||
print '</a>';
|
||||
print '</td><td>'.$obj->code.'</td>';
|
||||
print '<td><a href="commerciaux.php?socid='.$_GET["socid"].'&commid='.$obj->rowid.'">'.$langs->trans("Add").'</a></td>';
|
||||
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@ -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 '<table class="border" width="100%">';
|
||||
print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td></tr>';
|
||||
|
||||
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>";
|
||||
|
||||
print "<tr><td>".$langs->trans('Zip')."</td><td>".$soc->cp."</td>";
|
||||
print "<td>".$langs->trans('Town')."</td><td>".$soc->ville."</td></tr>";
|
||||
|
||||
print "<tr><td>".$langs->trans('Country')."</td><td colspan=\"3\">".$soc->pays."</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel).'</td>';
|
||||
print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax).'</td></tr>';
|
||||
|
||||
|
||||
$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 '<table class="border" width="100%">';
|
||||
print '<tr><td width="20%">'.$langs->trans('Name').'</td><td colspan="3">'.$soc->nom.'</td></tr>';
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans('Code client').'</td><td colspan="3">';
|
||||
print $langs->trans('CustomerCode').'</td><td width="20%">';
|
||||
print $soc->code_client;
|
||||
if ($soc->check_codeclient() <> 0)
|
||||
if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode");
|
||||
print '</td><td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td></tr>';
|
||||
|
||||
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>";
|
||||
|
||||
print "<tr><td>".$langs->trans('Zip')."</td><td>".$soc->cp."</td>";
|
||||
print "<td>".$langs->trans('Town')."</td><td>".$soc->ville."</td></tr>";
|
||||
|
||||
print "<tr><td>".$langs->trans('Country')."</td><td colspan=\"3\">".$soc->pays."</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel).'</td>';
|
||||
print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
|
||||
if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->transcountry('ProfId1',$soc->pays_code).'</td><td><a target="_blank" href="http://www.societe.com/cgi-bin/recherche?rncs='.$soc->siren.'">'.$soc->siren.'</a> </td>';
|
||||
|
||||
print '<td>'.$langs->transcountry('ProfId2',$soc->pays_code).'</td><td>'.$soc->siret.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td>'.$soc->ape.'</td><td colspan="2"> </td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Capital").'</td><td colspan="3">'.$soc->capital.' '.$conf->monnaie.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("ParentCompany").'</td><td colspan="3">';
|
||||
if ($soc->parent)
|
||||
{
|
||||
print $langs->trans("WrongCode");
|
||||
$socm = new Societe($db);
|
||||
$socm->fetch($soc->parent);
|
||||
print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$socm->idp.'">'.img_object($langs->trans("ShowCompany"),'company').' '.$socm->nom.'</a>'.($socm->code_client?"(".$socm->code_client.")":"").' - '.$socm->ville;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
|
||||
if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->transcountry('ProfId1',$soc->pays_code).'</td><td><a target="_blank" href="http://www.societe.com/cgi-bin/recherche?rncs='.$soc->siren.'">'.$soc->siren.'</a> </td>';
|
||||
|
||||
print '<td>'.$langs->transcountry('ProfId2',$soc->pays_code).'</td><td>'.$soc->siret.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td>'.$soc->ape.'</td><td colspan="2"> </td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Capital").'</td><td colspan="3">'.$soc->capital.' '.$conf->monnaie.'</td></tr>';
|
||||
|
||||
if ($soc->parent > 0)
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print "<br></div>\n";
|
||||
|
||||
|
||||
if ($_GET["select"] > 0)
|
||||
{
|
||||
$socm = new Societe($db);
|
||||
$socm->fetch($soc->parent);
|
||||
|
||||
print '<tr><td>'.$langs->trans("ParentCompany").'</td><td colspan="3">'.$socm->nom_url.' '.($socm->code_client?"(".$socm->code_client.")":"").'<br />'.$socm->ville.'</td></tr>';
|
||||
$socm = new Societe($db);
|
||||
$socm->id = $_GET["select"];
|
||||
$socm->fetch($_GET["select"]);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print "<br></div>\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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Company").'</td>';
|
||||
print '<td>'.$langs->trans("Town").'</td>';
|
||||
print '<td>Type<td>';
|
||||
print '<td colspan="2" align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<form action="lien.php" method="GET" >';
|
||||
print '<input type="hidden" name="socid" value="'.$_GET["socid"].'">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td valign="right">';
|
||||
print '<input type="text" name="search_nom" value="'.stripslashes($search_nom).'">';
|
||||
print '</td><td colspan="5" align="center">';
|
||||
print '<input type="submit" class="button" name="button_search" value="'.$langs->trans("Search").'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
|
||||
$var=True;
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
print stripslashes($obj->nom)."</td>\n";
|
||||
print "<td>".$obj->ville." </td>\n";
|
||||
print "<td>".$obj->libelle." </td>\n";
|
||||
print '<td align="center">';
|
||||
if ($obj->client==1)
|
||||
{
|
||||
print $langs->trans("Customer")."\n";
|
||||
}
|
||||
elseif ($obj->client==2)
|
||||
{
|
||||
print $langs->trans("Prospect")."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
print "</td><td align=\"center\">";
|
||||
if ($obj->fournisseur)
|
||||
{
|
||||
print $langs->trans("Supplier");
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
|
||||
print '</td><td><a href="lien.php?socid='.$_GET["socid"].'&select='.$obj->idp.'">'.$langs->trans("Select").'</a></td>';
|
||||
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
$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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Company").'</td>';
|
||||
print '<td>'.$langs->trans("Town").'</td>';
|
||||
print '<td>Type<td>';
|
||||
print '<td colspan="2" align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<form action="lien.php" method="GET" >';
|
||||
print '<input type="hidden" name="socid" value="'.$_GET["socid"].'">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td valign="right">';
|
||||
print '<input type="text" name="search_nom" value="'.stripslashes($search_nom).'">';
|
||||
print '</td><td colspan="5" align="center">';
|
||||
print '<input type="submit" class="button" name="button_search" value="'.$langs->trans("Search").'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
|
||||
$var=True;
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
print stripslashes($obj->nom)."</td>\n";
|
||||
print "<td>".$obj->ville." </td>\n";
|
||||
print "<td>".$obj->libelle." </td>\n";
|
||||
print '<td align="center">';
|
||||
if ($obj->client==1)
|
||||
{
|
||||
print $langs->trans("Customer")."\n";
|
||||
}
|
||||
elseif ($obj->client==2)
|
||||
{
|
||||
print $langs->trans("Prospect")."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
print "</td><td align=\"center\">";
|
||||
if ($obj->fournisseur)
|
||||
{
|
||||
print $langs->trans("Supplier");
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
|
||||
print '</td><td><a href="lien.php?socid='.$_GET["socid"].'&select='.$obj->idp.'">'.$langs->trans("Select").'</a></td>';
|
||||
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@ -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 '<div class="error"><b>Le contrôle de la clé indique que les informations de ce compte bancaire sont incomplètes ou incorrectes.</b></div><br>';
|
||||
}
|
||||
|
||||
if (!$account->verif())
|
||||
{
|
||||
print '<div class="error"><b>Le contrôle de la clé indique que les informations de ce compte bancaire sont incomplètes ou incorrectes.</b></div><br>';
|
||||
}
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||
print '<td colspan="4">'.$account->bank.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("RIB").'</td><td align="center">Code Banque</td><td align="center">Code Guichet</td><td align="center">Numéro</td><td align="center">Clé RIB</td></tr>';
|
||||
print '<tr><td> </td><td align="center">'.$account->code_banque.'</td>';
|
||||
print '<td align="center">'.$account->code_guichet.'</td>';
|
||||
print '<td align="center">'.$account->number.'</td>';
|
||||
print '<td align="center">'.$account->cle_rib.'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="4">'.$account->iban_prefix.'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="4">'.$account->bic.'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">Domiciliation</td><td colspan="4">';
|
||||
print $account->domiciliation;
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">Nom propriétaire du compte</td><td colspan="4">';
|
||||
print $account->proprio;
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">Adresse propriétaire du compte</td><td colspan="4">';
|
||||
print $account->adresse_proprio;
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||
print '<td colspan="4">'.$account->bank.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("RIB").'</td><td align="center">Code Banque</td><td align="center">Code Guichet</td><td align="center">Numéro</td><td align="center">Clé RIB</td></tr>';
|
||||
print '<tr><td> </td><td align="center">'.$account->code_banque.'</td>';
|
||||
print '<td align="center">'.$account->code_guichet.'</td>';
|
||||
print '<td align="center">'.$account->number.'</td>';
|
||||
print '<td align="center">'.$account->cle_rib.'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="4">'.$account->iban_prefix.'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="4">'.$account->bic.'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">Domiciliation</td><td colspan="4">';
|
||||
print $account->domiciliation;
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">Nom propriétaire du compte</td><td colspan="4">';
|
||||
print $account->proprio;
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">Adresse propriétaire du compte</td><td colspan="4">';
|
||||
print $account->adresse_proprio;
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*
|
||||
*/
|
||||
* Barre d'actions
|
||||
*
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($user->rights->societe->creer)
|
||||
{
|
||||
print '<a class="tabAction" href="rib.php?socid='.$soc->id.'&action=edit">'.$langs->trans("Edit").'</a>';
|
||||
}
|
||||
if ($user->rights->societe->creer)
|
||||
{
|
||||
print '<a class="tabAction" href="rib.php?socid='.$soc->id.'&action=edit">'.$langs->trans("Edit").'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($_GET["socid"] && $_GET["action"] == 'edit' && $user->rights->societe->creer)
|
||||
{
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($message) { print "$message<br><br>\n"; }
|
||||
|
||||
print '<form action="rib.php?socid='.$soc->id.'" method="post">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="bank" value="'.$account->bank.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("RIB").'</td><td>Code Banque</td><td>Code Guichet</td><td>Numéro</td><td>Clé RIB</td></tr>';
|
||||
print '<tr><td> </td><td><input size="8" type="text" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '<td><input size="8" type="text" name="code_guichet" value="'.$account->code_guichet.'"></td>';
|
||||
print '<td><input size="15" type="text" name="number" value="'.$account->number.'"></td>';
|
||||
print '<td><input size="3" type="text" name="cle_rib" value="'.$account->cle_rib.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="4"><input size="5" type="text" name="iban_prefix" value="'.$account->iban_prefix.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="4"><input size="12" type="text" name="bic" value="'.$account->bic.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">Domiciliation</td><td colspan="4">';
|
||||
print "<textarea name=\"domiciliation\" rows=\"4\" cols=\"40\">";
|
||||
print $account->domiciliation;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td valign="top">Nom propriétaire du compte</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="proprio" value="'.$account->proprio.'"></td></tr>';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">Adresse propriétaire du compte</td><td colspan="4">';
|
||||
print "<textarea name=\"adresse_proprio\" rows=\"4\" cols=\"40\">";
|
||||
print $account->adresse_proprio;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td align="center" colspan="5"><input value="'.$langs->trans("Modify").'" type="submit">';
|
||||
print ' <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
|
||||
print '</td></tr>';
|
||||
if ($_GET["socid"] && $_GET["action"] == 'edit' && $user->rights->societe->creer)
|
||||
{
|
||||
|
||||
print '</form>';
|
||||
print '</table><br>';
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($message) { print "$message<br><br>\n"; }
|
||||
|
||||
print '<form action="rib.php?socid='.$soc->id.'" method="post">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="bank" value="'.$account->bank.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("RIB").'</td><td>Code Banque</td><td>Code Guichet</td><td>Numéro</td><td>Clé RIB</td></tr>';
|
||||
print '<tr><td> </td><td><input size="8" type="text" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '<td><input size="8" type="text" name="code_guichet" value="'.$account->code_guichet.'"></td>';
|
||||
print '<td><input size="15" type="text" name="number" value="'.$account->number.'"></td>';
|
||||
print '<td><input size="3" type="text" name="cle_rib" value="'.$account->cle_rib.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="4"><input size="5" type="text" name="iban_prefix" value="'.$account->iban_prefix.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="4"><input size="12" type="text" name="bic" value="'.$account->bic.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">Domiciliation</td><td colspan="4">';
|
||||
print "<textarea name=\"domiciliation\" rows=\"4\" cols=\"40\">";
|
||||
print $account->domiciliation;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td valign="top">Nom propriétaire du compte</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="proprio" value="'.$account->proprio.'"></td></tr>';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">Adresse propriétaire du compte</td><td colspan="4">';
|
||||
print "<textarea name=\"adresse_proprio\" rows=\"4\" cols=\"40\">";
|
||||
print $account->adresse_proprio;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td align="center" colspan="5"><input value="'.$langs->trans("Modify").'" type="submit">';
|
||||
print ' <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</form>';
|
||||
print '</table><br>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user