28 require
'../../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
37 $langs->loadLangs(array(
"compta",
"banks",
"bills",
"accountancy"));
39 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'directdebitcredittransferlist';
42 $socid =
GETPOST(
"socid",
"int");
44 $socid = $user->socid;
47 $optioncss =
GETPOST(
'optioncss',
'alpha');
49 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
50 $search_ref =
GETPOST(
'search_ref',
'int');
51 $search_user =
GETPOST(
'search_user',
'alpha');
52 $search_label =
GETPOST(
'search_label',
'alpha');
53 $search_datep_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
54 $search_datep_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
55 $search_datev_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_value_startmonth',
'int'),
GETPOST(
'search_date_value_startday',
'int'),
GETPOST(
'search_date_value_startyear',
'int'));
56 $search_datev_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_value_endmonth',
'int'),
GETPOST(
'search_date_value_endday',
'int'),
GETPOST(
'search_date_value_endyear',
'int'));
57 $search_amount_deb =
GETPOST(
'search_amount_deb',
'alpha');
58 $search_amount_cred =
GETPOST(
'search_amount_cred',
'alpha');
59 $search_bank_account =
GETPOST(
'search_account',
'int');
60 $search_bank_entry =
GETPOST(
'search_bank_entry',
'int');
61 $search_accountancy_account =
GETPOST(
"search_accountancy_account");
62 if ($search_accountancy_account == - 1) {
63 $search_accountancy_account =
'';
65 $search_accountancy_subledger =
GETPOST(
"search_accountancy_subledger");
66 if ($search_accountancy_subledger == - 1) {
67 $search_accountancy_subledger =
'';
69 if (empty($search_datep_start)) {
70 $search_datep_start =
GETPOST(
"search_datep_start",
'int');
72 if (empty($search_datep_end)) {
73 $search_datep_end =
GETPOST(
"search_datep_end",
'int');
75 if (empty($search_datev_start)) {
76 $search_datev_start =
GETPOST(
"search_datev_start",
'int');
78 if (empty($search_datev_end)) {
79 $search_datev_end =
GETPOST(
"search_datev_end",
'int');
81 $search_type_id =
GETPOST(
'search_type_id',
'int');
83 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
84 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
86 if (empty($page) || $page == -1) {
89 $offset = $limit * $page;
90 $pageprev = $page - 1;
91 $pagenext = $page + 1;
93 $sortfield =
"v.datep,v.rowid";
96 $sortorder =
"DESC,DESC";
99 $filtre =
GETPOST(
"filtre",
'alpha');
101 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
104 $search_datep_start =
'';
105 $search_datep_end =
'';
106 $search_datev_start =
'';
107 $search_datev_end =
'';
108 $search_amount_deb =
'';
109 $search_amount_cred =
'';
110 $search_bank_account =
'';
111 $search_bank_entry =
'';
112 $search_accountancy_account =
'';
113 $search_accountancy_subledger =
'';
114 $search_type_id =
'';
140 $fieldstosearchall = array(
143 'v.datep'=>
"DatePayment",
144 'v.datev'=>
"DateValue",
145 'v.amount'=>$langs->trans(
"Debit").
", ".$langs->trans(
"Credit"),
149 $arrayfields = array(
150 'ref' =>array(
'label'=>
"Ref",
'checked'=>1,
'position'=>100),
151 'label' =>array(
'label'=>
"Label",
'checked'=>1,
'position'=>110),
152 'datep' =>array(
'label'=>
"DatePayment",
'checked'=>1,
'position'=>120),
153 'datev' =>array(
'label'=>
"DateValue",
'checked'=>-1,
'position'=>130),
154 'type' =>array(
'label'=>
"PaymentMode",
'checked'=>1,
'position'=>140),
155 'project' =>array(
'label'=>
"Project",
'checked'=>1,
'position'=>200,
"enabled"=>
isModEnabled(
'project')),
156 'bank' =>array(
'label'=>
"BankAccount",
'checked'=>1,
'position'=>300,
"enabled"=>
isModEnabled(
"banque")),
157 'entry' =>array(
'label'=>
"BankTransactionLine",
'checked'=>1,
'position'=>310,
"enabled"=>
isModEnabled(
"banque")),
158 'account' =>array(
'label'=>
"AccountAccountingShort",
'checked'=>1,
'position'=>400,
"enabled"=>
isModEnabled(
'accounting')),
159 'subledger' =>array(
'label'=>
"SubledgerAccount",
'checked'=>1,
'position'=>410,
"enabled"=>
isModEnabled(
'accounting')),
160 'debit' =>array(
'label'=>
"Debit",
'checked'=>1,
'position'=>500),
161 'credit' =>array(
'label'=>
"Credit",
'checked'=>1,
'position'=>510),
175 $parameters = array();
176 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
181 if (empty($reshook)) {
183 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
191 if ($arrayfields[
'account'][
'checked'] || $arrayfields[
'subledger'][
'checked']) {
194 if ($arrayfields[
'bank'][
'checked'] &&
isModEnabled(
'accounting')) {
197 if ($arrayfields[
'ref'][
'checked']) {
200 if ($arrayfields[
'bank'][
'checked']) {
201 $accountstatic =
new Account($db);
203 if ($arrayfields[
'project'][
'checked']) {
206 if ($arrayfields[
'entry'][
'checked']) {
209 if ($arrayfields[
'account'][
'checked']) {
213 $sql =
"SELECT v.rowid, v.sens, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank, v.accountancy_code, v.subledger_account, v.fk_projet as fk_project,";
214 $sql .=
" ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number as bank_account_number, ba.fk_accountancy_journal as accountancy_journal, ba.label as blabel,";
215 $sql .=
" pst.code as payment_code";
219 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as v";
220 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON v.fk_typepayment = pst.id";
221 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON v.fk_bank = b.rowid";
222 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
223 $sql .=
" WHERE v.entity IN (".getEntity(
'payment_various').
")";
227 $sql .=
" AND v.rowid = ".((int) $search_ref);
232 if ($search_datep_start) {
233 $sql .=
" AND v.datep >= '".$db->idate($search_datep_start).
"'";
235 if ($search_datep_end) {
236 $sql .=
" AND v.datep <= '".$db->idate($search_datep_end).
"'";
238 if ($search_datev_start) {
239 $sql .=
" AND v.datev >= '".$db->idate($search_datev_start).
"'";
241 if ($search_datev_end) {
242 $sql .=
" AND v.datev <= '".$db->idate($search_datev_end).
"'";
244 if ($search_amount_deb) {
247 if ($search_amount_cred) {
250 if ($search_bank_account > 0) {
251 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
253 if ($search_bank_entry > 0) {
254 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
256 if ($search_accountancy_account > 0) {
257 $sql .=
" AND v.accountancy_code = ".((int) $search_accountancy_account);
259 if ($search_accountancy_subledger > 0) {
260 $sql .=
" AND v.subledger_account = ".((int) $search_accountancy_subledger);
262 if ($search_type_id > 0) {
263 $sql .=
" AND v.fk_typepayment=".((int) $search_type_id);
266 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
271 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
273 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
274 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
275 $resql = $db->query($sqlforcount);
277 $objforcount = $db->fetch_object(
$resql);
291 $sql .= $db->order($sortfield, $sortorder);
293 $sql .= $db->plimit($limit + 1, $offset);
296 $resql = $db->query($sql);
298 $num = $db->num_rows(
$resql);
301 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) {
302 $obj = $db->fetch_object(
$resql);
304 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?id='.$id);
309 llxHeader(
'', $langs->trans(
"VariousPayments"));
315 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
316 $param .=
'&contextpage='.urlencode($contextpage);
318 if ($limit > 0 && $limit != $conf->liste_limit) {
319 $param .=
'&limit='.urlencode($limit);
322 $param .=
'&search_ref='.urlencode($search_ref);
325 $param .=
'&search_label='.urlencode($search_label);
327 if ($search_datep_start) {
328 $param .=
'&search_datep_start='.urlencode($search_datep_start);
330 if ($search_datep_end) {
331 $param .=
'&search_datep_end='.urlencode($search_datep_end);
333 if ($search_datev_start) {
334 $param .=
'&search_datev_start='.urlencode($search_datev_start);
336 if ($search_datev_end) {
337 $param .=
'&search_datev_end='.urlencode($search_datev_end);
339 if ($search_type_id > 0) {
340 $param .=
'&search_type_id='.urlencode($search_type_id);
342 if ($search_amount_deb) {
343 $param .=
'&search_amount_deb='.urlencode($search_amount_deb);
345 if ($search_amount_cred) {
346 $param .=
'&search_amount_cred='.urlencode($search_amount_cred);
348 if ($search_bank_account > 0) {
349 $param .=
'&search_account='.urlencode($search_bank_account);
351 if ($search_accountancy_account > 0) {
352 $param .=
'&search_accountancy_account='.urlencode($search_accountancy_account);
354 if ($search_accountancy_subledger > 0) {
355 $param .=
'&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
357 if ($optioncss !=
'') {
358 $param .=
'&optioncss='.urlencode($optioncss);
361 $url = DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?action=create';
362 if (!empty($socid)) {
363 $url .=
'&socid='.urlencode($socid);
365 $newcardbutton =
dolGetButtonTitle($langs->trans(
'MenuNewVariousPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->banque->modifier);
367 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
369 if ($optioncss !=
'') {
370 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
372 print
'<input type="hidden" name="token" value="'.newToken().
'">';
373 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
374 print
'<input type="hidden" name="action" value="list">';
375 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
376 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
377 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
379 print_barre_liste($langs->trans(
"MenuVariousPayment"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num,
$nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
382 foreach ($fieldstosearchall as $key => $val) {
383 $fieldstosearchall[$key] = $langs->trans($val);
385 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
388 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
389 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
392 print
'<div class="div-table-responsive">';
393 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">';
395 print
'<tr class="liste_titre">';
397 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
398 print
'<td class="liste_titre">';
403 if ($arrayfields[
'ref'][
'checked']) {
404 print
'<td class="liste_titre left">';
405 print
'<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
410 if ($arrayfields[
'label'][
'checked']) {
411 print
'<td class="liste_titre">';
412 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
417 if ($arrayfields[
'datep'][
'checked']) {
418 print
'<td class="liste_titre center">';
419 print
'<div class="nowrap">';
420 print
$form->selectDate($search_datep_start ? $search_datep_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
422 print
'<div class="nowrap">';
423 print
$form->selectDate($search_datep_end ? $search_datep_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
429 if ($arrayfields[
'datev'][
'checked']) {
430 print
'<td class="liste_titre center">';
431 print
'<div class="nowrap">';
432 print
$form->selectDate($search_datev_start ? $search_datev_start : -1,
'search_date_value_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
434 print
'<div class="nowrap">';
435 print
$form->selectDate($search_datev_end ? $search_datev_end : -1,
'search_date_value_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
441 if ($arrayfields[
'type'][
'checked']) {
442 print
'<td class="liste_titre center">';
443 print
$form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'maxwidth100', 1);
448 if ($arrayfields[
'project'][
'checked']) {
449 print
'<td class="liste_titre">';
455 if ($arrayfields[
'bank'][
'checked']) {
456 print
'<td class="liste_titre">';
457 $form->select_comptes($search_bank_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
462 if ($arrayfields[
'entry'][
'checked']) {
463 print
'<td class="liste_titre left">';
464 print
'<input name="search_bank_entry" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_bank_entry).
'">';
469 if (!empty($arrayfields[
'account'][
'checked'])) {
470 print
'<td class="liste_titre">';
471 print
'<div class="nowrap">';
472 print $formaccounting->select_account($search_accountancy_account,
'search_accountancy_account', 1, array(), 1, 1,
'maxwidth200');
478 if (!empty($arrayfields[
'subledger'][
'checked'])) {
479 print
'<td class="liste_titre">';
480 print
'<div class="nowrap">';
481 print $formaccounting->select_auxaccount($search_accountancy_subledger,
'search_accountancy_subledger', 1,
'maxwidth200');
487 if (!empty($arrayfields[
'debit'][
'checked'])) {
488 print
'<td class="liste_titre right">';
489 print
'<input name="search_amount_deb" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_amount_deb).
'">';
494 if ($arrayfields[
'credit'][
'checked']) {
495 print
'<td class="liste_titre right">';
496 print
'<input name="search_amount_cred" class="flat maxwidth50" type="text" size="8" value="'.dol_escape_htmltag($search_amount_cred).
'">';
500 print
'<td class="liste_titre maxwidthsearch">';
501 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
508 print
'<tr class="liste_titre">';
510 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
514 if ($arrayfields[
'ref'][
'checked']) {
515 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
'v.rowid',
'', $param,
'', $sortfield, $sortorder);
517 if ($arrayfields[
'label'][
'checked']) {
518 print_liste_field_titre($arrayfields[
'label'][
'label'], $_SERVER[
"PHP_SELF"],
'v.label',
'', $param,
'', $sortfield, $sortorder);
520 if ($arrayfields[
'datep'][
'checked']) {
521 print_liste_field_titre($arrayfields[
'datep'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datep,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
523 if ($arrayfields[
'datev'][
'checked']) {
524 print_liste_field_titre($arrayfields[
'datev'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datev,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
526 if ($arrayfields[
'type'][
'checked']) {
527 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
'type',
'', $param,
'', $sortfield, $sortorder,
'center ');
529 if ($arrayfields[
'project'][
'checked']) {
530 print_liste_field_titre($arrayfields[
'project'][
'label'], $_SERVER[
"PHP_SELF"],
'fk_project',
'', $param,
'', $sortfield, $sortorder);
532 if ($arrayfields[
'bank'][
'checked']) {
533 print_liste_field_titre($arrayfields[
'bank'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
535 if ($arrayfields[
'entry'][
'checked']) {
536 print_liste_field_titre($arrayfields[
'entry'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
538 if (!empty($arrayfields[
'account'][
'checked'])) {
539 print_liste_field_titre($arrayfields[
'account'][
'label'], $_SERVER[
"PHP_SELF"],
'v.accountancy_code',
'', $param,
'', $sortfield, $sortorder,
'left ');
541 if (!empty($arrayfields[
'subledger'][
'checked'])) {
542 print_liste_field_titre($arrayfields[
'subledger'][
'label'], $_SERVER[
"PHP_SELF"],
'v.subledger_account',
'', $param,
'', $sortfield, $sortorder,
'left ');
544 if ($arrayfields[
'debit'][
'checked']) {
545 print_liste_field_titre($arrayfields[
'debit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
547 if ($arrayfields[
'credit'][
'checked']) {
548 print_liste_field_titre($arrayfields[
'credit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
552 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
553 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
554 print $hookmanager->resPrint;
556 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
560 $totalarray = array();
561 $totalarray[
'nbfield'] = 0;
562 $totalarray[
'val'][
'total_cred'] = 0;
563 $totalarray[
'val'][
'total_deb'] = 0;
565 while ($i < min($num, $limit)) {
566 $obj = $db->fetch_object(
$resql);
568 $variousstatic->id = $obj->rowid;
569 $variousstatic->ref = $obj->rowid;
570 $variousstatic->label = $obj->label;
572 print
'<tr class="oddeven">';
575 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
576 print
'<td>'.(($offset * $limit) + $i).
'</td>';
580 if ($arrayfields[
'ref'][
'checked']) {
581 print
'<td>'.$variousstatic->getNomUrl(1).
"</td>";
583 $totalarray[
'nbfield']++;
588 if ($arrayfields[
'label'][
'checked']) {
589 print
'<td class="tdoverflowmax150" title="'.$variousstatic->label.
'">'.$variousstatic->label.
"</td>";
591 $totalarray[
'nbfield']++;
596 if ($arrayfields[
'datep'][
'checked']) {
597 print
'<td class="center">'.dol_print_date($obj->datep,
'day').
"</td>";
599 $totalarray[
'nbfield']++;
605 if ($arrayfields[
'datev'][
'checked']) {
606 print
'<td class="center">'.dol_print_date($obj->datev,
'day').
"</td>";
608 $totalarray[
'nbfield']++;
613 if ($arrayfields[
'type'][
'checked']) {
614 print
'<td class="center">';
615 if ($obj->payment_code) {
616 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
619 print $obj->num_payment;
622 $totalarray[
'nbfield']++;
627 if ($arrayfields[
'project'][
'checked']) {
628 print
'<td class="nowraponall">';
629 if ($obj->fk_project > 0) {
630 $proj->fetch($obj->fk_project);
631 print $proj->getNomUrl(1);
635 $totalarray[
'nbfield']++;
640 if ($arrayfields[
'bank'][
'checked']) {
641 print
'<td class="nowraponall">';
643 $accountstatic->id = $obj->bid;
644 $accountstatic->ref = $obj->bref;
645 $accountstatic->number = $obj->bnumber;
648 $accountstatic->account_number = $obj->bank_account_number;
649 $accountingjournal->fetch($obj->accountancy_journal);
650 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
653 $accountstatic->label = $obj->blabel;
654 print $accountstatic->getNomUrl(1);
660 $totalarray[
'nbfield']++;
665 if ($arrayfields[
'entry'][
'checked']) {
666 $bankline->fetch($obj->fk_bank);
667 print
'<td>'.$bankline->getNomUrl(1).
'</td>';
669 $totalarray[
'nbfield']++;
674 if (!empty($arrayfields[
'account'][
'checked'])) {
675 $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
677 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.
' '.$accountingaccount->label).
'">'.$accountingaccount->getNomUrl(0, 1, 1,
'', 1).
'</td>';
679 $totalarray[
'nbfield']++;
684 if (!empty($arrayfields[
'subledger'][
'checked'])) {
685 print
'<td class="tdoverflowmax150">'.length_accounta($obj->subledger_account).
'</td>';
687 $totalarray[
'nbfield']++;
692 if ($arrayfields[
'debit'][
'checked']) {
693 print
'<td class="nowrap right">';
694 if ($obj->sens == 0) {
695 print
'<span class="amount">'.price($obj->amount).
'</span>';
696 $totalarray[
'val'][
'total_deb'] += $obj->amount;
699 $totalarray[
'nbfield']++;
702 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_deb';
708 if ($arrayfields[
'credit'][
'checked']) {
709 print
'<td class="nowrap right">';
710 if ($obj->sens == 1) {
711 print
'<span class="amount">'.price($obj->amount).
'</span>';
712 $totalarray[
'val'][
'total_cred'] += $obj->amount;
715 $totalarray[
'nbfield']++;
718 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_cred';
726 $totalarray[
'nbfield']++;
735 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
740 foreach ($arrayfields as $key => $val) {
741 if (!empty($val[
'checked'])) {
745 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
750 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
751 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
752 print $hookmanager->resPrint;
754 print
'</table>'.
"\n";
757 print
'</form>'.
"\n";
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage accounting accounts.
Class to manage accounting accounts.
Class to manage various payments.
Class to manage projects.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
$nbtotalofrecords
Count total nb of records.
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.