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');
 
   60include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
 
   62if ($action == 
'updateMask') {
 
   63  $maskconstinvoice = 
GETPOST(
'maskconstinvoice', 
'aZ09');
 
   64  $maskconstreplacement = 
GETPOST(
'maskconstreplacement', 
'aZ09');
 
   65  $maskconstcredit = 
GETPOST(
'maskconstcredit', 
'aZ09');
 
   66  $maskconstdeposit = 
GETPOST(
'maskconstdeposit', 
'aZ09');
 
   67  $maskinvoice = 
GETPOST(
'maskinvoice', 
'alpha');
 
   68  $maskreplacement = 
GETPOST(
'maskreplacement', 
'alpha');
 
   69  $maskcredit = 
GETPOST(
'maskcredit', 
'alpha');
 
   70  $maskdeposit = 
GETPOST(
'maskdeposit', 
'alpha');
 
   71  if ($maskconstinvoice && preg_match(
'/_MASK_/', $maskconstinvoice)) {
 
   72    $res = 
dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 
'chaine', 0, 
'', $conf->entity);
 
   74  if ($maskconstreplacement && preg_match(
'/_MASK_/', $maskconstreplacement)) {
 
   75    $res = 
dolibarr_set_const($db, $maskconstreplacement, $maskreplacement, 
'chaine', 0, 
'', $conf->entity);
 
   77  if ($maskconstcredit && preg_match(
'/_MASK_/', $maskconstcredit)) {
 
   78    $res = 
dolibarr_set_const($db, $maskconstcredit, $maskcredit, 
'chaine', 0, 
'', $conf->entity);
 
   80  if ($maskconstdeposit && preg_match(
'/_MASK_/', $maskconstdeposit)) {
 
   81    $res = 
dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 
'chaine', 0, 
'', $conf->entity);
 
   93} elseif ($action == 
'specimen') {
 
   94  $modele = 
GETPOST(
'module', 
'alpha');
 
   97  $facture->initAsSpecimen();
 
  103  $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
 
  104  foreach ($dirmodels as $reldir) {
 
  105    $file = 
dol_buildpath($reldir.
"core/modules/facture/doc/pdf_".$modele.
".modules.php", 0);
 
  106    if (file_exists($file)) {
 
  108      $classname = 
"pdf_".$modele;
 
  116    $module = 
new $classname($db);
 
  118    if ($module->write_file($facture, $langs) > 0) {
 
  119      header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=facture&file=SPECIMEN.pdf");
 
  127    dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
 
  129} elseif ($action == 
'set') {
 
  132} elseif ($action == 
'del') {
 
  135    if ($conf->global->FACTURE_ADDON_PDF == 
"$value") {
 
  139} elseif ($action == 
'setdoc') {
 
  141  if (
dolibarr_set_const($db, 
"FACTURE_ADDON_PDF", $value, 
'chaine', 0, 
'', $conf->entity)) {
 
  144    $conf->global->FACTURE_ADDON_PDF = $value;
 
  152} elseif ($action == 
'setmod') {
 
  157} elseif ($action == 
'setribchq') {
 
  158  $rib = 
GETPOST(
'rib', 
'alpha');
 
  159  $chq = 
GETPOST(
'chq', 
'alpha');
 
  161  $res = 
dolibarr_set_const($db, 
"FACTURE_RIB_NUMBER", $rib, 
'chaine', 0, 
'', $conf->entity);
 
  162  $res = 
dolibarr_set_const($db, 
"FACTURE_CHQ_NUMBER", $chq, 
'chaine', 0, 
'', $conf->entity);
 
  173} elseif ($action == 
'set_FACTURE_DRAFT_WATERMARK') {
 
  174  $draft = 
GETPOST(
'FACTURE_DRAFT_WATERMARK', 
'alpha');
 
  176  $res = 
dolibarr_set_const($db, 
"FACTURE_DRAFT_WATERMARK", trim($draft), 
'chaine', 0, 
'', $conf->entity);
 
  187} elseif ($action == 
'set_INVOICE_FREE_TEXT') {
 
  188  $freetext = 
GETPOST(
'INVOICE_FREE_TEXT', 
'restricthtml'); 
 
  190  $res = 
dolibarr_set_const($db, 
"INVOICE_FREE_TEXT", $freetext, 
'chaine', 0, 
'', $conf->entity);
 
  201} elseif ($action == 
'setforcedate') {
 
  202  $forcedate = 
GETPOST(
'forcedate', 
'alpha');
 
  204  $res = 
dolibarr_set_const($db, 
"FAC_FORCE_DATE_VALIDATION", $forcedate, 
'chaine', 0, 
'', $conf->entity);
 
  215} elseif ($action == 
'setDefaultPDFModulesByType') {
 
  216  $invoicetypemodels = 
GETPOST(
'invoicetypemodels');
 
  218  if (!empty($invoicetypemodels) && is_array($invoicetypemodels)) {
 
  221    foreach ($invoicetypemodels as $type => $value) {
 
  222      $res = 
dolibarr_set_const($db, 
'FACTURE_ADDON_PDF_'.intval($type), $value, 
'chaine', 0, 
'', $conf->entity);
 
  234} elseif ($action == 
'set_INVOICE_CHECK_POSTERIOR_DATE') {
 
  235  $check_posterior_date = 
GETPOST(
'INVOICE_CHECK_POSTERIOR_DATE', 
'int');
 
  236  $res = 
dolibarr_set_const($db, 
'INVOICE_CHECK_POSTERIOR_DATE', $check_posterior_date, 
'chaine', 0, 
'', $conf->entity);
 
  240} elseif (preg_match(
'/set_(.*)/', $action, $reg)) {
 
  253    header(
"Location: " . $_SERVER[
"PHP_SELF"]);
 
  256} elseif (preg_match(
'/del_(.*)/', $action, $reg)) {
 
  268    header(
"Location: " . $_SERVER[
"PHP_SELF"]);
 
  278$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
 
  280llxHeader(
"", $langs->trans(
"BillsSetup"), 
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura');
 
  282$form = 
new Form($db);
 
  285$linkback = 
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
 
  286print 
load_fiche_titre($langs->trans(
"BillsSetup"), $linkback, 
'title_setup');
 
  297print 
'<div class="div-table-responsive-no-min">';
 
  298print 
'<table class="noborder centpercent">';
 
  299print 
'<tr class="liste_titre">';
 
  300print 
'<td>'.$langs->trans(
"Name").
'</td>';
 
  301print 
'<td>'.$langs->trans(
"Description").
'</td>';
 
  302print 
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
 
  303print 
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
 
  304print 
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
 
  309foreach ($dirmodels as $reldir) {
 
  312    $handle = opendir($dir);
 
  313    if (is_resource($handle)) {
 
  314      while (($file = readdir($handle)) !== 
false) {
 
  315        if (!is_dir($dir.$file) || (substr($file, 0, 1) != 
'.' && substr($file, 0, 3) != 
'CVS')) {
 
  317          $classname = preg_replace(
'/\.php$/', 
'', $file);
 
  319          if (!is_file($dir.$filebis)) {
 
  320            $filebis = $file.
"/".$file.
".modules.php";
 
  321            $classname = 
"mod_facture_".$file;
 
  324          preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
 
  325          if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) {
 
  329          $classname = preg_replace(
'/\-.*$/', 
'', $classname);
 
  330          if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) && substr($filebis, 
dol_strlen($filebis) - 3, 3) == 
'php') {
 
  332            require_once $dir.$filebis;
 
  334            $module = 
new $classname($db);
 
  337            if ($module->version == 
'development' && 
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
 
  340            if ($module->version == 
'experimental' && 
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
 
  344            if ($module->isEnabled()) {
 
  345              print 
'<tr class="oddeven"><td width="100">';
 
  346              echo preg_replace(
'/\-.*$/', 
'', preg_replace(
'/mod_facture_/', 
'', preg_replace(
'/\.php$/', 
'', $file)));
 
  349              print $module->info($langs);
 
  354              print 
'<td class="nowrap">';
 
  355              $tmp = $module->getExample();
 
  356              if (preg_match(
'/^Error/', $tmp)) {
 
  357                $langs->load(
"errors");
 
  358                print 
'<div class="error">'.$langs->trans($tmp).
'</div>';
 
  359              } elseif ($tmp == 
'NotConfigured') {
 
  360                print 
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
 
  366              print 
'<td class="center">';
 
  368              if ($conf->global->FACTURE_ADDON == $file || 
getDolGlobalString(
'FACTURE_ADDON') . 
'.php' == $file) {
 
  369                print 
img_picto($langs->trans(
"Activated"), 
'switch_on');
 
  371                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>';
 
  376              $facture->initAsSpecimen();
 
  380              $htmltooltip .= 
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
 
  382              $nextval = $module->getNextValue($mysoc, $facture);
 
  383              if (
"$nextval" != $langs->trans(
"NotAvailable")) {  
 
  384                $htmltooltip .= $langs->trans(
"NextValueForInvoices").
': ';
 
  386                  if (preg_match(
'/^Error/', $nextval) || $nextval == 
'NotConfigured') {
 
  387                    $nextval = $langs->trans($nextval);
 
  389                  $htmltooltip .= $nextval.
'<br>';
 
  391                  $htmltooltip .= $langs->trans($module->error).
'<br>';
 
  396              $nextval = $module->getNextValue($mysoc, $facture);
 
  397              if (
"$nextval" != $langs->trans(
"NotAvailable")) {  
 
  398                $htmltooltip .= $langs->trans(
"NextValueForReplacements").
': ';
 
  400                  if (preg_match(
'/^Error/', $nextval) || $nextval == 
'NotConfigured') {
 
  401                    $nextval = $langs->trans($nextval);
 
  403                  $htmltooltip .= $nextval.
'<br>';
 
  405                  $htmltooltip .= $langs->trans($module->error).
'<br>';
 
  411              $nextval = $module->getNextValue($mysoc, $facture);
 
  412              if (
"$nextval" != $langs->trans(
"NotAvailable")) {  
 
  413                $htmltooltip .= $langs->trans(
"NextValueForCreditNotes").
': ';
 
  415                  if (preg_match(
'/^Error/', $nextval) || $nextval == 
'NotConfigured') {
 
  416                    $nextval = $langs->trans($nextval);
 
  418                  $htmltooltip .= $nextval.
'<br>';
 
  420                  $htmltooltip .= $langs->trans($module->error).
'<br>';
 
  425              $nextval = $module->getNextValue($mysoc, $facture);
 
  426              if (
"$nextval" != $langs->trans(
"NotAvailable")) {  
 
  427                $htmltooltip .= $langs->trans(
"NextValueForDeposit").
': ';
 
  429                  if (preg_match(
'/^Error/', $nextval) || $nextval == 
'NotConfigured') {
 
  430                    $nextval = $langs->trans($nextval);
 
  432                  $htmltooltip .= $nextval;
 
  434                  $htmltooltip .= $langs->trans($module->error);
 
  438              print 
'<td class="center">';
 
  439              print $form->textwithpicto(
'', $htmltooltip, 1, 0);
 
  442                if (!empty($module->error)) {
 
  473$sql .= 
" FROM ".MAIN_DB_PREFIX.
"document_model";
 
  474$sql .= 
" WHERE type = '".$db->escape($type).
"'";
 
  475$sql .= 
" AND entity = ".$conf->entity;
 
  476$resql = $db->query($sql);
 
  479  $num_rows = $db->num_rows($resql);
 
  480  while ($i < $num_rows) {
 
  481    $array = $db->fetch_array($resql);
 
  482    array_push($def, $array[0]);
 
  489print 
'<div class="div-table-responsive-no-min">';
 
  490print 
'<table class="noborder centpercent">';
 
  491print 
'<tr class="liste_titre">';
 
  492print 
'<td>'.$langs->trans(
"Name").
'</td>';
 
  493print 
'<td>'.$langs->trans(
"Description").
'</td>';
 
  494print 
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
 
  495print 
'<td class="center" width="60">'.$langs->trans(
"Default").
'</td>';
 
  496print 
'<td class="center" width="32">'.$langs->trans(
"ShortInfo").
'</td>';
 
  497print 
'<td class="center" width="32">'.$langs->trans(
"Preview").
'</td>';
 
  502$activatedModels = array();
 
  504foreach ($dirmodels as $reldir) {
 
  505  foreach (array(
'', 
'/doc') as $valdir) {
 
  506    $realpath = $reldir.
"core/modules/facture".$valdir;
 
  510      $handle = opendir($dir);
 
  511      if (is_resource($handle)) {
 
  512        while (($file = readdir($handle)) !== 
false) {
 
  518        foreach ($filelist as $file) {
 
  519          if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
 
  520            if (file_exists($dir.
'/'.$file)) {
 
  521              $name = substr($file, 4, 
dol_strlen($file) - 16);
 
  522              $classname = substr($file, 0, 
dol_strlen($file) - 12);
 
  524              require_once $dir.
'/'.$file;
 
  525              $module = 
new $classname($db);
 
  527              $modulequalified = 1;
 
  528              if ($module->version == 
'development' && 
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
 
  529                $modulequalified = 0;
 
  531              if ($module->version == 
'experimental' && 
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
 
  532                $modulequalified = 0;
 
  535              if ($modulequalified) {
 
  536                print 
'<tr class="oddeven"><td width="100">';
 
  537                print(empty($module->name) ? $name : $module->
name);
 
  539                if (method_exists($module, 
'info')) {
 
  540                  print $module->info($langs);
 
  542                  print $module->description;
 
  547                if (in_array($name, $def)) {
 
  548                  print 
'<td class="center">'.
"\n";
 
  549                  print 
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.newToken().
'&value='.urlencode($name).
'">';
 
  550                  print 
img_picto($langs->trans(
"Enabled"), 
'switch_on');
 
  554                  print 
'<td class="center">'.
"\n";
 
  555                  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>';
 
  560                print 
'<td class="center">';
 
  561                if ($conf->global->FACTURE_ADDON_PDF == 
"$name") {
 
  562                  print 
img_picto($langs->trans(
"Default"), 
'on');
 
  564                  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>';
 
  569                $htmltooltip = 
''.$langs->trans(
"Name").
': '.$module->name;
 
  570                $htmltooltip .= 
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
 
  571                if ($module->type == 
'pdf') {
 
  572                  $htmltooltip .= 
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
 
  574                $htmltooltip .= 
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//', 
'', $realpath).
'/'.$file;
 
  576                $htmltooltip .= 
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
 
  577                $htmltooltip .= 
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
 
  578                $htmltooltip .= 
'<br>'.$langs->trans(
"PaymentMode").
': '.
yn($module->option_modereg, 1, 1);
 
  579                $htmltooltip .= 
'<br>'.$langs->trans(
"PaymentConditions").
': '.
yn($module->option_condreg, 1, 1);
 
  580                $htmltooltip .= 
'<br>'.$langs->trans(
"Discounts").
': '.
yn($module->option_escompte, 1, 1);
 
  581                $htmltooltip .= 
'<br>'.$langs->trans(
"CreditNote").
': '.
yn($module->option_credit_note, 1, 1);
 
  582                $htmltooltip .= 
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
 
  583                $htmltooltip .= 
'<br>'.$langs->trans(
"WatermarkOnDraftInvoices").
': '.
yn($module->option_draft_watermark, 1, 1);
 
  586                print 
'<td class="center">';
 
  587                print $form->textwithpicto(
'', $htmltooltip, 1, 0);
 
  591                print 
'<td class="center">';
 
  592                if ($module->type == 
'pdf') {
 
  593                  print 
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"), 
'pdf').
'</a>';
 
  595                  print 
img_object($langs->trans(
"PreviewNotAvailable"), 
'generic');
 
  616  print 
load_fiche_titre($langs->trans(
"BillsPDFModulesAccordindToInvoiceType"), 
'', 
'');
 
  618  print 
'<form action="'.$_SERVER[
"PHP_SELF"].
'#default-pdf-modules-by-type-table" method="POST">';
 
  619  print 
'<input type="hidden" name="token" value="'.newToken().
'" />';
 
  620  print 
'<input type="hidden" name="action" value="setDefaultPDFModulesByType" >';
 
  621  print 
'<input type="hidden" name="page_y" value="" />';
 
  623  print 
'<div class="div-table-responsive-no-min">';
 
  624  print 
'<table id="default-pdf-modules-by-type-table" class="noborder centpercent">';
 
  625  print 
'<tr class="liste_titre">';
 
  626  print 
'<td>'.$langs->trans(
"Type").
'</td>';
 
  627  print 
'<td>'.$langs->trans(
"Name").
'</td>';
 
  628  print 
'<td class="right"><input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'"></td>';
 
  641  foreach ($listtype as $type => $trans) {
 
  642    $thisTypeConfName = 
'FACTURE_ADDON_PDF_'.$type;
 
  645    print 
'<td>'.$trans.
'</td>';
 
  660print 
load_fiche_titre($langs->trans(
"SuggestedPaymentModesIfNotDefinedInInvoice"), 
'', 
'');
 
  662print 
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
 
  663print 
'<input type="hidden" name="token" value="'.newToken().
'" />';
 
  664print 
'<input type="hidden" name="page_y" value="" />';
 
  666print 
'<div class="div-table-responsive-no-min">';
 
  667print 
'<table class="noborder centpercent">';
 
  669print 
'<tr class="liste_titre">';
 
  671print 
'<input type="hidden" name="action" value="setribchq">';
 
  672print $langs->trans(
"PaymentMode").
'</td>';
 
  673print 
'<td class="right"><input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'"></td>';
 
  676print 
'<tr class="oddeven">';
 
  677print 
"<td>".$langs->trans(
"SuggestPaymentByRIBOnAccount").
"</td>";
 
  679if (isModEnabled(
'banque')) {
 
  680  $sql = 
"SELECT rowid, label, clos";
 
  681  $sql .= 
" FROM ".MAIN_DB_PREFIX.
"bank_account";
 
  682  $sql .= 
" WHERE courant = 1";
 
  683  $sql .= 
" AND entity IN (".getEntity(
'bank_account').
")";
 
  684  $resql = $db->query($sql);
 
  686    $num = $db->num_rows($resql);
 
  689      print 
'<select name="rib" class="flat" id="rib">';
 
  690      print 
'<option value="0">'.$langs->trans(
"DoNotSuggestPaymentMode").
'</option>';
 
  692        $obj = $db->fetch_object($resql);
 
  694        print 
'<option value="'.$obj->rowid.
'"';
 
  696        if (!empty($obj->clos)) {
 
  699        print 
'>'.dol_escape_htmltag($obj->label).
'</option>';
 
  706      print 
'<span class="opacitymedium">'.$langs->trans(
"NoActiveBankAccountDefined").
'</span>';
 
  710  print $langs->trans(
"BankModuleNotActive");
 
  716print 
'<tr class="oddeven">';
 
  717print 
"<td>".$langs->trans(
"SuggestPaymentByChequeToAddress").
"</td>";
 
  719print 
'<select class="flat" name="chq" id="chq">';
 
  720print 
'<option value="0">'.$langs->trans(
"DoNotSuggestPaymentMode").
'</option>';
 
  721print 
'<option value="-1"'.($FACTURE_CHQ_NUMBER == -1 ? 
' selected' : 
'').
'>'.$langs->trans(
"MenuCompanySetup").
' ('.($mysoc->name ? $mysoc->name : $langs->trans(
"NotDefined")).
')</option>';
 
  723$sql = 
"SELECT rowid, label";
 
  724$sql .= 
" FROM ".MAIN_DB_PREFIX.
"bank_account";
 
  725$sql .= 
" WHERE clos = 0";
 
  726$sql .= 
" AND courant = 1";
 
  727$sql .= 
" AND entity IN (".getEntity(
'bank_account').
")";
 
  729$resql = $db->query($sql);
 
  731  $num = $db->num_rows($resql);
 
  734    $row = $db->fetch_row($resql);
 
  736    print 
'<option value="'.$row[0].
'"';
 
  737    print $FACTURE_CHQ_NUMBER == $row[0] ? 
' selected' : 
'';
 
  738    print 
'>'.$langs->trans(
"OwnerOfBankAccount", $row[1]).
'</option>';
 
  756print 
'<div class="div-table-responsive-no-min">';
 
  757print 
'<table class="noborder centpercent">';
 
  758print 
'<tr class="liste_titre">';
 
  759print 
'<td>'.$langs->trans(
"Parameters").
'</td>';
 
  760print 
'<td class="center" width="60">'.$langs->trans(
"Value").
'</td>';
 
  761print 
'<td width="80"> </td>';
 
  765print 
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
 
  766print 
'<input type="hidden" name="token" value="'.newToken().
'" />';
 
  767print 
'<input type="hidden" name="action" value="setforcedate" />';
 
  768print 
'<input type="hidden" name="page_y" value="" />';
 
  769print 
'<tr class="oddeven"><td>';
 
  770print $langs->trans(
"ForceInvoiceDate");
 
  771print 
'</td><td width="60" class="center">';
 
  772print $form->selectyesno(
"forcedate", 
getDolGlobalInt(
'FAC_FORCE_DATE_VALIDATION', 0), 1);
 
  773print 
'</td><td class="right">';
 
  774print 
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
 
  779$substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
 
  780$htmltext = 
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
 
  781foreach ($substitutionarray as $key => $val) {
 
  782  $htmltext .= $key.
'<br>';
 
  786print 
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
 
  787print 
'<input type="hidden" name="token" value="'.newToken().
'" />';
 
  788print 
'<input type="hidden" name="action" value="set_INVOICE_FREE_TEXT" />';
 
  789print 
'<input type="hidden" name="page_y" value="" />';
 
  790print 
'<tr class="oddeven"><td colspan="2">';
 
  791print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices"), $langs->trans(
"AddCRIfTooLong").
'<br><br>'.$htmltext, 1, 
'help', 
'', 0, 2, 
'freetexttooltip').
'<br>';
 
  792$variablename = 
'INVOICE_FREE_TEXT';
 
  794  print 
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
 
  796  include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
 
  798  print $doleditor->Create();
 
  800print 
'</td><td class="right">';
 
  801print 
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
 
  806print 
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
 
  807print 
'<input type="hidden" name="token" value="'.newToken().
'" />';
 
  808print 
'<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />';
 
  809print 
'<input type="hidden" name="page_y" value="" />';
 
  810print 
'<tr class="oddeven"><td>';
 
  811print $form->textwithpicto($langs->trans(
"WatermarkOnDraftBill"), $htmltext, 1, 
'help', 
'', 0, 2, 
'watermarktooltip').
'<br>';
 
  813print 
'<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(
getDolGlobalString(
'FACTURE_DRAFT_WATERMARK')).
'">';
 
  814print 
'</td><td class="right">';
 
  815print 
'<input type="submit" class="button button-edit reposition" value="'.$langs->trans(
"Modify").
'" />';
 
  820print 
'<tr class="oddeven"><td>'.$langs->trans(
"InvoiceCheckPosteriorDate"). 
' ' ;
 
  821print $form->textwithpicto(
'', $langs->trans(
"InvoiceCheckPosteriorDateHelp"), 1, 
'help') . 
'</td>';
 
  822print 
'<td class="left" colspan="2">';
 
  823print ajax_constantonoff(
'INVOICE_CHECK_POSTERIOR_DATE');
 
  827print 
'<tr class="oddeven">';
 
  828print 
'<td>'.$langs->trans(
"AllowExternalDownload").
'</td>';
 
  829print 
'<td class="left" colspan="2">';
 
  830print ajax_constantonoff(
'INVOICE_ALLOW_EXTERNAL_DOWNLOAD', array(), 
null, 0, 0, 0, 2, 0, 1);
 
  842print 
'<div class="div-table-responsive-no-min">';
 
  843print 
'<table class="noborder centpercent">'.
"\n";
 
  844print 
'<tr class="liste_titre">'.
"\n";
 
  845print 
'<td>'.$langs->trans(
"Name").
'</td>'.
"\n";
 
  846print 
'<td>'.$langs->trans(
"Value").
'</td>'.
"\n";
 
  848print 
'<tr class="oddeven">'.
"\n";
 
  849print 
'<td width="140">'.$langs->trans(
"PathDirectory").
'</td>'.
"\n";
 
  850print 
'<td>'.$conf->facture->dir_output.
'</td>'.
"\n";
 
  861print 
'<div class="div-table-responsive-no-min">';
 
  862print 
'<table class="noborder centpercent">';
 
  863print 
'<tr class="liste_titre">';
 
  864print 
'<td>'.$langs->trans(
"Parameter").
'</td>';
 
  865print 
'<td class="center" width="60"></td>';
 
  866print 
'<td width="80"> </td>';
 
  868print 
'<tr class="oddeven"><td colspan="2">';
 
  869print $langs->trans(
"YouMayFindNotificationsFeaturesIntoModuleNotification").
'<br>';
 
  870print 
'</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()
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 a 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.