30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
44$langs->loadLangs(array(
"admin",
"withdrawals"));
51$action =
GETPOST(
'action',
'aZ09');
52$type =
'paymentorder';
61if ($action ==
"set") {
66 if ($account->fetch(
$id) > 0) {
95 if (
GETPOST(
"PRELEVEMENT_USER") > 0) {
101 if (
GETPOST(
"PRELEVEMENT_END_TO_END") ||
GETPOST(
"PRELEVEMENT_END_TO_END") ==
"") {
107 if (
GETPOST(
"PRELEVEMENT_USTRD") ||
GETPOST(
"PRELEVEMENT_USTRD") ==
"") {
128if ($action ==
"addnotif") {
130 $bon->addNotification($db,
GETPOSTINT(
'user'), $action);
132 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
136if ($action ==
"deletenotif") {
138 $bon->deleteNotificationById(
GETPOSTINT(
'notif'));
140 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
149$form =
new Form($db);
151$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
153llxHeader(
'', $langs->trans(
"WithdrawalsSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-prelevement');
155$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
157print
load_fiche_titre($langs->trans(
"WithdrawalsSetup"), $linkback,
'title_setup');
160print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'?action=set">';
161print
'<input type="hidden" name="token" value="'.newToken().
'">';
163print
'<table class="noborder centpercent">';
165print
'<tr class="liste_titre">';
166print
'<td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td>';
167print
'<td>'.$langs->trans(
"Value").
'</td>';
172print
'<tr class="oddeven"><td class="fieldrequired">'.$langs->trans(
"BankToReceiveWithdraw").
'</td>';
174print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
175print $form->select_comptes(
getDolGlobalInt(
'PRELEVEMENT_ID_BANKACCOUNT'),
'PRELEVEMENT_ID_BANKACCOUNT', 0,
"courant=1", 1,
'', 0,
'minwidth200 widthcentpercentminusxx maxwidth300', 1);
177print
' <a href="'.DOL_URL_ROOT.
'/compta/bank/card.php?action=create&backtopage='.DOL_URL_ROOT.
'/admin/prelevement.php"><span class="fa fa-plus-circle"></span></a>';
194print
'<tr class="oddeven"><td class="fieldrequired">'.$langs->trans(
"ResponsibleUser").
'</td>';
196print
img_picto(
'',
'user',
'class="pictofixedwidth"');
197print $form->select_dolusers(
getDolGlobalInt(
'PRELEVEMENT_USER'),
'PRELEVEMENT_USER', 1,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'minwidth200 maxwidth500');
202print
'<tr class="oddeven"><td>';
203$htmltext = $langs->trans(
"KeepThisEmptyInMostCases");
204print $form->textwithpicto($langs->trans(
"END_TO_END"), $htmltext);
207print
'<input type="text" name="PRELEVEMENT_END_TO_END" value="'.getDolGlobalString(
'PRELEVEMENT_END_TO_END').
'" class="width100"></td>';
211print
'<tr class="oddeven"><td>';
212$htmltext = $langs->trans(
"KeepThisEmptyInMostCases");
213print $form->textwithpicto($langs->trans(
"USTRD"), $htmltext);
215print
'<td class="left">';
216print
'<input type="text" name="PRELEVEMENT_USTRD" value="'.getDolGlobalString(
'PRELEVEMENT_USTRD').
'" class="width100"></td>';
220print
'<tr class="oddeven"><td>'.$langs->trans(
"ADDDAYS").
'</td>';
223 $conf->global->PRELEVEMENT_ADDDAYS = 0;
225print
'<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.getDolGlobalString(
'PRELEVEMENT_ADDDAYS').
'" class="width50"></td>';
230print $form->buttonsSaveCancel(
"Save",
'');
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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage bank accounts.
Class to manage withdrawal receipts.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.