35require
'../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
42$langs->loadLangs(array(
'admin',
'errors',
'other',
'bills'));
48$action =
GETPOST(
'action',
'aZ09');
49$value =
GETPOST(
'value',
'alpha');
50$modulepart =
GETPOST(
'modulepart',
'aZ09');
52$label =
GETPOST(
'label',
'alpha');
53$scandir =
GETPOST(
'scan_dir',
'alpha');
63include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
65if ($action ==
'updateMask') {
66 $maskconstinvoice =
GETPOST(
'maskconstinvoice',
'aZ09');
67 $maskconstreplacement =
GETPOST(
'maskconstreplacement',
'aZ09');
68 $maskconstcredit =
GETPOST(
'maskconstcredit',
'aZ09');
69 $maskconstdeposit =
GETPOST(
'maskconstdeposit',
'aZ09');
70 $maskinvoice =
GETPOST(
'maskinvoice',
'alpha');
71 $maskreplacement =
GETPOST(
'maskreplacement',
'alpha');
72 $maskcredit =
GETPOST(
'maskcredit',
'alpha');
73 $maskdeposit =
GETPOST(
'maskdeposit',
'alpha');
75 if ($maskconstinvoice && preg_match(
'/_MASK_/', $maskconstinvoice)) {
76 $res =
dolibarr_set_const($db, $maskconstinvoice, $maskinvoice,
'chaine', 0,
'', $conf->entity);
78 if ($maskconstreplacement && preg_match(
'/_MASK_/', $maskconstreplacement)) {
79 $res =
dolibarr_set_const($db, $maskconstreplacement, $maskreplacement,
'chaine', 0,
'', $conf->entity);
81 if ($maskconstcredit && preg_match(
'/_MASK_/', $maskconstcredit)) {
82 $res =
dolibarr_set_const($db, $maskconstcredit, $maskcredit,
'chaine', 0,
'', $conf->entity);
84 if ($maskconstdeposit && preg_match(
'/_MASK_/', $maskconstdeposit)) {
85 $res =
dolibarr_set_const($db, $maskconstdeposit, $maskdeposit,
'chaine', 0,
'', $conf->entity);
97} elseif ($action ==
'specimen') {
98 $modele =
GETPOST(
'module',
'alpha');
101 $facture->initAsSpecimen();
106 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
107 foreach ($dirmodels as $reldir) {
108 $file =
dol_buildpath($reldir.
"core/modules/facture/doc/pdf_".$modele.
".modules.php", 0);
109 if (file_exists($file)) {
110 $classname =
"pdf_".$modele;
115 if ($classname !==
'') {
118 $module =
new $classname($db);
119 '@phan-var-force ModelePDFFactures $module';
121 if ($module->write_file($facture, $langs) > 0) {
122 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=facture&file=SPECIMEN.pdf");
130 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
132} elseif ($action ==
'set') {
135} elseif ($action ==
'del') {
142} elseif ($action ==
'setdoc') {
144 if (
dolibarr_set_const($db,
"FACTURE_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
147 $conf->global->FACTURE_ADDON_PDF = $value;
155} elseif ($action ==
'setmod') {
159} elseif ($action ==
'setribchq') {
160 $rib =
GETPOST(
'rib',
'alpha');
161 $chq =
GETPOST(
'chq',
'alpha');
163 $res =
dolibarr_set_const($db,
"FACTURE_RIB_NUMBER", $rib,
'chaine', 0,
'', $conf->entity);
164 $res =
dolibarr_set_const($db,
"FACTURE_CHQ_NUMBER", $chq,
'chaine', 0,
'', $conf->entity);
175} elseif ($action ==
'set_FACTURE_DRAFT_WATERMARK') {
176 $draft =
GETPOST(
'FACTURE_DRAFT_WATERMARK',
'alpha');
178 $res =
dolibarr_set_const($db,
"FACTURE_DRAFT_WATERMARK", trim($draft),
'chaine', 0,
'', $conf->entity);
189} elseif ($action ==
'set_INVOICE_FREE_TEXT') {
190 $freetext =
GETPOST(
'INVOICE_FREE_TEXT',
'restricthtml');
192 $res =
dolibarr_set_const($db,
"INVOICE_FREE_TEXT", $freetext,
'chaine', 0,
'', $conf->entity);
203} elseif ($action ==
'setforcedate') {
204 $forcedate =
GETPOST(
'forcedate',
'alpha');
206 $res =
dolibarr_set_const($db,
"FAC_FORCE_DATE_VALIDATION", $forcedate,
'chaine', 0,
'', $conf->entity);
217} elseif ($action ==
'setDefaultPDFModulesByType') {
218 $invoicetypemodels =
GETPOST(
'invoicetypemodels');
220 if (!empty($invoicetypemodels) && is_array($invoicetypemodels)) {
223 foreach ($invoicetypemodels as $type => $value) {
224 $res =
dolibarr_set_const($db,
'FACTURE_ADDON_PDF_'.intval($type), $value,
'chaine', 0,
'', $conf->entity);
236} elseif ($action ==
'set_INVOICE_CHECK_POSTERIOR_DATE') {
237 $check_posterior_date =
GETPOSTINT(
'INVOICE_CHECK_POSTERIOR_DATE');
238 $res =
dolibarr_set_const($db,
'INVOICE_CHECK_POSTERIOR_DATE', $check_posterior_date,
'chaine', 0,
'', $conf->entity);
242} elseif (preg_match(
'/set_(.*)/', $action, $reg)) {
255 header(
"Location: " . $_SERVER[
"PHP_SELF"]);
258} elseif (preg_match(
'/del_(.*)/', $action, $reg)) {
270 header(
"Location: " . $_SERVER[
"PHP_SELF"]);
280$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
282llxHeader(
"", $langs->trans(
"BillsSetup"),
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura',
'', 0, 0,
'',
'',
'',
'mod-admin page-invoice');
284$form =
new Form($db);
287$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
288print
load_fiche_titre($langs->trans(
"BillsSetup"), $linkback,
'title_setup');
299print
'<div class="div-table-responsive-no-min">';
300print
'<table class="noborder centpercent">';
301print
'<tr class="liste_titre">';
302print
'<td>'.$langs->trans(
"Name").
'</td>';
303print
'<td>'.$langs->trans(
"Description").
'</td>';
304print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
305print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
306print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
311foreach ($dirmodels as $reldir) {
314 $handle = opendir($dir);
315 if (is_resource($handle)) {
316 while (($file = readdir($handle)) !==
false) {
317 if (!is_dir($dir.$file) || (substr($file, 0, 1) !=
'.' && substr($file, 0, 3) !=
'CVS')) {
319 $classname = preg_replace(
'/\.php$/',
'', $file);
321 if (!is_file($dir.$filebis)) {
322 $filebis = $file.
"/".$file.
".modules.php";
323 $classname =
"mod_facture_".$file;
326 preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
327 if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) {
331 $classname = preg_replace(
'/\-.*$/',
'', $classname);
332 if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) && substr($filebis,
dol_strlen($filebis) - 3, 3) ==
'php') {
334 require_once $dir.$filebis;
336 $module =
new $classname($db);
338 '@phan-var-force ModeleNumRefFactures $module';
341 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
344 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
348 if ($module->isEnabled()) {
349 print
'<tr class="oddeven"><td width="100">';
350 echo preg_replace(
'/\-.*$/',
'', preg_replace(
'/mod_facture_/',
'', preg_replace(
'/\.php$/',
'', $file)));
353 print $module->info($langs);
358 print
'<td class="nowrap">';
359 $tmp = $module->getExample();
360 if (preg_match(
'/^Error/', $tmp)) {
361 $langs->load(
"errors");
362 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
363 } elseif ($tmp ==
'NotConfigured') {
364 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
370 print
'<td class="center">';
372 if ($conf->global->FACTURE_ADDON == $file ||
getDolGlobalString(
'FACTURE_ADDON') .
'.php' == $file) {
373 print
img_picto($langs->trans(
"Activated"),
'switch_on');
375 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>';
380 $facture->initAsSpecimen();
385 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
387 $nextval = $module->getNextValue($mysoc, $facture);
388 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
389 $htmltooltip .= $langs->trans(
"NextValueForInvoices").
': ';
391 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
392 $nextval = $langs->trans($nextval);
394 $htmltooltip .= $nextval.
'<br>';
396 $htmltooltip .= $langs->trans($module->error).
'<br>';
402 $nextval = $module->getNextValue($mysoc, $facture);
403 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
404 $htmltooltip .= $langs->trans(
"NextValueForReplacements").
': ';
406 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
407 $nextval = $langs->trans($nextval);
409 $htmltooltip .= $nextval.
'<br>';
411 $htmltooltip .= $langs->trans($module->error).
'<br>';
417 $nextval = $module->getNextValue($mysoc, $facture);
418 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
419 $htmltooltip .= $langs->trans(
"NextValueForCreditNotes").
': ';
421 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
422 $nextval = $langs->trans($nextval);
424 $htmltooltip .= $nextval.
'<br>';
426 $htmltooltip .= $langs->trans($module->error).
'<br>';
431 $nextval = $module->getNextValue($mysoc, $facture);
432 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
433 $htmltooltip .= $langs->trans(
"NextValueForDeposit").
': ';
435 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
436 $nextval = $langs->trans($nextval);
438 $htmltooltip .= $nextval;
440 $htmltooltip .= $langs->trans($module->error);
444 print
'<td class="center">';
445 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
448 if (!empty($module->error)) {
480$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
481$sql .=
" WHERE type = '".$db->escape($type).
"'";
482$sql .=
" AND entity = ".$conf->entity;
483$resql = $db->query($sql);
486 $num_rows = $db->num_rows($resql);
487 while ($i < $num_rows) {
488 $array = $db->fetch_array($resql);
489 if (is_array($array)) {
490 array_push($def, $array[0]);
498print
'<div class="div-table-responsive-no-min">';
499print
'<table class="noborder centpercent">';
500print
'<tr class="liste_titre">';
501print
'<td>'.$langs->trans(
"Name").
'</td>';
502print
'<td>'.$langs->trans(
"Description").
'</td>';
503print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
504print
'<td class="center" width="60">'.$langs->trans(
"Default").
'</td>';
505print
'<td class="center" width="32">'.$langs->trans(
"ShortInfo").
'</td>';
506print
'<td class="center" width="32">'.$langs->trans(
"Preview").
'</td>';
511$activatedModels = array();
513foreach ($dirmodels as $reldir) {
514 foreach (array(
'',
'/doc') as $valdir) {
515 $realpath = $reldir.
"core/modules/facture".$valdir;
519 $handle = opendir($dir);
520 if (is_resource($handle)) {
522 while (($file = readdir($handle)) !==
false) {
528 foreach ($filelist as $file) {
529 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
530 if (file_exists($dir.
'/'.$file)) {
531 $name = substr($file, 4,
dol_strlen($file) - 16);
532 $classname = substr($file, 0,
dol_strlen($file) - 12);
534 require_once $dir.
'/'.$file;
535 $module =
new $classname($db);
537 '@phan-var-force ModelePDFFactures $module';
539 $modulequalified = 1;
540 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
541 $modulequalified = 0;
543 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
544 $modulequalified = 0;
546 if ($module->version ==
'disabled') {
547 $modulequalified = 0;
550 if ($modulequalified) {
551 print
'<tr class="oddeven"><td width="100">';
552 print(empty($module->name) ? $name : $module->
name);
554 if (method_exists($module,
'info')) {
555 print $module->info($langs);
557 print $module->description;
562 if (in_array($name, $def)) {
563 print
'<td class="center">'.
"\n";
564 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.urlencode($name).
'">';
565 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
569 print
'<td class="center">'.
"\n";
570 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>';
575 print
'<td class="center">';
577 print
img_picto($langs->trans(
"Default"),
'on');
579 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>';
584 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
585 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
586 if ($module->type ==
'pdf') {
587 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
589 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
591 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
592 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
593 $htmltooltip .=
'<br>'.$langs->trans(
"PaymentMode").
': '.
yn($module->option_modereg, 1, 1);
594 $htmltooltip .=
'<br>'.$langs->trans(
"PaymentConditions").
': '.
yn($module->option_condreg, 1, 1);
595 $htmltooltip .=
'<br>'.$langs->trans(
"Discounts").
': '.
yn($module->option_escompte, 1, 1);
596 $htmltooltip .=
'<br>'.$langs->trans(
"CreditNote").
': '.
yn($module->option_credit_note, 1, 1);
597 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
598 $htmltooltip .=
'<br>'.$langs->trans(
"WatermarkOnDraftInvoices").
': '.
yn($module->option_draft_watermark, 1, 1);
601 print
'<td class="center">';
602 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
606 print
'<td class="center">';
607 if ($module->type ==
'pdf') {
608 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
610 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
631 print
load_fiche_titre($langs->trans(
"BillsPDFModulesAccordindToInvoiceType"),
'',
'');
633 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'#default-pdf-modules-by-type-table" method="POST">';
634 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
635 print
'<input type="hidden" name="action" value="setDefaultPDFModulesByType" >';
636 print
'<input type="hidden" name="page_y" value="" />';
638 print
'<div class="div-table-responsive-no-min">';
639 print
'<table id="default-pdf-modules-by-type-table" class="noborder centpercent">';
640 print
'<tr class="liste_titre">';
641 print
'<td>'.$langs->trans(
"Type").
'</td>';
642 print
'<td>'.$langs->trans(
"Name").
'</td>';
643 print
'<td class="right"><input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'"></td>';
656 foreach ($listtype as $type => $trans) {
657 $thisTypeConfName =
'FACTURE_ADDON_PDF_'.$type;
660 print
'<td>'.$trans.
'</td>';
675print
load_fiche_titre($langs->trans(
"SuggestedPaymentModesIfNotDefinedInInvoice"),
'',
'');
677print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
678print
'<input type="hidden" name="token" value="'.newToken().
'" />';
679print
'<input type="hidden" name="page_y" value="" />';
681print
'<div class="div-table-responsive-no-min">';
682print
'<table class="noborder centpercent">';
684print
'<tr class="liste_titre">';
686print
'<input type="hidden" name="action" value="setribchq">';
687print $langs->trans(
"PaymentMode").
'</td>';
688print
'<td class="right"><input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'"></td>';
691print
'<tr class="oddeven">';
692print
"<td>".$langs->trans(
"SuggestPaymentByRIBOnAccount").
"</td>";
694if (isModEnabled(
'bank')) {
695 $sql =
"SELECT rowid, label, clos";
696 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account";
697 $sql .=
" WHERE courant = 1";
698 $sql .=
" AND entity IN (".getEntity(
'bank_account').
")";
699 $resql = $db->query($sql);
701 $num = $db->num_rows($resql);
704 print
'<select name="rib" class="flat" id="rib">';
705 print
'<option value="0">'.$langs->trans(
"DoNotSuggestPaymentMode").
'</option>';
707 $obj = $db->fetch_object($resql);
709 print
'<option value="'.$obj->rowid.
'"';
711 if (!empty($obj->clos)) {
714 print
'>'.dol_escape_htmltag($obj->label).
'</option>';
721 print
'<span class="opacitymedium">'.$langs->trans(
"NoActiveBankAccountDefined").
'</span>';
725 print $langs->trans(
"BankModuleNotActive");
731print
'<tr class="oddeven">';
732print
"<td>".$langs->trans(
"SuggestPaymentByChequeToAddress").
"</td>";
734print
'<select class="flat" name="chq" id="chq">';
735print
'<option value="0">'.$langs->trans(
"DoNotSuggestPaymentMode").
'</option>';
736print
'<option value="-1"'.($FACTURE_CHQ_NUMBER == -1 ?
' selected' :
'').
'>'.$langs->trans(
"MenuCompanySetup").
' ('.($mysoc->name ? $mysoc->name : $langs->trans(
"NotDefined")).
')</option>';
738$sql =
"SELECT rowid, label";
739$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account";
740$sql .=
" WHERE clos = 0";
741$sql .=
" AND courant = 1";
742$sql .=
" AND entity IN (".getEntity(
'bank_account').
")";
744$resql = $db->query($sql);
746 $num = $db->num_rows($resql);
749 $row = $db->fetch_row($resql);
751 print
'<option value="'.$row[0].
'"';
752 print $FACTURE_CHQ_NUMBER == $row[0] ?
' selected' :
'';
753 print
'>'.$langs->trans(
"OwnerOfBankAccount", $row[1]).
'</option>';
765if ($mysoc->country_code ==
'BE') {
766 print
'<tr class="oddeven"><td>' . $langs->trans(
"InvoicePaymentManageStructuredCommunication") .
' ';
767 print $form->textwithpicto(
'', $langs->trans(
"InvoicePaymentManageStructuredCommunicationHelp"), 1,
'help') .
'</td>';
768 print
'<td class="left" colspan="2">';
769 print ajax_constantonoff(
'INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION');
782print
'<div class="div-table-responsive-no-min">';
783print
'<table class="noborder centpercent">';
784print
'<tr class="liste_titre">';
785print
'<td>'.$langs->trans(
"Parameters").
'</td>';
786print
'<td class="center" width="60">'.$langs->trans(
"Value").
'</td>';
787print
'<td width="80"> </td>';
791print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
792print
'<input type="hidden" name="token" value="'.newToken().
'" />';
793print
'<input type="hidden" name="action" value="setforcedate" />';
794print
'<input type="hidden" name="page_y" value="" />';
795print
'<tr class="oddeven"><td>';
796print $langs->trans(
"ForceInvoiceDate");
797print
'</td><td width="60" class="center">';
798print $form->selectyesno(
"forcedate",
getDolGlobalInt(
'FAC_FORCE_DATE_VALIDATION', 0), 1);
799print
'</td><td class="right">';
800print
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
805$substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
806$htmltext =
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
807foreach ($substitutionarray as $key => $val) {
808 $htmltext .= $key.
'<br>';
812print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
813print
'<input type="hidden" name="token" value="'.newToken().
'" />';
814print
'<input type="hidden" name="action" value="set_INVOICE_FREE_TEXT" />';
815print
'<input type="hidden" name="page_y" value="" />';
816print
'<tr class="oddeven"><td colspan="2">';
817print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices"), $langs->trans(
"AddCRIfTooLong").
'<br><br>'.$htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
818$variablename =
'INVOICE_FREE_TEXT';
820 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
822 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
824 print $doleditor->Create();
826print
'</td><td class="right">';
827print
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
832print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
833print
'<input type="hidden" name="token" value="'.newToken().
'" />';
834print
'<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />';
835print
'<input type="hidden" name="page_y" value="" />';
836print
'<tr class="oddeven"><td>';
837print $form->textwithpicto($langs->trans(
"WatermarkOnDraftBill"), $htmltext, 1,
'help',
'', 0, 2,
'watermarktooltip').
'<br>';
839print
'<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(
getDolGlobalString(
'FACTURE_DRAFT_WATERMARK')).
'">';
840print
'</td><td class="right">';
841print
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
846print
'<tr class="oddeven"><td>'.$langs->trans(
"InvoiceCheckPosteriorDate").
' ' ;
847print $form->textwithpicto(
'', $langs->trans(
"InvoiceCheckPosteriorDateHelp"), 1,
'help') .
'</td>';
848print
'<td class="left" colspan="2">';
849print ajax_constantonoff(
'INVOICE_CHECK_POSTERIOR_DATE');
854print
'<tr class="oddeven">';
855print
'<td>'.$langs->trans(
"AllowExternalDownload").
'</td>';
856print
'<td class="left" colspan="2">';
857print ajax_constantonoff(
'INVOICE_ALLOW_EXTERNAL_DOWNLOAD', array(),
null, 0, 0, 0, 2, 0, 1);
869print
'<div class="div-table-responsive-no-min">';
870print
'<table class="noborder centpercent">'.
"\n";
871print
'<tr class="liste_titre">'.
"\n";
872print
'<td>'.$langs->trans(
"Name").
'</td>'.
"\n";
873print
'<td>'.$langs->trans(
"Value").
'</td>'.
"\n";
875print
'<tr class="oddeven">'.
"\n";
876print
'<td width="140">'.$langs->trans(
"PathDirectory").
'</td>'.
"\n";
877print
'<td>'.$conf->facture->dir_output.
'</td>'.
"\n";
888print
'<div class="div-table-responsive-no-min">';
889print
'<table class="noborder centpercent">';
890print
'<tr class="liste_titre">';
891print
'<td>'.$langs->trans(
"Parameter").
'</td>';
892print
'<td class="center" width="60"></td>';
893print
'<td width="80"> </td>';
895print
'<tr class="oddeven"><td colspan="2">';
896print $langs->trans(
"YouMayFindNotificationsFeaturesIntoModuleNotification").
'<br>';
897print
'</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.
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'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
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.