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$item = $formSetup->newItem(
'BANK_DISABLE_DIRECT_INPUT')->setAsYesNo();
70$item->fieldParams[
'tdOutputFieldClass'] =
'right';
74 (
string) 0 => $langs->trans(
"No").
' - <span class="opacitymedium">'.$langs->trans(
"FreeInput").
'</span>',
75 (
string) 1 => $langs->trans(
"Yes").
' - <span class="opacitymedium">'.$langs->trans(
"DropDownList").
'</span>',
76 (
string) 2 => $langs->trans(
"Yes").
' - <span class="opacitymedium">'.$langs->trans(
"NumberOfKeyToSearch", 1).
'</span>',
77 (
string) 3 => $langs->trans(
"Yes").
' - <span class="opacitymedium">'.$langs->trans(
"NumberOfKeyToSearch", 2).
'</span>',
78 (
string) 4 => $langs->trans(
"Yes").
' - <span class="opacitymedium">'.$langs->trans(
"NumberOfKeyToSearch", 3).
'</span>',
80$item = $formSetup->newItem(
'ACCOUNTANCY_AUXACCOUNT_USE_SEARCH_TO_SELECT');
81$item->setAsSelect($arrval);
82$item->helpText = $langs->trans(
'UseSearchToSelectAuxAccountTooltip');
83$item->cssClass =
'minwidth300 maxwidth400';
84$item->fieldParams[
'tdOutputFieldClass'] =
'right';
86$item = $formSetup->newItem(
'ACCOUNTING_MANAGE_ZERO')->setAsYesNo();
87$item->helpText = $langs->trans(
'ACCOUNTING_MANAGE_ZERO2');
88$item->fieldParams[
'helpText'] =
'noclick';
89$item->fieldParams[
'forcereload'] = 1;
90$item->fieldParams[
'tdOutputFieldClass'] =
'right';
94 $item = $formSetup->newItem(
'ACCOUNTING_LENGTH_GACCOUNT')->setAsString();
95 $item->fieldAttr[
'type'] =
'number';
96 $item->fieldAttr[
'class'] =
'maxwidth50';
97 $item->fieldParams[
'tdOutputFieldClass'] =
'right';
99 $item = $formSetup->newItem(
'ACCOUNTING_LENGTH_AACCOUNT')->setAsString();
100 $item->fieldAttr[
'type'] =
'number';
101 $item->fieldAttr[
'class'] =
'maxwidth50';
102 $item->fieldParams[
'tdOutputFieldClass'] =
'right';
107 'ACCOUNTING_LENGTH_GACCOUNT',
108 'ACCOUNTING_LENGTH_AACCOUNT',
111$list_binding = array(
112 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER',
113 'ACCOUNTING_DATE_START_BINDING',
114 'ACCOUNTING_LABEL_OPERATION_ON_TRANSFER'
119 'ACCOUNTING_EXPORT_PREFIX_SPEC',
123$configuration = $accountancyexport->getTypeConfig();
125$listparam = $configuration[
'param'];
126$listformat = $configuration[
'format'];
127$listcr = $configuration[
'cr'];
129$model_option = array(
131 'label' =>
'ACCOUNTING_EXPORT_FORMAT',
132 'param' => $listformat,
135 'label' =>
'ACCOUNTING_EXPORT_SEPARATORCSV',
139 'label' =>
'ACCOUNTING_EXPORT_ENDLINE',
143 'label' =>
'ACCOUNTING_EXPORT_DATE',
157include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
159if (in_array($action, array(
'setACCOUNTANCY_ER_DATE_RECORD',
'setACCOUNTING_BANK_CONCILIATED'))) {
160 $constname = preg_replace(
'/^set/',
'', $action);
174if ($action ==
'updatemode') {
177 $accounting_modes = array(
182 $accounting_mode =
GETPOST(
'accounting_mode',
'alpha');
184 if (in_array($accounting_mode, $accounting_modes)) {
195if ($action ==
'update') {
198 foreach ($list as $constname) {
199 $constvalue =
GETPOST($constname,
'alpha');
213if ($action ==
'update_binding') {
216 foreach ($list_binding as $constname) {
217 $constvalue =
GETPOST($constname,
'alpha');
219 if ($constname ==
'ACCOUNTING_DATE_START_BINDING') {
235if ($action ==
'update_advanced') {
238 if (GETPOSTISSET(
'ACCOUNTING_LETTERING_NBLETTERS')) {
251if ($action ==
'update_export') {
255 $modelcsv =
GETPOSTINT(
'ACCOUNTING_EXPORT_MODELCSV');
258 $configuration = $accountancyexport->getTypeConfig();
259 $listparam = $configuration[
'param'];
261 if (!empty($modelcsv)) {
272 foreach ($main_option as $constname) {
273 $constvalue =
GETPOST($constname,
'alpha');
280 foreach ($listparam[$modelcsv] as $key => $value) {
283 if (strpos($constante,
'ACCOUNTING') !==
false) {
284 $constvalue =
GETPOST($key,
'alpha');
298if ($action ==
'setenabledraftexport') {
300 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport,
'yesno', 0,
'',
$conf->entity);
312if ($action ==
'setdisablebindingonsales') {
313 $setdisablebindingonsales =
GETPOSTINT(
'value');
314 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales,
'yesno', 0,
'',
$conf->entity);
326if ($action ==
'setdisablebindingonpurchases') {
327 $setdisablebindingonpurchases =
GETPOSTINT(
'value');
328 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases,
'yesno', 0,
'',
$conf->entity);
340if ($action ==
'setdisablebindingonexpensereports') {
341 $setdisablebindingonexpensereports =
GETPOSTINT(
'value');
342 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports,
'yesno', 0,
'',
$conf->entity);
354if ($action ==
'setdisabletransferonassets') {
355 $setdisabletransferonassets =
GETPOSTINT(
'value');
356 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_DISABLE_TRANSFER_ON_ASSETS", $setdisabletransferonassets,
'yesno', 0,
'',
$conf->entity);
368if ($action ==
'setdisabletransferondiscounts') {
369 $setdisabletransferondiscounts =
GETPOSTINT(
'value');
370 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS", $setdisabletransferondiscounts,
'yesno', 0,
'',
$conf->entity);
382if ($action ==
'setenablelettering') {
396if ($action ==
'setenableautolettering') {
397 $setenableautolettering =
GETPOSTINT(
'value');
410if ($action ==
'setenablevatreversecharge') {
411 $setenablevatreversecharge =
GETPOSTINT(
'value');
412 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge,
'yesno', 0,
'',
$conf->entity);
424if ($action ==
'setenabletabonthirdparty') {
425 $setenabletabonthirdparty =
GETPOSTINT(
'value');
426 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_ENABLE_TABONTHIRDPARTY", $setenabletabonthirdparty,
'yesno', 0,
'',
$conf->entity);
438if ($action ==
'setenabledissociatecashsales') {
439 $setenabledissociatecashsales =
GETPOSTINT(
'value');
440 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_DISSOCIATE_CASH_SALES", $setenabledissociatecashsales,
'yesno', 0,
'',
$conf->entity);
452if ($action ==
'setexportenablelettering') {
453 $setexportenablelettering =
GETPOSTINT(
'value');
454 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_DEFAULT_NOT_EXPORT_LETTERING", $setexportenablelettering,
'yesno', 0,
'',
$conf->entity);
466if ($action ==
'setexportenableexportdate') {
467 $setexportenableexportdate =
GETPOSTINT(
'value');
468 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE", $setexportenableexportdate,
'yesno', 0,
'',
$conf->entity);
480if ($action ==
'setexportenablevalidationdate') {
481 $setexportenablevalidationdate =
GETPOSTINT(
'value');
482 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_DEFAULT_NOTIFIED_VALIDATION_DATE", $setexportenablevalidationdate,
'yesno', 0,
'',
$conf->entity);
494if ($action ==
'setexportenablefull') {
496 $res =
dolibarr_set_const(
$db,
"ACCOUNTING_DEFAULT_NOTIFIED_EXPORTFULL", $setexportenablefull,
'yesno', 0,
'',
$conf->entity);
508if ($action ==
'updateMask') {
509 $maskconstbookkeeping =
GETPOST(
'maskconstbookkeeping',
'aZ09');
510 $maskbookkeeping =
GETPOST(
'maskbookkeeping',
'alpha');
514 if ($maskconstbookkeeping && preg_match(
'/_MASK$/', $maskconstbookkeeping)) {
529if ($action ==
'setmod') {
530 $value =
GETPOST(
'value',
'alpha');
540$title = $langs->trans(
'ConfigAccountingExpert');
541$help_url =
'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilité_en_Partie_Double#Configuration';
542llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-accountancy page-admin_index');
552 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
555 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") .
'</div>';
558 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") .
'</div>';
561 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_COMPANY_PERENTITY_SHARED") .
'</div>';
564 print
'<div class="info">' . $langs->trans(
"ConstantIsOn",
"MAIN_PRODUCT_PERENTITY_SHARED") .
'</div>';
571print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
572print
'<input type="hidden" name="token" value="'.newToken().
'">';
573print
'<input type="hidden" name="action" value="updatemode">';
575print
'<table class="noborder centpercent">';
577print
'<tr class="liste_titre">';
578print
'<td colspan="2">'.$langs->trans(
'OptionMode').
'</td>';
580print
'<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>';
581print
'<td><span class="opacitymedium">'.nl2br($langs->trans(
'ACCOUNTING_USE_NON_TREASURY_Desc')).
'</span>';
583print
'<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>';
584print
'<td><span class="opacitymedium">'.nl2br($langs->trans(
'ACCOUNTING_USE_TREASURY_Desc')).
"</span>";
589print
'<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans(
'Save').
'"></div>';
595print $formSetup->generateOutput(
true);
600print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
601print
'<input type="hidden" name="token" value="'.newToken().
'">';
602print
'<input type="hidden" name="action" value="update_binding">';
603print
'<input type="hidden" name="page_y" value="">';
606print
'<div class="div-table-responsive-no-min">';
607print
'<table class="noborder centpercent">';
608print
'<tr class="liste_titre">';
609print
'<td colspan="2">'.$langs->trans(
'BindingOptions').
'</td>';
613foreach ($list_binding as $key) {
614 print
'<tr class="oddeven value">';
617 $label = $langs->trans($key);
618 print
'<td>'.$label.
'</td>';
620 print
'<td class="right minwidth75imp parentonrightofpage">';
621 if ($key ==
'ACCOUNTING_DATE_START_BINDING') {
623 } elseif ($key ==
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
624 $array = array(0=>$langs->trans(
"PreviousMonth"), 1=>$langs->trans(
"CurrentMonth"), 2=>$langs->trans(
"Fiscalyear"));
625 print $form->selectarray($key, $array,
getDolGlobalInt(
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage width200');
626 } elseif ($key ==
'ACCOUNTING_LABEL_OPERATION_ON_TRANSFER') {
628 0=>$langs->trans(
"ThirdPartyName") .
' - ' . $langs->trans(
"NumPiece") .
' - ' . $langs->trans(
"LabelAccount"),
629 1=>$langs->trans(
"ThirdPartyName") .
' - ' . $langs->trans(
"NumPiece"),
630 2=>$langs->trans(
"ThirdPartyName")
632 print $form->selectarray($key, $array,
getDolGlobalInt(
'ACCOUNTING_LABEL_OPERATION_ON_TRANSFER', 0), 0, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage width300');
634 print
'<input type="text" class="maxwidth100" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
641print
'<tr class="oddeven">';
642print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_SALES").
'</td>';
644 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonsales&value=0">';
645 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
648 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonsales&value=1">';
649 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
654print
'<tr class="oddeven">';
655print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").
'</td>';
657 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonpurchases&value=0">';
658 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
661 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonpurchases&value=1">';
662 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
667print
'<tr class="oddeven">';
668print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").
'</td>';
670 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonexpensereports&value=0">';
671 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
674 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisablebindingonexpensereports&value=1">';
675 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
680print
'<tr class="oddeven">';
681print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_TRANSFER_ON_ASSETS").
'</td>';
683 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisabletransferonassets&value=0">';
684 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
687 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisabletransferonassets&value=1">';
688 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
693print
'<tr class="oddeven">';
694print
'<td>'.$langs->trans(
"ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS").
'</td>';
696 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisabletransferondiscounts&value=0">';
697 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'', 0, 0, 0,
'',
'warning');
700 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setdisabletransferondiscounts&value=1">';
701 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
707 print
'<tr class="oddeven">';
708 print
'<td>'.$langs->trans(
"ACCOUNTANCY_ER_DATE_RECORD").
'</td>';
710 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTANCY_ER_DATE_RECORD&value=0">';
711 print
img_picto($langs->trans(
"Activated"),
'switch_on');
714 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTANCY_ER_DATE_RECORD&value=1">';
715 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
721print
'<tr class="oddeven">';
722print
'<td>'.$langs->trans(
"ACCOUNTING_BANK_CONCILIATED").
'</td>';
724 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTING_BANK_CONCILIATED&value=1">';
725 print
img_picto($langs->trans(
"Activated"),
'switch_on');
728 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setACCOUNTING_BANK_CONCILIATED&value=2">';
729 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
737print
'<div class="center"><input type="submit" class="button button-edit reposition" name="button" value="'.dol_escape_htmltag($langs->trans(
'Save')).
'"></div>';
744$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
746print
'<div class="div-table-responsive-no-min">';
747print
'<table class="noborder centpercent">';
748print
'<tr class="liste_titre">';
749print
'<td colspan="2">'.$langs->trans(
"BookkeepingNumberingModules").
'</td>';
750print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
751print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
752print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
757$arrayofmodules = array();
759foreach ($dirmodels as $reldir) {
763 $handle = opendir($dir);
764 if (is_resource($handle)) {
765 while (($file = readdir($handle)) !==
false) {
766 if (strpos($file,
'mod_bookkeeping_') === 0 && substr($file,
dol_strlen($file) - 3, 3) ==
'php') {
767 $file = substr($file, 0,
dol_strlen($file) - 4);
769 require_once $dir.$file.
'.php';
771 $module =
new $file(
$db);
774 '@phan-var-force ModeleNumRefBookkeeping $module';
776 $arrayofmodules[] = $module;
786foreach ($arrayofmodules as $module) {
787 $file =
'mod_bookkeeping_'.strtolower($module->getName($langs));
790 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
793 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
797 if ($module->isEnabled()) {
798 print
'<tr class="oddeven"><td class="width100">'.$module->name.
"</td><td>\n";
799 print $module->info($langs);
803 print
'<td class="nowrap">';
804 $tmp = $module->getExample();
805 if (preg_match(
'/^Error/', $tmp)) {
806 $langs->load(
"errors");
807 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
808 } elseif ($tmp ==
'NotConfigured') {
809 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
815 print
'<td class="center">';
817 print
img_picto($langs->trans(
"Activated"),
'switch_on');
819 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setmod&token='.newToken().
'&value='.urlencode($file).
'">';
820 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
826 $bookkeeping->initAsSpecimen();
829 $htmltooltip =
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
831 $nextval = $module->getNextValue($bookkeeping);
832 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
833 $htmltooltip .=
''.$langs->trans(
"NextValue").
': ';
835 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
836 $nextval = $langs->trans($nextval);
838 $htmltooltip .= $nextval.
'<br>';
840 $htmltooltip .= $langs->trans($module->error).
'<br>';
844 print
'<td class="center">';
845 print $form->textwithpicto(
'', $htmltooltip, 1,
'info');
859print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
860print
'<input type="hidden" name="token" value="'.newToken().
'">';
861print
'<input type="hidden" name="action" value="update_advanced">';
862print
'<input type="hidden" name="page_y" value="">';
864print
'<div class="div-table-responsive-no-min">';
865print
'<table class="noborder centpercent">';
866print
'<tr class="liste_titre">';
867print
'<td colspan="2">' . $langs->trans(
'OptionsAdvanced') .
'</td>';
870print
'<tr class="oddeven">';
872print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_LETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_LETTERING_DESC", $langs->transnoentitiesnoconv(
"NumMvts")).
'<br>'.$langs->trans(
"EnablingThisFeatureIsNotNecessary")).
'</td>';
874 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setenablelettering&value=0">';
875 print
img_picto($langs->trans(
"Activated"),
'switch_on');
878 print
'<td class="right"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setenablelettering&value=1">';
879 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
886 print
'<tr class="oddeven">';
888 print $form->textwithpicto($langs->trans(
"ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans(
"ACCOUNTING_LETTERING_NBLETTERS_DESC")) .
'</td>';
889 print
'<td class="right">';
891 if (empty($letter)) {
899 print
'<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter .
'" type="number" step="1" min="2" max="3" >' .
"\n";
903 print
'<tr class="oddeven">';
905 print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans(
"ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) .
'</td>';
907 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenableautolettering&value=0">';
908 print
img_picto($langs->trans(
"Activated"),
'switch_on');
911 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenableautolettering&value=1">';
912 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
918print
'<tr class="oddeven">';
920print $form->textwithpicto($langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans(
"ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities(
"MenuDefaultAccounts"))).
'</td>';
922 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenablevatreversecharge&value=0">';
923 print
img_picto($langs->trans(
"Activated"),
'switch_on');
926 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenablevatreversecharge&value=1">';
927 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
932print
'<tr class="oddeven">';
934print $form->textwithpicto($langs->trans(
"ACCOUNTING_ENABLE_TABONTHIRDPARTY"), $langs->trans(
"ACCOUNTING_ENABLE_TABONTHIRDPARTY_DESC")).
'</td>';
936 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenabletabonthirdparty&value=0">';
937 print
img_picto($langs->trans(
"Activated"),
'switch_on');
940 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenabletabonthirdparty&value=1">';
941 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
946print
'<tr class="oddeven">';
948print $form->textwithpicto($langs->trans(
"AccountingDissociateCashSales"), $langs->trans(
"AccountingDissociateCashSalesDesc")).
'</td>';
950 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenabledissociatecashsales&value=0">';
951 print
img_picto($langs->trans(
"Activated"),
'switch_on');
954 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setenabledissociatecashsales&value=1">';
955 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
964print
'<div class="center"><input type="submit" class="button button-edit reposition" name="button" value="'.$langs->trans(
'Save').
'"></div>';
972print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
973print
'<input type="hidden" name="token" value="'.newToken().
'">';
974print
'<input type="hidden" name="action" value="update_export">';
975print
'<input type="hidden" name="page_y" value="">';
977print
"\n".
'<script type="text/javascript">'.
"\n";
978print
'jQuery(document).ready(function () {'.
"\n";
979print
' function initfields()'.
"\n";
981foreach ($listparam as $key => $param) {
982 print
' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.
'")'.
"\n";
984 print
' //console.log("'.$param[
'label'].
'");'.
"\n";
985 if (empty($param[
'ACCOUNTING_EXPORT_FORMAT'])) {
986 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.getDolGlobalString(
'ACCOUNTING_EXPORT_FORMAT').
'");'.
"\n";
987 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'.
"\n";
989 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param[
'ACCOUNTING_EXPORT_FORMAT'].
'");'.
"\n";
990 print
' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'.
"\n";
992 if (empty($param[
'ACCOUNTING_EXPORT_SEPARATORCSV'])) {
993 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'.
"\n";
994 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'.
"\n";
996 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.getDolGlobalString(
'ACCOUNTING_EXPORT_SEPARATORCSV').
'");'.
"\n";
997 print
' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'.
"\n";
999 if (empty($param[
'ACCOUNTING_EXPORT_ENDLINE'])) {
1000 print
' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'.
"\n";
1002 print
' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'.
"\n";
1004 if (empty($param[
'ACCOUNTING_EXPORT_DATE'])) {
1005 print
' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'.
"\n";
1006 print
' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'.
"\n";
1008 print
' jQuery("#ACCOUNTING_EXPORT_DATE").val("'.getDolGlobalString(
'ACCOUNTING_EXPORT_DATE').
'");'.
"\n";
1009 print
' jQuery("#ACCOUNTING_EXPORT_DATE").removeAttr("disabled");'.
"\n";
1014print
' initfields();'.
"\n";
1015print
' jQuery("#ACCOUNTING_EXPORT_MODELCSV").change(function() {'.
"\n";
1016print
' initfields();'.
"\n";
1019print
'</script>'.
"\n";
1021print
'<table class="noborder centpercent">';
1022print
'<tr class="liste_titre">';
1023print
'<td colspan="2">'.$langs->trans(
'ExportOptions').
'</td>';
1026$num = count($main_option);
1028 foreach ($main_option as $key) {
1029 print
'<tr class="oddeven value">';
1032 $label = $langs->trans($key);
1033 print
'<td>'.dol_escape_htmltag($label).
'</td>';
1037 print
'<input type="text" size="20" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
1042print
'<tr class="oddeven">';
1043print
'<td>'.$langs->trans(
"Selectmodelcsv").
'</td>';
1044if (!
$conf->use_javascript_ajax) {
1045 print
'<td class="nowrap">';
1046 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
1050 $listofexporttemplates = $accountancyexport->getType(1);
1051 print $form->selectarray(
"ACCOUNTING_EXPORT_MODELCSV", $listofexporttemplates,
getDolGlobalString(
'ACCOUNTING_EXPORT_MODELCSV'), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1057$num2 = count($model_option);
1059 foreach ($model_option as $key) {
1060 print
'<tr class="oddeven value">';
1063 $label = $key[
'label'];
1064 print
'<td>'.$langs->trans($label).
'</td>';
1068 if (is_array($key[
'param'])) {
1071 print
'<input type="text" size="20" id="'.$label.
'" name="'.$key[
'label'].
'" value="'.
getDolGlobalString($label).
'">';
1078print
'<tr class="oddeven">';
1080print $form->textwithpicto($langs->trans(
"AccountingDefaultNotExportLettering"), $langs->trans(
"AccountingDefaultNotExportLetteringDesc")) .
'</td>';
1082 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setexportenablelettering&value=0">';
1083 print
img_picto($langs->trans(
"Activated"),
'switch_on');
1086 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setexportenablelettering&value=1">';
1087 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
1092print
'<tr class="oddeven">';
1094print $form->textwithpicto($langs->trans(
"AccountingDefaultNotNotifiedExportDate"), $langs->trans(
"AccountingDefaultNotNotifiedExportDateDesc")) .
'</td>';
1096 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setexportenableexportdate&value=0">';
1097 print
img_picto($langs->trans(
"Activated"),
'switch_on');
1100 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setexportenableexportdate&value=1">';
1101 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
1106print
'<tr class="oddeven">';
1108print $form->textwithpicto($langs->trans(
"AccountingDefaultNotifiedValidationDate"), $langs->trans(
"AccountingDefaultNotifiedValidationDateDesc")) .
'</td>';
1110 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setexportenablevalidationdate&value=0">';
1111 print
img_picto($langs->trans(
"Activated"),
'switch_on');
1114 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setexportenablevalidationdate&value=1">';
1115 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
1120print
'<tr class="oddeven">';
1122print $form->textwithpicto($langs->trans(
"AccountingDefaultNotifiedExportFull"), $langs->trans(
"AccountingDefaultNotifiedExportFullDesc")) .
'</td>';
1124 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setexportenablefull&value=0">';
1125 print
img_picto($langs->trans(
"Activated"),
'switch_on');
1128 print
'<td class="right"><a class="reposition" href="' . $_SERVER[
'PHP_SELF'] .
'?token=' . newToken() .
'&action=setexportenablefull&value=1">';
1129 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
1136print
'<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...
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.