30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
38$langs->loadLangs(array(
"admin",
"companies",
"bills",
"other",
"banks"));
40$action =
GETPOST(
'action',
'aZ09');
41$actionsave =
GETPOST(
'save',
'alpha');
42$value =
GETPOST(
'value',
'alpha');
43$label =
GETPOST(
'label',
'alpha');
44$scandir =
GETPOST(
'scan_dir',
'alpha');
58if (in_array($action, array(
'setBANK_DISABLE_DIRECT_INPUT'))) {
59 $constname = preg_replace(
'/^set/',
'', $action);
61 $res =
dolibarr_set_const($db, $constname, $constvalue,
'yesno', 0,
'', $conf->entity);
74if ($action ==
'setbankorder') {
82if ($action ==
'setreportlastnumreleve') {
83 if (
dolibarr_set_const($db,
"BANK_REPORT_LAST_NUM_RELEVE", 1,
'chaine', 0,
'', $conf->entity) > 0) {
87} elseif ($action ==
'unsetreportlastnumreleve') {
88 if (
dolibarr_set_const($db,
"BANK_REPORT_LAST_NUM_RELEVE", 0,
'chaine', 0,
'', $conf->entity) > 0) {
95if ($action ==
'setbankcolorizemovement') {
96 if (
dolibarr_set_const($db,
"BANK_COLORIZE_MOVEMENT", 1,
'chaine', 0,
'', $conf->entity) > 0) {
100} elseif ($action ==
'unsetbankcolorizemovement') {
101 if (
dolibarr_set_const($db,
"BANK_COLORIZE_MOVEMENT", 0,
'chaine', 0,
'', $conf->entity) > 0) {
116 $color =
GETPOST(
'BANK_COLORIZE_MOVEMENT_COLOR'.$i,
'alpha');
117 if ($color ==
'-1') {
121 $res =
dolibarr_set_const($db,
'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color,
'chaine', 0,
'', $conf->entity);
133 if (empty($errorsaved)) {
140if ($action ==
'specimen') {
141 $modele =
GETPOST(
'module',
'alpha');
143 if ($modele ==
'sepamandate') {
153 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
154 foreach ($dirmodels as $reldir) {
155 $file =
dol_buildpath($reldir.
"core/modules/bank/doc/pdf_".$modele.
".modules.php", 0);
156 if (file_exists($file)) {
157 $classname =
"pdf_".$modele;
162 if ($classname !==
'') {
165 $module =
new $classname($db);
166 '@phan-var-force ModeleBankAccountDoc $module';
168 if ($module->write_file(
$object, $langs) > 0) {
169 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=bank&file=SPECIMEN.pdf");
177 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
182if ($action ==
'set') {
184} elseif ($action ==
'del') {
187 if ($conf->global->BANKADDON_PDF ==
"$value") {
191} elseif ($action ==
'setdoc') {
193 if (
dolibarr_set_const($db,
"BANKADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
196 $conf->global->BANKADDON_PDF = $value;
212$form =
new Form($db);
215$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
217llxHeader(
"", $langs->trans(
"BankSetupModule"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-bank');
219$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
220print
load_fiche_titre($langs->trans(
"BankSetupModule"), $linkback,
'title_setup');
222print
'<form name="bankmovementcolorconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
223print
'<input type="hidden" name="token" value="'.newToken().
'">';
224print
'<input type="hidden" name="action" value="save">';
227print
dol_get_fiche_head($head,
'general', $langs->trans(
"BankSetupModule"), -1,
'account');
232print
'<div class="div-table-responsive-no-min">';
233print
'<table class="noborder centpercent">';
234print
'<tr class="liste_titre">';
235print
'<td>'.$langs->trans(
"Name").
'</td>';
236print
'<td class="minwidth100">'.$langs->trans(
"Description").
'</td>';
237print
'<td>'.$langs->trans(
"Example").
'</td>';
238print
'<td class="center">'.$langs->trans(
"Status").
'</td>';
242$bankorder[0][0] = $langs->trans(
"BankOrderGlobal");
243$bankorder[0][1] = $langs->trans(
"BankOrderGlobalDesc");
244$bankorder[0][2] =
'BankCode DeskCode BankAccountNumber BankAccountNumberKey';
245$bankorder[1][0] = $langs->trans(
"BankOrderES");
246$bankorder[1][1] = $langs->trans(
"BankOrderESDesc");
247$bankorder[1][2] =
'BankCode DeskCode BankAccountNumberKey BankAccountNumber';
251$nbofbank = count($bankorder);
252while ($i < $nbofbank) {
253 print
'<tr class="oddeven">';
254 print
'<td>'.$bankorder[$i][0].
"</td><td>\n";
255 print $bankorder[$i][1];
257 print
'<td class="nowrap">';
258 $tmparray = explode(
' ', $bankorder[$i][2]);
259 foreach ($tmparray as $key => $val) {
263 print $langs->trans($val);
268 print
'<td class="center">';
269 print
img_picto($langs->trans(
"Activated"),
'on');
272 print
'<td class="center"><a href="'.$_SERVER[
'PHP_SELF'].
'?action=setbankorder&token='.
newToken().
'&value='.((int) $i).
'">';
273 print
img_picto($langs->trans(
"Disabled"),
'off');
280print
'</table>'.
"\n";
295$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
296$sql .=
" WHERE type = '".$db->escape($type).
"'";
297$sql .=
" AND entity = ".$conf->entity;
298$resql = $db->query($sql);
301 $num_rows = $db->num_rows($resql);
302 while ($i < $num_rows) {
303 $array = $db->fetch_array($resql);
304 if (is_array($array)) {
305 array_push($def, $array[0]);
313print
'<div class="div-table-responsive-no-min">';
314print
'<table class="noborder centpercent">'.
"\n";
315print
'<tr class="liste_titre">'.
"\n";
316print
'<td>'.$langs->trans(
"Name").
'</td>';
317print
'<td class="minwidth100">'.$langs->trans(
"Description").
'</td>';
318print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
319print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
320print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
321print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
326foreach ($dirmodels as $reldir) {
327 foreach (array(
'',
'/doc') as $valdir) {
331 $handle = opendir($dir);
332 if (is_resource($handle)) {
334 while (($file = readdir($handle)) !==
false) {
340 foreach ($filelist as $file) {
341 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
342 if (file_exists($dir.
'/'.$file)) {
343 $name = substr($file, 4,
dol_strlen($file) - 16);
344 $classname = substr($file, 0,
dol_strlen($file) - 12);
346 require_once $dir.
'/'.$file;
347 $module =
new $classname($db);
349 '@phan-var-force ModeleBankAccountDoc $module';
351 $modulequalified = 1;
352 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
353 $modulequalified = 0;
355 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
356 $modulequalified = 0;
359 if ($modulequalified) {
360 print
'<tr class="oddeven"><td width="100">';
361 print(empty($module->name) ? $name : $module->
name);
363 if (method_exists($module,
'info')) {
364 print $module->info($langs);
366 print $module->description;
371 if (in_array($name, $def)) {
372 print
'<td class="center">'.
"\n";
373 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.$name.
'">';
374 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
378 print
'<td class="center">'.
"\n";
379 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=set&value='.$name.
'&token='.
newToken().
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
384 print
'<td class="center">';
385 if ($conf->global->BANKADDON_PDF == $name) {
386 print
img_picto($langs->trans(
"Default"),
'on');
388 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.
newToken().
'&value='.$name.
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
393 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
394 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
395 if ($module->type ==
'pdf') {
396 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
398 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
399 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
402 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
407 print
'<td class="center">';
408 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
412 print
'<td class="center">';
413 if ($module->type ==
'pdf') {
414 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
416 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
436print
'<div class="div-table-responsive-no-min">';
437print
'<table class="noborder centpercent">'.
"\n";
438print
'<tr class="liste_titre">'.
"\n";
439print
'<td colspan="4">'.$langs->trans(
"Name").
'</td>';
440print
'<td align="center" width="75">'.$langs->trans(
"Value").
'</td>'.
"\n";
443print
'<tr class="oddeven"><td colspan="4">';
444print $langs->trans(
'BankColorizeMovementDesc');
448 print
'<td class="center">'.
"\n";
449 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetbankcolorizemovement&token='.
newToken().
'">';
450 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
454 print
'<td class="center">'.
"\n";
455 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setbankcolorizemovement&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
465 $color =
'BANK_COLORIZE_MOVEMENT_COLOR'.$key;
467 print
'<tr class="oddeven">';
470 print
'<td colspan="4" width="180" class="nowrap">'.$langs->trans(
"BankColorizeMovementName".$key).
"</td>";
472 print
'<td class="nowrap right">';
473 print $formother->selectColor((
GETPOST(
"BANK_COLORIZE_MOVEMENT_COLOR".$key) ?
GETPOST(
"BANK_COLORIZE_MOVEMENT_COLOR".$key) :
getDolGlobalString($color)),
"BANK_COLORIZE_MOVEMENT_COLOR".$key,
'bankmovementcolorconfig', 1, array(),
'right hideifnotset');
491print
'<div class="div-table-responsive-no-min">';
492print
'<table class="noborder centpercent">'.
"\n";
493print
'<tr class="liste_titre">'.
"\n";
494print
'<td>'.$langs->trans(
"Name").
'</td>';
495print
'<td>'.$langs->trans(
"Description").
'</td>';
496print
'<td class="center width75">'.$langs->trans(
"Status").
"</td>\n";
499print
'<tr class="oddeven">';
500print
'<td>'.$langs->trans(
"BANK_DISABLE_DIRECT_INPUT").
'</td><td></td>';
502 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
503 print
img_picto($langs->trans(
"Activated"),
'switch_on');
506 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
507 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
512print
'<tr class="oddeven"><td>';
513print $langs->trans(
'AccountStatement');
515print $langs->trans(
'AutoReportLastAccountStatement');
519 print
'<td class="center">'.
"\n";
520 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetreportlastnumreleve&token='.
newToken().
'">';
521 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
525 print
'<td class="center">'.
"\n";
526 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setreportlastnumreleve&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
533 print
'<tr class="oddeven">';
534 print
'<td>'.$langs->trans(
"AllowOnLineSign").
'</td>';
535 print
'<td>'.$langs->trans(
"AllowOnLineSignDesc").
'</td>';
536 print
'<td class="center">';
537 print ajax_constantonoff(
'SOCIETE_RIB_ALLOW_ONLINESIGN', array(),
null, 0, 0, 0, 2, 0, 1);
546print $form->buttonsSaveCancel(
"Save",
'');
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
bank_admin_prepare_head($object)
Prepare array with list of tabs.
Class to manage bank accounts.
Class to manage bank accounts description of third parties.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$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.