27 require
'../../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36 $langs->loadLangs(array(
"compta",
"banks",
"bills",
"accountancy"));
38 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'directdebitcredittransferlist';
41 $socid =
GETPOST(
"socid",
"int");
43 $socid = $user->socid;
46 $optioncss =
GETPOST(
'optioncss',
'alpha');
48 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
49 $search_ref =
GETPOST(
'search_ref',
'int');
50 $search_user =
GETPOST(
'search_user',
'alpha');
51 $search_label =
GETPOST(
'search_label',
'alpha');
52 $search_datep_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
53 $search_datep_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
54 $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'));
55 $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'));
56 $search_amount_deb =
GETPOST(
'search_amount_deb',
'alpha');
57 $search_amount_cred =
GETPOST(
'search_amount_cred',
'alpha');
58 $search_bank_account =
GETPOST(
'search_account',
'int');
59 $search_bank_entry =
GETPOST(
'search_bank_entry',
'int');
60 $search_accountancy_account =
GETPOST(
"search_accountancy_account");
61 if ($search_accountancy_account == - 1) {
62 $search_accountancy_account =
'';
64 $search_accountancy_subledger =
GETPOST(
"search_accountancy_subledger");
65 if ($search_accountancy_subledger == - 1) {
66 $search_accountancy_subledger =
'';
68 if (empty($search_datep_start)) {
69 $search_datep_start =
GETPOST(
"search_datep_start",
'int');
71 if (empty($search_datep_end)) {
72 $search_datep_end =
GETPOST(
"search_datep_end",
'int');
74 if (empty($search_datev_start)) {
75 $search_datev_start =
GETPOST(
"search_datev_start",
'int');
77 if (empty($search_datev_end)) {
78 $search_datev_end =
GETPOST(
"search_datev_end",
'int');
80 $search_type_id =
GETPOST(
'search_type_id',
'int');
82 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
83 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
85 if (empty($page) || $page == -1) {
88 $offset = $limit * $page;
89 $pageprev = $page - 1;
90 $pagenext = $page + 1;
92 $sortfield =
"v.datep,v.rowid";
95 $sortorder =
"DESC,DESC";
98 $filtre =
GETPOST(
"filtre",
'alpha');
100 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
103 $search_datep_start =
'';
104 $search_datep_end =
'';
105 $search_datev_start =
'';
106 $search_datev_end =
'';
107 $search_amount_deb =
'';
108 $search_amount_cred =
'';
109 $search_bank_account =
'';
110 $search_bank_entry =
'';
111 $search_accountancy_account =
'';
112 $search_accountancy_subledger =
'';
113 $search_type_id =
'';
139 $fieldstosearchall = array(
142 'v.datep'=>
"DatePayment",
143 'v.datev'=>
"DateValue",
144 'v.amount'=>$langs->trans(
"Debit").
", ".$langs->trans(
"Credit"),
148 $arrayfields = array(
149 'ref' =>array(
'label'=>
"Ref",
'checked'=>1,
'position'=>100),
150 'label' =>array(
'label'=>
"Label",
'checked'=>1,
'position'=>110),
151 'datep' =>array(
'label'=>
"DatePayment",
'checked'=>1,
'position'=>120),
152 'datev' =>array(
'label'=>
"DateValue",
'checked'=>-1,
'position'=>130),
153 'type' =>array(
'label'=>
"PaymentMode",
'checked'=>1,
'position'=>140),
154 'project' =>array(
'label'=>
"Project",
'checked'=>1,
'position'=>200,
"enabled"=>!empty($conf->project->enabled)),
155 'bank' =>array(
'label'=>
"BankAccount",
'checked'=>1,
'position'=>300,
"enabled"=>
isModEnabled(
'banque')),
156 'entry' =>array(
'label'=>
"BankTransactionLine",
'checked'=>1,
'position'=>310,
"enabled"=>
isModEnabled(
'banque')),
157 'account' =>array(
'label'=>
"AccountAccountingShort",
'checked'=>1,
'position'=>400,
"enabled"=>
isModEnabled(
'accounting')),
158 'subledger' =>array(
'label'=>
"SubledgerAccount",
'checked'=>1,
'position'=>410,
"enabled"=>
isModEnabled(
'accounting')),
159 'debit' =>array(
'label'=>
"Debit",
'checked'=>1,
'position'=>500),
160 'credit' =>array(
'label'=>
"Credit",
'checked'=>1,
'position'=>510),
174 $parameters = array();
175 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
180 if (empty($reshook)) {
182 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
190 if ($arrayfields[
'account'][
'checked'] || $arrayfields[
'subledger'][
'checked']) {
193 if ($arrayfields[
'bank'][
'checked'] &&
isModEnabled(
'accounting')) {
196 if ($arrayfields[
'ref'][
'checked']) {
199 if ($arrayfields[
'bank'][
'checked']) {
200 $accountstatic =
new Account($db);
202 if ($arrayfields[
'project'][
'checked']) {
205 if ($arrayfields[
'entry'][
'checked']) {
208 if ($arrayfields[
'account'][
'checked']) {
212 $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,";
213 $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,";
214 $sql .=
" pst.code as payment_code";
215 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as v";
216 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON v.fk_typepayment = pst.id";
217 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON v.fk_bank = b.rowid";
218 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
219 $sql .=
" WHERE v.entity IN (".getEntity(
'payment_various').
")";
223 $sql .=
" AND v.rowid = ".((int) $search_ref);
228 if ($search_datep_start) {
229 $sql .=
" AND v.datep >= '".$db->idate($search_datep_start).
"'";
231 if ($search_datep_end) {
232 $sql .=
" AND v.datep <= '".$db->idate($search_datep_end).
"'";
234 if ($search_datev_start) {
235 $sql .=
" AND v.datev >= '".$db->idate($search_datev_start).
"'";
237 if ($search_datev_end) {
238 $sql .=
" AND v.datev <= '".$db->idate($search_datev_end).
"'";
240 if ($search_amount_deb) {
243 if ($search_amount_cred) {
246 if ($search_bank_account > 0) {
247 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
249 if ($search_bank_entry > 0) {
250 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
252 if ($search_accountancy_account > 0) {
253 $sql .=
" AND v.accountancy_code = ".((int) $search_accountancy_account);
255 if ($search_accountancy_subledger > 0) {
256 $sql .=
" AND v.subledger_account = ".((int) $search_accountancy_subledger);
258 if ($search_type_id > 0) {
259 $sql .=
" AND v.fk_typepayment=".((int) $search_type_id);
262 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
265 $sql .= $db->order($sortfield, $sortorder);
268 $resql = $db->query($sql);
270 $totalnboflines = $db->num_rows(
$resql);
272 $sql .= $db->plimit($limit + 1, $offset);
274 $resql = $db->query($sql);
276 $num = $db->num_rows(
$resql);
279 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) {
280 $obj = $db->fetch_object(
$resql);
282 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?id='.$id);
293 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
294 $param .=
'&contextpage='.urlencode($contextpage);
296 if ($limit > 0 && $limit != $conf->liste_limit) {
297 $param .=
'&limit='.urlencode($limit);
300 $param .=
'&search_ref='.urlencode($search_ref);
303 $param .=
'&search_label='.urlencode($search_label);
305 if ($search_datep_start) {
306 $param .=
'&search_datep_start='.urlencode($search_datep_start);
308 if ($search_datep_end) {
309 $param .=
'&search_datep_end='.urlencode($search_datep_end);
311 if ($search_datev_start) {
312 $param .=
'&search_datev_start='.urlencode($search_datev_start);
314 if ($search_datev_end) {
315 $param .=
'&search_datev_end='.urlencode($search_datev_end);
317 if ($search_type_id > 0) {
318 $param .=
'&search_type_id='.urlencode($search_type_id);
320 if ($search_amount_deb) {
321 $param .=
'&search_amount_deb='.urlencode($search_amount_deb);
323 if ($search_amount_cred) {
324 $param .=
'&search_amount_cred='.urlencode($search_amount_cred);
326 if ($search_bank_account > 0) {
327 $param .=
'&search_account='.urlencode($search_bank_account);
329 if ($search_accountancy_account > 0) {
330 $param .=
'&search_accountancy_account='.urlencode($search_accountancy_account);
332 if ($search_accountancy_subledger > 0) {
333 $param .=
'&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
335 if ($optioncss !=
'') {
336 $param .=
'&optioncss='.urlencode($optioncss);
339 $url = DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?action=create';
340 if (!empty($socid)) {
341 $url .=
'&socid='.urlencode($socid);
343 $newcardbutton =
dolGetButtonTitle($langs->trans(
'MenuNewVariousPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->banque->modifier);
345 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
347 if ($optioncss !=
'') {
348 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
350 print
'<input type="hidden" name="token" value="'.newToken().
'">';
351 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
352 print
'<input type="hidden" name="action" value="list">';
353 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
354 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
355 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
357 print_barre_liste($langs->trans(
"MenuVariousPayment"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $totalnboflines,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
360 foreach ($fieldstosearchall as $key => $val) {
361 $fieldstosearchall[$key] = $langs->trans($val);
363 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
366 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
367 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
370 print
'<div class="div-table-responsive">';
371 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">';
373 print
'<tr class="liste_titre">';
375 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
376 print
'<td class="liste_titre">';
381 if ($arrayfields[
'ref'][
'checked']) {
382 print
'<td class="liste_titre left">';
383 print
'<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
388 if ($arrayfields[
'label'][
'checked']) {
389 print
'<td class="liste_titre">';
390 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
395 if ($arrayfields[
'datep'][
'checked']) {
396 print
'<td class="liste_titre center">';
397 print
'<div class="nowrap">';
398 print
$form->selectDate($search_datep_start ? $search_datep_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
400 print
'<div class="nowrap">';
401 print
$form->selectDate($search_datep_end ? $search_datep_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
407 if ($arrayfields[
'datev'][
'checked']) {
408 print
'<td class="liste_titre center">';
409 print
'<div class="nowrap">';
410 print
$form->selectDate($search_datev_start ? $search_datev_start : -1,
'search_date_value_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
412 print
'<div class="nowrap">';
413 print
$form->selectDate($search_datev_end ? $search_datev_end : -1,
'search_date_value_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
419 if ($arrayfields[
'type'][
'checked']) {
420 print
'<td class="liste_titre center">';
421 $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'maxwidth100');
426 if ($arrayfields[
'project'][
'checked']) {
427 print
'<td class="liste_titre">';
433 if ($arrayfields[
'bank'][
'checked']) {
434 print
'<td class="liste_titre">';
435 $form->select_comptes($search_bank_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
440 if ($arrayfields[
'entry'][
'checked']) {
441 print
'<td class="liste_titre left">';
442 print
'<input name="search_bank_entry" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_bank_entry).
'">';
447 if ($arrayfields[
'account'][
'checked']) {
448 print
'<td class="liste_titre">';
449 print
'<div class="nowrap">';
450 print $formaccounting->select_account($search_accountancy_account,
'search_accountancy_account', 1, array(), 1, 1,
'maxwidth200');
456 if ($arrayfields[
'subledger'][
'checked']) {
457 print
'<td class="liste_titre">';
458 print
'<div class="nowrap">';
459 print $formaccounting->select_auxaccount($search_accountancy_subledger,
'search_accountancy_subledger', 1,
'maxwidth200');
465 if ($arrayfields[
'debit'][
'checked']) {
466 print
'<td class="liste_titre right">';
467 print
'<input name="search_amount_deb" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_amount_deb).
'">';
472 if ($arrayfields[
'credit'][
'checked']) {
473 print
'<td class="liste_titre right">';
474 print
'<input name="search_amount_cred" class="flat maxwidth50" type="text" size="8" value="'.dol_escape_htmltag($search_amount_cred).
'">';
478 print
'<td class="liste_titre maxwidthsearch">';
479 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
485 print
'<tr class="liste_titre">';
487 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
491 if ($arrayfields[
'ref'][
'checked']) {
492 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
'v.rowid',
'', $param,
'', $sortfield, $sortorder);
494 if ($arrayfields[
'label'][
'checked']) {
495 print_liste_field_titre($arrayfields[
'label'][
'label'], $_SERVER[
"PHP_SELF"],
'v.label',
'', $param,
'', $sortfield, $sortorder);
497 if ($arrayfields[
'datep'][
'checked']) {
498 print_liste_field_titre($arrayfields[
'datep'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datep,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
500 if ($arrayfields[
'datev'][
'checked']) {
501 print_liste_field_titre($arrayfields[
'datev'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datev,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
503 if ($arrayfields[
'type'][
'checked']) {
504 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
'type',
'', $param,
'', $sortfield, $sortorder,
'center ');
506 if ($arrayfields[
'project'][
'checked']) {
507 print_liste_field_titre($arrayfields[
'project'][
'label'], $_SERVER[
"PHP_SELF"],
'fk_project',
'', $param,
'', $sortfield, $sortorder);
509 if ($arrayfields[
'bank'][
'checked']) {
510 print_liste_field_titre($arrayfields[
'bank'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
512 if ($arrayfields[
'entry'][
'checked']) {
513 print_liste_field_titre($arrayfields[
'entry'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
515 if ($arrayfields[
'account'][
'checked']) {
516 print_liste_field_titre($arrayfields[
'account'][
'label'], $_SERVER[
"PHP_SELF"],
'v.accountancy_code',
'', $param,
'', $sortfield, $sortorder,
'left ');
518 if ($arrayfields[
'subledger'][
'checked']) {
519 print_liste_field_titre($arrayfields[
'subledger'][
'label'], $_SERVER[
"PHP_SELF"],
'v.subledger_account',
'', $param,
'', $sortfield, $sortorder,
'left ');
521 if ($arrayfields[
'debit'][
'checked']) {
522 print_liste_field_titre($arrayfields[
'debit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
524 if ($arrayfields[
'credit'][
'checked']) {
525 print_liste_field_titre($arrayfields[
'credit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
529 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
530 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
531 print $hookmanager->resPrint;
533 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
537 $totalarray = array();
538 $totalarray[
'nbfield'] = 0;
539 $totalarray[
'val'][
'total_cred'] = 0;
540 $totalarray[
'val'][
'total_deb'] = 0;
542 while ($i < min($num, $limit)) {
543 $obj = $db->fetch_object(
$resql);
545 $variousstatic->id = $obj->rowid;
546 $variousstatic->ref = $obj->rowid;
547 $variousstatic->label = $obj->label;
549 print
'<tr class="oddeven">';
552 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
553 print
'<td>'.(($offset * $limit) + $i).
'</td>';
557 if ($arrayfields[
'ref'][
'checked']) {
558 print
'<td>'.$variousstatic->getNomUrl(1).
"</td>";
560 $totalarray[
'nbfield']++;
565 if ($arrayfields[
'label'][
'checked']) {
566 print
'<td class="tdoverflowmax150" title="'.$variousstatic->label.
'">'.$variousstatic->label.
"</td>";
568 $totalarray[
'nbfield']++;
573 if ($arrayfields[
'datep'][
'checked']) {
574 print
'<td class="center">'.dol_print_date($obj->datep,
'day').
"</td>";
576 $totalarray[
'nbfield']++;
582 if ($arrayfields[
'datev'][
'checked']) {
583 print
'<td class="center">'.dol_print_date($obj->datev,
'day').
"</td>";
585 $totalarray[
'nbfield']++;
590 if ($arrayfields[
'type'][
'checked']) {
591 print
'<td class="center">';
592 if ($obj->payment_code) {
593 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
596 print $obj->num_payment;
599 $totalarray[
'nbfield']++;
604 if ($arrayfields[
'project'][
'checked']) {
605 print
'<td class="nowraponall">';
606 if ($obj->fk_project > 0) {
607 $proj->fetch($obj->fk_project);
608 print $proj->getNomUrl(1);
612 $totalarray[
'nbfield']++;
617 if ($arrayfields[
'bank'][
'checked']) {
618 print
'<td class="nowraponall">';
620 $accountstatic->id = $obj->bid;
621 $accountstatic->ref = $obj->bref;
622 $accountstatic->number = $obj->bnumber;
625 $accountstatic->account_number = $obj->bank_account_number;
626 $accountingjournal->fetch($obj->accountancy_journal);
627 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
630 $accountstatic->label = $obj->blabel;
631 print $accountstatic->getNomUrl(1);
637 $totalarray[
'nbfield']++;
642 if ($arrayfields[
'entry'][
'checked']) {
643 $bankline->fetch($obj->fk_bank);
644 print
'<td>'.$bankline->getNomUrl(1).
'</td>';
646 $totalarray[
'nbfield']++;
651 if ($arrayfields[
'account'][
'checked']) {
652 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
653 $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
655 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.
' '.$accountingaccount->label).
'">'.$accountingaccount->getNomUrl(0, 1, 1,
'', 1).
'</td>';
657 $totalarray[
'nbfield']++;
662 if ($arrayfields[
'subledger'][
'checked']) {
663 print
'<td class="tdoverflowmax150">'.length_accounta($obj->subledger_account).
'</td>';
665 $totalarray[
'nbfield']++;
670 if ($arrayfields[
'debit'][
'checked']) {
671 print
'<td class="nowrap right">';
672 if ($obj->sens == 0) {
673 print
'<span class="amount">'.price($obj->amount).
'</span>';
674 $totalarray[
'val'][
'total_deb'] += $obj->amount;
677 $totalarray[
'nbfield']++;
680 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_deb';
686 if ($arrayfields[
'credit'][
'checked']) {
687 print
'<td class="nowrap right">';
688 if ($obj->sens == 1) {
689 print
'<span class="amount">'.price($obj->amount).
'</span>';
690 $totalarray[
'val'][
'total_cred'] += $obj->amount;
693 $totalarray[
'nbfield']++;
696 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_cred';
704 $totalarray[
'nbfield']++;
713 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
718 foreach ($arrayfields as $key => $val) {
719 if (!empty($val[
'checked'])) {
723 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
728 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
729 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
730 print $hookmanager->resPrint;
732 print
'</table>'.
"\n";
735 print
'</form>'.
"\n";