29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/salaries/class/salary.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/salaries.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/fourn.lib.php';
47require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/discount.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
54if (isModEnabled(
'project')) {
55 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
56 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
60$langs->loadLangs(array(
"compta",
"bills",
"users",
"salaries",
"hrm",
"withdrawals"));
64$action =
GETPOST(
'action',
'aZ09');
67$label =
GETPOST(
'label',
'alphanohtml');
73 $socid = $user->socid;
81$childids = $user->getAllChildIds(1);
84$extrafields->fetch_name_optionals_label(
$object->table_element);
87$hookmanager->initHooks(array(
'salaryinfo',
'globalcard'));
90if ($id > 0 || !empty($ref)) {
95 if ($user->hasRight(
'salaries',
'readall')) {
98 if ($user->hasRight(
'salaries',
'read') &&
$object->fk_user > 0 && in_array(
$object->fk_user, $childids)) {
106$permissiontoread = $user->hasRight(
'salaries',
'read');
107$permissiontoadd = $user->hasRight(
'salaries',
'write');
108$permissiontodelete = $user->hasRight(
'salaries',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_UNPAID);
111if ($type ==
'bank-transfer') {
113 $moreparam =
'&type='.$type;
119if ($id > 0 || !empty($ref)) {
120 $ret =
$object->fetch($id, $ref);
127$hookmanager->initHooks(array(
'directdebitcard',
'globalcard'));
137if ($action ==
'classin' && $user->hasRight(
'banque',
'modifier')) {
139 $object->setProject($projectid);
143if ($action ==
'setlabel' && $user->hasRight(
'salaries',
'write')) {
149$parameters = array(
'socid' => $socid);
150$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $obj, $action);
156if ($action ==
"new") {
161 $sourcetype =
'salaire';
162 $newtype =
'salaire';
163 $paymentservice =
GETPOST(
'paymentservice');
164 $result =
$object->demande_prelevement($user,
price2num(
GETPOST(
'request_transfer',
'alpha')), $newtype, $sourcetype);
179if ($action ==
"delete" && $permissiontodelete) {
183 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
196if (isModEnabled(
'project')) {
200$title = $langs->trans(
'Salary').
" - ".$langs->trans(
'Info');
207$head = salaries_prepare_head($object);
209print
dol_get_fiche_head($head,
'request_virement', $langs->trans(
"SalaryPayment"), -1,
'salary');
211$linkback =
'<a href="'.DOL_URL_ROOT.
'/salaries/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
213$morehtmlref =
'<div class="refidno">';
215$userstatic =
new User($db);
216$userstatic->fetch(
$object->fk_user);
220if ($action !=
'editlabel') {
221 $morehtmlref .= $form->editfieldkey(
"Label",
'label',
$object->label, $object, $user->hasRight(
'salaries',
'write'),
'string',
'', 0, 1);
222 $morehtmlref .=
$object->label;
224 $morehtmlref .= $langs->trans(
'Label').
' : ';
225 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
226 $morehtmlref .=
'<input type="hidden" name="action" value="setlabel">';
227 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
228 $morehtmlref .=
'<input type="text" name="label" value="'.$object->label.
'"/>';
229 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
230 $morehtmlref .=
'</form>';
233$morehtmlref .=
'<br>'.$langs->trans(
'Employee').
' : '.$userstatic->getNomUrl(-1);
235$usercancreate = $permissiontoadd;
238if (isModEnabled(
'project')) {
239 $langs->load(
"projects");
240 $morehtmlref .=
'<br>';
241 if ($usercancreate) {
242 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
243 if ($action !=
'classify') {
244 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
246 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
248 if (!empty(
$object->fk_project)) {
250 $proj->fetch(
$object->fk_project);
251 $morehtmlref .= $proj->getNomUrl(1);
253 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
259$morehtmlref .=
'</div>';
261dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'',
'');
263print
'<div class="fichecenter">';
264print
'<div class="fichehalfleft">';
266print
'<div class="underbanner clearboth"></div>';
269print
'<table class="border centpercent tableforfield">';
271if ($action ==
'edit') {
272 print
'<tr><td class="titlefield">'.$langs->trans(
"DateStartPeriod").
"</td><td>";
273 print $form->selectDate(
$object->datesp,
'datesp', 0, 0, 0,
'datesp', 1);
277 print
'<td class="titlefield">' . $langs->trans(
"DateStartPeriod") .
'</td><td>';
282if ($action ==
'edit') {
283 print
'<tr><td>'.$langs->trans(
"DateEndPeriod").
"</td><td>";
284 print $form->selectDate(
$object->dateep,
'dateep', 0, 0, 0,
'dateep', 1);
288 print
'<td>' . $langs->trans(
"DateEndPeriod") .
'</td><td>';
292if ($action ==
'edit') {
293 print
'<tr><td class="fieldrequired">' . $langs->trans(
"Amount") .
'</td><td><input name="amount" size="10" value="' .
price(
$object->amount) .
'"></td></tr>';
295 print
'<tr><td>' . $langs->trans(
"Amount") .
'</td><td><span class="amount">' .
price(
$object->amount, 0, $langs, 1, -1, -1, $conf->currency) .
'</span></td></tr>';
300print
'<table class="nobordernopadding" width="100%"><tr><td>';
301print $langs->trans(
'DefaultPaymentMode');
303if ($action !=
'editmode') {
304 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>';
306print
'</tr></table>';
309if ($action ==
'editmode') {
310 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->type_payment,
'mode_reglement_id');
312 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->type_payment,
'none');
317if (isModEnabled(
"bank")) {
318 print
'<tr><td class="nowrap">';
319 print
'<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
320 print $langs->trans(
'DefaultBankAccount');
322 if ($action !=
'editbankaccount' && $user->hasRight(
'salaries',
'write')) {
323 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>';
325 print
'</tr></table>';
327 if ($action ==
'editbankaccount') {
328 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->fk_account,
'fk_account', 1);
330 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->fk_account,
'none');
337include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
342$user_perms = $user->hasRight(
'virement',
'bons',
'creer');
343$buttonlabel = $langs->trans(
"MakeTransferRequest");
344$user_perms = $user->hasRight(
'paymentbybanktransfer',
'create');
346print
'<div class="fichehalfright">';
350$sql =
"SELECT p.rowid, p.num_payment as num_payment, p.datep as dp, p.amount,";
351$sql .=
" c.code as type_code,c.libelle as paiement_type,";
352$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';
353$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as p";
354$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank as b ON p.fk_bank = b.rowid';
355$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank_account as ba ON b.fk_account = ba.rowid';
356$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_typepayment = c.id";
357$sql .=
", ".MAIN_DB_PREFIX.
"salary as s";
358$sql .=
" WHERE p.fk_salary = ".((int) $id);
359$sql .=
" AND p.fk_salary = s.rowid";
360$sql .=
" AND s.entity IN (".getEntity(
'tax').
")";
361$sql .=
" ORDER BY dp DESC";
364$resql = $db->query($sql);
368 $num = $db->num_rows($resql);
373 print
'<div class="div-table-responsive-no-min">';
374 print
'<table class="noborder paymenttable">';
375 print
'<tr class="liste_titre">';
376 print
'<td>'.$langs->trans(
"RefPayment").
'</td>';
377 print
'<td>'.$langs->trans(
"Date").
'</td>';
378 print
'<td>'.$langs->trans(
"Type").
'</td>';
379 if (isModEnabled(
"bank")) {
380 print
'<td class="liste_titre right">'.$langs->trans(
'BankAccount').
'</td>';
382 print
'<td class="right">'.$langs->trans(
"Amount").
'</td>';
386 $bankaccountstatic =
new Account($db);
388 $objp = $db->fetch_object($resql);
390 print
'<tr class="oddeven"><td>';
391 print
'<a href="'.DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id='.$objp->rowid.
'">'.
img_object($langs->trans(
"Payment"),
"payment").
' '.$objp->rowid.
'</a></td>';
392 print
'<td>'.dol_print_date($db->jdate($objp->dp),
'dayhour',
'tzuserrel').
"</td>\n";
393 $labeltype = $langs->trans(
"PaymentType".$objp->type_code) !=
"PaymentType".$objp->type_code ? $langs->trans(
"PaymentType".$objp->type_code) : $objp->paiement_type;
394 print
"<td>".$labeltype.
' '.$objp->num_payment.
"</td>\n";
395 if (isModEnabled(
"bank")) {
396 $bankaccountstatic->id = $objp->baid;
397 $bankaccountstatic->ref = $objp->baref;
398 $bankaccountstatic->label = $objp->baref;
399 $bankaccountstatic->number = $objp->banumber;
400 $bankaccountstatic->currency_code = $objp->bacurrency_code;
402 if (isModEnabled(
'accounting')) {
403 $bankaccountstatic->account_number = $objp->account_number;
406 $accountingjournal->fetch($objp->fk_accountancy_journal);
407 $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
410 print
'<td class="right">';
411 if ($bankaccountstatic->id) {
412 print $bankaccountstatic->getNomUrl(1,
'transactions');
416 print
'<td class="right nowrap amountcard">'.price($objp->amount).
"</td>\n";
418 $totalpaid += $objp->amount;
422 print
'<tr class="oddeven"><td><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
423 print
'<td></td><td></td><td></td><td></td>';
430 $resteapayer =
$object->amount - $totalpaid;
445print
'<div class="clearboth"></div>';
451print
'<div class="tabsAction">'.
"\n";
453$sql =
"SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,";
454$sql .=
" pfd.date_traite as date_traite, pfd.amount, pfd.fk_prelevement_bons,";
455$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,";
456$sql .=
" u.rowid as user_id, u.email, u.lastname, u.firstname, u.login, u.statut as user_status";
457$sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
458$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u on pfd.fk_user_demande = u.rowid";
459$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons";
460if ($type ==
'salaire') {
461 $sql .=
" WHERE pfd.fk_salary = ".((int)
$object->id);
463 $sql .=
" WHERE fk_facture = ".((int)
$object->id);
465$sql .=
" AND pfd.traite = 0";
466$sql .=
" AND pfd.type = 'ban'";
467$sql .=
" ORDER BY pfd.date_demande DESC";
468$resql = $db->query($sql);
470$hadRequest = $db->num_rows($resql);
471if (
$object->paye == 0 && $hadRequest == 0) {
472 if ($resteapayer > 0) {
474 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
475 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
476 print
'<input type="hidden" name="id" value="'.$object->id.
'" />';
477 print
'<input type="hidden" name="type" value="'.$type.
'" />';
478 print
'<input type="hidden" name="action" value="new" />';
479 print
'<label for="withdraw_request_amount">'.$langs->trans(
'BankTransferAmount').
' </label>';
480 print
'<input type="text" id="withdraw_request_amount" name="request_transfer" value="'.price($resteapayer, 0, $langs, 1, -1, -1).
'" size="9" />';
481 print
'<input type="submit" class="butAction" value="'.$buttonlabel.
'" />';
488 $buttonlabel = $langs->trans(
"MakeWithdrawRequestStripe");
489 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
490 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
491 print
'<input type="hidden" name="id" value="'.$object->id.
'" />';
492 print
'<input type="hidden" name="type" value="'.$type.
'" />';
493 print
'<input type="hidden" name="action" value="new" />';
494 print
'<input type="hidden" name="paymenservice" value="stripesepa" />';
495 print
'<label for="withdraw_request_amount">'.$langs->trans(
'BankTransferAmount').
' </label>';
496 print
'<input type="text" id="withdraw_request_amount" name="request_transfer" value="'.price($resteapayer, 0, $langs, 1, -1, -1).
'" size="9" />';
497 print
'<input type="submit" class="butAction" value="'.$buttonlabel.
'" />';
501 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$buttonlabel.
'</a>';
504 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"AmountMustBePositive")).
'">'.$buttonlabel.
'</a>';
507 if ($hadRequest == 0) {
509 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"AlreadyPaid")).
'">'.$buttonlabel.
'</a>';
511 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"Draft")).
'">'.$buttonlabel.
'</a>';
514 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"RequestAlreadyDone")).
'">'.$buttonlabel.
'</a>';
532print
'<div class="div-table-responsive-no-min">';
533print
'<table class="noborder centpercent">';
535print
'<tr class="liste_titre">';
538 print
'<td> </td>';
540print
'<td class="left">'.$langs->trans(
"DateRequest").
'</td>';
541print
'<td>'.$langs->trans(
"User").
'</td>';
542print
'<td class="center">'.$langs->trans(
"Amount").
'</td>';
543print
'<td class="center">'.$langs->trans(
"DateProcess").
'</td>';
544if ($type ==
'bank-transfer') {
545 print
'<td class="center">'.$langs->trans(
"BankTransferReceipt").
'</td>';
547 print
'<td class="center">'.$langs->trans(
"WithdrawalReceipt").
'</td>';
549print
'<td> </td>';
552 print
'<td> </td>';
560 $tmpuser =
new User($db);
562 $num = $db->num_rows($result);
565 $obj = $db->fetch_object($resql);
567 $tmpuser->id = $obj->user_id;
568 $tmpuser->login = $obj->login;
569 $tmpuser->ref = $obj->login;
570 $tmpuser->email = $obj->email;
571 $tmpuser->lastname = $obj->lastname;
572 $tmpuser->firstname = $obj->firstname;
573 $tmpuser->statut = $obj->user_status;
574 $tmpuser->status = $obj->user_status;
576 print
'<tr class="oddeven">';
580 print
'<td class="right">';
581 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'&did='.$obj->rowid.
'&type='.urlencode($type).
'">';
587 print
'<td class="nowraponall">'.dol_print_date($db->jdate($obj->date_demande),
'dayhour').
"</td>\n";
590 print
'<td class="tdoverflowmax125">';
591 print $tmpuser->getNomUrl(-1,
'', 0, 0, 0, 0,
'login');
595 print
'<td class="center"><span class="amount">'.price($obj->amount).
'</span></td>';
598 print
'<td class="center"><span class="opacitymedium">'.$langs->trans(
"OrderWaiting").
'</span></td>';
601 print
'<td class="minwidth75">';
602 if ($obj->fk_prelevement_bons > 0) {
604 $withdrawreceipt->id = $obj->fk_prelevement_bons;
605 $withdrawreceipt->ref = $obj->ref;
606 $withdrawreceipt->date_trans = $db->jdate($obj->date_trans);
607 $withdrawreceipt->date_credit = $db->jdate($obj->date_credit);
608 $withdrawreceipt->date_creation = $db->jdate($obj->datec);
609 $withdrawreceipt->statut = $obj->status;
610 $withdrawreceipt->status = $obj->status;
611 $withdrawreceipt->amount = $obj->pb_amount;
614 print $withdrawreceipt->getNomUrl(1);
617 if (!in_array($type, array(
'bank-transfer',
'salaire',
'salary'))) {
619 $langs->load(
"stripe");
620 if ($obj->fk_prelevement_bons > 0) {
623 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>';
627 $langs->load(
"stripe");
628 if ($obj->fk_prelevement_bons > 0) {
631 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>';
637 print
'<td class="center">-</td>';
641 print
'<td class="right">';
642 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'&did='.$obj->rowid.
'&type='.urlencode($type).
'">';
659$sql =
"SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,";
660$sql .=
" pfd.date_traite as date_traite, pfd.amount, pfd.fk_prelevement_bons,";
661$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,";
662$sql .=
" u.rowid as user_id, u.email, u.lastname, u.firstname, u.login, u.statut as user_status";
663$sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
664$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as u on pfd.fk_user_demande = u.rowid";
665$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons";
666if ($type ==
'salaire') {
667 $sql .=
" WHERE pfd.fk_salary = ".((int)
$object->id);
669 $sql .=
" WHERE fk_facture = ".((int)
$object->id);
671$sql .=
" AND pfd.traite = 1";
672$sql .=
" AND pfd.type = 'ban'";
673$sql .=
" ORDER BY pfd.date_demande DESC";
675$resql = $db->query($sql);
677 $numOfBp = $db->num_rows($resql);
679 $tmpuser =
new User($db);
681 while ($i < $numOfBp) {
682 $obj = $db->fetch_object($resql);
684 $tmpuser->id = $obj->user_id;
685 $tmpuser->login = $obj->login;
686 $tmpuser->ref = $obj->login;
687 $tmpuser->email = $obj->email;
688 $tmpuser->lastname = $obj->lastname;
689 $tmpuser->firstname = $obj->firstname;
690 $tmpuser->statut = $obj->user_status;
691 $tmpuser->status = $obj->user_status;
693 print
'<tr class="oddeven">';
697 print
'<td> </td>';
701 print
'<td class="nowraponall">'.dol_print_date($db->jdate($obj->date_demande),
'dayhour').
"</td>\n";
704 print
'<td class="tdoverflowmax125">';
705 print $tmpuser->getNomUrl(-1,
'', 0, 0, 0, 0,
'login');
709 print
'<td class="center"><span class="amount">'.price($obj->amount).
'</span></td>';
712 print
'<td class="center nowraponall">'.dol_print_date($db->jdate($obj->date_traite),
'dayhour',
'tzuserrel').
"</td>\n";
715 print
'<td class="center minwidth75">';
716 if ($obj->fk_prelevement_bons > 0) {
718 $withdrawreceipt->id = $obj->fk_prelevement_bons;
719 $withdrawreceipt->ref = $obj->ref;
720 $withdrawreceipt->date_trans = $db->jdate($obj->date_trans);
721 $withdrawreceipt->date_credit = $db->jdate($obj->date_credit);
722 $withdrawreceipt->date_creation = $db->jdate($obj->datec);
723 $withdrawreceipt->statut = $obj->status;
724 $withdrawreceipt->status = $obj->status;
725 $withdrawreceipt->fk_bank_account = $obj->fk_bank_account;
726 $withdrawreceipt->amount = $obj->pb_amount;
729 print $withdrawreceipt->getNomUrl(1);
731 print $withdrawreceipt->getLibStatut(2);
734 $fk_bank_account = $withdrawreceipt->fk_bank_account;
735 if (empty($fk_bank_account)) {
736 $fk_bank_account = (
$object->type ==
'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
738 if ($fk_bank_account > 0) {
739 $bankaccount =
new Account($db);
740 $result = $bankaccount->fetch($fk_bank_account);
743 print $bankaccount->getNomUrl(1);
750 print
'<td> </td>';
754 print
'<td> </td>';
766if ($num == 0 && $numOfBp == 0) {
767 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
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.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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_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.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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 dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify 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.