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';
46$langs->loadLangs(array(
"compta",
"salaries",
"bills",
"hrm"));
48$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
49$massaction =
GETPOST(
'massaction',
'alpha');
51$confirm =
GETPOST(
'confirm',
'alpha');
52$cancel =
GETPOST(
'cancel',
'alpha');
53$toselect =
GETPOST(
'toselect',
'array');
54$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'bomlist';
55$backtopage =
GETPOST(
'backtopage',
'alpha');
56$optioncss =
GETPOST(
'optioncss',
'aZ');
57$mode =
GETPOST(
'mode',
'alpha');
62$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
63$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
65if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
68$offset = $limit * $page;
72 $sortfield =
"s.datep,s.rowid";
75 $sortorder =
"DESC,DESC";
81$diroutputmassaction =
$conf->user->dir_output.
'/temp/massgeneration/'.$user->id;
82$hookmanager->initHooks(array(
'salarieslist'));
85$extrafields->fetch_name_optionals_label(
$object->table_element);
87$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
90 $sortfield =
"s.datep,s.rowid";
93 $sortorder =
"DESC,DESC";
96$search_ref =
GETPOST(
'search_ref',
'alpha');
97$search_ref_salary =
GETPOST(
'search_ref_salary',
'alpha');
98$search_user =
GETPOST(
'search_user',
'alpha');
99$search_label =
GETPOST(
'search_label',
'alpha');
104$search_amount =
GETPOST(
'search_amount',
'alpha');
105$search_account =
GETPOST(
'search_account',
'alpha');
106$search_fk_bank =
GETPOST(
'search_fk_bank',
'alpha');
107$search_chq_number =
GETPOST(
'search_chq_number',
'alpha');
109$search_type_id =
GETPOST(
'search_type_id',
'int');
110if (!$search_type_id) {
111 $filtre =
GETPOST(
"filtre",
'restricthtml');
112 $newfiltre = str_replace(
'filtre=',
'', $filtre);
113 $filterarray = explode(
'-', $newfiltre);
114 foreach ($filterarray as $val) {
115 $part = explode(
':', $val);
116 if ($part[0] ==
's.fk_typepayment') {
117 $search_type_id = (int) $part[1];
122$childids = $user->getAllChildIds(1);
125$search_all =
GETPOST(
"search_all",
'alpha');
127foreach (
$object->fields as $key => $val) {
128 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
129 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
134$fieldstosearchall = array();
135foreach (
$object->fields as $key => $val) {
136 if (!empty($val[
'searchall'])) {
137 $fieldstosearchall[
't.'.$key] = $val[
'label'];
142$arrayfields = array();
143foreach (
$object->fields as $key => $val) {
145 if (!empty($val[
'visible'])) {
146 $visible = (int)
dol_eval((
string) $val[
'visible'], 1, 1,
'1');
147 $arrayfields[
't.'.$key] = array(
148 'label' => $val[
'label'],
149 'checked' => (($visible < 0) ? 0 : 1),
150 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
151 'position' => $val[
'position'],
152 'help' => isset($val[
'help']) ? $val[
'help'] :
''
157$permissiontoread = $user->hasRight(
'salaries',
'read');
158$permissiontoadd = $user->hasRight(
'salaries',
'write');
159$permissiontodelete = $user->hasRight(
'salaries',
'delete');
163if ($user->socid > 0) {
164 $socid = $user->socid;
174if (
GETPOST(
'cancel',
'alpha')) {
178if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
182$parameters = array();
183$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
188if (empty($reshook)) {
190 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
193 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
195 $search_ref_salary =
"";
198 $search_date_start =
'';
199 $search_date_end =
'';
200 $search_dateep_start =
'';
201 $search_dateep_end =
'';
203 $search_account =
'';
204 $search_fk_bank =
'';
205 $search_chq_number =
'';
206 $search_type_id =
"";
208 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
209 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
214 $objectclass =
'PaymentSalary';
215 $objectlabel =
'SalariesPayments';
216 $uploaddir =
$conf->salaries->dir_output;
219 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
222 if (!$error && $massaction ==
'buildsepa' && $permissiontoadd) {
223 $objecttmp =
new $objectclass($db);
233$form =
new Form($db);
234$salstatic =
new Salary($db);
236$userstatic =
new User($db);
237$accountstatic =
new Account($db);
244$title = $langs->trans(
'SalariesPayments');
246$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,";
247$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,";
248$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,";
249$sql .=
" pst.code as payment_code";
250$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as s";
251$sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"salary as sal ON (sal.rowid = s.fk_salary)";
252$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON s.fk_typepayment = pst.id";
253$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON s.fk_bank = b.rowid";
254$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid,";
255$sql .=
" ".MAIN_DB_PREFIX.
"user as u";
256$sql .=
" WHERE u.rowid = sal.fk_user";
257$sql .=
" AND s.entity IN (".getEntity(
'payment_salaries').
")";
258if (!$user->hasRight(
'salaries',
'readall')) {
259 $sql .=
" AND sal.fk_user IN (".$db->sanitize(implode(
',', $childids)).
")";
264 $sql .=
" AND s.rowid=".((int) $search_ref);
266if ($search_ref_salary) {
267 $sql .=
" AND sal.rowid=".((int) $search_ref_salary);
270 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname',
'u.email'), $search_user);
275if ($search_date_start) {
276 $sql .=
" AND s.datep >= '".$db->idate($search_date_start).
"'";
278if ($search_date_end) {
279 $sql .=
" AND s.datep <= '".$db->idate($search_date_end).
"'";
281if ($search_dateep_start) {
282 $sql .=
" AND sal.dateep >= '".$db->idate($search_dateep_start).
"'";
284if ($search_dateep_end) {
285 $sql .=
" AND sal.dateep <= '".$db->idate($search_dateep_end).
"'";
290if ($search_account > 0) {
291 $sql .=
" AND b.fk_account=".((int) $search_account);
293if ($search_fk_bank) {
294 $sql .=
" AND s.fk_bank=".((int) $search_fk_bank);
296if ($search_chq_number) {
297 $sql .=
natural_search(array(
's.num_payment'), $search_chq_number);
300if ($search_type_id > 0) {
301 $sql .=
" AND s.fk_typepayment=".((int) $search_type_id);
303$sql .= $db->order($sortfield, $sortorder);
306$nbtotalofrecords =
'';
308 $resql = $db->query($sql);
310 $nbtotalofrecords = $db->num_rows($resql);
315 if (($page * $limit) > $nbtotalofrecords) {
321if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
322 $num = $nbtotalofrecords;
325 $sql .= $db->plimit($limit + 1, $offset);
328 $resql = $db->query($sql);
334 $num = $db->num_rows($resql);
340llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
342$arrayofselected = is_array($toselect) ? $toselect : array();
346 $param .=
'&mode='.urlencode($mode);
348if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
349 $param .=
'&contextpage='.urlencode($contextpage);
351if ($limit > 0 && $limit !=
$conf->liste_limit) {
352 $param .=
'&limit='.((int) $limit);
354if ($search_type_id) {
355 $param .=
'&search_type_id='.urlencode($search_type_id);
357if ($optioncss !=
'') {
358 $param .=
'&optioncss='.urlencode($optioncss);
361 $param .=
'&search_ref='.urlencode($search_ref);
363if ($search_ref_salary) {
364 $param .=
'&search_ref_salary='.urlencode($search_ref_salary);
367 $param .=
'&search_user='.urlencode($search_user);
370 $param .=
'&search_label='.urlencode($search_label);
372if ($search_fk_bank) {
373 $param .=
'&search_fk_bank='.urlencode((
string) ($search_fk_bank));
375if ($search_chq_number) {
376 $param .=
'&search_chq_number='.urlencode((
string) ($search_chq_number));
378if ($search_account) {
379 $param .=
'&search_account='.urlencode((
string) ($search_account));
381if ($search_date_start) {
382 $param .=
'&search_date_startday='.GETPOSTINT(
'search_date_startday').
'&search_date_startmonth='.
GETPOSTINT(
'search_date_startmonth').
'&search_date_startyear='.
GETPOSTINT(
'search_date_startyear');
384if ($search_dateep_start) {
385 $param .=
'&search_dateep_startday='.GETPOSTINT(
'search_dateep_startday').
'&search_dateep_startmonth='.
GETPOSTINT(
'search_dateep_startmonth').
'&search_dateep_startyear='.
GETPOSTINT(
'search_dateep_startyear');
387if ($search_date_end) {
388 $param .=
'&search_date_endday='.GETPOSTINT(
'search_date_endday').
'&search_date_endmonth='.
GETPOSTINT(
'search_date_endmonth').
'&search_date_endyear='.
GETPOSTINT(
'search_date_endyear');
390if ($search_dateep_end) {
391 $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')));
394include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
397$arrayofmassactions = array(
402if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
403 $arrayofmassactions = array();
405$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
407print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
408if ($optioncss !=
'') {
409 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
411print
'<input type="hidden" name="token" value="'.newToken().
'">';
412print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
413print
'<input type="hidden" name="action" value="list">';
414print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
415print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
416print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
417print
'<input type="hidden" name="mode" value="'.$mode.
'">';
420$url = DOL_URL_ROOT.
'/salaries/card.php?action=create';
422 $url .=
'&socid='.$socid;
425$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'));
426$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'));
428$newcardbutton =
dolGetButtonTitle($langs->trans(
'NewSalaryPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'salaries',
'write'));
430print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
434$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
437$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
439print
'<div class="div-table-responsive">';
440print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
444print
'<tr class="liste_titre_filter">';
447 print
'<td class="liste_titre maxwidthsearch">';
448 $searchpicto = $form->showFilterButtons();
453print
'<td class="liste_titre left">';
454print
'<input class="flat" type="text" size="3" name="search_ref" value="'.$db->escape($search_ref).
'">';
457print
'<td class="liste_titre center">';
458print
'<input class="flat" type="text" size="3" name="search_ref_salary" value="'.$db->escape($search_ref_salary).
'">';
461print
'<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$db->escape($search_label).
'"></td>';
463print
'<td class="liste_titre center">';
464print
'<div class="nowrapfordate">';
465print $form->selectDate($search_dateep_start ? $search_dateep_start : -1,
'search_dateep_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
467print
'<div class="nowrapfordate">';
468print $form->selectDate($search_dateep_end ? $search_dateep_end : -1,
'search_dateep_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
472print
'<td class="liste_titre center">';
473print
'<div class="nowrapfordate">';
474print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
476print
'<div class="nowrapfordate">';
477print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
484print
'<td class="liste_titre">';
485print
'<input class="flat" type="text" size="6" name="search_user" value="'.$db->escape($search_user).
'">';
488print
'<td class="liste_titre">';
489print $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'', 1);
492print
'<td class="liste_titre"><input name="search_chq_number" class="flat width50" type="text" value="'.$db->escape($search_chq_number).
'"></td>';
494if (isModEnabled(
"bank")) {
496 print
'<td class="liste_titre">';
497 print
'<input class="flat width50" type="text" name="search_fk_bank" value="'.$db->escape($search_fk_bank).
'">';
501 print
'<td class="liste_titre">';
502 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
506print
'<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).
'"></td>';
509include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
512$parameters = array(
'arrayfields' => $arrayfields);
513$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters,
$object);
514print $hookmanager->resPrint;
517 print
'<td class="liste_titre maxwidthsearch">';
518 $searchpicto = $form->showFilterButtons();
524$totalarray = array();
525$totalarray[
'nbfield'] = 0;
529print
'<tr class="liste_titre">';
532 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
533 $totalarray[
'nbfield']++;
536$totalarray[
'nbfield']++;
538$totalarray[
'nbfield']++;
540$totalarray[
'nbfield']++;
541print_liste_field_titre(
"PeriodEndDate", $_SERVER[
"PHP_SELF"],
"sal.dateep",
"", $param,
'', $sortfield, $sortorder,
'center ');
542$totalarray[
'nbfield']++;
543print_liste_field_titre(
"DatePayment", $_SERVER[
"PHP_SELF"],
"s.datep,s.rowid",
"", $param,
'', $sortfield, $sortorder,
'center ');
544$totalarray[
'nbfield']++;
546$totalarray[
'nbfield']++;
547print_liste_field_titre(
"PaymentMode", $_SERVER[
"PHP_SELF"],
"pst.code",
"", $param,
'', $sortfield, $sortorder);
548$totalarray[
'nbfield']++;
549print_liste_field_titre(
"Numero", $_SERVER[
"PHP_SELF"],
"s.num_payment",
"", $param,
'', $sortfield, $sortorder,
'',
'ChequeOrTransferNumber');
550$totalarray[
'nbfield']++;
551if (isModEnabled(
"bank")) {
552 print_liste_field_titre(
"BankTransactionLine", $_SERVER[
"PHP_SELF"],
"s.fk_bank",
"", $param,
'', $sortfield, $sortorder);
553 $totalarray[
'nbfield']++;
554 print_liste_field_titre(
"BankAccount", $_SERVER[
"PHP_SELF"],
"ba.label",
"", $param,
"", $sortfield, $sortorder);
555 $totalarray[
'nbfield']++;
557print_liste_field_titre(
"PayedByThisPayment", $_SERVER[
"PHP_SELF"],
"s.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
558$totalarray[
'nbfield']++;
560include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
562$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
563$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters,
$object);
564print $hookmanager->resPrint;
567 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
568 $totalarray[
'nbfield']++;
574$needToFetchEachLine = 0;
575if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
576 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
577 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
578 $needToFetchEachLine++;
587$savnbfield = $totalarray[
'nbfield'];
588$totalarray = array();
589$totalarray[
'nbfield'] = 0;
590$imaxinloop = ($limit ? min($num, $limit) : $num);
591while ($i < $imaxinloop) {
592 $obj = $db->fetch_object($resql);
599 $object->setVarsFromFetchObj($obj);
601 $userstatic->id = $obj->uid;
602 $userstatic->lastname = $obj->lastname;
603 $userstatic->firstname = $obj->firstname;
604 $userstatic->admin = $obj->admin;
605 $userstatic->login = $obj->login;
606 $userstatic->email = $obj->email;
607 $userstatic->socid = $obj->fk_soc;
608 $userstatic->statut = $obj->status;
609 $userstatic->status = $obj->status;
610 $userstatic->gender = $obj->gender;
611 $userstatic->photo = $obj->photo;
613 $salstatic->id = $obj->id_salary;
614 $salstatic->ref = $obj->id_salary;
616 $paymentsalstatic->id = $obj->rowid;
617 $paymentsalstatic->ref = $obj->rowid;
618 $paymentsalstatic->amount = $obj->amount;
619 $paymentsalstatic->fk_typepayment = $obj->payment_code;
620 $paymentsalstatic->datec = $obj->dateep;
621 $paymentsalstatic->datep = $obj->datep;
623 $accountlinestatic->id = $obj->fk_bank;
624 $accountlinestatic->ref = $obj->fk_bank;
625 $paymentsalstatic->fk_bank = $accountlinestatic->id;
626 $paymentsalstatic->fk_user_author = $userstatic->id;
628 if ($mode ==
'kanban') {
630 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
631 print
'<div class="box-flex-container kanban">';
634 print $paymentsalstatic->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
635 if ($i == ($imaxinloop - 1)) {
641 print
'<tr class="oddeven">';
645 print
'<td class="nowrap center">';
646 if ($massactionbutton || $massaction) {
648 if (in_array(
$object->id, $arrayofselected)) {
651 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
655 $totalarray[
'nbfield']++;
660 print
"<td>".$paymentsalstatic->getNomUrl(1).
"</td>\n";
662 $totalarray[
'nbfield']++;
666 print
"<td>".$salstatic->getNomUrl(1).
"</td>\n";
668 $totalarray[
'nbfield']++;
672 print
"<td>".dol_trunc($obj->label, 40).
"</td>\n";
674 $totalarray[
'nbfield']++;
678 print
'<td class="center">'.dol_print_date($db->jdate($obj->dateep),
'day').
"</td>\n";
680 $totalarray[
'nbfield']++;
684 print
'<td class="center">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>\n";
686 $totalarray[
'nbfield']++;
694 print
'<td class="tdoverflowmax150">'.$userstatic->getNomUrl(-1).
"</td>\n";
696 $totalarray[
'nbfield']++;
701 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
704 $totalarray[
'nbfield']++;
708 print
'<td>'.$obj->num_payment.
'</td>';
710 $totalarray[
'nbfield']++;
714 if (isModEnabled(
"bank")) {
717 $accountlinestatic->id = $obj->fk_bank;
718 print $accountlinestatic->getNomUrl(1);
721 $totalarray[
'nbfield']++;
725 if ($obj->fk_bank > 0) {
727 $accountstatic->id = $obj->bid;
728 $accountstatic->ref = $obj->bref;
729 $accountstatic->number = $obj->bnumber;
730 $accountstatic->iban = $obj->iban;
731 $accountstatic->bic = $obj->bic;
732 $accountstatic->currency_code = $langs->trans(
"Currency".$obj->currency_code);
733 $accountstatic->clos = $obj->clos;
735 if (isModEnabled(
'accounting')) {
736 $accountstatic->account_number = $obj->account_number;
739 $accountingjournal->fetch($obj->fk_accountancy_journal);
741 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
743 $accountstatic->label = $obj->blabel;
744 if ($accountstatic->id > 0) {
745 print $accountstatic->getNomUrl(1);
752 $totalarray[
'nbfield']++;
757 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
759 $totalarray[
'nbfield']++;
762 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalttcfield';
765 $totalarray[
'val'][
'totalttcfield'] = $obj->amount;
767 $totalarray[
'val'][
'totalttcfield'] += $obj->amount;
772 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
774 $parameters = array(
'arrayfields' => $arrayfields,
'object' =>
$object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
775 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters,
$object);
776 print $hookmanager->resPrint;
780 print
'<td class="nowrap center">';
781 if ($massactionbutton || $massaction) {
783 if (in_array(
$object->id, $arrayofselected)) {
786 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
790 $totalarray[
'nbfield']++;
800include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
812 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
818$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
819$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters,
$object);
820print $hookmanager->resPrint;
822print
'</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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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 a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.