34require
'../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
41$langs->loadLangs(array(
'admin',
'errors',
'other',
'bills'));
47$action =
GETPOST(
'action',
'aZ09');
48$value =
GETPOST(
'value',
'alpha');
49$modulepart =
GETPOST(
'modulepart',
'aZ09');
51$label =
GETPOST(
'label',
'alpha');
52$scandir =
GETPOST(
'scan_dir',
'alpha');
62include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
64if ($action ==
'updateMask') {
65 $maskconstinvoice =
GETPOST(
'maskconstinvoice',
'aZ09');
66 $maskconstreplacement =
GETPOST(
'maskconstreplacement',
'aZ09');
67 $maskconstcredit =
GETPOST(
'maskconstcredit',
'aZ09');
68 $maskconstdeposit =
GETPOST(
'maskconstdeposit',
'aZ09');
69 $maskinvoice =
GETPOST(
'maskinvoice',
'alpha');
70 $maskreplacement =
GETPOST(
'maskreplacement',
'alpha');
71 $maskcredit =
GETPOST(
'maskcredit',
'alpha');
72 $maskdeposit =
GETPOST(
'maskdeposit',
'alpha');
74 if ($maskconstinvoice && preg_match(
'/_MASK_/', $maskconstinvoice)) {
75 $res =
dolibarr_set_const($db, $maskconstinvoice, $maskinvoice,
'chaine', 0,
'', $conf->entity);
77 if ($maskconstreplacement && preg_match(
'/_MASK_/', $maskconstreplacement)) {
78 $res =
dolibarr_set_const($db, $maskconstreplacement, $maskreplacement,
'chaine', 0,
'', $conf->entity);
80 if ($maskconstcredit && preg_match(
'/_MASK_/', $maskconstcredit)) {
81 $res =
dolibarr_set_const($db, $maskconstcredit, $maskcredit,
'chaine', 0,
'', $conf->entity);
83 if ($maskconstdeposit && preg_match(
'/_MASK_/', $maskconstdeposit)) {
84 $res =
dolibarr_set_const($db, $maskconstdeposit, $maskdeposit,
'chaine', 0,
'', $conf->entity);
96} elseif ($action ==
'specimen') {
97 $modele =
GETPOST(
'module',
'alpha');
100 $facture->initAsSpecimen();
105 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
106 foreach ($dirmodels as $reldir) {
107 $file =
dol_buildpath($reldir.
"core/modules/facture/doc/pdf_".$modele.
".modules.php", 0);
108 if (file_exists($file)) {
109 $classname =
"pdf_".$modele;
114 if ($classname !==
'') {
117 $module =
new $classname($db);
118 '@phan-var-force ModelePDFFactures $module';
120 if ($module->write_file($facture, $langs) > 0) {
121 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=facture&file=SPECIMEN.pdf");
129 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
131} elseif ($action ==
'set') {
134} elseif ($action ==
'del') {
141} elseif ($action ==
'setdoc') {
143 if (
dolibarr_set_const($db,
"FACTURE_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
146 $conf->global->FACTURE_ADDON_PDF = $value;
154} elseif ($action ==
'setmod') {
158} elseif ($action ==
'setribchq') {
159 $rib =
GETPOST(
'rib',
'alpha');
160 $chq =
GETPOST(
'chq',
'alpha');
162 $res =
dolibarr_set_const($db,
"FACTURE_RIB_NUMBER", $rib,
'chaine', 0,
'', $conf->entity);
163 $res =
dolibarr_set_const($db,
"FACTURE_CHQ_NUMBER", $chq,
'chaine', 0,
'', $conf->entity);
174} elseif ($action ==
'set_FACTURE_DRAFT_WATERMARK') {
175 $draft =
GETPOST(
'FACTURE_DRAFT_WATERMARK',
'alpha');
177 $res =
dolibarr_set_const($db,
"FACTURE_DRAFT_WATERMARK", trim($draft),
'chaine', 0,
'', $conf->entity);
188} elseif ($action ==
'set_INVOICE_FREE_TEXT') {
189 $freetext =
GETPOST(
'INVOICE_FREE_TEXT',
'restricthtml');
191 $res =
dolibarr_set_const($db,
"INVOICE_FREE_TEXT", $freetext,
'chaine', 0,
'', $conf->entity);
202} elseif ($action ==
'setforcedate') {
203 $forcedate =
GETPOST(
'forcedate',
'alpha');
205 $res =
dolibarr_set_const($db,
"FAC_FORCE_DATE_VALIDATION", $forcedate,
'chaine', 0,
'', $conf->entity);
216} elseif ($action ==
'setDefaultPDFModulesByType') {
217 $invoicetypemodels =
GETPOST(
'invoicetypemodels');
219 if (!empty($invoicetypemodels) && is_array($invoicetypemodels)) {
222 foreach ($invoicetypemodels as $type => $value) {
223 $res =
dolibarr_set_const($db,
'FACTURE_ADDON_PDF_'.intval($type), $value,
'chaine', 0,
'', $conf->entity);
235} elseif ($action ==
'set_INVOICE_CHECK_POSTERIOR_DATE') {
236 $check_posterior_date =
GETPOSTINT(
'INVOICE_CHECK_POSTERIOR_DATE');
237 $res =
dolibarr_set_const($db,
'INVOICE_CHECK_POSTERIOR_DATE', $check_posterior_date,
'chaine', 0,
'', $conf->entity);
241} elseif (preg_match(
'/set_(.*)/', $action, $reg)) {
254 header(
"Location: " . $_SERVER[
"PHP_SELF"]);
257} elseif (preg_match(
'/del_(.*)/', $action, $reg)) {
269 header(
"Location: " . $_SERVER[
"PHP_SELF"]);
279$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
281llxHeader(
"", $langs->trans(
"BillsSetup"),
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura',
'', 0, 0,
'',
'',
'',
'mod-admin page-invoice');
283$form =
new Form($db);
286$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
287print
load_fiche_titre($langs->trans(
"BillsSetup"), $linkback,
'title_setup');
298print
'<div class="div-table-responsive-no-min">';
299print
'<table class="noborder centpercent">';
300print
'<tr class="liste_titre">';
301print
'<td>'.$langs->trans(
"Name").
'</td>';
302print
'<td>'.$langs->trans(
"Description").
'</td>';
303print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
304print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
305print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
310foreach ($dirmodels as $reldir) {
313 $handle = opendir($dir);
314 if (is_resource($handle)) {
315 while (($file = readdir($handle)) !==
false) {
316 if (!is_dir($dir.$file) || (substr($file, 0, 1) !=
'.' && substr($file, 0, 3) !=
'CVS')) {
318 $classname = preg_replace(
'/\.php$/',
'', $file);
320 if (!is_file($dir.$filebis)) {
321 $filebis = $file.
"/".$file.
".modules.php";
322 $classname =
"mod_facture_".$file;
325 preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
326 if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) {
330 $classname = preg_replace(
'/\-.*$/',
'', $classname);
331 if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) && substr($filebis,
dol_strlen($filebis) - 3, 3) ==
'php') {
333 require_once $dir.$filebis;
335 $module =
new $classname($db);
337 '@phan-var-force ModeleNumRefFactures $module';
340 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
343 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
347 if ($module->isEnabled()) {
348 print
'<tr class="oddeven"><td width="100">';
349 echo preg_replace(
'/\-.*$/',
'', preg_replace(
'/mod_facture_/',
'', preg_replace(
'/\.php$/',
'', $file)));
352 print $module->info($langs);
357 print
'<td class="nowrap">';
358 $tmp = $module->getExample();
359 if (preg_match(
'/^Error/', $tmp)) {
360 $langs->load(
"errors");
361 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
362 } elseif ($tmp ==
'NotConfigured') {
363 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
369 print
'<td class="center">';
371 if ($conf->global->FACTURE_ADDON == $file ||
getDolGlobalString(
'FACTURE_ADDON') .
'.php' == $file) {
372 print
img_picto($langs->trans(
"Activated"),
'switch_on');
374 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>';
379 $facture->initAsSpecimen();
384 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
386 $nextval = $module->getNextValue($mysoc, $facture);
387 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
388 $htmltooltip .= $langs->trans(
"NextValueForInvoices").
': ';
390 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
391 $nextval = $langs->trans($nextval);
393 $htmltooltip .= $nextval.
'<br>';
395 $htmltooltip .= $langs->trans($module->error).
'<br>';
401 $nextval = $module->getNextValue($mysoc, $facture);
402 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
403 $htmltooltip .= $langs->trans(
"NextValueForReplacements").
': ';
405 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
406 $nextval = $langs->trans($nextval);
408 $htmltooltip .= $nextval.
'<br>';
410 $htmltooltip .= $langs->trans($module->error).
'<br>';
416 $nextval = $module->getNextValue($mysoc, $facture);
417 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
418 $htmltooltip .= $langs->trans(
"NextValueForCreditNotes").
': ';
420 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
421 $nextval = $langs->trans($nextval);
423 $htmltooltip .= $nextval.
'<br>';
425 $htmltooltip .= $langs->trans($module->error).
'<br>';
430 $nextval = $module->getNextValue($mysoc, $facture);
431 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
432 $htmltooltip .= $langs->trans(
"NextValueForDeposit").
': ';
434 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
435 $nextval = $langs->trans($nextval);
437 $htmltooltip .= $nextval;
439 $htmltooltip .= $langs->trans($module->error);
443 print
'<td class="center">';
444 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
447 if (!empty($module->error)) {
479$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
480$sql .=
" WHERE type = '".$db->escape($type).
"'";
481$sql .=
" AND entity = ".$conf->entity;
482$resql = $db->query($sql);
485 $num_rows = $db->num_rows($resql);
486 while ($i < $num_rows) {
487 $array = $db->fetch_array($resql);
488 if (is_array($array)) {
489 array_push($def, $array[0]);
497print
'<div class="div-table-responsive-no-min">';
498print
'<table class="noborder centpercent">';
499print
'<tr class="liste_titre">';
500print
'<td>'.$langs->trans(
"Name").
'</td>';
501print
'<td>'.$langs->trans(
"Description").
'</td>';
502print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
503print
'<td class="center" width="60">'.$langs->trans(
"Default").
'</td>';
504print
'<td class="center" width="32">'.$langs->trans(
"ShortInfo").
'</td>';
505print
'<td class="center" width="32">'.$langs->trans(
"Preview").
'</td>';
510$activatedModels = array();
512foreach ($dirmodels as $reldir) {
513 foreach (array(
'',
'/doc') as $valdir) {
514 $realpath = $reldir.
"core/modules/facture".$valdir;
518 $handle = opendir($dir);
519 if (is_resource($handle)) {
521 while (($file = readdir($handle)) !==
false) {
527 foreach ($filelist as $file) {
528 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
529 if (file_exists($dir.
'/'.$file)) {
530 $name = substr($file, 4,
dol_strlen($file) - 16);
531 $classname = substr($file, 0,
dol_strlen($file) - 12);
533 require_once $dir.
'/'.$file;
534 $module =
new $classname($db);
536 '@phan-var-force ModelePDFFactures $module';
538 $modulequalified = 1;
539 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
540 $modulequalified = 0;
542 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
543 $modulequalified = 0;
545 if ($module->version ==
'disabled') {
546 $modulequalified = 0;
549 if ($modulequalified) {
550 print
'<tr class="oddeven"><td width="100">';
551 print(empty($module->name) ? $name : $module->
name);
553 if (method_exists($module,
'info')) {
554 print $module->info($langs);
556 print $module->description;
561 if (in_array($name, $def)) {
562 print
'<td class="center">'.
"\n";
563 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.urlencode($name).
'">';
564 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
568 print
'<td class="center">'.
"\n";
569 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>';
574 print
'<td class="center">';
576 print
img_picto($langs->trans(
"Default"),
'on');
578 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>';
583 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
584 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
585 if ($module->type ==
'pdf') {
586 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
588 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
590 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
591 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
592 $htmltooltip .=
'<br>'.$langs->trans(
"PaymentMode").
': '.
yn($module->option_modereg, 1, 1);
593 $htmltooltip .=
'<br>'.$langs->trans(
"PaymentConditions").
': '.
yn($module->option_condreg, 1, 1);
594 $htmltooltip .=
'<br>'.$langs->trans(
"Discounts").
': '.
yn($module->option_escompte, 1, 1);
595 $htmltooltip .=
'<br>'.$langs->trans(
"CreditNote").
': '.
yn($module->option_credit_note, 1, 1);
596 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
597 $htmltooltip .=
'<br>'.$langs->trans(
"WatermarkOnDraftInvoices").
': '.
yn($module->option_draft_watermark, 1, 1);
600 print
'<td class="center">';
601 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
605 print
'<td class="center">';
606 if ($module->type ==
'pdf') {
607 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
609 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
630 print
load_fiche_titre($langs->trans(
"BillsPDFModulesAccordindToInvoiceType"),
'',
'');
632 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'#default-pdf-modules-by-type-table" method="POST">';
633 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
634 print
'<input type="hidden" name="action" value="setDefaultPDFModulesByType" >';
635 print
'<input type="hidden" name="page_y" value="" />';
637 print
'<div class="div-table-responsive-no-min">';
638 print
'<table id="default-pdf-modules-by-type-table" class="noborder centpercent">';
639 print
'<tr class="liste_titre">';
640 print
'<td>'.$langs->trans(
"Type").
'</td>';
641 print
'<td>'.$langs->trans(
"Name").
'</td>';
642 print
'<td class="right"><input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'"></td>';
655 foreach ($listtype as $type => $trans) {
656 $thisTypeConfName =
'FACTURE_ADDON_PDF_'.$type;
659 print
'<td>'.$trans.
'</td>';
674print
load_fiche_titre($langs->trans(
"SuggestedPaymentModesIfNotDefinedInInvoice"),
'',
'');
676print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
677print
'<input type="hidden" name="token" value="'.newToken().
'" />';
678print
'<input type="hidden" name="page_y" value="" />';
680print
'<div class="div-table-responsive-no-min">';
681print
'<table class="noborder centpercent">';
683print
'<tr class="liste_titre">';
685print
'<input type="hidden" name="action" value="setribchq">';
686print $langs->trans(
"PaymentMode").
'</td>';
687print
'<td class="right"><input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'"></td>';
690print
'<tr class="oddeven">';
691print
"<td>".$langs->trans(
"SuggestPaymentByRIBOnAccount").
"</td>";
693if (isModEnabled(
'bank')) {
694 $sql =
"SELECT rowid, label, clos";
695 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account";
696 $sql .=
" WHERE courant = 1";
697 $sql .=
" AND entity IN (".getEntity(
'bank_account').
")";
698 $resql = $db->query($sql);
700 $num = $db->num_rows($resql);
703 print
'<select name="rib" class="flat" id="rib">';
704 print
'<option value="0">'.$langs->trans(
"DoNotSuggestPaymentMode").
'</option>';
706 $obj = $db->fetch_object($resql);
708 print
'<option value="'.$obj->rowid.
'"';
710 if (!empty($obj->clos)) {
713 print
'>'.dol_escape_htmltag($obj->label).
'</option>';
720 print
'<span class="opacitymedium">'.$langs->trans(
"NoActiveBankAccountDefined").
'</span>';
724 print $langs->trans(
"BankModuleNotActive");
730print
'<tr class="oddeven">';
731print
"<td>".$langs->trans(
"SuggestPaymentByChequeToAddress").
"</td>";
733print
'<select class="flat" name="chq" id="chq">';
734print
'<option value="0">'.$langs->trans(
"DoNotSuggestPaymentMode").
'</option>';
735print
'<option value="-1"'.($FACTURE_CHQ_NUMBER == -1 ?
' selected' :
'').
'>'.$langs->trans(
"MenuCompanySetup").
' ('.($mysoc->name ? $mysoc->name : $langs->trans(
"NotDefined")).
')</option>';
737$sql =
"SELECT rowid, label";
738$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account";
739$sql .=
" WHERE clos = 0";
740$sql .=
" AND courant = 1";
741$sql .=
" AND entity IN (".getEntity(
'bank_account').
")";
743$resql = $db->query($sql);
745 $num = $db->num_rows($resql);
748 $row = $db->fetch_row($resql);
750 print
'<option value="'.$row[0].
'"';
751 print $FACTURE_CHQ_NUMBER == $row[0] ?
' selected' :
'';
752 print
'>'.$langs->trans(
"OwnerOfBankAccount", $row[1]).
'</option>';
770print
'<div class="div-table-responsive-no-min">';
771print
'<table class="noborder centpercent">';
772print
'<tr class="liste_titre">';
773print
'<td>'.$langs->trans(
"Parameters").
'</td>';
774print
'<td class="center" width="60">'.$langs->trans(
"Value").
'</td>';
775print
'<td width="80"> </td>';
779print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
780print
'<input type="hidden" name="token" value="'.newToken().
'" />';
781print
'<input type="hidden" name="action" value="setforcedate" />';
782print
'<input type="hidden" name="page_y" value="" />';
783print
'<tr class="oddeven"><td>';
784print $langs->trans(
"ForceInvoiceDate");
785print
'</td><td width="60" class="center">';
786print $form->selectyesno(
"forcedate",
getDolGlobalInt(
'FAC_FORCE_DATE_VALIDATION', 0), 1);
787print
'</td><td class="right">';
788print
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
793$substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
794$htmltext =
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
795foreach ($substitutionarray as $key => $val) {
796 $htmltext .= $key.
'<br>';
800print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
801print
'<input type="hidden" name="token" value="'.newToken().
'" />';
802print
'<input type="hidden" name="action" value="set_INVOICE_FREE_TEXT" />';
803print
'<input type="hidden" name="page_y" value="" />';
804print
'<tr class="oddeven"><td colspan="2">';
805print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices"), $langs->trans(
"AddCRIfTooLong").
'<br><br>'.$htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
806$variablename =
'INVOICE_FREE_TEXT';
808 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
810 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
812 print $doleditor->Create();
814print
'</td><td class="right">';
815print
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
820print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
821print
'<input type="hidden" name="token" value="'.newToken().
'" />';
822print
'<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />';
823print
'<input type="hidden" name="page_y" value="" />';
824print
'<tr class="oddeven"><td>';
825print $form->textwithpicto($langs->trans(
"WatermarkOnDraftBill"), $htmltext, 1,
'help',
'', 0, 2,
'watermarktooltip').
'<br>';
827print
'<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(
getDolGlobalString(
'FACTURE_DRAFT_WATERMARK')).
'">';
828print
'</td><td class="right">';
829print
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
834print
'<tr class="oddeven"><td>'.$langs->trans(
"InvoiceCheckPosteriorDate").
' ' ;
835print $form->textwithpicto(
'', $langs->trans(
"InvoiceCheckPosteriorDateHelp"), 1,
'help') .
'</td>';
836print
'<td class="left" colspan="2">';
837print ajax_constantonoff(
'INVOICE_CHECK_POSTERIOR_DATE');
842print
'<tr class="oddeven">';
843print
'<td>'.$langs->trans(
"AllowExternalDownload").
'</td>';
844print
'<td class="left" colspan="2">';
845print ajax_constantonoff(
'INVOICE_ALLOW_EXTERNAL_DOWNLOAD', array(),
null, 0, 0, 0, 2, 0, 1);
857print
'<div class="div-table-responsive-no-min">';
858print
'<table class="noborder centpercent">'.
"\n";
859print
'<tr class="liste_titre">'.
"\n";
860print
'<td>'.$langs->trans(
"Name").
'</td>'.
"\n";
861print
'<td>'.$langs->trans(
"Value").
'</td>'.
"\n";
863print
'<tr class="oddeven">'.
"\n";
864print
'<td width="140">'.$langs->trans(
"PathDirectory").
'</td>'.
"\n";
865print
'<td>'.$conf->facture->dir_output.
'</td>'.
"\n";
876print
'<div class="div-table-responsive-no-min">';
877print
'<table class="noborder centpercent">';
878print
'<tr class="liste_titre">';
879print
'<td>'.$langs->trans(
"Parameter").
'</td>';
880print
'<td class="center" width="60"></td>';
881print
'<td width="80"> </td>';
883print
'<tr class="oddeven"><td colspan="2">';
884print $langs->trans(
"YouMayFindNotificationsFeaturesIntoModuleNotification").
'<br>';
885print
'</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.
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
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.
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($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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_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 a Dolibarr global constant int value.
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.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formatted messages to output (Used to show messages on html output).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a 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 information.
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.