New: Ajout du lien édition rib, maison mère, commerciaux sur fiche société.

This commit is contained in:
Laurent Destailleur 2005-06-25 15:34:51 +00:00
parent 3acef1fd50
commit e5f0dc9efb
4 changed files with 615 additions and 569 deletions

View File

@ -412,9 +412,11 @@ else
$soc->fetch($_GET["socid"]); $soc->fetch($_GET["socid"]);
} }
$head[0][0] = 'soc.php?socid='.$soc->id; $h=0;
$head[0][1] = $langs->trans("Company");
$h = 1; $head[$h][0] = 'soc.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Company");
$h++;
if ($soc->client==1) if ($soc->client==1)
{ {
@ -537,11 +539,62 @@ else
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>&nbsp;"; // RIB
print $langs->trans('RIB').'</td><td colspan="3">'; 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 $soc->display_rib();
print '</td></tr>'; print '</td></tr>';
// 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 '</table>';
print "<br></div>\n"; print "<br></div>\n";
/* /*
@ -552,10 +605,6 @@ else
print '<div class="tabsAction">'; print '<div class="tabsAction">';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$soc->id.'">'.$langs->trans("SalesRepresentative").'</a>';
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.'&amp;action=edit">'.$langs->trans("Edit").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/soc.php?socid='.$soc->id.'&amp;action=edit">'.$langs->trans("Edit").'</a>';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$soc->id.'&amp;action=create">'.$langs->trans("AddContact").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$soc->id.'&amp;action=create">'.$langs->trans("AddContact").'</a>';
@ -567,13 +616,13 @@ else
} }
print '</div>'; print '</div>';
} }
/*
*
*/
} }
$db->close(); $db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?> ?>

View File

@ -85,15 +85,19 @@ llxHeader();
if($_GET["socid"]) if($_GET["socid"])
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->id = $_GET["socid"]; $soc->id = $_GET["socid"];
$soc->fetch($_GET["socid"]); $soc->fetch($_GET["socid"]);
$h=0;
$head[0][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id; $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id;
$head[0][1] = $langs->trans("Company"); $head[$h][1] = $langs->trans("Company");
$h = 1; $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][0] = 'lien.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Links"); $head[$h][1] = $langs->trans("Links");
@ -101,20 +105,23 @@ if($_GET["socid"])
$head[$h][0] = 'commerciaux.php?socid='.$soc->id; $head[$h][0] = 'commerciaux.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("SalesRepresentative"); $head[$h][1] = $langs->trans("SalesRepresentative");
$hselected=$h;
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$soc->id; dolibarr_fiche_head($head, $hselected, $soc->nom);
$head[$h][1] = $langs->trans("Note");
$h++;
dolibarr_fiche_head($head, 2, $soc->nom);
/* /*
* Fiche société en mode visu * Fiche société en mode visu
*/ */
print '<table class="border" width="100%">'; 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 width="20%">'.$langs->trans('Name').'</td><td colspan="3">'.$soc->nom.'</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 valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>"; print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>";
@ -126,28 +133,14 @@ if($_GET["socid"])
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel).'</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 '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax).'</td></tr>';
print '<tr><td>';
print $langs->trans('CustomerCode').'</td><td colspan="3">';
print $soc->code_client;
if ($soc->check_codeclient() <> 0)
{
print $langs->trans("WrongCode");
}
print '</td></tr>';
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; } if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
print '</td></tr>'; print '</td></tr>';
if ($soc->parent > 0)
{
$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>';
}
// Liste les commerciaux // 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 = "SELECT u.rowid, u.name, u.firstname";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -155,9 +148,6 @@ if($_GET["socid"])
$sql .= " AND sc.fk_user = u.rowid"; $sql .= " AND sc.fk_user = u.rowid";
$sql .= " ORDER BY u.name ASC "; $sql .= " ORDER BY u.name ASC ";
print '<tr><td valign="top">'.$langs->trans("SalesRepresentatives").'</td>';
print '<td colspan="3">';
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
@ -184,6 +174,7 @@ if($_GET["socid"])
dolibarr_print_error($db); dolibarr_print_error($db);
} }
if($i == 0) { print $langs->trans("NoSalesRepresentativeAffected"); } if($i == 0) { print $langs->trans("NoSalesRepresentativeAffected"); }
print "</td></tr>"; print "</td></tr>";
@ -254,5 +245,5 @@ if($_GET["socid"])
$db->close(); $db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>"); llxFooter('$Date$ - $Revision$');
?> ?>

View File

@ -72,33 +72,40 @@ if($_GET["socid"])
$soc->id = $_GET["socid"]; $soc->id = $_GET["socid"];
$soc->fetch($_GET["socid"]); $soc->fetch($_GET["socid"]);
$h=0;
$head[0][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id; $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id;
$head[0][1] = $langs->trans("Company"); $head[$h][1] = $langs->trans("Company");
$h = 1; $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][0] = 'lien.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Links"); $head[$h][1] = $langs->trans("Links");
$hselected=$h;
$h++; $h++;
$head[$h][0] = 'commerciaux.php?socid='.$soc->id; $head[$h][0] = 'commerciaux.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("SalesRepresentative"); $head[$h][1] = $langs->trans("SalesRepresentative");
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Note");
$h++;
dolibarr_fiche_head($head, $hselected, $soc->nom);
dolibarr_fiche_head($head, 1, $soc->nom);
/* /*
* Fiche société en mode visu * Fiche société en mode visu
*/ */
print '<table class="border" width="100%">'; 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 width="20%">'.$langs->trans('Name').'</td><td colspan="3">'.$soc->nom.'</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 valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>"; print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>";
@ -110,15 +117,6 @@ if($_GET["socid"])
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel).'</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 '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax).'</td></tr>';
print '<tr><td>';
print $langs->trans('Code client').'</td><td colspan="3">';
print $soc->code_client;
if ($soc->check_codeclient() <> 0)
{
print $langs->trans("WrongCode");
}
print '</td></tr>';
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; } if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
print '</td></tr>'; print '</td></tr>';
@ -130,13 +128,14 @@ if($_GET["socid"])
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td>'.$soc->ape.'</td><td colspan="2">&nbsp;</td></tr>'; print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td>'.$soc->ape.'</td><td colspan="2">&nbsp;</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>';
if ($soc->parent > 0) print '<tr><td>'.$langs->trans("ParentCompany").'</td><td colspan="3">';
if ($soc->parent)
{ {
$socm = new Societe($db); $socm = new Societe($db);
$socm->fetch($soc->parent); $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 '<tr><td>'.$langs->trans("ParentCompany").'</td><td colspan="3">'.$socm->nom_url.' '.($socm->code_client?"(".$socm->code_client.")":"").'<br />'.$socm->ville.'</td></tr>';
} }
print '</td></tr>';
print '</table>'; print '</table>';
print "<br></div>\n"; print "<br></div>\n";
@ -264,5 +263,5 @@ if($_GET["socid"])
$db->close(); $db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>"); llxFooter('$Date$ - $Revision$');
?> ?>

View File

@ -83,15 +83,24 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
*/ */
$h = 0; $h = 0;
$head[0][0] = DOL_URL_ROOT .'/soc.php?socid='.$soc->id; $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id;
$head[0][1] = $langs->trans("Company"); $head[$h][1] = $langs->trans("Company");
$h = 1; $h++;
$head[$h][0] = DOL_URL_ROOT .'/societe/rib.php?socid='.$soc->id; $head[$h][0] = DOL_URL_ROOT .'/societe/rib.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("BankAccount")." $account->number"; $head[$h][1] = $langs->trans("BankAccount")." $account->number";
$hselected=$h;
$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 = new CompanyBankAccount($db, $soc->id);
$account->fetch(); $account->fetch();
@ -103,9 +112,8 @@ $account->fetch();
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
if ($_GET["socid"] && $_GET["action"] != 'edit') if ($_GET["socid"] && $_GET["action"] != 'edit')
{ {
if (!$account->verif()) 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 '<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>';
@ -160,16 +168,16 @@ $account->fetch();
print '</div>'; print '</div>';
} }
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* Edition */ /* Edition */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
if ($_GET["socid"] && $_GET["action"] == 'edit' && $user->rights->societe->creer) if ($_GET["socid"] && $_GET["action"] == 'edit' && $user->rights->societe->creer)
{ {
$form = new Form($db); $form = new Form($db);
@ -216,13 +224,12 @@ $account->fetch();
print '</form>'; print '</form>';
print '</table><br>'; print '</table><br>';
} }
$db->close(); $db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?> ?>