28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/salaries/class/salary.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/salaries.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/fourn.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/discount.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
53if (isModEnabled(
'project')) {
54 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
55 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
59$langs->loadLangs(array(
"compta",
"bills",
"users",
"salaries",
"hrm",
"withdrawals"));
63$action =
GETPOST(
'action',
'aZ09');
66$label =
GETPOST(
'label',
'alphanohtml');
67$projectid = (
GETPOST(
'projectid',
'int') ?
GETPOST(
'projectid',
'int') :
GETPOST(
'fk_project',
'int'));
70$socid =
GETPOST(
'socid',
'int');
72 $socid = $user->socid;
80$childids = $user->getAllChildIds(1);
83$extrafields->fetch_name_optionals_label($object->table_element);
86$hookmanager->initHooks(array(
'salaryinfo',
'globalcard'));
89if ($id > 0 || !empty($ref)) {
90 $object->fetch($id, $ref);
94 if ($user->hasRight(
'salaries',
'readall')) {
97 if ($user->hasRight(
'salaries',
'read') && $object->fk_user > 0 && in_array($object->fk_user, $childids)) {
105$permissiontoread = $user->rights->salaries->read;
106$permissiontoadd = $user->rights->salaries->write;
107$permissiontodelete = $user->rights->salaries->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_UNPAID);
110if ($type ==
'bank-transfer') {
112 $moreparam =
'&type='.$type;
118if ($id > 0 || !empty($ref)) {
119 $ret = $object->fetch($id, $ref);
122 $object->fetch_thirdparty();
126$hookmanager->initHooks(array(
'directdebitcard',
'globalcard'));
136if ($action ==
'classin' && $user->hasRight(
'banque',
'modifier')) {
138 $object->setProject($projectid);
142if ($action ==
'setlabel' && $user->hasRight(
'salaries',
'write')) {
144 $object->label = $label;
145 $object->update($user);
148$parameters = array(
'socid' => $socid);
149$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $obj, $action);
155if ($action ==
"new") {
157 if ($object->id > 0) {
160 $sourcetype =
'salaire';
161 $newtype =
'salaire';
162 $paymentservice =
GETPOST(
'paymentservice');
163 $result = $object->demande_prelevement($user,
price2num(
GETPOST(
'request_transfer',
'alpha')), $newtype, $sourcetype);
178if ($action ==
"delete" && $permissiontodelete) {
179 if ($object->id > 0) {
180 $result = $object->demande_prelevement_delete($user,
GETPOST(
'did',
'int'));
182 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
195if (isModEnabled(
'project')) {
199$title = $langs->trans(
'Salary').
" - ".$langs->trans(
'Info');
206$head = salaries_prepare_head($object);
208print
dol_get_fiche_head($head,
'request_virement', $langs->trans(
"SalaryPayment"), -1,
'salary');
210$linkback =
'<a href="'.DOL_URL_ROOT.
'/salaries/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
212$morehtmlref =
'<div class="refidno">';
214$userstatic =
new User($db);
215$userstatic->fetch($object->fk_user);
219if ($action !=
'editlabel') {
220 $morehtmlref .= $form->editfieldkey(
"Label",
'label', $object->label, $object, $user->hasRight(
'salaries',
'write'),
'string',
'', 0, 1);
221 $morehtmlref .= $object->label;
223 $morehtmlref .= $langs->trans(
'Label').
' : ';
224 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
225 $morehtmlref .=
'<input type="hidden" name="action" value="setlabel">';
226 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
227 $morehtmlref .=
'<input type="text" name="label" value="'.$object->label.
'"/>';
228 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
229 $morehtmlref .=
'</form>';
232$morehtmlref .=
'<br>'.$langs->trans(
'Employee').
' : '.$userstatic->getNomUrl(-1);
234$usercancreate = $permissiontoadd;
237if (isModEnabled(
'project')) {
238 $langs->load(
"projects");
239 $morehtmlref .=
'<br>';
240 if ($usercancreate) {
241 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
242 if ($action !=
'classify') {
243 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
245 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
247 if (!empty($object->fk_project)) {
249 $proj->fetch($object->fk_project);
250 $morehtmlref .= $proj->getNomUrl(1);
252 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
258$morehtmlref .=
'</div>';
260dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'',
'');
262print
'<div class="fichecenter">';
263print
'<div class="fichehalfleft">';
265print
'<div class="underbanner clearboth"></div>';
268print
'<table class="border centpercent tableforfield">';
270if ($action ==
'edit') {
271 print
'<tr><td class="titlefield">'.$langs->trans(
"DateStartPeriod").
"</td><td>";
272 print $form->selectDate($object->datesp,
'datesp', 0, 0, 0,
'datesp', 1);
276 print
'<td class="titlefield">' . $langs->trans(
"DateStartPeriod") .
'</td><td>';
281if ($action ==
'edit') {
282 print
'<tr><td>'.$langs->trans(
"DateEndPeriod").
"</td><td>";
283 print $form->selectDate($object->dateep,
'dateep', 0, 0, 0,
'dateep', 1);
287 print
'<td>' . $langs->trans(
"DateEndPeriod") .
'</td><td>';
291if ($action ==
'edit') {
292 print
'<tr><td class="fieldrequired">' . $langs->trans(
"Amount") .
'</td><td><input name="amount" size="10" value="' .
price($object->amount) .
'"></td></tr>';
294 print
'<tr><td>' . $langs->trans(
"Amount") .
'</td><td><span class="amount">' .
price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) .
'</span></td></tr>';
299print
'<table class="nobordernopadding" width="100%"><tr><td>';
300print $langs->trans(
'DefaultPaymentMode');
302if ($action !=
'editmode') {
303 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editmode&token='.newToken().
'&id='.$object->id.
'">'.
img_edit($langs->trans(
'SetMode'), 1).
'</a></td>';
305print
'</tr></table>';
308if ($action ==
'editmode') {
309 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->type_payment,
'mode_reglement_id');
311 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->type_payment,
'none');
316if (isModEnabled(
"banque")) {
317 print
'<tr><td class="nowrap">';
318 print
'<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
319 print $langs->trans(
'DefaultBankAccount');
321 if ($action !=
'editbankaccount' && $user->hasRight(
'salaries',
'write')) {
322 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editbankaccount&token='.newToken().
'&id='.$object->id.
'">'.
img_edit($langs->trans(
'SetBankAccount'), 1).
'</a></td>';
324 print
'</tr></table>';
326 if ($action ==
'editbankaccount') {
327 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->fk_account,
'fk_account', 1);
329 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->fk_account,
'none');
336include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
341$user_perms = $user->hasRight(
'virement',
'bons',
'creer');
342$buttonlabel = $langs->trans(
"MakeTransferRequest");
343$user_perms = $user->hasRight(
'paymentbybanktransfer',
'create');
345print
'<div class="fichehalfright">';
349 $sql =
"SELECT p.rowid, p.num_payment as num_payment, p.datep as dp, p.amount,";
350 $sql .=
" c.code as type_code,c.libelle as paiement_type,";
351 $sql .=
' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.currency_code as bacurrency_code, ba.fk_accountancy_journal';
352 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as p";
353 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank as b ON p.fk_bank = b.rowid';
354 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank_account as ba ON b.fk_account = ba.rowid';
355 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_typepayment = c.id";
356 $sql .=
", ".MAIN_DB_PREFIX.
"salary as s";
357 $sql .=
" WHERE p.fk_salary = ".((int) $id);
358 $sql .=
" AND p.fk_salary = s.rowid";
359 $sql .=
" AND s.entity IN (".getEntity(
'tax').
")";
360 $sql .=
" ORDER BY dp DESC";
363 $resql = $db->query($sql);
367 $num = $db->num_rows($resql);
372 print
'<div class="div-table-responsive-no-min">';
373 print
'<table class="noborder paymenttable">';
374 print
'<tr class="liste_titre">';
375 print
'<td>'.$langs->trans(
"RefPayment").
'</td>';
376 print
'<td>'.$langs->trans(
"Date").
'</td>';
377 print
'<td>'.$langs->trans(
"Type").
'</td>';
378 if (isModEnabled(
"banque")) {
379 print
'<td class="liste_titre right">'.$langs->trans(
'BankAccount').
'</td>';
381 print
'<td class="right">'.$langs->trans(
"Amount").
'</td>';
385 $bankaccountstatic =
new Account($db);
387 $objp = $db->fetch_object($resql);
389 print
'<tr class="oddeven"><td>';
390 print
'<a href="'.DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id='.$objp->rowid.
'">'.
img_object($langs->trans(
"Payment"),
"payment").
' '.$objp->rowid.
'</a></td>';
391 print
'<td>'.dol_print_date($db->jdate($objp->dp),
'dayhour',
'tzuserrel').
"</td>\n";
392 $labeltype = $langs->trans(
"PaymentType".$objp->type_code) !=
"PaymentType".$objp->type_code ? $langs->trans(
"PaymentType".$objp->type_code) : $objp->paiement_type;
393 print
"<td>".$labeltype.
' '.$objp->num_payment.
"</td>\n";
394 if (isModEnabled(
"banque")) {
395 $bankaccountstatic->id = $objp->baid;
396 $bankaccountstatic->ref = $objp->baref;
397 $bankaccountstatic->label = $objp->baref;
398 $bankaccountstatic->number = $objp->banumber;
399 $bankaccountstatic->currency_code = $objp->bacurrency_code;
401 if (isModEnabled(
'accounting')) {
402 $bankaccountstatic->account_number = $objp->account_number;
405 $accountingjournal->fetch($objp->fk_accountancy_journal);
406 $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
409 print
'<td class="right">';
410 if ($bankaccountstatic->id) {
411 print $bankaccountstatic->getNomUrl(1,
'transactions');
415 print
'<td class="right nowrap amountcard">'.price($objp->amount).
"</td>\n";
417 $totalpaid += $objp->amount;
421 print
'<tr class="oddeven"><td><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
422 print
'<td></td><td></td><td></td><td></td>';
429 $resteapayer = $object->amount - $totalpaid;
444print
'<div class="clearboth"></div>';
450print
'<div class="tabsAction">'.
"\n";
452$sql =
"SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,";
453 $sql .=
" pfd.date_traite as date_traite, pfd.amount, pfd.fk_prelevement_bons,";
454 $sql .=
" pb.ref, pb.date_trans, pb.method_trans, pb.credite, pb.date_credit, pb.datec, pb.statut as status, pb.amount as pb_amount,";
455 $sql .=
" u.rowid as user_id, u.email, u.lastname, u.firstname, u.login, u.statut as user_status";
456 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
457 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u on pfd.fk_user_demande = u.rowid";
458 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons";
459if ($type ==
'salaire') {
460 $sql .=
" WHERE pfd.fk_salary = ".((int) $object->id);
462 $sql .=
" WHERE fk_facture = ".((int) $object->id);
464 $sql .=
" AND pfd.traite = 0";
465 $sql .=
" AND pfd.type = 'ban'";
466 $sql .=
" ORDER BY pfd.date_demande DESC";
467 $resql = $db->query($sql);
469 $hadRequest = $db->num_rows($resql);
470if ($object->paye == 0 && $hadRequest == 0) {
471 if ($resteapayer > 0) {
473 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
474 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
475 print
'<input type="hidden" name="id" value="'.$object->id.
'" />';
476 print
'<input type="hidden" name="type" value="'.$type.
'" />';
477 print
'<input type="hidden" name="action" value="new" />';
478 print
'<label for="withdraw_request_amount">'.$langs->trans(
'BankTransferAmount').
' </label>';
479 print
'<input type="text" id="withdraw_request_amount" name="request_transfer" value="'.price($resteapayer, 0, $langs, 1, -1, -1).
'" size="9" />';
480 print
'<input type="submit" class="butAction" value="'.$buttonlabel.
'" />';
487 $buttonlabel = $langs->trans(
"MakeWithdrawRequestStripe");
488 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
489 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
490 print
'<input type="hidden" name="id" value="'.$object->id.
'" />';
491 print
'<input type="hidden" name="type" value="'.$type.
'" />';
492 print
'<input type="hidden" name="action" value="new" />';
493 print
'<input type="hidden" name="paymenservice" value="stripesepa" />';
494 print
'<label for="withdraw_request_amount">'.$langs->trans(
'BankTransferAmount').
' </label>';
495 print
'<input type="text" id="withdraw_request_amount" name="request_transfer" value="'.price($resteapayer, 0, $langs, 1, -1, -1).
'" size="9" />';
496 print
'<input type="submit" class="butAction" value="'.$buttonlabel.
'" />';
500 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$buttonlabel.
'</a>';
503 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"AmountMustBePositive")).
'">'.$buttonlabel.
'</a>';
506 if ($hadRequest == 0) {
507 if ($object->paye > 0) {
508 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"AlreadyPaid")).
'">'.$buttonlabel.
'</a>';
510 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"Draft")).
'">'.$buttonlabel.
'</a>';
513 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"RequestAlreadyDone")).
'">'.$buttonlabel.
'</a>';
531 print
'<div class="div-table-responsive-no-min">';
532 print
'<table class="noborder centpercent">';
534 print
'<tr class="liste_titre">';
537 print
'<td> </td>';
539 print
'<td class="left">'.$langs->trans(
"DateRequest").
'</td>';
540 print
'<td>'.$langs->trans(
"User").
'</td>';
541 print
'<td class="center">'.$langs->trans(
"Amount").
'</td>';
542 print
'<td class="center">'.$langs->trans(
"DateProcess").
'</td>';
543if ($type ==
'bank-transfer') {
544 print
'<td class="center">'.$langs->trans(
"BankTransferReceipt").
'</td>';
546 print
'<td class="center">'.$langs->trans(
"WithdrawalReceipt").
'</td>';
548 print
'<td> </td>';
551 print
'<td> </td>';
559 $tmpuser =
new User($db);
561 $num = $db->num_rows($result);
564 $obj = $db->fetch_object($resql);
566 $tmpuser->id = $obj->user_id;
567 $tmpuser->login = $obj->login;
568 $tmpuser->ref = $obj->login;
569 $tmpuser->email = $obj->email;
570 $tmpuser->lastname = $obj->lastname;
571 $tmpuser->firstname = $obj->firstname;
572 $tmpuser->statut = $obj->user_status;
573 $tmpuser->status = $obj->user_status;
575 print
'<tr class="oddeven">';
579 print
'<td class="right">';
580 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=delete&token='.newToken().
'&did='.$obj->rowid.
'&type='.urlencode($type).
'">';
586 print
'<td class="nowraponall">'.dol_print_date($db->jdate($obj->date_demande),
'dayhour').
"</td>\n";
589 print
'<td class="tdoverflowmax125">';
590 print $tmpuser->getNomUrl(-1,
'', 0, 0, 0, 0,
'login');
594 print
'<td class="center"><span class="amount">'.price($obj->amount).
'</span></td>';
597 print
'<td class="center"><span class="opacitymedium">'.$langs->trans(
"OrderWaiting").
'</span></td>';
600 print
'<td class="minwidth75">';
601 if ($obj->fk_prelevement_bons > 0) {
603 $withdrawreceipt->id = $obj->fk_prelevement_bons;
604 $withdrawreceipt->ref = $obj->ref;
605 $withdrawreceipt->date_trans = $db->jdate($obj->date_trans);
606 $withdrawreceipt->date_credit = $db->jdate($obj->date_credit);
607 $withdrawreceipt->date_creation = $db->jdate($obj->datec);
608 $withdrawreceipt->statut = $obj->status;
609 $withdrawreceipt->status = $obj->status;
610 $withdrawreceipt->amount = $obj->pb_amount;
613 print $withdrawreceipt->getNomUrl(1);
616 if (!in_array($type, array(
'bank-transfer',
'salaire',
'salary'))) {
618 $langs->load(
"stripe");
619 if ($obj->fk_prelevement_bons > 0) {
622 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=sepastripedirectdebit&paymentservice=stripesepa&token='.newToken().
'&did='.$obj->rowid.
'&id='.$object->id.
'&type='.urlencode($type).
'">'.
img_picto(
'',
'stripe',
'class="pictofixedwidth"').$langs->trans(
"RequestDirectDebitWithStripe").
'</a>';
626 $langs->load(
"stripe");
627 if ($obj->fk_prelevement_bons > 0) {
630 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=sepastripecredittransfer&paymentservice=stripesepa&token='.newToken().
'&did='.$obj->rowid.
'&id='.$object->id.
'&type='.urlencode($type).
'">'.
img_picto(
'',
'stripe',
'class="pictofixedwidth"').$langs->trans(
"RequesCreditTransferWithStripe").
'</a>';
636 print
'<td class="center">-</td>';
640 print
'<td class="right">';
641 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=delete&token='.newToken().
'&did='.$obj->rowid.
'&type='.urlencode($type).
'">';
658 $sql =
"SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,";
659 $sql .=
" pfd.date_traite as date_traite, pfd.amount, pfd.fk_prelevement_bons,";
660 $sql .=
" pb.ref, pb.date_trans, pb.method_trans, pb.credite, pb.date_credit, pb.datec, pb.statut as status, pb.amount as pb_amount,";
661 $sql .=
" u.rowid as user_id, u.email, u.lastname, u.firstname, u.login, u.statut as user_status";
662 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
663 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u on pfd.fk_user_demande = u.rowid";
664 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons";
665if ($type ==
'salaire') {
666 $sql .=
" WHERE pfd.fk_salary = ".((int) $object->id);
668 $sql .=
" WHERE fk_facture = ".((int) $object->id);
670 $sql .=
" AND pfd.traite = 1";
671 $sql .=
" AND pfd.type = 'ban'";
672 $sql .=
" ORDER BY pfd.date_demande DESC";
674 $resql = $db->query($sql);
676 $numOfBp = $db->num_rows($resql);
678 $tmpuser =
new User($db);
680 while ($i < $numOfBp) {
681 $obj = $db->fetch_object($resql);
683 $tmpuser->id = $obj->user_id;
684 $tmpuser->login = $obj->login;
685 $tmpuser->ref = $obj->login;
686 $tmpuser->email = $obj->email;
687 $tmpuser->lastname = $obj->lastname;
688 $tmpuser->firstname = $obj->firstname;
689 $tmpuser->statut = $obj->user_status;
690 $tmpuser->status = $obj->user_status;
692 print
'<tr class="oddeven">';
696 print
'<td> </td>';
700 print
'<td class="nowraponall">'.dol_print_date($db->jdate($obj->date_demande),
'dayhour').
"</td>\n";
703 print
'<td class="tdoverflowmax125">';
704 print $tmpuser->getNomUrl(-1,
'', 0, 0, 0, 0,
'login');
708 print
'<td class="center"><span class="amount">'.price($obj->amount).
'</span></td>';
711 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->date_traite),
'dayhour',
'tzuserrel').
"</td>\n";
714 print
'<td class="center minwidth75">';
715 if ($obj->fk_prelevement_bons > 0) {
717 $withdrawreceipt->id = $obj->fk_prelevement_bons;
718 $withdrawreceipt->ref = $obj->ref;
719 $withdrawreceipt->date_trans = $db->jdate($obj->date_trans);
720 $withdrawreceipt->date_credit = $db->jdate($obj->date_credit);
721 $withdrawreceipt->date_creation = $db->jdate($obj->datec);
722 $withdrawreceipt->statut = $obj->status;
723 $withdrawreceipt->status = $obj->status;
724 $withdrawreceipt->fk_bank_account = $obj->fk_bank_account;
725 $withdrawreceipt->amount = $obj->pb_amount;
728 print $withdrawreceipt->getNomUrl(1);
730 print $withdrawreceipt->getLibStatut(2);
733 $fk_bank_account = $withdrawreceipt->fk_bank_account;
734 if (empty($fk_bank_account)) {
735 $fk_bank_account = ($object->type ==
'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
737 if ($fk_bank_account > 0) {
738 $bankaccount =
new Account($db);
739 $result = $bankaccount->fetch($fk_bank_account);
742 print $bankaccount->getNomUrl(1);
749 print
'<td> </td>';
753 print
'<td> </td>';
765if ($num == 0 && $numOfBp == 0) {
766 print
'<tr class="oddeven"><td colspan="7"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
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 accounting journals.
Class to manage withdrawal receipts.
Class to manage suppliers invoices.
Class to manage invoices.
Class to manage projects.
Class to manage salary payments.
Class to manage Dolibarr users.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_get_fiche_end($notab=0)
Return tab footer of a card.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.