34require
'../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
45$action =
GETPOST(
'action',
'aZ09');
46$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'admincompany';
59$langs->loadLangs(array(
'admin',
'companies',
'bills'));
68$maxwidthsmall = $tmparraysize[
'maxwidthsmall'];
69$maxheightsmall = $tmparraysize[
'maxheightsmall'];
70$maxwidthmini = $tmparraysize[
'maxwidthmini'];
71$maxheightmini = $tmparraysize[
'maxheightmini'];
72$quality = $tmparraysize[
'quality'];
75$hookmanager->initHooks(array(
'admincompany',
'globaladmin'));
83$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
88if (($action ==
'update' && !
GETPOST(
"cancel",
'alpha'))
89|| ($action ==
'updateedit')) {
91 if (!empty($tmparray[
'id'])) {
92 if ($tmparray[
'code'] ==
'FR' && $tmparray[
'id'] != $mysoc->country_id) {
97 $mysoc->country_id = $tmparray[
'id'];
98 $mysoc->country_code = $tmparray[
'code'];
99 $mysoc->country_label = $tmparray[
'label'];
101 $s = $mysoc->country_id.
':'.$mysoc->country_code.
':'.$mysoc->country_label;
108 if (!empty($tmparray[
'id'])) {
109 $mysoc->state_id = $tmparray[
'id'];
110 $mysoc->state_code = $tmparray[
'code'];
111 $mysoc->state_label = $tmparray[
'label'];
113 $s = $mysoc->state_id.
':'.$mysoc->state_code.
':'.$mysoc->state_label;
135 $dirforimage =
$conf->mycompany->dir_output.
'/logos/';
137 $arrayofimages = array(
'logo',
'logo_squarred');
139 foreach ($arrayofimages as $varforimage) {
140 if ($_FILES[$varforimage][
"name"] && !preg_match(
'/(\.jpeg|\.jpg|\.png)$/i', $_FILES[$varforimage][
"name"])) {
141 $langs->load(
"errors");
149 if (preg_match(
'/([^\\/:]+)$/i', $_FILES[$varforimage][
"name"], $reg)) {
150 $original_file = $reg[1];
154 dol_syslog(
"Move file ".$_FILES[$varforimage][
"tmp_name"].
" to ".$dirforimage.$original_file);
155 if (!is_dir($dirforimage)) {
158 $result =
dol_move_uploaded_file($_FILES[$varforimage][
"tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage][
'error']);
160 if (is_numeric($result) && $result > 0) {
161 $constant =
"MAIN_INFO_SOCIETE_LOGO";
162 if ($varforimage ==
'logo_squarred') {
163 $constant =
"MAIN_INFO_SOCIETE_LOGO_SQUARRED";
175 $imgThumbSmall =
vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall,
'_small', $quality);
177 $imgThumbSmall = $reg[1];
184 $imgThumbMini =
vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini,
'_mini', $quality);
186 $imgThumbMini = $reg[1];
192 dol_syslog(
"ErrorImageFormatNotSupported", LOG_WARNING);
194 } elseif (preg_match(
'/^ErrorFileIsInfectedWithAVirus/', $result)) {
196 $langs->load(
"errors");
197 $tmparray = explode(
':', $result);
198 setEventMessages($langs->trans(
'ErrorFileIsInfectedWithAVirus', $tmparray[1]),
null,
'errors');
199 } elseif (preg_match(
'/^ErrorFileSizeTooLarge/', $result)) {
208 $langs->load(
"errors");
236 $usevat =
GETPOST(
"optiontva",
'aZ09');
237 $uselocaltax1 =
GETPOST(
"optionlocaltax1",
'aZ09');
238 $uselocaltax2 =
GETPOST(
"optionlocaltax2",
'aZ09');
239 if ($uselocaltax1 ==
'localtax1on' && !$usevat) {
240 setEventMessages($langs->trans(
"IfYouUseASecondTaxYouMustSetYouUseTheMainTax"),
null,
'errors');
243 if ($uselocaltax2 ==
'localtax2on' && !$usevat) {
244 setEventMessages($langs->trans(
"IfYouUseAThirdTaxYouMustSetYouUseTheMainTax"),
null,
'errors');
252 if (
GETPOST(
"optionlocaltax1") ==
"localtax1on") {
253 if (!GETPOSTISSET(
'lt1')) {
260 if (
GETPOST(
"optionlocaltax2") ==
"localtax2on") {
261 if (!GETPOSTISSET(
'lt2')) {
270 if ($mysoc->country_code ==
'GR') {
289 if ($action !=
'updateedit' && !$error) {
290 header(
"Location: ".$_SERVER[
"PHP_SELF"].($page_y ?
'?page_y='.$page_y :
''));
295if ($action ==
'addthumb' || $action ==
'addthumbsquarred') {
296 if (file_exists(
$conf->mycompany->dir_output.
'/logos/'.
GETPOST(
"file"))) {
301 $constant =
"MAIN_INFO_SOCIETE_LOGO";
302 if ($action ==
'addthumbsquarred') {
303 $constant =
"MAIN_INFO_SOCIETE_LOGO_SQUARRED";
312 $imgThumbSmall =
vignette(
$conf->mycompany->dir_output.
'/logos/'.
GETPOST(
"file"), $maxwidthsmall, $maxheightsmall,
'_small', $quality);
314 $imgThumbSmall = $reg[1];
321 $imgThumbMini =
vignette(
$conf->mycompany->dir_output.
'/logos/'.
GETPOST(
"file"), $maxwidthmini, $maxheightmini,
'_mini', $quality);
323 $imgThumbMini = $reg[1];
329 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
333 $langs->load(
"errors");
335 dol_syslog($langs->transnoentities(
"ErrorBadImageFormat"), LOG_INFO);
339 $langs->load(
"errors");
341 dol_syslog($langs->transnoentities(
"ErrorFileDoesNotExists",
GETPOST(
"file")), LOG_WARNING);
346if ($action ==
'removelogo' || $action ==
'removelogo_squarred') {
347 $constant =
"MAIN_INFO_SOCIETE_LOGO";
348 if ($action ==
'removelogo_squarred') {
349 $constant =
"MAIN_INFO_SOCIETE_LOGO_SQUARRED";
352 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
354 $logofilename = $mysoc->logo;
355 $logofilenamebis = $mysoc->logo_squarred;
356 if ($action ==
'removelogo_squarred') {
357 $logofilename = $mysoc->logo_squarred;
358 $logofilenamebis = $mysoc->logo;
361 $logofile =
$conf->mycompany->dir_output.
'/logos/'.$logofilename;
362 if ($logofilename !=
'' && $logofilename != $logofilenamebis) {
366 if ($action ==
'removelogo_squarred') {
367 $mysoc->logo_squarred =
'';
372 $logofilename = $mysoc->logo_small;
373 $logofilenamebis = $mysoc->logo_squarred_small;
374 if ($action ==
'removelogo_squarred') {
375 $logofilename = $mysoc->logo_squarred_small;
376 $logofilenamebis = $mysoc->logo_small;
379 $logosmallfile =
$conf->mycompany->dir_output.
'/logos/thumbs/'.$logofilename;
380 if ($logofilename !=
'' && $logofilename != $logofilenamebis) {
384 if ($action ==
'removelogo_squarred') {
385 $mysoc->logo_squarred_small =
'';
387 $mysoc->logo_small =
'';
390 $logofilename = $mysoc->logo_mini;
391 $logofilenamebis = $mysoc->logo_squarred_mini;
392 if ($action ==
'removelogo_squarred') {
393 $logofilename = $mysoc->logo_squarred_mini;
394 $logofilenamebis = $mysoc->logo_mini;
397 $logominifile =
$conf->mycompany->dir_output.
'/logos/thumbs/'.$logofilename;
398 if ($logofilename !=
'' && $logofilename != $logofilenamebis) {
402 if ($action ==
'removelogo_squarred') {
403 $mysoc->logo_squarred_mini =
'';
405 $mysoc->logo_mini =
'';
414$wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
415llxHeader(
'', $langs->trans(
"Setup"), $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-company');
417$form =
new Form($db);
422$countrynotdefined =
'<span class="error">'.$langs->trans(
"ErrorSetACountryFirst").
' <a href="#trzipbeforecountry">('.$langs->trans(
"SeeAbove").
')</a></span>';
424print
load_fiche_titre($langs->trans(
"CompanyFoundation"),
'',
'title_setup');
430print
'<span class="opacitymedium">'.$langs->trans(
"CompanyFundationDesc", $langs->transnoentities(
"Save")).
"</span><br>\n";
436if (!empty(
$conf->use_javascript_ajax)) {
437 print
"\n".
'<script type="text/javascript">';
438 print
'$(document).ready(function () {
439 $("#selectcountry_id").change(function() {
440 console.log("selectcountry_id change");
441 document.form_index.action.value="updateedit";
442 document.form_index.submit();
445 print
'</script>'.
"\n";
448print
'<form enctype="multipart/form-data" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="form_index">';
449print
'<input type="hidden" name="token" value="'.newToken().
'">';
450print
'<input type="hidden" name="action" value="update">';
451print
'<input type="hidden" name="page_y" value="">';
453print
'<table class="noborder centpercent editmode">';
454print
'<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans(
"CompanyInfo").
'</th><th></th></tr>'.
"\n";
457print
'<tr class="oddeven"><td class="fieldrequired wordbreak"><label for="name">'.$langs->trans(
"CompanyName").
'</label></td><td>';
458print
'<input name="name" id="name" maxlength="'.$mysoc->fields[
'nom'][
'length'].
'" class="minwidth250" value="'.
dol_escape_htmltag((GETPOSTISSET(
'name') ?
GETPOST(
'name',
'alphanohtml') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM')))).
'"'.(!
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM') ?
' autofocus="autofocus"' :
'').
'></td></tr>'.
"\n";
461print
'<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans(
"CompanyAddress").
'</label></td><td>';
462print
'<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') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_ADDRESS'))).
'</textarea></td></tr>'.
"\n";
465print
'<tr class="oddeven" id="trzipbeforecountry"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans(
"CompanyZip").
'</label></td><td>';
466print
'<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') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_ZIP')))).
'"></td></tr>'.
"\n";
468print
'<tr class="oddeven" id="trtownbeforecountry"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans(
"CompanyTown").
'</label></td><td>';
469print
'<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') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_TOWN')))).
'"></td></tr>'.
"\n";
472print
'<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans(
"Country").
'</label></td><td>';
473print
img_picto(
'',
'globe-americas',
'class="pictofixedwidth"');
474print $form->select_country($mysoc->country_id,
'country_id',
'', 0);
476 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
478print
'</td></tr>'.
"\n";
480print
'<tr class="oddeven"><td class="wordbreak"><label for="state_id">'.$langs->trans(
"State").
'</label></td><td>';
486print
img_picto(
'',
'state',
'class="pictofixedwidth"');
487print $formcompany->select_state($state_id, $mysoc->country_code,
'state_id',
'maxwidth200onsmartphone minwidth300');
488print
'</td></tr>'.
"\n";
491print
'<tr class="oddeven"><td><label for="currency">'.$langs->trans(
"CompanyCurrency").
'</label></td><td>';
492print
img_picto(
'',
'multicurrency',
'class="pictofixedwidth"');
493print $form->selectCurrency(
$conf->currency,
"currency");
494print
'</td></tr>'.
"\n";
497print
'<tr class="oddeven"><td><label for="phone">'.$langs->trans(
"Phone").
'</label></td><td>';
498print
img_picto(
'',
'object_phoning',
'', 0, 0, 0,
'',
'pictofixedwidth');
499print
'<input class="maxwidth150 widthcentpercentminusx" name="phone" id="phone" value="'.dol_escape_htmltag((GETPOSTISSET(
'phone') ?
GETPOST(
'phone',
'alphanohtml') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_TEL')))).
'"></td></tr>';
500print
'</td></tr>'.
"\n";
503print
'<tr class="oddeven"><td><label for="phone">'.$langs->trans(
"PhoneMobile").
'</label></td><td>';
504print
img_picto(
'',
'object_phoning_mobile',
'', 0, 0, 0,
'',
'pictofixedwidth');
505print
'<input class="maxwidth150 widthcentpercentminusx" name="phone_mobile" id="phone_mobile" value="'.dol_escape_htmltag((GETPOSTISSET(
'phone_mobile') ?
GETPOST(
'phone_mobile',
'alphanohtml') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_MOBILE')))).
'"></td></tr>';
506print
'</td></tr>'.
"\n";
509print
'<tr class="oddeven"><td><label for="fax">'.$langs->trans(
"Fax").
'</label></td><td>';
510print
img_picto(
'',
'object_phoning_fax',
'', 0, 0, 0,
'',
'pictofixedwidth');
511print
'<input class="maxwidth150" name="fax" id="fax" value="'.dol_escape_htmltag((GETPOSTISSET(
'fax') ?
GETPOST(
'fax',
'alphanohtml') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_FAX')))).
'"></td></tr>';
512print
'</td></tr>'.
"\n";
515print
'<tr class="oddeven"><td><label for="email">'.$langs->trans(
"EMail").
'</label></td><td>';
516print
img_picto(
'',
'object_email',
'', 0, 0, 0,
'',
'pictofixedwidth');
517print
'<input class="minwidth300 maxwidth500 widthcentpercentminusx" name="mail" id="email" value="'.dol_escape_htmltag((GETPOSTISSET(
'mail') ?
GETPOST(
'mail',
'alphanohtml') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_MAIL') ?
$conf->global->MAIN_INFO_SOCIETE_MAIL :
''))).
'"></td></tr>';
518print
'</td></tr>'.
"\n";
521print
'<tr class="oddeven"><td><label for="web">'.$langs->trans(
"Web").
'</label></td><td>';
522print
img_picto(
'',
'globe',
'', 0, 0, 0,
'',
'pictofixedwidth');
523print
'<input class="maxwidth300 widthcentpercentminusx" name="web" id="web" value="'.dol_escape_htmltag((GETPOSTISSET(
'web') ?
GETPOST(
'web',
'alphanohtml') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_WEB') ?
$conf->global->MAIN_INFO_SOCIETE_WEB :
''))).
'"></td></tr>';
524print
'</td></tr>'.
"\n";
527if (isModEnabled(
'barcode')) {
528 print
'<tr class="oddeven"><td>';
529 print
'<label for="barcode">'.$langs->trans(
"Gencod").
'</label></td><td>';
530 print
'<span class="fa fa-barcode pictofixedwidth"></span>';
531 print
'<input name="barcode" id="barcode" class="minwidth150 widthcentpercentminusx maxwidth300" value="'.dol_escape_htmltag(GETPOSTISSET(
'barcode') ?
GETPOST(
'barcode',
'alphanohtml') :
getDolGlobalString(
'MAIN_INFO_SOCIETE_GENCOD',
'')).
'"></td></tr>';
537$maxmin = $maxfilesizearray[
'maxmin'];
538$tooltiplogo = $langs->trans(
'AvailableFormats').
' : png, jpg, jpeg';
539$tooltiplogo .= ($maxmin > 0) ?
'<br>'.$langs->trans(
'MaxSize').
' : '.$maxmin.
' '.$langs->trans(
'Kb') :
'';
542print
'<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans(
"Logo"), $tooltiplogo).
'</label></td><td>';
544$modulepart =
'mycompany';
545$dirformainimage =
$conf->mycompany->dir_output;
546$subdirformainimage =
'logos/';
547$fileformainimage = $mysoc->logo;
549print $formfile->showImageToEdit(
'logo', $modulepart, $dirformainimage, $subdirformainimage, $fileformainimage);
554print
'<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans(
"LogoSquarred"), $tooltiplogo).
'</label></td><td>';
556$modulepart =
'mycompany';
557$dirformainimage =
$conf->mycompany->dir_output;
558$subdirformainimage =
'logos/';
559$fileformainimage = $mysoc->logo_squarred;
561print $formfile->showImageToEdit(
'logo_squarred', $modulepart, $dirformainimage, $subdirformainimage, $fileformainimage);
566print
'<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans(
"Note").
'</label></td><td>';
567print
'<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.
'">'.(GETPOSTISSET(
'note') ?
GETPOST(
'note',
'restricthtml') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOTE') ?
$conf->global->MAIN_INFO_SOCIETE_NOTE :
'')).
'</textarea></td></tr>';
572print $form->buttonsSaveCancel(
"Save",
'', array(),
false,
'reposition');
578print
'<div class="div-table-responsive-no-min">';
579print
'<table class="noborder centpercent editmode">';
580print
'<tr class="liste_titre"><td class="titlefieldcreate wordbreak">'.$langs->trans(
"CompanyIds").
'</td><td></td></tr>';
582$langs->load(
"companies");
585print
'<tr class="oddeven"><td><label for="director">'.$langs->trans(
"ManagingDirectors").
'</label></td><td>';
586print
'<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') : (
getDolGlobalString(
'MAIN_INFO_SOCIETE_MANAGERS') ?
$conf->global->MAIN_INFO_SOCIETE_MANAGERS :
''))).
'"></td></tr>';
589print
'<tr class="oddeven"><td>';
590print $form->textwithpicto($langs->trans(
"GDPRContact"), $langs->trans(
"GDPRContactDesc"));
592print
'<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET(
"MAIN_INFO_GDPR") ?
GETPOST(
"MAIN_INFO_GDPR",
'alphanohtml') : (
getDolGlobalString(
'MAIN_INFO_GDPR') ?
$conf->global->MAIN_INFO_GDPR :
''))).
'"></td></tr>';
595print
'<tr class="oddeven"><td><label for="capital">'.$langs->trans(
"Capital").
'</label></td><td>';
596print
'<input name="capital" id="capital" class="maxwidth100" value="'.dol_escape_htmltag((GETPOSTISSET(
'capital') ?
GETPOST(
'capital',
'alphanohtml') : (
getDolGlobalString(
'MAIN_INFO_CAPITAL') ?
$conf->global->MAIN_INFO_CAPITAL :
''))).
'"></td></tr>';
599print
'<tr class="oddeven"><td><label for="forme_juridique_code">'.$langs->trans(
"JuridicalStatus").
'</label></td><td>';
600if ($mysoc->country_code) {
601 print $formcompany->select_juridicalstatus(
getDolGlobalString(
'MAIN_INFO_SOCIETE_FORME_JURIDIQUE'), $mysoc->country_code,
'',
'forme_juridique_code');
603 print $countrynotdefined;
608if ($langs->transcountry(
"ProfId1", $mysoc->country_code) !=
'-') {
609 print
'<tr class="oddeven"><td><label for="profid1">'.$langs->transcountry(
"ProfId1", $mysoc->country_code).
'</label></td><td>';
610 if (!empty($mysoc->country_code)) {
611 print
'<input name="siren" id="profid1" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_SIREN')).
'">';
613 print $countrynotdefined;
619if ($langs->transcountry(
"ProfId2", $mysoc->country_code) !=
'-') {
620 print
'<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry(
"ProfId2", $mysoc->country_code).
'</label></td><td>';
621 if (!empty($mysoc->country_code)) {
622 print
'<input name="siret" id="profid2" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_SIRET')).
'">';
624 print $countrynotdefined;
630if ($langs->transcountry(
"ProfId3", $mysoc->country_code) !=
'-') {
631 print
'<tr class="oddeven"><td><label for="profid3">'.$langs->transcountry(
"ProfId3", $mysoc->country_code).
'</label></td><td>';
632 if (!empty($mysoc->country_code)) {
633 print
'<input name="ape" id="profid3" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_APE')).
'">';
635 print $countrynotdefined;
641if ($langs->transcountry(
"ProfId4", $mysoc->country_code) !=
'-') {
642 print
'<tr class="oddeven"><td><label for="profid4">'.$langs->transcountry(
"ProfId4", $mysoc->country_code).
'</label></td><td>';
643 if (!empty($mysoc->country_code)) {
644 print
'<input name="rcs" id="profid4" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_RCS')).
'">';
646 print $countrynotdefined;
652if ($langs->transcountry(
"ProfId5", $mysoc->country_code) !=
'-') {
653 print
'<tr class="oddeven"><td><label for="profid5">'.$langs->transcountry(
"ProfId5", $mysoc->country_code).
'</label></td><td>';
654 if (!empty($mysoc->country_code)) {
655 print
'<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_PROFID5')).
'">';
657 print $countrynotdefined;
663if ($langs->transcountry(
"ProfId6", $mysoc->country_code) !=
'-') {
664 print
'<tr class="oddeven"><td><label for="profid6">'.$langs->transcountry(
"ProfId6", $mysoc->country_code).
'</label></td><td>';
665 if (!empty($mysoc->country_code)) {
666 print
'<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_PROFID6')).
'">';
668 print $countrynotdefined;
674if ($langs->transcountry(
"ProfId7", $mysoc->country_code) !=
'-') {
675 print
'<tr class="oddeven"><td><label for="profid7">'.$langs->transcountry(
"ProfId7", $mysoc->country_code).
'</label></td><td>';
676 if (!empty($mysoc->country_code)) {
677 print
'<input name="MAIN_INFO_PROFID7" id="profid7" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_PROFID7')).
'">';
679 print $countrynotdefined;
685if ($langs->transcountry(
"ProfId8", $mysoc->country_code) !=
'-') {
686 print
'<tr class="oddeven"><td><label for="profid8">'.$langs->transcountry(
"ProfId8", $mysoc->country_code).
'</label></td><td>';
687 if (!empty($mysoc->country_code)) {
688 print
'<input name="MAIN_INFO_PROFID8" id="profid8" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_PROFID8')).
'">';
690 print $countrynotdefined;
696if ($langs->transcountry(
"ProfId9", $mysoc->country_code) !=
'-') {
697 print
'<tr class="oddeven"><td><label for="profid9">'.$langs->transcountry(
"ProfId9", $mysoc->country_code).
'</label></td><td>';
698 if (!empty($mysoc->country_code)) {
699 print
'<input name="MAIN_INFO_PROFID9" id="profid9" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_PROFID9')).
'">';
701 print $countrynotdefined;
707if ($langs->transcountry(
"ProfId10", $mysoc->country_code) !=
'-') {
708 print
'<tr class="oddeven"><td><label for="profid10">'.$langs->transcountry(
"ProfId10", $mysoc->country_code).
'</label></td><td>';
709 if (!empty($mysoc->country_code)) {
710 print
'<input name="MAIN_INFO_PROFID10" id="profid10" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_PROFID10')).
'">';
712 print $countrynotdefined;
718print
'<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans(
"VATIntra").
'</label></td><td>';
719print
'<input name="tva" id="intra_vat" class="minwidth200" value="'.dol_escape_htmltag(
getDolGlobalString(
'MAIN_INFO_TVAINTRA')).
'">';
723print
'<tr class="oddeven"><td><label for="socialobject">'.$langs->trans(
"CompanyObject").
'</label></td><td>';
724print
'<textarea class="flat quatrevingtpercent" name="socialobject" id="socialobject" rows="'.ROWS_5.
'">'.(
getDolGlobalString(
'MAIN_INFO_SOCIETE_OBJECT')).
'</textarea></td></tr>';
733print
'<table class="noborder centpercent editmode">';
734print
'<tr class="liste_titre">';
735print
'<td class="titlefieldcreate">'.$langs->trans(
"FiscalYearInformation").
'</td><td></td>';
738print
'<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">'.$langs->trans(
"FiscalMonthStart").
'</label></td><td>';
739print $formother->select_month(
getDolGlobalInt(
'SOCIETE_FISCAL_MONTH_START') ?
$conf->global->SOCIETE_FISCAL_MONTH_START :
'',
'SOCIETE_FISCAL_MONTH_START', 0, 1,
'maxwidth100').
'</td></tr>';
743print $form->buttonsSaveCancel(
"Save",
'', array(),
false,
'reposition');
749print
load_fiche_titre($langs->trans(
"TypeOfSaleTaxes"),
'',
'object_payment');
751print
'<table class="noborder centpercent editmode">';
752print
'<tr class="liste_titre">';
753print
'<td class="titlefieldcreate">'.$langs->trans(
"VATManagement").
'</td><td></td>';
754print
'<td class="right"> </td>';
758print
'<tr class="oddeven"><td><label><input type="radio" name="optiontva" id="use_vat" value="1"'.(!
getDolGlobalString(
'FACTURE_TVAOPTION') ?
"" :
" checked").
"> ".$langs->trans(
"VATIsUsed").
"</label></td>";
759print
'<td colspan="2">';
760$tooltiphelp = $langs->trans(
"VATIsUsedDesc");
761if ($mysoc->country_code ==
'FR') {
762 $tooltiphelp .=
'<br><br><i>'.$langs->trans(
"Example").
': '.$langs->trans(
"VATIsUsedExampleFR").
"</i>";
764print
'<label for="use_vat">'.$form->textwithpicto($langs->trans(
"VATIsUsedStandard"), $tooltiphelp).
"</label>";
768print
'<tr class="oddeven"><td width="140"><label><input type="radio" name="optiontva" id="no_vat" value="0"'.(!
getDolGlobalString(
'FACTURE_TVAOPTION') ?
" checked" :
"").
"> ".$langs->trans(
"VATIsNotUsed").
"</label></td>";
769print
'<td colspan="2">';
771if ($mysoc->country_code ==
'FR') {
772 $tooltiphelp =
"<i>".$langs->trans(
"Example").
': '.$langs->trans(
"VATIsNotUsedExampleFR").
"</i>\n";
774print
'<label for="no_vat">'.$form->textwithpicto($langs->trans(
"VATIsNotUsedDesc"), $tooltiphelp).
"</label>";
781print
'<table class="noborder centpercent editmode">';
782print
'<tr class="liste_titre">';
783print
'<td class="titlefieldcreate">'.$form->textwithpicto($langs->transcountry(
"LocalTax1Management", $mysoc->country_code), $langs->transcountry(
"LocalTax1IsUsedDesc", $mysoc->country_code)).
'</td><td></td>';
784print
'<td class="right"> </td>';
787if ($mysoc->useLocalTax(1)) {
789 print
'<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.((getDolGlobalString(
'FACTURE_LOCAL_TAX1_OPTION') ==
'1' ||
getDolGlobalString(
'FACTURE_LOCAL_TAX1_OPTION') ==
"localtax1on") ?
" checked" :
"").
'> <label for="lt1">'.$langs->transcountry(
"LocalTax1IsUsed", $mysoc->country_code).
"</label></td>";
790 print
'<td colspan="2">';
791 print
'<div class="nobordernopadding">';
792 $tooltiphelp = $langs->transcountry(
"LocalTax1IsUsedExample", $mysoc->country_code);
793 $tooltiphelp = ($tooltiphelp !=
"LocalTax1IsUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax1IsUsedExample", $mysoc->country_code).
"</i>\n" :
"");
794 print $form->textwithpicto($langs->transcountry(
"LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp);
796 print
'<br><label for="lt1">'.$langs->trans(
"LTRate").
'</label>: ';
797 $formcompany->select_localtax(1,
$conf->global->MAIN_INFO_VALUE_LOCALTAX1,
"lt1");
800 $options = array($langs->trans(
"CalcLocaltax1").
' '.$langs->trans(
"CalcLocaltax1Desc"), $langs->trans(
"CalcLocaltax2").
' - '.$langs->trans(
"CalcLocaltax2Desc"), $langs->trans(
"CalcLocaltax3").
' - '.$langs->trans(
"CalcLocaltax3Desc"));
802 print
'<br><label for="clt1">'.$langs->trans(
"CalcLocaltax").
'</label>: ';
803 print $form->selectarray(
"clt1", $options,
getDolGlobalString(
'MAIN_INFO_LOCALTAX_CALC1'));
805 print
"</td></tr>\n";
807 print
'<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((!
getDolGlobalString(
'FACTURE_LOCAL_TAX1_OPTION') ||
getDolGlobalString(
'FACTURE_LOCAL_TAX1_OPTION') ==
"localtax1off") ?
" checked" :
"").
'> <label for="nolt1">'.$langs->transcountry(
"LocalTax1IsNotUsed", $mysoc->country_code).
"</label></td>";
808 print
'<td colspan="2">';
809 $tooltiphelp = $langs->transcountry(
"LocalTax1IsNotUsedExample", $mysoc->country_code);
810 $tooltiphelp = ($tooltiphelp !=
"LocalTax1IsNotUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax1IsNotUsedExample", $mysoc->country_code).
"</i>\n" :
"");
811 print $form->textwithpicto($langs->transcountry(
"LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp);
812 print
"</td></tr>\n";
814 if (empty($mysoc->country_code)) {
815 print
'<tr class="oddeven nohover"><td class="" colspan="3">'.$countrynotdefined.
'</td></tr>';
817 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>';
825print
'<table class="noborder centpercent editmode">';
826print
'<tr class="liste_titre">';
827print
'<td class="titlefieldcreate">'.$form->textwithpicto($langs->transcountry(
"LocalTax2Management", $mysoc->country_code), $langs->transcountry(
"LocalTax2IsUsedDesc", $mysoc->country_code)).
'</td><td></td>';
828print
'<td class="right"> </td>';
831if ($mysoc->useLocalTax(2)) {
833 print
'<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.((getDolGlobalString(
'FACTURE_LOCAL_TAX2_OPTION') ==
'1' ||
getDolGlobalString(
'FACTURE_LOCAL_TAX2_OPTION') ==
"localtax2on") ?
" checked" :
"").
'> <label for="lt2">'.$langs->transcountry(
"LocalTax2IsUsed", $mysoc->country_code).
"</label></td>";
834 print
'<td colspan="2">';
835 print
'<div class="nobordernopadding">';
836 print
'<label for="lt2">'.$langs->transcountry(
"LocalTax2IsUsedDesc", $mysoc->country_code).
"</label>";
837 $tooltiphelp = $langs->transcountry(
"LocalTax2IsUsedExample", $mysoc->country_code);
838 $tooltiphelp = ($tooltiphelp !=
"LocalTax2IsUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax2IsUsedExample", $mysoc->country_code).
"</i>\n" :
"");
840 print
'<br><label for="lt2">'.$langs->trans(
"LTRate").
'</label>: ';
841 $formcompany->select_localtax(2,
getDolGlobalString(
'MAIN_INFO_VALUE_LOCALTAX2'),
"lt2");
844 $options = array($langs->trans(
"CalcLocaltax1").
' '.$langs->trans(
"CalcLocaltax1Desc"), $langs->trans(
"CalcLocaltax2").
' - '.$langs->trans(
"CalcLocaltax2Desc"), $langs->trans(
"CalcLocaltax3").
' - '.$langs->trans(
"CalcLocaltax3Desc"));
846 print
'<br><label for="clt2">'.$langs->trans(
"CalcLocaltax").
'</label>: ';
847 print $form->selectarray(
"clt2", $options,
getDolGlobalString(
'MAIN_INFO_LOCALTAX_CALC2'));
849 print
"</td></tr>\n";
851 print
'<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((!
getDolGlobalString(
'FACTURE_LOCAL_TAX2_OPTION') ||
getDolGlobalString(
'FACTURE_LOCAL_TAX2_OPTION') ==
"localtax2off") ?
" checked" :
"").
'> <label for="nolt2">'.$langs->transcountry(
"LocalTax2IsNotUsed", $mysoc->country_code).
"</label></td>";
852 print
'<td colspan="2">';
854 $tooltiphelp = $langs->transcountry(
"LocalTax2IsNotUsedExample", $mysoc->country_code);
855 $tooltiphelp = ($tooltiphelp !=
"LocalTax2IsNotUsedExample" ?
"<i>".$langs->trans(
"Example").
': '.$langs->transcountry(
"LocalTax2IsNotUsedExample", $mysoc->country_code).
"</i>\n" :
"");
856 print
"<label for=\"nolt2\">".$form->textwithpicto($langs->transcountry(
"LocalTax2IsNotUsedDesc", $mysoc->country_code), $tooltiphelp).
"</label>";
858 print
"</td></tr>\n";
860 if (empty($mysoc->country_code)) {
861 print
'<tr class="oddeven nohover"><td class="" colspan="3">'.$countrynotdefined.
'</td></tr>';
863 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>';
872print
'<table class="noborder centpercent editmode">';
873print
'<tr class="liste_titre">';
874print
'<td>'.$form->textwithpicto($langs->trans(
"RevenueStamp"), $langs->trans(
"RevenueStampDesc")).
'</td><td></td>';
875print
'<td class="right"> </td>';
877if ($mysoc->useRevenueStamp()) {
879 print
'<tr class="oddeven"><td>';
880 print $langs->trans(
"UseRevenueStamp");
882 print
'<td colspan="2">';
883 print $langs->trans(
"UseRevenueStampExample", $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Dictionaries"), $langs->transnoentitiesnoconv(
"DictionaryRevenueStamp"));
884 print
"</td></tr>\n";
886 if (empty($mysoc->country_code)) {
887 print
'<tr class="oddeven nohover"><td class="" colspan="3">'.$countrynotdefined.
'</td></tr>';
889 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>';
896if ($mysoc->country_code ==
'GR') {
898 print
'<table class="noborder centpercent editmode">';
899 print
'<tr class="liste_titre">';
900 print
'<td>'.$langs->trans(
"AccountParameter").
'</td>';
901 print
'<td>'.$langs->trans(
"Value").
'</td>';
905 print
'<tr class="oddeven"><td>';
906 print
'<span class="titlefield fieldrequired">'.$langs->trans(
"MYDATA_AADE_USER").
'</span></td><td>';
907 print
'<input class="minwidth300" type="text" name="MYDATA_AADE_USER" value="'.getDolGlobalString(
'MYDATA_AADE_USER').
'"';
908 print
'</td><td></td></tr>';
910 print
'<tr class="oddeven"><td>';
911 print
'<span class="titlefield fieldrequired">'.$langs->trans(
"MYDATA_AADE_KEY").
'</span></td><td>';
912 print
'<input class="minwidth300" type="text" name="MYDATA_AADE_KEY" value="'.getDolGlobalString(
'MYDATA_AADE_KEY').
'"';
913 print
'</td><td></td></tr>';
915 print
'<tr class="oddeven"><td>';
916 print
'<span class="titlefield fieldrequired">'.$langs->trans(
"AADE_WEBSERVICE_USER").
'</span></td><td>';
917 print
'<input class="minwidth300" type="text" name="AADE_WEBSERVICE_USER" value="'.getDolGlobalString(
'AADE_WEBSERVICE_USER').
'"';
918 print
'</td><td></td></tr>';
920 print
'<tr class="oddeven"><td>';
921 print
'<span class="titlefield fieldrequired">'.$langs->trans(
"AADE_WEBSERVICE_KEY").
'</span></td><td>';
922 print
'<input class="minwidth300" type="text" name="AADE_WEBSERVICE_KEY" value="'.getDolGlobalString(
'AADE_WEBSERVICE_KEY').
'"';
923 print
'</td><td></td></tr>';
930print $form->buttonsSaveCancel(
"Save",
'', array(),
false,
'reposition');
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
activateModulesRequiredByCountry($country_code)
Activate external modules mandatory when country is country_code.
company_admin_prepare_head()
Return array head with list of tabs to view object information.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
getState($id, $withcode='0', $dbtouse=null, $withregion=0, $outputlangs=null, $entconv=1)
Return state translated from an id.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile', $upload_dir='')
Check validity of a file upload from an GUI page, and move it to its final destination.
isOnlyOneLocalTax($local)
Return true if LocalTax (1 or 2) is unique.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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).
if(!defined( 'IMAGETYPE_WEBP')) getDefaultImageSizes()
Return default values for image sizes.
image_format_supported($file, $acceptsvg=0)
Return if a filename is file name of a supported image format.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
getMaxFileSizeArray()
Return the max allowed for file upload.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.