31 require
'../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/user/class/userbankaccount.class.php';
36 if (!empty($conf->holiday->enabled)) {
37 require_once DOL_DOCUMENT_ROOT.
'/holiday/class/holiday.class.php';
39 if (!empty($conf->expensereport->enabled)) {
40 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
42 if (!empty($conf->salaries->enabled)) {
43 require_once DOL_DOCUMENT_ROOT.
'/salaries/class/salary.class.php';
44 require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
48 $langs->loadLangs(array(
'companies',
'commercial',
'banks',
'bills',
'trips',
'holiday',
'salaries'));
51 $ref =
GETPOST(
'ref',
'alphanohtml');
52 $bankid =
GETPOST(
'bankid',
'int');
53 $action =
GETPOST(
"action",
'alpha');
54 $cancel =
GETPOST(
'cancel',
'alpha');
58 if ($user->socid > 0) {
59 $socid = $user->socid;
61 $feature2 = (($socid && $user->rights->user->self->creer) ?
'' :
'user');
63 $object =
new User($db);
64 if ($id > 0 || !empty($ref)) {
65 $result = $object->fetch($id, $ref,
'', 1);
71 $account->fetch(0,
'', $id);
73 $account->fetch($bankid);
75 if (empty($account->userid)) {
76 $account->userid = $object->id;
81 $canadduser = (!empty($user->admin) || $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write);
82 $canreaduser = (!empty($user->admin) || $user->rights->user->user->lire || $user->rights->hrm->read_personal_information->read);
83 $permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || !empty($user->rights->user->creer));
88 if ($user->id == $id) {
91 if (!empty($user->rights->salaries->read)) {
94 if (!empty($user->rights->hrm->read)) {
97 if (!empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) {
109 if ($action ==
'add' && !$cancel && $permissiontoaddbankaccount) {
110 $account->userid = $object->id;
112 $account->bank =
GETPOST(
'bank',
'alpha');
113 $account->label =
GETPOST(
'label',
'alpha');
114 $account->courant =
GETPOST(
'courant',
'alpha');
115 $account->code_banque =
GETPOST(
'code_banque',
'alpha');
116 $account->code_guichet =
GETPOST(
'code_guichet',
'alpha');
117 $account->number =
GETPOST(
'number',
'alpha');
118 $account->cle_rib =
GETPOST(
'cle_rib',
'alpha');
119 $account->bic =
GETPOST(
'bic',
'alpha');
120 $account->iban =
GETPOST(
'iban',
'alpha');
121 $account->domiciliation =
GETPOST(
'domiciliation',
'alpha');
122 $account->proprio =
GETPOST(
'proprio',
'alpha');
123 $account->owner_address =
GETPOST(
'owner_address',
'alpha');
125 $result = $account->create($user);
136 if ($action ==
'update' && !$cancel && $permissiontoaddbankaccount) {
137 $account->userid = $object->id;
182 $account->bank =
GETPOST(
'bank',
'alpha');
183 $account->label =
GETPOST(
'label',
'alpha');
184 $account->courant =
GETPOST(
'courant',
'alpha');
185 $account->code_banque =
GETPOST(
'code_banque',
'alpha');
186 $account->code_guichet =
GETPOST(
'code_guichet',
'alpha');
187 $account->number =
GETPOST(
'number',
'alpha');
188 $account->cle_rib =
GETPOST(
'cle_rib',
'alpha');
189 $account->bic =
GETPOST(
'bic',
'alpha');
190 $account->iban =
GETPOST(
'iban',
'alpha');
191 $account->domiciliation =
GETPOST(
'domiciliation',
'alpha');
192 $account->proprio =
GETPOST(
'proprio',
'alpha');
193 $account->owner_address =
GETPOST(
'owner_address',
'alpha');
195 $result = $account->update($user);
207 if ($action ==
'setbirth' && $canadduser && !$cancel) {
209 $result = $object->update($user);
216 if ($action ==
'setpersonal_email' && $canadduser && !$cancel) {
217 $object->personal_email = (string)
GETPOST(
'personal_email',
'alphanohtml');
218 $result = $object->update($user);
225 if ($action ==
'setpersonal_mobile' && $canadduser && !$cancel) {
226 $object->personal_mobile = (string)
GETPOST(
'personal_mobile',
'alphanohtml');
227 $result = $object->update($user);
234 if ($action ==
'setref_employee' && $canadduser && !$cancel) {
235 $object->ref_employee = (string)
GETPOST(
'ref_employee',
'alphanohtml');
236 $result = $object->update($user);
243 if ($action ==
'setnational_registration_number' && $canadduser && !$cancel) {
244 $object->national_registration_number = (string)
GETPOST(
'national_registration_number',
'alphanohtml');
245 $result = $object->update($user);
251 if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
253 if ($action ==
'setdefault_c_exp_tax_cat' && $canadduser) {
254 $object->default_c_exp_tax_cat =
GETPOST(
'default_c_exp_tax_cat',
'int');
255 $result = $object->update($user);
262 if ($action ==
'setdefault_range' && $canadduser) {
263 $object->default_range =
GETPOST(
'default_range',
'int');
264 $result = $object->update($user);
278 $childids = $user->getAllChildIds(1);
280 llxHeader(null, $langs->trans(
"BankAccounts"));
284 if ($id && $bankid && $action ==
'edit' && ($user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write)) {
285 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'" method="post">';
286 print
'<input type="hidden" name="token" value="'.newToken().
'">';
287 print
'<input type="hidden" name="action" value="update">';
288 print
'<input type="hidden" name="id" value="'.GETPOST(
"id",
'int').
'">';
289 print
'<input type="hidden" name="bankid" value="'.$bankid.
'">';
291 if ($id && $action ==
'create' && $user->rights->user->user->creer) {
292 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'" method="post">';
293 print
'<input type="hidden" name="token" value="'.newToken().
'">';
294 print
'<input type="hidden" name="action" value="add">';
295 print
'<input type="hidden" name="bankid" value="'.$bankid.
'">';
300 if ($action !=
'edit' && $action !=
'create') {
301 $title = $langs->trans(
"User");
306 if ($user->rights->user->user->lire || $user->admin) {
307 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
310 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/user/vcard.php?id='.$object->id.
'" class="refid">';
311 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
312 $morehtmlref .=
'</a>';
314 dol_banner_tab($object,
'id', $linkback, $user->rights->user->user->lire || $user->admin,
'rowid',
'ref', $morehtmlref);
316 print
'<div class="fichecenter"><div class="fichehalfleft">';
318 print
'<div class="underbanner clearboth"></div>';
320 print
'<table class="border centpercent tableforfield">';
322 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"Login").
'</td>';
323 if (!empty($object->ldap_sid) && $object->statut == 0) {
324 print
'<td class="error">';
325 print $langs->trans(
"LoginAccountDisableInDolibarr");
330 if (property_exists($object,
'admin')) {
331 if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
332 $addadmin .=
img_picto($langs->trans(
"SuperAdministratorDesc"),
"redstar",
'class="paddingleft"');
333 } elseif (!empty($object->admin)) {
334 $addadmin .=
img_picto($langs->trans(
"AdministratorDesc"),
"star",
'class="paddingleft"');
344 print
'<tr><td>'.$langs->trans(
"HierarchicalResponsible").
'</td>';
346 if (empty($object->fk_user)) {
347 print
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>';
349 $huser =
new User($db);
350 if ($object->fk_user > 0) {
351 $huser->fetch($object->fk_user);
352 print $huser->getNomUrl(1);
354 print
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>';
361 if (!empty($conf->expensereport->enabled)) {
363 $text = $langs->trans(
"ForceUserExpenseValidator");
364 print
$form->textwithpicto($text, $langs->trans(
"ValidatorIsSupervisorByDefault"), 1,
'help');
367 if (!empty($object->fk_user_expense_validator)) {
368 $evuser =
new User($db);
369 $evuser->fetch($object->fk_user_expense_validator);
370 print $evuser->getNomUrl(1);
377 if (!empty($conf->holiday->enabled)) {
379 $text = $langs->trans(
"ForceUserHolidayValidator");
380 print
$form->textwithpicto($text, $langs->trans(
"ValidatorIsSupervisorByDefault"), 1,
'help');
383 if (!empty($object->fk_user_holiday_validator)) {
384 $hvuser =
new User($db);
385 $hvuser->fetch($object->fk_user_holiday_validator);
386 print $hvuser->getNomUrl(1);
393 print
'<tr><td>'.$langs->trans(
"PostOrFunction").
'</td>';
394 print
'<td>'.dol_escape_htmltag($object->job).
'</td>';
398 print
'<tr><td>'.$langs->trans(
"WeeklyHours").
'</td>';
405 if ((empty($user->socid) && in_array($id, $childids))
406 || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall))
407 || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) {
408 $langs->load(
"salaries");
411 print
'<tr><td>'.$langs->trans(
"Salary").
'</td>';
413 print ($object->salary !=
'' ?
img_picto(
'',
'salary',
'class="pictofixedwidth paddingright"').
'<span class="amount">'.
price($object->salary,
'', $langs, 1, -1, -1, $conf->currency) :
'').
'</span>';
419 $text = $langs->trans(
"THM");
420 print
$form->textwithpicto($text, $langs->trans(
"THMDescription"), 1,
'help',
'classthm');
423 print ($object->thm !=
'' ?
price($object->thm,
'', $langs, 1, -1, -1, $conf->currency) :
'');
429 $text = $langs->trans(
"TJM");
430 print
$form->textwithpicto($text, $langs->trans(
"TJMDescription"), 1,
'help',
'classtjm');
433 print ($object->tjm !=
'' ?
price($object->tjm,
'', $langs, 1, -1, -1, $conf->currency) :
'');
439 print
'<tr><td>'.$langs->trans(
"DateOfEmployment").
'</td>';
441 if ($object->dateemployment) {
442 print
'<span class="opacitymedium">'.$langs->trans(
"FromDate").
'</span> ';
445 if ($object->dateemploymentend) {
446 print
'<span class="opacitymedium"> - '.$langs->trans(
"To").
'</span> ';
453 if ($user->hasRight(
'hrm',
'read_personal_information',
'read') || $user->hasRight(
'hrm',
'write_personal_information',
'write')) {
456 print
$form->editfieldkey(
"DateOfBirth",
'birth', $object->birth, $object, $user->rights->user->user->creer);
458 print
$form->editfieldval(
"DateOfBirth",
'birth', $object->birth, $object, $user->rights->user->user->creer,
'day', $object->birth);
464 if ($user->hasRight(
'hrm',
'read_personal_information',
'read') || $user->hasRight(
'hrm',
'write_personal_information',
'write')) {
465 print
'<tr class="nowrap">';
467 print
$form->editfieldkey(
"UserPersonalEmail",
'personal_email', $object->personal_email, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write);
469 print
$form->editfieldval(
"UserPersonalEmail",
'personal_email', $object->personal_email, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write,
'email',
'', null, null,
'', 0,
'dol_print_email');
475 if ($user->hasRight(
'hrm',
'read_personal_information',
'read') || $user->hasRight(
'hrm',
'write_personal_information',
'write')) {
476 print
'<tr class="nowrap">';
478 print
$form->editfieldkey(
"UserPersonalMobile",
'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write);
480 print
$form->editfieldval(
"UserPersonalMobile",
'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write,
'string',
'', null, null,
'', 0,
'dol_print_phone');
485 if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
486 print
'<tr class="nowrap">';
488 print
$form->editfieldkey(
"DefaultCategoryCar",
'default_c_exp_tax_cat', $object->default_c_exp_tax_cat, $object, $user->rights->user->user->creer);
490 if ($action ==
'editdefault_c_exp_tax_cat') {
491 $ret =
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].($moreparam ?
'?'.$moreparam :
'').
'">';
492 $ret .=
'<input type="hidden" name="action" value="setdefault_c_exp_tax_cat">';
493 $ret .=
'<input type="hidden" name="token" value="'.newToken().
'">';
494 $ret .=
'<input type="hidden" name="id" value="'.$object->id.
'">';
495 $ret .=
$form->selectExpenseCategories($object->default_c_exp_tax_cat,
'default_c_exp_tax_cat', 1);
496 $ret .=
'<input type="submit" class="button" name="modify" value="'.$langs->trans(
"Modify").
'"> ';
497 $ret .=
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
501 $label_exp_tax_cat =
dol_getIdFromCode($db, $object->default_c_exp_tax_cat,
'c_exp_tax_cat',
'rowid',
'label');
502 print $langs->trans($label_exp_tax_cat);
508 print
'<tr class="nowrap">';
510 print
$form->editfieldkey(
"DefaultRangeNumber",
'default_range', $object->default_range, $object, $user->rights->user->user->creer);
512 if ($action ==
'editdefault_range') {
513 $ret =
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].($moreparam ?
'?'.$moreparam :
'').
'">';
514 $ret .=
'<input type="hidden" name="action" value="setdefault_range">';
515 $ret .=
'<input type="hidden" name="token" value="'.newToken().
'">';
516 $ret .=
'<input type="hidden" name="id" value="'.$object->id.
'">';
519 $maxRangeNum = $expensereportik->getMaxRangeNumber($object->default_c_exp_tax_cat);
521 $ret .=
$form->selectarray(
'default_range', range(0, $maxRangeNum), $object->default_range);
522 $ret .=
'<input type="submit" class="button" name="modify" value="'.$langs->trans(
"Modify").
'"> ';
523 $ret .=
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
527 print $object->default_range;
534 if (!empty($conf->accounting->enabled)) {
535 print
'<tr><td>'.$langs->trans(
"AccountancyCode").
'</td>';
536 print
'<td>'.$object->accountancy_code.
'</td></tr>';
540 if ($user->hasRight(
'hrm',
'read_personal_information',
'read') || $user->hasRight(
'hrm',
'write_personal_information',
'write')) {
541 print
'<tr class="nowrap">';
543 print
$form->editfieldkey(
"RefEmployee",
'ref_employee', $object->ref_employee, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write);
545 print
$form->editfieldval(
"RefEmployee",
'ref_employee', $object->ref_employee, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write,
'string', $object->ref_employee);
551 if ($user->hasRight(
'hrm',
'read_personal_information',
'read') || $user->hasRight(
'hrm',
'write_personal_information',
'write')) {
552 print
'<tr class="nowrap">';
554 print
$form->editfieldkey(
"NationalRegistrationNumber",
'national_registration_number', $object->national_registration_number, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write);
556 print
$form->editfieldval(
"NationalRegistrationNumber",
'national_registration_number', $object->national_registration_number, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write,
'string', $object->national_registration_number);
563 print
'</div><div class="fichehalfright">';
566 $MAXLIST = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
569 if (!empty($conf->salaries->enabled) &&
570 (($user->rights->salaries->read && (in_array($object->id, $childids) || $object->id == $user->id)) || (!empty($user->rights->salaries->readall)))
573 $salary =
new Salary($db);
575 $sql =
"SELECT s.rowid as sid, s.ref as sref, s.label, s.datesp, s.dateep, s.paye, s.amount, SUM(ps.amount) as alreadypaid";
576 $sql .=
" FROM ".MAIN_DB_PREFIX.
"salary as s";
577 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"payment_salary as ps ON (s.rowid = ps.fk_salary)";
578 $sql .=
" WHERE s.fk_user = ".((int) $object->id);
579 $sql .=
" AND s.entity IN (".getEntity(
'salary').
")";
580 $sql .=
" GROUP BY s.rowid, s.ref, s.label, s.datesp, s.dateep, s.paye, s.amount";
581 $sql .=
" ORDER BY s.dateep DESC";
583 $resql = $db->query($sql);
585 $num = $db->num_rows(
$resql);
587 print
'<div class="div-table-responsive-no-min">';
588 print
'<table class="noborder centpercent">';
590 print
'<tr class="liste_titre">';
591 print
'<td colspan="5"><table class="nobordernopadding centpercent"><tr><td>'.$langs->trans(
"LastSalaries", ($num <= $MAXLIST ?
"" : $MAXLIST)).
'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.
'/salaries/list.php?search_user='.$object->login.
'">'.$langs->trans(
"AllSalaries").
'<span class="badge marginleftonlyshort">'.$num.
'</span></a></td>';
592 print
'</tr></table></td>';
596 while ($i < $num && $i < $MAXLIST) {
597 $objp = $db->fetch_object(
$resql);
599 $salary->id = $objp->sid;
600 $salary->ref = $objp->sref ? $objp->sref : $objp->sid;
601 $salary->label = $objp->label;
602 $salary->datesp = $db->jdate($objp->datesp);
603 $salary->dateep = $db->jdate($objp->dateep);
604 $salary->paye = $objp->paye;
605 $salary->amount = $objp->amount;
607 $payment_salary->id = $objp->rowid;
608 $payment_salary->ref = $objp->ref;
609 $payment_salary->datep = $db->jdate($objp->datep);
611 print
'<tr class="oddeven">';
612 print
'<td class="nowraponall">';
613 print $salary->getNomUrl(1);
615 print
'<td class="right nowraponall">'.dol_print_date($db->jdate($objp->datesp),
'day').
"</td>\n";
616 print
'<td class="right nowraponall">'.dol_print_date($db->jdate($objp->dateep),
'day').
"</td>\n";
617 print
'<td class="right nowraponall"><span class="amount">'.price($objp->amount).
'</span></td>';
618 print
'<td class="right nowraponall">'.$salary->getLibStatut(5, $objp->alreadypaid).
'</td>';
625 print
'<td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></a>';
635 if (!empty($conf->holiday->enabled) && ($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id))) {
638 $sql =
"SELECT h.rowid, h.statut as status, h.fk_type, h.date_debut, h.date_fin, h.halfday";
639 $sql .=
" FROM ".MAIN_DB_PREFIX.
"holiday as h";
640 $sql .=
" WHERE h.fk_user = ".((int) $object->id);
641 $sql .=
" AND h.entity IN (".getEntity(
'holiday').
")";
642 $sql .=
" ORDER BY h.date_debut DESC";
644 $resql = $db->query($sql);
646 $num = $db->num_rows(
$resql);
648 print
'<div class="div-table-responsive-no-min">';
649 print
'<table class="noborder centpercent">';
651 print
'<tr class="liste_titre">';
652 print
'<td colspan="4"><table class="nobordernopadding centpercent"><tr><td>'.$langs->trans(
"LastHolidays", ($num <= $MAXLIST ?
"" : $MAXLIST)).
'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.
'/holiday/list.php?id='.$object->id.
'">'.$langs->trans(
"AllHolidays").
'<span class="badge marginleftonlyshort">'.$num.
'</span></a></td>';
653 print
'</tr></table></td>';
657 while ($i < $num && $i < $MAXLIST) {
658 $objp = $db->fetch_object(
$resql);
660 $holiday->id = $objp->rowid;
661 $holiday->ref = $objp->rowid;
663 $holiday->fk_type = $objp->fk_type;
664 $holiday->statut = $objp->status;
665 $holiday->status = $objp->status;
667 $nbopenedday =
num_open_day($db->jdate($objp->date_debut,
'gmt'), $db->jdate($objp->date_fin,
'gmt'), 0, 1, $objp->halfday);
669 print
'<tr class="oddeven">';
670 print
'<td class="nowraponall">';
671 print $holiday->getNomUrl(1);
672 print
'</td><td class="right nowraponall">'.dol_print_date($db->jdate($objp->date_debut),
'day').
"</td>\n";
673 print
'<td class="right nowraponall">'.$nbopenedday.
' '.$langs->trans(
'DurationDays').
'</td>';
674 print
'<td class="right nowraponall">'.$holiday->LibStatut($objp->status, 5).
'</td>';
681 print
'<td colspan="4"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></a>';
691 if (!empty($conf->expensereport->enabled) &&
692 ($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id))
696 $sql =
"SELECT e.rowid, e.ref, e.fk_statut as status, e.date_debut, e.total_ttc";
697 $sql .=
" FROM ".MAIN_DB_PREFIX.
"expensereport as e";
698 $sql .=
" WHERE e.fk_user_author = ".((int) $object->id);
699 $sql .=
" AND e.entity = ".((int) $conf->entity);
700 $sql .=
" ORDER BY e.date_debut DESC";
702 $resql = $db->query($sql);
704 $num = $db->num_rows(
$resql);
706 print
'<div class="div-table-responsive-no-min">';
707 print
'<table class="noborder centpercent">';
709 print
'<tr class="liste_titre">';
710 print
'<td colspan="4"><table class="nobordernopadding centpercent"><tr><td>'.$langs->trans(
"LastExpenseReports", ($num <= $MAXLIST ?
"" : $MAXLIST)).
'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.
'/expensereport/list.php?id='.$object->id.
'">'.$langs->trans(
"AllExpenseReports").
'<span class="badge marginleftonlyshort">'.$num.
'</span></a></td>';
711 print
'</tr></table></td>';
715 while ($i < $num && $i < $MAXLIST) {
716 $objp = $db->fetch_object(
$resql);
718 $exp->id = $objp->rowid;
719 $exp->ref = $objp->ref;
720 $exp->status = $objp->status;
722 print
'<tr class="oddeven">';
723 print
'<td class="nowraponall">';
724 print $exp->getNomUrl(1);
725 print
'</td><td class="right nowraponall">'.dol_print_date($db->jdate($objp->date_debut),
'day').
"</td>\n";
726 print
'<td class="right nowraponall"><span class="amount">'.price($objp->total_ttc).
'</span></td>';
727 print
'<td class="right nowraponall">'.$exp->LibStatut($objp->status, 5).
'</td>';
734 print
'<td colspan="4"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></a>';
743 print
'</div></div>';
744 print
'<div style="clear:both"></div>';
751 if ($account->id == 0) {
752 if ($permissiontoaddbankaccount) {
753 $morehtmlright =
dolGetButtonTitle($langs->trans(
'Add'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=create');
755 $morehtmlright =
dolGetButtonTitle($langs->trans(
'Add'), $langs->trans(
'NotEnoughPermissions'),
'fa fa-plus-circle',
'',
'', -2);
758 $morehtmlright =
dolGetButtonTitle($langs->trans(
'Add'), $langs->trans(
'AlreadyOneBankAccount'),
'fa fa-plus-circle',
'',
'', -2);
761 print
load_fiche_titre($langs->trans(
"BankAccounts"), $morehtmlright,
'bank_account');
763 print
'<div class="div-table-responsive-no-min">';
764 print
'<table class="liste centpercent">';
766 print
'<tr class="liste_titre">';
775 if ($account->id > 0) {
776 print
'<tr class="oddeven">';
778 print
'<td>'.$account->label.
'</td>';
780 print
'<td>'.$account->bank.
'</td>';
784 foreach ($account->getFieldsToShow() as $val) {
785 if ($val ==
'BankCode') {
786 $string .= $account->code_banque.
' ';
787 } elseif ($val ==
'BankAccountNumber') {
788 $string .= $account->number.
' ';
789 } elseif ($val ==
'DeskCode') {
790 $string .= $account->code_guichet.
' ';
791 } elseif ($val ==
'BankAccountNumberKey') {
792 $string .= $account->cle_rib.
' ';
795 if (!empty($account->label) && $account->number) {
797 $string .=
' '.img_picto($langs->trans(
"ValueIsNotValid"),
'warning');
799 $string .=
' '.img_picto($langs->trans(
"ValueIsValid"),
'info');
806 print
'<td>'.$account->iban;
807 if (!empty($account->iban)) {
809 print
' '.img_picto($langs->trans(
"IbanNotValid"),
'warning');
814 print
'<td>'.$account->bic;
815 if (!empty($account->bic)) {
817 print
' '.img_picto($langs->trans(
"SwiftNotValid"),
'warning');
823 print
'<td class="right nowraponall">';
824 if ($permissiontoaddbankaccount) {
825 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&bankid='.$account->id.
'&action=edit&token='.
newToken().
'">';
826 print
img_picto($langs->trans(
"Modify"),
'edit');
835 if ($account->id == 0) {
837 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoBANRecord").
'</span></td></tr>';
845 if ($id && ($action ==
'edit' || $action ==
'create') && $user->rights->user->user->creer) {
846 $title = $langs->trans(
"User");
849 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
851 dol_banner_tab($object,
'id', $linkback, $user->rights->user->user->lire || $user->admin);
855 print
'<div class="underbanner clearboth"></div>';
856 print
'<table class="border centpercent">';
858 print
'<tr><td class="titlefield fieldrequired">'.$langs->trans(
"LabelRIB").
'</td>';
859 print
'<td colspan="4"><input size="30" type="text" name="label" value="'.$account->label.
'"></td></tr>';
861 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankName").
'</td>';
862 print
'<td><input size="30" type="text" name="bank" value="'.$account->bank.
'"></td></tr>';
865 foreach ($account->getFieldsToShow() as $val) {
866 if ($val ==
'BankCode') {
867 $name =
'code_banque';
869 $content = $account->code_banque;
870 } elseif ($val ==
'DeskCode') {
871 $name =
'code_guichet';
873 $content = $account->code_guichet;
874 } elseif ($val ==
'BankAccountNumber') {
877 $content = $account->number;
878 } elseif ($val ==
'BankAccountNumberKey') {
881 $content = $account->cle_rib;
884 print
'<td>'.$langs->trans($val).
'</td>';
885 print
'<td><input size="'.$size.
'" type="text" class="flat" name="'.$name.
'" value="'.$content.
'"></td>';
890 print
'<tr><td class="fieldrequired">'.$langs->trans(
"IBAN").
'</td>';
891 print
'<td colspan="4"><input size="30" type="text" name="iban" value="'.$account->iban.
'"></td></tr>';
893 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BIC").
'</td>';
894 print
'<td colspan="4"><input size="12" type="text" name="bic" value="'.$account->bic.
'"></td></tr>';
896 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountDomiciliation").
'</td><td colspan="4">';
897 print
'<textarea name="domiciliation" rows="4" class="quatrevingtpercent">';
899 print
"</textarea></td></tr>";
901 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td>';
902 print
'<td colspan="4"><input size="30" type="text" name="proprio" value="'.$account->proprio.
'"></td></tr>';
903 print
"</td></tr>\n";
905 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td colspan="4">';
906 print
'<textarea name="owner_address" rows="4" class="quatrevingtpercent">';
908 print
"</textarea></td></tr>";
916 print
$form->buttonsSaveCancel(
"Modify");
919 if ($id && $action ==
'edit' && $user->rights->user->user->creer) {
923 if ($id && $action ==
'create' && $user->rights->user->user->creer) {
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class of the module paid holiday.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow= '')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
Class to manage payments of salaries.
dolGetButtonTitle($label, $helpText= '', $iconClass= 'fa fa-file', $url= '', $id= '', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
Class to manage inventories.
Class to manage bank accounts description of users.
Class to manage Dolibarr users.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
checkSwiftForAccount($account)
Check SWIFT informations for a bank account.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
dol_getIdFromCode($db, $key, $tablename, $fieldkey= 'code', $fieldid= 'id', $entityfilter=0, $filters= '')
Return an id or code from a code or id.
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...
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
user_prepare_head(User $object)
Prepare array with list of tabs.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $country_code= '')
Function to return number of working days (and text of units) between two dates (working days) ...
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage Trips and Expenses.
if(isModEnabled('facture')&&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur')&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)&&$user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice')&&$user->rights->supplier_invoice->lire)) if(isModEnabled('don')&&!empty($user->rights->don->lire)) if(isModEnabled('tax')&&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture')&&isModEnabled('commande')&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
checkBanForAccount($account)
Check account number informations for a bank account.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Class to manage salary payments.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
checkIbanForAccount(Account $account)
Check IBAN number informations for a bank account.
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.