* Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011-2017 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2017 Rui Strecht * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/admin/company.php * \ingroup company * \brief Setup page to configure company/foundation */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $action=GETPOST('action','aZ09'); $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'admincompany'; // To manage different context of search // Load translation files required by the page $langs->loadLangs(array('admin', 'companies')); if (! $user->admin) accessforbidden(); $error=0; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('admincompany','globaladmin')); /* * Actions */ $parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) || ($action == 'updateedit') ) { $tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0); if (! empty($tmparray['id'])) { $mysoc->country_id =$tmparray['id']; $mysoc->country_code =$tmparray['code']; $mysoc->country_label=$tmparray['label']; $s=$mysoc->country_id.':'.$mysoc->country_code.':'.$mysoc->country_label; dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity); activateModulesRequiredByCountry($mysoc->country_code); } $db->begin(); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP",'alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", GETPOST("state_id",'alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code",'alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency",'aZ09'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel",'alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX", GETPOST("fax",'alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL", GETPOST("mail",'alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB", GETPOST("web",'alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE", GETPOST("note",'none'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode",'alpha'),'chaine',0,'',$conf->entity); $varforimage='logo'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) { if (preg_match('/([^\\/:]+)$/i',$_FILES[$varforimage]["name"],$reg)) { $original_file=$reg[1]; $isimage=image_format_supported($original_file); if ($isimage >= 0) { dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file); if (! is_dir($dirforimage)) { dol_mkdir($dirforimage); } $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"],$dirforimage.$original_file,1,0,$_FILES[$varforimage]['error']); if ($result > 0) { dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file,'chaine',0,'',$conf->entity); // Create thumbs of logo (Note that PDF use original file and not thumbs) if ($isimage > 0) { // Create thumbs //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... // Create small thumb, Used on logon for example $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) { $imgThumbSmall = $reg[1]; // Save only basename dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); } else dol_syslog($imgThumbSmall); // Create mini thumb, Used on menu or for setup page for example $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) { $imgThumbMini = $reg[1]; // Save only basename dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); } else dol_syslog($imgThumbMini); } else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING); } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) { $error++; $langs->load("errors"); $tmparray=explode(':',$result); setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors'); } else { $error++; setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } } else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); } } } dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object",'nohtml'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START",'int'),'chaine',0,'',$conf->entity); // Sale tax options $usevat = GETPOST("optiontva",'aZ09'); $uselocaltax1 = GETPOST("optionlocaltax1",'aZ09'); $uselocaltax2 = GETPOST("optionlocaltax2",'aZ09'); if ($uselocaltax1 == 'localtax1on' && ! $usevat) { setEventMessages($langs->trans("IfYouUseASecondTaxYouMustSetYouUseTheMainTax"), null, 'errors'); $error++; } if ($uselocaltax2 == 'localtax2on' && ! $usevat) { setEventMessages($langs->trans("IfYouUseAThirdTaxYouMustSetYouUseTheMainTax"), null, 'errors'); $error++; } dolibarr_set_const($db, "FACTURE_TVAOPTION", $usevat,'chaine',0,'',$conf->entity); dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION", $uselocaltax1,'chaine',0,'',$conf->entity); dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION", $uselocaltax2,'chaine',0,'',$conf->entity); if($_POST["optionlocaltax1"]=="localtax1on") { if(!isset($_REQUEST['lt1'])) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0,'chaine',0,'',$conf->entity); } else { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1','aZ09'),'chaine',0,'',$conf->entity); } dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'aZ09'),'chaine',0,'',$conf->entity); } if($_POST["optionlocaltax2"]=="localtax2on") { if(!isset($_REQUEST['lt2'])) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0,'chaine',0,'',$conf->entity); } else { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2','aZ09'),'chaine',0,'',$conf->entity); } dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'aZ09'),'chaine',0,'',$conf->entity); } if (! $error) { $db->commit(); } else { $db->rollback(); } if ($action != 'updateedit' && ! $error) { header("Location: ".$_SERVER["PHP_SELF"]); exit; } } if ($action == 'addthumb') // Regenerate thumbs { if (file_exists($conf->mycompany->dir_output.'/logos/'.$_GET["file"])) { $isimage=image_format_supported($_GET["file"]); // Create thumbs of logo if ($isimage > 0) { // Create thumbs //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... // Create small thumb. Used on logon for example $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small',$quality); if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) { $imgThumbSmall = $reg[1]; // Save only basename dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); } else dol_syslog($imgThumbSmall); // Create mini thumbs. Used on menu or for setup page for example $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini',$quality); if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) { $imgThumbMini = $reg[1]; // Save only basename dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); } else dol_syslog($imgThumbMini); header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING); } } else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorFileDoesNotExists",$_GET["file"]), null, 'errors'); dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING); } } if ($action == 'removelogo') { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; if ($mysoc->logo != '') dol_delete_file($logofile); dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO",$conf->entity); $mysoc->logo=''; $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; if ($mysoc->logo_small != '') dol_delete_file($logosmallfile); dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity); $mysoc->logo_small=''; $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini; if ($mysoc->logo_mini != '') dol_delete_file($logominifile); dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity); $mysoc->logo_mini=''; } /* * View */ $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; llxHeader('',$langs->trans("Setup"),$wikihelp); $form=new Form($db); $formother=new FormOther($db); $formcompany=new FormCompany($db); $countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; print load_fiche_titre($langs->trans("CompanyFoundation"),'','title_setup'); $head = company_admin_prepare_head(); dol_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company'); print ''.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Modify"), $langs->transnoentities("Save"))."
\n"; print "
\n"; if ($action == 'edit' || $action == 'updateedit') { /** * Edition des parametres */ print "\n".''."\n"; print '
'; print ''; print ''; print ''; print ''."\n"; // Name print ''."\n"; // Addresse print ''."\n"; print ''."\n"; print ''."\n"; // Country print ''."\n"; print ''."\n"; print ''."\n"; print ''; print ''."\n"; print ''; print ''."\n"; print ''; print ''."\n"; // Web print ''; print ''."\n"; // Barcode if (! empty($conf->barcode->enabled)) { print ''; print ''; } // Logo print ''; // Note print ''; print ''; print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; print '
'; print '
'; print '
'; print '
'; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($mysoc->country_id, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'; $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE, $mysoc->country_code, 'state_id'); print '
'; print $form->selectCurrency($conf->currency, "currency"); print '
'; print '
'; print '
'; print '
'; print '
'; print '
'; print '
'; print ''; print ''; if (! empty($mysoc->logo_mini)) { print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { print '   '; print ''; } } else { print ''; } print '
'; print '
'; print '
'; print '
'; // IDs of the company (country-specific) print ''; print ''; $langs->load("companies"); // Managing Director(s) print ''; // GDPR contact print ''; // Capital print ''; // Juridical Status print ''; // ProfID1 if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') { print ''; } // ProfId2 if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') { print ''; } // ProfId3 if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') { print ''; } // ProfId4 if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') { print ''; } // ProfId5 if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') { print ''; } // ProfId6 if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') { print ''; } // TVA Intra print ''; // Object of the company print ''; print ''; print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'; print '
'; print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc")); print ''; print '
'; print '
'; if ($mysoc->country_code) { print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'forme_juridique_code'); } else { print $countrynotdefined; } print '
'; if (! empty($mysoc->country_code)) { print ''; } else { print $countrynotdefined; } print '
'; if (! empty($mysoc->country_code)) { print ''; } else { print $countrynotdefined; } print '
'; if (! empty($mysoc->country_code)) { print ''; } else { print $countrynotdefined; } print '
'; if (! empty($mysoc->country_code)) { print ''; } else { print $countrynotdefined; } print '
'; if (! empty($mysoc->country_code)) { print ''; } else { print $countrynotdefined; } print '
'; if (! empty($mysoc->country_code)) { print ''; } else { print $countrynotdefined; } print '
'; print ''; print '
'; print '
'; // Fiscal year start print '
'; print ''; print ''; print ''; print "\n"; print ''; print "
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").'
'; print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'SOCIETE_FISCAL_MONTH_START',0,1) . '
"; // Fiscal options print '
'; print ''; print ''; print ''; print ''; print "\n"; print ""; print '\n"; print ""; print '\n"; print "
'.$langs->trans("VATManagement").''.$langs->trans("Description").' 
'; print ""; print ""; if ($mysoc->country_code == 'FR') print "\n"; print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; print "
'; print ""; print ""; if ($mysoc->country_code == 'FR') print "\n"; print "
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; print "
"; /* * Local Taxes */ if ($mysoc->useLocalTax(1)) { // Local Tax 1 print '
'; print ''; print ''; print ''; print ''; print "\n"; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option print ""; print '\n"; print ""; print '\n"; print "
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; print ''; print ""; $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); print ($example!="LocalTax1IsUsedExample"?"\n":""); if(! isOnlyOneLocalTax(1)) { print ''; } $opcions=array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"),$langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"),$langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc")); print ''; print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
: '; $formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); print '
'.$langs->trans("CalcLocaltax").': '; print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1); print '
"; print "
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; print ""; $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); print ($example!="LocalTax1IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
"; print "
"; } if ($mysoc->useLocalTax(2)) { // Local Tax 2 print '
'; print ''; print ''; print ''; print ''; print "\n"; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option print ""; print '\n"; print ""; print '\n"; print "
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; print ''; print ""; $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); print ($example!="LocalTax2IsUsedExample"?"\n":""); if(! isOnlyOneLocalTax(2)) { print ''; } print ''; print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
: '; $formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); print '
: '; print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2); print '
"; print "
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; print ""; print ""; $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); print ($example!="LocalTax2IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
"; print "
"; } print '
'; print ''; print '     '; print ''; print '
'; print '
'; print '
'; } else { /* * Show parameters */ // Actions buttons //print '
'; //print ''.$langs->trans("Modify").''; //print '

'; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print ''; print ''; print ''; print ''; print ''; // Web print ''; // Barcode if (! empty($conf->barcode->enabled)) { print ''; } // Logo print ''; print ''; print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyName").''; if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM; else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).''; print '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '
'.$langs->trans("CompanyCountry").''; if ($mysoc->country_code) { $img=picto_from_langcode($mysoc->country_code); print $img?$img.' ':''; print getCountry($mysoc->country_code,1); } else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; print '
'.$langs->trans("Region-State").''; else print '
'.$langs->trans("State").''; if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE,$conf->global->MAIN_SHOW_STATE_CODE,0,$conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); else print ' '; print '
'.$langs->trans("CompanyCurrency").''; print currency_name($conf->currency,0); print ' ('.$conf->currency; print ($conf->currency != $langs->getCurrencySymbol($conf->currency) ? ' - '.$langs->getCurrencySymbol($conf->currency) : ''); print ')'; print ' - '.$langs->trans("PriceFormatInCurrentLanguage", $langs->defaultlang).' : '.price(price2num('99.333333333','MT'), 1, $langs, 1, -1, -1, $conf->currency); print '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '
'.$langs->trans("Web").''; $arrayofurl = preg_split('/\s/', $conf->global->MAIN_INFO_SOCIETE_WEB); foreach($arrayofurl as $urltoshow) { if ($urltoshow) print dol_print_url($urltoshow,'_blank',80); } print '
'.$langs->trans("Gencod").'' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '
'.$langs->trans("Logo").''; $tagtd='tagtd '; if ($conf->browser->layout == 'phone') $tagtd=''; print '
'; print $mysoc->logo; print '
'; // It offers the generation of the thumbnail if it does not exist if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i',$mysoc->logo)) { print '  '; } elseif ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { print ''; } else { print ''; } print '
'; print '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '
'; print "
"; print '
'; // IDs of the company (country-specific) print '
'; print ''; print '
'; print ''; print ''; // Managing Director(s) print ''; // GDPR Contact print ''; // Capital print ''; // Juridical Status print ''; // ProfId1 if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') { print ''; } // ProfId2 if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') { print ''; } // ProfId3 if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') { print ''; } // ProfId4 if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') { print ''; } // ProfId5 if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') { print ''; } // ProfId6 if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') { print ''; } // VAT print ''; print ''; print ''; print ''; print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'.$langs->trans("ManagingDirectors").''; print $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '
'.$langs->trans("GDPRContact").''; print $conf->global->MAIN_INFO_GDPR . '
'.$langs->trans("Capital").''; print $conf->global->MAIN_INFO_CAPITAL . '
'.$langs->trans("JuridicalStatus").''; print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE); print '
'.$langs->transcountry("ProfId1",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_SIREN)) { print $conf->global->MAIN_INFO_SIREN; $s = $mysoc->id_prof_url(1,$mysoc); if ($s) print ' - '.$s; } else { print ' '; } print '
'.$langs->transcountry("ProfId2",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_SIRET)) { print $conf->global->MAIN_INFO_SIRET; $s = $mysoc->id_prof_url(2,$mysoc); if ($s) print ' - '.$s; } else { print ' '; } print '
'.$langs->transcountry("ProfId3",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_APE)) { print $conf->global->MAIN_INFO_APE; $s = $mysoc->id_prof_url(3,$mysoc); if ($s) print ' - '.$s; } else { print ' '; } print '
'.$langs->transcountry("ProfId4",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_RCS)) { print $conf->global->MAIN_INFO_RCS; $s = $mysoc->id_prof_url(4,$mysoc); if ($s) print ' - '.$s; } else { print ' '; } print '
'.$langs->transcountry("ProfId5",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_PROFID5)) { print $conf->global->MAIN_INFO_PROFID5; $s = $mysoc->id_prof_url(5,$mysoc); if ($s) print ' - '.$s; } else { print ' '; } print '
'.$langs->transcountry("ProfId6",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_PROFID6)) { print $conf->global->MAIN_INFO_PROFID6; $s = $mysoc->id_prof_url(6,$mysoc); if ($s) print ' - '.$s; } else { print ' '; } print '
'.$langs->trans("VATIntra").''; if (! empty($conf->global->MAIN_INFO_TVAINTRA)) { $s=''; $s.=$conf->global->MAIN_INFO_TVAINTRA; $s.=''; if (empty($conf->global->MAIN_DISABLEVATCHECK) && $mysoc->isInEEC()) { $s.=' - '; if (! empty($conf->use_javascript_ajax)) { print "\n"; print ''; print "\n"; $s.=''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); } else { $s.='id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; } } print $s; } else { print ' '; } print '
'.$langs->trans("CompanyObject").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '
'; print "
"; print '
'; /* * fiscal year beginning */ print '
'; print '
'; print ''; print ''; print ''; print "\n"; print ''; print "
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").'
'.$langs->trans("FiscalMonthStart").''; $monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1; print dol_print_date(dol_mktime(12,0,0,$monthstart,1,2000,1),'%B','gm') . '
"; print "
"; /* * tax options */ print '
'; print '
'; print ''; print ''; print ''; print ''; print "\n"; print '"; print '\n"; print '"; print '\n"; print "
'.$langs->trans("VATManagement").''.$langs->trans("Description").' 
'; print "global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."'; print ""; print ""; if ($mysoc->country_code == 'FR') print "\n"; print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; print "
'; print "global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."'; print ""; print ""; if ($mysoc->country_code == 'FR') print "\n"; print "
".$langs->trans("VATIsNotUsedDesc")."
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; print "
"; print "
"; /* * Local Taxes */ if ($mysoc->useLocalTax(1)) // True if we found at least on vat with a setup adding a localtax 1 { // Local Tax 1 print '
'; print '
'; print ''; print ''; print ''; print ''; print "\n"; print ""; print '\n"; print '"; print '\n"; print "
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").' 
"; print "global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; print ""; print ""; $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); print ($example!="LocalTax1IsUsedExample"?"\n":""); if($conf->global->MAIN_INFO_VALUE_LOCALTAX1!=0) { print ''; } print ''; print "
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX1 .'
'.$langs->trans("CalcLocaltax").': '; if($conf->global->MAIN_INFO_LOCALTAX_CALC1==0) { print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc"); } elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==1) { print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"); } elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){ print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"); } print '
"; print "
'; print "global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; print ""; $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); print ($example!="LocalTax1IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
"; print "
"; print "
"; } if ($mysoc->useLocalTax(2)) // True if we found at least on vat with a setup adding a localtax 1 { // Local Tax 2 print '
'; print '
'; print ''; print ''; print ''; print ''; print "\n"; print ""; print '\n"; print ""; print '\n"; print "
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").' 
"; print "global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; print ""; print ""; $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); print ($example!="LocalTax2IsUsedExample"?"\n":""); if($conf->global->MAIN_INFO_VALUE_LOCALTAX2!=0) { print ''; } print ''; print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX2 .'
'.$langs->trans("CalcLocaltax").': '; if($conf->global->MAIN_INFO_LOCALTAX_CALC2==0) { print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc"); } elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==1) { print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"); } elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==2) { print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"); } print '
"; print "
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; print ""; print ""; $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); print ($example!="LocalTax2IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
"; print "
"; print "
"; } // Actions buttons print '
'; print ''; print '
'; } // End of page llxFooter(); $db->close();