27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/salaries/class/salary.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
36 $langs->loadLangs(array(
"compta",
"salaries",
"bills",
"hrm"));
38 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
39 $massaction =
GETPOST(
'massaction',
'alpha');
40 $show_files =
GETPOST(
'show_files',
'int');
41 $confirm =
GETPOST(
'confirm',
'alpha');
42 $cancel =
GETPOST(
'cancel',
'alpha');
43 $toselect =
GETPOST(
'toselect',
'array');
44 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'bomlist';
45 $backtopage =
GETPOST(
'backtopage',
'alpha');
46 $optioncss =
GETPOST(
'optioncss',
'aZ');
49 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
50 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
51 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
53 if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) { $page = 0; }
54 $offset = $limit * $page;
55 $pageprev = $page - 1;
56 $pagenext = $page + 1;
58 $sortfield =
"s.datep,s.rowid";
61 $sortorder =
"DESC,DESC";
67 $diroutputmassaction = $conf->user->dir_output.
'/temp/massgeneration/'.$user->id;
68 $hookmanager->initHooks(array(
'salarieslist'));
71 $extrafields->fetch_name_optionals_label($object->table_element);
73 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
76 $sortfield =
"s.datep,s.rowid";
79 $sortorder =
"DESC,DESC";
82 $search_ref =
GETPOST(
'search_ref',
'int');
83 $search_ref_salary =
GETPOST(
'search_ref_salary',
'int');
84 $search_user =
GETPOST(
'search_user',
'alpha');
85 $search_label =
GETPOST(
'search_label',
'alpha');
86 $search_date_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
87 $search_date_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
88 $search_dateep_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_dateep_startmonth',
'int'),
GETPOST(
'search_dateep_startday',
'int'),
GETPOST(
'search_dateep_startyear',
'int'));
89 $search_dateep_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_dateep_endmonth',
'int'),
GETPOST(
'search_dateep_endday',
'int'),
GETPOST(
'search_dateep_endyear',
'int'));
90 $search_amount =
GETPOST(
'search_amount',
'alpha');
91 $search_account =
GETPOST(
'search_account',
'int');
92 $search_fk_bank =
GETPOST(
'search_fk_bank',
'int');
93 $search_chq_number =
GETPOST(
'search_chq_number',
'int');
95 $filtre =
GETPOST(
"filtre",
'restricthtml');
97 if (!
GETPOST(
'search_type_id',
'int')) {
98 $newfiltre = str_replace(
'filtre=',
'', $filtre);
99 $filterarray = explode(
'-', $newfiltre);
100 foreach ($filterarray as $val) {
101 $part = explode(
':', $val);
102 if ($part[0] ==
's.fk_typepayment') {
103 $search_type_id = $part[1];
107 $search_type_id =
GETPOST(
'search_type_id',
'int');
110 $childids = $user->getAllChildIds(1);
113 $search_all =
GETPOST(
"search_all",
'alpha');
115 foreach ($object->fields as $key => $val) {
116 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
120 $fieldstosearchall = array();
121 foreach ($object->fields as $key => $val) {
122 if (!empty($val[
'searchall'])) {
123 $fieldstosearchall[
't.'.$key] = $val[
'label'];
128 $arrayfields = array();
129 foreach ($object->fields as $key => $val) {
131 if (!empty($val[
'visible'])) {
132 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
133 $arrayfields[
't.'.$key] = array(
134 'label'=>$val[
'label'],
135 'checked'=>(($visible < 0) ? 0 : 1),
136 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
137 'position'=>$val[
'position'],
138 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
143 $permissiontoread = $user->rights->salaries->read;
144 $permissiontoadd = $user->rights->salaries->write;
145 $permissiontodelete = $user->rights->salaries->delete;
148 $socid =
GETPOST(
"socid",
"int");
149 if ($user->socid > 0) {
150 $socid = $user->socid;
159 if (
GETPOST(
'cancel',
'alpha')) { $action =
'list'; $massaction =
''; }
160 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') { $massaction =
''; }
162 $parameters = array();
163 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
168 if (empty($reshook)) {
170 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
173 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
175 $search_ref_salary =
"";
178 $search_date_start =
'';
179 $search_date_end =
'';
180 $search_dateep_start =
'';
181 $search_dateep_end =
'';
183 $search_account =
'';
184 $search_fk_bank =
'';
185 $search_chq_number =
'';
186 $search_type_id =
"";
188 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
189 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
194 $objectclass =
'PaymentSalary';
195 $objectlabel =
'SalariesPayments';
196 $uploaddir = $conf->salaries->dir_output;
197 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
200 if (!$error && $massaction ==
'buildsepa' && $permissiontoadd) {
201 $objecttmp =
new $objectclass($db);
212 $salstatic =
new Salary($db);
214 $userstatic =
new User($db);
215 $accountstatic =
new Account($db);
222 $title = $langs->trans(
'SalariesPayments');
224 $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,";
225 $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,";
226 $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,";
227 $sql .=
" pst.code as payment_code";
228 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as s";
229 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"salary as sal ON (sal.rowid = s.fk_salary)";
230 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON s.fk_typepayment = pst.id";
231 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON s.fk_bank = b.rowid";
232 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid,";
233 $sql .=
" ".MAIN_DB_PREFIX.
"user as u";
234 $sql .=
" WHERE u.rowid = sal.fk_user";
235 $sql .=
" AND s.entity IN (".getEntity(
'payment_salaries').
")";
236 if (empty($user->rights->salaries->readall)) {
237 $sql .=
" AND sal.fk_user IN (".$db->sanitize(join(
',', $childids)).
")";
242 $sql .=
" AND s.rowid=".((int) $search_ref);
244 if ($search_ref_salary) {
245 $sql .=
" AND sal.rowid=".((int) $search_ref_salary);
248 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname',
'u.email'), $search_user);
253 if ($search_date_start) {
254 $sql .=
" AND s.datep >= '".$db->idate($search_date_start).
"'";
256 if ($search_date_end) {
257 $sql .=
" AND s.datep <= '".$db->idate($search_date_end).
"'";
259 if ($search_dateep_start) {
260 $sql .=
" AND sal.dateep >= '".$db->idate($search_dateep_start).
"'";
262 if ($search_dateep_end) {
263 $sql .=
" AND sal.dateep <= '".$db->idate($search_dateep_end).
"'";
265 if ($search_amount) {
268 if ($search_account > 0) {
269 $sql .=
" AND b.fk_account=".((int) $search_account);
271 if ($search_fk_bank) {
272 $sql .=
" AND s.fk_bank=".((int) $search_fk_bank);
274 if ($search_chq_number) {
275 $sql .=
natural_search(array(
's.num_payment'), $search_chq_number);
278 if ($search_type_id > 0) {
279 $sql .=
" AND s.fk_typepayment=".((int) $search_type_id);
281 $sql .= $db->order($sortfield, $sortorder);
284 $nbtotalofrecords =
'';
285 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
286 $resql = $db->query($sql);
287 $nbtotalofrecords = $db->num_rows(
$resql);
288 if (($page * $limit) > $nbtotalofrecords) {
294 if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
295 $num = $nbtotalofrecords;
298 $sql .= $db->plimit($limit + 1, $offset);
301 $resql = $db->query($sql);
307 $num = $db->num_rows(
$resql);
315 $arrayofselected = is_array($toselect) ? $toselect : array();
318 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
319 $param .=
'&contextpage='.urlencode($contextpage);
321 if ($limit > 0 && $limit != $conf->liste_limit) {
322 $param .=
'&limit='.urlencode($limit);
324 if ($search_type_id) {
325 $param .=
'&search_type_id='.urlencode($search_type_id);
327 if ($optioncss !=
'') {
328 $param .=
'&optioncss='.urlencode($optioncss);
331 $param .=
'&search_ref='.urlencode($search_ref);
333 if ($search_ref_salary) {
334 $param .=
'&search_ref_salary='.urlencode($search_ref_salary);
337 $param .=
'&search_user='.urlencode($search_user);
340 $param .=
'&search_label='.urlencode($search_label);
342 if ($search_fk_bank) {
343 $param .=
'&search_fk_bank='.urlencode($search_fk_bank);
345 if ($search_chq_number) {
346 $param .=
'&search_chq_number='.urlencode($search_chq_number);
348 if ($search_account) {
349 $param .=
'&search_account='.urlencode($search_account);
351 if ($search_date_start) {
352 $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'));
354 if ($search_dateep_start) {
355 $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'));
357 if ($search_date_end) {
358 $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'));
360 if ($search_dateep_end) {
361 $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'));
364 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
367 $arrayofmassactions = array(
372 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
373 $arrayofmassactions = array();
375 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
377 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
378 if ($optioncss !=
'') {
379 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
381 print
'<input type="hidden" name="token" value="'.newToken().
'">';
382 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
383 print
'<input type="hidden" name="action" value="list">';
384 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
385 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
386 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
388 $url = DOL_URL_ROOT.
'/salaries/card.php?action=create';
389 if (!empty($socid)) {
390 $url .=
'&socid='.$socid;
392 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewSalaryPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->salaries->write);
394 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
398 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
400 $selectedfields =
'';
401 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
403 print
'<div class="div-table-responsive">';
404 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
408 print
'<tr class="liste_titre_filter">';
410 print
'<td class="liste_titre left">';
411 print
'<input class="flat" type="text" size="3" name="search_ref" value="'.$db->escape($search_ref).
'">';
414 print
'<td class="liste_titre center">';
415 print
'<input class="flat" type="text" size="3" name="search_ref_salary" value="'.$db->escape($search_ref_salary).
'">';
418 print
'<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$db->escape($search_label).
'"></td>';
420 print
'<td class="liste_titre center">';
421 print
'<div class="nowrap">';
422 print
$form->selectDate($search_dateep_start ? $search_dateep_start : -1,
'search_dateep_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
424 print
'<div class="nowrap">';
425 print
$form->selectDate($search_dateep_end ? $search_dateep_end : -1,
'search_dateep_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
429 print
'<td class="liste_titre center">';
430 print
'<div class="nowrap">';
431 print
$form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
433 print
'<div class="nowrap">';
434 print
$form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
441 print
'<td class="liste_titre">';
442 print
'<input class="flat" type="text" size="6" name="search_user" value="'.$db->escape($search_user).
'">';
445 print
'<td class="liste_titre left">';
446 $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16);
449 print
'<td class="liste_titre right"><input name="search_chq_number" class="flat" type="text" size="8" value="'.$db->escape($search_chq_number).
'"></td>';
453 print
'<td class="liste_titre center">';
454 print
'<input class="flat" type="text" size="3" name="search_fk_bank" value="'.$db->escape($search_fk_bank).
'">';
458 print
'<td class="liste_titre">';
459 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
463 print
'<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).
'"></td>';
466 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
469 $parameters = array(
'arrayfields'=>$arrayfields);
470 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
471 print $hookmanager->resPrint;
473 print
'<td class="liste_titre maxwidthsearch">';
474 $searchpicto =
$form->showFilterButtons();
482 print
'<tr class="liste_titre">';
483 print_liste_field_titre(
"RefPayment", $_SERVER[
"PHP_SELF"],
"s.rowid",
"", $param,
"", $sortfield, $sortorder);
485 print_liste_field_titre(
"Label", $_SERVER[
"PHP_SELF"],
"s.label",
"", $param,
'class="left"', $sortfield, $sortorder);
486 print_liste_field_titre(
"PeriodEndDate", $_SERVER[
"PHP_SELF"],
"sal.dateep",
"", $param,
'', $sortfield, $sortorder,
'center ');
487 print_liste_field_titre(
"DatePayment", $_SERVER[
"PHP_SELF"],
"s.datep,s.rowid",
"", $param,
'', $sortfield, $sortorder,
'center ');
490 print_liste_field_titre(
"PaymentMode", $_SERVER[
"PHP_SELF"],
"pst.code",
"", $param,
'class="left"', $sortfield, $sortorder);
491 print_liste_field_titre(
"Numero", $_SERVER[
"PHP_SELF"],
"s.num_payment",
"", $param,
'', $sortfield, $sortorder,
'',
'ChequeOrTransferNumber');
493 print_liste_field_titre(
"BankTransactionLine", $_SERVER[
"PHP_SELF"],
"s.fk_bank",
"", $param,
'', $sortfield, $sortorder);
494 print_liste_field_titre(
"BankAccount", $_SERVER[
"PHP_SELF"],
"ba.label",
"", $param,
"", $sortfield, $sortorder);
496 print_liste_field_titre(
"PayedByThisPayment", $_SERVER[
"PHP_SELF"],
"s.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
498 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
500 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
501 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
502 print $hookmanager->resPrint;
504 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
509 $needToFetchEachLine = 0;
510 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
511 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
512 if (preg_match(
'/\$object/', $val)) {
513 $needToFetchEachLine++;
523 $totalarray = array();
524 while ($i < ($limit ? min($num, $limit) : $num)) {
525 $obj = $db->fetch_object(
$resql);
532 $object->setVarsFromFetchObj($obj);
535 print
'<tr class="oddeven">';
537 $userstatic->id = $obj->uid;
538 $userstatic->lastname = $obj->lastname;
539 $userstatic->firstname = $obj->firstname;
540 $userstatic->admin = $obj->admin;
541 $userstatic->login = $obj->login;
542 $userstatic->email = $obj->email;
543 $userstatic->socid = $obj->fk_soc;
544 $userstatic->statut = $obj->status;
546 $salstatic->id = $obj->id_salary;
547 $salstatic->ref = $obj->id_salary;
549 $paymentsalstatic->id = $obj->rowid;
550 $paymentsalstatic->ref = $obj->rowid;
553 print
"<td>".$paymentsalstatic->getNomUrl(1).
"</td>\n";
555 $totalarray[
'nbfield']++;
559 print
"<td>".$salstatic->getNomUrl(1).
"</td>\n";
561 $totalarray[
'nbfield']++;
565 print
"<td>".dol_trunc($obj->label, 40).
"</td>\n";
567 $totalarray[
'nbfield']++;
571 print
'<td class="center">'.dol_print_date($db->jdate($obj->dateep),
'day').
"</td>\n";
573 $totalarray[
'nbfield']++;
577 print
'<td class="center">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>\n";
579 $totalarray[
'nbfield']++;
587 print
"<td>".$userstatic->getNomUrl(1).
"</td>\n";
589 $totalarray[
'nbfield']++;
594 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
597 $totalarray[
'nbfield']++;
601 print
'<td>'.$obj->num_payment.
'</td>';
603 $totalarray[
'nbfield']++;
610 $accountlinestatic->id = $obj->fk_bank;
611 print $accountlinestatic->getNomUrl(1);
614 $totalarray[
'nbfield']++;
618 if ($obj->fk_bank > 0) {
620 $accountstatic->id = $obj->bid;
621 $accountstatic->ref = $obj->bref;
622 $accountstatic->number = $obj->bnumber;
623 $accountstatic->iban = $obj->iban;
624 $accountstatic->bic = $obj->bic;
625 $accountstatic->currency_code = $langs->trans(
"Currency".$obj->currency_code);
626 $accountstatic->clos = $obj->clos;
629 $accountstatic->account_number = $obj->account_number;
632 $accountingjournal->fetch($obj->fk_accountancy_journal);
634 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
636 $accountstatic->label = $obj->blabel;
637 if ($accountstatic->id > 0) {
638 print $accountstatic->getNomUrl(1);
645 $totalarray[
'nbfield']++;
650 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
652 $totalarray[
'nbfield']++;
655 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalttcfield';
657 $totalarray[
'val'][
'totalttcfield'] += $obj->amount;
660 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
662 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
663 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
664 print $hookmanager->resPrint;
666 print
'<td class="nowrap center">';
667 if ($massactionbutton || $massaction) {
669 if (in_array($object->id, $arrayofselected)) {
672 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
676 $totalarray[
'nbfield']++;
685 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
697 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
703 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
704 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
705 print $hookmanager->resPrint;
707 print
'</table>'.
"\n";
710 print
'</form>'.
"\n";