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.
'/core/lib/accounting.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
38 $langs->loadLangs(array(
"compta",
"banks",
"bills",
"accountancy"));
40 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'directdebitcredittransferlist';
43 $socid =
GETPOST(
"socid",
"int");
45 $socid = $user->socid;
48 $optioncss =
GETPOST(
'optioncss',
'alpha');
49 $mode =
GETPOST(
'mode',
'alpha');
51 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
52 $search_ref =
GETPOST(
'search_ref',
'int');
53 $search_user =
GETPOST(
'search_user',
'alpha');
54 $search_label =
GETPOST(
'search_label',
'alpha');
55 $search_datep_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
56 $search_datep_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
57 $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'));
58 $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'));
59 $search_amount_deb =
GETPOST(
'search_amount_deb',
'alpha');
60 $search_amount_cred =
GETPOST(
'search_amount_cred',
'alpha');
61 $search_bank_account =
GETPOST(
'search_account',
'int');
62 $search_bank_entry =
GETPOST(
'search_bank_entry',
'int');
63 $search_accountancy_account =
GETPOST(
"search_accountancy_account");
64 if ($search_accountancy_account == - 1) {
65 $search_accountancy_account =
'';
67 $search_accountancy_subledger =
GETPOST(
"search_accountancy_subledger");
68 if ($search_accountancy_subledger == - 1) {
69 $search_accountancy_subledger =
'';
71 if (empty($search_datep_start)) {
72 $search_datep_start =
GETPOST(
"search_datep_start",
'int');
74 if (empty($search_datep_end)) {
75 $search_datep_end =
GETPOST(
"search_datep_end",
'int');
77 if (empty($search_datev_start)) {
78 $search_datev_start =
GETPOST(
"search_datev_start",
'int');
80 if (empty($search_datev_end)) {
81 $search_datev_end =
GETPOST(
"search_datev_end",
'int');
83 $search_type_id =
GETPOST(
'search_type_id',
'int');
85 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
86 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
88 if (empty($page) || $page == -1) {
91 $offset = $limit * $page;
92 $pageprev = $page - 1;
93 $pagenext = $page + 1;
95 $sortfield =
"v.datep,v.rowid";
98 $sortorder =
"DESC,DESC";
101 $filtre =
GETPOST(
"filtre",
'alpha');
103 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
106 $search_datep_start =
'';
107 $search_datep_end =
'';
108 $search_datev_start =
'';
109 $search_datev_end =
'';
110 $search_amount_deb =
'';
111 $search_amount_cred =
'';
112 $search_bank_account =
'';
113 $search_bank_entry =
'';
114 $search_accountancy_account =
'';
115 $search_accountancy_subledger =
'';
116 $search_type_id =
'';
142 $fieldstosearchall = array(
145 'v.datep'=>
"DatePayment",
146 'v.datev'=>
"DateValue",
147 'v.amount'=>$langs->trans(
"Debit").
", ".$langs->trans(
"Credit"),
151 $arrayfields = array(
152 'ref' =>array(
'label'=>
"Ref",
'checked'=>1,
'position'=>100),
153 'label' =>array(
'label'=>
"Label",
'checked'=>1,
'position'=>110),
154 'datep' =>array(
'label'=>
"DatePayment",
'checked'=>1,
'position'=>120),
155 'datev' =>array(
'label'=>
"DateValue",
'checked'=>-1,
'position'=>130),
156 'type' =>array(
'label'=>
"PaymentMode",
'checked'=>1,
'position'=>140),
157 'project' =>array(
'label'=>
"Project",
'checked'=>1,
'position'=>200,
"enabled"=>
isModEnabled(
'project')),
158 'bank' =>array(
'label'=>
"BankAccount",
'checked'=>1,
'position'=>300,
"enabled"=>
isModEnabled(
"banque")),
159 'entry' =>array(
'label'=>
"BankTransactionLine",
'checked'=>1,
'position'=>310,
"enabled"=>
isModEnabled(
"banque")),
160 'account' =>array(
'label'=>
"AccountAccountingShort",
'checked'=>1,
'position'=>400,
"enabled"=>
isModEnabled(
'accounting')),
161 'subledger' =>array(
'label'=>
"SubledgerAccount",
'checked'=>1,
'position'=>410,
"enabled"=>
isModEnabled(
'accounting')),
162 'debit' =>array(
'label'=>
"Debit",
'checked'=>1,
'position'=>500),
163 'credit' =>array(
'label'=>
"Credit",
'checked'=>1,
'position'=>510),
177 $parameters = array();
178 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
183 if (empty($reshook)) {
185 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
193 if ($arrayfields[
'account'][
'checked'] || $arrayfields[
'subledger'][
'checked']) {
196 if ($arrayfields[
'bank'][
'checked'] &&
isModEnabled(
'accounting')) {
199 if ($arrayfields[
'ref'][
'checked']) {
202 if ($arrayfields[
'bank'][
'checked']) {
203 $accountstatic =
new Account($db);
205 if ($arrayfields[
'project'][
'checked']) {
208 if ($arrayfields[
'entry'][
'checked']) {
211 if ($arrayfields[
'account'][
'checked']) {
215 $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,";
216 $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,";
217 $sql .=
" pst.code as payment_code";
221 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as v";
222 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON v.fk_typepayment = pst.id";
223 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON v.fk_bank = b.rowid";
224 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
225 $sql .=
" WHERE v.entity IN (".getEntity(
'payment_various').
")";
229 $sql .=
" AND v.rowid = ".((int) $search_ref);
234 if ($search_datep_start) {
235 $sql .=
" AND v.datep >= '".$db->idate($search_datep_start).
"'";
237 if ($search_datep_end) {
238 $sql .=
" AND v.datep <= '".$db->idate($search_datep_end).
"'";
240 if ($search_datev_start) {
241 $sql .=
" AND v.datev >= '".$db->idate($search_datev_start).
"'";
243 if ($search_datev_end) {
244 $sql .=
" AND v.datev <= '".$db->idate($search_datev_end).
"'";
246 if ($search_amount_deb) {
249 if ($search_amount_cred) {
252 if ($search_bank_account > 0) {
253 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
255 if ($search_bank_entry > 0) {
256 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
258 if ($search_accountancy_account > 0) {
259 $sql .=
" AND v.accountancy_code = ".((int) $search_accountancy_account);
261 if ($search_accountancy_subledger > 0) {
262 $sql .=
" AND v.subledger_account = ".((int) $search_accountancy_subledger);
264 if ($search_type_id > 0) {
265 $sql .=
" AND v.fk_typepayment=".((int) $search_type_id);
273 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
275 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords',
$sql);
276 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
277 $resql = $db->query($sqlforcount);
279 $objforcount = $db->fetch_object($resql);
293 $sql .= $db->order($sortfield, $sortorder);
295 $sql .= $db->plimit($limit + 1, $offset);
298 $resql = $db->query(
$sql);
300 $num = $db->num_rows($resql);
303 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) {
304 $obj = $db->fetch_object($resql);
306 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?id='.$id);
311 llxHeader(
'', $langs->trans(
"VariousPayments"));
318 $param .=
'&mode='.urlencode($mode);
320 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
321 $param .=
'&contextpage='.urlencode($contextpage);
323 if ($limit > 0 && $limit != $conf->liste_limit) {
324 $param .=
'&limit='.urlencode($limit);
327 $param .=
'&search_ref='.urlencode($search_ref);
330 $param .=
'&search_label='.urlencode($search_label);
332 if ($search_datep_start) {
333 $param .=
'&search_datep_start='.urlencode($search_datep_start);
335 if ($search_datep_end) {
336 $param .=
'&search_datep_end='.urlencode($search_datep_end);
338 if ($search_datev_start) {
339 $param .=
'&search_datev_start='.urlencode($search_datev_start);
341 if ($search_datev_end) {
342 $param .=
'&search_datev_end='.urlencode($search_datev_end);
344 if ($search_type_id > 0) {
345 $param .=
'&search_type_id='.urlencode($search_type_id);
347 if ($search_amount_deb) {
348 $param .=
'&search_amount_deb='.urlencode($search_amount_deb);
350 if ($search_amount_cred) {
351 $param .=
'&search_amount_cred='.urlencode($search_amount_cred);
353 if ($search_bank_account > 0) {
354 $param .=
'&search_account='.urlencode($search_bank_account);
356 if ($search_accountancy_account > 0) {
357 $param .=
'&search_accountancy_account='.urlencode($search_accountancy_account);
359 if ($search_accountancy_subledger > 0) {
360 $param .=
'&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
362 if ($optioncss !=
'') {
363 $param .=
'&optioncss='.urlencode($optioncss);
366 $url = DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?action=create';
367 if (!empty($socid)) {
368 $url .=
'&socid='.urlencode($socid);
371 $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'));
372 $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'));
373 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'MenuNewVariousPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->banque->modifier);
375 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
377 if ($optioncss !=
'') {
378 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
380 print
'<input type="hidden" name="token" value="'.newToken().
'">';
381 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
382 print
'<input type="hidden" name="action" value="list">';
383 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
384 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
385 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
386 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
389 print_barre_liste($langs->trans(
"MenuVariousPayment"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num,
$nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
392 foreach ($fieldstosearchall as $key => $val) {
393 $fieldstosearchall[$key] = $langs->trans($val);
395 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
398 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
399 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
402 print
'<div class="div-table-responsive">';
403 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">';
405 print
'<tr class="liste_titre">';
408 print
'<td class="liste_titre maxwidthsearch">';
409 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
414 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
415 print
'<td class="liste_titre">';
420 if ($arrayfields[
'ref'][
'checked']) {
421 print
'<td class="liste_titre left">';
422 print
'<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
427 if ($arrayfields[
'label'][
'checked']) {
428 print
'<td class="liste_titre">';
429 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
434 if ($arrayfields[
'datep'][
'checked']) {
435 print
'<td class="liste_titre center">';
436 print
'<div class="nowrap">';
437 print
$form->selectDate($search_datep_start ? $search_datep_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
439 print
'<div class="nowrap">';
440 print
$form->selectDate($search_datep_end ? $search_datep_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
446 if ($arrayfields[
'datev'][
'checked']) {
447 print
'<td class="liste_titre center">';
448 print
'<div class="nowrap">';
449 print
$form->selectDate($search_datev_start ? $search_datev_start : -1,
'search_date_value_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
451 print
'<div class="nowrap">';
452 print
$form->selectDate($search_datev_end ? $search_datev_end : -1,
'search_date_value_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
458 if ($arrayfields[
'type'][
'checked']) {
459 print
'<td class="liste_titre center">';
460 print
$form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'maxwidth100', 1);
465 if ($arrayfields[
'project'][
'checked']) {
466 print
'<td class="liste_titre">';
472 if ($arrayfields[
'bank'][
'checked']) {
473 print
'<td class="liste_titre">';
474 $form->select_comptes($search_bank_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
479 if ($arrayfields[
'entry'][
'checked']) {
480 print
'<td class="liste_titre left">';
481 print
'<input name="search_bank_entry" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_bank_entry).
'">';
486 if (!empty($arrayfields[
'account'][
'checked'])) {
487 print
'<td class="liste_titre">';
488 print
'<div class="nowrap">';
489 print $formaccounting->select_account($search_accountancy_account,
'search_accountancy_account', 1, array(), 1, 1,
'maxwidth200');
495 if (!empty($arrayfields[
'subledger'][
'checked'])) {
496 print
'<td class="liste_titre">';
497 print
'<div class="nowrap">';
498 print $formaccounting->select_auxaccount($search_accountancy_subledger,
'search_accountancy_subledger', 1,
'maxwidth200');
504 if (!empty($arrayfields[
'debit'][
'checked'])) {
505 print
'<td class="liste_titre right">';
506 print
'<input name="search_amount_deb" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_amount_deb).
'">';
511 if ($arrayfields[
'credit'][
'checked']) {
512 print
'<td class="liste_titre right">';
513 print
'<input name="search_amount_cred" class="flat maxwidth50" type="text" size="8" value="'.dol_escape_htmltag($search_amount_cred).
'">';
518 print
'<td class="liste_titre maxwidthsearch">';
519 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
527 print
'<tr class="liste_titre">';
530 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
533 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
537 if ($arrayfields[
'ref'][
'checked']) {
538 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
'v.rowid',
'', $param,
'', $sortfield, $sortorder);
540 if ($arrayfields[
'label'][
'checked']) {
541 print_liste_field_titre($arrayfields[
'label'][
'label'], $_SERVER[
"PHP_SELF"],
'v.label',
'', $param,
'', $sortfield, $sortorder);
543 if ($arrayfields[
'datep'][
'checked']) {
544 print_liste_field_titre($arrayfields[
'datep'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datep,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
546 if ($arrayfields[
'datev'][
'checked']) {
547 print_liste_field_titre($arrayfields[
'datev'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datev,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
549 if ($arrayfields[
'type'][
'checked']) {
550 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
'type',
'', $param,
'', $sortfield, $sortorder,
'center ');
552 if ($arrayfields[
'project'][
'checked']) {
553 print_liste_field_titre($arrayfields[
'project'][
'label'], $_SERVER[
"PHP_SELF"],
'fk_project',
'', $param,
'', $sortfield, $sortorder);
555 if ($arrayfields[
'bank'][
'checked']) {
556 print_liste_field_titre($arrayfields[
'bank'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
558 if ($arrayfields[
'entry'][
'checked']) {
559 print_liste_field_titre($arrayfields[
'entry'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
561 if (!empty($arrayfields[
'account'][
'checked'])) {
562 print_liste_field_titre($arrayfields[
'account'][
'label'], $_SERVER[
"PHP_SELF"],
'v.accountancy_code',
'', $param,
'', $sortfield, $sortorder,
'left ');
564 if (!empty($arrayfields[
'subledger'][
'checked'])) {
565 print_liste_field_titre($arrayfields[
'subledger'][
'label'], $_SERVER[
"PHP_SELF"],
'v.subledger_account',
'', $param,
'', $sortfield, $sortorder,
'left ');
567 if ($arrayfields[
'debit'][
'checked']) {
568 print_liste_field_titre($arrayfields[
'debit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
570 if ($arrayfields[
'credit'][
'checked']) {
571 print_liste_field_titre($arrayfields[
'credit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
575 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
576 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
577 print $hookmanager->resPrint;
580 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
585 $totalarray = array();
586 $totalarray[
'nbfield'] = 0;
587 $totalarray[
'val'][
'total_cred'] = 0;
588 $totalarray[
'val'][
'total_deb'] = 0;
590 while ($i < min($num, $limit)) {
591 $obj = $db->fetch_object($resql);
593 $variousstatic->id = $obj->rowid;
594 $variousstatic->ref = $obj->rowid;
595 $variousstatic->label = $obj->label;
596 $variousstatic->datep = $obj->datep;
597 $variousstatic->type_payment = $obj->payment_code;
598 $bankline->fetch($obj->fk_bank);
599 $variousstatic->fk_bank = $bankline->getNomUrl(1);
600 $variousstatic->amount = $obj->amount;
602 $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
603 $variousstatic->accountancy_code = $accountingaccount->getNomUrl(0, 0, 1, $obj->accountingaccount, 1);
605 if ($mode ==
'kanban') {
607 print
'<tr><td colspan="12">';
608 print
'<div class="box-flex-container kanban">';
612 print $variousstatic->getKanbanView(
'');
613 if ($i == (min($num, $limit) - 1)) {
618 print
'<tr class="oddeven">';
625 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
626 print
'<td>'.(($offset * $limit) + $i).
'</td>';
630 if ($arrayfields[
'ref'][
'checked']) {
631 print
'<td>'.$variousstatic->getNomUrl(1).
"</td>";
633 $totalarray[
'nbfield']++;
638 if ($arrayfields[
'label'][
'checked']) {
639 print
'<td class="tdoverflowmax150" title="'.$variousstatic->label.
'">'.$variousstatic->label.
"</td>";
641 $totalarray[
'nbfield']++;
646 if ($arrayfields[
'datep'][
'checked']) {
647 print
'<td class="center">'.dol_print_date($obj->datep,
'day').
"</td>";
649 $totalarray[
'nbfield']++;
655 if ($arrayfields[
'datev'][
'checked']) {
656 print
'<td class="center">'.dol_print_date($obj->datev,
'day').
"</td>";
658 $totalarray[
'nbfield']++;
663 if ($arrayfields[
'type'][
'checked']) {
664 print
'<td class="center">';
665 if ($obj->payment_code) {
666 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
669 print $obj->num_payment;
672 $totalarray[
'nbfield']++;
677 if ($arrayfields[
'project'][
'checked']) {
678 print
'<td class="nowraponall">';
679 if ($obj->fk_project > 0) {
680 $proj->fetch($obj->fk_project);
681 print $proj->getNomUrl(1);
685 $totalarray[
'nbfield']++;
690 if ($arrayfields[
'bank'][
'checked']) {
691 print
'<td class="nowraponall">';
693 $accountstatic->id = $obj->bid;
694 $accountstatic->ref = $obj->bref;
695 $accountstatic->number = $obj->bnumber;
698 $accountstatic->account_number = $obj->bank_account_number;
699 $accountingjournal->fetch($obj->accountancy_journal);
700 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
703 $accountstatic->label = $obj->blabel;
704 print $accountstatic->getNomUrl(1);
710 $totalarray[
'nbfield']++;
715 if ($arrayfields[
'entry'][
'checked']) {
716 $bankline->fetch($obj->fk_bank);
717 print
'<td>'.$bankline->getNomUrl(1).
'</td>';
719 $totalarray[
'nbfield']++;
724 if (!empty($arrayfields[
'account'][
'checked'])) {
725 $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
727 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.
' '.$accountingaccount->label).
'">'.$accountingaccount->getNomUrl(0, 1, 1,
'', 1).
'</td>';
729 $totalarray[
'nbfield']++;
734 if (!empty($arrayfields[
'subledger'][
'checked'])) {
735 print
'<td class="tdoverflowmax150">'.length_accounta($obj->subledger_account).
'</td>';
737 $totalarray[
'nbfield']++;
742 if ($arrayfields[
'debit'][
'checked']) {
743 print
'<td class="nowrap right">';
744 if ($obj->sens == 0) {
745 print
'<span class="amount">'.price($obj->amount).
'</span>';
746 $totalarray[
'val'][
'total_deb'] += $obj->amount;
749 $totalarray[
'nbfield']++;
752 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_deb';
758 if ($arrayfields[
'credit'][
'checked']) {
759 print
'<td class="nowrap right">';
760 if ($obj->sens == 1) {
761 print
'<span class="amount">'.price($obj->amount).
'</span>';
762 $totalarray[
'val'][
'total_cred'] += $obj->amount;
765 $totalarray[
'nbfield']++;
768 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_cred';
777 $totalarray[
'nbfield']++;
786 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
791 foreach ($arrayfields as $key => $val) {
792 if (!empty($val[
'checked'])) {
796 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
801 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>
$sql);
802 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
803 print $hookmanager->resPrint;
805 print
'</table>'.
"\n";
808 print
'</form>'.
"\n";