mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
NEW: [ task #851 ] Add a new field: Commercial name
This commit is contained in:
parent
a67d0f712c
commit
2ba795fcbc
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -248,6 +249,11 @@ if ($socid)
|
|||
print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom','','&type='.$type);
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr><td valign="top">'.$langs->trans('CommercialName').'</td><td colspan="3">';
|
||||
print $soc->commercial_name;
|
||||
print "</td></tr>";
|
||||
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$soc->prefix_comm.'</td></tr>';
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -219,6 +220,11 @@ if ($id > 0)
|
|||
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','','');
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr><td valign="top">'.$langs->trans('CommercialName').'</td><td colspan="3">';
|
||||
print $object->commercial_name;
|
||||
print "</td></tr>";
|
||||
|
||||
// Prospect/Customer
|
||||
print '<tr><td width="30%">'.$langs->trans('ProspectCustomer').'</td><td width="70%" colspan="3">';
|
||||
print $object->getLibCustProspStatut();
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -101,7 +102,7 @@ $thirdpartystatic=new Societe($db);
|
|||
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||
llxHeader('',$langs->trans("ThirdParty"),$help_url);
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.commercial_name, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
|
||||
$sql.= " s.datec, s.canvas";
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
|
|
@ -119,7 +120,13 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
|||
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
$sql .= natural_search(
|
||||
array(
|
||||
's.nom',
|
||||
's.commercial_name'
|
||||
),
|
||||
$search_company
|
||||
);
|
||||
}
|
||||
if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
|
||||
if ($search_town) {
|
||||
|
|
@ -255,6 +262,7 @@ if ($result)
|
|||
$thirdpartystatic->code_client=$obj->code_client;
|
||||
$thirdpartystatic->canvas=$obj->canvas;
|
||||
$thirdpartystatic->status=$obj->status;
|
||||
$thirdpartystatic->commercial_name=$obj->commercial_name;
|
||||
print $thirdpartystatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td>'.$obj->zip.'</td>';
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -194,7 +195,7 @@ if (empty($reshook)) {
|
|||
$formother=new FormOther($db);
|
||||
$form=new Form($db);
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,";
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.commercial_name, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,";
|
||||
$sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,";
|
||||
$sql.= " d.nom as departement";
|
||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
|
|
@ -214,7 +215,13 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
|||
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_nom) {
|
||||
$sql .= natural_search('s.nom', $search_nom);
|
||||
$sql .= natural_search(
|
||||
array(
|
||||
's.nom',
|
||||
's.commercial_name'
|
||||
),
|
||||
$search_nom
|
||||
);
|
||||
}
|
||||
if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'";
|
||||
if ($search_town) {
|
||||
|
|
@ -423,6 +430,7 @@ if ($resql)
|
|||
$prospectstatic->code_client=$obj->code_client;
|
||||
$prospectstatic->client=$obj->client;
|
||||
$prospectstatic->fk_prospectlevel=$obj->fk_prospectlevel;
|
||||
$prospectstatic->commercial_name=$obj->commercial_name;
|
||||
print $prospectstatic->getNomUrl(1,'prospect');
|
||||
print '</td>';
|
||||
print "<td>".$obj->zip." </td>";
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -147,6 +148,7 @@ abstract class CommonDocGenerator
|
|||
|
||||
$array_thirdparty = array(
|
||||
'company_name'=>$object->name,
|
||||
'company_commercial_name' => $object->commercial_name,
|
||||
'company_email'=>$object->email,
|
||||
'company_phone'=>$object->phone,
|
||||
'company_fax'=>$object->fax,
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -286,6 +287,33 @@ function pdf_getHeightForLogo($logo, $url = false)
|
|||
return $height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the thirdparty
|
||||
*
|
||||
* @param Societe|Contact $thirdparty
|
||||
* @param Translate $outputlangs
|
||||
* @return string
|
||||
*/
|
||||
function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs)
|
||||
{
|
||||
//Recipient name
|
||||
$socname = '';
|
||||
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($thirdparty instanceof Societe) {
|
||||
if (!empty($thirdparty->commercial_name)) {
|
||||
$socname = $thirdparty->commercial_name."\n";
|
||||
}
|
||||
|
||||
$socname .= $thirdparty->name;
|
||||
} elseif ($thirdparty instanceof Contact) {
|
||||
$socname = $thirdparty->socname;
|
||||
} else {
|
||||
throw new InvalidArgumentException();
|
||||
}
|
||||
|
||||
return $outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a string with full address formated
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1224,19 +1225,16 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->client;
|
||||
}
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1185,19 +1186,16 @@ class pdf_proforma extends ModelePDFCommandes
|
|||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->client;
|
||||
}
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011 Fabrice CHERRIER
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -588,17 +589,16 @@ class pdf_strato extends ModelePDFContract
|
|||
|
||||
$this->recipient = $object->client;
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact)) {
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$this->recipient->name = $outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else {
|
||||
$this->recipient->name = $outputlangs->convToOutputCharset($object->client->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->client;
|
||||
}
|
||||
|
||||
$this->recipient->name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');
|
||||
|
||||
// Show recipient
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -622,19 +623,16 @@ class pdf_merou extends ModelePdfExpedition
|
|||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->client;
|
||||
}
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,((!empty($object->contact))?$object->contact:null),$usecontact,'targetwithdetails');
|
||||
|
||||
$blDestX=$blExpX+55;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -639,19 +639,16 @@ class pdf_rouget extends ModelePdfExpedition
|
|||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->client;
|
||||
}
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,(!empty($object->contact)?$object->contact:null),$usecontact,'targetwithdetails');
|
||||
|
||||
// Show recipient
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1514,19 +1515,16 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->client;
|
||||
}
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011 Fabrice CHERRIER
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -609,19 +610,16 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->client;
|
||||
}
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');
|
||||
|
||||
// Show recipient
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2008 Chiptronik
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -820,19 +821,16 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->client;
|
||||
}
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1323,19 +1324,16 @@ class pdf_azur extends ModelePDFPropales
|
|||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->client;
|
||||
}
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1022,19 +1023,16 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $mysoc->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($mysoc->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $mysoc;
|
||||
}
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,((!empty($object->contact))?$object->contact:null),$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1071,19 +1072,16 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
|
||||
//Recipient name
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||
$thirdparty = $object->contact;
|
||||
} else {
|
||||
$thirdparty = $object->client;
|
||||
}
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -132,6 +133,11 @@ if ($object->id > 0)
|
|||
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','','');
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr><td valign="top">'.$langs->trans('CommercialName').'</td><td colspan="3">';
|
||||
print $object->commercial_name;
|
||||
print "</td></tr>";
|
||||
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ $thirdpartystatic=new Societe($db);
|
|||
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||
llxHeader('',$langs->trans("ThirdParty"),$help_url);
|
||||
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, ";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.commercial_name, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, ";
|
||||
$sql.= "code_fournisseur, code_compta_fournisseur";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
|
|
@ -109,7 +109,13 @@ if ($socname) {
|
|||
$sortorder = "ASC";
|
||||
}
|
||||
if ($search_name) {
|
||||
$sql .= natural_search('s.nom', $search_name);
|
||||
$sql .= natural_search(
|
||||
array(
|
||||
's.nom',
|
||||
's.commercial_name'
|
||||
),
|
||||
$search_name
|
||||
);
|
||||
}
|
||||
if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
|
||||
if ($search_town) {
|
||||
|
|
@ -216,6 +222,7 @@ if ($resql)
|
|||
$thirdpartystatic->id=$obj->socid;
|
||||
$thirdpartystatic->name=$obj->name;
|
||||
$thirdpartystatic->status=$obj->status;
|
||||
$thirdpartystatic->commercial_name=$obj->commercial_name;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td>';
|
||||
|
|
|
|||
|
|
@ -195,7 +195,8 @@ CREATE TABLE llx_expensereport_det
|
|||
|
||||
|
||||
ALTER TABLE llx_projet ADD COLUMN budget_amount double(24,8);
|
||||
|
||||
-- Commercial name
|
||||
ALTER TABLE llx_societe ADD COLUMN commercial_name varchar(128) NULL;
|
||||
|
||||
|
||||
create table llx_commande_fournisseurdet_extrafields
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
-- Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
-- Copyright (C) 2010 Juanjo Menent <dolibarr@2byte.es>
|
||||
-- Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
||||
-- Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -24,6 +25,7 @@ create table llx_societe
|
|||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
nom varchar(128), -- company reference name (should be same length than adherent.societe)
|
||||
commercial_name varchar(128) NULL,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
|
||||
ref_ext varchar(128), -- reference into an external system (not used by dolibarr)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -82,6 +83,11 @@ if ($socid)
|
|||
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr><td valign="top">'.$langs->trans('CommercialName').'</td><td colspan="3">';
|
||||
print $object->commercial_name;
|
||||
print "</td></tr>";
|
||||
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -61,6 +61,13 @@ class Societe extends CommonObject
|
|||
|
||||
var $firstname;
|
||||
var $lastname;
|
||||
|
||||
/**
|
||||
* Commercial name
|
||||
* @var string
|
||||
*/
|
||||
public $commercial_name;
|
||||
|
||||
var $particulier;
|
||||
var $civility_id;
|
||||
var $address;
|
||||
|
|
@ -424,8 +431,8 @@ class Societe extends CommonObject
|
|||
|
||||
if ($result >= 0)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, import_key)";
|
||||
$sql.= " VALUES ('".$this->db->escape($this->name)."', ".$conf->entity.", '".$this->db->idate($now)."'";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, commercial_name, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, import_key)";
|
||||
$sql.= " VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->commercial_name)."', ".$conf->entity.", '".$this->db->idate($now)."'";
|
||||
$sql.= ", ".(! empty($user->id) ? "'".$user->id."'":"null");
|
||||
$sql.= ", ".(! empty($this->canvas) ? "'".$this->canvas."'":"null");
|
||||
$sql.= ", ".$this->status;
|
||||
|
|
@ -637,6 +644,7 @@ class Societe extends CommonObject
|
|||
$this->id = $id;
|
||||
$this->name = $this->name?trim($this->name):trim($this->nom);
|
||||
$this->nom = $this->name; // For backward compatibility
|
||||
$this->commercial_name = trim($this->commercial_name);
|
||||
$this->ref_ext = trim($this->ref_ext);
|
||||
$this->address = $this->address?trim($this->address):trim($this->address);
|
||||
$this->zip = $this->zip?trim($this->zip):trim($this->zip);
|
||||
|
|
@ -744,6 +752,7 @@ class Societe extends CommonObject
|
|||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET ";
|
||||
$sql .= "nom = '" . $this->db->escape($this->name) ."'"; // Required
|
||||
$sql .= ",commercial_name = '" . $this->db->escape($this->commercial_name) ."'";
|
||||
$sql .= ",ref_ext = " .(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext) ."'":"null");
|
||||
$sql .= ",address = '" . $this->db->escape($this->address) ."'";
|
||||
|
||||
|
|
@ -962,7 +971,7 @@ class Societe extends CommonObject
|
|||
|
||||
if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
|
||||
|
||||
$sql = 'SELECT s.rowid, s.nom as name, s.entity, s.ref_ext, s.ref_int, s.address, s.datec as date_creation, s.prefix_comm';
|
||||
$sql = 'SELECT s.rowid, s.nom as name, s.commercial_name, s.entity, s.ref_ext, s.ref_int, s.address, s.datec as date_creation, s.prefix_comm';
|
||||
$sql .= ', s.status';
|
||||
$sql .= ', s.price_level';
|
||||
$sql .= ', s.tms as date_modification';
|
||||
|
|
@ -1021,6 +1030,7 @@ class Societe extends CommonObject
|
|||
$this->ref = $obj->rowid;
|
||||
$this->name = $obj->name;
|
||||
$this->nom = $obj->name; // deprecated
|
||||
$this->commercial_name = $obj->commercial_name;
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
$this->ref_int = $obj->ref_int;
|
||||
|
||||
|
|
@ -1721,6 +1731,10 @@ class Societe extends CommonObject
|
|||
$name =$code.' '.$name;
|
||||
}
|
||||
|
||||
if (!empty($this->commercial_name)) {
|
||||
$name .= ' ('.$this->commercial_name.')';
|
||||
}
|
||||
|
||||
$result=''; $label='';
|
||||
$lien=''; $lienfin='';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2012-2013 Philippe Berthet <berthet@systune.be>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* Version V1.1 Initial version of Philippe Berthet
|
||||
* Version V2 Change to be compatible with 3.4 and enhanced to be more generic
|
||||
|
|
@ -116,6 +117,10 @@ print '<td colspan="3">';
|
|||
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr id="commercial_name"><td valign="top"><label for="commercial_name_input">'.$langs->trans('CommercialName').'</label></td>';
|
||||
print '<td colspan="3"><input type="text" name="commercial_name" id="commercial_name_input" value="'.dol_escape_htmltag($object->commercial_name).'" size="32"></td></tr>';
|
||||
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -115,6 +116,11 @@ if ($object->id)
|
|||
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr><td valign="top">'.$langs->trans('CommercialName').'</td><td colspan="3">';
|
||||
print $object->commercial_name;
|
||||
print "</td></tr>";
|
||||
|
||||
// Prefix
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -81,6 +82,11 @@ if ($id > 0)
|
|||
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr><td valign="top">'.$langs->trans('CommercialName').'</td><td colspan="3">';
|
||||
print $object->commercial_name;
|
||||
print "</td></tr>";
|
||||
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -143,6 +144,11 @@ if ($result > 0)
|
|||
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr><td valign="top">'.$langs->trans('CommercialName').'</td><td colspan="3">';
|
||||
print $object->commercial_name;
|
||||
print "</td></tr>";
|
||||
|
||||
// Prefix
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -136,6 +137,11 @@ print '<tr><td width="25%">' . $langs->trans("ThirdPartyName") . '</td><td colsp
|
|||
print $form->showrefnav($soc, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr><td valign="top">'.$langs->trans('CommercialName').'</td><td colspan="3">';
|
||||
print $soc->commercial_name;
|
||||
print "</td></tr>";
|
||||
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>' . $langs->trans('Prefix') . '</td><td colspan="3">' . $soc->prefix_comm . '</td></tr>';
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -143,7 +144,9 @@ if (empty($reshook))
|
|||
else
|
||||
{
|
||||
$object->name = GETPOST('name', 'alpha')?GETPOST('name', 'alpha'):GETPOST('nom', 'alpha');
|
||||
$object->commercial_name = GETPOST('commercial_name');
|
||||
}
|
||||
|
||||
$object->address = GETPOST('address', 'alpha');
|
||||
$object->zip = GETPOST('zipcode', 'alpha');
|
||||
$object->town = GETPOST('town', 'alpha');
|
||||
|
|
@ -764,6 +767,7 @@ else
|
|||
$("#radiocompany").click(function() {
|
||||
$(".individualline").hide();
|
||||
$("#typent_id").val(0);
|
||||
$("#commercial_name").show();
|
||||
$("#effectif_id").val(0);
|
||||
$("#TypeName").html(document.formsoc.ThirdPartyName.value);
|
||||
document.formsoc.private.value=0;
|
||||
|
|
@ -771,6 +775,7 @@ else
|
|||
$("#radioprivate").click(function() {
|
||||
$(".individualline").show();
|
||||
$("#typent_id").val(id_te_private);
|
||||
$("#commercial_name").hide();
|
||||
$("#effectif_id").val(id_ef15);
|
||||
$("#TypeName").html(document.formsoc.LastName.value);
|
||||
document.formsoc.private.value=1;
|
||||
|
|
@ -902,6 +907,10 @@ else
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Commercial name
|
||||
print '<tr id="commercial_name"><td valign="top"><label for="commercial_name_input">'.$langs->trans('CommercialName').'</label></td>';
|
||||
print '<td colspan="3"><input type="text" name="commercial_name" id="commercial_name_input" value="'.$object->commercial_name.'" size="32"></td></tr>';
|
||||
|
||||
// Address
|
||||
print '<tr><td valign="top"><label for="address">'.$langs->trans('Address').'</label></td>';
|
||||
print '<td colspan="3"><textarea name="address" id="address" cols="40" rows="3" wrap="soft">';
|
||||
|
|
@ -1290,6 +1299,10 @@ else
|
|||
print '<tr><td><label for="name"><span class="fieldrequired">'.$langs->trans('ThirdPartyName').'</span></label></td>';
|
||||
print '<td colspan="3"><input type="text" size="60" maxlength="128" name="nom" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus"></td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr id="commercial_name"><td valign="top"><label for="commercial_name_input">'.$langs->trans('CommercialName').'</label></td>';
|
||||
print '<td colspan="3"><input type="text" name="commercial_name" id="commercial_name_input" value="'.dol_escape_htmltag($object->commercial_name).'" size="32"></td></tr>';
|
||||
|
||||
// Prefix
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
|
|
@ -1647,15 +1660,6 @@ else
|
|||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
/*
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $fuser->id;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
// Name
|
||||
print '<tr><td width="25%">'.$langs->trans('ThirdPartyName').'</td>';
|
||||
print '<td colspan="3">';
|
||||
|
|
@ -1663,6 +1667,11 @@ else
|
|||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr><td valign="top">'.$langs->trans('CommercialName').'</td><td colspan="3">';
|
||||
print $object->commercial_name;
|
||||
print "</td></tr>";
|
||||
|
||||
// Logo+barcode
|
||||
$rowspan=6;
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) $rowspan++;
|
||||
|
|
|
|||
|
|
@ -85,20 +85,22 @@ if ($mode == 'search')
|
|||
|
||||
// For natural search
|
||||
$scrit = explode(' ', $socname);
|
||||
|
||||
$fields = array(
|
||||
's.nom',
|
||||
's.code_client',
|
||||
's.email',
|
||||
's.url',
|
||||
's.siren',
|
||||
's.commercial_name'
|
||||
);
|
||||
|
||||
if (!empty($conf->barcode->enabled)) {
|
||||
$fields[] = 's.barcode';
|
||||
}
|
||||
|
||||
foreach ($scrit as $crit) {
|
||||
$sql.= " AND (";
|
||||
$sql.= " s.nom LIKE '%".$db->escape($crit)."%'";
|
||||
$sql.= " OR s.code_client LIKE '%".$db->escape($crit)."%'";
|
||||
$sql.= " OR s.email LIKE '%".$db->escape($crit)."%'";
|
||||
$sql.= " OR s.url LIKE '%".$db->escape($crit)."%'";
|
||||
$sql.= " OR s.siren LIKE '%".$db->escape($crit)."%'";
|
||||
|
||||
if (!empty($conf->barcode->enabled))
|
||||
{
|
||||
$sql.= "OR s.barcode LIKE '".$db->escape($crit)."'";
|
||||
}
|
||||
|
||||
$sql.= ")";
|
||||
$sql.= natural_search($fields, $crit);
|
||||
}
|
||||
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2014 Charles-Fr Benke <charles.fr@benke.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -153,6 +154,11 @@ if ($id > 0 || ! empty($ref))
|
|||
print $form->showrefnav($object,'id','',($user->societe_id?0:1),'rowid','nom');
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial name
|
||||
print '<tr><td valign="top">'.$langs->trans('CommercialName').'</td><td colspan="3">';
|
||||
print $object->commercial_name;
|
||||
print "</td></tr>";
|
||||
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user