37require
'../main.inc.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
49require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
52$langs->loadLangs(array(
'admin',
'other',
'bills'));
58$action =
GETPOST(
'action',
'aZ09');
59$value =
GETPOST(
'value',
'alpha');
60$modulepart =
GETPOST(
'modulepart',
'aZ09');
62$label =
GETPOST(
'label',
'alpha');
63$scandir =
GETPOST(
'scan_dir',
'alpha');
74include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
76if ($action ==
'updateMask') {
77 $maskconstinvoice =
GETPOST(
'maskconstinvoice',
'aZ09');
78 $maskconstreplacement =
GETPOST(
'maskconstreplacement',
'aZ09');
79 $maskconstcredit =
GETPOST(
'maskconstcredit',
'aZ09');
80 $maskconstdeposit =
GETPOST(
'maskconstdeposit',
'aZ09');
81 $maskinvoice =
GETPOST(
'maskinvoice',
'alpha');
82 $maskreplacement =
GETPOST(
'maskreplacement',
'alpha');
83 $maskcredit =
GETPOST(
'maskcredit',
'alpha');
84 $maskdeposit =
GETPOST(
'maskdeposit',
'alpha');
86 if ($maskconstinvoice && preg_match(
'/_MASK_/', $maskconstinvoice)) {
89 if ($maskconstreplacement && preg_match(
'/_MASK_/', $maskconstreplacement)) {
92 if ($maskconstcredit && preg_match(
'/_MASK_/', $maskconstcredit)) {
95 if ($maskconstdeposit && preg_match(
'/_MASK_/', $maskconstdeposit)) {
104 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
106 setEventMessages($langs->trans(
"Error"),
null,
'errors');
108} elseif ($action ==
'specimen') {
109 $modele =
GETPOST(
'module',
'alpha');
112 $facture->initAsSpecimen();
117 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
118 foreach ($dirmodels as $reldir) {
119 $file =
dol_buildpath($reldir.
"core/modules/facture/doc/pdf_".$modele.
".modules.php", 0);
120 if (file_exists($file)) {
121 $classname =
"pdf_".$modele;
126 if ($classname !==
'') {
131 '@phan-var-force ModelePDFFactures $module';
133 if (
$module->write_file($facture, $langs) > 0) {
134 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=facture&file=SPECIMEN.pdf");
141 $langs->load(
'errors');
142 setEventMessages($langs->trans(
"ErrorModuleNotFound"),
null,
'errors');
143 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
145} elseif ($action ==
'set') {
148} elseif ($action ==
'del') {
155} elseif ($action ==
'setdoc') {
160 $conf->global->FACTURE_ADDON_PDF = $value;
168} elseif ($action ==
'setmod') {
172} elseif ($action ==
'setribchq') {
173 $rib =
GETPOST(
'rib',
'alpha');
174 $chq =
GETPOST(
'chq',
'alpha');
177 $payrefmode =
GETPOST(
'INVOICE_PAYMENT_REF_MODE',
'aZ09');
178 if (!in_array($payrefmode, array(
'',
'company',
'thirdparty',
'invoice'))) {
183 include_once DOL_DOCUMENT_ROOT.
'/core/lib/paymentref.lib.php';
185 if ($payrefmode !=
'' && $payrefblocker !=
'') {
186 setEventMessages($langs->trans($payrefblocker),
null,
'errors');
192 $payrefparts = array();
193 foreach (
GETPOST(
'INVOICE_PAYMENT_REF_PARTS',
'array') as $payrefpart) {
194 if (in_array($payrefpart, array(
'invoice_ref',
'customer_code',
'contract_ref'))) {
195 $payrefparts[] = $payrefpart;
198 if (empty($payrefparts)) {
199 $payrefparts[] =
'invoice_ref';
201 dolibarr_set_const($db,
"INVOICE_PAYMENT_REF_PARTS", implode(
',', $payrefparts),
'chaine', 0,
'',
$conf->entity);
204 $payrefbase =
GETPOST(
'INVOICE_PAYMENT_REF_TP_BASE',
'aZ09');
205 if (!in_array($payrefbase, array(
'code_client',
'code_fournisseur',
'rowid'))) {
206 $payrefbase =
'code_client';
218 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
220 setEventMessages($langs->trans(
"Error"),
null,
'errors');
222} elseif ($action ==
'set_FACTURE_DRAFT_WATERMARK') {
223 $draft =
GETPOST(
'FACTURE_DRAFT_WATERMARK',
'alpha');
232 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
234 setEventMessages($langs->trans(
"Error"),
null,
'errors');
236} elseif ($action ==
'set_INVOICE_FREE_TEXT') {
237 $freetext =
GETPOST(
'INVOICE_FREE_TEXT',
'restricthtml');
246 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
248 setEventMessages($langs->trans(
"Error"),
null,
'errors');
250} elseif ($action ==
'setforcedate') {
251 $forcedate =
GETPOST(
'forcedate',
'alpha');
260 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
262 setEventMessages($langs->trans(
"Error"),
null,
'errors');
264} elseif ($action ==
'setDefaultPDFModulesByType') {
265 $invoicetypemodels =
GETPOST(
'invoicetypemodels');
267 if (!empty($invoicetypemodels) && is_array($invoicetypemodels)) {
270 foreach ($invoicetypemodels as $type => $value) {
278 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
280 setEventMessages($langs->trans(
"Error"),
null,
'errors');
283} elseif ($action ==
'set_INVOICE_CHECK_POSTERIOR_DATE') {
284 $check_posterior_date =
GETPOSTINT(
'INVOICE_CHECK_POSTERIOR_DATE');
285 $res =
dolibarr_set_const($db,
'INVOICE_CHECK_POSTERIOR_DATE', $check_posterior_date,
'chaine', 0,
'',
$conf->entity);
289} elseif (preg_match(
'/set_(.*)/', $action, $reg)) {
299 setEventMessages($langs->trans(
'Error'),
null,
'errors');
301 setEventMessages($langs->trans(
'SetupSaved'),
null,
'mesgs');
302 header(
"Location: " . $_SERVER[
"PHP_SELF"]);
305} elseif (preg_match(
'/del_(.*)/', $action, $reg)) {
314 setEventMessages($langs->trans(
'Error'),
null,
'errors');
316 setEventMessages($langs->trans(
'SetupSaved'),
null,
'mesgs');
317 header(
"Location: " . $_SERVER[
"PHP_SELF"]);
327$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
329$title = $langs->trans(
"BillsSetup");
331llxHeader(
"", $title,
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura',
'', 0, 0,
'',
'',
'',
'mod-admin page-invoice');
333$form =
new Form($db);
336$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
347print
'<div class="div-table-responsive-no-min">';
348print
'<table class="noborder centpercent">';
349print
'<tr class="liste_titre">';
350print
'<td>'.$langs->trans(
"Name").
'</td>';
351print
'<td>'.$langs->trans(
"Description").
'</td>';
352print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
353print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
354print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
359$arrayofmodules = array();
361foreach ($dirmodels as $reldir) {
364 $handle = opendir($dir);
365 if (is_resource($handle)) {
366 while (($file = readdir($handle)) !==
false) {
367 if (!is_dir($dir.$file) || (
dol_substr($file, 0, 1) !=
'.' &&
dol_substr($file, 0, 3) !=
'CVS')) {
369 $classname = preg_replace(
'/\.php$/',
'', $file);
371 if (!is_file($dir.$filebis)) {
372 $filebis = $file.
"/".$file.
".modules.php";
373 $classname =
"mod_facture_".$file;
377 preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
378 if (!empty($reg[2]) && $reg[2] != strtoupper(
$mysoc->country_code)) {
382 $classname = preg_replace(
'/\-.*$/',
'', $classname);
383 if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) &&
dol_substr($filebis,
dol_strlen($filebis) - 3, 3) ==
'php') {
385 require_once $dir.$filebis;
389 '@phan-var-force ModeleNumRefFactures $module';
402'@phan-var-force ModeleNumRefFactures[] $arrayofmodules';
404foreach ($arrayofmodules as
$module) {
405 $file = strtolower(
$module->getName($langs));
406 if (!preg_match(
'/^mod_facture_/', $file)) {
407 $file =
'mod_facture_'.$file;
422 print
'<tr class="oddeven"><td width="100">';
423 print preg_replace(
'/\-.*$/',
'', preg_replace(
'/mod_facture_/',
'',
$module->getName($langs)));
429 print
'<td class="nowrap">';
431 if (preg_match(
'/^Error/', $tmp)) {
432 $langs->load(
"errors");
433 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
434 } elseif ($tmp ==
'NotConfigured') {
435 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
441 print
'<td class="center">';
443 print img_picto($langs->trans(
"Activated"),
'switch_on');
445 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>';
450 $facture->initAsSpecimen();
455 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.
$module->getVersion().
'</b><br>';
458 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
459 $htmltooltip .= $langs->trans(
"NextValueForInvoices").
': ';
461 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
462 $langs->load(
'errors');
463 $nextval = $langs->trans($nextval);
465 $htmltooltip .= $nextval.
'<br>';
467 $langs->load(
'errors');
468 $htmltooltip .= $langs->trans(
$module->error).
'<br>';
475 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
476 $htmltooltip .= $langs->trans(
"NextValueForReplacements").
': ';
478 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
479 $langs->load(
'errors');
480 $nextval = $langs->trans($nextval);
482 $htmltooltip .= $nextval.
'<br>';
484 $langs->load(
'errors');
485 $htmltooltip .= $langs->trans(
$module->error).
'<br>';
492 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
493 $htmltooltip .= $langs->trans(
"NextValueForCreditNotes").
': ';
495 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
496 $langs->load(
'errors');
497 $nextval = $langs->trans($nextval);
499 $htmltooltip .= $nextval.
'<br>';
501 $langs->load(
'errors');
502 $htmltooltip .= $langs->trans(
$module->error).
'<br>';
508 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
509 $htmltooltip .= $langs->trans(
"NextValueForDeposit").
': ';
511 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
512 $langs->load(
'errors');
513 $nextval = $langs->trans($nextval);
515 $htmltooltip .= $nextval;
517 $langs->load(
'errors');
518 $htmltooltip .= $langs->trans(
$module->error);
522 print
'<td class="center">';
523 print $form->textwithpicto(
'', $htmltooltip, 1,
'info');
546printDocumentModelList(
'invoice',
'facture',
'FACTURE_ADDON_PDF', $langs->trans(
"BillsPDFModules"), array(
547 'Logo' =>
'option_logo',
548 'PaymentMode' =>
'option_modereg',
549 'PaymentConditions' =>
'option_condreg',
550 'Discounts' =>
'option_escompte',
551 'CreditNote' =>
'option_credit_note',
552 'MultiLanguage' =>
'option_multilang',
553 'WatermarkOnDraftInvoices' =>
'option_draft_watermark',
561 print
load_fiche_titre($langs->trans(
"BillsPDFModulesAccordindToInvoiceType"),
'',
'');
563 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'#default-pdf-modules-by-type-table" method="POST" spellcheck="false">';
564 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
565 print
'<input type="hidden" name="action" value="setDefaultPDFModulesByType" >';
566 print
'<input type="hidden" name="page_y" value="" />';
568 print
'<div class="div-table-responsive-no-min">';
569 print
'<table id="default-pdf-modules-by-type-table" class="noborder centpercent">';
570 print
'<tr class="liste_titre">';
571 print
'<td>'.$langs->trans(
"Type").
'</td>';
572 print
'<td>'.$langs->trans(
"Name").
'</td>';
573 print
'<td class="right"><input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'"></td>';
586 foreach ($listtype as $type => $trans) {
587 $thisTypeConfName =
'FACTURE_ADDON_PDF_'.$type;
590 print
'<td>'.$trans.
'</td>';
605print
load_fiche_titre($langs->trans(
"SuggestedPaymentModesIfNotDefinedInInvoice"),
'',
'');
607print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" spellcheck="false">';
608print
'<input type="hidden" name="token" value="'.newToken().
'" />';
609print
'<input type="hidden" name="page_y" value="" />';
611print
'<div class="div-table-responsive-no-min">';
612print
'<table class="noborder centpercent">';
614print
'<tr class="liste_titre">';
616print
'<input type="hidden" name="action" value="setribchq">';
617print $langs->trans(
"PaymentMode").
'</td>';
618print
'<td class="right"></td>';
621print
'<tr class="oddeven">';
622print
"<td>".$langs->trans(
"SuggestPaymentByRIBOnAccount").
"</td>";
625 $sql =
"SELECT rowid, label, clos";
626 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account";
627 $sql .=
" WHERE courant = 1";
628 $sql .=
" AND entity IN (".getEntity(
'bank_account').
")";
629 $resql = $db->query($sql);
631 $num = $db->num_rows($resql);
634 print
'<select name="rib" class="flat" id="rib">';
635 print
'<option value="0">'.$langs->trans(
"DoNotSuggestPaymentMode").
'</option>';
637 $obj = $db->fetch_object($resql);
639 print
'<option value="'.$obj->rowid.
'"';
641 if (!empty($obj->clos)) {
644 print
'>'.dol_escape_htmltag($obj->label).
'</option>';
651 print
'<span class="opacitymedium">'.$langs->trans(
"NoActiveBankAccountDefined").
'</span>';
655 print $langs->trans(
"BankModuleNotActive");
661print
'<tr class="oddeven">';
662print
"<td>".$langs->trans(
"SuggestPaymentByChequeToAddress").
"</td>";
664print
'<select class="flat" name="chq" id="chq">';
665print
'<option value="0">'.$langs->trans(
"DoNotSuggestPaymentMode").
'</option>';
666print
'<option value="-1"'.($FACTURE_CHQ_NUMBER == -1 ?
' selected' :
'').
'>'.$langs->trans(
"MenuCompanySetup").
' ('.(
$mysoc->name ?
$mysoc->name : $langs->trans(
"NotDefined")).
')</option>';
668$sql =
"SELECT rowid, label";
669$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account";
670$sql .=
" WHERE clos = 0";
671$sql .=
" AND courant = 1";
672$sql .=
" AND entity IN (".getEntity(
'bank_account').
")";
674$resql = $db->query($sql);
676 $num = $db->num_rows($resql);
679 $row = $db->fetch_row($resql);
681 print
'<option value="'.$row[0].
'"';
682 print $FACTURE_CHQ_NUMBER == $row[0] ?
' selected' :
'';
683 print
'>'.$langs->trans(
"OwnerOfBankAccount", $row[1]).
'</option>';
695print
'<tr class="oddeven"><td>' . $langs->trans(
"InvoicePaymentReferenceMode") .
' ';
696print $form->textwithpicto(
'', $langs->trans(
"InvoicePaymentReferenceModeHelp"), 1,
'help') .
'</td>';
697print
'<td class="left" colspan="2">';
698$arraypayrefmode = array(
699 '' => $langs->trans(
"None"),
700 'company' => $langs->trans(
"PaymentRefModeCompany"),
701 'thirdparty' => $langs->trans(
"PaymentRefModeThirdparty"),
702 'invoice' => $langs->trans(
"PaymentRefModeInvoice"),
704print $form->selectarray(
"INVOICE_PAYMENT_REF_MODE", $arraypayrefmode,
getDolGlobalString(
'INVOICE_PAYMENT_REF_MODE'), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200');
708include_once DOL_DOCUMENT_ROOT.
'/core/lib/paymentref.lib.php';
710if ($payrefwarning !=
'') {
711 print
'<tr class="oddeven"><td colspan="3">';
712 print
'<span class="warning">'.img_warning().
' '.$langs->trans($payrefwarning).
'</span>';
718 print
'<tr class="oddeven"><td>' . $langs->trans(
"PaymentRefParts") .
' ';
719 print $form->textwithpicto(
'', $langs->trans(
"PaymentRefPartsHelp"), 1,
'help') .
'</td>';
720 print
'<td class="left" colspan="2">';
721 $arraypayrefparts = array(
722 'invoice_ref' => $langs->trans(
"InvoiceRef"),
723 'customer_code' => $langs->trans(
"CustomerCode"),
724 'contract_ref' => $langs->trans(
"RefContract"),
726 print $form->multiselectarray(
"INVOICE_PAYMENT_REF_PARTS", $arraypayrefparts, explode(
',',
getDolGlobalString(
'INVOICE_PAYMENT_REF_PARTS',
'invoice_ref')), 0, 0,
'minwidth200');
732 print
'<tr class="oddeven"><td>' . $langs->trans(
"PaymentRefBase") .
' ';
733 print $form->textwithpicto(
'', $langs->trans(
"PaymentRefBaseHelp"), 1,
'help') .
'</td>';
734 print
'<td class="left" colspan="2">';
735 $arraypayrefbase = array(
736 'code_client' => $langs->trans(
"CustomerCode"),
737 'code_fournisseur' => $langs->trans(
"SupplierCode"),
738 'rowid' => $langs->trans(
"Id"),
740 print $form->selectarray(
"INVOICE_PAYMENT_REF_TP_BASE", $arraypayrefbase,
getDolGlobalString(
'INVOICE_PAYMENT_REF_TP_BASE',
'code_client'), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200');
746if (
$mysoc->country_code ==
'BE') {
747 print
'<tr class="oddeven"><td>' . $langs->trans(
"InvoicePaymentManageStructuredCommunication") .
' ';
748 print $form->textwithpicto(
'', $langs->trans(
"InvoicePaymentManageStructuredCommunicationHelp"), 1,
'help') .
'</td>';
749 print
'<td class="left" colspan="2">';
750 print ajax_constantonoff(
'INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION');
758print
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'">';
767print
'<div class="div-table-responsive-no-min">';
768print
'<table class="noborder centpercent">';
769print
'<tr class="liste_titre">';
770print
'<td>'.$langs->trans(
"Parameters").
'</td>';
771print
'<td class="center"></td>';
772print
'<td width="80"> </td>';
776$substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
777$htmltext =
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
778foreach ($substitutionarray as $key => $val) {
779 $htmltext .= $key.
'<br>';
783print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" spellcheck="false">';
784print
'<input type="hidden" name="token" value="'.newToken().
'" />';
785print
'<input type="hidden" name="action" value="set_INVOICE_FREE_TEXT" />';
786print
'<input type="hidden" name="page_y" value="" />';
787print
'<tr class="oddeven"><td colspan="2">';
788print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices"), $langs->trans(
"AddCRIfTooLong").
'<br><br>'.$htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
789$variablename =
'INVOICE_FREE_TEXT';
791 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
793 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
795 print $doleditor->Create();
797print
'</td><td class="right">';
798print
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
803print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" spellcheck="false">';
804print
'<input type="hidden" name="token" value="'.newToken().
'" />';
805print
'<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />';
806print
'<input type="hidden" name="page_y" value="" />';
807print
'<tr class="oddeven"><td>';
808print $form->textwithpicto($langs->trans(
"WatermarkOnDraftBill"), $htmltext, 1,
'help',
'', 0, 2,
'watermarktooltip').
'<br>';
810print
'<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(
getDolGlobalString(
'FACTURE_DRAFT_WATERMARK')).
'">';
811print
'</td><td class="right">';
812print
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
818print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" spellcheck="false">';
819print
'<input type="hidden" name="token" value="'.newToken().
'" />';
820print
'<input type="hidden" name="action" value="setforcedate" />';
821print
'<input type="hidden" name="page_y" value="" />';
822print
'<tr class="oddeven"><td>';
823print $langs->trans(
"ForceInvoiceDate");
825print $form->selectyesno(
"forcedate",
getDolGlobalInt(
'FAC_FORCE_DATE_VALIDATION', 0), 1);
826print
'</td><td class="right">';
827print
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
831print
'<tr class="oddeven"><td>'.$langs->trans(
"InvoiceCheckPosteriorDate").
' ' ;
832print $form->textwithpicto(
'', $langs->trans(
"InvoiceCheckPosteriorDateHelp"), 1,
'help') .
'</td>';
833print
'<td class="left" colspan="2">';
835print ajax_constantonoff(
'INVOICE_CHECK_POSTERIOR_DATE');
843 print
'<tr class="oddeven"><td>'.$langs->trans(
"InvoicePointOfTaxDateMandatory").
' ';
844 print $form->textwithpicto(
'', $langs->trans(
"InvoicePointOfTaxDateMandatoryHelp"), 1,
'help').
'</td>';
845 print
'<td class="left" colspan="2">';
846 print ajax_constantonoff(
'INVOICE_POINTOFTAX_DATE_MANDATORY');
851print
'<tr class="oddeven">';
852print
'<td>'.$langs->trans(
"AllowExternalDownload").
'</td>';
853print
'<td class="left" colspan="2">';
854print ajax_constantonoff(
'INVOICE_ALLOW_EXTERNAL_DOWNLOAD', array(),
null, 0, 0, 0, 2, 0, 1);
859print
'<tr class="oddeven">';
860print
'<td>'.img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"Notifications").
'</td>';
861print
'<td colspan="2">';
862print $langs->trans(
"YouMayFindNotificationsFeaturesIntoModuleNotification");
866print
'<tr class="oddeven">';
867print
'<td>'.img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"MoreOptionsRelatedToPDF").
'</td>';
868print
'<td colspan="2">';
869print img_picto(
'',
'url',
'class="pictofixedwidth"').
'<a href="'.DOL_URL_ROOT.
'/admin/pdf_other.php">'.$langs->trans(
"SeeInPDFSetupPage").
'</a>';
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='', $placeholder='')
Convert a html select field into an ajax combobox.
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.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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.
if(! $sortfield) if(! $sortorder) $module
dol_strlen($string, $stringencoding='UTF-8', $binarycount=0)
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formatted messages to output (Used to show messages on html output).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
invoice_admin_prepare_head()
Return array head with list of tabs to view object information.
dolPayRefGetSetupWarning($country_code, $mode='')
Return the setup that is still missing before references can be generated.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.