28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/salaries/class/salary.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
32if (isModEnabled(
'accounting')) {
33 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
37$langs->loadLangs(array(
"compta",
"salaries",
"bills",
"hrm"));
39$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
40$massaction =
GETPOST(
'massaction',
'alpha');
41$show_files =
GETPOST(
'show_files',
'int');
42$confirm =
GETPOST(
'confirm',
'alpha');
43$cancel =
GETPOST(
'cancel',
'alpha');
44$toselect =
GETPOST(
'toselect',
'array');
45$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'bomlist';
46$backtopage =
GETPOST(
'backtopage',
'alpha');
47$optioncss =
GETPOST(
'optioncss',
'aZ');
48$mode =
GETPOST(
'mode',
'alpha');
52$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
53$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
54$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
55$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
56if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) { $page = 0; }
57$offset = $limit * $page;
61 $sortfield =
"s.datep,s.rowid";
64 $sortorder =
"DESC,DESC";
70$diroutputmassaction = $conf->user->dir_output.
'/temp/massgeneration/'.$user->id;
71$hookmanager->initHooks(array(
'salarieslist'));
74$extrafields->fetch_name_optionals_label($object->table_element);
76$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
79 $sortfield =
"s.datep,s.rowid";
82 $sortorder =
"DESC,DESC";
85$search_ref =
GETPOST(
'search_ref',
'int');
86$search_ref_salary =
GETPOST(
'search_ref_salary',
'int');
87$search_user =
GETPOST(
'search_user',
'alpha');
88$search_label =
GETPOST(
'search_label',
'alpha');
89$search_date_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
90$search_date_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
91$search_dateep_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_dateep_startmonth',
'int'),
GETPOST(
'search_dateep_startday',
'int'),
GETPOST(
'search_dateep_startyear',
'int'));
92$search_dateep_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_dateep_endmonth',
'int'),
GETPOST(
'search_dateep_endday',
'int'),
GETPOST(
'search_dateep_endyear',
'int'));
93$search_amount =
GETPOST(
'search_amount',
'alpha');
94$search_account =
GETPOST(
'search_account',
'int');
95$search_fk_bank =
GETPOST(
'search_fk_bank',
'int');
96$search_chq_number =
GETPOST(
'search_chq_number',
'int');
98$filtre =
GETPOST(
"filtre",
'restricthtml');
101if (!
GETPOST(
'search_type_id',
'int')) {
102 $newfiltre = str_replace(
'filtre=',
'', $filtre);
103 $filterarray = explode(
'-', $newfiltre);
104 foreach ($filterarray as $val) {
105 $part = explode(
':', $val);
106 if ($part[0] ==
's.fk_typepayment') {
107 $search_type_id = $part[1];
111 $search_type_id =
GETPOST(
'search_type_id',
'int');
114$childids = $user->getAllChildIds(1);
117$search_all =
GETPOST(
"search_all",
'alpha');
119foreach ($object->fields as $key => $val) {
120 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
124$fieldstosearchall = array();
125foreach ($object->fields as $key => $val) {
126 if (!empty($val[
'searchall'])) {
127 $fieldstosearchall[
't.'.$key] = $val[
'label'];
132$arrayfields = array();
133foreach ($object->fields as $key => $val) {
135 if (!empty($val[
'visible'])) {
136 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
137 $arrayfields[
't.'.$key] = array(
138 'label'=>$val[
'label'],
139 'checked'=>(($visible < 0) ? 0 : 1),
140 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
141 'position'=>$val[
'position'],
142 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
147$permissiontoread = $user->rights->salaries->read;
148$permissiontoadd = $user->rights->salaries->write;
149$permissiontodelete = $user->rights->salaries->delete;
152$socid =
GETPOST(
"socid",
"int");
153if ($user->socid > 0) {
154 $socid = $user->socid;
163if (
GETPOST(
'cancel',
'alpha')) { $action =
'list'; $massaction =
''; }
164if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') { $massaction =
''; }
166$parameters = array();
167$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
172if (empty($reshook)) {
174 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
177 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
179 $search_ref_salary =
"";
182 $search_date_start =
'';
183 $search_date_end =
'';
184 $search_dateep_start =
'';
185 $search_dateep_end =
'';
187 $search_account =
'';
188 $search_fk_bank =
'';
189 $search_chq_number =
'';
190 $search_type_id =
"";
192 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
193 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
198 $objectclass =
'PaymentSalary';
199 $objectlabel =
'SalariesPayments';
200 $uploaddir = $conf->salaries->dir_output;
201 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
204 if (!$error && $massaction ==
'buildsepa' && $permissiontoadd) {
205 $objecttmp =
new $objectclass($db);
215$form =
new Form($db);
216$salstatic =
new Salary($db);
218$userstatic =
new User($db);
219$accountstatic =
new Account($db);
226$title = $langs->trans(
'SalariesPayments');
228$sql =
"SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,";
229$sql .=
" s.rowid, s.fk_user, s.amount, s.salary, sal.rowid as id_salary, sal.label, s.datep as datep, sal.dateep, b.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
230$sql .=
" ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,";
231$sql .=
" pst.code as payment_code";
232$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as s";
233$sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"salary as sal ON (sal.rowid = s.fk_salary)";
234$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON s.fk_typepayment = pst.id";
235$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON s.fk_bank = b.rowid";
236$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid,";
237$sql .=
" ".MAIN_DB_PREFIX.
"user as u";
238$sql .=
" WHERE u.rowid = sal.fk_user";
239$sql .=
" AND s.entity IN (".getEntity(
'payment_salaries').
")";
240if (empty($user->rights->salaries->readall)) {
241 $sql .=
" AND sal.fk_user IN (".$db->sanitize(join(
',', $childids)).
")";
246 $sql .=
" AND s.rowid=".((int) $search_ref);
248if ($search_ref_salary) {
249 $sql .=
" AND sal.rowid=".((int) $search_ref_salary);
252 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname',
'u.email'), $search_user);
257if ($search_date_start) {
258 $sql .=
" AND s.datep >= '".$db->idate($search_date_start).
"'";
260if ($search_date_end) {
261 $sql .=
" AND s.datep <= '".$db->idate($search_date_end).
"'";
263if ($search_dateep_start) {
264 $sql .=
" AND sal.dateep >= '".$db->idate($search_dateep_start).
"'";
266if ($search_dateep_end) {
267 $sql .=
" AND sal.dateep <= '".$db->idate($search_dateep_end).
"'";
272if ($search_account > 0) {
273 $sql .=
" AND b.fk_account=".((int) $search_account);
275if ($search_fk_bank) {
276 $sql .=
" AND s.fk_bank=".((int) $search_fk_bank);
278if ($search_chq_number) {
279 $sql .=
natural_search(array(
's.num_payment'), $search_chq_number);
282if ($search_type_id > 0) {
283 $sql .=
" AND s.fk_typepayment=".((int) $search_type_id);
285$sql .= $db->order($sortfield, $sortorder);
288$nbtotalofrecords =
'';
290 $resql = $db->query($sql);
291 $nbtotalofrecords = $db->num_rows($resql);
292 if (($page * $limit) > $nbtotalofrecords) {
298if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
299 $num = $nbtotalofrecords;
302 $sql .= $db->plimit($limit + 1, $offset);
305 $resql = $db->query($sql);
311 $num = $db->num_rows($resql);
319$arrayofselected = is_array($toselect) ? $toselect : array();
323 $param .=
'&mode='.urlencode($mode);
325if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
326 $param .=
'&contextpage='.urlencode($contextpage);
328if ($limit > 0 && $limit != $conf->liste_limit) {
329 $param .=
'&limit='.((int) $limit);
331if ($search_type_id) {
332 $param .=
'&search_type_id='.urlencode($search_type_id);
334if ($optioncss !=
'') {
335 $param .=
'&optioncss='.urlencode($optioncss);
338 $param .=
'&search_ref='.urlencode($search_ref);
340if ($search_ref_salary) {
341 $param .=
'&search_ref_salary='.urlencode($search_ref_salary);
344 $param .=
'&search_user='.urlencode($search_user);
347 $param .=
'&search_label='.urlencode($search_label);
349if ($search_fk_bank) {
350 $param .=
'&search_fk_bank='.urlencode($search_fk_bank);
352if ($search_chq_number) {
353 $param .=
'&search_chq_number='.urlencode($search_chq_number);
355if ($search_account) {
356 $param .=
'&search_account='.urlencode($search_account);
358if ($search_date_start) {
359 $param .=
'&search_date_startday='.urlencode(
GETPOST(
'search_date_startday',
'int')).
'&search_date_startmonth='.urlencode(
GETPOST(
'search_date_startmonth',
'int')).
'&search_date_startyear='.urlencode(
GETPOST(
'search_date_startyear',
'int'));
361if ($search_dateep_start) {
362 $param .=
'&search_dateep_startday='.urlencode(
GETPOST(
'search_dateep_startday',
'int')).
'&search_dateep_startmonth='.urlencode(
GETPOST(
'search_dateep_startmonth',
'int')).
'&search_dateep_startyear='.urlencode(
GETPOST(
'search_dateep_startyear',
'int'));
364if ($search_date_end) {
365 $param .=
'&search_date_endday='.urlencode(
GETPOST(
'search_date_endday',
'int')).
'&search_date_endmonth='.urlencode(
GETPOST(
'search_date_endmonth',
'int')).
'&search_date_endyear='.urlencode(
GETPOST(
'search_date_endyear',
'int'));
367if ($search_dateep_end) {
368 $param .=
'&search_dateep_endday='.urlencode(
GETPOST(
'search_dateep_endday',
'int')).
'&search_dateep_endmonth='.urlencode(
GETPOST(
'search_dateep_endmonth',
'int')).
'&search_dateep_endyear='.urlencode(
GETPOST(
'search_dateep_endyear',
'int'));
371include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
374$arrayofmassactions = array(
379if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
380 $arrayofmassactions = array();
382$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
384print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
385if ($optioncss !=
'') {
386 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
388print
'<input type="hidden" name="token" value="'.newToken().
'">';
389print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
390print
'<input type="hidden" name="action" value="list">';
391print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
392print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
393print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
394print
'<input type="hidden" name="mode" value="'.$mode.
'">';
397$url = DOL_URL_ROOT.
'/salaries/card.php?action=create';
399 $url .=
'&socid='.$socid;
402$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss'=>
'reposition'));
403$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss'=>
'reposition'));
404$newcardbutton =
dolGetButtonTitle($langs->trans(
'NewSalaryPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->salaries->write);
406print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
410$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
413$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
415print
'<div class="div-table-responsive">';
416print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
420print
'<tr class="liste_titre_filter">';
423 print
'<td class="liste_titre maxwidthsearch">';
424 $searchpicto = $form->showFilterButtons();
429print
'<td class="liste_titre left">';
430print
'<input class="flat" type="text" size="3" name="search_ref" value="'.$db->escape($search_ref).
'">';
433print
'<td class="liste_titre center">';
434print
'<input class="flat" type="text" size="3" name="search_ref_salary" value="'.$db->escape($search_ref_salary).
'">';
437print
'<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$db->escape($search_label).
'"></td>';
439print
'<td class="liste_titre center">';
440print
'<div class="nowrap">';
441print $form->selectDate($search_dateep_start ? $search_dateep_start : -1,
'search_dateep_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
443print
'<div class="nowrap">';
444print $form->selectDate($search_dateep_end ? $search_dateep_end : -1,
'search_dateep_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
448print
'<td class="liste_titre center">';
449print
'<div class="nowrap">';
450print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
452print
'<div class="nowrap">';
453print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
460print
'<td class="liste_titre">';
461print
'<input class="flat" type="text" size="6" name="search_user" value="'.$db->escape($search_user).
'">';
464print
'<td class="liste_titre">';
465print $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'', 1);
468print
'<td class="liste_titre"><input name="search_chq_number" class="flat width50" type="text" value="'.$db->escape($search_chq_number).
'"></td>';
470if (isModEnabled(
"banque")) {
472 print
'<td class="liste_titre">';
473 print
'<input class="flat width50" type="text" name="search_fk_bank" value="'.$db->escape($search_fk_bank).
'">';
477 print
'<td class="liste_titre">';
478 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
482print
'<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).
'"></td>';
485include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
488$parameters = array(
'arrayfields'=>$arrayfields);
489$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
490print $hookmanager->resPrint;
493 print
'<td class="liste_titre maxwidthsearch">';
494 $searchpicto = $form->showFilterButtons();
500$totalarray = array();
501$totalarray[
'nbfield'] = 0;
505print
'<tr class="liste_titre">';
508 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
509 $totalarray[
'nbfield']++;
512$totalarray[
'nbfield']++;
514$totalarray[
'nbfield']++;
516$totalarray[
'nbfield']++;
517print_liste_field_titre(
"PeriodEndDate", $_SERVER[
"PHP_SELF"],
"sal.dateep",
"", $param,
'', $sortfield, $sortorder,
'center ');
518$totalarray[
'nbfield']++;
519print_liste_field_titre(
"DatePayment", $_SERVER[
"PHP_SELF"],
"s.datep,s.rowid",
"", $param,
'', $sortfield, $sortorder,
'center ');
520$totalarray[
'nbfield']++;
522$totalarray[
'nbfield']++;
523print_liste_field_titre(
"PaymentMode", $_SERVER[
"PHP_SELF"],
"pst.code",
"", $param,
'', $sortfield, $sortorder);
524$totalarray[
'nbfield']++;
525print_liste_field_titre(
"Numero", $_SERVER[
"PHP_SELF"],
"s.num_payment",
"", $param,
'', $sortfield, $sortorder,
'',
'ChequeOrTransferNumber');
526$totalarray[
'nbfield']++;
527if (isModEnabled(
"banque")) {
528 print_liste_field_titre(
"BankTransactionLine", $_SERVER[
"PHP_SELF"],
"s.fk_bank",
"", $param,
'', $sortfield, $sortorder);
529 $totalarray[
'nbfield']++;
530 print_liste_field_titre(
"BankAccount", $_SERVER[
"PHP_SELF"],
"ba.label",
"", $param,
"", $sortfield, $sortorder);
531 $totalarray[
'nbfield']++;
533print_liste_field_titre(
"PayedByThisPayment", $_SERVER[
"PHP_SELF"],
"s.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
534$totalarray[
'nbfield']++;
536include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
538$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
539$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
540print $hookmanager->resPrint;
543 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
544 $totalarray[
'nbfield']++;
550$needToFetchEachLine = 0;
551if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
552 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
553 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
554 $needToFetchEachLine++;
563$savnbfield = $totalarray[
'nbfield'];
564$totalarray = array();
565$totalarray[
'nbfield'] = 0;
566$imaxinloop = ($limit ? min($num, $limit) : $num);
567while ($i < $imaxinloop) {
568 $obj = $db->fetch_object($resql);
575 $object->setVarsFromFetchObj($obj);
577 $userstatic->id = $obj->uid;
578 $userstatic->lastname = $obj->lastname;
579 $userstatic->firstname = $obj->firstname;
580 $userstatic->admin = $obj->admin;
581 $userstatic->login = $obj->login;
582 $userstatic->email = $obj->email;
583 $userstatic->socid = $obj->fk_soc;
584 $userstatic->statut = $obj->status;
585 $userstatic->status = $obj->status;
587 $salstatic->id = $obj->id_salary;
588 $salstatic->ref = $obj->id_salary;
590 $paymentsalstatic->id = $obj->rowid;
591 $paymentsalstatic->ref = $obj->rowid;
592 $paymentsalstatic->amount = $obj->amount;
593 $paymentsalstatic->fk_typepayment = $obj->payment_code;
594 $paymentsalstatic->datec = $obj->dateep;
595 $paymentsalstatic->datep = $obj->datep;
597 $accountlinestatic->id = $obj->fk_bank;
598 $accountlinestatic->ref = $obj->fk_bank;
599 $paymentsalstatic->fk_bank = $accountlinestatic->getNomUrl(1);
600 $paymentsalstatic->fk_user_author = $userstatic->getNomUrl(1);
602 if ($mode ==
'kanban') {
604 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
605 print
'<div class="box-flex-container kanban">';
608 print $paymentsalstatic->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
609 if ($i == ($imaxinloop - 1)) {
615 print
'<tr class="oddeven">';
619 print
'<td class="nowrap center">';
620 if ($massactionbutton || $massaction) {
622 if (in_array($object->id, $arrayofselected)) {
625 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
629 $totalarray[
'nbfield']++;
634 print
"<td>".$paymentsalstatic->getNomUrl(1).
"</td>\n";
636 $totalarray[
'nbfield']++;
640 print
"<td>".$salstatic->getNomUrl(1).
"</td>\n";
642 $totalarray[
'nbfield']++;
646 print
"<td>".dol_trunc($obj->label, 40).
"</td>\n";
648 $totalarray[
'nbfield']++;
652 print
'<td class="center">'.dol_print_date($db->jdate($obj->dateep),
'day').
"</td>\n";
654 $totalarray[
'nbfield']++;
658 print
'<td class="center">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>\n";
660 $totalarray[
'nbfield']++;
668 print
"<td>".$userstatic->getNomUrl(1).
"</td>\n";
670 $totalarray[
'nbfield']++;
675 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
678 $totalarray[
'nbfield']++;
682 print
'<td>'.$obj->num_payment.
'</td>';
684 $totalarray[
'nbfield']++;
688 if (isModEnabled(
"banque")) {
691 $accountlinestatic->id = $obj->fk_bank;
692 print $accountlinestatic->getNomUrl(1);
695 $totalarray[
'nbfield']++;
699 if ($obj->fk_bank > 0) {
701 $accountstatic->id = $obj->bid;
702 $accountstatic->ref = $obj->bref;
703 $accountstatic->number = $obj->bnumber;
704 $accountstatic->iban = $obj->iban;
705 $accountstatic->bic = $obj->bic;
706 $accountstatic->currency_code = $langs->trans(
"Currency".$obj->currency_code);
707 $accountstatic->clos = $obj->clos;
709 if (isModEnabled(
'accounting')) {
710 $accountstatic->account_number = $obj->account_number;
713 $accountingjournal->fetch($obj->fk_accountancy_journal);
715 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
717 $accountstatic->label = $obj->blabel;
718 if ($accountstatic->id > 0) {
719 print $accountstatic->getNomUrl(1);
726 $totalarray[
'nbfield']++;
731 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
733 $totalarray[
'nbfield']++;
736 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalttcfield';
739 $totalarray[
'val'][
'totalttcfield'] = $obj->amount;
741 $totalarray[
'val'][
'totalttcfield'] += $obj->amount;
746 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
748 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
749 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
750 print $hookmanager->resPrint;
754 print
'<td class="nowrap center">';
755 if ($massactionbutton || $massaction) {
757 if (in_array($object->id, $arrayofselected)) {
760 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
764 $totalarray[
'nbfield']++;
774include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
786 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
792$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
793$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
794print $hookmanager->resPrint;
796print
'</table>'.
"\n";
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 bank transaction lines.
Class to manage accounting accounts.
Class to manage payments of salaries.
Class to manage salary payments.
Class to manage Dolibarr users.
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...
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
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.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.