30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
40 $action =
GETPOST(
'action',
'aZ09');
41 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'admincompany';
44 $langs->loadLangs(array(
'admin',
'companies',
'bills'));
51 $hookmanager->initHooks(array(
'admincompany',
'globaladmin'));
58 $parameters = array();
59 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
60 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
62 if (($action ==
'update' && !
GETPOST(
"cancel",
'alpha'))
63 || ($action ==
'updateedit'))
66 if (!empty($tmparray[
'id']))
68 $mysoc->country_id = $tmparray[
'id'];
69 $mysoc->country_code = $tmparray[
'code'];
70 $mysoc->country_label = $tmparray[
'label'];
72 $s = $mysoc->country_id.
':'.$mysoc->country_code.
':'.$mysoc->country_label;
73 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_COUNTRY", $s,
'chaine', 0,
'', $conf->entity);
78 $tmparray =
getState(
GETPOST(
'state_id',
'int'),
'all', $db, $langs, 0);
79 if (!empty($tmparray[
'id']))
81 $mysoc->state_id = $tmparray[
'id'];
82 $mysoc->state_code = $tmparray[
'code'];
83 $mysoc->state_label = $tmparray[
'label'];
85 $s = $mysoc->state_id.
':'.$mysoc->state_code.
':'.$mysoc->state_label;
86 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_STATE", $s,
'chaine', 0,
'', $conf->entity);
94 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_ADDRESS",
GETPOST(
"MAIN_INFO_SOCIETE_ADDRESS",
'nohtml'),
'chaine', 0,
'', $conf->entity);
95 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_TOWN",
GETPOST(
"MAIN_INFO_SOCIETE_TOWN",
'nohtml'),
'chaine', 0,
'', $conf->entity);
96 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_ZIP",
GETPOST(
"MAIN_INFO_SOCIETE_ZIP",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
97 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_REGION",
GETPOST(
"region_code",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
106 $dirforimage = $conf->mycompany->dir_output.
'/logos/';
108 $arrayofimages = array(
'logo',
'logo_squarred');
110 foreach ($arrayofimages as $varforimage)
112 if ($_FILES[$varforimage][
"name"] && !preg_match(
'/(\.jpeg|\.jpg|\.png)$/i', $_FILES[$varforimage][
"name"])) {
113 $langs->load(
"errors");
118 if ($_FILES[$varforimage][
"tmp_name"])
121 if (preg_match(
'/([^\\/:]+)$/i', $_FILES[$varforimage][
"name"], $reg))
123 $original_file = $reg[1];
128 dol_syslog(
"Move file ".$_FILES[$varforimage][
"tmp_name"].
" to ".$dirforimage.$original_file);
129 if (!is_dir($dirforimage))
133 $result =
dol_move_uploaded_file($_FILES[$varforimage][
"tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage][
'error']);
136 $constant =
"MAIN_INFO_SOCIETE_LOGO";
137 if ($varforimage ==
'logo_squarred') $constant =
"MAIN_INFO_SOCIETE_LOGO_SQUARRED";
148 $imgThumbSmall =
vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall,
'_small', $quality);
151 $imgThumbSmall = $reg[1];
152 dolibarr_set_const($db, $constant.
"_SMALL", $imgThumbSmall,
'chaine', 0,
'', $conf->entity);
156 $imgThumbMini =
vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini,
'_mini', $quality);
159 $imgThumbMini = $reg[1];
160 dolibarr_set_const($db, $constant.
"_MINI", $imgThumbMini,
'chaine', 0,
'', $conf->entity);
162 }
else dol_syslog(
"ErrorImageFormatNotSupported", LOG_WARNING);
163 } elseif (preg_match(
'/^ErrorFileIsInfectedWithAVirus/', $result)) {
165 $langs->load(
"errors");
166 $tmparray = explode(
':', $result);
167 setEventMessages($langs->trans(
'ErrorFileIsInfectedWithAVirus', $tmparray[1]), null,
'errors');
174 $langs->load(
"errors");
181 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_MANAGERS",
GETPOST(
"MAIN_INFO_SOCIETE_MANAGERS",
'nohtml'),
'chaine', 0,
'', $conf->entity);
184 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_FORME_JURIDIQUE",
GETPOST(
"forme_juridique_code",
'nohtml'),
'chaine', 0,
'', $conf->entity);
195 dolibarr_set_const($db,
"SOCIETE_FISCAL_MONTH_START",
GETPOST(
"SOCIETE_FISCAL_MONTH_START",
'int'),
'chaine', 0,
'', $conf->entity);
198 $usevat =
GETPOST(
"optiontva",
'aZ09');
199 $uselocaltax1 =
GETPOST(
"optionlocaltax1",
'aZ09');
200 $uselocaltax2 =
GETPOST(
"optionlocaltax2",
'aZ09');
201 if ($uselocaltax1 ==
'localtax1on' && !$usevat)
203 setEventMessages($langs->trans(
"IfYouUseASecondTaxYouMustSetYouUseTheMainTax"), null,
'errors');
206 if ($uselocaltax2 ==
'localtax2on' && !$usevat)
208 setEventMessages($langs->trans(
"IfYouUseAThirdTaxYouMustSetYouUseTheMainTax"), null,
'errors');
212 dolibarr_set_const($db,
"FACTURE_TVAOPTION", $usevat,
'chaine', 0,
'', $conf->entity);
213 dolibarr_set_const($db,
"FACTURE_LOCAL_TAX1_OPTION", $uselocaltax1,
'chaine', 0,
'', $conf->entity);
214 dolibarr_set_const($db,
"FACTURE_LOCAL_TAX2_OPTION", $uselocaltax2,
'chaine', 0,
'', $conf->entity);
216 if ($_POST[
"optionlocaltax1"] ==
"localtax1on")
219 dolibarr_set_const($db,
"MAIN_INFO_VALUE_LOCALTAX1", 0,
'chaine', 0,
'', $conf->entity);
225 if ($_POST[
"optionlocaltax2"] ==
"localtax2on")
228 dolibarr_set_const($db,
"MAIN_INFO_VALUE_LOCALTAX2", 0,
'chaine', 0,
'', $conf->entity);
245 if ($action !=
'updateedit' && !$error)
247 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
252 if ($action ==
'addthumb' || $action ==
'addthumbsquarred')
254 if (file_exists($conf->mycompany->dir_output.
'/logos/'.$_GET[
"file"]))
261 $constant =
"MAIN_INFO_SOCIETE_LOGO";
262 if ($action ==
'addthumbsquarred') $constant =
"MAIN_INFO_SOCIETE_LOGO_SQUARRED";
270 $imgThumbSmall =
vignette($conf->mycompany->dir_output.
'/logos/'.$_GET[
"file"], $maxwidthsmall, $maxheightsmall,
'_small', $quality);
273 $imgThumbSmall = $reg[1];
274 dolibarr_set_const($db, $constant.
"_SMALL", $imgThumbSmall,
'chaine', 0,
'', $conf->entity);
278 $imgThumbMini =
vignette($conf->mycompany->dir_output.
'/logos/'.$_GET[
"file"], $maxwidthmini, $maxheightmini,
'_mini', $quality);
281 $imgThumbMini = $reg[1];
282 dolibarr_set_const($db, $constant.
"_MINI", $imgThumbMini,
'chaine', 0,
'', $conf->entity);
285 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
289 $langs->load(
"errors");
291 dol_syslog($langs->transnoentities(
"ErrorBadImageFormat"), LOG_INFO);
295 $langs->load(
"errors");
296 setEventMessages($langs->trans(
"ErrorFileDoesNotExists", $_GET[
"file"]), null,
'errors');
297 dol_syslog($langs->transnoentities(
"ErrorFileDoesNotExists", $_GET[
"file"]), LOG_WARNING);
302 if ($action ==
'removelogo' || $action ==
'removelogosquarred')
304 $constant =
"MAIN_INFO_SOCIETE_LOGO";
305 if ($action ==
'removelogosquarred') $constant =
"MAIN_INFO_SOCIETE_LOGO_SQUARRED";
307 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
309 $logofilename = $mysoc->logo;
310 $logofilenamebis = $mysoc->logo_squarred;
311 if ($action ==
'removelogosquarred')
313 $logofilename = $mysoc->logo_squarred;
314 $logofilenamebis = $mysoc->logo;
317 $logofile = $conf->mycompany->dir_output.
'/logos/'.$logofilename;
318 if ($logofilename !=
'' && $logofilename != $logofilenamebis)
dol_delete_file($logofile);
320 if ($action ==
'removelogosquarred') $mysoc->logo_squarred =
'';
321 else $mysoc->logo =
'';
323 $logofilename = $mysoc->logo_small;
324 $logofilenamebis = $mysoc->logo_squarred_small;
325 if ($action ==
'removelogosquarred')
327 $logofilename = $mysoc->logo_squarred_small;
328 $logofilenamebis = $mysoc->logo_small;
331 $logosmallfile = $conf->mycompany->dir_output.
'/logos/thumbs/'.$logofilename;
332 if ($logofilename !=
'' && $logofilename != $logofilenamebis)
dol_delete_file($logosmallfile);
334 if ($action ==
'removelogosquarred') $mysoc->logo_squarred_small =
'';
335 else $mysoc->logo_small =
'';
337 $logofilename = $mysoc->logo_mini;
338 $logofilenamebis = $mysoc->logo_squarred_mini;
339 if ($action ==
'removelogosquarred')
341 $logofilename = $mysoc->logo_squarred_mini;
342 $logofilenamebis = $mysoc->logo_mini;
345 $logominifile = $conf->mycompany->dir_output.
'/logos/thumbs/'.$logofilename;
346 if ($logofilename !=
'' && $logofilename != $logofilenamebis)
dol_delete_file($logominifile);
348 if ($action ==
'removelogosquarred') $mysoc->logo_squarred_mini =
'';
349 else $mysoc->logo_mini =
'';
357 $wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
360 $form =
new Form($db);
364 $countrynotdefined =
'<font class="error">'.$langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')</font>';
372 print '<span class="opacitymedium">'.$langs->trans(
"CompanyFundationDesc", $langs->transnoentities(
"Save")).
"</span><br>\n";
379 print "\n".
'<script type="text/javascript" language="javascript">';
380 print '$(document).ready(function () {
381 $("#selectcountry_id").change(function() {
382 document.form_index.action.value="updateedit";
383 document.form_index.submit();
386 print '</script>'.
"\n";
388 print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="form_index">';
389 print '<input type="hidden" name="token" value="'.newToken().
'">';
390 print '<input type="hidden" name="action" value="update">';
392 print '<table class="noborder centpercent editmode">';
393 print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans(
"CompanyInfo").
'</th><th>'.$langs->trans(
"Value").
'</th></tr>'.
"\n";
396 print '<tr class="oddeven"><td class="fieldrequired wordbreak"><label for="name">'.$langs->trans(
"CompanyName").
'</label></td><td>';
397 print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM ? $conf->global->MAIN_INFO_SOCIETE_NOM :
GETPOST(
"nom",
'nohtml')).
'"'.(empty($conf->global->MAIN_INFO_SOCIETE_NOM) ?
' autofocus="autofocus"' :
'').
'></td></tr>'.
"\n";
400 print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans(
"CompanyAddress").
'</label></td><td>';
401 print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.
'">'.($conf->global->MAIN_INFO_SOCIETE_ADDRESS ? $conf->global->MAIN_INFO_SOCIETE_ADDRESS :
GETPOST(
"MAIN_INFO_SOCIETE_ADDRESS",
'nohtml')).
'</textarea></td></tr>'.
"\n";
404 print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans(
"CompanyZip").
'</label></td><td>';
405 print '<input class="width100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP ? $conf->global->MAIN_INFO_SOCIETE_ZIP :
GETPOST(
"MAIN_INFO_SOCIETE_ZIP",
'alpha')).
'"></td></tr>'.
"\n";
407 print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans(
"CompanyTown").
'</label></td><td>';
408 print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN ? $conf->global->MAIN_INFO_SOCIETE_TOWN :
GETPOST(
"MAIN_INFO_SOCIETE_TOWN",
'nohtml')).
'"></td></tr>'.
"\n";
411 print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans(
"Country").
'</label></td><td class="maxwidthonsmartphone">';
412 print img_picto(
'',
'globe-americas',
'class="paddingrightonly"');
413 print $form->select_country($mysoc->country_id,
'country_id');
414 if ($user->admin)
print info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
415 print '</td></tr>'.
"\n";
417 print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans(
"State").
'</label></td><td class="maxwidthonsmartphone">';
419 if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE))
421 $tmp = explode(
':', $conf->global->MAIN_INFO_SOCIETE_STATE);
424 $formcompany->select_departement($state_id, $mysoc->country_code,
'state_id');
425 print '</td></tr>'.
"\n";
428 print '<tr class="oddeven"><td><label for="currency">'.$langs->trans(
"CompanyCurrency").
'</label></td><td>';
429 print $form->selectCurrency($conf->currency,
"currency");
430 print '</td></tr>'.
"\n";
433 print '<tr class="oddeven"><td><label for="phone">'.$langs->trans(
"Phone").
'</label></td><td>';
434 print img_picto(
'',
'object_phoning',
'',
false, 0, 0,
'',
'paddingright');
435 print '<input name="tel" id="phone" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL).
'"></td></tr>';
436 print '</td></tr>'.
"\n";
439 print '<tr class="oddeven"><td><label for="fax">'.$langs->trans(
"Fax").
'</label></td><td>';
440 print img_picto(
'',
'object_phoning_fax',
'',
false, 0, 0,
'',
'paddingright');
441 print '<input name="fax" id="fax" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_FAX).
'"></td></tr>';
442 print '</td></tr>'.
"\n";
445 print '<tr class="oddeven"><td><label for="email">'.$langs->trans(
"EMail").
'</label></td><td>';
446 print img_picto(
'',
'object_email',
'',
false, 0, 0,
'',
'paddingright');
447 print '<input name="mail" id="email" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL).
'"></td></tr>';
448 print '</td></tr>'.
"\n";
451 print '<tr class="oddeven"><td><label for="web">'.$langs->trans(
"Web").
'</label></td><td>';
452 print img_picto(
'',
'globe',
'',
false, 0, 0,
'',
'paddingright');
453 print '<input name="web" id="web" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB).
'"></td></tr>';
454 print '</td></tr>'.
"\n";
457 if (!empty($conf->barcode->enabled)) {
458 print '<tr class="oddeven"><td>';
459 print '<label for="barcode">'.$langs->trans(
"Gencod").
'</label></td><td>';
460 print '<span class="fa paddingright fa-barcode"></span>';
461 print '<input name="barcode" id="barcode" class="minwidth150" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GENCOD).
'"></td></tr>';
466 print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans(
"Logo"),
'png, jpg').
'</label></td><td>';
467 print '<div class="centpertent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
468 print '<input type="file" class="flat minwidth200" name="logo" id="logo" accept="image/*">';
470 if (!empty($mysoc->logo_small)) {
471 if (file_exists($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_small)) {
472 print '<div class="inline-block valignmiddle">';
473 print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.$mysoc->logo_small).
'">';
475 } elseif (!empty($mysoc->logo)) {
476 if (!file_exists($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_mini)) {
477 $imgThumbMini =
vignette($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini,
'_mini', $quality);
479 $imgThumbSmall =
vignette($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini,
'_small', $quality);
480 print '<div class="inline-block valignmiddle">';
481 print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.basename($imgThumbSmall)).
'">';
484 print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=removelogo">'.
img_delete($langs->trans(
"Delete"),
'',
'marginleftonly').
'</a></div>';
485 } elseif (!empty($mysoc->logo)) {
486 if (file_exists($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo)) {
487 print '<div class="inline-block valignmiddle">';
488 print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/'.$mysoc->logo).
'">';
490 print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=removelogo">'.
img_delete($langs->trans(
"Delete"),
'',
'marginleftonly').
'</a></div>';
492 print '<div class="inline-block valignmiddle">';
493 print '<img height="80" src="'.DOL_URL_ROOT.
'/public/theme/common/nophoto.png">';
501 print '<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans(
"LogoSquarred"),
'png, jpg').
'</label></td><td>';
502 print '<div class="centpertent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
503 print '<input type="file" class="flat minwidth200" name="logo_squarred" id="logo_squarred" accept="image/*">';
505 if (!empty($mysoc->logo_squarred_small)) {
506 if (file_exists($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_squarred_small)) {
507 print '<div class="inline-block valignmiddle marginrightonly">';
508 print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.$mysoc->logo_squarred_small).
'">';
510 } elseif (!empty($mysoc->logo_squarred)) {
511 if (!file_exists($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
512 $imgThumbMini =
vignette($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo_squarred, $maxwidthmini, $maxheightmini,
'_mini', $quality);
514 $imgThumbSmall =
vignette($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo_squarred, $maxwidthmini, $maxheightmini,
'_small', $quality);
515 print '<div class="inline-block valignmiddle">';
516 print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.basename($imgThumbSmall)).
'">';
519 print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=removelogosquarred">'.
img_delete($langs->trans(
"Delete"),
'',
'marginleftonly').
'</a></div>';
520 } elseif (!empty($mysoc->logo_squarred)) {
521 if (file_exists($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo_squarred)) {
522 print '<div class="inline-block valignmiddle">';
523 print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/'.$mysoc->logo_squarred).
'">';
525 print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=removelogosquarred">'.
img_delete($langs->trans(
"Delete"),
'',
'marginleftonly').
'</a></div>';
528 print '<div class="inline-block valignmiddle">';
529 print '<img height="80" src="'.DOL_URL_ROOT.
'/public/theme/common/nophoto.png">';
537 print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans(
"Note").
'</label></td><td>';
538 print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.
'">'.(
GETPOSTISSET(
'note') ?
GETPOST(
'note',
'restricthtml') : $conf->global->MAIN_INFO_SOCIETE_NOTE).
'</textarea></td></tr>';
546 print '<table class="noborder centpercent editmode">';
547 print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"CompanyIds").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
549 $langs->load(
"companies");
552 print '<tr class="oddeven"><td><label for="director">'.$langs->trans(
"ManagingDirectors").
'</label></td><td>';
553 print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MANAGERS).
'"></td></tr>';
556 print '<tr class="oddeven"><td>';
557 print $form->textwithpicto($langs->trans(
"GDPRContact"), $langs->trans(
"GDPRContactDesc"));
559 print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth500" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_GDPR).
'"></td></tr>';
562 print '<tr class="oddeven"><td><label for="capital">'.$langs->trans(
"Capital").
'</label></td><td>';
563 print '<input name="capital" id="capital" class="maxwidth100" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_CAPITAL).
'"></td></tr>';
566 print '<tr class="oddeven"><td><label for="forme_juridique_code">'.$langs->trans(
"JuridicalStatus").
'</label></td><td>';
567 if ($mysoc->country_code) {
568 print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code,
'',
'forme_juridique_code');
570 print $countrynotdefined;
575 if ($langs->transcountry(
"ProfId1", $mysoc->country_code) !=
'-')
577 print '<tr class="oddeven"><td><label for="profid1">'.$langs->transcountry(
"ProfId1", $mysoc->country_code).
'</label></td><td>';
578 if (!empty($mysoc->country_code))
580 print '<input name="siren" id="profid1" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN :
'').
'">';
582 print $countrynotdefined;
588 if ($langs->transcountry(
"ProfId2", $mysoc->country_code) !=
'-')
590 print '<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry(
"ProfId2", $mysoc->country_code).
'</label></td><td>';
591 if (!empty($mysoc->country_code))
593 print '<input name="siret" id="profid2" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET :
'').
'">';
595 print $countrynotdefined;
601 if ($langs->transcountry(
"ProfId3", $mysoc->country_code) !=
'-')
603 print '<tr class="oddeven"><td><label for="profid3">'.$langs->transcountry(
"ProfId3", $mysoc->country_code).
'</label></td><td>';
604 if (!empty($mysoc->country_code))
606 print '<input name="ape" id="profid3" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE :
'').
'">';
608 print $countrynotdefined;
614 if ($langs->transcountry(
"ProfId4", $mysoc->country_code) !=
'-')
616 print '<tr class="oddeven"><td><label for="profid4">'.$langs->transcountry(
"ProfId4", $mysoc->country_code).
'</label></td><td>';
617 if (!empty($mysoc->country_code))
619 print '<input name="rcs" id="profid4" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS :
'').
'">';
621 print $countrynotdefined;
627 if ($langs->transcountry(
"ProfId5", $mysoc->country_code) !=
'-')
629 print '<tr class="oddeven"><td><label for="profid5">'.$langs->transcountry(
"ProfId5", $mysoc->country_code).
'</label></td><td>';
630 if (!empty($mysoc->country_code))
632 print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_PROFID5) ? $conf->global->MAIN_INFO_PROFID5 :
'').
'">';
634 print $countrynotdefined;
640 if ($langs->transcountry(
"ProfId6", $mysoc->country_code) !=
'-')
642 print '<tr class="oddeven"><td><label for="profid6">'.$langs->transcountry(
"ProfId6", $mysoc->country_code).
'</label></td><td>';
643 if (!empty($mysoc->country_code))
645 print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_PROFID6) ? $conf->global->MAIN_INFO_PROFID6 :
'').
'">';
647 print $countrynotdefined;
653 print '<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans(
"VATIntra").
'</label></td><td>';
654 print '<input name="tva" id="intra_vat" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA :
'').
'">';
658 print '<tr class="oddeven"><td><label for="object">'.$langs->trans(
"CompanyObject").
'</label></td><td>';
659 print '<textarea class="flat quatrevingtpercent" name="object" id="object" rows="'.ROWS_5.
'">'.(!empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? $conf->global->MAIN_INFO_SOCIETE_OBJECT :
'').
'</textarea></td></tr>';
667 print '<table class="noborder centpercent editmode">';
668 print '<tr class="liste_titre">';
669 print '<td class="titlefield">'.$langs->trans(
"FiscalYearInformation").
'</td><td>'.$langs->trans(
"Value").
'</td>';
672 print '<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">'.$langs->trans(
"FiscalMonthStart").
'</label></td><td>';
673 print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,
'SOCIETE_FISCAL_MONTH_START', 0, 1,
'maxwidth100').
'</td></tr>';
682 print '<table class="noborder centpercent editmode">';
683 print
'<tr class="liste_titre">';
684 print
'<td width="25%">'.$langs->trans(
"VATManagement").
'</td><td>'.$langs->trans(
"Description").
'</td>';
685 print
'<td class="right"> </td>';
689 print
'<tr class="oddeven"><td width="140"><label><input type="radio" name="optiontva" id="use_vat" value="1"'.(empty($conf->global->FACTURE_TVAOPTION) ?
"" :
" checked").
"> ".$langs->trans(
"VATIsUsed").
"</label></td>";
690 print
'<td colspan="2">';
692 if ($mysoc->country_code ==
'FR') $tooltiphelp =
'<i>'.$langs->trans(
"Example").
': '.$langs->trans(
"VATIsUsedExampleFR").
"</i>";
693 print
"<label for=\"use_vat\">".$form->textwithpicto($langs->trans(
"VATIsUsedDesc"), $tooltiphelp).
"</label>";
694 print
"</td></tr>\n";
697 print
'<tr class="oddeven"><td width="140"><label><input type="radio" name="optiontva" id="no_vat" value="0"'.(empty($conf->global->FACTURE_TVAOPTION) ?
" checked" :
"").
"> ".$langs->trans(
"VATIsNotUsed").
"</label></td>";
698 print
'<td colspan="2">';
700 if ($mysoc->country_code ==
'FR') $tooltiphelp =
"<i>".$langs->trans(
"Example").
': '.$langs->trans(
"VATIsNotUsedExampleFR").
"</i>\n";
701 print
"<label for=\"no_vat\">".$form->textwithpicto($langs->trans(
"VATIsNotUsedDesc"), $tooltiphelp).
"</label>";
702 print
"</td></tr>\n";
708 print
'<table class="noborder centpercent editmode">';
709 print
'<tr class="liste_titre">';
710 print
'<td width="25%">'.$form->textwithpicto($langs->transcountry(
"LocalTax1Management", $mysoc->country_code), $langs->transcountry(
"LocalTax1IsUsedDesc", $mysoc->country_code)).
'</td><td>'.$langs->trans(
"Description").
'</td>';
711 print
'<td class="right"> </td>';
714 if ($mysoc->useLocalTax(1))
717 print
'<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION ==
'1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION ==
"localtax1on") ?
" checked" :
"").
"> ".$langs->transcountry(
"LocalTax1IsUsed", $mysoc->country_code).
"</td>";
718 print
'<td colspan="2">';
719 print
'<div class="nobordernopadding">';
720 $tooltiphelp = $langs->transcountry(
"LocalTax1IsUsedExample", $mysoc->country_code);
721 $tooltiphelp = ($tooltiphelp !=
"LocalTax1IsUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax1IsUsedExample", $mysoc->country_code).
"</i>\n" :
"");
722 print
'<label for="lt1">'.$form->textwithpicto($langs->transcountry(
"LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp).
"</label>";
725 print
'<br><label for="lt1">'.$langs->trans(
"LTRate").
'</label>: ';
726 $formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1,
"lt1");
729 $opcions = array($langs->trans(
"CalcLocaltax1").
' '.$langs->trans(
"CalcLocaltax1Desc"), $langs->trans(
"CalcLocaltax2").
' - '.$langs->trans(
"CalcLocaltax2Desc"), $langs->trans(
"CalcLocaltax3").
' - '.$langs->trans(
"CalcLocaltax3Desc"));
731 print
'<br><label for="clt1">'.$langs->trans(
"CalcLocaltax").
'</label>: ';
732 print $form->selectarray(
"clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1);
734 print
"</td></tr>\n";
736 print
'<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION ==
"localtax1off") ?
" checked" :
"").
"> ".$langs->transcountry(
"LocalTax1IsNotUsed", $mysoc->country_code).
"</td>";
737 print
'<td colspan="2">';
738 $tooltiphelp = $langs->transcountry(
"LocalTax1IsNotUsedExample", $mysoc->country_code);
739 $tooltiphelp = ($tooltiphelp !=
"LocalTax1IsNotUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax1IsNotUsedExample", $mysoc->country_code).
"</i>\n" :
"");
740 print
"<label for=\"nolt1\">".$form->textwithpicto($langs->transcountry(
"LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp).
"</label>";
741 print
"</td></tr>\n";
743 if (empty($mysoc->country_code))
745 print
'<tr class="oddeven nohover"><td class="">'.$countrynotdefined.
'</td><td></td><td></td></tr>';
747 print
'<tr class="oddeven nohover"><td class="" colspan="3">'.$langs->trans(
"NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Dictionaries"), $langs->transnoentitiesnoconv(
"DictionaryVAT"), $langs->transnoentitiesnoconv(
"LocalTax1Management")).
'</td></tr>';
755 print
'<table class="noborder centpercent editmode">';
756 print
'<tr class="liste_titre">';
757 print
'<td width="25%">'.$form->textwithpicto($langs->transcountry(
"LocalTax2Management", $mysoc->country_code), $langs->transcountry(
"LocalTax2IsUsedDesc", $mysoc->country_code)).
'</td><td>'.$langs->trans(
"Description").
'</td>';
758 print
'<td class="right"> </td>';
761 if ($mysoc->useLocalTax(2))
764 print
'<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION ==
'1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION ==
"localtax2on") ?
" checked" :
"").
"> ".$langs->transcountry(
"LocalTax2IsUsed", $mysoc->country_code).
"</td>";
765 print
'<td colspan="2">';
766 print
'<div class="nobordernopadding">';
767 print
'<label for="lt2">'.$langs->transcountry(
"LocalTax2IsUsedDesc", $mysoc->country_code).
"</label>";
768 $tooltiphelp = $langs->transcountry(
"LocalTax2IsUsedExample", $mysoc->country_code);
769 $tooltiphelp = ($tooltiphelp !=
"LocalTax2IsUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax2IsUsedExample", $mysoc->country_code).
"</i>\n" :
"");
772 print
'<br><label for="lt2">'.$langs->trans(
"LTRate").
'</label>: ';
773 $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2,
"lt2");
775 print
'<br><label for="clt2">'.$langs->trans(
"CalcLocaltax").
'</label>: ';
776 print $form->selectarray(
"clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2);
778 print
"</td></tr>\n";
780 print
'<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION ==
"localtax2off") ?
" checked" :
"").
"> ".$langs->transcountry(
"LocalTax2IsNotUsed", $mysoc->country_code).
"</td>";
781 print
'<td colspan="2">';
783 $tooltiphelp = $langs->transcountry(
"LocalTax2IsNotUsedExample", $mysoc->country_code);
784 $tooltiphelp = ($tooltiphelp !=
"LocalTax2IsNotUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax2IsNotUsedExample", $mysoc->country_code).
"</i>\n" :
"");
785 print
"<label for=\"nolt2\">".$form->textwithpicto($langs->transcountry(
"LocalTax2IsNotUsedDesc", $mysoc->country_code), $tooltiphelp).
"</label>";
787 print
"</td></tr>\n";
789 if (empty($mysoc->country_code))
791 print
'<tr class="oddeven nohover"><td class="">'.$countrynotdefined.
'</td><td></td><td></td></tr>';
793 print
'<tr class="oddeven nohover"><td class="" colspan="3">'.$langs->trans(
"NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Dictionaries"), $langs->transnoentitiesnoconv(
"DictionaryVAT"), $langs->transnoentitiesnoconv(
"LocalTax2Management")).
'</td></tr>';
802 print
'<table class="noborder centpercent editmode">';
803 print
'<tr class="liste_titre">';
804 print
'<td width="25%">'.$form->textwithpicto($langs->trans(
"RevenueStamp"), $langs->trans(
"RevenueStampDesc")).
'</td><td>'.$langs->trans(
"Description").
'</td>';
805 print
'<td class="right"> </td>';
807 if ($mysoc->useRevenueStamp())
810 print
'<tr class="oddeven"><td>';
811 print $langs->trans(
"UseRevenueStamp");
813 print
'<td colspan="2">';
814 print $langs->trans(
"UseRevenueStampExample", $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Dictionaries"), $langs->transnoentitiesnoconv(
"DictionaryRevenueStamp"));
815 print
"</td></tr>\n";
817 if (empty($mysoc->country_code))
819 print
'<tr class="oddeven nohover"><td class="">'.$countrynotdefined.
'</td><td></td><td></td></tr>';
821 print
'<tr class="oddeven nohover"><td class="" colspan="3">'.$langs->trans(
"NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Dictionaries"), $langs->transnoentitiesnoconv(
"DictionaryRevenueStamp"), $langs->transnoentitiesnoconv(
"RevenueStamp")).
'</td></tr>';
828 print
'<br><div class="center">';
829 print
'<input type="submit" class="button button-save" name="save" value="'.$langs->trans(
"Save").
'">';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
vignette($file, $maxWidth=160, $maxHeight=120, $extName= '_small', $quality=50, $outdir= 'thumbs', $targetformat=0)
Create a thumbnail from an image file (Supported extensions are gif, jpg, png and bmp)...
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
isOnlyOneLocalTax($local)
Return true if LocalTax (1 or 2) is unique.
image_format_supported($file, $acceptsvg=0)
Return if a filename is file name of a supported image format.
company_admin_prepare_head()
Return array head with list of tabs to view object informations.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save"&&empty($cancel)) $wikihelp
View.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1)
Remove a file or several files with a mask.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
getState($id, $withcode= '', $dbtouse=0, $withregion=0, $outputlangs= '', $entconv=1)
Return state translated from an id.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles= 'addedfile', $upload_dir= '')
Make control on an uploaded file from an GUI page and move it to final destination.
activateModulesRequiredByCountry($country_code)
Activate external modules mandatory when country is country_code.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
img_delete($titlealt= 'default', $other= 'class="pictodelete"', $morecss= '')
Show delete logo.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= '', $textfordropdown= '')
Show information for admin users or standard users.
getCountry($searchkey, $withcode= '', $dbtouse=0, $outputlangs= '', $entconv=1, $searchlabel= '')
Return country label, code or id from an id, code or label.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)