30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/salaries/class/salary.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/salaries.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/fourn.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/class/discount.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
54require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
55if (isModEnabled(
'project')) {
56 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
57 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
70$langs->loadLangs(array(
"compta",
"bills",
"users",
"salaries",
"hrm",
"withdrawals"));
74$action =
GETPOST(
'action',
'aZ09');
77$label =
GETPOST(
'label',
'alphanohtml');
83 $socid = $user->socid;
90$childids = $user->getAllChildIds(1);
93$extrafields->fetch_name_optionals_label(
$object->table_element);
96$hookmanager->initHooks(array(
'salaryinfo',
'globalcard'));
99if ($id > 0 || !empty($ref)) {
104 if ($user->hasRight(
'salaries',
'readall')) {
107 if ($user->hasRight(
'salaries',
'read') &&
$object->fk_user > 0 && in_array(
$object->fk_user, $childids)) {
115$permissiontoread = $user->hasRight(
'salaries',
'read');
116$permissiontoadd = $user->hasRight(
'salaries',
'write');
117$permissiontodelete = $user->hasRight(
'salaries',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_UNPAID);
120if ($type ==
'bank-transfer') {
122 $moreparam =
'&type='.$type;
128if ($id > 0 || !empty($ref)) {
129 $ret =
$object->fetch($id, $ref);
136$hookmanager->initHooks(array(
'directdebitcard',
'globalcard'));
146if ($action ==
'classin' && $user->hasRight(
'banque',
'modifier')) {
148 $object->setProject($projectid);
152if ($action ==
'setlabel' && $user->hasRight(
'salaries',
'write')) {
158$parameters = array(
'socid' => $socid);
159$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $obj, $action);
165if ($action ==
'setmode' && $permissiontoadd) {
174if ($action ==
'setbankaccount' && $permissiontoadd) {
182if ($action ==
"add" && $permissiontoadd) {
187 $sourcetype =
'salaire';
188 $newtype =
'salaire';
189 $paymentservice =
GETPOST(
'paymentservice');
191 $result =
$object->demande_prelevement($user,
price2num(
GETPOST(
'request_transfer',
'alpha')), $newtype, $sourcetype);
206if ($action ==
"delete" && $permissiontodelete) {
210 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
221if (isModEnabled(
'project')) {
225$title = $langs->trans(
'Salary').
" - ".$langs->trans(
'Info');
232$head = salaries_prepare_head($object);
234print
dol_get_fiche_head($head,
'request_virement', $langs->trans(
"SalaryPayment"), -1,
'salary');
236$linkback =
'<a href="'.DOL_URL_ROOT.
'/salaries/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
238$morehtmlref =
'<div class="refidno">';
240$userstatic =
new User($db);
241$userstatic->fetch(
$object->fk_user);
245if ($action !=
'editlabel') {
246 $morehtmlref .= $form->editfieldkey(
"Label",
'label',
$object->label, $object, $user->hasRight(
'salaries',
'write'),
'string',
'', 0, 1);
247 $morehtmlref .=
$object->label;
249 $morehtmlref .= $langs->trans(
'Label').
' : ';
250 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
251 $morehtmlref .=
'<input type="hidden" name="action" value="setlabel">';
252 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
253 $morehtmlref .=
'<input type="text" name="label" value="'.$object->label.
'"/>';
254 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
255 $morehtmlref .=
'</form>';
258$morehtmlref .=
'<br>'.$langs->trans(
'Employee').
' : '.$userstatic->getNomUrl(-1);
260$usercancreate = $permissiontoadd;
263if (isModEnabled(
'project')) {
264 $langs->load(
"projects");
265 $morehtmlref .=
'<br>';
266 if ($usercancreate) {
267 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
268 if ($action !=
'classify') {
269 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
271 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
273 if (!empty(
$object->fk_project)) {
275 $proj->fetch(
$object->fk_project);
276 $morehtmlref .= $proj->getNomUrl(1);
278 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
284$morehtmlref .=
'</div>';
286dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'',
'');
288print
'<div class="fichecenter">';
289print
'<div class="fichehalfleft">';
291print
'<div class="underbanner clearboth"></div>';
294print
'<table class="border centpercent tableforfield">';
296if ($action ==
'edit') {
297 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"DateStartPeriod").
"</td><td>";
298 print $form->selectDate(
$object->datesp,
'datesp', 0, 0, 0,
'datesp', 1);
302 print
'<td class="titlefieldmiddle">' . $langs->trans(
"DateStartPeriod") .
'</td><td>';
307if ($action ==
'edit') {
308 print
'<tr><td>'.$langs->trans(
"DateEndPeriod").
"</td><td>";
309 print $form->selectDate(
$object->dateep,
'dateep', 0, 0, 0,
'dateep', 1);
313 print
'<td>' . $langs->trans(
"DateEndPeriod") .
'</td><td>';
317if ($action ==
'edit') {
318 print
'<tr><td class="fieldrequired">' . $langs->trans(
"Amount") .
'</td><td><input name="amount" size="10" value="' .
price(
$object->amount) .
'"></td></tr>';
320 print
'<tr><td>' . $langs->trans(
"Amount") .
'</td><td><span class="amount">' .
price(
$object->amount, 0, $langs, 1, -1, -1,
$conf->currency) .
'</span></td></tr>';
325print
'<table class="nobordernopadding" width="100%"><tr><td>';
326print $langs->trans(
'DefaultPaymentMode');
328if ($action !=
'editmode') {
329 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>';
331print
'</tr></table>';
334if ($action ==
'editmode') {
335 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->type_payment,
'mode_reglement_id');
337 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->type_payment,
'none');
342if (isModEnabled(
"bank")) {
343 print
'<tr><td class="nowrap">';
344 print
'<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
345 print $langs->trans(
'DefaultBankAccount');
347 if ($action !=
'editbankaccount' && $user->hasRight(
'salaries',
'write')) {
348 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>';
350 print
'</tr></table>';
352 if ($action ==
'editbankaccount') {
353 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->fk_account,
'fk_account', 1);
355 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->fk_account,
'none');
362include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
367$user_perms = $user->hasRight(
'virement',
'bons',
'creer');
368$buttonlabel = $langs->trans(
"MakeTransferRequest");
369$user_perms = $user->hasRight(
'paymentbybanktransfer',
'create');
371print
'<div class="fichehalfright">';
375$sql =
"SELECT p.rowid, p.num_payment as num_payment, p.datep as dp, p.amount,";
376$sql .=
" c.code as type_code,c.libelle as paiement_type,";
377$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';
378$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as p";
379$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank as b ON p.fk_bank = b.rowid';
380$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank_account as ba ON b.fk_account = ba.rowid';
381$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_typepayment = c.id";
382$sql .=
", ".MAIN_DB_PREFIX.
"salary as s";
383$sql .=
" WHERE p.fk_salary = ".((int) $id);
384$sql .=
" AND p.fk_salary = s.rowid";
385$sql .=
" AND s.entity IN (".getEntity(
'tax').
")";
386$sql .=
" ORDER BY dp DESC";
389$resql = $db->query($sql);
393 $num = $db->num_rows($resql);
398 print
'<div class="div-table-responsive-no-min">';
399 print
'<table class="noborder paymenttable">';
400 print
'<tr class="liste_titre">';
401 print
'<td>'.$langs->trans(
"RefPayment").
'</td>';
402 print
'<td>'.$langs->trans(
"Date").
'</td>';
403 print
'<td>'.$langs->trans(
"Type").
'</td>';
404 if (isModEnabled(
"bank")) {
405 print
'<td class="liste_titre right">'.$langs->trans(
'BankAccount').
'</td>';
407 print
'<td class="right">'.$langs->trans(
"Amount").
'</td>';
411 $bankaccountstatic =
new Account($db);
413 $objp = $db->fetch_object($resql);
415 print
'<tr class="oddeven"><td>';
416 print
'<a href="'.DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id='.$objp->rowid.
'">'.
img_object($langs->trans(
"Payment"),
"payment").
' '.$objp->rowid.
'</a></td>';
417 print
'<td>'.dol_print_date($db->jdate($objp->dp),
'dayhour',
'tzuserrel').
"</td>\n";
418 $labeltype = $langs->trans(
"PaymentType".$objp->type_code) !=
"PaymentType".$objp->type_code ? $langs->trans(
"PaymentType".$objp->type_code) : $objp->paiement_type;
419 print
"<td>".$labeltype.
' '.$objp->num_payment.
"</td>\n";
420 if (isModEnabled(
"bank")) {
421 $bankaccountstatic->id = $objp->baid;
422 $bankaccountstatic->ref = $objp->baref;
423 $bankaccountstatic->label = $objp->baref;
424 $bankaccountstatic->number = $objp->banumber;
425 $bankaccountstatic->currency_code = $objp->bacurrency_code;
427 if (isModEnabled(
'accounting')) {
428 $bankaccountstatic->account_number = $objp->account_number;
431 $accountingjournal->fetch($objp->fk_accountancy_journal);
432 $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
435 print
'<td class="right">';
436 if ($bankaccountstatic->id) {
437 print $bankaccountstatic->getNomUrl(1,
'transactions');
441 print
'<td class="right nowrap amountcard">'.price($objp->amount).
"</td>\n";
443 $totalpaid += $objp->amount;
447 print
'<tr class="oddeven"><td><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
448 print
'<td></td><td></td><td></td><td></td>';
455 $resteapayer = (float)
$object->amount - $totalpaid;
470print
'<div class="clearboth"></div>';
476print
'<div class="tabsAction">'.
"\n";
478$sql =
"SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,";
479$sql .=
" pfd.date_traite as date_traite, pfd.amount, pfd.fk_prelevement_bons,";
480$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,";
481$sql .=
" u.rowid as user_id, u.email, u.lastname, u.firstname, u.login, u.statut as user_status";
482$sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
483$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u on pfd.fk_user_demande = u.rowid";
484$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons";
485if ($type ==
'salaire') {
486 $sql .=
" WHERE pfd.fk_salary = ".((int)
$object->id);
488 $sql .=
" WHERE fk_facture = ".((int)
$object->id);
490$sql .=
" AND pfd.traite = 0";
491$sql .=
" AND pfd.type = 'ban'";
492$sql .=
" ORDER BY pfd.date_demande DESC";
493$resql = $db->query($sql);
495$hadRequest = $db->num_rows($resql);
496if (
$object->paye == 0 && $hadRequest == 0) {
497 if ($resteapayer > 0) {
499 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
500 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
501 print
'<input type="hidden" name="id" value="'.$object->id.
'" />';
502 print
'<input type="hidden" name="type" value="'.$type.
'" />';
503 print
'<input type="hidden" name="action" value="add" />';
504 print
'<label for="withdraw_request_amount">'.$langs->trans(
'BankTransferAmount').
' </label>';
505 print
'<input type="text" id="withdraw_request_amount" name="request_transfer" value="'.price($resteapayer, 0, $langs, 1, -1, -1).
'" size="9" />';
506 print
'<input type="submit" class="butAction" value="'.$buttonlabel.
'" />';
513 $buttonlabel = $langs->trans(
"MakeWithdrawRequestStripe");
514 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
515 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
516 print
'<input type="hidden" name="id" value="'.$object->id.
'" />';
517 print
'<input type="hidden" name="type" value="'.$type.
'" />';
518 print
'<input type="hidden" name="action" value="add" />';
519 print
'<input type="hidden" name="paymenservice" value="stripesepa" />';
520 print
'<label for="withdraw_request_amount">'.$langs->trans(
'BankTransferAmount').
' </label>';
521 print
'<input type="text" id="withdraw_request_amount" name="request_transfer" value="'.price($resteapayer, 0, $langs, 1, -1, -1).
'" size="9" />';
522 print
'<input type="submit" class="butAction" value="'.$buttonlabel.
'" />';
526 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$buttonlabel.
'</a>';
529 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"AmountMustBePositive")).
'">'.$buttonlabel.
'</a>';
532 if ($hadRequest == 0) {
534 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"AlreadyPaid")).
'">'.$buttonlabel.
'</a>';
536 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"Draft")).
'">'.$buttonlabel.
'</a>';
539 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"RequestAlreadyDone")).
'">'.$buttonlabel.
'</a>';
551print
'<div class="div-table-responsive-no-min">';
552print
'<table class="noborder centpercent">';
554print
'<tr class="liste_titre">';
557 print
'<td> </td>';
559print
'<td class="left">'.$langs->trans(
"DateRequest").
'</td>';
560print
'<td>'.$langs->trans(
"User").
'</td>';
561print
'<td class="center">'.$langs->trans(
"Amount").
'</td>';
562print
'<td class="center">'.$langs->trans(
"DateProcess").
'</td>';
563if ($type ==
'bank-transfer') {
564 print
'<td class="center">'.$langs->trans(
"BankTransferReceipt").
'</td>';
566 print
'<td class="center">'.$langs->trans(
"WithdrawalReceipt").
'</td>';
568print
'<td> </td>';
571 print
'<td> </td>';
579 $tmpuser =
new User($db);
581 $num = $db->num_rows($result);
584 $obj = $db->fetch_object($resql);
586 $tmpuser->id = $obj->user_id;
587 $tmpuser->login = $obj->login;
588 $tmpuser->ref = $obj->login;
589 $tmpuser->email = $obj->email;
590 $tmpuser->lastname = $obj->lastname;
591 $tmpuser->firstname = $obj->firstname;
592 $tmpuser->statut = $obj->user_status;
593 $tmpuser->status = $obj->user_status;
595 print
'<tr class="oddeven">';
599 print
'<td class="right">';
600 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'&did='.$obj->rowid.
'&type='.urlencode($type).
'">';
606 print
'<td class="nowraponall">'.dol_print_date($db->jdate($obj->date_demande),
'dayhour').
"</td>\n";
609 print
'<td class="tdoverflowmax125">';
610 print $tmpuser->getNomUrl(-1,
'', 0, 0, 0, 0,
'login');
614 print
'<td class="center"><span class="amount">'.price($obj->amount).
'</span></td>';
617 print
'<td class="center"><span class="opacitymedium">'.$langs->trans(
"OrderWaiting").
'</span></td>';
620 print
'<td class="minwidth75">';
621 if ($obj->fk_prelevement_bons > 0) {
623 $withdrawreceipt->id = $obj->fk_prelevement_bons;
624 $withdrawreceipt->ref = $obj->ref;
625 $withdrawreceipt->date_trans = $db->jdate($obj->date_trans);
626 $withdrawreceipt->date_credit = $db->jdate($obj->date_credit);
627 $withdrawreceipt->date_creation = $db->jdate($obj->datec);
628 $withdrawreceipt->statut = $obj->status;
629 $withdrawreceipt->status = $obj->status;
630 $withdrawreceipt->amount = $obj->pb_amount;
633 print $withdrawreceipt->getNomUrl(1);
636 if (!in_array($type, array(
'bank-transfer',
'salaire',
'salary'))) {
638 $langs->load(
"stripe");
639 if ($obj->fk_prelevement_bons > 0) {
642 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>';
646 $langs->load(
"stripe");
647 if ($obj->fk_prelevement_bons > 0) {
650 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>';
656 print
'<td class="center">-</td>';
660 print
'<td class="right">';
661 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'&did='.$obj->rowid.
'&type='.urlencode($type).
'">';
678$sql =
"SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,";
679$sql .=
" pfd.date_traite as date_traite, pfd.amount, pfd.fk_prelevement_bons,";
680$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,";
681$sql .=
" u.rowid as user_id, u.email, u.lastname, u.firstname, u.login, u.statut as user_status";
682$sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
683$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u on pfd.fk_user_demande = u.rowid";
684$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons";
685if ($type ==
'salaire') {
686 $sql .=
" WHERE pfd.fk_salary = ".((int)
$object->id);
688 $sql .=
" WHERE fk_facture = ".((int)
$object->id);
690$sql .=
" AND pfd.traite = 1";
691$sql .=
" AND pfd.type = 'ban'";
692$sql .=
" ORDER BY pfd.date_demande DESC";
694$resql = $db->query($sql);
696 $numOfBp = $db->num_rows($resql);
698 $tmpuser =
new User($db);
700 while ($i < $numOfBp) {
701 $obj = $db->fetch_object($resql);
703 $tmpuser->id = $obj->user_id;
704 $tmpuser->login = $obj->login;
705 $tmpuser->ref = $obj->login;
706 $tmpuser->email = $obj->email;
707 $tmpuser->lastname = $obj->lastname;
708 $tmpuser->firstname = $obj->firstname;
709 $tmpuser->statut = $obj->user_status;
710 $tmpuser->status = $obj->user_status;
712 print
'<tr class="oddeven">';
716 print
'<td> </td>';
720 print
'<td class="nowraponall">'.dol_print_date($db->jdate($obj->date_demande),
'dayhour').
"</td>\n";
723 print
'<td class="tdoverflowmax125">';
724 print $tmpuser->getNomUrl(-1,
'', 0, 0, 0, 0,
'login');
728 print
'<td class="center"><span class="amount">'.price($obj->amount).
'</span></td>';
731 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->date_traite),
'dayhour',
'tzuserrel').
"</td>\n";
734 print
'<td class="center minwidth75">';
735 if ($obj->fk_prelevement_bons > 0) {
737 $withdrawreceipt->id = $obj->fk_prelevement_bons;
738 $withdrawreceipt->ref = $obj->ref;
739 $withdrawreceipt->date_trans = $db->jdate($obj->date_trans);
740 $withdrawreceipt->date_credit = $db->jdate($obj->date_credit);
741 $withdrawreceipt->date_creation = $db->jdate($obj->datec);
742 $withdrawreceipt->statut = $obj->status;
743 $withdrawreceipt->status = $obj->status;
744 $withdrawreceipt->fk_bank_account = $obj->fk_bank_account;
745 $withdrawreceipt->amount = $obj->pb_amount;
748 print $withdrawreceipt->getNomUrl(1);
750 print $withdrawreceipt->getLibStatut(2);
753 $fk_bank_account = $withdrawreceipt->fk_bank_account;
754 if (empty($fk_bank_account)) {
755 $fk_bank_account = (
$object->type ==
'bank-transfer' ?
$conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT :
$conf->global->PRELEVEMENT_ID_BANKACCOUNT);
757 if ($fk_bank_account > 0) {
758 $bankaccount =
new Account($db);
759 $result = $bankaccount->fetch($fk_bank_account);
762 print $bankaccount->getNomUrl(1);
769 print
'<td> </td>';
773 print
'<td> </td>';
785if ($num == 0 && $numOfBp == 0) {
786 print
'<tr class="oddeven"><td colspan="7"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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 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.
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, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
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=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.