2004-10-19 18:58:50 +00:00
< ? php
2011-10-25 09:24:06 +00:00
/* Copyright ( C ) 2003 - 2004 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
* Copyright ( C ) 2004 - 2011 Laurent Destailleur < eldy @ users . sourceforge . net >
* Copyright ( C ) 2005 Eric Seigne < eric . seigne @ ryxeo . com >
2018-10-27 12:43:12 +00:00
* Copyright ( C ) 2005 - 2012 Regis Houssin < regis . houssin @ inodbox . com >
2011-10-25 09:24:06 +00:00
* Copyright ( C ) 2008 Raphael Bertrand ( Resultic ) < raphael . bertrand @ resultic . fr >
2013-08-02 13:27:37 +00:00
* Copyright ( C ) 2012 - 2013 Juanjo Menent < jmenent @ 2 byte . es >
2014-08-12 09:40:24 +00:00
* Copyright ( C ) 2014 Teddy Andreotti < 125155 @ supinfo . com >
2022-11-21 08:29:30 +00:00
* Copyright ( C ) 2022 Anthony Berton < anthony . berton @ bb2a . fr >
2025-02-08 00:49:29 +00:00
* Copyright ( C ) 2024 - 2025 MDW < mdeweerd @ users . noreply . github . com >
2026-06-25 17:01:16 +00:00
* Copyright ( C ) 2024 - 2026 Frédéric France < frederic . france @ free . fr >
2024-10-13 23:39:03 +00:00
* Copyright ( C ) 2024 Alexandre Spangaro < alexandre @ inovea - conseil . com >
2003-03-11 15:27:34 +00:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 14:36:08 +00:00
* the Free Software Foundation ; either version 3 of the License , or
2003-03-11 15:27:34 +00:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2019-09-23 19:55:30 +00:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2003-03-11 15:27:34 +00:00
*/
2004-08-15 15:04:24 +00:00
2006-06-12 22:20:24 +00:00
/**
2024-03-10 14:52:29 +00:00
* \file htdocs / admin / invoice . php
2024-05-13 08:45:20 +00:00
* \ingroup invoice
2010-02-24 23:29:46 +00:00
* \brief Page to setup invoice module
2009-08-02 16:16:15 +00:00
*/
2004-08-15 15:04:24 +00:00
2022-09-07 18:08:59 +00:00
// Load Dolibarr environment
2012-08-22 21:24:21 +00:00
require '../main.inc.php' ;
2024-11-04 22:53:20 +00:00
/**
* @ var Conf $conf
* @ var DoliDB $db
* @ var HookManager $hookmanager
* @ var Societe $mysoc
* @ var Translate $langs
* @ var User $user
*/
2025-10-08 10:20:51 +00:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php' ;
2024-11-04 22:53:20 +00:00
2018-05-26 16:41:16 +00:00
// Load translation files required by the page
$langs -> loadLangs ( array ( 'admin' , 'errors' , 'other' , 'bills' ));
2004-08-29 12:01:58 +00:00
2021-02-26 21:04:03 +00:00
if ( ! $user -> admin ) {
accessforbidden ();
}
2004-02-15 16:49:08 +00:00
2020-09-16 17:39:50 +00:00
$action = GETPOST ( 'action' , 'aZ09' );
2019-01-27 10:55:16 +00:00
$value = GETPOST ( 'value' , 'alpha' );
2022-01-26 12:49:46 +00:00
$modulepart = GETPOST ( 'modulepart' , 'aZ09' ); // Used by actions_setmoduleoptions.inc.php
2019-01-27 10:55:16 +00:00
$label = GETPOST ( 'label' , 'alpha' );
$scandir = GETPOST ( 'scan_dir' , 'alpha' );
2020-01-30 00:48:28 +00:00
$type = 'invoice' ;
2011-08-31 18:47:29 +00:00
2024-03-10 14:42:38 +00:00
$error = 0 ;
2025-04-05 14:10:07 +00:00
$reg = array ();
2024-03-10 14:42:38 +00:00
2004-07-25 13:12:15 +00:00
2006-04-28 22:54:02 +00:00
/*
* Actions
*/
2010-06-15 21:52:41 +00:00
2017-06-01 10:11:45 +00:00
include DOL_DOCUMENT_ROOT . '/core/actions_setmoduleoptions.inc.php' ;
2021-02-26 21:04:03 +00:00
if ( $action == 'updateMask' ) {
2023-01-04 14:10:09 +00:00
$maskconstinvoice = GETPOST ( 'maskconstinvoice' , 'aZ09' );
$maskconstreplacement = GETPOST ( 'maskconstreplacement' , 'aZ09' );
$maskconstcredit = GETPOST ( 'maskconstcredit' , 'aZ09' );
$maskconstdeposit = GETPOST ( 'maskconstdeposit' , 'aZ09' );
2020-09-07 08:18:17 +00:00
$maskinvoice = GETPOST ( 'maskinvoice' , 'alpha' );
$maskreplacement = GETPOST ( 'maskreplacement' , 'alpha' );
$maskcredit = GETPOST ( 'maskcredit' , 'alpha' );
2020-01-30 00:48:28 +00:00
$maskdeposit = GETPOST ( 'maskdeposit' , 'alpha' );
2024-09-18 01:27:25 +00:00
$res = 0 ;
2023-01-04 14:10:09 +00:00
if ( $maskconstinvoice && preg_match ( '/_MASK_/' , $maskconstinvoice )) {
2021-02-26 21:04:03 +00:00
$res = dolibarr_set_const ( $db , $maskconstinvoice , $maskinvoice , 'chaine' , 0 , '' , $conf -> entity );
}
2023-01-04 14:10:09 +00:00
if ( $maskconstreplacement && preg_match ( '/_MASK_/' , $maskconstreplacement )) {
2021-02-26 21:04:03 +00:00
$res = dolibarr_set_const ( $db , $maskconstreplacement , $maskreplacement , 'chaine' , 0 , '' , $conf -> entity );
}
2023-01-04 14:10:09 +00:00
if ( $maskconstcredit && preg_match ( '/_MASK_/' , $maskconstcredit )) {
2021-02-26 21:04:03 +00:00
$res = dolibarr_set_const ( $db , $maskconstcredit , $maskcredit , 'chaine' , 0 , '' , $conf -> entity );
}
2023-01-04 14:10:09 +00:00
if ( $maskconstdeposit && preg_match ( '/_MASK_/' , $maskconstdeposit )) {
2021-02-26 21:04:03 +00:00
$res = dolibarr_set_const ( $db , $maskconstdeposit , $maskdeposit , 'chaine' , 0 , '' , $conf -> entity );
}
2011-11-06 14:12:18 +00:00
2021-02-26 21:04:03 +00:00
if ( ! ( $res > 0 )) {
$error ++ ;
}
2011-09-01 07:32:26 +00:00
2021-02-26 21:04:03 +00:00
if ( ! $error ) {
2020-09-07 08:18:17 +00:00
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
} else {
setEventMessages ( $langs -> trans ( " Error " ), null , 'errors' );
}
2021-02-26 21:04:03 +00:00
} elseif ( $action == 'specimen' ) {
2020-09-07 08:18:17 +00:00
$modele = GETPOST ( 'module' , 'alpha' );
2011-04-17 21:37:35 +00:00
2020-09-07 08:18:17 +00:00
$facture = new Facture ( $db );
$facture -> initAsSpecimen ();
2012-02-29 19:07:17 +00:00
// Search template files
2023-12-04 10:41:14 +00:00
$file = '' ;
$classname = '' ;
2020-01-30 00:48:28 +00:00
$dirmodels = array_merge ( array ( '/' ), ( array ) $conf -> modules_parts [ 'models' ]);
2021-02-26 21:04:03 +00:00
foreach ( $dirmodels as $reldir ) {
2020-09-07 08:18:17 +00:00
$file = dol_buildpath ( $reldir . " core/modules/facture/doc/pdf_ " . $modele . " .modules.php " , 0 );
2021-02-26 21:04:03 +00:00
if ( file_exists ( $file )) {
2020-09-07 08:18:17 +00:00
$classname = " pdf_ " . $modele ;
break ;
}
}
2024-03-12 15:15:53 +00:00
if ( $classname !== '' ) {
2020-09-07 08:18:17 +00:00
require_once $file ;
$module = new $classname ( $db );
2025-04-07 12:55:17 +00:00
/** @var ModelePDFFactures $module */
2024-08-14 17:21:10 +00:00
'@phan-var-force ModelePDFFactures $module' ;
2020-09-07 08:18:17 +00:00
2021-02-26 21:04:03 +00:00
if ( $module -> write_file ( $facture , $langs ) > 0 ) {
2020-09-07 08:18:17 +00:00
header ( " Location: " . DOL_URL_ROOT . " /document.php?modulepart=facture&file=SPECIMEN.pdf " );
return ;
} else {
setEventMessages ( $module -> error , $module -> errors , 'errors' );
dol_syslog ( $module -> error , LOG_ERR );
}
} else {
setEventMessages ( $langs -> trans ( " ErrorModuleNotFound " ), null , 'errors' );
dol_syslog ( $langs -> trans ( " ErrorModuleNotFound " ), LOG_ERR );
}
2021-02-26 21:04:03 +00:00
} elseif ( $action == 'set' ) {
// Activate a model
2013-06-05 09:21:45 +00:00
$ret = addDocumentModel ( $value , $type , $label , $scandir );
2021-02-26 21:04:03 +00:00
} elseif ( $action == 'del' ) {
2013-06-05 09:21:45 +00:00
$ret = delDocumentModel ( $value , $type );
2021-02-26 21:04:03 +00:00
if ( $ret > 0 ) {
2024-09-04 17:44:01 +00:00
if ( getDolGlobalString ( 'FACTURE_ADDON_PDF' ) == ( string ) $value ) {
2021-02-26 21:04:03 +00:00
dolibarr_del_const ( $db , 'FACTURE_ADDON_PDF' , $conf -> entity );
}
2013-06-05 09:21:45 +00:00
}
2021-02-26 21:04:03 +00:00
} elseif ( $action == 'setdoc' ) {
// Set default model
if ( dolibarr_set_const ( $db , " FACTURE_ADDON_PDF " , $value , 'chaine' , 0 , '' , $conf -> entity )) {
2013-06-05 14:24:32 +00:00
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf -> global -> FACTURE_ADDON_PDF = $value ;
}
2015-03-18 20:44:57 +00:00
2013-06-05 14:24:32 +00:00
// On active le modele
$ret = delDocumentModel ( $value , $type );
2021-02-26 21:04:03 +00:00
if ( $ret > 0 ) {
2013-06-05 14:24:32 +00:00
$ret = addDocumentModel ( $value , $type , $label , $scandir );
}
2021-02-26 21:04:03 +00:00
} elseif ( $action == 'setmod' ) {
2024-03-11 12:46:08 +00:00
// TODO Check if numbering module chosen can ba activated by calling method canBeActivated()
2006-04-28 22:54:02 +00:00
2020-09-07 08:18:17 +00:00
dolibarr_set_const ( $db , " FACTURE_ADDON " , $value , 'chaine' , 0 , '' , $conf -> entity );
2021-02-26 21:04:03 +00:00
} elseif ( $action == 'setribchq' ) {
2019-01-27 10:55:16 +00:00
$rib = GETPOST ( 'rib' , 'alpha' );
$chq = GETPOST ( 'chq' , 'alpha' );
2011-11-06 14:12:18 +00:00
2019-01-27 10:55:16 +00:00
$res = dolibarr_set_const ( $db , " FACTURE_RIB_NUMBER " , $rib , 'chaine' , 0 , '' , $conf -> entity );
2020-09-07 08:18:17 +00:00
$res = dolibarr_set_const ( $db , " FACTURE_CHQ_NUMBER " , $chq , 'chaine' , 0 , '' , $conf -> entity );
2011-11-06 14:12:18 +00:00
2021-02-26 21:04:03 +00:00
if ( ! ( $res > 0 )) {
$error ++ ;
}
2011-09-01 07:32:26 +00:00
2021-02-26 21:04:03 +00:00
if ( ! $error ) {
2020-09-07 08:18:17 +00:00
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
} else {
setEventMessages ( $langs -> trans ( " Error " ), null , 'errors' );
}
2021-02-26 21:04:03 +00:00
} elseif ( $action == 'set_FACTURE_DRAFT_WATERMARK' ) {
2019-01-27 10:55:16 +00:00
$draft = GETPOST ( 'FACTURE_DRAFT_WATERMARK' , 'alpha' );
2011-11-06 14:12:18 +00:00
2020-09-07 08:18:17 +00:00
$res = dolibarr_set_const ( $db , " FACTURE_DRAFT_WATERMARK " , trim ( $draft ), 'chaine' , 0 , '' , $conf -> entity );
2011-11-06 14:12:18 +00:00
2021-02-26 21:04:03 +00:00
if ( ! ( $res > 0 )) {
$error ++ ;
}
2011-09-01 07:32:26 +00:00
2021-02-26 21:04:03 +00:00
if ( ! $error ) {
2020-09-07 08:18:17 +00:00
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
} else {
setEventMessages ( $langs -> trans ( " Error " ), null , 'errors' );
}
2021-02-26 21:04:03 +00:00
} elseif ( $action == 'set_INVOICE_FREE_TEXT' ) {
2020-09-17 23:29:17 +00:00
$freetext = GETPOST ( 'INVOICE_FREE_TEXT' , 'restricthtml' ); // No alpha here, we want exact string
2019-07-18 16:19:51 +00:00
2020-09-07 08:18:17 +00:00
$res = dolibarr_set_const ( $db , " INVOICE_FREE_TEXT " , $freetext , 'chaine' , 0 , '' , $conf -> entity );
2019-07-18 16:19:51 +00:00
2021-02-26 21:04:03 +00:00
if ( ! ( $res > 0 )) {
$error ++ ;
}
2019-07-18 16:19:51 +00:00
2021-02-26 21:04:03 +00:00
if ( ! $error ) {
2020-09-07 08:18:17 +00:00
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
} else {
setEventMessages ( $langs -> trans ( " Error " ), null , 'errors' );
}
2021-02-26 21:04:03 +00:00
} elseif ( $action == 'setforcedate' ) {
2019-01-27 10:55:16 +00:00
$forcedate = GETPOST ( 'forcedate' , 'alpha' );
2011-11-06 14:12:18 +00:00
2020-09-07 08:18:17 +00:00
$res = dolibarr_set_const ( $db , " FAC_FORCE_DATE_VALIDATION " , $forcedate , 'chaine' , 0 , '' , $conf -> entity );
2011-11-06 14:12:18 +00:00
2021-02-26 21:04:03 +00:00
if ( ! ( $res > 0 )) {
$error ++ ;
}
2011-09-01 07:32:26 +00:00
2021-02-26 21:04:03 +00:00
if ( ! $error ) {
2020-09-07 08:18:17 +00:00
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
} else {
setEventMessages ( $langs -> trans ( " Error " ), null , 'errors' );
}
2021-02-26 21:04:03 +00:00
} elseif ( $action == 'setDefaultPDFModulesByType' ) {
2020-09-07 08:18:17 +00:00
$invoicetypemodels = GETPOST ( 'invoicetypemodels' );
2021-02-26 21:04:03 +00:00
if ( ! empty ( $invoicetypemodels ) && is_array ( $invoicetypemodels )) {
2020-09-07 08:18:17 +00:00
$error = 0 ;
2021-02-26 21:04:03 +00:00
foreach ( $invoicetypemodels as $type => $value ) {
2020-09-07 08:18:17 +00:00
$res = dolibarr_set_const ( $db , 'FACTURE_ADDON_PDF_' . intval ( $type ), $value , 'chaine' , 0 , '' , $conf -> entity );
2021-02-26 21:04:03 +00:00
if ( ! ( $res > 0 )) {
$error ++ ;
}
2020-09-07 08:18:17 +00:00
}
2021-02-26 21:04:03 +00:00
if ( ! $error ) {
2020-09-07 08:18:17 +00:00
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
} else {
setEventMessages ( $langs -> trans ( " Error " ), null , 'errors' );
}
}
2022-03-01 14:22:46 +00:00
} elseif ( $action == 'set_INVOICE_CHECK_POSTERIOR_DATE' ) {
Fix: GETPOST(...,'int') to GETPOSTINT(...) (#28448)
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: Update spelling exceptions
* Qual: Ignore Phan Notice
2024-02-27 13:05:53 +00:00
$check_posterior_date = GETPOSTINT ( 'INVOICE_CHECK_POSTERIOR_DATE' );
2022-03-01 14:22:46 +00:00
$res = dolibarr_set_const ( $db , 'INVOICE_CHECK_POSTERIOR_DATE' , $check_posterior_date , 'chaine' , 0 , '' , $conf -> entity );
if ( ! ( $res > 0 )) {
$error ++ ;
}
2022-10-28 08:40:43 +00:00
} elseif ( preg_match ( '/set_(.*)/' , $action , $reg )) {
$code = $reg [ 1 ];
$value = ( GETPOST ( $code ) ? GETPOST ( $code ) : 1 );
$res = dolibarr_set_const ( $db , $code , $value , 'chaine' , 0 , '' , $conf -> entity );
if ( ! ( $res > 0 )) {
$error ++ ;
}
if ( $error ) {
setEventMessages ( $langs -> trans ( 'Error' ), null , 'errors' );
} else {
setEventMessages ( $langs -> trans ( 'SetupSaved' ), null , 'mesgs' );
header ( " Location: " . $_SERVER [ " PHP_SELF " ]);
exit ();
}
} elseif ( preg_match ( '/del_(.*)/' , $action , $reg )) {
$code = $reg [ 1 ];
$res = dolibarr_del_const ( $db , $code , $conf -> entity );
if ( ! ( $res > 0 )) {
$error ++ ;
}
if ( $error ) {
setEventMessages ( $langs -> trans ( 'Error' ), null , 'errors' );
} else {
setEventMessages ( $langs -> trans ( 'SetupSaved' ), null , 'mesgs' );
header ( " Location: " . $_SERVER [ " PHP_SELF " ]);
exit ();
}
2018-02-20 14:08:57 +00:00
}
2014-08-11 16:14:40 +00:00
2005-08-22 19:39:55 +00:00
/*
2010-02-24 16:41:19 +00:00
* View
2005-08-22 19:39:55 +00:00
*/
2020-01-30 00:48:28 +00:00
$dirmodels = array_merge ( array ( '/' ), ( array ) $conf -> modules_parts [ 'models' ]);
2012-03-01 01:06:08 +00:00
2025-10-08 10:20:51 +00:00
$title = $langs -> trans ( " BillsSetup " );
llxHeader ( " " , $title , 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura' , '' , 0 , 0 , '' , '' , '' , 'mod-admin page-invoice' );
2006-04-28 22:54:02 +00:00
2020-01-30 00:48:28 +00:00
$form = new Form ( $db );
2006-04-08 22:47:51 +00:00
2006-08-18 23:28:27 +00:00
2025-10-17 00:31:07 +00:00
$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>' ;
2025-08-09 18:44:30 +00:00
2025-10-08 10:20:51 +00:00
print load_fiche_titre ( $title , $linkback , 'title_setup' );
2006-08-18 23:28:27 +00:00
2014-12-04 12:20:56 +00:00
$head = invoice_admin_prepare_head ();
2025-05-07 09:18:37 +00:00
print dol_get_fiche_head ( $head , 'general' , $langs -> trans ( " Invoices " ), - 1 , 'bill' );
2009-08-02 16:16:15 +00:00
2025-04-05 14:10:07 +00:00
// Numbering module
2009-08-02 16:16:15 +00:00
2019-01-27 10:55:16 +00:00
print load_fiche_titre ( $langs -> trans ( " BillsNumberingModule " ), '' , '' );
2009-08-02 16:16:15 +00:00
2021-06-12 23:27:04 +00:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 20:24:41 +00:00
print '<table class="noborder centpercent">' ;
2004-07-25 13:12:15 +00:00
print '<tr class="liste_titre">' ;
2004-07-25 15:31:16 +00:00
print '<td>' . $langs -> trans ( " Name " ) . '</td>' ;
print '<td>' . $langs -> trans ( " Description " ) . '</td>' ;
2013-04-24 23:13:13 +00:00
print '<td class="nowrap">' . $langs -> trans ( " Example " ) . '</td>' ;
2019-03-20 08:55:34 +00:00
print '<td class="center" width="60">' . $langs -> trans ( " Status " ) . '</td>' ;
print '<td class="center" width="16">' . $langs -> trans ( " ShortInfo " ) . '</td>' ;
2005-08-22 19:39:55 +00:00
print '</tr>' . " \n " ;
2003-03-11 15:27:34 +00:00
clearstatcache ();
2025-04-05 14:10:07 +00:00
$arrayofmodules = array ();
2021-02-26 21:04:03 +00:00
foreach ( $dirmodels as $reldir ) {
2012-03-01 01:06:08 +00:00
$dir = dol_buildpath ( $reldir . " core/modules/facture/ " );
2021-02-26 21:04:03 +00:00
if ( is_dir ( $dir )) {
2020-09-07 08:18:17 +00:00
$handle = opendir ( $dir );
2021-02-26 21:04:03 +00:00
if ( is_resource ( $handle )) {
while (( $file = readdir ( $handle )) !== false ) {
2023-12-26 21:32:46 +00:00
if ( ! is_dir ( $dir . $file ) || ( substr ( $file , 0 , 1 ) != '.' && substr ( $file , 0 , 3 ) != 'CVS' )) {
2020-09-07 08:18:17 +00:00
$filebis = $file ;
$classname = preg_replace ( '/\.php$/' , '' , $file );
// For compatibility
2021-02-26 21:04:03 +00:00
if ( ! is_file ( $dir . $filebis )) {
2020-09-07 08:18:17 +00:00
$filebis = $file . " / " . $file . " .modules.php " ;
$classname = " mod_facture_ " . $file ;
}
// Check if there is a filter on country
2025-09-03 12:41:23 +00:00
$reg = array ();
2020-09-07 08:18:17 +00:00
preg_match ( '/\-(.*)_(.*)$/' , $classname , $reg );
2021-02-26 21:04:03 +00:00
if ( ! empty ( $reg [ 2 ]) && $reg [ 2 ] != strtoupper ( $mysoc -> country_code )) {
continue ;
}
2020-09-07 08:18:17 +00:00
$classname = preg_replace ( '/\-.*$/' , '' , $classname );
2021-02-26 21:04:03 +00:00
if ( ! class_exists ( $classname ) && is_readable ( $dir . $filebis ) && ( preg_match ( '/mod_/' , $filebis ) || preg_match ( '/mod_/' , $classname )) && substr ( $filebis , dol_strlen ( $filebis ) - 3 , 3 ) == 'php' ) {
2020-09-07 08:18:17 +00:00
// Charging the numbering class
require_once $dir . $filebis ;
$module = new $classname ( $db );
2025-04-07 12:55:17 +00:00
/** @var ModeleNumRefFactures $module */
2025-04-05 14:30:22 +00:00
'@phan-var-force ModeleNumRefFactures $module' ;
2020-09-07 08:18:17 +00:00
2025-04-05 14:10:07 +00:00
$arrayofmodules [] = $module ;
2020-09-07 08:18:17 +00:00
}
}
}
closedir ( $handle );
}
}
2003-03-11 15:27:34 +00:00
}
2025-04-05 14:41:45 +00:00
$arrayofmodules = dol_sort_array ( $arrayofmodules , 'position' );
2025-08-14 17:27:14 +00:00
/** @var ModeleNumRefFactures[] $arrayofmodules */
'@phan-var-force ModeleNumRefFactures[] $arrayofmodules' ;
2025-04-05 14:41:45 +00:00
2025-04-05 14:10:07 +00:00
foreach ( $arrayofmodules as $module ) {
2025-04-05 14:41:45 +00:00
$file = strtolower ( $module -> getName ( $langs ));
if ( ! preg_match ( '/^mod_facture_/' , $file )) {
$file = 'mod_facture_' . $file ;
}
2025-04-05 14:10:07 +00:00
// Show modules according to features level
if ( $module -> version == 'development' && getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) < 2 ) {
continue ;
}
if ( $module -> version == 'experimental' && getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) < 1 ) {
continue ;
}
2025-04-05 14:42:55 +00:00
if ( $module -> version == 'dolibarr_deprecated' && getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) >= 0 && getDolGlobalString ( 'FACTURE_ADDON' ) != $file ) {
2025-04-05 14:10:07 +00:00
continue ;
}
if ( $module -> isEnabled ()) {
print '<tr class="oddeven"><td width="100">' ;
print preg_replace ( '/\-.*$/' , '' , preg_replace ( '/mod_facture_/' , '' , $module -> getName ( $langs )));
print " </td><td> \n " ;
print $module -> info ( $langs );
print '</td>' ;
// Show example of numbering module
print '<td class="nowrap">' ;
$tmp = $module -> getExample ();
if ( preg_match ( '/^Error/' , $tmp )) {
$langs -> load ( " errors " );
print '<div class="error">' . $langs -> trans ( $tmp ) . '</div>' ;
} elseif ( $tmp == 'NotConfigured' ) {
print '<span class="opacitymedium">' . $langs -> trans ( $tmp ) . '</span>' ;
} else {
print $tmp ;
}
print '</td>' . " \n " ;
print '<td class="center">' ;
if ( getDolGlobalString ( 'FACTURE_ADDON' ) == $file || getDolGlobalString ( 'FACTURE_ADDON' ) . '.php' == $file ) {
print img_picto ( $langs -> trans ( " Activated " ), 'switch_on' );
} else {
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>' ;
}
print '</td>' ;
$facture = new Facture ( $db );
$facture -> initAsSpecimen ();
$htmltooltip = '' ;
// Example for standard invoice
$htmltooltip .= '' . $langs -> trans ( " Version " ) . ': <b>' . $module -> getVersion () . '</b><br>' ;
$facture -> type = 0 ;
$nextval = $module -> getNextValue ( $mysoc , $facture );
if ( " $nextval " != $langs -> trans ( " NotAvailable " )) { // Keep " on nextval
$htmltooltip .= $langs -> trans ( " NextValueForInvoices " ) . ': ' ;
if ( $nextval ) {
if ( preg_match ( '/^Error/' , $nextval ) || $nextval == 'NotConfigured' ) {
$nextval = $langs -> trans ( $nextval );
}
$htmltooltip .= $nextval . '<br>' ;
} else {
$htmltooltip .= $langs -> trans ( $module -> error ) . '<br>' ;
}
}
// Example for replacement invoice
if ( ! getDolGlobalString ( 'INVOICE_DISABLE_REPLACEMENT' )) {
$facture -> type = 1 ;
$nextval = $module -> getNextValue ( $mysoc , $facture );
if ( " $nextval " != $langs -> trans ( " NotAvailable " )) { // Keep " on nextval
$htmltooltip .= $langs -> trans ( " NextValueForReplacements " ) . ': ' ;
if ( $nextval ) {
if ( preg_match ( '/^Error/' , $nextval ) || $nextval == 'NotConfigured' ) {
$nextval = $langs -> trans ( $nextval );
}
$htmltooltip .= $nextval . '<br>' ;
} else {
$htmltooltip .= $langs -> trans ( $module -> error ) . '<br>' ;
}
}
}
// Example for credit invoice
$facture -> type = 2 ;
$nextval = $module -> getNextValue ( $mysoc , $facture );
if ( " $nextval " != $langs -> trans ( " NotAvailable " )) { // Keep " on nextval
$htmltooltip .= $langs -> trans ( " NextValueForCreditNotes " ) . ': ' ;
if ( $nextval ) {
if ( preg_match ( '/^Error/' , $nextval ) || $nextval == 'NotConfigured' ) {
$nextval = $langs -> trans ( $nextval );
}
$htmltooltip .= $nextval . '<br>' ;
} else {
$htmltooltip .= $langs -> trans ( $module -> error ) . '<br>' ;
}
}
// Example for deposit invoice
$facture -> type = 3 ;
$nextval = $module -> getNextValue ( $mysoc , $facture );
if ( " $nextval " != $langs -> trans ( " NotAvailable " )) { // Keep " on nextval
$htmltooltip .= $langs -> trans ( " NextValueForDeposit " ) . ': ' ;
if ( $nextval ) {
if ( preg_match ( '/^Error/' , $nextval ) || $nextval == 'NotConfigured' ) {
$nextval = $langs -> trans ( $nextval );
}
$htmltooltip .= $nextval ;
} else {
$htmltooltip .= $langs -> trans ( $module -> error );
}
}
print '<td class="center">' ;
print $form -> textwithpicto ( '' , $htmltooltip , 1 , 'info' );
if ( getDolGlobalString ( 'FACTURE_ADDON' ) . '.php' == $file ) { // If module is the one used, we show existing errors
if ( ! empty ( $module -> error )) {
dol_htmloutput_mesg ( $module -> error , array (), 'error' , 1 );
}
}
print '</td>' ;
print " </tr> \n " ;
}
}
2003-03-11 15:27:34 +00:00
print '</table>' ;
2021-06-12 23:27:04 +00:00
print '</div>' ;
2004-02-27 22:53:39 +00:00
2004-07-26 13:42:44 +00:00
2003-04-13 14:25:45 +00:00
/*
2010-10-27 20:53:23 +00:00
* Document templates generators
2003-04-13 14:25:45 +00:00
*/
2024-06-26 15:39:01 +00:00
2004-02-27 22:53:39 +00:00
print '<br>' ;
2019-01-27 10:55:16 +00:00
print load_fiche_titre ( $langs -> trans ( " BillsPDFModules " ), '' , '' );
2006-04-28 22:54:02 +00:00
2010-10-27 20:53:23 +00:00
// Load array def with activated templates
2020-01-30 00:48:28 +00:00
$type = 'invoice' ;
2006-04-28 22:54:02 +00:00
$def = array ();
$sql = " SELECT nom " ;
2020-01-30 00:48:28 +00:00
$sql .= " FROM " . MAIN_DB_PREFIX . " document_model " ;
2020-09-19 21:11:38 +00:00
$sql .= " WHERE type = ' " . $db -> escape ( $type ) . " ' " ;
2025-10-02 08:56:12 +00:00
$sql .= " AND entity = " . (( int ) $conf -> entity );
2020-01-30 00:48:28 +00:00
$resql = $db -> query ( $sql );
2021-02-26 21:04:03 +00:00
if ( $resql ) {
2020-09-07 08:18:17 +00:00
$i = 0 ;
$num_rows = $db -> num_rows ( $resql );
2021-02-26 21:04:03 +00:00
while ( $i < $num_rows ) {
2020-09-07 08:18:17 +00:00
$array = $db -> fetch_array ( $resql );
2024-04-27 20:01:34 +00:00
if ( is_array ( $array )) {
array_push ( $def , $array [ 0 ]);
}
2020-09-07 08:18:17 +00:00
$i ++ ;
}
2020-05-21 07:35:30 +00:00
} else {
2020-09-07 08:18:17 +00:00
dol_print_error ( $db );
2006-04-28 22:54:02 +00:00
}
2003-04-13 14:25:45 +00:00
2021-06-12 23:27:04 +00:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 20:24:41 +00:00
print '<table class="noborder centpercent">' ;
2004-02-15 16:49:08 +00:00
print '<tr class="liste_titre">' ;
2004-07-25 15:31:16 +00:00
print '<td>' . $langs -> trans ( " Name " ) . '</td>' ;
print '<td>' . $langs -> trans ( " Description " ) . '</td>' ;
2019-03-20 08:55:34 +00:00
print '<td class="center" width="60">' . $langs -> trans ( " Status " ) . '</td>' ;
print '<td class="center" width="60">' . $langs -> trans ( " Default " ) . '</td>' ;
print '<td class="center" width="32">' . $langs -> trans ( " ShortInfo " ) . '</td>' ;
print '<td class="center" width="32">' . $langs -> trans ( " Preview " ) . '</td>' ;
2004-02-15 16:49:08 +00:00
print " </tr> \n " ;
2003-04-13 14:25:45 +00:00
clearstatcache ();
2018-02-20 14:08:57 +00:00
$activatedModels = array ();
2018-05-16 09:49:37 +00:00
2021-02-26 21:04:03 +00:00
foreach ( $dirmodels as $reldir ) {
foreach ( array ( '' , '/doc' ) as $valdir ) {
2020-09-07 08:18:17 +00:00
$realpath = $reldir . " core/modules/facture " . $valdir ;
$dir = dol_buildpath ( $realpath );
2021-02-26 21:04:03 +00:00
if ( is_dir ( $dir )) {
2020-09-07 08:18:17 +00:00
$handle = opendir ( $dir );
2021-02-26 21:04:03 +00:00
if ( is_resource ( $handle )) {
2024-03-09 01:43:57 +00:00
$filelist = array ();
2021-02-26 21:04:03 +00:00
while (( $file = readdir ( $handle )) !== false ) {
2020-09-07 08:18:17 +00:00
$filelist [] = $file ;
}
closedir ( $handle );
arsort ( $filelist );
2021-02-26 21:04:03 +00:00
foreach ( $filelist as $file ) {
if ( preg_match ( '/\.modules\.php$/i' , $file ) && preg_match ( '/^(pdf_|doc_)/' , $file )) {
if ( file_exists ( $dir . '/' . $file )) {
2020-09-07 08:18:17 +00:00
$name = substr ( $file , 4 , dol_strlen ( $file ) - 16 );
$classname = substr ( $file , 0 , dol_strlen ( $file ) - 12 );
require_once $dir . '/' . $file ;
$module = new $classname ( $db );
2024-08-17 17:32:52 +00:00
'@phan-var-force ModelePDFFactures $module' ;
2025-08-14 17:27:14 +00:00
/** @var ModelePDFFactures $module */
2024-08-17 17:32:52 +00:00
2020-09-07 08:18:17 +00:00
$modulequalified = 1 ;
2023-11-27 11:24:18 +00:00
if ( $module -> version == 'development' && getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) < 2 ) {
2021-02-26 21:04:03 +00:00
$modulequalified = 0 ;
}
2023-11-27 11:24:18 +00:00
if ( $module -> version == 'experimental' && getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) < 1 ) {
2021-02-26 21:04:03 +00:00
$modulequalified = 0 ;
}
2024-06-26 15:39:01 +00:00
if ( $module -> version == 'disabled' ) {
$modulequalified = 0 ;
}
2020-09-07 08:18:17 +00:00
2021-02-26 21:04:03 +00:00
if ( $modulequalified ) {
2020-09-07 08:18:17 +00:00
print '<tr class="oddeven"><td width="100">' ;
2023-12-04 10:41:14 +00:00
print ( empty ( $module -> name ) ? $name : $module -> name );
2020-09-07 08:18:17 +00:00
print " </td><td> \n " ;
2021-02-26 21:04:03 +00:00
if ( method_exists ( $module , 'info' )) {
2024-08-17 17:32:52 +00:00
print $module -> info ( $langs ); // @phan-suppress-current-line PhanUndeclaredMethod
2021-02-26 21:04:03 +00:00
} else {
print $module -> description ;
}
2020-09-07 08:18:17 +00:00
print '</td>' ;
// Active
2021-02-26 21:04:03 +00:00
if ( in_array ( $name , $def )) {
2020-09-07 08:18:17 +00:00
print '<td class="center">' . " \n " ;
2021-09-19 12:41:46 +00:00
print '<a class="reposition" href="' . $_SERVER [ " PHP_SELF " ] . '?action=del&token=' . newToken () . '&value=' . urlencode ( $name ) . '">' ;
2020-09-07 08:18:17 +00:00
print img_picto ( $langs -> trans ( " Enabled " ), 'switch_on' );
print '</a>' ;
print '</td>' ;
} else {
print '<td class="center">' . " \n " ;
2021-09-19 12:41:46 +00:00
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>' ;
2020-09-07 08:18:17 +00:00
print " </td> " ;
}
2024-01-11 08:59:52 +00:00
// Default
2020-09-07 08:18:17 +00:00
print '<td class="center">' ;
2024-09-04 17:44:01 +00:00
if ( getDolGlobalString ( 'FACTURE_ADDON_PDF' ) == ( string ) $name ) {
2020-09-07 08:18:17 +00:00
print img_picto ( $langs -> trans ( " Default " ), 'on' );
} else {
2021-09-19 16:03:38 +00:00
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>' ;
2020-09-07 08:18:17 +00:00
}
print '</td>' ;
// Info
$htmltooltip = '' . $langs -> trans ( " Name " ) . ': ' . $module -> name ;
$htmltooltip .= '<br>' . $langs -> trans ( " Type " ) . ': ' . ( $module -> type ? $module -> type : $langs -> trans ( " Unknown " ));
2021-02-26 21:04:03 +00:00
if ( $module -> type == 'pdf' ) {
2020-09-07 08:18:17 +00:00
$htmltooltip .= '<br>' . $langs -> trans ( " Width " ) . '/' . $langs -> trans ( " Height " ) . ': ' . $module -> page_largeur . '/' . $module -> page_hauteur ;
}
$htmltooltip .= '<br>' . $langs -> trans ( " Path " ) . ': ' . preg_replace ( '/^\//' , '' , $realpath ) . '/' . $file ;
$htmltooltip .= '<br><br><u>' . $langs -> trans ( " FeaturesSupported " ) . ':</u>' ;
$htmltooltip .= '<br>' . $langs -> trans ( " Logo " ) . ': ' . yn ( $module -> option_logo , 1 , 1 );
$htmltooltip .= '<br>' . $langs -> trans ( " PaymentMode " ) . ': ' . yn ( $module -> option_modereg , 1 , 1 );
$htmltooltip .= '<br>' . $langs -> trans ( " PaymentConditions " ) . ': ' . yn ( $module -> option_condreg , 1 , 1 );
$htmltooltip .= '<br>' . $langs -> trans ( " Discounts " ) . ': ' . yn ( $module -> option_escompte , 1 , 1 );
$htmltooltip .= '<br>' . $langs -> trans ( " CreditNote " ) . ': ' . yn ( $module -> option_credit_note , 1 , 1 );
$htmltooltip .= '<br>' . $langs -> trans ( " MultiLanguage " ) . ': ' . yn ( $module -> option_multilang , 1 , 1 );
$htmltooltip .= '<br>' . $langs -> trans ( " WatermarkOnDraftInvoices " ) . ': ' . yn ( $module -> option_draft_watermark , 1 , 1 );
print '<td class="center">' ;
2025-02-08 00:49:29 +00:00
print $form -> textwithpicto ( '' , $htmltooltip , 1 , 'info' );
2020-09-07 08:18:17 +00:00
print '</td>' ;
// Preview
print '<td class="center">' ;
2021-02-26 21:04:03 +00:00
if ( $module -> type == 'pdf' ) {
2026-06-25 17:01:16 +00:00
print '<a href="' . dolBuildUrl ( $_SERVER [ " PHP_SELF " ], [ 'action' => 'specimen' , 'module' => $name ], true ) . '">' . img_object ( $langs -> trans ( " Preview " ), 'pdf' ) . '</a>' ;
2020-09-07 08:18:17 +00:00
} else {
2025-01-08 16:45:28 +00:00
print img_object ( $langs -> transnoentitiesnoconv ( " PreviewNotAvailable " ), 'generic' );
2020-09-07 08:18:17 +00:00
}
print '</td>' ;
print " </tr> \n " ;
}
}
}
}
}
}
}
2003-04-13 14:25:45 +00:00
}
print '</table>' ;
2021-06-12 23:27:04 +00:00
print '</div>' ;
2003-04-13 14:25:45 +00:00
2023-10-24 15:00:13 +00:00
if ( getDolGlobalString ( 'INVOICE_USE_DEFAULT_DOCUMENT' )) { // Hidden conf
2020-09-07 08:18:17 +00:00
/*
2021-02-26 21:04:03 +00:00
* Document templates generators
*/
2020-09-07 08:18:17 +00:00
print '<br>' ;
print load_fiche_titre ( $langs -> trans ( " BillsPDFModulesAccordindToInvoiceType " ), '' , '' );
2021-06-12 23:27:04 +00:00
2020-09-07 08:18:17 +00:00
print '<form action="' . $_SERVER [ " PHP_SELF " ] . '#default-pdf-modules-by-type-table" method="POST">' ;
print '<input type="hidden" name="token" value="' . newToken () . '" />' ;
print '<input type="hidden" name="action" value="setDefaultPDFModulesByType" >' ;
2024-03-13 14:54:15 +00:00
print '<input type="hidden" name="page_y" value="" />' ;
2021-06-12 23:27:04 +00:00
print '<div class="div-table-responsive-no-min">' ;
2020-09-07 08:18:17 +00:00
print '<table id="default-pdf-modules-by-type-table" class="noborder centpercent">' ;
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> trans ( " Type " ) . '</td>' ;
print '<td>' . $langs -> trans ( " Name " ) . '</td>' ;
2024-03-13 14:54:15 +00:00
print '<td class="right"><input type="submit" class="button button-edit reposition" value="' . $langs -> trans ( " Modify " ) . '"></td>' ;
2020-09-07 08:18:17 +00:00
print " </tr> \n " ;
$listtype = array (
2024-03-12 15:15:53 +00:00
Facture :: TYPE_STANDARD => $langs -> trans ( " InvoiceStandard " ),
Facture :: TYPE_REPLACEMENT => $langs -> trans ( " InvoiceReplacement " ),
Facture :: TYPE_CREDIT_NOTE => $langs -> trans ( " InvoiceAvoir " ),
Facture :: TYPE_DEPOSIT => $langs -> trans ( " InvoiceDeposit " ),
2020-09-07 08:18:17 +00:00
);
2023-03-03 11:08:12 +00:00
if ( getDolGlobalInt ( 'INVOICE_USE_SITUATION' )) {
2020-09-07 08:18:17 +00:00
$listtype [ Facture :: TYPE_SITUATION ] = $langs -> trans ( " InvoiceSituation " );
}
2021-02-26 21:04:03 +00:00
foreach ( $listtype as $type => $trans ) {
2020-09-07 08:18:17 +00:00
$thisTypeConfName = 'FACTURE_ADDON_PDF_' . $type ;
2023-08-05 13:44:28 +00:00
$current = getDolGlobalString ( $thisTypeConfName , getDolGlobalString ( 'FACTURE_ADDON_PDF' ));
2020-09-07 08:18:17 +00:00
print '<tr >' ;
print '<td>' . $trans . '</td>' ;
print '<td colspan="2" >' . $form -> selectarray ( 'invoicetypemodels[' . $type . ']' , ModelePDFFactures :: liste_modeles ( $db ), $current , 0 , 0 , 0 ) . '</td>' ;
print " </tr> \n " ;
}
print '</table>' ;
2021-06-12 23:27:04 +00:00
print '</div>' ;
2020-09-07 08:18:17 +00:00
print " </form> " ;
2018-02-20 14:08:57 +00:00
}
2003-03-11 15:27:34 +00:00
2003-05-13 19:08:04 +00:00
/*
2020-04-16 13:40:16 +00:00
* Payment modes
2003-05-13 19:08:04 +00:00
*/
2004-02-27 22:53:39 +00:00
print '<br>' ;
2019-01-27 10:55:16 +00:00
print load_fiche_titre ( $langs -> trans ( " SuggestedPaymentModesIfNotDefinedInInvoice " ), '' , '' );
2006-05-05 20:01:58 +00:00
2011-10-25 09:24:06 +00:00
print '<form action="' . $_SERVER [ " PHP_SELF " ] . '" method="POST">' ;
2019-12-18 22:12:31 +00:00
print '<input type="hidden" name="token" value="' . newToken () . '" />' ;
2024-03-13 14:54:15 +00:00
print '<input type="hidden" name="page_y" value="" />' ;
2003-05-13 19:08:04 +00:00
2021-06-12 23:27:04 +00:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 20:24:41 +00:00
print '<table class="noborder centpercent">' ;
2004-02-02 22:03:12 +00:00
print '<tr class="liste_titre">' ;
2010-06-15 21:52:41 +00:00
print '<td>' ;
print '<input type="hidden" name="action" value="setribchq">' ;
print $langs -> trans ( " PaymentMode " ) . '</td>' ;
2025-10-13 18:25:03 +00:00
print '<td class="right"></td>' ;
2004-02-02 22:03:12 +00:00
print " </tr> \n " ;
2017-04-14 09:22:48 +00:00
print '<tr class="oddeven">' ;
2008-04-03 14:53:14 +00:00
print " <td> " . $langs -> trans ( " SuggestPaymentByRIBOnAccount " ) . " </td> " ;
2004-02-22 20:50:22 +00:00
print " <td> " ;
2024-02-27 14:30:37 +00:00
if ( isModEnabled ( 'bank' )) {
2024-03-13 14:54:15 +00:00
$sql = " SELECT rowid, label, clos " ;
2020-09-07 08:18:17 +00:00
$sql .= " FROM " . MAIN_DB_PREFIX . " bank_account " ;
2024-03-13 14:54:15 +00:00
$sql .= " WHERE courant = 1 " ;
2020-09-07 08:18:17 +00:00
$sql .= " AND entity IN ( " . getEntity ( 'bank_account' ) . " ) " ;
$resql = $db -> query ( $sql );
2021-02-26 21:04:03 +00:00
if ( $resql ) {
2020-09-07 08:18:17 +00:00
$num = $db -> num_rows ( $resql );
$i = 0 ;
2021-02-26 21:04:03 +00:00
if ( $num > 0 ) {
2020-09-07 08:18:17 +00:00
print '<select name="rib" class="flat" id="rib">' ;
print '<option value="0">' . $langs -> trans ( " DoNotSuggestPaymentMode " ) . '</option>' ;
2021-02-26 21:04:03 +00:00
while ( $i < $num ) {
2024-03-13 14:54:15 +00:00
$obj = $db -> fetch_object ( $resql );
2020-09-07 08:18:17 +00:00
2024-03-13 14:54:15 +00:00
print '<option value="' . $obj -> rowid . '"' ;
print getDolGlobalString ( 'FACTURE_RIB_NUMBER' ) == $obj -> rowid ? ' selected' : '' ;
if ( ! empty ( $obj -> clos )) {
print ' disabled' ;
}
print '>' . dol_escape_htmltag ( $obj -> label ) . '</option>' ;
2020-09-07 08:18:17 +00:00
$i ++ ;
}
print " </select> " ;
2024-03-13 14:54:15 +00:00
print ajax_combobox ( " rib " );
2020-09-07 08:18:17 +00:00
} else {
print '<span class="opacitymedium">' . $langs -> trans ( " NoActiveBankAccountDefined " ) . '</span>' ;
}
}
2020-05-21 07:35:30 +00:00
} else {
2020-09-07 08:18:17 +00:00
print $langs -> trans ( " BankModuleNotActive " );
2003-05-13 19:08:04 +00:00
}
2004-02-22 20:50:22 +00:00
print " </td></tr> " ;
2017-04-14 09:22:48 +00:00
2023-02-08 11:18:46 +00:00
$FACTURE_CHQ_NUMBER = getDolGlobalInt ( 'FACTURE_CHQ_NUMBER' );
2017-04-14 09:22:48 +00:00
print '<tr class="oddeven">' ;
2008-04-03 14:53:14 +00:00
print " <td> " . $langs -> trans ( " SuggestPaymentByChequeToAddress " ) . " </td> " ;
2004-02-22 20:50:22 +00:00
print " <td> " ;
2011-08-16 09:57:02 +00:00
print '<select class="flat" name="chq" id="chq">' ;
2006-05-05 20:01:58 +00:00
print '<option value="0">' . $langs -> trans ( " DoNotSuggestPaymentMode " ) . '</option>' ;
2023-02-08 11:18:46 +00:00
print '<option value="-1"' . ( $FACTURE_CHQ_NUMBER == - 1 ? ' selected' : '' ) . '>' . $langs -> trans ( " MenuCompanySetup " ) . ' (' . ( $mysoc -> name ? $mysoc -> name : $langs -> trans ( " NotDefined " )) . ')</option>' ;
2006-05-05 20:01:58 +00:00
2005-08-13 19:32:59 +00:00
$sql = " SELECT rowid, label " ;
2020-01-30 00:48:28 +00:00
$sql .= " FROM " . MAIN_DB_PREFIX . " bank_account " ;
$sql .= " WHERE clos = 0 " ;
$sql .= " AND courant = 1 " ;
$sql .= " AND entity IN ( " . getEntity ( 'bank_account' ) . " ) " ;
2018-04-22 17:27:37 +00:00
2020-01-30 00:48:28 +00:00
$resql = $db -> query ( $sql );
2021-02-26 21:04:03 +00:00
if ( $resql ) {
2020-09-07 08:18:17 +00:00
$num = $db -> num_rows ( $resql );
$i = 0 ;
2021-02-26 21:04:03 +00:00
while ( $i < $num ) {
2020-09-07 08:18:17 +00:00
$row = $db -> fetch_row ( $resql );
print '<option value="' . $row [ 0 ] . '"' ;
2023-02-08 11:18:46 +00:00
print $FACTURE_CHQ_NUMBER == $row [ 0 ] ? ' selected' : '' ;
2020-09-07 08:18:17 +00:00
print '>' . $langs -> trans ( " OwnerOfBankAccount " , $row [ 1 ]) . '</option>' ;
$i ++ ;
}
2004-02-02 22:03:12 +00:00
}
2006-05-05 20:01:58 +00:00
print " </select> " ;
2024-09-05 14:05:37 +00:00
print ajax_combobox ( " chq " , array (), 0 , 0 , 'resolve' , '-2' );
2024-03-13 14:54:15 +00:00
2004-02-22 20:50:22 +00:00
print " </td></tr> " ;
2024-10-13 23:39:03 +00:00
// Structured communication
// Specific to Belgium - See core/lib/functions_be.lib.php
if ( $mysoc -> country_code == 'BE' ) {
print '<tr class="oddeven"><td>' . $langs -> trans ( " InvoicePaymentManageStructuredCommunication " ) . ' ' ;
print $form -> textwithpicto ( '' , $langs -> trans ( " InvoicePaymentManageStructuredCommunicationHelp " ), 1 , 'help' ) . '</td>' ;
print '<td class="left" colspan="2">' ;
print ajax_constantonoff ( 'INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION' );
print '</td></tr>' ;
}
2004-02-02 22:03:12 +00:00
print " </table> " ;
2021-06-12 23:27:04 +00:00
print '</div>' ;
2025-10-13 18:25:03 +00:00
print '<center>' ;
print '<input type="submit" class="button button-edit reposition" value="' . $langs -> trans ( " Modify " ) . '">' ;
print '</center>' ;
2006-05-05 20:01:58 +00:00
print " </form> " ;
2003-06-22 12:16:11 +00:00
2004-02-08 17:00:18 +00:00
2005-03-20 01:55:37 +00:00
print " <br> " ;
2019-01-27 10:55:16 +00:00
print load_fiche_titre ( $langs -> trans ( " OtherOptions " ), '' , '' );
2005-06-19 11:58:07 +00:00
2021-06-12 23:27:04 +00:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 20:24:41 +00:00
print '<table class="noborder centpercent">' ;
2005-06-19 11:58:07 +00:00
print '<tr class="liste_titre">' ;
2022-12-16 13:41:45 +00:00
print '<td>' . $langs -> trans ( " Parameters " ) . '</td>' ;
2025-10-13 18:25:03 +00:00
print '<td class="center"></td>' ;
2005-06-19 11:58:07 +00:00
print '<td width="80"> </td>' ;
print " </tr> \n " ;
2020-01-30 00:48:28 +00:00
$substitutionarray = pdf_getSubstitutionArray ( $langs , null , null , 2 );
$substitutionarray [ '__(AnyTranslationKey)__' ] = $langs -> trans ( " Translation " );
2019-07-18 16:19:51 +00:00
$htmltext = '<i>' . $langs -> trans ( " AvailableVariables " ) . ':<br>' ;
2021-02-26 21:04:03 +00:00
foreach ( $substitutionarray as $key => $val ) {
$htmltext .= $key . '<br>' ;
}
2020-01-30 00:48:28 +00:00
$htmltext .= '</i>' ;
2019-07-18 16:19:51 +00:00
print '<form action="' . $_SERVER [ " PHP_SELF " ] . '" method="POST">' ;
2019-12-18 22:12:31 +00:00
print '<input type="hidden" name="token" value="' . newToken () . '" />' ;
2019-07-18 16:19:51 +00:00
print '<input type="hidden" name="action" value="set_INVOICE_FREE_TEXT" />' ;
2024-03-13 14:54:15 +00:00
print '<input type="hidden" name="page_y" value="" />' ;
2019-07-18 16:19:51 +00:00
print '<tr class="oddeven"><td colspan="2">' ;
print $form -> textwithpicto ( $langs -> trans ( " FreeLegalTextOnInvoices " ), $langs -> trans ( " AddCRIfTooLong " ) . '<br><br>' . $htmltext , 1 , 'help' , '' , 0 , 2 , 'freetexttooltip' ) . '<br>' ;
2020-01-30 00:48:28 +00:00
$variablename = 'INVOICE_FREE_TEXT' ;
2023-10-24 15:00:13 +00:00
if ( ! getDolGlobalString ( 'PDF_ALLOW_HTML_FOR_FREE_TEXT' )) {
2022-06-21 18:25:25 +00:00
print '<textarea name="' . $variablename . '" class="flat" cols="120">' . getDolGlobalString ( $variablename ) . '</textarea>' ;
2020-05-21 07:35:30 +00:00
} else {
2020-09-07 08:18:17 +00:00
include_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php' ;
2022-06-21 21:39:31 +00:00
$doleditor = new DolEditor ( $variablename , getDolGlobalString ( $variablename ), '' , 80 , 'dolibarr_notes' );
2020-09-07 08:18:17 +00:00
print $doleditor -> Create ();
2019-07-18 16:19:51 +00:00
}
print '</td><td class="right">' ;
2024-03-13 14:54:15 +00:00
print '<input type="submit" class="button button-edit reposition" value="' . $langs -> trans ( " Modify " ) . '" />' ;
2019-07-18 16:19:51 +00:00
print " </td></tr> \n " ;
print '</form>' ;
2017-04-14 09:22:48 +00:00
2011-10-25 09:24:06 +00:00
print '<form action="' . $_SERVER [ " PHP_SELF " ] . '" method="POST">' ;
2019-12-18 22:12:31 +00:00
print '<input type="hidden" name="token" value="' . newToken () . '" />' ;
2011-10-25 09:24:06 +00:00
print '<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />' ;
2024-03-13 14:54:15 +00:00
print '<input type="hidden" name="page_y" value="" />' ;
2017-04-14 11:02:29 +00:00
print '<tr class="oddeven"><td>' ;
2017-10-31 10:17:44 +00:00
print $form -> textwithpicto ( $langs -> trans ( " WatermarkOnDraftBill " ), $htmltext , 1 , 'help' , '' , 0 , 2 , 'watermarktooltip' ) . '<br>' ;
2017-04-17 11:02:40 +00:00
print '</td>' ;
2022-07-24 16:59:07 +00:00
print '<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="' . dol_escape_htmltag ( getDolGlobalString ( 'FACTURE_DRAFT_WATERMARK' )) . '">' ;
2019-01-22 10:46:12 +00:00
print '</td><td class="right">' ;
2024-03-13 14:54:15 +00:00
print '<input type="submit" class="button button-edit reposition" value="' . $langs -> trans ( " Modify " ) . '" />' ;
2008-06-09 18:55:24 +00:00
print " </td></tr> \n " ;
print '</form>' ;
2022-03-01 14:22:46 +00:00
2025-10-13 18:25:03 +00:00
// Force date validation
print '<form action="' . $_SERVER [ " PHP_SELF " ] . '" method="POST">' ;
print '<input type="hidden" name="token" value="' . newToken () . '" />' ;
print '<input type="hidden" name="action" value="setforcedate" />' ;
print '<input type="hidden" name="page_y" value="" />' ;
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " ForceInvoiceDate " );
print '</td><td>' ;
print $form -> selectyesno ( " forcedate " , getDolGlobalInt ( 'FAC_FORCE_DATE_VALIDATION' , 0 ), 1 );
print '</td><td class="right">' ;
print '<input type="submit" class="button button-edit reposition" value="' . $langs -> trans ( " Modify " ) . '" />' ;
print " </td></tr> \n " ;
print '</form>' ;
2022-03-01 14:22:46 +00:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " InvoiceCheckPosteriorDate " ) . ' ' ;
print $form -> textwithpicto ( '' , $langs -> trans ( " InvoiceCheckPosteriorDateHelp " ), 1 , 'help' ) . '</td>' ;
2022-10-28 08:40:43 +00:00
print '<td class="left" colspan="2">' ;
2026-02-20 11:43:49 +00:00
//if (!getDolGlobalInt('FAC_FORCE_DATE_VALIDATION')) { // If date is forced, this option to check become useless (it should be if you male import manually, it may be not)
print ajax_constantonoff ( 'INVOICE_CHECK_POSTERIOR_DATE' );
/* } else {
2026-02-12 18:22:58 +00:00
print img_picto ( $langs -> trans ( " PreviousOptionGuaranteeThatDateIsAlwaysHigher " ), 'switch_off' , 'class="opacitymedium"' );
2026-02-20 11:43:49 +00:00
} */
2022-10-28 08:40:43 +00:00
print '</td></tr>' ;
// Allow external download
print '<tr class="oddeven">' ;
print '<td>' . $langs -> trans ( " AllowExternalDownload " ) . '</td>' ;
print '<td class="left" colspan="2">' ;
print ajax_constantonoff ( 'INVOICE_ALLOW_EXTERNAL_DOWNLOAD' , array (), null , 0 , 0 , 0 , 2 , 0 , 1 );
2022-03-01 14:22:46 +00:00
print '</td></tr>' ;
2025-10-13 18:25:03 +00:00
// Notifications
print '<tr class="oddeven">' ;
print '<td>' . img_picto ( '' , 'email' , 'class="pictofixedwidth"' ) . $langs -> trans ( " Notifications " ) . '</td>' ;
2025-10-13 19:03:14 +00:00
print '<td colspan="2">' ;
2025-10-13 18:25:03 +00:00
print $langs -> trans ( " YouMayFindNotificationsFeaturesIntoModuleNotification " );
print '</td></tr>' ;
2006-06-02 20:58:55 +00:00
2025-10-13 18:25:03 +00:00
// More PDF options
print '<tr class="oddeven">' ;
print '<td>' . img_picto ( '' , 'pdf' , 'class="pictofixedwidth"' ) . $langs -> trans ( " MoreOptionsRelatedToPDF " ) . '</td>' ;
2025-10-13 19:03:14 +00:00
print '<td colspan="2">' ;
2025-10-13 18:25:03 +00:00
print img_picto ( '' , 'url' , 'class="pictofixedwidth"' ) . '<a href="' . DOL_URL_ROOT . '/admin/pdf_other.php">' . $langs -> trans ( " SeeInPDFSetupPage " ) . '</a>' ;
print '</td></tr>' ;
2019-09-30 23:35:11 +00:00
2015-03-18 20:44:57 +00:00
print '</table>' ;
2025-10-13 18:25:03 +00:00
print '</div>' ;
2019-09-30 23:35:11 +00:00
2015-03-18 20:44:57 +00:00
2020-10-27 17:19:31 +00:00
print dol_get_fiche_end ();
2015-03-18 20:44:57 +00:00
2018-07-28 16:03:14 +00:00
// End of page
2011-08-27 14:24:16 +00:00
llxFooter ();
2012-12-19 12:06:45 +00:00
$db -> close ();