34require
'../../main.inc.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancyexport.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsetup.class.php';
51$langs->loadLangs(array(
"compta",
"bills",
"admin",
"accountancy",
"other"));
54if (!$user->hasRight(
'accounting',
'chartofaccount')) {
58$action =
GETPOST(
'action',
'aZ09');
63$nbletter =
GETPOSTINT(
'ACCOUNTING_LETTERING_NBLETTERS');
69$formSetup->newItem(
'BANK_DISABLE_DIRECT_INPUT')->setAsYesNo();
71$formSetup->newItem(
'ACCOUNTANCY_COMBO_FOR_AUX')->setAsYesNo();
73$item = $formSetup->newItem(
'ACCOUNTING_MANAGE_ZERO')->setAsYesNo();
74$item->helpText = $langs->trans(
'ACCOUNTING_MANAGE_ZERO2');
75$item->fieldParams[
'helpText'] =
'noclick';
79 $item = $formSetup->newItem(
'ACCOUNTING_LENGTH_GACCOUNT')->setAsString();
80 $item->fieldAttr[
'type'] =
'number';
81 $item->fieldAttr[
'class'] =
'maxwidth50 right';
83 $item = $formSetup->newItem(
'ACCOUNTING_LENGTH_AACCOUNT')->setAsString();
84 $item->fieldAttr[
'type'] =
'number';
85 $item->fieldAttr[
'class'] =
'maxwidth50 right';
90 'ACCOUNTING_LENGTH_GACCOUNT',
91 'ACCOUNTING_LENGTH_AACCOUNT',
95 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER',
96 'ACCOUNTING_DATE_START_BINDING',
97 'ACCOUNTING_LABEL_OPERATION_ON_TRANSFER'
102 'ACCOUNTING_EXPORT_PREFIX_SPEC',
106$configuration = $accountancyexport->getTypeConfig();
108$listparam = $configuration[
'param'];
109$listformat = $configuration[
'format'];
110$listcr = $configuration[
'cr'];
112$model_option = array(
114 'label' =>
'ACCOUNTING_EXPORT_FORMAT',
115 'param' => $listformat,
118 'label' =>
'ACCOUNTING_EXPORT_SEPARATORCSV',
122 'label' =>
'ACCOUNTING_EXPORT_ENDLINE',
126 'label' =>
'ACCOUNTING_EXPORT_DATE',
140include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
142if (in_array($action, array(
'setACCOUNTANCY_ER_DATE_RECORD',
'setACCOUNTING_BANK_CONCILIATED'))) {
143 $constname = preg_replace(
'/^set/',
'', $action);
145 $res =
dolibarr_set_const($db, $constname, $constvalue,
'yesno', 0,
'', $conf->entity);
157if ($action ==
'updatemode') {
160 $accounting_modes = array(
165 $accounting_mode =
GETPOST(
'accounting_mode',
'alpha');
167 if (in_array($accounting_mode, $accounting_modes)) {
168 if (
dolibarr_set_const($db,
'ACCOUNTING_MODE', $accounting_mode,
'chaine', 0,
'', $conf->entity)) {
178if ($action ==
'update') {
181 foreach ($list as $constname) {
182 $constvalue =
GETPOST($constname,
'alpha');
184 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
196if ($action ==
'update_binding') {
199 foreach ($list_binding as $constname) {
200 $constvalue =
GETPOST($constname,
'alpha');
202 if ($constname ==
'ACCOUNTING_DATE_START_BINDING') {
206 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
218if ($action ==
'update_advanced') {
221 if (GETPOSTISSET(
'ACCOUNTING_LETTERING_NBLETTERS')) {
222 if (!
dolibarr_set_const($db,
'ACCOUNTING_LETTERING_NBLETTERS',
GETPOST(
'ACCOUNTING_LETTERING_NBLETTERS'),
'chaine', 0,
'', $conf->entity)) {
234if ($action ==
'update_export') {
238 $modelcsv =
GETPOSTINT(
'ACCOUNTING_EXPORT_MODELCSV');
241 $configuration = $accountancyexport->getTypeConfig();
242 $listparam = $configuration[
'param'];
244 if (!empty($modelcsv)) {
245 if (!
dolibarr_set_const($db,
'ACCOUNTING_EXPORT_MODELCSV', $modelcsv,
'chaine', 0,
'', $conf->entity)) {
255 foreach ($main_option as $constname) {
256 $constvalue =
GETPOST($constname,
'alpha');
258 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
263 foreach ($listparam[$modelcsv] as $key => $value) {
266 if (strpos($constante,
'ACCOUNTING') !==
false) {
267 $constvalue =
GETPOST($key,
'alpha');
268 if (!
dolibarr_set_const($db, $constante, $constvalue,
'chaine', 0,
'', $conf->entity)) {
281if ($action ==
'setenabledraftexport') {
283 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport,
'yesno', 0,
'', $conf->entity);
295if ($action ==
'setdisablebindingonsales') {
296 $setdisablebindingonsales =
GETPOSTINT(
'value');
297 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales,
'yesno', 0,
'', $conf->entity);
309if ($action ==
'setdisablebindingonpurchases') {
310 $setdisablebindingonpurchases =
GETPOSTINT(
'value');
311 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases,
'yesno', 0,
'', $conf->entity);
323if ($action ==
'setdisablebindingonexpensereports') {
324 $setdisablebindingonexpensereports =
GETPOSTINT(
'value');
325 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports,
'yesno', 0,
'', $conf->entity);
337if ($action ==
'setdisabletransferonassets') {
338 $setdisabletransferonassets =
GETPOSTINT(
'value');
339 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_TRANSFER_ON_ASSETS", $setdisabletransferonassets,
'yesno', 0,
'', $conf->entity);
351if ($action ==
'setdisabletransferondiscounts') {
352 $setdisabletransferondiscounts =
GETPOSTINT(
'value');
353 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS", $setdisabletransferondiscounts,
'yesno', 0,
'', $conf->entity);
365if ($action ==
'setenablelettering') {
367 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_LETTERING", $setenablelettering,
'yesno', 0,
'', $conf->entity);
379if ($action ==
'setenableautolettering') {
380 $setenableautolettering =
GETPOSTINT(
'value');
381 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering,
'yesno', 0,
'', $conf->entity);
393if ($action ==
'setenablevatreversecharge') {
394 $setenablevatreversecharge =
GETPOSTINT(
'value');
395 $res =
dolibarr_set_const($db,
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge,
'yesno', 0,
'', $conf->entity);
407if ($action ==
'setenabletabonthirdparty') {
408 $setenabletabonthirdparty =
GETPOSTINT(
'value');
409 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_TABONTHIRDPARTY", $setenabletabonthirdparty,
'yesno', 0,
'', $conf->entity);
421if ($action ==
'updateMask') {
422 $maskconstbookkeeping =
GETPOST(
'maskconstbookkeeping',
'aZ09');
423 $maskbookkeeping =
GETPOST(
'maskbookkeeping',
'alpha');
427 if ($maskconstbookkeeping && preg_match(
'/_MASK$/', $maskconstbookkeeping)) {
428 $res =
dolibarr_set_const($db, $maskconstbookkeeping, $maskbookkeeping,
'chaine', 0,
'', $conf->entity);
442if ($action ==
'setmod') {
443 $value =
GETPOST(
'value',
'alpha');
451$form =
new Form($db);
453$title = $langs->trans(
'ConfigAccountingExpert');
454$help_url =
'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilité_en_Partie_Double#Configuration';
455llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-accountancy page-admin_index');
465 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
468 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
471 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") .
'</div>';
474 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_COMPANY_PERENTITY_SHARED") .
'</div>';
477 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_PRODUCT_PERENTITY_SHARED") .
'</div>';
484print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
485print
'<input type="hidden" name="token" value="'.newToken().
'">';
486print
'<input type="hidden" name="action" value="updatemode">';
488print
'<table class="noborder centpercent">';
490print
'<tr class="liste_titre">';
491print
'<td colspan="2">'.$langs->trans(
'OptionMode').
'</td>';
493print
'<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_1" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode !=
'RECETTES-DEPENSES' ?
' checked' :
'').
'><label for="accounting_mode_1"> '.$langs->trans(
'OptionModeVirtual').
'</label> ('.$langs->trans(
'Default').
')</td>';
494print
'<td><span class="opacitymedium">'.nl2br($langs->trans(
'ACCOUNTING_USE_NON_TREASURY_Desc')).
'</span>';
496print
'<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_2" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode ==
'RECETTES-DEPENSES' ?
' checked' :
'').
'><label for="accounting_mode_2"> '.$langs->trans(
'OptionModeTrue').
'</label></td>';
497print
'<td><span class="opacitymedium">'.nl2br($langs->trans(
'ACCOUNTING_USE_TREASURY_Desc')).
"</span>";
502print
'<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans(
'Save').
'"></div>';
508print $formSetup->generateOutput(
true);
513print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
514print
'<input type="hidden" name="token" value="'.newToken().
'">';
515print
'<input type="hidden" name="action" value="update_binding">';
516print
'<input type="hidden" name="page_y" value="">';
519print
'<div class="div-table-responsive-no-min">';
520print
'<table class="noborder centpercent">';
521print
'<tr class="liste_titre">';
522print
'<td colspan="2">'.$langs->trans(
'BindingOptions').
'</td>';
526foreach ($list_binding as $key) {
527 print
'<tr class="oddeven value">';
530 $label = $langs->trans($key);
531 print
'<td>'.$label.
'</td>';
533 print
'<td class="right minwidth75imp parentonrightofpage">';
534 if ($key ==
'ACCOUNTING_DATE_START_BINDING') {
536 } elseif ($key ==
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
537 $array = array(0=>$langs->trans(
"PreviousMonth"), 1=>$langs->trans(
"CurrentMonth"), 2=>$langs->trans(
"Fiscalyear"));
538 print $form->selectarray($key, $array,
getDolGlobalInt(
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage width200');
539 } elseif ($key ==
'ACCOUNTING_LABEL_OPERATION_ON_TRANSFER') {
541 0=>$langs->trans(
"ThirdPartyName") .
' - ' . $langs->trans(
"NumPiece") .
' - ' . $langs->trans(
"LabelAccount"),
542 1=>$langs->trans(
"ThirdPartyName") .
' - ' . $langs->trans(
"NumPiece"),
543 2=>$langs->trans(
"ThirdPartyName")
545 print $form->selectarray($key, $array,
getDolGlobalInt(
'ACCOUNTING_LABEL_OPERATION_ON_TRANSFER', 0), 0, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage width300');
547 print
'<input type="text" class="maxwidth100" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
554print
'<tr class="oddeven">';
555print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_SALES").
'</td>';
557 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonsales&value=0">';
558 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
561 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonsales&value=1">';
562 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
567print
'<tr class="oddeven">';
568print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").
'</td>';
570 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonpurchases&value=0">';
571 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
574 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonpurchases&value=1">';
575 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
580print
'<tr class="oddeven">';
581print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").
'</td>';
583 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonexpensereports&value=0">';
584 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
587 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonexpensereports&value=1">';
588 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
593print
'<tr class="oddeven">';
594print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_TRANSFER_ON_ASSETS").
'</td>';
596 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisabletransferonassets&value=0">';
597 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
600 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisabletransferonassets&value=1">';
601 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
606print
'<tr class="oddeven">';
607print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS").
'</td>';
609 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisabletransferondiscounts&value=0">';
610 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
613 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisabletransferondiscounts&value=1">';
614 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
620 print
'<tr class="oddeven">';
621 print
'<td>'.$langs->trans(
"ACCOUNTANCY_ER_DATE_RECORD").
'</td>';
623 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTANCY_ER_DATE_RECORD&value=0">';
624 print
img_picto($langs->trans(
"Activated"),
'switch_on');
627 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTANCY_ER_DATE_RECORD&value=1">';
628 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
634print
'<tr class="oddeven">';
635print
'<td>'.$langs->trans(
"ACCOUNTING_BANK_CONCILIATED").
'</td>';
637 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_BANK_CONCILIATED&value=1">';
638 print
img_picto($langs->trans(
"Activated"),
'switch_on');
641 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_BANK_CONCILIATED&value=2">';
642 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
650print
'<div class="center"><input type="submit" class="button button-edit reposition" name="button" value="'.dol_escape_htmltag($langs->trans(
'Save')).
'"></div>';
657$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
659print
'<div class="div-table-responsive-no-min">';
660print
'<table class="noborder centpercent">';
661print
'<tr class="liste_titre">';
662print
'<td colspan="2">'.$langs->trans(
"BookkeepingNumberingModules").
'</td>';
663print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
664print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
665print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
670$arrayofmodules = array();
672foreach ($dirmodels as $reldir) {
676 $handle = opendir($dir);
677 if (is_resource($handle)) {
678 while (($file = readdir($handle)) !==
false) {
679 if (strpos($file,
'mod_bookkeeping_') === 0 && substr($file,
dol_strlen($file) - 3, 3) ==
'php') {
680 $file = substr($file, 0,
dol_strlen($file) - 4);
682 require_once $dir.$file.
'.php';
684 $module =
new $file($db);
687 '@phan-var-force ModeleNumRefBookkeeping $module';
689 $arrayofmodules[] = $module;
699foreach ($arrayofmodules as $module) {
700 $file =
'mod_bookkeeping_'.strtolower($module->getName($langs));
703 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
706 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
710 if ($module->isEnabled()) {
711 print
'<tr class="oddeven"><td class="width100">'.$module->name.
"</td><td>\n";
712 print $module->info($langs);
716 print
'<td class="nowrap">';
717 $tmp = $module->getExample();
718 if (preg_match(
'/^Error/', $tmp)) {
719 $langs->load(
"errors");
720 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
721 } elseif ($tmp ==
'NotConfigured') {
722 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
728 print
'<td class="center">';
730 print
img_picto($langs->trans(
"Activated"),
'switch_on');
732 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setmod&token='.
newToken().
'&value='.urlencode($file).
'">';
733 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
739 $bookkeeping->initAsSpecimen();
742 $htmltooltip =
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
744 $nextval = $module->getNextValue($bookkeeping);
745 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
746 $htmltooltip .=
''.$langs->trans(
"NextValue").
': ';
748 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
749 $nextval = $langs->trans($nextval);
751 $htmltooltip .= $nextval.
'<br>';
753 $htmltooltip .= $langs->trans($module->error).
'<br>';
757 print
'<td class="center">';
758 print $form->textwithpicto(
'', $htmltooltip, 1,
'info');
772print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
773print
'<input type="hidden" name="token" value="'.newToken().
'">';
774print
'<input type="hidden" name="action" value="update_advanced">';
775print
'<input type="hidden" name="page_y" value="">';
777print
'<div class="div-table-responsive-no-min">';
778print
'<table class="noborder centpercent">';
779print
'<tr class="liste_titre">';
780print
'<td colspan="2">' . $langs->trans(
'OptionsAdvanced') .
'</td>';
783print
'<tr class="oddeven">';
785print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_LETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_LETTERING_DESC", $langs->transnoentitiesnoconv(
"NumMvts")).
'<br>'.$langs->trans(
"EnablingThisFeatureIsNotNecessary")).
'</td>';
787 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setenablelettering&value=0">';
788 print
img_picto($langs->trans(
"Activated"),
'switch_on');
791 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setenablelettering&value=1">';
792 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
799 print
'<tr class="oddeven">';
801 print $form->textwithpicto($langs->trans(
"ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans(
"ACCOUNTING_LETTERING_NBLETTERS_DESC")) .
'</td>';
802 print
'<td class="right">';
804 if (empty($letter)) {
812 print
'<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter .
'" type="number" step="1" min="2" max="3" >' .
"\n";
816 print
'<tr class="oddeven">';
818 print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) .
'</td>';
820 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenableautolettering&value=0">';
821 print
img_picto($langs->trans(
"Activated"),
'switch_on');
824 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenableautolettering&value=1">';
825 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
831print
'<tr class="oddeven">';
833print $form->textwithpicto($langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities(
"MenuDefaultAccounts"))).
'</td>';
835 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenablevatreversecharge&value=0">';
836 print
img_picto($langs->trans(
"Activated"),
'switch_on');
839 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenablevatreversecharge&value=1">';
840 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
845print
'<tr class="oddeven">';
847print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_TABONTHIRDPARTY"), $langs->trans(
"ACCOUNTING_ENABLE_TABONTHIRDPARTY_DESC")).
'</td>';
849 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenabletabonthirdparty&value=0">';
850 print
img_picto($langs->trans(
"Activated"),
'switch_on');
853 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenabletabonthirdparty&value=1">';
854 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
863print
'<div class="center"><input type="submit" class="button button-edit reposition" name="button" value="'.$langs->trans(
'Save').
'"></div>';
871print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
872print
'<input type="hidden" name="token" value="'.newToken().
'">';
873print
'<input type="hidden" name="action" value="update_export">';
874print
'<input type="hidden" name="page_y" value="">';
876print
"\n".
'<script type="text/javascript">'.
"\n";
877print
'jQuery(document).ready(function () {'.
"\n";
878print
' function initfields()'.
"\n";
880foreach ($listparam as $key => $param) {
881 print
' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.
'")'.
"\n";
883 print
' //console.log("'.$param[
'label'].
'");'.
"\n";
884 if (empty($param[
'ACCOUNTING_EXPORT_FORMAT'])) {
885 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.getDolGlobalString(
'ACCOUNTING_EXPORT_FORMAT').
'");'.
"\n";
886 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'.
"\n";
888 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param[
'ACCOUNTING_EXPORT_FORMAT'].
'");'.
"\n";
889 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'.
"\n";
891 if (empty($param[
'ACCOUNTING_EXPORT_SEPARATORCSV'])) {
892 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'.
"\n";
893 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'.
"\n";
895 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.getDolGlobalString(
'ACCOUNTING_EXPORT_SEPARATORCSV').
'");'.
"\n";
896 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'.
"\n";
898 if (empty($param[
'ACCOUNTING_EXPORT_ENDLINE'])) {
899 print
' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'.
"\n";
901 print
' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'.
"\n";
903 if (empty($param[
'ACCOUNTING_EXPORT_DATE'])) {
904 print
' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'.
"\n";
905 print
' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'.
"\n";
907 print
' jQuery("#ACCOUNTING_EXPORT_DATE").val("'.getDolGlobalString(
'ACCOUNTING_EXPORT_DATE').
'");'.
"\n";
908 print
' jQuery("#ACCOUNTING_EXPORT_DATE").removeAttr("disabled");'.
"\n";
913print
' initfields();'.
"\n";
914print
' jQuery("#ACCOUNTING_EXPORT_MODELCSV").change(function() {'.
"\n";
915print
' initfields();'.
"\n";
918print
'</script>'.
"\n";
920print
'<table class="noborder centpercent">';
921print
'<tr class="liste_titre">';
922print
'<td colspan="2">'.$langs->trans(
'ExportOptions').
'</td>';
925$num = count($main_option);
927 foreach ($main_option as $key) {
928 print
'<tr class="oddeven value">';
931 $label = $langs->trans($key);
932 print
'<td>'.dol_escape_htmltag($label).
'</td>';
936 print
'<input type="text" size="20" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
941print
'<tr class="oddeven">';
942print
'<td>'.$langs->trans(
"Selectmodelcsv").
'</td>';
943if (!$conf->use_javascript_ajax) {
944 print
'<td class="nowrap">';
945 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
949 $listofexporttemplates = $accountancyexport->getType(1);
950 print $form->selectarray(
"ACCOUNTING_EXPORT_MODELCSV", $listofexporttemplates,
getDolGlobalString(
'ACCOUNTING_EXPORT_MODELCSV'), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
956$num2 = count($model_option);
958 foreach ($model_option as $key) {
959 print
'<tr class="oddeven value">';
962 $label = $key[
'label'];
963 print
'<td>'.$langs->trans($label).
'</td>';
967 if (is_array($key[
'param'])) {
970 print
'<input type="text" size="20" id="'.$label.
'" name="'.$key[
'label'].
'" value="'.
getDolGlobalString($label).
'">';
979print
'<div class="center"><input type="submit" class="button reposition" value="'.dol_escape_htmltag($langs->trans(
'Save')).
'" name="button"></div>';
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).
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
Manage the different format accountancy export.
Class to manage Ledger (General Ledger and Subledger)
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
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, $allowothertags=array())
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_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.