29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/salaries/class/salary.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
33if (isModEnabled(
'accounting')) {
34 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
38$langs->loadLangs(array(
"compta",
"salaries",
"bills",
"hrm"));
40$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
41$massaction =
GETPOST(
'massaction',
'alpha');
43$confirm =
GETPOST(
'confirm',
'alpha');
44$cancel =
GETPOST(
'cancel',
'alpha');
45$toselect =
GETPOST(
'toselect',
'array');
46$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'bomlist';
47$backtopage =
GETPOST(
'backtopage',
'alpha');
48$optioncss =
GETPOST(
'optioncss',
'aZ');
49$mode =
GETPOST(
'mode',
'alpha');
54$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
55$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
57if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
60$offset = $limit * $page;
64 $sortfield =
"s.datep,s.rowid";
67 $sortorder =
"DESC,DESC";
73$diroutputmassaction = $conf->user->dir_output.
'/temp/massgeneration/'.$user->id;
74$hookmanager->initHooks(array(
'salarieslist'));
77$extrafields->fetch_name_optionals_label(
$object->table_element);
79$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
82 $sortfield =
"s.datep,s.rowid";
85 $sortorder =
"DESC,DESC";
88$search_ref =
GETPOST(
'search_ref',
'alpha');
89$search_ref_salary =
GETPOST(
'search_ref_salary',
'alpha');
90$search_user =
GETPOST(
'search_user',
'alpha');
91$search_label =
GETPOST(
'search_label',
'alpha');
96$search_amount =
GETPOST(
'search_amount',
'alpha');
97$search_account =
GETPOST(
'search_account',
'alpha');
98$search_fk_bank =
GETPOST(
'search_fk_bank',
'alpha');
99$search_chq_number =
GETPOST(
'search_chq_number',
'alpha');
101$search_type_id =
GETPOST(
'search_type_id',
'int');
102if (!$search_type_id) {
103 $filtre =
GETPOST(
"filtre",
'restricthtml');
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 = (int) $part[1];
114$childids = $user->getAllChildIds(1);
117$search_all =
GETPOST(
"search_all",
'alpha');
119foreach (
$object->fields as $key => $val) {
120 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
121 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
126$fieldstosearchall = array();
127foreach (
$object->fields as $key => $val) {
128 if (!empty($val[
'searchall'])) {
129 $fieldstosearchall[
't.'.$key] = $val[
'label'];
134$arrayfields = array();
135foreach (
$object->fields as $key => $val) {
137 if (!empty($val[
'visible'])) {
138 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
139 $arrayfields[
't.'.$key] = array(
140 'label' => $val[
'label'],
141 'checked' => (($visible < 0) ? 0 : 1),
142 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
143 'position' => $val[
'position'],
144 'help' => isset($val[
'help']) ? $val[
'help'] :
''
149$permissiontoread = $user->hasRight(
'salaries',
'read');
150$permissiontoadd = $user->hasRight(
'salaries',
'write');
151$permissiontodelete = $user->hasRight(
'salaries',
'delete');
155if ($user->socid > 0) {
156 $socid = $user->socid;
165if (
GETPOST(
'cancel',
'alpha')) {
169if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
173$parameters = array();
174$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
179if (empty($reshook)) {
181 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
184 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
186 $search_ref_salary =
"";
189 $search_date_start =
'';
190 $search_date_end =
'';
191 $search_dateep_start =
'';
192 $search_dateep_end =
'';
194 $search_account =
'';
195 $search_fk_bank =
'';
196 $search_chq_number =
'';
197 $search_type_id =
"";
199 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
200 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
205 $objectclass =
'PaymentSalary';
206 $objectlabel =
'SalariesPayments';
207 $uploaddir = $conf->salaries->dir_output;
208 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
211 if (!$error && $massaction ==
'buildsepa' && $permissiontoadd) {
212 $objecttmp =
new $objectclass($db);
222$form =
new Form($db);
223$salstatic =
new Salary($db);
225$userstatic =
new User($db);
226$accountstatic =
new Account($db);
233$title = $langs->trans(
'SalariesPayments');
235$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,";
236$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,";
237$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,";
238$sql .=
" pst.code as payment_code";
239$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as s";
240$sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"salary as sal ON (sal.rowid = s.fk_salary)";
241$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON s.fk_typepayment = pst.id";
242$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON s.fk_bank = b.rowid";
243$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid,";
244$sql .=
" ".MAIN_DB_PREFIX.
"user as u";
245$sql .=
" WHERE u.rowid = sal.fk_user";
246$sql .=
" AND s.entity IN (".getEntity(
'payment_salaries').
")";
247if (!$user->hasRight(
'salaries',
'readall')) {
248 $sql .=
" AND sal.fk_user IN (".$db->sanitize(implode(
',', $childids)).
")";
253 $sql .=
" AND s.rowid=".((int) $search_ref);
255if ($search_ref_salary) {
256 $sql .=
" AND sal.rowid=".((int) $search_ref_salary);
259 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname',
'u.email'), $search_user);
264if ($search_date_start) {
265 $sql .=
" AND s.datep >= '".$db->idate($search_date_start).
"'";
267if ($search_date_end) {
268 $sql .=
" AND s.datep <= '".$db->idate($search_date_end).
"'";
270if ($search_dateep_start) {
271 $sql .=
" AND sal.dateep >= '".$db->idate($search_dateep_start).
"'";
273if ($search_dateep_end) {
274 $sql .=
" AND sal.dateep <= '".$db->idate($search_dateep_end).
"'";
279if ($search_account > 0) {
280 $sql .=
" AND b.fk_account=".((int) $search_account);
282if ($search_fk_bank) {
283 $sql .=
" AND s.fk_bank=".((int) $search_fk_bank);
285if ($search_chq_number) {
286 $sql .=
natural_search(array(
's.num_payment'), $search_chq_number);
289if ($search_type_id > 0) {
290 $sql .=
" AND s.fk_typepayment=".((int) $search_type_id);
292$sql .= $db->order($sortfield, $sortorder);
295$nbtotalofrecords =
'';
297 $resql = $db->query($sql);
299 $nbtotalofrecords = $db->num_rows($resql);
304 if (($page * $limit) > $nbtotalofrecords) {
310if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
311 $num = $nbtotalofrecords;
314 $sql .= $db->plimit($limit + 1, $offset);
317 $resql = $db->query($sql);
323 $num = $db->num_rows($resql);
329llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
331$arrayofselected = is_array($toselect) ? $toselect : array();
335 $param .=
'&mode='.urlencode($mode);
337if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
338 $param .=
'&contextpage='.urlencode($contextpage);
340if ($limit > 0 && $limit != $conf->liste_limit) {
341 $param .=
'&limit='.((int) $limit);
343if ($search_type_id) {
344 $param .=
'&search_type_id='.urlencode($search_type_id);
346if ($optioncss !=
'') {
347 $param .=
'&optioncss='.urlencode($optioncss);
350 $param .=
'&search_ref='.urlencode($search_ref);
352if ($search_ref_salary) {
353 $param .=
'&search_ref_salary='.urlencode($search_ref_salary);
356 $param .=
'&search_user='.urlencode($search_user);
359 $param .=
'&search_label='.urlencode($search_label);
361if ($search_fk_bank) {
362 $param .=
'&search_fk_bank='.urlencode((
string) ($search_fk_bank));
364if ($search_chq_number) {
365 $param .=
'&search_chq_number='.urlencode((
string) ($search_chq_number));
367if ($search_account) {
368 $param .=
'&search_account='.urlencode((
string) ($search_account));
370if ($search_date_start) {
371 $param .=
'&search_date_startday='.GETPOSTINT(
'search_date_startday').
'&search_date_startmonth='.
GETPOSTINT(
'search_date_startmonth').
'&search_date_startyear='.
GETPOSTINT(
'search_date_startyear');
373if ($search_dateep_start) {
374 $param .=
'&search_dateep_startday='.GETPOSTINT(
'search_dateep_startday').
'&search_dateep_startmonth='.
GETPOSTINT(
'search_dateep_startmonth').
'&search_dateep_startyear='.
GETPOSTINT(
'search_dateep_startyear');
376if ($search_date_end) {
377 $param .=
'&search_date_endday='.GETPOSTINT(
'search_date_endday').
'&search_date_endmonth='.
GETPOSTINT(
'search_date_endmonth').
'&search_date_endyear='.
GETPOSTINT(
'search_date_endyear');
379if ($search_dateep_end) {
380 $param .=
'&search_dateep_endday='.urlencode((
string) (
GETPOSTINT(
'search_dateep_endday'))).
'&search_dateep_endmonth='.urlencode((
string) (
GETPOSTINT(
'search_dateep_endmonth'))).
'&search_dateep_endyear='.urlencode((
string) (
GETPOSTINT(
'search_dateep_endyear')));
383include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
386$arrayofmassactions = array(
391if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
392 $arrayofmassactions = array();
394$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
396print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
397if ($optioncss !=
'') {
398 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
400print
'<input type="hidden" name="token" value="'.newToken().
'">';
401print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
402print
'<input type="hidden" name="action" value="list">';
403print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
404print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
405print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
406print
'<input type="hidden" name="mode" value="'.$mode.
'">';
409$url = DOL_URL_ROOT.
'/salaries/card.php?action=create';
411 $url .=
'&socid='.$socid;
414$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'));
415$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'));
417$newcardbutton =
dolGetButtonTitle($langs->trans(
'NewSalaryPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'salaries',
'write'));
419print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
423$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
426$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
428print
'<div class="div-table-responsive">';
429print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
433print
'<tr class="liste_titre_filter">';
436 print
'<td class="liste_titre maxwidthsearch">';
437 $searchpicto = $form->showFilterButtons();
442print
'<td class="liste_titre left">';
443print
'<input class="flat" type="text" size="3" name="search_ref" value="'.$db->escape($search_ref).
'">';
446print
'<td class="liste_titre center">';
447print
'<input class="flat" type="text" size="3" name="search_ref_salary" value="'.$db->escape($search_ref_salary).
'">';
450print
'<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$db->escape($search_label).
'"></td>';
452print
'<td class="liste_titre center">';
453print
'<div class="nowrapfordate">';
454print $form->selectDate($search_dateep_start ? $search_dateep_start : -1,
'search_dateep_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
456print
'<div class="nowrapfordate">';
457print $form->selectDate($search_dateep_end ? $search_dateep_end : -1,
'search_dateep_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
461print
'<td class="liste_titre center">';
462print
'<div class="nowrapfordate">';
463print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
465print
'<div class="nowrapfordate">';
466print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
473print
'<td class="liste_titre">';
474print
'<input class="flat" type="text" size="6" name="search_user" value="'.$db->escape($search_user).
'">';
477print
'<td class="liste_titre">';
478print $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'', 1);
481print
'<td class="liste_titre"><input name="search_chq_number" class="flat width50" type="text" value="'.$db->escape($search_chq_number).
'"></td>';
483if (isModEnabled(
"bank")) {
485 print
'<td class="liste_titre">';
486 print
'<input class="flat width50" type="text" name="search_fk_bank" value="'.$db->escape($search_fk_bank).
'">';
490 print
'<td class="liste_titre">';
491 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
495print
'<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).
'"></td>';
498include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
501$parameters = array(
'arrayfields' => $arrayfields);
502$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters,
$object);
503print $hookmanager->resPrint;
506 print
'<td class="liste_titre maxwidthsearch">';
507 $searchpicto = $form->showFilterButtons();
513$totalarray = array();
514$totalarray[
'nbfield'] = 0;
518print
'<tr class="liste_titre">';
521 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
522 $totalarray[
'nbfield']++;
525$totalarray[
'nbfield']++;
527$totalarray[
'nbfield']++;
529$totalarray[
'nbfield']++;
530print_liste_field_titre(
"PeriodEndDate", $_SERVER[
"PHP_SELF"],
"sal.dateep",
"", $param,
'', $sortfield, $sortorder,
'center ');
531$totalarray[
'nbfield']++;
532print_liste_field_titre(
"DatePayment", $_SERVER[
"PHP_SELF"],
"s.datep,s.rowid",
"", $param,
'', $sortfield, $sortorder,
'center ');
533$totalarray[
'nbfield']++;
535$totalarray[
'nbfield']++;
536print_liste_field_titre(
"PaymentMode", $_SERVER[
"PHP_SELF"],
"pst.code",
"", $param,
'', $sortfield, $sortorder);
537$totalarray[
'nbfield']++;
538print_liste_field_titre(
"Numero", $_SERVER[
"PHP_SELF"],
"s.num_payment",
"", $param,
'', $sortfield, $sortorder,
'',
'ChequeOrTransferNumber');
539$totalarray[
'nbfield']++;
540if (isModEnabled(
"bank")) {
541 print_liste_field_titre(
"BankTransactionLine", $_SERVER[
"PHP_SELF"],
"s.fk_bank",
"", $param,
'', $sortfield, $sortorder);
542 $totalarray[
'nbfield']++;
543 print_liste_field_titre(
"BankAccount", $_SERVER[
"PHP_SELF"],
"ba.label",
"", $param,
"", $sortfield, $sortorder);
544 $totalarray[
'nbfield']++;
546print_liste_field_titre(
"PayedByThisPayment", $_SERVER[
"PHP_SELF"],
"s.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
547$totalarray[
'nbfield']++;
549include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
551$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
552$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters,
$object);
553print $hookmanager->resPrint;
556 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
557 $totalarray[
'nbfield']++;
563$needToFetchEachLine = 0;
564if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
565 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
566 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
567 $needToFetchEachLine++;
576$savnbfield = $totalarray[
'nbfield'];
577$totalarray = array();
578$totalarray[
'nbfield'] = 0;
579$imaxinloop = ($limit ? min($num, $limit) : $num);
580while ($i < $imaxinloop) {
581 $obj = $db->fetch_object($resql);
588 $object->setVarsFromFetchObj($obj);
590 $userstatic->id = $obj->uid;
591 $userstatic->lastname = $obj->lastname;
592 $userstatic->firstname = $obj->firstname;
593 $userstatic->admin = $obj->admin;
594 $userstatic->login = $obj->login;
595 $userstatic->email = $obj->email;
596 $userstatic->socid = $obj->fk_soc;
597 $userstatic->statut = $obj->status;
598 $userstatic->status = $obj->status;
599 $userstatic->gender = $obj->gender;
600 $userstatic->photo = $obj->photo;
602 $salstatic->id = $obj->id_salary;
603 $salstatic->ref = $obj->id_salary;
605 $paymentsalstatic->id = $obj->rowid;
606 $paymentsalstatic->ref = $obj->rowid;
607 $paymentsalstatic->amount = $obj->amount;
608 $paymentsalstatic->fk_typepayment = $obj->payment_code;
609 $paymentsalstatic->datec = $obj->dateep;
610 $paymentsalstatic->datep = $obj->datep;
612 $accountlinestatic->id = $obj->fk_bank;
613 $accountlinestatic->ref = $obj->fk_bank;
614 $paymentsalstatic->fk_bank = $accountlinestatic->id;
615 $paymentsalstatic->fk_user_author = $userstatic->id;
617 if ($mode ==
'kanban') {
619 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
620 print
'<div class="box-flex-container kanban">';
623 print $paymentsalstatic->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
624 if ($i == ($imaxinloop - 1)) {
630 print
'<tr class="oddeven">';
634 print
'<td class="nowrap center">';
635 if ($massactionbutton || $massaction) {
637 if (in_array(
$object->id, $arrayofselected)) {
640 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
644 $totalarray[
'nbfield']++;
649 print
"<td>".$paymentsalstatic->getNomUrl(1).
"</td>\n";
651 $totalarray[
'nbfield']++;
655 print
"<td>".$salstatic->getNomUrl(1).
"</td>\n";
657 $totalarray[
'nbfield']++;
661 print
"<td>".dol_trunc($obj->label, 40).
"</td>\n";
663 $totalarray[
'nbfield']++;
667 print
'<td class="center">'.dol_print_date($db->jdate($obj->dateep),
'day').
"</td>\n";
669 $totalarray[
'nbfield']++;
673 print
'<td class="center">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>\n";
675 $totalarray[
'nbfield']++;
683 print
'<td class="tdoverflowmax150">'.$userstatic->getNomUrl(-1).
"</td>\n";
685 $totalarray[
'nbfield']++;
690 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
693 $totalarray[
'nbfield']++;
697 print
'<td>'.$obj->num_payment.
'</td>';
699 $totalarray[
'nbfield']++;
703 if (isModEnabled(
"bank")) {
706 $accountlinestatic->id = $obj->fk_bank;
707 print $accountlinestatic->getNomUrl(1);
710 $totalarray[
'nbfield']++;
714 if ($obj->fk_bank > 0) {
716 $accountstatic->id = $obj->bid;
717 $accountstatic->ref = $obj->bref;
718 $accountstatic->number = $obj->bnumber;
719 $accountstatic->iban = $obj->iban;
720 $accountstatic->bic = $obj->bic;
721 $accountstatic->currency_code = $langs->trans(
"Currency".$obj->currency_code);
722 $accountstatic->clos = $obj->clos;
724 if (isModEnabled(
'accounting')) {
725 $accountstatic->account_number = $obj->account_number;
728 $accountingjournal->fetch($obj->fk_accountancy_journal);
730 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
732 $accountstatic->label = $obj->blabel;
733 if ($accountstatic->id > 0) {
734 print $accountstatic->getNomUrl(1);
741 $totalarray[
'nbfield']++;
746 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
748 $totalarray[
'nbfield']++;
751 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalttcfield';
754 $totalarray[
'val'][
'totalttcfield'] = $obj->amount;
756 $totalarray[
'val'][
'totalttcfield'] += $obj->amount;
761 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
763 $parameters = array(
'arrayfields' => $arrayfields,
'object' =>
$object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
764 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters,
$object);
765 print $hookmanager->resPrint;
769 print
'<td class="nowrap center">';
770 if ($massactionbutton || $massaction) {
772 if (in_array(
$object->id, $arrayofselected)) {
775 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
779 $totalarray[
'nbfield']++;
789include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
801 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
807$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
808$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters,
$object);
809print $hookmanager->resPrint;
811print
'</table>'.
"\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.
Class to manage 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 information (by default a local PHP server timestamp) Rep...
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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.
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.
print_barre_liste($title, $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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.