PageRenderTime 244ms CodeModel.GetById 41ms app.highlight 97ms RepoModel.GetById 94ms app.codeStats 1ms

/htdocs/admin/company.php

https://github.com/asterix14/dolibarr
PHP | 987 lines | 745 code | 140 blank | 102 comment | 116 complexity | 318e4647e059bb42a55354e9fc1672b8 MD5 | raw file
  1<?php
  2/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3 * Copyright (C) 2004-2011 Laurent Destailleur  <eldy@users.sourceforge.net>
  4 * Copyright (C) 2010      Juanjo Menent        <jmenent@2byte.es>
  5 * Copyright (C) 2011      Philippe Grand       <philippe.grand@atoo-net.com>
  6 *
  7 * This program is free software; you can redistribute it and/or modify
  8 * it under the terms of the GNU General Public License as published by
  9 * the Free Software Foundation; either version 2 of the License, or
 10 * (at your option) any later version.
 11 *
 12 * This program is distributed in the hope that it will be useful,
 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 15 * GNU General Public License for more details.
 16 *
 17 * You should have received a copy of the GNU General Public License
 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 19 */
 20
 21/**
 22 *	\file       htdocs/admin/company.php
 23 *	\ingroup    company
 24 *	\brief      Setup page to configure company/foundation
 25 */
 26
 27require("../main.inc.php");
 28require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
 29require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
 30require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
 31require_once(DOL_DOCUMENT_ROOT."/core/lib/images.lib.php");
 32require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
 33require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
 34require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
 35
 36$langs->load("admin");
 37$langs->load("companies");
 38
 39if (!$user->admin)
 40accessforbidden();
 41
 42
 43/*
 44 * Actions
 45 */
 46
 47if ( (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["cancel"]))
 48|| (isset($_POST["action"]) && $_POST["action"] == 'updateedit') )
 49{
 50    require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
 51
 52    $new_pays_id=$_POST["pays_id"];
 53    $new_pays_code=getCountry($new_pays_id,2);
 54    $new_pays_label=getCountry($new_pays_id,0);
 55
 56    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_PAYS", $new_pays_id.':'.$new_pays_code.':'.$new_pays_label,'chaine',0,'',$conf->entity);
 57
 58    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"],'chaine',0,'',$conf->entity);
 59    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADRESSE",$_POST["address"],'chaine',0,'',$conf->entity);
 60    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_VILLE",$_POST["ville"],'chaine',0,'',$conf->entity);
 61    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_CP",$_POST["cp"],'chaine',0,'',$conf->entity);
 62    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_DEPARTEMENT",$_POST["departement_id"],'chaine',0,'',$conf->entity);
 63    dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"],'chaine',0,'',$conf->entity);
 64    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL",$_POST["tel"],'chaine',0,'',$conf->entity);
 65    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX",$_POST["fax"],'chaine',0,'',$conf->entity);
 66    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL",$_POST["mail"],'chaine',0,'',$conf->entity);
 67    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB",$_POST["web"],'chaine',0,'',$conf->entity);
 68    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE",$_POST["note"],'chaine',0,'',$conf->entity);
 69    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD",$_POST["gencod"],'chaine',0,'',$conf->entity);
 70    if ($_FILES["logo"]["tmp_name"])
 71    {
 72        if (preg_match('/([^\\/:]+)$/i',$_FILES["logo"]["name"],$reg))
 73        {
 74            $original_file=$reg[1];
 75
 76            $isimage=image_format_supported($original_file);
 77            if ($isimage >= 0)
 78            {
 79                dol_syslog("Move file ".$_FILES["logo"]["tmp_name"]." to ".$conf->mycompany->dir_output.'/logos/'.$original_file);
 80                if (! is_dir($conf->mycompany->dir_output.'/logos/'))
 81                {
 82                    create_exdir($conf->mycompany->dir_output.'/logos/');
 83                }
 84                $result=dol_move_uploaded_file($_FILES["logo"]["tmp_name"],$conf->mycompany->dir_output.'/logos/'.$original_file,1,0,$_FILES['logo']['error']);
 85                if ($result > 0)
 86                {
 87                    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file,'chaine',0,'',$conf->entity);
 88
 89                    // Create thumbs of logo (Note that PDF use original file and not thumbs)
 90                    if ($isimage > 0)
 91                    {
 92                        // Create small thumbs for company (Ratio is near 16/9)
 93                        // Used on logon for example
 94                        $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
 95                        if (preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg))
 96                        {
 97                            $imgThumbSmall = $reg[1];
 98                            dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity);
 99                        }
100                        else dol_syslog($imgThumbSmall);
101
102                        // Create mini thumbs for company (Ratio is near 16/9)
103                        // Used on menu or for setup page for example
104                        $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality);
105                        if (preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg))
106                        {
107                            $imgThumbMini = $reg[1];
108                            dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity);
109                        }
110                        else dol_syslog($imgThumbMini);
111                    }
112                    else dol_syslog($langs->trans("ErrorImageFormatNotSupported"),LOG_WARNING);
113                }
114                else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
115                {
116                    $langs->load("errors");
117                    $tmparray=explode(':',$result);
118                    $message .= '<div class="error">'.$langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]).'</div>';
119                }
120                else
121                {
122                    $message .= '<div class="error">'.$langs->trans("ErrorFailedToSaveFile").'</div>';
123                }
124            }
125            else
126            {
127                $message .= '<div class="error">'.$langs->trans("ErrorOnlyPngJpgSupported").'</div>';
128            }
129        }
130    }
131
132    dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"],'chaine',0,'',$conf->entity);
133    dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE",$_POST["forme_juridique_code"],'chaine',0,'',$conf->entity);
134    dolibarr_set_const($db, "MAIN_INFO_SIREN",$_POST["siren"],'chaine',0,'',$conf->entity);
135    dolibarr_set_const($db, "MAIN_INFO_SIRET",$_POST["siret"],'chaine',0,'',$conf->entity);
136    dolibarr_set_const($db, "MAIN_INFO_APE",$_POST["ape"],'chaine',0,'',$conf->entity);
137    dolibarr_set_const($db, "MAIN_INFO_RCS",$_POST["rcs"],'chaine',0,'',$conf->entity);
138    dolibarr_set_const($db, "MAIN_INFO_TRAINER",$_POST["trainer"],'chaine',0,'',$conf->entity);
139
140    dolibarr_set_const($db, "MAIN_INFO_TVAINTRA",$_POST["tva"],'chaine',0,'',$conf->entity);
141
142    dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START",$_POST["fiscalmonthstart"],'chaine',0,'',$conf->entity);
143
144    dolibarr_set_const($db, "FACTURE_TVAOPTION",$_POST["optiontva"],'chaine',0,'',$conf->entity);
145
146    // Local taxes
147    dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity);
148    dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity);
149
150    if ($_POST['action'] != 'updateedit' && ! $message)
151    {
152        Header("Location: ".$_SERVER["PHP_SELF"]);
153        exit;
154    }
155}
156
157if ($_GET["action"] == 'addthumb')
158{
159    if (file_exists($conf->societe->dir_output.'/logos/'.$_GET["file"]))
160    {
161        $isimage=image_format_supported($_GET["file"]);
162
163        // Create thumbs of logo
164        if ($isimage > 0)
165        {
166            // Create small thumbs for company (Ratio is near 16/9)
167            // Used on logon for example
168            $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small',$quality);
169            if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg))
170            {
171                $imgThumbSmall = $reg[1];
172                dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity);
173            }
174            else dol_syslog($imgThumbSmall);
175
176            // Create mini thumbs for company (Ratio is near 16/9)
177            // Used on menu or for setup page for example
178            $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini',$quality);
179            if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg))
180            {
181                $imgThumbMini = $reg[1];
182                dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity);
183            }
184            else dol_syslog($imgThumbMini);
185
186            Header("Location: ".$_SERVER["PHP_SELF"]);
187            exit;
188        }
189        else
190        {
191            $message .= '<div class="error">'.$langs->trans("ErrorImageFormatNotSupported").'</div>';
192            dol_syslog($langs->transnoentities("ErrorImageFormatNotSupported"),LOG_WARNING);
193        }
194    }
195    else
196    {
197        $message .= '<div class="error">'.$langs->trans("ErrorFileDoesNotExists",$_GET["file"]).'</div>';
198        dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING);
199    }
200}
201
202if ($_GET["action"] == 'removelogo')
203{
204    require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
205
206    $logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo;
207    dol_delete_file($logofile);
208    dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO",$conf->entity);
209    $mysoc->logo='';
210
211    $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small;
212    dol_delete_file($logosmallfile);
213    dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity);
214    $mysoc->logo_small='';
215
216    $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini;
217    dol_delete_file($logominifile);
218    dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity);
219    $mysoc->logo_mini='';
220}
221
222
223/*
224 * View
225 */
226
227$wikihelp='EN:First_setup|FR:Premiers_paramĂŠtrages|ES:Primeras_configuraciones';
228llxHeader('',$langs->trans("Setup"),$wikihelp);
229
230$form=new Form($db);
231$formother=new FormOther($db);
232$formcompany=new FormCompany($db);
233
234$countrynotdefined='<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
235
236// We define pays_id, pays_code and pays_label
237if (! empty($conf->global->MAIN_INFO_SOCIETE_PAYS))
238{
239    $tmp=explode(':',$conf->global->MAIN_INFO_SOCIETE_PAYS);
240    $pays_id=$tmp[0];
241    if (! empty($tmp[1]))   // If $conf->global->MAIN_INFO_SOCIETE_PAYS is "id:code:label"
242    {
243        $pays_code=$tmp[1];
244        $pays_label=$tmp[2];
245    }
246    else
247    {
248        $pays_code=getCountry($pays_id,2);
249        $pays_label=getCountry($pays_id,0);
250    }
251}
252else
253{
254    $pays_id=0;
255    $pays_code='';
256    $pays_label='';
257}
258
259
260print_fiche_titre($langs->trans("CompanyFoundation"),'','setup');
261
262print $langs->trans("CompanyFundationDesc")."<br>\n";
263print "<br>\n";
264
265if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
266|| (isset($_POST["action"]) && $_POST["action"] == 'updateedit') )
267{
268    /**
269     * Edition des parametres
270     */
271    print "\n".'<script type="text/javascript" language="javascript">';
272    print 'jQuery(document).ready(function () {
273              jQuery("#selectpays_id").change(function() {
274                document.form_index.action.value="updateedit";
275                document.form_index.submit();
276              });
277          });';
278    print '</script>'."\n";
279
280    print '<form enctype="multipart/form-data" method="post" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
281    print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
282    print '<input type="hidden" name="action" value="update">';
283    $var=true;
284
285    print '<table class="noborder" width="100%">';
286    print '<tr class="liste_titre"><td width="35%">'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
287
288    $var=!$var;
289    print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("CompanyName").'</td><td>';
290    print '<input name="nom" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM:$_POST["nom"]) . '"></td></tr>'."\n";
291
292    $var=!$var;
293    print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyAddress").'</td><td>';
294    print '<textarea name="address" cols="80" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADRESSE?$conf->global->MAIN_INFO_SOCIETE_ADRESSE:$_POST["address"]) . '</textarea></td></tr>'."\n";
295
296    $var=!$var;
297    print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyZip").'</td><td>';
298    print '<input name="cp" value="'. ($conf->global->MAIN_INFO_SOCIETE_CP?$conf->global->MAIN_INFO_SOCIETE_CP:$_POST["cp"]) . '" size="10"></td></tr>'."\n";
299
300    $var=!$var;
301    print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyTown").'</td><td>';
302    print '<input name="ville" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_VILLE?$conf->global->MAIN_INFO_SOCIETE_VILLE:$_POST["ville"]) . '"></td></tr>'."\n";
303
304    // Country
305    $var=!$var;
306    print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("Country").'</td><td>';
307    $pays_selected=$pays_id;
308    //if (empty($pays_selected)) $pays_selected=substr($langs->defaultlang,-2);    // Par defaut, pays de la localisation
309    print $form->select_country($pays_selected,'pays_id');
310    if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
311    print '</td></tr>'."\n";
312
313    $var=!$var;
314    print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td>';
315    $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT,$pays_code,'departement_id');
316    print '</td></tr>'."\n";
317
318    $var=!$var;
319    print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyCurrency").'</td><td>';
320    $form->select_currency($conf->global->MAIN_MONNAIE,"currency");
321    print '</td></tr>'."\n";
322
323    $var=!$var;
324    print '<tr '.$bc[$var].'><td>'.$langs->trans("Tel").'</td><td>';
325    print '<input name="tel" value="'. $conf->global->MAIN_INFO_SOCIETE_TEL . '"></td></tr>';
326    print '</td></tr>'."\n";
327
328    $var=!$var;
329    print '<tr '.$bc[$var].'><td>'.$langs->trans("Fax").'</td><td>';
330    print '<input name="fax" value="'. $conf->global->MAIN_INFO_SOCIETE_FAX . '"></td></tr>';
331    print '</td></tr>'."\n";
332
333    $var=!$var;
334    print '<tr '.$bc[$var].'><td>'.$langs->trans("Mail").'</td><td>';
335    print '<input name="mail" size="60" value="'. $conf->global->MAIN_INFO_SOCIETE_MAIL . '"></td></tr>';
336    print '</td></tr>'."\n";
337
338    // Web
339    $var=!$var;
340    print '<tr '.$bc[$var].'><td>'.$langs->trans("Web").'</td><td>';
341    print '<input name="web" size="60" value="'. $conf->global->MAIN_INFO_SOCIETE_WEB . '"></td></tr>';
342    print '</td></tr>'."\n";
343
344    // Barcode
345    if ($conf->barcode->enabled)
346    {
347        $var=!$var;
348        print '<tr '.$bc[$var].'><td>'.$langs->trans("Gencod").'</td><td>';
349        print '<input name="gencod" size="40" value="'. $conf->global->MAIN_INFO_SOCIETE_GENCOD . '"></td></tr>';
350        print '</td></tr>';
351    }
352
353    // Logo
354    $var=!$var;
355    print '<tr '.$bc[$var].'><td>'.$langs->trans("Logo").' (png,jpg)</td><td>';
356    print '<table width="100%" class="nocellnopadd"><tr><td valign="center">';
357    print '<input type="file" class="flat" name="logo" size="50">';
358    print '</td><td valign="middle" align="right">';
359    if ($mysoc->logo_mini)
360    {
361        print '<a href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
362        if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
363        {
364            print ' &nbsp; ';
365            print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&amp;file='.urlencode('/thumbs/'.$mysoc->logo_mini).'">';
366        }
367    }
368    else
369    {
370        print '<img height="30" src="'.DOL_URL_ROOT.'/theme/common/nophoto.jpg">';
371    }
372    print '</td></tr></table>';
373    print '</td></tr>';
374
375    // Note
376    $var=!$var;
377    print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("Note").'</td><td>';
378    print '<textarea class="flat" name="note" cols="80" rows="'.ROWS_5.'">'.$conf->global->MAIN_INFO_SOCIETE_NOTE.'</textarea></td></tr>';
379    print '</td></tr>';
380
381    print '</table>';
382
383    print '<br>';
384
385    // Identifiants de la societe (propre au pays)
386    print '<table class="noborder" width="100%">';
387    print '<tr class="liste_titre"><td>'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
388    $var=true;
389
390    $langs->load("companies");
391
392    // Capital
393    $var=!$var;
394    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Capital").'</td><td>';
395    print '<input name="capital" size="20" value="' . $conf->global->MAIN_INFO_CAPITAL . '"></td></tr>';
396
397    // Forme juridique
398    $var=!$var;
399    print '<tr '.$bc[$var].'><td>'.$langs->trans("JuridicalStatus").'</td><td>';
400    if ($pays_code)
401    {
402        $formcompany->select_forme_juridique($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE,$pays_code);
403    }
404    else
405    {
406        print $countrynotdefined;
407    }
408    print '</td></tr>';
409
410    // ProfID1
411    if ($langs->transcountry("ProfId1",$pays_code) != '-')
412    {
413        $var=!$var;
414        print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId1",$pays_code).'</td><td>';
415        if ($pays_code)
416        {
417            print '<input name="siren" size="20" value="' . $conf->global->MAIN_INFO_SIREN . '">';
418        }
419        else
420        {
421            print $countrynotdefined;
422        }
423        print '</td></tr>';
424    }
425
426    // ProfId2
427    if ($langs->transcountry("ProfId2",$pays_code) != '-')
428    {
429        $var=!$var;
430        print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId2",$pays_code).'</td><td>';
431        if ($pays_code)
432        {
433            print '<input name="siret" size="20" value="' . $conf->global->MAIN_INFO_SIRET . '">';
434        }
435        else
436        {
437            print $countrynotdefined;
438        }
439        print '</td></tr>';
440    }
441
442    // ProfId3
443    if ($langs->transcountry("ProfId3",$pays_code) != '-')
444    {
445        $var=!$var;
446        print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId3",$pays_code).'</td><td>';
447        if ($pays_code)
448        {
449            print '<input name="ape" size="20" value="' . $conf->global->MAIN_INFO_APE . '">';
450        }
451        else
452        {
453            print $countrynotdefined;
454        }
455        print '</td></tr>';
456    }
457
458    // ProfId4
459    if ($langs->transcountry("ProfId4",$pays_code) != '-')
460    {
461        $var=!$var;
462        print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId4",$pays_code).'</td><td>';
463        if ($pays_code)
464        {
465            print '<input name="rcs" size="20" value="' . $conf->global->MAIN_INFO_RCS . '">';
466        }
467        else
468        {
469            print $countrynotdefined;
470        }
471        print '</td></tr>';
472    }
473
474    // ProfId5
475    if ($langs->transcountry("ProfId5",$pays_code) != '-')
476    {
477        $var=!$var;
478        print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId5",$pays_code).'</td><td>';
479        if ($pays_code)
480        {
481            print '<input name="trainer" size="20" value="' . $conf->global->MAIN_INFO_TRAINER . '">';
482        }
483        else
484        {
485            print $countrynotdefined;
486        }
487        print '</td></tr>';
488    }
489
490    // TVA Intra
491    $var=!$var;
492    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("VATIntra").'</td><td>';
493    print '<input name="tva" size="20" value="' . $conf->global->MAIN_INFO_TVAINTRA . '">';
494    print '</td></tr>';
495
496    print '</table>';
497
498
499    /*
500     *  Debut d'annee fiscale
501     */
502    print '<br>';
503    print '<table class="noborder" width="100%">';
504    print '<tr class="liste_titre">';
505    print '<td>'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>';
506    print "</tr>\n";
507    $var=true;
508
509    $var=!$var;
510    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("FiscalMonthStart").'</td><td>';
511    print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',1) . '</td></tr>';
512
513    print "</table>";
514
515
516    /*
517     *  Options fiscale
518     */
519    print '<br>';
520    print '<table class="noborder" width="100%">';
521    print '<tr class="liste_titre">';
522    print '<td>'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
523    print '<td align="right">&nbsp;</td>';
524    print "</tr>\n";
525    $var=true;
526
527    $var=!$var;
528    print "<tr ".$bc[$var]."><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" value=\"reel\"".($conf->global->FACTURE_TVAOPTION != "franchise"?" checked":"")."> ".$langs->trans("VATIsUsed")."</label></td>";
529    print '<td colspan="2">';
530    print "<table>";
531    print "<tr><td>".$langs->trans("VATIsUsedDesc")."</td></tr>";
532    print "<tr><td><i>".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i></td></tr>\n";
533    print "</table>";
534    print "</td></tr>\n";
535
536    $var=!$var;
537    print "<tr ".$bc[$var]."><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" value=\"franchise\"".($conf->global->FACTURE_TVAOPTION == "franchise"?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
538    print '<td colspan="2">';
539    print "<table>";
540    print "<tr><td>".$langs->trans("VATIsNotUsedDesc")."</td></tr>";
541    print "<tr><td><i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i></td></tr>\n";
542    print "</table>";
543    print "</td></tr>\n";
544
545    print "</table>";
546
547    /*
548     *  Local Taxes
549     */
550    if ($pays_code=='ES')
551    {
552        // Local Tax 1
553        print '<br>';
554        print '<table class="noborder" width="100%">';
555        print '<tr class="liste_titre">';
556        print '<td>'.$langs->transcountry("LocalTax1Management",$pays_code).'</td><td>'.$langs->trans("Description").'</td>';
557        print '<td align="right">&nbsp;</td>';
558        print "</tr>\n";
559        $var=true;
560
561        $var=!$var;
562        print "<tr ".$bc[$var]."><td width=\"140\"><label><input type=\"radio\" name=\"optionlocaltax1\" value=\"localtax1on\"".($conf->global->FACTURE_LOCAL_TAX1_OPTION != "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$pays_code)."</label></td>";
563        print '<td colspan="2">';
564        print "<table>";
565        print "<tr><td>".$langs->transcountry("LocalTax1IsUsedDesc",$pays_code)."</td></tr>";
566        print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$pays_code)."</i></td></tr>\n";
567        print "</table>";
568        print "</td></tr>\n";
569
570        $var=!$var;
571        print "<tr ".$bc[$var]."><td width=\"140\"><label><input type=\"radio\" name=\"optionlocaltax1\" value=\"localtax1off\"".($conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$pays_code)."</label></td>";
572        print '<td colspan="2">';
573        print "<table>";
574        print "<tr><td>".$langs->transcountry("LocalTax1IsNotUsedDesc",$pays_code)."</td></tr>";
575        print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$pays_code)."</i></td></tr>\n";
576        print "</table>";
577        print "</td></tr>\n";
578        print "</table>";
579
580        // Local Tax 2
581        print '<br>';
582        print '<table class="noborder" width="100%">';
583        print '<tr class="liste_titre">';
584        print '<td>'.$langs->transcountry("LocalTax2Management",$pays_code).'</td><td>'.$langs->trans("Description").'</td>';
585        print '<td align="right">&nbsp;</td>';
586        print "</tr>\n";
587        $var=true;
588
589        $var=!$var;
590        print "<tr ".$bc[$var]."><td width=\"140\"><label><input type=\"radio\" name=\"optionlocaltax2\" value=\"localtax2on\"".($conf->global->FACTURE_LOCAL_TAX2_OPTION != "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$pays_code)."</label></td>";
591        print '<td colspan="2">';
592        print "<table>";
593        print "<tr><td>".$langs->transcountry("LocalTax2IsUsedDesc",$pays_code)."</td></tr>";
594        print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$pays_code)."</i></td></tr>\n";
595        print "</table>";
596        print "</td></tr>\n";
597
598        $var=!$var;
599        print "<tr ".$bc[$var]."><td width=\"140\"><label><input type=\"radio\" name=\"optionlocaltax2\" value=\"localtax2off\"".($conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$pays_code)."</label></td>";
600        print '<td colspan="2">';
601        print "<table>";
602        print "<tr><td>".$langs->transcountry("LocalTax2IsNotUsedDesc",$pays_code)."</td></tr>";
603        print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$pays_code)."</i></td></tr>\n";
604        print "</table>";
605        print "</td></tr>\n";
606        print "</table>";
607    }
608
609
610    print '<br><center>';
611    print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
612    print ' &nbsp; &nbsp; ';
613    print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
614    print '</center>';
615    print '<br>';
616
617    print '</form>';
618}
619else
620{
621    /*
622     * Show parameters
623     */
624
625    dol_htmloutput_mesg($message);
626
627    // Actions buttons
628    //print '<div class="tabsAction">';
629    //print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
630    //print '</div><br>';
631
632    print '<table class="noborder" width="100%">';
633    print '<tr class="liste_titre"><td>'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>';
634    $var=true;
635
636    $var=!$var;
637    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyName").'</td><td>';
638    if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM;
639    else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).'</font>';
640    print '</td></tr>';
641
642    $var=!$var;
643    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyAddress").'</td><td>' . nl2br($conf->global->MAIN_INFO_SOCIETE_ADRESSE) . '</td></tr>';
644
645    $var=!$var;
646    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyZip").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_CP . '</td></tr>';
647
648    $var=!$var;
649    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyTown").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_VILLE . '</td></tr>';
650
651    $var=!$var;
652    print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyCountry").'</td><td>';
653    if ($pays_code)
654    {
655        $img=picto_from_langcode($pays_code);
656        print $img?$img.' ':'';
657        print getCountry($pays_code,1);
658    }
659    else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
660    print '</td></tr>';
661
662    $var=!$var;
663    print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td>';
664    if ($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)
665    {
666        $sql = "SELECT code_departement as code, nom as label from ".MAIN_DB_PREFIX."c_departements where rowid = '".$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT."'";
667        $resql=$db->query($sql);
668        if ($resql)
669        {
670            $obj = $db->fetch_object($resql);
671        }
672        else
673        {
674            dol_print_error($db);
675        }
676        $state=$obj->label;
677        print $state;
678    }
679    print '</td></tr>';
680
681    $var=!$var;
682    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyCurrency").'</td><td>';
683    print currency_name($conf->global->MAIN_MONNAIE,1);
684    print ' ('.$conf->global->MAIN_MONNAIE.')';
685    print '</td></tr>';
686
687    $var=!$var;
688    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Tel").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->pays_code) . '</td></tr>';
689
690    $var=!$var;
691    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Fax").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->pays_code) . '</td></tr>';
692
693    $var=!$var;
694    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Mail").'</td><td>' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '</td></tr>';
695
696    // Web
697    $var=!$var;
698    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Web").'</td><td>' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . '</td></tr>';
699
700    // Barcode
701    if ($conf->barcode->enabled)
702    {
703        $var=!$var;
704        print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Gencod").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '</td></tr>';
705    }
706
707    // Logo
708    $var=!$var;
709    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Logo").'</td><td>';
710
711    print '<table width="100%" class="nocellnopadd"><tr><td valign="center">';
712    print $mysoc->logo;
713    print '</td><td valign="center" align="right">';
714
715    // On propose la generation de la vignette si elle n'existe pas
716    if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i',$mysoc->logo))
717    {
718        print '<a href="'.$_SERVER["PHP_SELF"].'?action=addthumb&amp;file='.urlencode($mysoc->logo).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'&nbsp;&nbsp;</a>';
719    }
720    else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
721    {
722        print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&amp;file='.urlencode('/thumbs/'.$mysoc->logo_mini).'">';
723    }
724    else
725    {
726        print '<img height="30" src="'.DOL_URL_ROOT.'/theme/common/nophoto.jpg">';
727    }
728    print '</td></tr></table>';
729
730    print '</td></tr>';
731
732    $var=!$var;
733    print '<tr '.$bc[$var].'><td width="35%" valign="top">'.$langs->trans("Note").'</td><td>' . nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) . '</td></tr>';
734
735    print '</table>';
736
737
738    print '<br>';
739
740
741    // Identifiants de la societe (propre au pays)
742    print '<form name="formsoc" method="post">';
743    print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
744    print '<table class="noborder" width="100%">';
745    print '<tr class="liste_titre"><td>'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
746    $var=true;
747
748    // Capital
749    $var=!$var;
750    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Capital").'</td><td>';
751    print $conf->global->MAIN_INFO_CAPITAL . '</td></tr>';
752
753    // Forme juridique
754    $var=!$var;
755    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("JuridicalStatus").'</td><td>';
756    print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE,1);
757    print '</td></tr>';
758
759    // ProfId1
760    if ($langs->transcountry("ProfId1",$pays_code) != '-')
761    {
762        $var=!$var;
763        print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId1",$pays_code).'</td><td>';
764        if ($langs->transcountry("ProfId1",$pays_code) != '-')
765        {
766            print $conf->global->MAIN_INFO_SIREN;
767            if ($conf->global->MAIN_INFO_SIREN && $pays_code == 'FR') print ' &nbsp; <a href="http://avis-situation-sirene.insee.fr/avisitu/jsp/avis.jsp" target="_blank">'.$langs->trans("Check").'</a>';
768        }
769        print '</td></tr>';
770    }
771
772    // ProfId2
773    if ($langs->transcountry("ProfId2",$pays_code) != '-')
774    {
775        $var=!$var;
776        print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId2",$pays_code).'</td><td>';
777        if ($langs->transcountry("ProfId2",$pays_code) != '-')
778        {
779            print $conf->global->MAIN_INFO_SIRET;
780        }
781        print '</td></tr>';
782    }
783
784    // ProfId3
785    if ($langs->transcountry("ProfId3",$pays_code) != '-')
786    {
787        $var=!$var;
788        print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId3",$pays_code).'</td><td>';
789        if ($langs->transcountry("ProfId3",$pays_code) != '-')
790        {
791            print $conf->global->MAIN_INFO_APE;
792        }
793        print '</td></tr>';
794    }
795
796    // ProfId4
797    if ($langs->transcountry("ProfId4",$pays_code) != '-')
798    {
799        $var=!$var;
800        print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId4",$pays_code).'</td><td>';
801        if ($langs->transcountry("ProfId4",$pays_code) != '-')
802        {
803            print $conf->global->MAIN_INFO_RCS;
804        }
805        print '</td></tr>';
806    }
807
808    // ProfId5
809    if ($langs->transcountry("ProfId5",$pays_code) != '-')
810    {
811        $var=!$var;
812        print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId5",$pays_code).'</td><td>';
813        if ($langs->transcountry("ProfId5",$pays_code) != '-')
814        {
815            print $conf->global->MAIN_INFO_TRAINER;
816        }
817        print '</td></tr>';
818    }
819
820    // TVA
821    $var=!$var;
822    print '<tr '.$bc[$var].'><td>'.$langs->trans("VATIntra").'</td>';
823    print '<td>';
824    if ($conf->global->MAIN_INFO_TVAINTRA)
825    {
826        $s='';
827        $s.=$conf->global->MAIN_INFO_TVAINTRA;
828        $s.='<input type="hidden" name="tva_intra" size="12" maxlength="20" value="'.$conf->global->MAIN_INFO_TVAINTRA.'">';
829        if (empty($conf->global->MAIN_DISABLEVATCHECK))
830        {
831            $s.=' &nbsp; ';
832            if ($conf->use_javascript_ajax)
833            {
834                print "\n";
835                print '<script language="JavaScript" type="text/javascript">';
836                print "function CheckVAT(a) {\n";
837                print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,285);\n";
838                print "}\n";
839                print '</script>';
840                print "\n";
841                $s.='<a href="#" onClick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
842                $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
843            }
844            else
845            {
846                $s.='<a href="'.$langs->transcountry("VATIntraCheckURL",$soc->id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
847            }
848        }
849        print $s;
850    }
851    else
852    {
853        print '&nbsp;';
854    }
855    print '</td>';
856    print '</tr>';
857
858    print '</table>';
859    print '</form>';
860
861    /*
862     *  Debut d'annee fiscale
863     */
864    print '<br>';
865    print '<table class="noborder" width="100%">';
866    print '<tr class="liste_titre">';
867    print '<td>'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>';
868    print "</tr>\n";
869    $var=true;
870
871    $var=!$var;
872    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("FiscalMonthStart").'</td><td>';
873    $monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1;
874    print monthArrayOrSelected($monthstart) . '</td></tr>';
875
876    print "</table>";
877
878    /*
879     *  Options fiscale
880     */
881    print '<br>';
882    print '<table class="noborder" width="100%">';
883    print '<tr class="liste_titre">';
884    print '<td>'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
885    print '<td align="right">&nbsp;</td>';
886    print "</tr>\n";
887    $var=true;
888
889    $var=!$var;
890    print "<tr ".$bc[$var]."><td width=\"140\"><label><input ".$bc[$var]." type=\"radio\" name=\"optiontva\" disabled value=\"reel\"".($conf->global->FACTURE_TVAOPTION != "franchise"?" checked":"")."> ".$langs->trans("VATIsUsed")."</label></td>";
891    print '<td colspan="2">';
892    print "<table>";
893    print "<tr><td>".$langs->trans("VATIsUsedDesc")."</td></tr>";
894    print "<tr><td><i>".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i></td></tr>\n";
895    print "</table>";
896    print "</td></tr>\n";
897
898    $var=!$var;
899    print "<tr ".$bc[$var]."><td width=\"140\"><label><input ".$bc[$var]." type=\"radio\" name=\"optiontva\" disabled value=\"franchise\"".($conf->global->FACTURE_TVAOPTION == "franchise"?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
900    print '<td colspan="2">';
901    print "<table>";
902    print "<tr><td>".$langs->trans("VATIsNotUsedDesc")."</td></tr>";
903    print "<tr><td><i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i></td></tr>\n";
904    print "</table>";
905    print "</td></tr>\n";
906
907    print "</table>";
908
909
910    /*
911     *  Local Taxes
912     */
913    if ($pays_code=='ES')
914    {
915        // Local Tax 1
916        print '<br>';
917        print '<table class="noborder" width="100%">';
918        print '<tr class="liste_titre">';
919        print '<td>'.$langs->transcountry("LocalTax1Management",$pays_code).'</td><td>'.$langs->trans("Description").'</td>';
920        print '<td align="right">&nbsp;</td>';
921        print "</tr>\n";
922        $var=true;
923
924        $var=!$var;
925        print "<tr ".$bc[$var]."><td width=\"140\"><label><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" disabled value=\"localtax1on\"".($conf->global->FACTURE_LOCAL_TAX1_OPTION != "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$pays_code)."</label></td>";
926        print '<td colspan="2">';
927        print "<table>";
928        print "<tr><td>".$langs->transcountry("LocalTax1IsUsedDesc",$pays_code)."</td></tr>";
929        print "<tr><td><i>".$langs->trans("Example",$pays_code).': '.$langs->transcountry("LocalTax1IsUsedExample",$pays_code)."</i></td></tr>\n";
930        print "</table>";
931        print "</td></tr>\n";
932
933        $var=!$var;
934        print "<tr ".$bc[$var]."><td width=\"140\"><label><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" disabled value=\"localtax1off\"".($conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$pays_code)."</label></td>";
935        print '<td colspan="2">';
936        print "<table>";
937        print "<tr><td>".$langs->transcountry("LocalTax1IsNotUsedDesc",$pays_code)."</td></tr>";
938        print "<tr><td><i>".$langs->trans("Example",$pays_code).': '.$langs->transcountry("LocalTax1IsNotUsedExample",$pays_code)."</i></td></tr>\n";
939        print "</table>";
940        print "</td></tr>\n";
941
942        print "</table>";
943
944        // Local Tax 2
945        print '<br>';
946        print '<table class="noborder" width="100%">';
947        print '<tr class="liste_titre">';
948        print '<td>'.$langs->transcountry("LocalTax2Management",$pays_code).'</td><td>'.$langs->trans("Description").'</td>';
949        print '<td align="right">&nbsp;</td>';
950        print "</tr>\n";
951        $var=true;
952
953        $var=!$var;
954        print "<tr ".$bc[$var]."><td width=\"140\"><label><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" disabled value=\"localtax2on\"".($conf->global->FACTURE_LOCAL_TAX2_OPTION != "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$pays_code)."</label></td>";
955        print '<td colspan="2">';
956        print "<table>";
957        print "<tr><td>".$langs->transcountry("LocalTax2IsUsedDesc",$pays_code)."</td></tr>";
958        print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$pays_code)."</i></td></tr>\n";
959        print "</table>";
960        print "</td></tr>\n";
961
962        $var=!$var;
963        print "<tr ".$bc[$var]."><td width=\"140\"><label><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" disabled value=\"localtax2off\"".($conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$pays_code)."</label></td>";
964        print '<td colspan="2">';
965        print "<table>";
966        print "<tr><td>".$langs->transcountry("LocalTax2IsNotUsedDesc",$pays_code)."</td></tr>";
967        print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$pays_code)."</i></td></tr>\n";
968        print "</table>";
969        print "</td></tr>\n";
970
971        print "</table>";
972    }
973
974
975    // Actions buttons
976    print '<div class="tabsAction">';
977    print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
978    print '</div>';
979
980    print '<br>';
981}
982
983$db->close();
984
985llxFooter();
986
987?>