29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35 $langs->loadLangs(array(
"admin",
"withdrawals"));
42 $action =
GETPOST(
'action',
'aZ09');
43 $type =
'paymentorder';
52 if ($action ==
"set") {
55 $id =
GETPOST(
'PRELEVEMENT_ID_BANKACCOUNT',
'int');
57 if ($account->fetch($id) > 0) {
58 $res =
dolibarr_set_const($db,
"PRELEVEMENT_ID_BANKACCOUNT", $id,
'chaine', 0,
'', $conf->entity);
86 if (
GETPOST(
"PRELEVEMENT_USER") > 0) {
92 if (
GETPOST(
"PRELEVEMENT_END_TO_END") ||
GETPOST(
"PRELEVEMENT_END_TO_END") ==
"") {
93 $res =
dolibarr_set_const($db,
"PRELEVEMENT_END_TO_END",
GETPOST(
"PRELEVEMENT_END_TO_END"),
'chaine', 0,
'', $conf->entity);
98 if (
GETPOST(
"PRELEVEMENT_USTRD") ||
GETPOST(
"PRELEVEMENT_USTRD") ==
"") {
119 if ($action ==
"addnotif") {
121 $bon->addNotification($db,
GETPOST(
'user',
'int'), $action);
123 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
127 if ($action ==
"deletenotif") {
129 $bon->deleteNotificationById(
GETPOST(
'notif',
'int'));
131 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
142 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
144 llxHeader(
'', $langs->trans(
"WithdrawalsSetup"));
146 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
148 print
load_fiche_titre($langs->trans(
"WithdrawalsSetup"), $linkback,
'title_setup');
151 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'?action=set">';
152 print
'<input type="hidden" name="token" value="'.newToken().
'">';
154 print
'<table class="noborder centpercent">';
156 print
'<tr class="liste_titre">';
157 print
'<td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td>';
158 print
'<td>'.$langs->trans(
"Value").
'</td>';
163 print
'<tr class="oddeven"><td class="fieldrequired">'.$langs->trans(
"BankToReceiveWithdraw").
'</td>';
165 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
166 print
$form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT,
'PRELEVEMENT_ID_BANKACCOUNT', 0,
"courant=1", 1,
'', 0,
'minwidth200', 1);
168 print
' <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>';
185 print
'<tr class="oddeven"><td class="fieldrequired">'.$langs->trans(
"ResponsibleUser").
'</td>';
187 print
img_picto(
'',
'user',
'class="pictofixedwidth"');
188 print
$form->select_dolusers($conf->global->PRELEVEMENT_USER,
'PRELEVEMENT_USER', 1,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'minwidth200 maxwidth500');
193 print
'<tr class="oddeven"><td>';
194 $htmltext = $langs->trans(
"KeepThisEmptyInMostCases");
195 print
$form->textwithpicto($langs->trans(
"END_TO_END"), $htmltext);
198 print
'<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->PRELEVEMENT_END_TO_END.
'" class="width100"></td>';
202 print
'<tr class="oddeven"><td>';
203 $htmltext = $langs->trans(
"KeepThisEmptyInMostCases");
204 print
$form->textwithpicto($langs->trans(
"USTRD"), $htmltext);
206 print
'<td class="left">';
207 print
'<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->PRELEVEMENT_USTRD.
'" class="width100"></td>';
211 print
'<tr class="oddeven"><td>'.$langs->trans(
"ADDDAYS").
'</td>';
213 if (empty($conf->global->PRELEVEMENT_ADDDAYS)) {
214 $conf->global->PRELEVEMENT_ADDDAYS = 0;
216 print
'<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.
'" class="width50"></td>';
221 print
$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()
Empty header.
Class to manage bank accounts.
Class to manage withdrawal receipts.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.