* Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013-2014 Philippe Grand * Copyright (C) 2015 Jean-François Ferry * * 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 * the Free Software Foundation; either version 3 of the License, or * (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 * along with this program. If not, see . */ /** * \file htdocs/admin/bank.php * \ingroup bank * \brief Page to setup the bank module */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->load("admin"); $langs->load("companies"); $langs->load("bills"); $langs->load("other"); $langs->load("banks"); if (!$user->admin) accessforbidden(); $action = GETPOST('action','alpha'); /* * Actions */ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') { $freetext = GETPOST('BANK_CHEQUERECEIPT_FREE_TEXT'); // No alpha here, we want exact string $res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; if (! $error) { setEventMessage($langs->trans("SetupSaved")); } else { setEventMessage($langs->trans("Error"),'errors'); } } //Order display of bank account if ($action == 'setbankorder') { if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION",GETPOST('value','alpha'),'chaine',0,'',$conf->entity) > 0) { header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dol_print_error($db); } } /* * view */ llxHeader("",$langs->trans("BankSetupModule")); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("BankSetupModule"),$linkback,'title_setup'); print '
'; print ''; print ''; $head = bank_admin_prepare_head(null); dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), 0, 'account'); print ''; print ''; print ''; print ''; print ''; print "\n"; $var=true; $var=! $var; print '\n"; print '
'.$langs->trans("Parameters").'  
'; print $langs->trans("FreeLegalTextOnChequeReceipts").' ('.$langs->trans("AddCRIfTooLong").')
'; print ''; print '
'; print ''; print "
'; print "
"; /* $var=!$var; print ""; print ''; print ""; print ''; print $langs->trans("WatermarkOnDraftChequeReceipt").'
'; print ''; print ''; print ''; print "\n"; print '
'; */ //Show bank account order print_titre($langs->trans("BankOrderShow")); print ''; print ''; print ''; print ''; print ''; print ''; print ''; print "\n"; $bankorder[0][0]=$langs->trans("BankOrderGlobal"); $bankorder[0][1]=$langs->trans("BankOrderGlobalDesc"); $bankorder[0][2]='BankCode DeskCode AccountNumber BankAccountNumberKey'; $bankorder[1][0]=$langs->trans("BankOrderES"); $bankorder[1][1]=$langs->trans("BankOrderESDesc"); $bankorder[1][2]='BankCode DeskCode BankAccountNumberKey AccountNumber'; $var = true; $i=0; $nbofbank=count($bankorder); while ($i < $nbofbank) { $var = !$var; print ''; print ''; print '\n"; if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) { print ''; } else { print ''; } print ''; print ''."\n"; $i++; } print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").' 
'.$bankorder[$i][0]."\n"; print $bankorder[$i][1]; print ''; $tmparray=explode(' ',$bankorder[$i][2]); foreach($tmparray as $key => $val) { if ($key > 0) print ', '; print $langs->trans($val); } print "'; print img_picto($langs->trans("Activated"),'on'); print ''; print img_picto($langs->trans("Disabled"),'off'); print ' 
'."\n"; dol_fiche_end(); print ''; llxFooter(); $db->close();