32require
'../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
39$langs->loadLangs(array(
'admin',
'errors',
'other',
'bills'));
45$action =
GETPOST(
'action',
'aZ09');
46$value =
GETPOST(
'value',
'alpha');
47$modulepart =
GETPOST(
'modulepart',
'aZ09');
49$label =
GETPOST(
'label',
'alpha');
50$scandir =
GETPOST(
'scan_dir',
'alpha');
58include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
60if ($action ==
'updateMask') {
61 $maskconstinvoice =
GETPOST(
'maskconstinvoice',
'aZ09');
62 $maskconstreplacement =
GETPOST(
'maskconstreplacement',
'aZ09');
63 $maskconstcredit =
GETPOST(
'maskconstcredit',
'aZ09');
64 $maskconstdeposit =
GETPOST(
'maskconstdeposit',
'aZ09');
65 $maskinvoice =
GETPOST(
'maskinvoice',
'alpha');
66 $maskreplacement =
GETPOST(
'maskreplacement',
'alpha');
67 $maskcredit =
GETPOST(
'maskcredit',
'alpha');
68 $maskdeposit =
GETPOST(
'maskdeposit',
'alpha');
69 if ($maskconstinvoice && preg_match(
'/_MASK_/', $maskconstinvoice)) {
70 $res =
dolibarr_set_const($db, $maskconstinvoice, $maskinvoice,
'chaine', 0,
'', $conf->entity);
72 if ($maskconstreplacement && preg_match(
'/_MASK_/', $maskconstreplacement)) {
73 $res =
dolibarr_set_const($db, $maskconstreplacement, $maskreplacement,
'chaine', 0,
'', $conf->entity);
75 if ($maskconstcredit && preg_match(
'/_MASK_/', $maskconstcredit)) {
76 $res =
dolibarr_set_const($db, $maskconstcredit, $maskcredit,
'chaine', 0,
'', $conf->entity);
78 if ($maskconstdeposit && preg_match(
'/_MASK_/', $maskconstdeposit)) {
79 $res =
dolibarr_set_const($db, $maskconstdeposit, $maskdeposit,
'chaine', 0,
'', $conf->entity);
91} elseif ($action ==
'specimen') {
92 $modele =
GETPOST(
'module',
'alpha');
95 $facture->initAsSpecimen();
98 $file =
''; $classname =
''; $filefound = 0;
99 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
100 foreach ($dirmodels as $reldir) {
101 $file =
dol_buildpath($reldir.
"core/modules/facture/doc/pdf_".$modele.
".modules.php", 0);
102 if (file_exists($file)) {
104 $classname =
"pdf_".$modele;
112 $module =
new $classname($db);
114 if ($module->write_file($facture, $langs) > 0) {
115 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=facture&file=SPECIMEN.pdf");
123 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
125} elseif ($action ==
'set') {
128} elseif ($action ==
'del') {
131 if ($conf->global->FACTURE_ADDON_PDF ==
"$value") {
135} elseif ($action ==
'setdoc') {
137 if (
dolibarr_set_const($db,
"FACTURE_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
140 $conf->global->FACTURE_ADDON_PDF = $value;
148} elseif ($action ==
'setmod') {
153} elseif ($action ==
'setribchq') {
154 $rib =
GETPOST(
'rib',
'alpha');
155 $chq =
GETPOST(
'chq',
'alpha');
157 $res =
dolibarr_set_const($db,
"FACTURE_RIB_NUMBER", $rib,
'chaine', 0,
'', $conf->entity);
158 $res =
dolibarr_set_const($db,
"FACTURE_CHQ_NUMBER", $chq,
'chaine', 0,
'', $conf->entity);
169} elseif ($action ==
'set_FACTURE_DRAFT_WATERMARK') {
170 $draft =
GETPOST(
'FACTURE_DRAFT_WATERMARK',
'alpha');
172 $res =
dolibarr_set_const($db,
"FACTURE_DRAFT_WATERMARK", trim($draft),
'chaine', 0,
'', $conf->entity);
183} elseif ($action ==
'set_INVOICE_FREE_TEXT') {
184 $freetext =
GETPOST(
'INVOICE_FREE_TEXT',
'restricthtml');
186 $res =
dolibarr_set_const($db,
"INVOICE_FREE_TEXT", $freetext,
'chaine', 0,
'', $conf->entity);
197} elseif ($action ==
'setforcedate') {
198 $forcedate =
GETPOST(
'forcedate',
'alpha');
200 $res =
dolibarr_set_const($db,
"FAC_FORCE_DATE_VALIDATION", $forcedate,
'chaine', 0,
'', $conf->entity);
211} elseif ($action ==
'setDefaultPDFModulesByType') {
212 $invoicetypemodels =
GETPOST(
'invoicetypemodels');
214 if (!empty($invoicetypemodels) && is_array($invoicetypemodels)) {
217 foreach ($invoicetypemodels as $type => $value) {
218 $res =
dolibarr_set_const($db,
'FACTURE_ADDON_PDF_'.intval($type), $value,
'chaine', 0,
'', $conf->entity);
230} elseif ($action ==
'set_INVOICE_CHECK_POSTERIOR_DATE') {
231 $check_posterior_date =
GETPOST(
'INVOICE_CHECK_POSTERIOR_DATE',
'int');
232 $res =
dolibarr_set_const($db,
'INVOICE_CHECK_POSTERIOR_DATE', $check_posterior_date,
'chaine', 0,
'', $conf->entity);
236} elseif (preg_match(
'/set_(.*)/', $action, $reg)) {
249 header(
"Location: " . $_SERVER[
"PHP_SELF"]);
252} elseif (preg_match(
'/del_(.*)/', $action, $reg)) {
264 header(
"Location: " . $_SERVER[
"PHP_SELF"]);
274$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
276llxHeader(
"", $langs->trans(
"BillsSetup"),
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura');
278$form =
new Form($db);
281$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
282print
load_fiche_titre($langs->trans(
"BillsSetup"), $linkback,
'title_setup');
293print
'<div class="div-table-responsive-no-min">';
294print
'<table class="noborder centpercent">';
295print
'<tr class="liste_titre">';
296print
'<td>'.$langs->trans(
"Name").
'</td>';
297print
'<td>'.$langs->trans(
"Description").
'</td>';
298print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
299print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
300print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
305foreach ($dirmodels as $reldir) {
308 $handle = opendir($dir);
309 if (is_resource($handle)) {
310 while (($file = readdir($handle)) !==
false) {
311 if (!is_dir($dir.$file) || (substr($file, 0, 1) <>
'.' && substr($file, 0, 3) <>
'CVS')) {
313 $classname = preg_replace(
'/\.php$/',
'', $file);
315 if (!is_file($dir.$filebis)) {
316 $filebis = $file.
"/".$file.
".modules.php";
317 $classname =
"mod_facture_".$file;
320 preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
321 if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) {
325 $classname = preg_replace(
'/\-.*$/',
'', $classname);
326 if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) && substr($filebis,
dol_strlen($filebis) - 3, 3) ==
'php') {
328 require_once $dir.$filebis;
330 $module =
new $classname($db);
333 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
336 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
340 if ($module->isEnabled()) {
341 print
'<tr class="oddeven"><td width="100">';
342 echo preg_replace(
'/\-.*$/',
'', preg_replace(
'/mod_facture_/',
'', preg_replace(
'/\.php$/',
'', $file)));
345 print $module->info();
350 print
'<td class="nowrap">';
351 $tmp = $module->getExample();
352 if (preg_match(
'/^Error/', $tmp)) {
353 $langs->load(
"errors");
354 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
355 } elseif ($tmp ==
'NotConfigured') {
356 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
362 print
'<td class="center">';
364 if ($conf->global->FACTURE_ADDON == $file || $conf->global->FACTURE_ADDON.
'.php' == $file) {
365 print
img_picto($langs->trans(
"Activated"),
'switch_on');
367 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setmod&token='.newToken().
'&value='.preg_replace(
'/\.php$/',
'', $file).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
372 $facture->initAsSpecimen();
376 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
378 $nextval = $module->getNextValue($mysoc, $facture);
379 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
380 $htmltooltip .= $langs->trans(
"NextValueForInvoices").
': ';
382 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
383 $nextval = $langs->trans($nextval);
385 $htmltooltip .= $nextval.
'<br>';
387 $htmltooltip .= $langs->trans($module->error).
'<br>';
392 $nextval = $module->getNextValue($mysoc, $facture);
393 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
394 $htmltooltip .= $langs->trans(
"NextValueForReplacements").
': ';
396 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
397 $nextval = $langs->trans($nextval);
399 $htmltooltip .= $nextval.
'<br>';
401 $htmltooltip .= $langs->trans($module->error).
'<br>';
407 $nextval = $module->getNextValue($mysoc, $facture);
408 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
409 $htmltooltip .= $langs->trans(
"NextValueForCreditNotes").
': ';
411 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
412 $nextval = $langs->trans($nextval);
414 $htmltooltip .= $nextval.
'<br>';
416 $htmltooltip .= $langs->trans($module->error).
'<br>';
421 $nextval = $module->getNextValue($mysoc, $facture);
422 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
423 $htmltooltip .= $langs->trans(
"NextValueForDeposit").
': ';
425 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
426 $nextval = $langs->trans($nextval);
428 $htmltooltip .= $nextval;
430 $htmltooltip .= $langs->trans($module->error);
434 print
'<td class="center">';
435 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
437 if ($conf->global->FACTURE_ADDON.
'.php' == $file) {
438 if (!empty($module->error)) {
469$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
470$sql .=
" WHERE type = '".$db->escape($type).
"'";
471$sql .=
" AND entity = ".$conf->entity;
472$resql = $db->query($sql);
475 $num_rows = $db->num_rows($resql);
476 while ($i < $num_rows) {
477 $array = $db->fetch_array($resql);
478 array_push($def, $array[0]);
485print
'<div class="div-table-responsive-no-min">';
486print
'<table class="noborder centpercent">';
487print
'<tr class="liste_titre">';
488print
'<td>'.$langs->trans(
"Name").
'</td>';
489print
'<td>'.$langs->trans(
"Description").
'</td>';
490print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
491print
'<td class="center" width="60">'.$langs->trans(
"Default").
'</td>';
492print
'<td class="center" width="32">'.$langs->trans(
"ShortInfo").
'</td>';
493print
'<td class="center" width="32">'.$langs->trans(
"Preview").
'</td>';
498$activatedModels = array();
500foreach ($dirmodels as $reldir) {
501 foreach (array(
'',
'/doc') as $valdir) {
502 $realpath = $reldir.
"core/modules/facture".$valdir;
506 $handle = opendir($dir);
507 if (is_resource($handle)) {
508 while (($file = readdir($handle)) !==
false) {
514 foreach ($filelist as $file) {
515 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
516 if (file_exists($dir.
'/'.$file)) {
517 $name = substr($file, 4,
dol_strlen($file) - 16);
518 $classname = substr($file, 0,
dol_strlen($file) - 12);
520 require_once $dir.
'/'.$file;
521 $module =
new $classname($db);
523 $modulequalified = 1;
524 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
525 $modulequalified = 0;
527 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
528 $modulequalified = 0;
531 if ($modulequalified) {
532 print
'<tr class="oddeven"><td width="100">';
533 print (empty($module->name) ? $name : $module->
name);
535 if (method_exists($module,
'info')) {
536 print $module->info($langs);
538 print $module->description;
543 if (in_array($name, $def)) {
544 print
'<td class="center">'.
"\n";
545 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.newToken().
'&value='.urlencode($name).
'">';
546 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
550 print
'<td class="center">'.
"\n";
551 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.newToken().
'&value='.urlencode($name).
'&scan_dir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"SetAsDefault"),
'switch_off').
'</a>';
556 print
'<td class="center">';
557 if ($conf->global->FACTURE_ADDON_PDF ==
"$name") {
558 print
img_picto($langs->trans(
"Default"),
'on');
560 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.newToken().
'&value='.urlencode($name).
'&scan_dir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"SetAsDefault"),
'off').
'</a>';
565 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
566 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
567 if ($module->type ==
'pdf') {
568 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
570 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
572 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
573 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
574 $htmltooltip .=
'<br>'.$langs->trans(
"PaymentMode").
': '.
yn($module->option_modereg, 1, 1);
575 $htmltooltip .=
'<br>'.$langs->trans(
"PaymentConditions").
': '.
yn($module->option_condreg, 1, 1);
576 $htmltooltip .=
'<br>'.$langs->trans(
"Discounts").
': '.
yn($module->option_escompte, 1, 1);
577 $htmltooltip .=
'<br>'.$langs->trans(
"CreditNote").
': '.
yn($module->option_credit_note, 1, 1);
578 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
579 $htmltooltip .=
'<br>'.$langs->trans(
"WatermarkOnDraftInvoices").
': '.
yn($module->option_draft_watermark, 1, 1);
582 print
'<td class="center">';
583 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
587 print
'<td class="center">';
588 if ($module->type ==
'pdf') {
589 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
591 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
607if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) {
612 print
load_fiche_titre($langs->trans(
"BillsPDFModulesAccordindToInvoiceType"),
'',
'');
614 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'#default-pdf-modules-by-type-table" method="POST">';
615 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
616 print
'<input type="hidden" name="action" value="setDefaultPDFModulesByType" >';
618 print
'<div class="div-table-responsive-no-min">';
619 print
'<table id="default-pdf-modules-by-type-table" class="noborder centpercent">';
620 print
'<tr class="liste_titre">';
621 print
'<td>'.$langs->trans(
"Type").
'</td>';
622 print
'<td>'.$langs->trans(
"Name").
'</td>';
623 print
'<td class="right"><input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'"></td>';
636 foreach ($listtype as $type => $trans) {
637 $thisTypeConfName =
'FACTURE_ADDON_PDF_'.$type;
638 $current = !empty($conf->global->{$thisTypeConfName}) ? $conf->global->{$thisTypeConfName}:$conf->global->FACTURE_ADDON_PDF;
640 print
'<td>'.$trans.
'</td>';
655print
load_fiche_titre($langs->trans(
"SuggestedPaymentModesIfNotDefinedInInvoice"),
'',
'');
657print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
658print
'<input type="hidden" name="token" value="'.newToken().
'" />';
660print
'<div class="div-table-responsive-no-min">';
661print
'<table class="noborder centpercent">';
663print
'<tr class="liste_titre">';
665print
'<input type="hidden" name="action" value="setribchq">';
666print $langs->trans(
"PaymentMode").
'</td>';
667print
'<td class="right"><input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'"></td>';
670print
'<tr class="oddeven">';
671print
"<td>".$langs->trans(
"SuggestPaymentByRIBOnAccount").
"</td>";
673if (isModEnabled(
'banque')) {
674 $sql =
"SELECT rowid, label";
675 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account";
676 $sql .=
" WHERE clos = 0";
677 $sql .=
" AND courant = 1";
678 $sql .=
" AND entity IN (".getEntity(
'bank_account').
")";
679 $resql = $db->query($sql);
681 $num = $db->num_rows($resql);
684 print
'<select name="rib" class="flat" id="rib">';
685 print
'<option value="0">'.$langs->trans(
"DoNotSuggestPaymentMode").
'</option>';
687 $row = $db->fetch_row($resql);
689 print
'<option value="'.$row[0].
'"';
690 print $conf->global->FACTURE_RIB_NUMBER == $row[0] ?
' selected' :
'';
691 print
'>'.$row[1].
'</option>';
697 print
'<span class="opacitymedium">'.$langs->trans(
"NoActiveBankAccountDefined").
'</span>';
701 print $langs->trans(
"BankModuleNotActive");
707print
'<tr class="oddeven">';
708print
"<td>".$langs->trans(
"SuggestPaymentByChequeToAddress").
"</td>";
710print
'<select class="flat" name="chq" id="chq">';
711print
'<option value="0">'.$langs->trans(
"DoNotSuggestPaymentMode").
'</option>';
712print
'<option value="-1"'.($FACTURE_CHQ_NUMBER == -1 ?
' selected' :
'').
'>'.$langs->trans(
"MenuCompanySetup").
' ('.($mysoc->name ? $mysoc->name : $langs->trans(
"NotDefined")).
')</option>';
714$sql =
"SELECT rowid, label";
715$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account";
716$sql .=
" WHERE clos = 0";
717$sql .=
" AND courant = 1";
718$sql .=
" AND entity IN (".getEntity(
'bank_account').
")";
720$resql = $db->query($sql);
722 $num = $db->num_rows($resql);
725 $row = $db->fetch_row($resql);
727 print
'<option value="'.$row[0].
'"';
728 print $FACTURE_CHQ_NUMBER == $row[0] ?
' selected' :
'';
729 print
'>'.$langs->trans(
"OwnerOfBankAccount", $row[1]).
'</option>';
745print
'<div class="div-table-responsive-no-min">';
746print
'<table class="noborder centpercent">';
747print
'<tr class="liste_titre">';
748print
'<td>'.$langs->trans(
"Parameters").
'</td>';
749print
'<td class="center" width="60">'.$langs->trans(
"Value").
'</td>';
750print
'<td width="80"> </td>';
754print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
755print
'<input type="hidden" name="token" value="'.newToken().
'" />';
756print
'<input type="hidden" name="action" value="setforcedate" />';
757print
'<tr class="oddeven"><td>';
758print $langs->trans(
"ForceInvoiceDate");
759print
'</td><td width="60" class="center">';
760print $form->selectyesno(
"forcedate",
getDolGlobalInt(
'FAC_FORCE_DATE_VALIDATION', 0), 1);
761print
'</td><td class="right">';
762print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'" />';
767$substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
768$htmltext =
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
769foreach ($substitutionarray as $key => $val) {
770 $htmltext .= $key.
'<br>';
774print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
775print
'<input type="hidden" name="token" value="'.newToken().
'" />';
776print
'<input type="hidden" name="action" value="set_INVOICE_FREE_TEXT" />';
777print
'<tr class="oddeven"><td colspan="2">';
778print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices"), $langs->trans(
"AddCRIfTooLong").
'<br><br>'.$htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
779$variablename =
'INVOICE_FREE_TEXT';
780if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
781 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
783 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
785 print $doleditor->Create();
787print
'</td><td class="right">';
788print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'" />';
793print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
794print
'<input type="hidden" name="token" value="'.newToken().
'" />';
795print
'<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />';
796print
'<tr class="oddeven"><td>';
797print $form->textwithpicto($langs->trans(
"WatermarkOnDraftBill"), $htmltext, 1,
'help',
'', 0, 2,
'watermarktooltip').
'<br>';
799print
'<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(
getDolGlobalString(
'FACTURE_DRAFT_WATERMARK')).
'">';
800print
'</td><td class="right">';
801print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'" />';
806print
'<tr class="oddeven"><td>'.$langs->trans(
"InvoiceCheckPosteriorDate").
' ' ;
807print $form->textwithpicto(
'', $langs->trans(
"InvoiceCheckPosteriorDateHelp"), 1,
'help') .
'</td>';
808print
'<td class="left" colspan="2">';
809print ajax_constantonoff(
'INVOICE_CHECK_POSTERIOR_DATE');
813print
'<tr class="oddeven">';
814print
'<td>'.$langs->trans(
"AllowExternalDownload").
'</td>';
815print
'<td class="left" colspan="2">';
816print ajax_constantonoff(
'INVOICE_ALLOW_EXTERNAL_DOWNLOAD', array(),
null, 0, 0, 0, 2, 0, 1);
828print
'<div class="div-table-responsive-no-min">';
829print
'<table class="noborder centpercent">'.
"\n";
830print
'<tr class="liste_titre">'.
"\n";
831print
'<td>'.$langs->trans(
"Name").
'</td>'.
"\n";
832print
'<td>'.$langs->trans(
"Value").
'</td>'.
"\n";
834print
'<tr class="oddeven">'.
"\n";
835print
'<td width="140">'.$langs->trans(
"PathDirectory").
'</td>'.
"\n";
836print
'<td>'.$conf->facture->dir_output.
'</td>'.
"\n";
847print
'<div class="div-table-responsive-no-min">';
848print
'<table class="noborder centpercent">';
849print
'<tr class="liste_titre">';
850print
'<td>'.$langs->trans(
"Parameter").
'</td>';
851print
'<td class="center" width="60"></td>';
852print
'<td width="80"> </td>';
854print
'<tr class="oddeven"><td colspan="2">';
855print $langs->trans(
"YouMayFindNotificationsFeaturesIntoModuleNotification").
'<br>';
856print
'</td><td class="right">';
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
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.
delDocumentModel($name, $type)
Delete document model used by doc generator.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage a WYSIWYG editor.
Class to manage invoices.
const TYPE_REPLACEMENT
Replacement invoice.
const TYPE_STANDARD
Standard invoice.
const TYPE_SITUATION
Situation invoice.
const TYPE_DEPOSIT
Deposit invoice.
const TYPE_CREDIT_NOTE
Credit note invoice.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formated messages to output (Used to show messages on html output).
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
invoice_admin_prepare_head()
Return array head with list of tabs to view object informations.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
$conf db name
Only used if Module[ID]Name translation string is not found.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.