34require
'../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancyexport.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsetup.class.php';
52$langs->loadLangs(array(
"compta",
"bills",
"admin",
"accountancy",
"other"));
55if (!$user->hasRight(
'accounting',
'chartofaccount')) {
59$action =
GETPOST(
'action',
'aZ09');
64$nbletter =
GETPOSTINT(
'ACCOUNTING_LETTERING_NBLETTERS');
70$formSetup->newItem(
'BANK_DISABLE_DIRECT_INPUT')->setAsYesNo();
72$formSetup->newItem(
'ACCOUNTANCY_COMBO_FOR_AUX')->setAsYesNo();
74$item = $formSetup->newItem(
'ACCOUNTING_MANAGE_ZERO')->setAsYesNo();
75$item->helpText = $langs->trans(
'ACCOUNTING_MANAGE_ZERO2');
76$item->fieldParams[
'helpText'] =
'noclick';
80 $item = $formSetup->newItem(
'ACCOUNTING_LENGTH_GACCOUNT')->setAsString();
81 $item->fieldAttr[
'type'] =
'number';
82 $item->fieldAttr[
'class'] =
'maxwidth50 right';
84 $item = $formSetup->newItem(
'ACCOUNTING_LENGTH_AACCOUNT')->setAsString();
85 $item->fieldAttr[
'type'] =
'number';
86 $item->fieldAttr[
'class'] =
'maxwidth50 right';
91 'ACCOUNTING_LENGTH_GACCOUNT',
92 'ACCOUNTING_LENGTH_AACCOUNT',
96 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER',
97 'ACCOUNTING_DATE_START_BINDING',
98 'ACCOUNTING_LABEL_OPERATION_ON_TRANSFER'
103 'ACCOUNTING_EXPORT_PREFIX_SPEC',
107$configuration = $accountancyexport->getTypeConfig();
109$listparam = $configuration[
'param'];
110$listformat = $configuration[
'format'];
111$listcr = $configuration[
'cr'];
113$model_option = array(
115 'label' =>
'ACCOUNTING_EXPORT_FORMAT',
116 'param' => $listformat,
119 'label' =>
'ACCOUNTING_EXPORT_SEPARATORCSV',
123 'label' =>
'ACCOUNTING_EXPORT_ENDLINE',
127 'label' =>
'ACCOUNTING_EXPORT_DATE',
141include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
143if (in_array($action, array(
'setACCOUNTANCY_ER_DATE_RECORD',
'setACCOUNTING_BANK_CONCILIATED'))) {
144 $constname = preg_replace(
'/^set/',
'', $action);
158if ($action ==
'updatemode') {
161 $accounting_modes = array(
166 $accounting_mode =
GETPOST(
'accounting_mode',
'alpha');
168 if (in_array($accounting_mode, $accounting_modes)) {
179if ($action ==
'update') {
182 foreach ($list as $constname) {
183 $constvalue =
GETPOST($constname,
'alpha');
197if ($action ==
'update_binding') {
200 foreach ($list_binding as $constname) {
201 $constvalue =
GETPOST($constname,
'alpha');
203 if ($constname ==
'ACCOUNTING_DATE_START_BINDING') {
219if ($action ==
'update_advanced') {
222 if (GETPOSTISSET(
'ACCOUNTING_LETTERING_NBLETTERS')) {
235if ($action ==
'update_export') {
239 $modelcsv =
GETPOSTINT(
'ACCOUNTING_EXPORT_MODELCSV');
243 $configuration = $accountancyexport->getTypeConfig();
244 $listparam = $configuration[
'param'];
247 if (!empty($modelcsv)) {
258 foreach ($main_option as $constname) {
259 $constvalue =
GETPOST($constname,
'alpha');
266 foreach ($listparam[$modelcsv] as $key => $value) {
269 if (strpos($constante,
'ACCOUNTING') !==
false) {
270 $constvalue =
GETPOST($key,
'alpha');
284if ($action ==
'setenabledraftexport') {
286 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport,
'yesno', 0,
'',
$conf->entity);
298if ($action ==
'setdisablebindingonsales') {
299 $setdisablebindingonsales =
GETPOSTINT(
'value');
300 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales,
'yesno', 0,
'',
$conf->entity);
312if ($action ==
'setdisablebindingonpurchases') {
313 $setdisablebindingonpurchases =
GETPOSTINT(
'value');
314 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases,
'yesno', 0,
'',
$conf->entity);
326if ($action ==
'setdisablebindingonexpensereports') {
327 $setdisablebindingonexpensereports =
GETPOSTINT(
'value');
328 $res =
dolibarr_set_const($db,
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports,
'yesno', 0,
'',
$conf->entity);
340if ($action ==
'setenablelettering') {
342 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_LETTERING", $setenablelettering,
'yesno', 0,
'',
$conf->entity);
354if ($action ==
'setenableautolettering') {
355 $setenableautolettering =
GETPOSTINT(
'value');
356 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering,
'yesno', 0,
'',
$conf->entity);
368if ($action ==
'setenablevatreversecharge') {
369 $setenablevatreversecharge =
GETPOSTINT(
'value');
370 $res =
dolibarr_set_const($db,
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge,
'yesno', 0,
'',
$conf->entity);
382if ($action ==
'setenabletabonthirdparty') {
383 $setenabletabonthirdparty =
GETPOSTINT(
'value');
384 $res =
dolibarr_set_const($db,
"ACCOUNTING_ENABLE_TABONTHIRDPARTY", $setenabletabonthirdparty,
'yesno', 0,
'',
$conf->entity);
396if ($action ==
'updateMask') {
397 $maskconstbookkeeping =
GETPOST(
'maskconstbookkeeping',
'aZ09');
398 $maskbookkeeping =
GETPOST(
'maskbookkeeping',
'alpha');
402 if ($maskconstbookkeeping && preg_match(
'/_MASK$/', $maskconstbookkeeping)) {
417if ($action ==
'setmod') {
418 $value =
GETPOST(
'value',
'alpha');
426$form =
new Form($db);
428$title = $langs->trans(
'ConfigAccountingExpert');
429$help_url =
'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilité_en_Partie_Double#Configuration';
430llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-accountancy page-admin_index');
440 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
443 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
446 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") .
'</div>';
449 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_COMPANY_PERENTITY_SHARED") .
'</div>';
452 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_PRODUCT_PERENTITY_SHARED") .
'</div>';
461 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
462 print
'<input type="hidden" name="token" value="'.newToken().
'">';
463 print
'<input type="hidden" name="action" value="updatemode">';
465 print
'<table class="noborder centpercent">';
467 print
'<tr class="liste_titre">';
468 print
'<td colspan="2">'.$langs->trans(
'OptionMode').
'</td>';
470 print
'<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>';
471 print
'<td><span class="opacitymedium">'.nl2br($langs->trans(
'ACCOUNTING_USE_NON_TREASURY_Desc')).
'</span>';
472 print
"</td></tr>\n";
473 print
'<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>';
474 print
'<td><span class="opacitymedium">'.nl2br($langs->trans(
'ACCOUNTING_USE_TREASURY_Desc')).
"</span>";
475 print
"</td></tr>\n";
479 print
'<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans(
'Save').
'"></div>';
488print $formSetup->generateOutput(
true);
493print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
494print
'<input type="hidden" name="token" value="'.newToken().
'">';
495print
'<input type="hidden" name="action" value="update_binding">';
496print
'<input type="hidden" name="page_y" value="">';
499print
'<div class="div-table-responsive-no-min">';
500print
'<table class="noborder centpercent">';
501print
'<tr class="liste_titre">';
502print
'<td colspan="2">'.$langs->trans(
'BindingOptions').
'</td>';
506foreach ($list_binding as $key) {
507 print
'<tr class="oddeven value">';
510 $label = $langs->trans($key);
511 print
'<td>'.$label.
'</td>';
513 print
'<td class="right minwidth75imp parentonrightofpage">';
514 if ($key ==
'ACCOUNTING_DATE_START_BINDING') {
516 } elseif ($key ==
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
517 $array = array(0=>$langs->trans(
"PreviousMonth"), 1=>$langs->trans(
"CurrentMonth"), 2=>$langs->trans(
"Fiscalyear"));
518 print $form->selectarray($key, $array,
getDolGlobalInt(
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage width200');
519 } elseif ($key ==
'ACCOUNTING_LABEL_OPERATION_ON_TRANSFER') {
521 0=>$langs->trans(
"ThirdPartyName") .
' - ' . $langs->trans(
"NumPiece") .
' - ' . $langs->trans(
"LabelAccount"),
522 1=>$langs->trans(
"ThirdPartyName") .
' - ' . $langs->trans(
"NumPiece"),
523 2=>$langs->trans(
"ThirdPartyName")
525 print $form->selectarray($key, $array,
getDolGlobalInt(
'ACCOUNTING_LABEL_OPERATION_ON_TRANSFER', 0), 0, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage width200');
527 print
'<input type="text" class="maxwidth100" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
534print
'<tr class="oddeven">';
535print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_SALES").
'</td>';
537 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonsales&value=0">';
538 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
541 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonsales&value=1">';
542 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
547print
'<tr class="oddeven">';
548print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").
'</td>';
550 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonpurchases&value=0">';
551 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
554 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonpurchases&value=1">';
555 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
560print
'<tr class="oddeven">';
561print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").
'</td>';
563 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonexpensereports&value=0">';
564 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
567 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setdisablebindingonexpensereports&value=1">';
568 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
574 print
'<tr class="oddeven">';
575 print
'<td>'.$langs->trans(
"ACCOUNTANCY_ER_DATE_RECORD").
'</td>';
577 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTANCY_ER_DATE_RECORD&value=0">';
578 print
img_picto($langs->trans(
"Activated"),
'switch_on');
581 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTANCY_ER_DATE_RECORD&value=1">';
582 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
588print
'<tr class="oddeven">';
589print
'<td>'.$langs->trans(
"ACCOUNTING_BANK_CONCILIATED").
'</td>';
591 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_BANK_CONCILIATED&value=1">';
592 print
img_picto($langs->trans(
"Activated"),
'switch_on');
595 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setACCOUNTING_BANK_CONCILIATED&value=2">';
596 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
604print
'<div class="center"><input type="submit" class="button button-edit reposition" name="button" value="'.dol_escape_htmltag($langs->trans(
'Save')).
'"></div>';
611$dirmodels = array_merge(array(
'/'),
$conf->modules_parts[
'models']);
613print
'<div class="div-table-responsive-no-min">';
614print
'<table class="noborder centpercent">';
615print
'<tr class="liste_titre">';
616print
'<td colspan="2">'.$langs->trans(
"BookkeepingNumberingModules").
'</td>';
617print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
618print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
619print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
624$arrayofmodules = array();
626foreach ($dirmodels as $reldir) {
630 $handle = opendir($dir);
631 if (is_resource($handle)) {
632 while (($file = readdir($handle)) !==
false) {
633 if (strpos($file,
'mod_bookkeeping_') === 0 && substr($file,
dol_strlen($file) - 3, 3) ==
'php') {
634 $file = substr($file, 0,
dol_strlen($file) - 4);
636 require_once $dir.$file.
'.php';
638 $module =
new $file($db);
641 '@phan-var-force ModeleNumRefBookkeeping $module';
643 $arrayofmodules[] = $module;
653foreach ($arrayofmodules as $module) {
654 $file =
'mod_bookkeeping_'.strtolower($module->getName($langs));
657 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
660 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
664 if ($module->isEnabled()) {
665 print
'<tr class="oddeven"><td class="width100">'.$module->name.
"</td><td>\n";
666 print $module->info($langs);
670 print
'<td class="nowrap">';
671 $tmp = $module->getExample();
672 if (preg_match(
'/^Error/', $tmp)) {
673 $langs->load(
"errors");
674 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
675 } elseif ($tmp ==
'NotConfigured') {
676 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
682 print
'<td class="center">';
684 print
img_picto($langs->trans(
"Activated"),
'switch_on');
686 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setmod&token='.
newToken().
'&value='.urlencode($file).
'">';
687 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
693 $bookkeeping->initAsSpecimen();
696 $htmltooltip =
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
698 $nextval = $module->getNextValue($bookkeeping);
699 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
700 $htmltooltip .=
''.$langs->trans(
"NextValue").
': ';
702 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
703 $nextval = $langs->trans($nextval);
705 $htmltooltip .= $nextval.
'<br>';
707 $htmltooltip .= $langs->trans($module->error).
'<br>';
711 print
'<td class="center">';
712 print $form->textwithpicto(
'', $htmltooltip, 1,
'info');
726print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
727print
'<input type="hidden" name="token" value="'.newToken().
'">';
728print
'<input type="hidden" name="action" value="update_advanced">';
729print
'<input type="hidden" name="page_y" value="">';
731print
'<div class="div-table-responsive-no-min">';
732print
'<table class="noborder centpercent">';
733print
'<tr class="liste_titre">';
734print
'<td colspan="2">' . $langs->trans(
'OptionsAdvanced') .
'</td>';
737print
'<tr class="oddeven">';
739print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_LETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_LETTERING_DESC", $langs->transnoentitiesnoconv(
"NumMvts")).
'<br>'.$langs->trans(
"EnablingThisFeatureIsNotNecessary")).
'</td>';
741 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setenablelettering&value=0">';
742 print
img_picto($langs->trans(
"Activated"),
'switch_on');
745 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setenablelettering&value=1">';
746 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
753 print
'<tr class="oddeven">';
755 print $form->textwithpicto($langs->trans(
"ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans(
"ACCOUNTING_LETTERING_NBLETTERS_DESC")) .
'</td>';
756 print
'<td class="right">';
758 if (empty($letter)) {
766 print
'<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter .
'" type="number" step="1" min="2" max="3" >' .
"\n";
770 print
'<tr class="oddeven">';
772 print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) .
'</td>';
774 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenableautolettering&value=0">';
775 print
img_picto($langs->trans(
"Activated"),
'switch_on');
778 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenableautolettering&value=1">';
779 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
785print
'<tr class="oddeven">';
787print $form->textwithpicto($langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities(
"MenuDefaultAccounts"))).
'</td>';
789 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenablevatreversecharge&value=0">';
790 print
img_picto($langs->trans(
"Activated"),
'switch_on');
793 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenablevatreversecharge&value=1">';
794 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
799print
'<tr class="oddeven">';
801print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_TABONTHIRDPARTY"), $langs->trans(
"ACCOUNTING_ENABLE_TABONTHIRDPARTY_DESC")).
'</td>';
803 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenabletabonthirdparty&value=0">';
804 print
img_picto($langs->trans(
"Activated"),
'switch_on');
807 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' .
newToken() .
'&action=setenabletabonthirdparty&value=1">';
808 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
817print
'<div class="center"><input type="submit" class="button button-edit reposition" name="button" value="'.$langs->trans(
'Save').
'"></div>';
824print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
825print
'<input type="hidden" name="token" value="'.newToken().
'">';
826print
'<input type="hidden" name="action" value="update_export">';
827print
'<input type="hidden" name="page_y" value="">';
829print
"\n".
'<script type="text/javascript">'.
"\n";
830print
'jQuery(document).ready(function () {'.
"\n";
831print
' function initfields()'.
"\n";
833foreach ($listparam as $key => $param) {
834 print
' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.
'")'.
"\n";
836 print
' //console.log("'.$param[
'label'].
'");'.
"\n";
837 if (empty($param[
'ACCOUNTING_EXPORT_FORMAT'])) {
838 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.getDolGlobalString(
'ACCOUNTING_EXPORT_FORMAT').
'");'.
"\n";
839 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'.
"\n";
841 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param[
'ACCOUNTING_EXPORT_FORMAT'].
'");'.
"\n";
842 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'.
"\n";
844 if (empty($param[
'ACCOUNTING_EXPORT_SEPARATORCSV'])) {
845 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'.
"\n";
846 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'.
"\n";
848 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.getDolGlobalString(
'ACCOUNTING_EXPORT_SEPARATORCSV').
'");'.
"\n";
849 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'.
"\n";
851 if (empty($param[
'ACCOUNTING_EXPORT_ENDLINE'])) {
852 print
' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'.
"\n";
854 print
' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'.
"\n";
856 if (empty($param[
'ACCOUNTING_EXPORT_DATE'])) {
857 print
' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'.
"\n";
858 print
' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'.
"\n";
860 print
' jQuery("#ACCOUNTING_EXPORT_DATE").val("'.getDolGlobalString(
'ACCOUNTING_EXPORT_DATE').
'");'.
"\n";
861 print
' jQuery("#ACCOUNTING_EXPORT_DATE").removeAttr("disabled");'.
"\n";
866print
' initfields();'.
"\n";
867print
' jQuery("#ACCOUNTING_EXPORT_MODELCSV").change(function() {'.
"\n";
868print
' initfields();'.
"\n";
871print
'</script>'.
"\n";
873print
'<table class="noborder centpercent">';
874print
'<tr class="liste_titre">';
875print
'<td colspan="2">'.$langs->trans(
'ExportOptions').
'</td>';
878$num = count($main_option);
880 foreach ($main_option as $key) {
881 print
'<tr class="oddeven value">';
884 $label = $langs->trans($key);
885 print
'<td>'.dol_escape_htmltag($label).
'</td>';
889 print
'<input type="text" size="20" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
894print
'<tr class="oddeven">';
895print
'<td>'.$langs->trans(
"Selectmodelcsv").
'</td>';
896if (!
$conf->use_javascript_ajax) {
897 print
'<td class="nowrap">';
898 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
902 $listofexporttemplates = $accountancyexport->getType(1);
903 print $form->selectarray(
"ACCOUNTING_EXPORT_MODELCSV", $listofexporttemplates,
getDolGlobalString(
'ACCOUNTING_EXPORT_MODELCSV'), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
909$num2 = count($model_option);
911 foreach ($model_option as $key) {
912 print
'<tr class="oddeven value">';
915 $label = $key[
'label'];
916 print
'<td>'.$langs->trans($label).
'</td>';
920 if (is_array($key[
'param'])) {
923 print
'<input type="text" size="20" id="'.$label.
'" name="'.$key[
'label'].
'" value="'.
getDolGlobalString($label).
'">';
932print
'<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...
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, $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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.