* Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011-2017 Philippe Grand * Copyright (C) 2015-2025 Alexandre Spangaro * Copyright (C) 2017 Rui Strecht * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * 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 */ // Load Dolibarr environment 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.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $action = GETPOST('action', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'admincompany'; // To manage different context of search $page_y = GETPOSTINT('page_y'); /** * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager * @var Societe $mysoc * @var Translate $langs * @var User $user */ // Load translation files required by the page $langs->loadLangs(array('admin', 'companies', 'bills')); if (!$user->admin) { accessforbidden(); } $error = 0; $tmparraysize = getDefaultImageSizes(); $maxwidthsmall = $tmparraysize['maxwidthsmall']; $maxheightsmall = $tmparraysize['maxheightsmall']; $maxwidthmini = $tmparraysize['maxwidthmini']; $maxheightmini = $tmparraysize['maxheightmini']; $quality = $tmparraysize['quality']; // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admincompany', 'globaladmin')); $object = new Societe($db); /* * 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(GETPOSTINT('country_id'), 'all', $db, $langs, 0); if (!empty($tmparray['id'])) { if ($tmparray['code'] == 'FR' && $tmparray['id'] != $mysoc->country_id) { // For FR, default value of option to show profid SIREN is on by default $res = dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", 1, 'chaine', 0, '', $conf->entity); } $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); } $tmparray = getState(GETPOSTINT('state_id'), 'all', $db, 0, $langs, 0); if (!empty($tmparray['id'])) { $mysoc->state_id = $tmparray['id']; $mysoc->state_code = $tmparray['code']; $mysoc->state_label = $tmparray['label']; $s = $mysoc->state_id.':'.$mysoc->state_code.':'.$mysoc->state_label; dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", $s, 'chaine', 0, '', $conf->entity); } else { dolibarr_del_const($db, "MAIN_INFO_SOCIETE_STATE", $conf->entity); } $db->begin(); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("name", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code", 'alphanohtml'), '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("phone", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MOBILE", GETPOST("phone_mobile", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB", GETPOST("web", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE", GETPOST("note", 'restricthtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity); $dirforimage = $conf->mycompany->dir_output.'/logos/'; $arrayofimages = array('logo', 'logo_squarred'); //var_dump($_FILES); exit; foreach ($arrayofimages as $varforimage) { if ($_FILES[$varforimage]["name"] && !image_format_supported($_FILES[$varforimage]["name"], 0)) { // Logo can be used on a lot of different places. Recommend using jpg and png for better compatibility. $langs->load("errors"); $mesg = $langs->trans("ErrorBadImageFormat"); if (!function_exists("imagecreate")) { $mesg .= ' - '.$langs->trans("ErrorPHPDoesNotSupport", "GD"); } else { $supportedextensions = getListOfPossibleImageExt(); $supportedextensions = preg_replace('/\\\./', '', $supportedextensions); // Remove '\.' $mesg .= ' - '.$langs->trans("ErrorSupportedFormatAre", implode(', ', explode('|', $supportedextensions))); } setEventMessages($mesg, null, 'errors'); break; } // Remove to check file size to large /*if ($_FILES[$varforimage]["tmp_name"]) {*/ $reg = array(); 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 (is_numeric($result) && $result > 0) { $constant = "MAIN_INFO_SOCIETE_LOGO"; if ($varforimage == 'logo_squarred') { $constant = "MAIN_INFO_SOCIETE_LOGO_SQUARRED"; } dolibarr_set_const($db, $constant, $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 retrieve 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, $constant."_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, $constant."_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'); } elseif (preg_match('/^ErrorFileSizeTooLarge/', $result)) { $error++; setEventMessages($langs->trans("ErrorFileSizeTooLarge"), 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", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_PROFID7", GETPOST("MAIN_INFO_PROFID7", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_PROFID8", GETPOST("MAIN_INFO_PROFID8", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_PROFID9", GETPOST("MAIN_INFO_PROFID9", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_PROFID10", GETPOST("MAIN_INFO_PROFID10", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("socialobject", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOSTINT("SOCIETE_FISCAL_MONTH_START"), '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 (GETPOST("optionlocaltax1") == "localtax1on") { if (!GETPOSTISSET('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 (GETPOST("optionlocaltax2") == "localtax2on") { if (!GETPOSTISSET('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); } // Credentials for AADE webservices, applicable only for Greece if ($mysoc->country_code == 'GR') { dolibarr_set_const($db, "MYDATA_AADE_USER", GETPOST("MYDATA_AADE_USER", 'alpha'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MYDATA_AADE_KEY", GETPOST("MYDATA_AADE_KEY", 'alpha'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "AADE_WEBSERVICE_USER", GETPOST("AADE_WEBSERVICE_USER", 'alpha'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "AADE_WEBSERVICE_KEY", GETPOST("AADE_WEBSERVICE_KEY", 'alpha'), 'chaine', 0, '', $conf->entity); } // Remove constant MAIN_INFO_SOCIETE_SETUP_TODO_WARNING dolibarr_del_const($db, "MAIN_INFO_SOCIETE_SETUP_TODO_WARNING", $conf->entity); if (!$error) { if (GETPOST('save')) { // To avoid to show message when we juste switch the country that resubmit the form. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } $db->commit(); } else { $db->rollback(); } if ($action != 'updateedit' && !$error) { header("Location: ".$_SERVER["PHP_SELF"].($page_y ? '?page_y='.$page_y : '')); exit; } } if ($action == 'addthumb' || $action == 'addthumbsquarred') { // Regenerate thumbs if (file_exists($conf->mycompany->dir_output.'/logos/'.GETPOST("file"))) { $isimage = image_format_supported(GETPOST("file")); // Create thumbs of logo if ($isimage > 0) { $constant = "MAIN_INFO_SOCIETE_LOGO"; if ($action == 'addthumbsquarred') { $constant = "MAIN_INFO_SOCIETE_LOGO_SQUARRED"; } $reg = array(); // 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 retrieve value with get... // Create small thumb. Used on logon for example $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.GETPOST("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, $constant."_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/'.GETPOST("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, $constant."_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_INFO); } } else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorFileDoesNotExists", GETPOST("file")), null, 'errors'); dol_syslog($langs->transnoentities("ErrorFileDoesNotExists", GETPOST("file")), LOG_WARNING); } } if ($action == 'removelogo' || $action == 'removelogo_squarred') { $constant = "MAIN_INFO_SOCIETE_LOGO"; if ($action == 'removelogo_squarred') { $constant = "MAIN_INFO_SOCIETE_LOGO_SQUARRED"; } require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $logofilename = $mysoc->logo; $logofilenamebis = $mysoc->logo_squarred; if ($action == 'removelogo_squarred') { $logofilename = $mysoc->logo_squarred; $logofilenamebis = $mysoc->logo; } $logofile = $conf->mycompany->dir_output.'/logos/'.$logofilename; if ($logofilename != '' && $logofilename != $logofilenamebis) { dol_delete_file($logofile); } dolibarr_del_const($db, $constant, $conf->entity); if ($action == 'removelogo_squarred') { $mysoc->logo_squarred = ''; } else { $mysoc->logo = ''; } $logofilename = $mysoc->logo_small; $logofilenamebis = $mysoc->logo_squarred_small; if ($action == 'removelogo_squarred') { $logofilename = $mysoc->logo_squarred_small; $logofilenamebis = $mysoc->logo_small; } $logosmallfile = $conf->mycompany->dir_output.'/logos/thumbs/'.$logofilename; if ($logofilename != '' && $logofilename != $logofilenamebis) { dol_delete_file($logosmallfile); } dolibarr_del_const($db, $constant."_SMALL", $conf->entity); if ($action == 'removelogo_squarred') { $mysoc->logo_squarred_small = ''; } else { $mysoc->logo_small = ''; } $logofilename = $mysoc->logo_mini; $logofilenamebis = $mysoc->logo_squarred_mini; if ($action == 'removelogo_squarred') { $logofilename = $mysoc->logo_squarred_mini; $logofilenamebis = $mysoc->logo_mini; } $logominifile = $conf->mycompany->dir_output.'/logos/thumbs/'.$logofilename; if ($logofilename != '' && $logofilename != $logofilenamebis) { dol_delete_file($logominifile); } dolibarr_del_const($db, $constant."_MINI", $conf->entity); if ($action == 'removelogo_squarred') { $mysoc->logo_squarred_mini = ''; } else { $mysoc->logo_mini = ''; } } /* * View */ $wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; llxHeader('', $langs->trans("Setup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-company'); $form = new Form($db); $formother = new FormOther($db); $formcompany = new FormCompany($db); $formfile = new FormFile($db); $countrynotdefined = ''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup'); $head = company_admin_prepare_head(); print dol_get_fiche_head($head, 'company', '', -1, ''); print ''.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Save"))."
\n"; print "

\n"; // Edit parameters if (!empty($conf->use_javascript_ajax)) { print "\n".''."\n"; } print '
'; print ''; print ''; print ''; print ''; print ''."\n"; // Company name print ''."\n"; // Main currency print ''."\n"; // Country print ''."\n"; // Address print ''."\n"; // Zip print ''."\n"; print ''."\n"; // State print ''."\n"; // Phone print ''; print ''."\n"; // Phone mobile print ''; print ''."\n"; // Fax print ''; print ''."\n"; // Email print ''; print ''."\n"; // Web print ''; print ''."\n"; // Barcode if (isModEnabled('barcode')) { print ''; print ''; } // Tooltip for both Logo and LogSquarred $maxfilesizearray = getMaxFileSizeArray(); $maxmin = $maxfilesizearray['maxmin']; $tooltiplogo = $langs->trans('AvailableFormats').' : png, jpg, jpeg'; $tooltiplogo .= ($maxmin > 0) ? '
'.$langs->trans('MaxSize').' : '.$maxmin.' '.$langs->trans('Kb') : ''; // Logo print ''; // Logo (squarred) print ''; // Note print ''; print ''; print '
'.$langs->trans("CompanyInfo").'
'; print '
'; print img_picto('', 'multicurrency', 'class="pictofixedwidth"'); print $form->selectCurrency($conf->currency, "currency", 2); print '
'; print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); print $form->select_country((string) $mysoc->country_id, 'country_id', '', 0); print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'; print '
'; print '
'; print '
'; $state_id = 0; if (getDolGlobalString('MAIN_INFO_SOCIETE_STATE')) { $tmp = explode(':', getDolGlobalString('MAIN_INFO_SOCIETE_STATE')); $state_id = $tmp[0]; } print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($state_id, $mysoc->country_code, 'state_id', 'maxwidth200onsmartphone minwidth300'); print '
'; print img_picto('', 'object_phoning', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; print img_picto('', 'object_phoning_mobile', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; print img_picto('', 'object_phoning_fax', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; print img_picto('', 'object_email', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; print img_picto('', 'globe', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; print ''; print ''; print '
'; $modulepart = 'mycompany'; $dirformainimage = $conf->mycompany->dir_output; $subdirformainimage = 'logos/'; $fileformainimage = $mysoc->logo; print $formfile->showImageToEdit('logo', $modulepart, $dirformainimage, $subdirformainimage, $fileformainimage); print '
'; $modulepart = 'mycompany'; $dirformainimage = $conf->mycompany->dir_output; $subdirformainimage = 'logos/'; $fileformainimage = $mysoc->logo_squarred; print $formfile->showImageToEdit('logo_squarred', $modulepart, $dirformainimage, $subdirformainimage, $fileformainimage); print '
'; print '
'; print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition'); print '

'; // IDs of the company (country-specific) print '
'; print ''; print ''; $langs->load("companies"); // Managing Director(s) print ''; // GDPR contact print ''; // Capital print ''; // Juridical Status print ''; // Object of the company print ''; print ''; // Tax ID Intra-community VAT number 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 ''; } // ProfId7 if ($langs->transcountry("ProfId7", $mysoc->country_code) != '-') { print ''; } // ProfId8 if ($langs->transcountry("ProfId8", $mysoc->country_code) != '-') { print ''; } // ProfId9 if ($langs->transcountry("ProfId9", $mysoc->country_code) != '-') { print ''; } // ProfId10 if ($langs->transcountry("ProfId10", $mysoc->country_code) != '-') { print ''; } print '
'.$langs->trans("CompanyIds").'
'; print '
'; print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc")); print ''; print '
'; print '
'; if ($mysoc->country_code) { print $formcompany->select_juridicalstatus(getDolGlobalInt('MAIN_INFO_SOCIETE_FORME_JURIDIQUE'), $mysoc->country_code, '', 'forme_juridique_code'); } else { print $countrynotdefined; } print '
'; print '
'; print ''; 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 '
'; 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 '
'; // Fiscal year start print '
'; print ''; print ''; print ''; print "\n"; print ''; print "
'.$langs->trans("FiscalYearInformation").'
'; print $formother->select_month(getDolGlobalString('SOCIETE_FISCAL_MONTH_START'), 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').'
"; print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition'); print '
'; // Sales taxes (VAT, IRPF, ...) print load_fiche_titre($langs->trans("TypeOfSaleTaxes"), '', 'object_payment'); print ''; print ''; print ''; print ''; print "\n"; // Main tax print '"; print '\n"; print '"; print '\n"; print "
'.$langs->trans("VATManagement").' 
'; $tooltiphelp = $langs->trans("VATIsUsedDesc"); if ($mysoc->country_code == 'FR') { $tooltiphelp .= '

'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR").""; } print '"; print "
'; $tooltiphelp = ''; if ($mysoc->country_code == 'FR') { $tooltiphelp = "".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."\n"; } print '"; print "
"; // Second tax print '
'; print ''; print ''; print ''; print ''; print "\n"; if ($mysoc->useLocalTax(1)) { // 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"; } else { if (empty($mysoc->country_code)) { print ''; } else { print ''; } } print "
'.$form->textwithpicto($langs->transcountry("LocalTax1Management", $mysoc->country_code), $langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)).' 
'; print '
'; $tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); $tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."\n" : ""); print $form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp); if (!isOnlyOneLocalTax(1)) { print '
: '; $formcompany->select_localtax(1, getDolGlobalFloat('MAIN_INFO_VALUE_LOCALTAX1'), "lt1"); } $options = array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"), $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"), $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc")); print '
: '; print $form->selectarray("clt1", $options, getDolGlobalString('MAIN_INFO_LOCALTAX_CALC1')); print "
"; print "
'; $tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); $tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."\n" : ""); print $form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp); print "
'.$countrynotdefined.'
'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax1Management")).'
"; // Third tax system print '
'; print ''; print ''; print ''; print ''; print "\n"; if ($mysoc->useLocalTax(2)) { // 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"; } else { if (empty($mysoc->country_code)) { print ''; } else { print ''; } } print "
'.$form->textwithpicto($langs->transcountry("LocalTax2Management", $mysoc->country_code), $langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)).' 
'; print '
'; print '"; $tooltiphelp = $langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code); $tooltiphelp = ($tooltiphelp != "LocalTax2IsUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."\n" : ""); if (!isOnlyOneLocalTax(2)) { print '
: '; $formcompany->select_localtax(2, getDolGlobalFloat('MAIN_INFO_VALUE_LOCALTAX2'), "lt2"); } $options = array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"), $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"), $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc")); print '
: '; print $form->selectarray("clt2", $options, getDolGlobalString('MAIN_INFO_LOCALTAX_CALC2')); print "
"; print "
'; print "
"; $tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); $tooltiphelp = ($tooltiphelp != "LocalTax2IsNotUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."\n" : ""); print ""; print "
"; print "
'.$countrynotdefined.'
'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax2Management")).'
"; // Tax stamp print '
'; print ''; print ''; print ''; print ''; print "\n"; if ($mysoc->useRevenueStamp()) { // 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"; } else { if (empty($mysoc->country_code)) { print ''; } else { print ''; } } print "
'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).' 
'; print $langs->trans("UseRevenueStamp"); print "'; print $langs->trans("UseRevenueStampExample", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryRevenueStamp")); print "
'.$countrynotdefined.'
'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryRevenueStamp"), $langs->transnoentitiesnoconv("RevenueStamp")).'
"; // AADE webservices credentials, applicable only for Greece if ($mysoc->country_code == 'GR') { print load_fiche_titre($langs->trans("AADEWebserviceCredentials"), '', ''); print ''; print ''; print ''; print ''; print ''; print "\n"; print ''; print ''; print ''; print ''; print '
'; print "
'.$langs->trans("AccountParameter").'
'; print ''.$langs->trans("MYDATA_AADE_USER").''; print '
'; print ''.$langs->trans("MYDATA_AADE_KEY").''; print '
'; print ''.$langs->trans("AADE_WEBSERVICE_USER").''; print '
'; print ''.$langs->trans("AADE_WEBSERVICE_KEY").''; print '
"; } print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition'); print '
'; // End of page llxFooter(); $db->close();