26require
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
32$langs->loadLangs(array(
"admin",
"other",
"errors",
"bills"));
38$action =
GETPOST(
'action',
'aZ09');
39$value =
GETPOST(
'value',
'alpha');
40$label =
GETPOST(
'label',
'alpha');
41$scandir =
GETPOST(
'scan_dir',
'alpha');
44if (empty($conf->global->PAYMENT_ADDON)) {
45 $conf->global->PAYMENT_ADDON =
'mod_payment_cicada.php';
53if ($action ==
'updateMask') {
54 $maskconstpayment =
GETPOST(
'maskconstpayment',
'aZ09');
55 $maskpayment =
GETPOST(
'maskpayment',
'alpha');
56 if ($maskconstpayment && preg_match(
'/_MASK$/', $maskconstpayment)) {
57 $res =
dolibarr_set_const($db, $maskconstpayment, $maskpayment,
'chaine', 0,
'', $conf->entity);
71if ($action ==
'setmod') {
75if ($action ==
'setparams') {
76 $freetext =
GETPOST(
'FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS',
'restricthtml');
77 $res =
dolibarr_set_const($db,
"FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $freetext,
'chaine', 0,
'', $conf->entity);
82 $res =
dolibarr_set_const($db,
"PAYMENTS_REPORT_GROUP_BY_MOD",
GETPOST(
'PAYMENTS_REPORT_GROUP_BY_MOD',
'int'),
'chaine', 0,
'', $conf->entity);
100$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
102llxHeader(
"", $langs->trans(
"BillsSetup"),
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura');
104$form =
new Form($db);
107$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
108print
load_fiche_titre($langs->trans(
"BillsSetup"), $linkback,
'title_setup');
119print
'<div class="div-table-responsive-no-min">';
120print
'<table class="noborder centpercent">';
121print
'<tr class="liste_titre">';
122print
'<td>'.$langs->trans(
"Name").
'</td>';
123print
'<td>'.$langs->trans(
"Description").
'</td>';
124print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
125print
'<td align="center" width="60">'.$langs->trans(
"Status").
'</td>';
126print
'<td align="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
131foreach ($dirmodels as $reldir) {
134 $handle = opendir($dir);
135 if (is_resource($handle)) {
136 while (($file = readdir($handle)) !==
false) {
137 if (!is_dir($dir.$file) || (substr($file, 0, 1) <>
'.' && substr($file, 0, 3) <>
'CVS')) {
139 $classname = preg_replace(
'/\.php$/',
'', $file);
141 if (!is_file($dir.$filebis)) {
142 $filebis = $file.
"/".$file.
".modules.php";
143 $classname =
"mod_payment_".$file;
146 preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
147 if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) {
151 $classname = preg_replace(
'/\-.*$/',
'', $classname);
152 if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) && substr($filebis,
dol_strlen($filebis) - 3, 3) ==
'php') {
154 require_once $dir.$filebis;
156 $module =
new $classname($db);
159 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
162 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
166 if ($module->isEnabled()) {
167 print
'<tr class="oddeven"><td width="100">';
168 echo preg_replace(
'/\-.*$/',
'', preg_replace(
'/mod_payment_/',
'', preg_replace(
'/\.php$/',
'', $file)));
171 print $module->info();
176 print
'<td class="nowrap">';
177 $tmp = $module->getExample();
178 if (preg_match(
'/^Error/', $tmp)) {
179 $langs->load(
"errors");
180 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
181 } elseif ($tmp ==
'NotConfigured') {
182 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
188 print
'<td class="center">';
190 if ($conf->global->PAYMENT_ADDON == $file || $conf->global->PAYMENT_ADDON.
'.php' == $file) {
191 print
img_picto($langs->trans(
"Activated"),
'switch_on');
193 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>';
198 $payment->initAsSpecimen();
202 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
203 $nextval = $module->getNextValue($mysoc, $payment);
204 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
205 $htmltooltip .= $langs->trans(
"NextValue").
': ';
207 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
208 $nextval = $langs->trans($nextval);
210 $htmltooltip .= $nextval.
'<br>';
212 $htmltooltip .= $langs->trans($module->error).
'<br>';
216 print
'<td class="center">';
217 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
219 if ($conf->global->PAYMENT_ADDON.
'.php' == $file) {
220 if (!empty($module->error)) {
244print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
245print
'<input type="hidden" name="token" value="'.newToken().
'" />';
246print
'<input type="hidden" name="action" value="setparams" />';
248print
'<div class="div-table-responsive-no-min">';
249print
'<table class="noborder centpercent">';
250print
'<tr class="liste_titre">';
251print
'<td>'.$langs->trans(
"Parameter").
'</td>';
252print
'<td align="center" width="60">'.$langs->trans(
"Value").
'</td>';
253print
'<td width="80"> </td>';
257print
'<tr class="oddeven"><td>';
258print $langs->trans(
"PaymentOnDifferentThirdBills");
259print
'</td><td width="60" align="center">';
260print $form->selectyesno(
"FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",
getDolGlobalInt(
'FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS'), 1);
261print
'</td><td class="right">';
265print
'<tr class="oddeven"><td>';
266print $langs->trans(
"GroupPaymentsByModOnReports");
267print
'</td><td width="60" align="center">';
268print $form->selectyesno(
"PAYMENTS_REPORT_GROUP_BY_MOD",
getDolGlobalInt(
'PAYMENTS_REPORT_GROUP_BY_MOD'), 1);
269print
'</td><td class="right">';
277print $form->buttonsSaveCancel(
"Modify",
'');
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).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage payments of customer invoices.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return 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).
invoice_admin_prepare_head()
Return array head with list of tabs to view object informations.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.