31 require
'../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
41 $action =
GETPOST(
'action',
'aZ09');
42 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'admincompany';
45 $langs->loadLangs(array(
'admin',
'companies',
'bills'));
54 $hookmanager->initHooks(array(
'admincompany',
'globaladmin'));
61 $parameters = array();
62 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
67 if (($action ==
'update' && !
GETPOST(
"cancel",
'alpha'))
68 || ($action ==
'updateedit')) {
70 if (!empty($tmparray[
'id'])) {
71 $mysoc->country_id = $tmparray[
'id'];
72 $mysoc->country_code = $tmparray[
'code'];
73 $mysoc->country_label = $tmparray[
'label'];
75 $s = $mysoc->country_id.
':'.$mysoc->country_code.
':'.$mysoc->country_label;
76 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_COUNTRY", $s,
'chaine', 0,
'', $conf->entity);
81 $tmparray =
getState(
GETPOST(
'state_id',
'int'),
'all', $db, $langs, 0);
82 if (!empty($tmparray[
'id'])) {
83 $mysoc->state_id = $tmparray[
'id'];
84 $mysoc->state_code = $tmparray[
'code'];
85 $mysoc->state_label = $tmparray[
'label'];
87 $s = $mysoc->state_id.
':'.$mysoc->state_code.
':'.$mysoc->state_label;
88 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_STATE", $s,
'chaine', 0,
'', $conf->entity);
96 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_ADDRESS",
GETPOST(
"MAIN_INFO_SOCIETE_ADDRESS",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
97 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_TOWN",
GETPOST(
"MAIN_INFO_SOCIETE_TOWN",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
98 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_ZIP",
GETPOST(
"MAIN_INFO_SOCIETE_ZIP",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
99 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_REGION",
GETPOST(
"region_code",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
108 $dirforimage = $conf->mycompany->dir_output.
'/logos/';
110 $arrayofimages = array(
'logo',
'logo_squarred');
112 foreach ($arrayofimages as $varforimage) {
113 if ($_FILES[$varforimage][
"name"] && !preg_match(
'/(\.jpeg|\.jpg|\.png)$/i', $_FILES[$varforimage][
"name"])) {
114 $langs->load(
"errors");
122 if (preg_match(
'/([^\\/:]+)$/i', $_FILES[$varforimage][
"name"], $reg)) {
123 $original_file = $reg[1];
127 dol_syslog(
"Move file ".$_FILES[$varforimage][
"tmp_name"].
" to ".$dirforimage.$original_file);
128 if (!is_dir($dirforimage)) {
131 $result =
dol_move_uploaded_file($_FILES[$varforimage][
"tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage][
'error']);
133 $constant =
"MAIN_INFO_SOCIETE_LOGO";
134 if ($varforimage ==
'logo_squarred') {
135 $constant =
"MAIN_INFO_SOCIETE_LOGO_SQUARRED";
146 $imgThumbSmall =
vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall,
'_small', $quality);
148 $imgThumbSmall = $reg[1];
149 dolibarr_set_const($db, $constant.
"_SMALL", $imgThumbSmall,
'chaine', 0,
'', $conf->entity);
155 $imgThumbMini =
vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini,
'_mini', $quality);
157 $imgThumbMini = $reg[1];
158 dolibarr_set_const($db, $constant.
"_MINI", $imgThumbMini,
'chaine', 0,
'', $conf->entity);
163 dol_syslog(
"ErrorImageFormatNotSupported", LOG_WARNING);
165 } elseif (preg_match(
'/^ErrorFileIsInfectedWithAVirus/', $result)) {
167 $langs->load(
"errors");
168 $tmparray = explode(
':', $result);
169 setEventMessages($langs->trans(
'ErrorFileIsInfectedWithAVirus', $tmparray[1]),
null,
'errors');
170 } elseif (preg_match(
'/^ErrorFileSizeTooLarge/', $result)) {
179 $langs->load(
"errors");
186 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_MANAGERS",
GETPOST(
"MAIN_INFO_SOCIETE_MANAGERS",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
189 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_FORME_JURIDIQUE",
GETPOST(
"forme_juridique_code",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
194 dolibarr_set_const($db,
"MAIN_INFO_PROFID5",
GETPOST(
"MAIN_INFO_PROFID5",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
195 dolibarr_set_const($db,
"MAIN_INFO_PROFID6",
GETPOST(
"MAIN_INFO_PROFID6",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
198 dolibarr_set_const($db,
"MAIN_INFO_SOCIETE_OBJECT",
GETPOST(
"socialobject",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
200 dolibarr_set_const($db,
"SOCIETE_FISCAL_MONTH_START",
GETPOST(
"SOCIETE_FISCAL_MONTH_START",
'int'),
'chaine', 0,
'', $conf->entity);
203 $usevat =
GETPOST(
"optiontva",
'aZ09');
204 $uselocaltax1 =
GETPOST(
"optionlocaltax1",
'aZ09');
205 $uselocaltax2 =
GETPOST(
"optionlocaltax2",
'aZ09');
206 if ($uselocaltax1 ==
'localtax1on' && !$usevat) {
207 setEventMessages($langs->trans(
"IfYouUseASecondTaxYouMustSetYouUseTheMainTax"),
null,
'errors');
210 if ($uselocaltax2 ==
'localtax2on' && !$usevat) {
211 setEventMessages($langs->trans(
"IfYouUseAThirdTaxYouMustSetYouUseTheMainTax"),
null,
'errors');
215 dolibarr_set_const($db,
"FACTURE_TVAOPTION", $usevat,
'chaine', 0,
'', $conf->entity);
216 dolibarr_set_const($db,
"FACTURE_LOCAL_TAX1_OPTION", $uselocaltax1,
'chaine', 0,
'', $conf->entity);
217 dolibarr_set_const($db,
"FACTURE_LOCAL_TAX2_OPTION", $uselocaltax2,
'chaine', 0,
'', $conf->entity);
219 if (
GETPOST(
"optionlocaltax1") ==
"localtax1on") {
221 dolibarr_set_const($db,
"MAIN_INFO_VALUE_LOCALTAX1", 0,
'chaine', 0,
'', $conf->entity);
227 if (
GETPOST(
"optionlocaltax2") ==
"localtax2on") {
229 dolibarr_set_const($db,
"MAIN_INFO_VALUE_LOCALTAX2", 0,
'chaine', 0,
'', $conf->entity);
248 if ($action !=
'updateedit' && !$error) {
249 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
254 if ($action ==
'addthumb' || $action ==
'addthumbsquarred') {
255 if (file_exists($conf->mycompany->dir_output.
'/logos/'.$_GET[
"file"])) {
260 $constant =
"MAIN_INFO_SOCIETE_LOGO";
261 if ($action ==
'addthumbsquarred') {
262 $constant =
"MAIN_INFO_SOCIETE_LOGO_SQUARRED";
271 $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);
280 $imgThumbMini =
vignette($conf->mycompany->dir_output.
'/logos/'.$_GET[
"file"], $maxwidthmini, $maxheightmini,
'_mini', $quality);
282 $imgThumbMini = $reg[1];
283 dolibarr_set_const($db, $constant.
"_MINI", $imgThumbMini,
'chaine', 0,
'', $conf->entity);
288 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
292 $langs->load(
"errors");
294 dol_syslog($langs->transnoentities(
"ErrorBadImageFormat"), LOG_INFO);
298 $langs->load(
"errors");
300 dol_syslog($langs->transnoentities(
"ErrorFileDoesNotExists",
GETPOST(
"file")), LOG_WARNING);
305 if ($action ==
'removelogo' || $action ==
'removelogosquarred') {
306 $constant =
"MAIN_INFO_SOCIETE_LOGO";
307 if ($action ==
'removelogosquarred') {
308 $constant =
"MAIN_INFO_SOCIETE_LOGO_SQUARRED";
311 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
313 $logofilename = $mysoc->logo;
314 $logofilenamebis = $mysoc->logo_squarred;
315 if ($action ==
'removelogosquarred') {
316 $logofilename = $mysoc->logo_squarred;
317 $logofilenamebis = $mysoc->logo;
320 $logofile = $conf->mycompany->dir_output.
'/logos/'.$logofilename;
321 if ($logofilename !=
'' && $logofilename != $logofilenamebis) {
325 if ($action ==
'removelogosquarred') {
326 $mysoc->logo_squarred =
'';
331 $logofilename = $mysoc->logo_small;
332 $logofilenamebis = $mysoc->logo_squarred_small;
333 if ($action ==
'removelogosquarred') {
334 $logofilename = $mysoc->logo_squarred_small;
335 $logofilenamebis = $mysoc->logo_small;
338 $logosmallfile = $conf->mycompany->dir_output.
'/logos/thumbs/'.$logofilename;
339 if ($logofilename !=
'' && $logofilename != $logofilenamebis) {
343 if ($action ==
'removelogosquarred') {
344 $mysoc->logo_squarred_small =
'';
346 $mysoc->logo_small =
'';
349 $logofilename = $mysoc->logo_mini;
350 $logofilenamebis = $mysoc->logo_squarred_mini;
351 if ($action ==
'removelogosquarred') {
352 $logofilename = $mysoc->logo_squarred_mini;
353 $logofilenamebis = $mysoc->logo_mini;
356 $logominifile = $conf->mycompany->dir_output.
'/logos/thumbs/'.$logofilename;
357 if ($logofilename !=
'' && $logofilename != $logofilenamebis) {
361 if ($action ==
'removelogosquarred') {
362 $mysoc->logo_squarred_mini =
'';
364 $mysoc->logo_mini =
'';
373 $wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
380 $countrynotdefined =
'<span class="error">'.$langs->trans(
"ErrorSetACountryFirst").
' <a href="#trzipbeforecountry">('.$langs->trans(
"SeeAbove").
')</a></span>';
382 print
load_fiche_titre($langs->trans(
"CompanyFoundation"),
'',
'title_setup');
388 print
'<span class="opacitymedium">'.$langs->trans(
"CompanyFundationDesc", $langs->transnoentities(
"Save")).
"</span><br>\n";
394 if (!empty($conf->use_javascript_ajax)) {
395 print
"\n".
'<script type="text/javascript">';
396 print
'$(document).ready(function () {
397 $("#selectcountry_id").change(function() {
398 document.form_index.action.value="updateedit";
399 document.form_index.submit();
402 print
'</script>'.
"\n";
405 print
'<form enctype="multipart/form-data" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="form_index">';
406 print
'<input type="hidden" name="token" value="'.newToken().
'">';
407 print
'<input type="hidden" name="action" value="update">';
409 print
'<table class="noborder centpercent editmode">';
410 print
'<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans(
"CompanyInfo").
'</th><th></th></tr>'.
"\n";
413 print
'<tr class="oddeven"><td class="fieldrequired wordbreak"><label for="name">'.$langs->trans(
"CompanyName").
'</label></td><td>';
414 print
'<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag((
GETPOSTISSET(
'nom') ?
GETPOST(
'nom',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? $conf->global->MAIN_INFO_SOCIETE_NOM :
''))).
'"'.(empty($conf->global->MAIN_INFO_SOCIETE_NOM) ?
' autofocus="autofocus"' :
'').
'></td></tr>'.
"\n";
417 print
'<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans(
"CompanyAddress").
'</label></td><td>';
418 print
'<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.
'">'.(
GETPOSTISSET(
'MAIN_INFO_SOCIETE_ADDRESS') ?
GETPOST(
'MAIN_INFO_SOCIETE_ADDRESS',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS) ? $conf->global->MAIN_INFO_SOCIETE_ADDRESS :
'')).
'</textarea></td></tr>'.
"\n";
421 print
'<tr class="oddeven" id="trzipbeforecountry"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans(
"CompanyZip").
'</label></td><td>';
422 print
'<input class="width100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag((
GETPOSTISSET(
'MAIN_INFO_SOCIETE_ZIP') ?
GETPOST(
'MAIN_INFO_SOCIETE_ZIP',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_ZIP) ? $conf->global->MAIN_INFO_SOCIETE_ZIP :
''))).
'"></td></tr>'.
"\n";
424 print
'<tr class="oddeven" id="trtownbeforecountry"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans(
"CompanyTown").
'</label></td><td>';
425 print
'<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag((
GETPOSTISSET(
'MAIN_INFO_SOCIETE_TOWN') ?
GETPOST(
'MAIN_INFO_SOCIETE_TOWN',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_TOWN) ? $conf->global->MAIN_INFO_SOCIETE_TOWN :
''))).
'"></td></tr>'.
"\n";
428 print
'<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans(
"Country").
'</label></td><td>';
429 print
img_picto(
'',
'globe-americas',
'class="pictofixedwidth"');
430 print
$form->select_country($mysoc->country_id,
'country_id',
'', 0);
432 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
434 print
'</td></tr>'.
"\n";
436 print
'<tr class="oddeven"><td class="wordbreak"><label for="state_id">'.$langs->trans(
"State").
'</label></td><td>';
438 if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE)) {
439 $tmp = explode(
':', $conf->global->MAIN_INFO_SOCIETE_STATE);
442 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
443 print $formcompany->select_state($state_id, $mysoc->country_code,
'state_id',
'maxwidth200onsmartphone minwidth300');
444 print
'</td></tr>'.
"\n";
447 print
'<tr class="oddeven"><td><label for="currency">'.$langs->trans(
"CompanyCurrency").
'</label></td><td>';
448 print
img_picto(
'',
'multicurrency',
'class="pictofixedwidth"');
449 print
$form->selectCurrency($conf->currency,
"currency");
450 print
'</td></tr>'.
"\n";
453 print
'<tr class="oddeven"><td><label for="phone">'.$langs->trans(
"Phone").
'</label></td><td>';
454 print
img_picto(
'',
'object_phoning',
'',
false, 0, 0,
'',
'pictofixedwidth');
455 print
'<input class="maxwidth150 widthcentpercentminusx" name="tel" id="phone" value="'.dol_escape_htmltag((
GETPOSTISSET(
'tel') ?
GETPOST(
'tel',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_TEL) ? $conf->global->MAIN_INFO_SOCIETE_TEL :
''))).
'"></td></tr>';
456 print
'</td></tr>'.
"\n";
459 print
'<tr class="oddeven"><td><label for="fax">'.$langs->trans(
"Fax").
'</label></td><td>';
460 print
img_picto(
'',
'object_phoning_fax',
'',
false, 0, 0,
'',
'pictofixedwidth');
461 print
'<input class="maxwidth150" name="fax" id="fax" value="'.dol_escape_htmltag((
GETPOSTISSET(
'fax') ?
GETPOST(
'fax',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_FAX) ? $conf->global->MAIN_INFO_SOCIETE_FAX :
''))).
'"></td></tr>';
462 print
'</td></tr>'.
"\n";
465 print
'<tr class="oddeven"><td><label for="email">'.$langs->trans(
"EMail").
'</label></td><td>';
466 print
img_picto(
'',
'object_email',
'',
false, 0, 0,
'',
'pictofixedwidth');
467 print
'<input class="minwidth300 maxwidth500 widthcentpercentminusx" name="mail" id="email" value="'.dol_escape_htmltag((
GETPOSTISSET(
'mail') ?
GETPOST(
'mail',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL :
''))).
'"></td></tr>';
468 print
'</td></tr>'.
"\n";
471 print
'<tr class="oddeven"><td><label for="web">'.$langs->trans(
"Web").
'</label></td><td>';
472 print
img_picto(
'',
'globe',
'',
false, 0, 0,
'',
'pictofixedwidth');
473 print
'<input class="maxwidth300 widthcentpercentminusx" name="web" id="web" value="'.dol_escape_htmltag((
GETPOSTISSET(
'web') ?
GETPOST(
'web',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_WEB) ? $conf->global->MAIN_INFO_SOCIETE_WEB :
''))).
'"></td></tr>';
474 print
'</td></tr>'.
"\n";
478 print
'<tr class="oddeven"><td>';
479 print
'<label for="barcode">'.$langs->trans(
"Gencod").
'</label></td><td>';
480 print
'<span class="fa fa-barcode pictofixedwidth"></span>';
481 print
'<input name="barcode" id="barcode" class="minwidth150 widthcentpercentminusx maxwidth300" value="'.dol_escape_htmltag((
GETPOSTISSET(
'barcode') ?
GETPOST(
'barcode',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_GENCODE) ? $conf->global->MAIN_INFO_SOCIETE_GENCODE :
''))).
'"></td></tr>';
486 $tooltiplogo = $langs->trans(
'AvailableFormats').
' : png, jpg, jpeg';
488 $maxmin = $maxfilesizearray[
'maxmin'];
489 $tooltiplogo .= ($maxmin > 0) ?
'<br>'.$langs->trans(
'MaxSize').
' : '.$maxmin.
' '.$langs->trans(
'Kb') :
'';
492 print
'<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans(
"Logo"), $tooltiplogo).
'</label></td><td>';
493 print
'<div class="centpercent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
495 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
497 print
'<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="logo" id="logo" accept="image/*">';
499 if (!empty($mysoc->logo_small)) {
500 if (file_exists($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_small)) {
501 print
'<div class="inline-block valignmiddle">';
502 print
'<img style="max-height: 80px; max-width: 200px;" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.$mysoc->logo_small).
'">';
504 } elseif (!empty($mysoc->logo)) {
505 if (!file_exists($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_mini)) {
506 $imgThumbMini =
vignette($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini,
'_mini', $quality);
508 $imgThumbSmall =
vignette($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini,
'_small', $quality);
509 print
'<div class="inline-block valignmiddle">';
510 print
'<img style="max-height: 80px; max-width: 200px;" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.basename($imgThumbSmall)).
'">';
513 print
'<div class="inline-block valignmiddle marginrightonly">';
514 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=removelogo&token='.
newToken().
'">'.
img_delete($langs->trans(
"Delete"),
'',
'marginleftonly').
'</a>';
516 } elseif (!empty($mysoc->logo)) {
517 if (file_exists($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo)) {
518 print
'<div class="inline-block valignmiddle">';
519 print
'<img style="max-height: 80px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/'.$mysoc->logo).
'">';
521 print
'<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=removelogo&token='.
newToken().
'">'.
img_delete($langs->trans(
"Delete"),
'',
'marginleftonly').
'</a></div>';
523 print
'<div class="inline-block valignmiddle">';
524 print
'<img height="80" src="'.DOL_URL_ROOT.
'/public/theme/common/nophoto.png">';
532 print
'<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans(
"LogoSquarred"), $tooltiplogo).
'</label></td><td>';
533 print
'<div class="centpercent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
535 $maxmin = $maxfilesizearray[
'maxmin'];
537 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
539 print
'<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="logo_squarred" id="logo_squarred" accept="image/*">';
541 if (!empty($mysoc->logo_squarred_small)) {
542 if (file_exists($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_squarred_small)) {
543 print
'<div class="inline-block valignmiddle marginrightonly">';
544 print
'<img style="max-height: 80px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.$mysoc->logo_squarred_small).
'">';
546 } elseif (!empty($mysoc->logo_squarred)) {
547 if (!file_exists($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
548 $imgThumbMini =
vignette($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo_squarred, $maxwidthmini, $maxheightmini,
'_mini', $quality);
550 $imgThumbSmall =
vignette($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo_squarred, $maxwidthmini, $maxheightmini,
'_small', $quality);
551 print
'<div class="inline-block valignmiddle">';
552 print
'<img style="max-height: 80px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/thumbs/'.basename($imgThumbSmall)).
'">';
555 print
'<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=removelogosquarred&token='.
newToken().
'">'.
img_delete($langs->trans(
"Delete"),
'',
'marginleftonly').
'</a></div>';
556 } elseif (!empty($mysoc->logo_squarred)) {
557 if (file_exists($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo_squarred)) {
558 print
'<div class="inline-block valignmiddle">';
559 print
'<img style="max-height: 80px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/'.$mysoc->logo_squarred).
'">';
561 print
'<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=removelogosquarred&token='.
newToken().
'">'.
img_delete($langs->trans(
"Delete"),
'',
'marginleftonly').
'</a></div>';
563 print
'<div class="inline-block valignmiddle">';
564 print
'<img height="80" src="'.DOL_URL_ROOT.
'/public/theme/common/nophoto.png">';
572 print
'<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans(
"Note").
'</label></td><td>';
573 print
'<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.
'">'.(
GETPOSTISSET(
'note') ?
GETPOST(
'note',
'restricthtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? $conf->global->MAIN_INFO_SOCIETE_NOTE :
'')).
'</textarea></td></tr>';
583 print
'<div class="div-table-responsive-no-min">';
584 print
'<table class="noborder centpercent editmode">';
585 print
'<tr class="liste_titre"><td class="titlefieldcreate wordbreak">'.$langs->trans(
"CompanyIds").
'</td><td></td></tr>';
587 $langs->load(
"companies");
590 print
'<tr class="oddeven"><td><label for="director">'.$langs->trans(
"ManagingDirectors").
'</label></td><td>';
591 print
'<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth300" value="'.dol_escape_htmltag((
GETPOSTISSET(
'MAIN_INFO_SOCIETE_MANAGERS') ?
GETPOST(
'MAIN_INFO_SOCIETE_MANAGERS',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MANAGERS) ? $conf->global->MAIN_INFO_SOCIETE_MANAGERS :
''))).
'"></td></tr>';
594 print
'<tr class="oddeven"><td>';
595 print
$form->textwithpicto($langs->trans(
"GDPRContact"), $langs->trans(
"GDPRContactDesc"));
597 print
'<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth300" value="'.dol_escape_htmltag((
GETPOSTISSET(
"MAIN_INFO_GDPR") ?
GETPOST(
"MAIN_INFO_GDPR",
'alphanohtml') : (!empty($conf->global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR :
''))).
'"></td></tr>';
600 print
'<tr class="oddeven"><td><label for="capital">'.$langs->trans(
"Capital").
'</label></td><td>';
601 print
'<input name="capital" id="capital" class="maxwidth100" value="'.dol_escape_htmltag((
GETPOSTISSET(
'capital') ?
GETPOST(
'capital',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_CAPITAL) ? $conf->global->MAIN_INFO_CAPITAL :
''))).
'"></td></tr>';
604 print
'<tr class="oddeven"><td><label for="forme_juridique_code">'.$langs->trans(
"JuridicalStatus").
'</label></td><td>';
605 if ($mysoc->country_code) {
606 print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code,
'',
'forme_juridique_code');
608 print $countrynotdefined;
613 if ($langs->transcountry(
"ProfId1", $mysoc->country_code) !=
'-') {
614 print
'<tr class="oddeven"><td><label for="profid1">'.$langs->transcountry(
"ProfId1", $mysoc->country_code).
'</label></td><td>';
615 if (!empty($mysoc->country_code)) {
616 print
'<input name="siren" id="profid1" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN :
'').
'">';
618 print $countrynotdefined;
624 if ($langs->transcountry(
"ProfId2", $mysoc->country_code) !=
'-') {
625 print
'<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry(
"ProfId2", $mysoc->country_code).
'</label></td><td>';
626 if (!empty($mysoc->country_code)) {
627 print
'<input name="siret" id="profid2" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET :
'').
'">';
629 print $countrynotdefined;
635 if ($langs->transcountry(
"ProfId3", $mysoc->country_code) !=
'-') {
636 print
'<tr class="oddeven"><td><label for="profid3">'.$langs->transcountry(
"ProfId3", $mysoc->country_code).
'</label></td><td>';
637 if (!empty($mysoc->country_code)) {
638 print
'<input name="ape" id="profid3" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE :
'').
'">';
640 print $countrynotdefined;
646 if ($langs->transcountry(
"ProfId4", $mysoc->country_code) !=
'-') {
647 print
'<tr class="oddeven"><td><label for="profid4">'.$langs->transcountry(
"ProfId4", $mysoc->country_code).
'</label></td><td>';
648 if (!empty($mysoc->country_code)) {
649 print
'<input name="rcs" id="profid4" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS :
'').
'">';
651 print $countrynotdefined;
657 if ($langs->transcountry(
"ProfId5", $mysoc->country_code) !=
'-') {
658 print
'<tr class="oddeven"><td><label for="profid5">'.$langs->transcountry(
"ProfId5", $mysoc->country_code).
'</label></td><td>';
659 if (!empty($mysoc->country_code)) {
660 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 :
'').
'">';
662 print $countrynotdefined;
668 if ($langs->transcountry(
"ProfId6", $mysoc->country_code) !=
'-') {
669 print
'<tr class="oddeven"><td><label for="profid6">'.$langs->transcountry(
"ProfId6", $mysoc->country_code).
'</label></td><td>';
670 if (!empty($mysoc->country_code)) {
671 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 :
'').
'">';
673 print $countrynotdefined;
679 print
'<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans(
"VATIntra").
'</label></td><td>';
680 print
'<input name="tva" id="intra_vat" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA :
'').
'">';
684 print
'<tr class="oddeven"><td><label for="socialobject">'.$langs->trans(
"CompanyObject").
'</label></td><td>';
685 print
'<textarea class="flat quatrevingtpercent" name="socialobject" id="socialobject" rows="'.ROWS_5.
'">'.(!empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? $conf->global->MAIN_INFO_SOCIETE_OBJECT :
'').
'</textarea></td></tr>';
694 print
'<table class="noborder centpercent editmode">';
695 print
'<tr class="liste_titre">';
696 print
'<td class="titlefieldcreate">'.$langs->trans(
"FiscalYearInformation").
'</td><td></td>';
699 print
'<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">'.$langs->trans(
"FiscalMonthStart").
'</label></td><td>';
700 print $formother->select_month(!empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START :
'',
'SOCIETE_FISCAL_MONTH_START', 0, 1,
'maxwidth100').
'</td></tr>';
707 print
load_fiche_titre($langs->trans(
"TypeOfSaleTaxes"),
'',
'object_payment');
709 print
'<table class="noborder centpercent editmode">';
710 print
'<tr class="liste_titre">';
711 print
'<td class="titlefieldcreate">'.$langs->trans(
"VATManagement").
'</td><td></td>';
712 print
'<td class="right"> </td>';
716 print
'<tr class="oddeven"><td><label><input type="radio" name="optiontva" id="use_vat" value="1"'.(empty($conf->global->FACTURE_TVAOPTION) ?
"" :
" checked").
"> ".$langs->trans(
"VATIsUsed").
"</label></td>";
717 print
'<td colspan="2">';
719 if ($mysoc->country_code ==
'FR') {
720 $tooltiphelp =
'<i>'.$langs->trans(
"Example").
': '.$langs->trans(
"VATIsUsedExampleFR").
"</i>";
722 print
'<label for="use_vat">'.$form->textwithpicto($langs->trans(
"VATIsUsedDesc"), $tooltiphelp).
"</label>";
723 print
"</td></tr>\n";
726 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>";
727 print
'<td colspan="2">';
729 if ($mysoc->country_code ==
'FR') {
730 $tooltiphelp =
"<i>".$langs->trans(
"Example").
': '.$langs->trans(
"VATIsNotUsedExampleFR").
"</i>\n";
732 print
'<label for="no_vat">'.$form->textwithpicto($langs->trans(
"VATIsNotUsedDesc"), $tooltiphelp).
"</label>";
733 print
"</td></tr>\n";
739 print
'<table class="noborder centpercent editmode">';
740 print
'<tr class="liste_titre">';
741 print
'<td class="titlefieldcreate">'.$form->textwithpicto($langs->transcountry(
"LocalTax1Management", $mysoc->country_code), $langs->transcountry(
"LocalTax1IsUsedDesc", $mysoc->country_code)).
'</td><td></td>';
742 print
'<td class="right"> </td>';
745 if ($mysoc->useLocalTax(1)) {
747 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" :
"").
'> <label for="lt1">'.$langs->transcountry(
"LocalTax1IsUsed", $mysoc->country_code).
"</label></td>";
748 print
'<td colspan="2">';
749 print
'<div class="nobordernopadding">';
750 $tooltiphelp = $langs->transcountry(
"LocalTax1IsUsedExample", $mysoc->country_code);
751 $tooltiphelp = ($tooltiphelp !=
"LocalTax1IsUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax1IsUsedExample", $mysoc->country_code).
"</i>\n" :
"");
752 print
$form->textwithpicto($langs->transcountry(
"LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp);
754 print
'<br><label for="lt1">'.$langs->trans(
"LTRate").
'</label>: ';
755 $formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1,
"lt1");
758 $opcions = array($langs->trans(
"CalcLocaltax1").
' '.$langs->trans(
"CalcLocaltax1Desc"), $langs->trans(
"CalcLocaltax2").
' - '.$langs->trans(
"CalcLocaltax2Desc"), $langs->trans(
"CalcLocaltax3").
' - '.$langs->trans(
"CalcLocaltax3Desc"));
760 print
'<br><label for="clt1">'.$langs->trans(
"CalcLocaltax").
'</label>: ';
763 print
"</td></tr>\n";
765 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" :
"").
'> <label for="nolt1">'.$langs->transcountry(
"LocalTax1IsNotUsed", $mysoc->country_code).
"</label></td>";
766 print
'<td colspan="2">';
767 $tooltiphelp = $langs->transcountry(
"LocalTax1IsNotUsedExample", $mysoc->country_code);
768 $tooltiphelp = ($tooltiphelp !=
"LocalTax1IsNotUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax1IsNotUsedExample", $mysoc->country_code).
"</i>\n" :
"");
769 print
$form->textwithpicto($langs->transcountry(
"LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp);
770 print
"</td></tr>\n";
772 if (empty($mysoc->country_code)) {
773 print
'<tr class="oddeven nohover"><td class="">'.$countrynotdefined.
'</td><td></td><td></td></tr>';
775 print
'<tr class="oddeven nohover"><td class="" colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Dictionaries"), $langs->transnoentitiesnoconv(
"DictionaryVAT"), $langs->transnoentitiesnoconv(
"LocalTax1Management")).
'</span></td></tr>';
783 print
'<table class="noborder centpercent editmode">';
784 print
'<tr class="liste_titre">';
785 print
'<td class="titlefieldcreate">'.$form->textwithpicto($langs->transcountry(
"LocalTax2Management", $mysoc->country_code), $langs->transcountry(
"LocalTax2IsUsedDesc", $mysoc->country_code)).
'</td><td></td>';
786 print
'<td class="right"> </td>';
789 if ($mysoc->useLocalTax(2)) {
791 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" :
"").
'> <label for="lt2">'.$langs->transcountry(
"LocalTax2IsUsed", $mysoc->country_code).
"</label></td>";
792 print
'<td colspan="2">';
793 print
'<div class="nobordernopadding">';
794 print
'<label for="lt2">'.$langs->transcountry(
"LocalTax2IsUsedDesc", $mysoc->country_code).
"</label>";
795 $tooltiphelp = $langs->transcountry(
"LocalTax2IsUsedExample", $mysoc->country_code);
796 $tooltiphelp = ($tooltiphelp !=
"LocalTax2IsUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax2IsUsedExample", $mysoc->country_code).
"</i>\n" :
"");
798 print
'<br><label for="lt2">'.$langs->trans(
"LTRate").
'</label>: ';
799 $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2,
"lt2");
801 print
'<br><label for="clt2">'.$langs->trans(
"CalcLocaltax").
'</label>: ';
804 print
"</td></tr>\n";
806 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" :
"").
'> <label for="nolt2">'.$langs->transcountry(
"LocalTax2IsNotUsed", $mysoc->country_code).
"</label></td>";
807 print
'<td colspan="2">';
809 $tooltiphelp = $langs->transcountry(
"LocalTax2IsNotUsedExample", $mysoc->country_code);
810 $tooltiphelp = ($tooltiphelp !=
"LocalTax2IsNotUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax2IsNotUsedExample", $mysoc->country_code).
"</i>\n" :
"");
811 print
"<label for=\"nolt2\">".$form->textwithpicto($langs->transcountry(
"LocalTax2IsNotUsedDesc", $mysoc->country_code), $tooltiphelp).
"</label>";
813 print
"</td></tr>\n";
815 if (empty($mysoc->country_code)) {
816 print
'<tr class="oddeven nohover"><td class="">'.$countrynotdefined.
'</td><td></td><td></td></tr>';
818 print
'<tr class="oddeven nohover"><td class="" colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Dictionaries"), $langs->transnoentitiesnoconv(
"DictionaryVAT"), $langs->transnoentitiesnoconv(
"LocalTax2Management")).
'</span></td></tr>';
827 print
'<table class="noborder centpercent editmode">';
828 print
'<tr class="liste_titre">';
829 print
'<td>'.$form->textwithpicto($langs->trans(
"RevenueStamp"), $langs->trans(
"RevenueStampDesc")).
'</td><td></td>';
830 print
'<td class="right"> </td>';
832 if ($mysoc->useRevenueStamp()) {
834 print
'<tr class="oddeven"><td>';
835 print $langs->trans(
"UseRevenueStamp");
837 print
'<td colspan="2">';
838 print $langs->trans(
"UseRevenueStampExample", $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Dictionaries"), $langs->transnoentitiesnoconv(
"DictionaryRevenueStamp"));
839 print
"</td></tr>\n";
841 if (empty($mysoc->country_code)) {
842 print
'<tr class="oddeven nohover"><td class="">'.$countrynotdefined.
'</td><td></td><td></td></tr>';
844 print
'<tr class="oddeven nohover"><td class="" colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Dictionaries"), $langs->transnoentitiesnoconv(
"DictionaryRevenueStamp"), $langs->transnoentitiesnoconv(
"RevenueStamp")).
'</span></td></tr>';
850 print
$form->buttonsSaveCancel(
"Save",
'');