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')) {
59$offset = $limit * $page;
63 $sortfield =
"s.datep,s.rowid";
66 $sortorder =
"DESC,DESC";
72$diroutputmassaction = $conf->user->dir_output.
'/temp/massgeneration/'.$user->id;
73$hookmanager->initHooks(array(
'salarieslist'));
76$extrafields->fetch_name_optionals_label($object->table_element);
78$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
81 $sortfield =
"s.datep,s.rowid";
84 $sortorder =
"DESC,DESC";
87$search_ref =
GETPOST(
'search_ref',
'int');
88$search_ref_salary =
GETPOST(
'search_ref_salary',
'int');
89$search_user =
GETPOST(
'search_user',
'alpha');
90$search_label =
GETPOST(
'search_label',
'alpha');
91$search_date_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
92$search_date_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
93$search_dateep_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_dateep_startmonth',
'int'),
GETPOST(
'search_dateep_startday',
'int'),
GETPOST(
'search_dateep_startyear',
'int'));
94$search_dateep_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_dateep_endmonth',
'int'),
GETPOST(
'search_dateep_endday',
'int'),
GETPOST(
'search_dateep_endyear',
'int'));
95$search_amount =
GETPOST(
'search_amount',
'alpha');
96$search_account =
GETPOST(
'search_account',
'int');
97$search_fk_bank =
GETPOST(
'search_fk_bank',
'int');
98$search_chq_number =
GETPOST(
'search_chq_number',
'int');
100$filtre =
GETPOST(
"filtre",
'restricthtml');
103if (!
GETPOST(
'search_type_id',
'int')) {
104 $newfiltre = str_replace(
'filtre=',
'', $filtre);
105 $filterarray = explode(
'-', $newfiltre);
106 foreach ($filterarray as $val) {
107 $part = explode(
':', $val);
108 if ($part[0] ==
's.fk_typepayment') {
109 $search_type_id = $part[1];
113 $search_type_id =
GETPOST(
'search_type_id',
'int');
116$childids = $user->getAllChildIds(1);
119$search_all =
GETPOST(
"search_all",
'alpha');
121foreach ($object->fields as $key => $val) {
122 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
123 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
128$fieldstosearchall = array();
129foreach ($object->fields as $key => $val) {
130 if (!empty($val[
'searchall'])) {
131 $fieldstosearchall[
't.'.$key] = $val[
'label'];
136$arrayfields = array();
137foreach ($object->fields as $key => $val) {
139 if (!empty($val[
'visible'])) {
140 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
141 $arrayfields[
't.'.$key] = array(
142 'label'=>$val[
'label'],
143 'checked'=>(($visible < 0) ? 0 : 1),
144 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
145 'position'=>$val[
'position'],
146 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
151$permissiontoread = $user->rights->salaries->read;
152$permissiontoadd = $user->rights->salaries->write;
153$permissiontodelete = $user->rights->salaries->delete;
156$socid =
GETPOST(
"socid",
"int");
157if ($user->socid > 0) {
158 $socid = $user->socid;
167if (
GETPOST(
'cancel',
'alpha')) {
171if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
175$parameters = array();
176$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
181if (empty($reshook)) {
183 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
186 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
188 $search_ref_salary =
"";
191 $search_date_start =
'';
192 $search_date_end =
'';
193 $search_dateep_start =
'';
194 $search_dateep_end =
'';
196 $search_account =
'';
197 $search_fk_bank =
'';
198 $search_chq_number =
'';
199 $search_type_id =
"";
201 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
202 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
207 $objectclass =
'PaymentSalary';
208 $objectlabel =
'SalariesPayments';
209 $uploaddir = $conf->salaries->dir_output;
210 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
213 if (!$error && $massaction ==
'buildsepa' && $permissiontoadd) {
214 $objecttmp =
new $objectclass($db);
224$form =
new Form($db);
225$salstatic =
new Salary($db);
227$userstatic =
new User($db);
228$accountstatic =
new Account($db);
235$title = $langs->trans(
'SalariesPayments');
237$sql =
"SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.photo, u.gender, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,";
238$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,";
239$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,";
240$sql .=
" pst.code as payment_code";
241$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as s";
242$sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"salary as sal ON (sal.rowid = s.fk_salary)";
243$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON s.fk_typepayment = pst.id";
244$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON s.fk_bank = b.rowid";
245$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid,";
246$sql .=
" ".MAIN_DB_PREFIX.
"user as u";
247$sql .=
" WHERE u.rowid = sal.fk_user";
248$sql .=
" AND s.entity IN (".getEntity(
'payment_salaries').
")";
249if (!$user->hasRight(
'salaries',
'readall')) {
250 $sql .=
" AND sal.fk_user IN (".$db->sanitize(join(
',', $childids)).
")";
255 $sql .=
" AND s.rowid=".((int) $search_ref);
257if ($search_ref_salary) {
258 $sql .=
" AND sal.rowid=".((int) $search_ref_salary);
261 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname',
'u.email'), $search_user);
266if ($search_date_start) {
267 $sql .=
" AND s.datep >= '".$db->idate($search_date_start).
"'";
269if ($search_date_end) {
270 $sql .=
" AND s.datep <= '".$db->idate($search_date_end).
"'";
272if ($search_dateep_start) {
273 $sql .=
" AND sal.dateep >= '".$db->idate($search_dateep_start).
"'";
275if ($search_dateep_end) {
276 $sql .=
" AND sal.dateep <= '".$db->idate($search_dateep_end).
"'";
281if ($search_account > 0) {
282 $sql .=
" AND b.fk_account=".((int) $search_account);
284if ($search_fk_bank) {
285 $sql .=
" AND s.fk_bank=".((int) $search_fk_bank);
287if ($search_chq_number) {
288 $sql .=
natural_search(array(
's.num_payment'), $search_chq_number);
291if ($search_type_id > 0) {
292 $sql .=
" AND s.fk_typepayment=".((int) $search_type_id);
294$sql .= $db->order($sortfield, $sortorder);
297$nbtotalofrecords =
'';
299 $resql = $db->query($sql);
301 $nbtotalofrecords = $db->num_rows($resql);
306 if (($page * $limit) > $nbtotalofrecords) {
312if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
313 $num = $nbtotalofrecords;
316 $sql .= $db->plimit($limit + 1, $offset);
319 $resql = $db->query($sql);
325 $num = $db->num_rows($resql);
333$arrayofselected = is_array($toselect) ? $toselect : array();
337 $param .=
'&mode='.urlencode($mode);
339if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
340 $param .=
'&contextpage='.urlencode($contextpage);
342if ($limit > 0 && $limit != $conf->liste_limit) {
343 $param .=
'&limit='.((int) $limit);
345if ($search_type_id) {
346 $param .=
'&search_type_id='.urlencode($search_type_id);
348if ($optioncss !=
'') {
349 $param .=
'&optioncss='.urlencode($optioncss);
352 $param .=
'&search_ref='.urlencode($search_ref);
354if ($search_ref_salary) {
355 $param .=
'&search_ref_salary='.urlencode($search_ref_salary);
358 $param .=
'&search_user='.urlencode($search_user);
361 $param .=
'&search_label='.urlencode($search_label);
363if ($search_fk_bank) {
364 $param .=
'&search_fk_bank='.urlencode($search_fk_bank);
366if ($search_chq_number) {
367 $param .=
'&search_chq_number='.urlencode($search_chq_number);
369if ($search_account) {
370 $param .=
'&search_account='.urlencode($search_account);
372if ($search_date_start) {
373 $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'));
375if ($search_dateep_start) {
376 $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'));
378if ($search_date_end) {
379 $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'));
381if ($search_dateep_end) {
382 $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'));
385include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
388$arrayofmassactions = array(
393if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
394 $arrayofmassactions = array();
396$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
398print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
399if ($optioncss !=
'') {
400 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
402print
'<input type="hidden" name="token" value="'.newToken().
'">';
403print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
404print
'<input type="hidden" name="action" value="list">';
405print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
406print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
407print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
408print
'<input type="hidden" name="mode" value="'.$mode.
'">';
411$url = DOL_URL_ROOT.
'/salaries/card.php?action=create';
413 $url .=
'&socid='.$socid;
416$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'));
417$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'));
419$newcardbutton =
dolGetButtonTitle($langs->trans(
'NewSalaryPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->salaries->write);
421print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
425$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
428$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
430print
'<div class="div-table-responsive">';
431print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
435print
'<tr class="liste_titre_filter">';
438 print
'<td class="liste_titre maxwidthsearch">';
439 $searchpicto = $form->showFilterButtons();
444print
'<td class="liste_titre left">';
445print
'<input class="flat" type="text" size="3" name="search_ref" value="'.$db->escape($search_ref).
'">';
448print
'<td class="liste_titre center">';
449print
'<input class="flat" type="text" size="3" name="search_ref_salary" value="'.$db->escape($search_ref_salary).
'">';
452print
'<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$db->escape($search_label).
'"></td>';
454print
'<td class="liste_titre center">';
455print
'<div class="nowrapfordate">';
456 print $form->selectDate($search_dateep_start ? $search_dateep_start : -1,
'search_dateep_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
458print
'<div class="nowrapfordate">';
459 print $form->selectDate($search_dateep_end ? $search_dateep_end : -1,
'search_dateep_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
463print
'<td class="liste_titre center">';
464print
'<div class="nowrapfordate">';
465 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
467print
'<div class="nowrapfordate">';
468 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
475print
'<td class="liste_titre">';
476print
'<input class="flat" type="text" size="6" name="search_user" value="'.$db->escape($search_user).
'">';
479print
'<td class="liste_titre">';
480print $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'', 1);
483print
'<td class="liste_titre"><input name="search_chq_number" class="flat width50" type="text" value="'.$db->escape($search_chq_number).
'"></td>';
485if (isModEnabled(
"banque")) {
487 print
'<td class="liste_titre">';
488 print
'<input class="flat width50" type="text" name="search_fk_bank" value="'.$db->escape($search_fk_bank).
'">';
492 print
'<td class="liste_titre">';
493 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
497print
'<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).
'"></td>';
500include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
503$parameters = array(
'arrayfields'=>$arrayfields);
504$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
505print $hookmanager->resPrint;
508 print
'<td class="liste_titre maxwidthsearch">';
509 $searchpicto = $form->showFilterButtons();
515$totalarray = array();
516$totalarray[
'nbfield'] = 0;
520print
'<tr class="liste_titre">';
523 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
524 $totalarray[
'nbfield']++;
527$totalarray[
'nbfield']++;
529$totalarray[
'nbfield']++;
531$totalarray[
'nbfield']++;
532print_liste_field_titre(
"PeriodEndDate", $_SERVER[
"PHP_SELF"],
"sal.dateep",
"", $param,
'', $sortfield, $sortorder,
'center ');
533$totalarray[
'nbfield']++;
534print_liste_field_titre(
"DatePayment", $_SERVER[
"PHP_SELF"],
"s.datep,s.rowid",
"", $param,
'', $sortfield, $sortorder,
'center ');
535$totalarray[
'nbfield']++;
537$totalarray[
'nbfield']++;
538print_liste_field_titre(
"PaymentMode", $_SERVER[
"PHP_SELF"],
"pst.code",
"", $param,
'', $sortfield, $sortorder);
539$totalarray[
'nbfield']++;
540print_liste_field_titre(
"Numero", $_SERVER[
"PHP_SELF"],
"s.num_payment",
"", $param,
'', $sortfield, $sortorder,
'',
'ChequeOrTransferNumber');
541$totalarray[
'nbfield']++;
542if (isModEnabled(
"banque")) {
543 print_liste_field_titre(
"BankTransactionLine", $_SERVER[
"PHP_SELF"],
"s.fk_bank",
"", $param,
'', $sortfield, $sortorder);
544 $totalarray[
'nbfield']++;
545 print_liste_field_titre(
"BankAccount", $_SERVER[
"PHP_SELF"],
"ba.label",
"", $param,
"", $sortfield, $sortorder);
546 $totalarray[
'nbfield']++;
548print_liste_field_titre(
"PayedByThisPayment", $_SERVER[
"PHP_SELF"],
"s.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
549$totalarray[
'nbfield']++;
551include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
553$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
554$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
555print $hookmanager->resPrint;
558 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
559 $totalarray[
'nbfield']++;
565$needToFetchEachLine = 0;
566if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
567 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
568 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
569 $needToFetchEachLine++;
578$savnbfield = $totalarray[
'nbfield'];
579$totalarray = array();
580$totalarray[
'nbfield'] = 0;
581$imaxinloop = ($limit ? min($num, $limit) : $num);
582while ($i < $imaxinloop) {
583 $obj = $db->fetch_object($resql);
590 $object->setVarsFromFetchObj($obj);
592 $userstatic->id = $obj->uid;
593 $userstatic->lastname = $obj->lastname;
594 $userstatic->firstname = $obj->firstname;
595 $userstatic->admin = $obj->admin;
596 $userstatic->login = $obj->login;
597 $userstatic->email = $obj->email;
598 $userstatic->socid = $obj->fk_soc;
599 $userstatic->statut = $obj->status;
600 $userstatic->status = $obj->status;
601 $userstatic->gender = $obj->gender;
602 $userstatic->photo = $obj->photo;
604 $salstatic->id = $obj->id_salary;
605 $salstatic->ref = $obj->id_salary;
607 $paymentsalstatic->id = $obj->rowid;
608 $paymentsalstatic->ref = $obj->rowid;
609 $paymentsalstatic->amount = $obj->amount;
610 $paymentsalstatic->fk_typepayment = $obj->payment_code;
611 $paymentsalstatic->datec = $obj->dateep;
612 $paymentsalstatic->datep = $obj->datep;
614 $accountlinestatic->id = $obj->fk_bank;
615 $accountlinestatic->ref = $obj->fk_bank;
616 $paymentsalstatic->fk_bank = $accountlinestatic->getNomUrl(1);
617 $paymentsalstatic->fk_user_author = $userstatic->getNomUrl(1);
619 if ($mode ==
'kanban') {
621 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
622 print
'<div class="box-flex-container kanban">';
625 print $paymentsalstatic->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
626 if ($i == ($imaxinloop - 1)) {
632 print
'<tr class="oddeven">';
636 print
'<td class="nowrap center">';
637 if ($massactionbutton || $massaction) {
639 if (in_array($object->id, $arrayofselected)) {
642 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
646 $totalarray[
'nbfield']++;
651 print
"<td>".$paymentsalstatic->getNomUrl(1).
"</td>\n";
653 $totalarray[
'nbfield']++;
657 print
"<td>".$salstatic->getNomUrl(1).
"</td>\n";
659 $totalarray[
'nbfield']++;
663 print
"<td>".dol_trunc($obj->label, 40).
"</td>\n";
665 $totalarray[
'nbfield']++;
669 print
'<td class="center">'.dol_print_date($db->jdate($obj->dateep),
'day').
"</td>\n";
671 $totalarray[
'nbfield']++;
675 print
'<td class="center">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>\n";
677 $totalarray[
'nbfield']++;
685 print
'<td class="tdoverflowmax150">'.$userstatic->getNomUrl(-1).
"</td>\n";
687 $totalarray[
'nbfield']++;
692 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
695 $totalarray[
'nbfield']++;
699 print
'<td>'.$obj->num_payment.
'</td>';
701 $totalarray[
'nbfield']++;
705 if (isModEnabled(
"banque")) {
708 $accountlinestatic->id = $obj->fk_bank;
709 print $accountlinestatic->getNomUrl(1);
712 $totalarray[
'nbfield']++;
716 if ($obj->fk_bank > 0) {
718 $accountstatic->id = $obj->bid;
719 $accountstatic->ref = $obj->bref;
720 $accountstatic->number = $obj->bnumber;
721 $accountstatic->iban = $obj->iban;
722 $accountstatic->bic = $obj->bic;
723 $accountstatic->currency_code = $langs->trans(
"Currency".$obj->currency_code);
724 $accountstatic->clos = $obj->clos;
726 if (isModEnabled(
'accounting')) {
727 $accountstatic->account_number = $obj->account_number;
730 $accountingjournal->fetch($obj->fk_accountancy_journal);
732 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
734 $accountstatic->label = $obj->blabel;
735 if ($accountstatic->id > 0) {
736 print $accountstatic->getNomUrl(1);
743 $totalarray[
'nbfield']++;
748 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
750 $totalarray[
'nbfield']++;
753 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalttcfield';
756 $totalarray[
'val'][
'totalttcfield'] = $obj->amount;
758 $totalarray[
'val'][
'totalttcfield'] += $obj->amount;
763 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
765 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
766 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
767 print $hookmanager->resPrint;
771 print
'<td class="nowrap center">';
772 if ($massactionbutton || $massaction) {
774 if (in_array($object->id, $arrayofselected)) {
777 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
781 $totalarray[
'nbfield']++;
791include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
803 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
809$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
810$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
811print $hookmanager->resPrint;
813print
'</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 journals.
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 a 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.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
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.