29require
'../../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
39$langs->loadLangs(array(
"compta",
"banks",
"bills",
"accountancy"));
41$optioncss =
GETPOST(
'optioncss',
'alpha');
42$mode =
GETPOST(
'mode',
'alpha');
43$massaction =
GETPOST(
'massaction',
'aZ09');
44$toselect =
GETPOST(
'toselect',
'array');
45$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'directdebitcredittransferlist';
48$search_ref =
GETPOST(
'search_ref',
'alpha');
49$search_user =
GETPOST(
'search_user',
'alpha');
50$search_label =
GETPOST(
'search_label',
'alpha');
55$search_amount_deb =
GETPOST(
'search_amount_deb',
'alpha');
56$search_amount_cred =
GETPOST(
'search_amount_cred',
'alpha');
57$search_bank_account =
GETPOST(
'search_account',
"intcomma");
58$search_bank_entry =
GETPOST(
'search_bank_entry',
'alpha');
59$search_accountancy_account =
GETPOST(
"search_accountancy_account");
60if ($search_accountancy_account == - 1) {
61 $search_accountancy_account =
'';
63$search_accountancy_subledger =
GETPOST(
"search_accountancy_subledger");
64if ($search_accountancy_subledger == - 1) {
65 $search_accountancy_subledger =
'';
67if (empty($search_datep_start)) {
68 $search_datep_start =
GETPOSTINT(
"search_datep_start");
70if (empty($search_datep_end)) {
71 $search_datep_end =
GETPOSTINT(
"search_datep_end");
73if (empty($search_datev_start)) {
74 $search_datev_start =
GETPOSTINT(
"search_datev_start");
76if (empty($search_datev_end)) {
77 $search_datev_end =
GETPOSTINT(
"search_datev_end");
79$search_type_id =
GETPOST(
'search_type_id',
'int');
81$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
82$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
84if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
88$offset = $limit * $page;
96$hookmanager->initHooks(array($contextpage));
99$extrafields->fetch_name_optionals_label(
$object->table_element);
101$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
105 $sortfield =
"v.datep,v.rowid";
108 $sortorder =
"DESC,DESC";
111$filtre =
GETPOST(
"filtre",
'alpha');
113if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
116 $search_datep_start =
'';
117 $search_datep_end =
'';
118 $search_datev_start =
'';
119 $search_datev_end =
'';
120 $search_amount_deb =
'';
121 $search_amount_cred =
'';
122 $search_bank_account =
'';
123 $search_bank_entry =
'';
124 $search_accountancy_account =
'';
125 $search_accountancy_subledger =
'';
126 $search_type_id =
'';
129$search_all = GETPOSTISSET(
"search_all") ? trim(
GETPOST(
"search_all",
'alpha')) : trim(
GETPOST(
'sall'));
152$fieldstosearchall = array(
154 'v.label' =>
"Label",
155 'v.datep' =>
"DatePayment",
156 'v.datev' =>
"DateValue",
157 'v.amount' => $langs->trans(
"Debit").
", ".$langs->trans(
"Credit"),
162 'ref' => array(
'label' =>
"Ref",
'checked' => 1,
'position' => 100),
163 'label' => array(
'label' =>
"Label",
'checked' => 1,
'position' => 110),
164 'datep' => array(
'label' =>
"DatePayment",
'checked' => 1,
'position' => 120),
165 'datev' => array(
'label' =>
"DateValue",
'checked' => -1,
'position' => 130),
166 'type' => array(
'label' =>
"PaymentMode",
'checked' => 1,
'position' => 140),
167 'project' => array(
'label' =>
"Project",
'checked' => 1,
'position' => 200,
"enabled" => isModEnabled(
'project')),
168 'bank' => array(
'label' =>
"BankAccount",
'checked' => 1,
'position' => 300,
"enabled" => isModEnabled(
"bank")),
169 'entry' => array(
'label' =>
"BankTransactionLine",
'checked' => 1,
'position' => 310,
"enabled" => isModEnabled(
"bank")),
170 'account' => array(
'label' =>
"AccountAccountingShort",
'checked' => 1,
'position' => 400,
"enabled" => isModEnabled(
'accounting')),
171 'subledger' => array(
'label' =>
"SubledgerAccount",
'checked' => 1,
'position' => 410,
"enabled" => isModEnabled(
'accounting')),
172 'debit' => array(
'label' =>
"Debit",
'checked' => 1,
'position' => 500),
173 'credit' => array(
'label' =>
"Credit",
'checked' => 1,
'position' => 510),
177'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
182 $socid = $user->socid;
192if (
GETPOST(
'cancel',
'alpha')) {
196if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
200$parameters = array();
201$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
206if (empty($reshook)) {
208 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
211 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
212 foreach (
$object->fields as $key => $val) {
214 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
215 $search[$key.
'_dtstart'] =
'';
216 $search[$key.
'_dtend'] =
'';
220 $search_array_options = array();
222 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
223 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
232$form =
new Form($db);
234if ($arrayfields[
'account'][
'checked'] || $arrayfields[
'subledger'][
'checked']) {
237if ($arrayfields[
'bank'][
'checked'] && isModEnabled(
'accounting')) {
240if ($arrayfields[
'ref'][
'checked']) {
243if ($arrayfields[
'bank'][
'checked']) {
244 $accountstatic =
new Account($db);
246if ($arrayfields[
'project'][
'checked']) {
249if ($arrayfields[
'entry'][
'checked']) {
252if ($arrayfields[
'account'][
'checked']) {
256$title = $langs->trans(
"VariousPayments");
263$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,";
264$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,";
265$sql .=
" pst.code as payment_code";
269$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as v";
270$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON v.fk_typepayment = pst.id";
271$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON v.fk_bank = b.rowid";
272$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
273$sql .=
" WHERE v.entity IN (".getEntity(
'payment_various').
")";
277 $sql .=
" AND v.rowid = ".((int) $search_ref);
282if ($search_datep_start) {
283 $sql .=
" AND v.datep >= '".$db->idate($search_datep_start).
"'";
285if ($search_datep_end) {
286 $sql .=
" AND v.datep <= '".$db->idate($search_datep_end).
"'";
288if ($search_datev_start) {
289 $sql .=
" AND v.datev >= '".$db->idate($search_datev_start).
"'";
291if ($search_datev_end) {
292 $sql .=
" AND v.datev <= '".$db->idate($search_datev_end).
"'";
294if ($search_amount_deb) {
297if ($search_amount_cred) {
300if ($search_bank_account > 0) {
301 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
303if ($search_bank_entry > 0) {
304 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
306if ($search_accountancy_account > 0) {
307 $sql .=
" AND v.accountancy_code = ".((int) $search_accountancy_account);
309if ($search_accountancy_subledger > 0) {
310 $sql .=
" AND v.subledger_account = ".((int) $search_accountancy_subledger);
312if ($search_type_id > 0) {
313 $sql .=
" AND v.fk_typepayment=".((int) $search_type_id);
316 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
320include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
322$parameters = array();
323$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
324$sql .= $hookmanager->resPrint;
327$nbtotalofrecords =
'';
330 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
331 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
332 $resql = $db->query($sqlforcount);
334 $objforcount = $db->fetch_object($resql);
335 $nbtotalofrecords = $objforcount->nbtotalofrecords;
340 if (($page * $limit) > $nbtotalofrecords) {
348$sql .= $db->order($sortfield, $sortorder);
350 $sql .= $db->plimit($limit + 1, $offset);
353$resql = $db->query($sql);
359$num = $db->num_rows($resql);
362if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
363 $obj = $db->fetch_object($resql);
365 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?id='.
$id);
372llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
374$arrayofselected = is_array($toselect) ? $toselect : array();
378 $param .=
'&mode='.urlencode($mode);
380if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
381 $param .=
'&contextpage='.urlencode($contextpage);
383if ($limit > 0 && $limit != $conf->liste_limit) {
384 $param .=
'&limit='.((int) $limit);
386if ($optioncss !=
'') {
387 $param .=
'&optioncss='.urlencode($optioncss);
390 $param .=
'&search_ref='.urlencode($search_ref);
393 $param .=
'&search_label='.urlencode($search_label);
395if ($search_datep_start) {
396 $param .=
'&search_datep_start='.urlencode($search_datep_start);
398if ($search_datep_end) {
399 $param .=
'&search_datep_end='.urlencode($search_datep_end);
401if ($search_datev_start) {
402 $param .=
'&search_datev_start='.urlencode($search_datev_start);
404if ($search_datev_end) {
405 $param .=
'&search_datev_end='.urlencode($search_datev_end);
407if ($search_type_id > 0) {
408 $param .=
'&search_type_id='.urlencode((
string) ($search_type_id));
410if ($search_amount_deb) {
411 $param .=
'&search_amount_deb='.urlencode($search_amount_deb);
413if ($search_amount_cred) {
414 $param .=
'&search_amount_cred='.urlencode($search_amount_cred);
416if ($search_bank_account > 0) {
417 $param .=
'&search_account='.urlencode((
string) ($search_bank_account));
419if ($search_accountancy_account > 0) {
420 $param .=
'&search_accountancy_account='.urlencode($search_accountancy_account);
422if ($search_accountancy_subledger > 0) {
423 $param .=
'&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
426$url = DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?action=create';
428 $url .=
'&socid='.urlencode((
string) ($socid));
432$arrayofmassactions = array();
433$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
435print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
436if ($optioncss !=
'') {
437 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
439print
'<input type="hidden" name="token" value="'.newToken().
'">';
440print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
441print
'<input type="hidden" name="action" value="list">';
442print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
443print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
444print
'<input type="hidden" name="page" value="'.$page.
'">';
445print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
446print
'<input type="hidden" name="page_y" value="">';
447print
'<input type="hidden" name="mode" value="'.$mode.
'">';
450$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'));
451$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'));
453$newcardbutton .=
dolGetButtonTitle($langs->trans(
'MenuNewVariousPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'banque',
'modifier'));
455print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
459 foreach ($fieldstosearchall as $key => $val) {
460 $fieldstosearchall[$key] = $langs->trans($val);
461 $setupstring .= $key.
"=".$val.
";";
463 print
'<!-- Search done like if VARIOUSPAYMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
464 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
467$arrayofmassactions = array();
471$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
472$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
473$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
474$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
477print
'<div class="div-table-responsive">';
478print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
482print
'<tr class="liste_titre_filter">';
485 print
'<td class="liste_titre center maxwidthsearch">';
486 $searchpicto = $form->showFilterButtons(
'left');
492 print
'<td class="liste_titre">';
497if ($arrayfields[
'ref'][
'checked']) {
498 print
'<td class="liste_titre left">';
499 print
'<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
504if ($arrayfields[
'label'][
'checked']) {
505 print
'<td class="liste_titre">';
506 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
511if ($arrayfields[
'datep'][
'checked']) {
512 print
'<td class="liste_titre center">';
513 print
'<div class="nowrapfordate">';
514 print $form->selectDate($search_datep_start ? $search_datep_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
516 print
'<div class="nowrapfordate">';
517 print $form->selectDate($search_datep_end ? $search_datep_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
523if ($arrayfields[
'datev'][
'checked']) {
524 print
'<td class="liste_titre center">';
525 print
'<div class="nowrapfordate">';
526 print $form->selectDate($search_datev_start ? $search_datev_start : -1,
'search_date_value_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
528 print
'<div class="nowrapfordate">';
529 print $form->selectDate($search_datev_end ? $search_datev_end : -1,
'search_date_value_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
535if ($arrayfields[
'type'][
'checked']) {
536 print
'<td class="liste_titre center">';
537 print $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'maxwidth100', 1);
542if ($arrayfields[
'project'][
'checked']) {
543 print
'<td class="liste_titre">';
549if ($arrayfields[
'bank'][
'checked']) {
550 print
'<td class="liste_titre">';
551 $form->select_comptes($search_bank_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
556if ($arrayfields[
'entry'][
'checked']) {
557 print
'<td class="liste_titre left">';
558 print
'<input name="search_bank_entry" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_bank_entry).
'">';
563if (!empty($arrayfields[
'account'][
'checked'])) {
564 print
'<td class="liste_titre">';
565 print
'<div class="nowrap">';
566 print $formaccounting->select_account($search_accountancy_account,
'search_accountancy_account', 1, array(), 1, 1,
'maxwidth200');
572if (!empty($arrayfields[
'subledger'][
'checked'])) {
573 print
'<td class="liste_titre">';
574 print
'<div class="nowrap">';
575 print $formaccounting->select_auxaccount($search_accountancy_subledger,
'search_accountancy_subledger', 1,
'maxwidth200');
581if (!empty($arrayfields[
'debit'][
'checked'])) {
582 print
'<td class="liste_titre right">';
583 print
'<input name="search_amount_deb" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_amount_deb).
'">';
588if ($arrayfields[
'credit'][
'checked']) {
589 print
'<td class="liste_titre right">';
590 print
'<input name="search_amount_cred" class="flat maxwidth50" type="text" size="8" value="'.dol_escape_htmltag($search_amount_cred).
'">';
595 print
'<td class="liste_titre center maxwidthsearch">';
596 $searchpicto = $form->showFilterButtons();
603$totalarray = array();
604$totalarray[
'nbfield'] = 0;
608print
'<tr class="liste_titre">';
611 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
612 $totalarray[
'nbfield']++;
616 $totalarray[
'nbfield']++;
619if ($arrayfields[
'ref'][
'checked']) {
620 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
'v.rowid',
'', $param,
'', $sortfield, $sortorder);
621 $totalarray[
'nbfield']++;
623if ($arrayfields[
'label'][
'checked']) {
624 print_liste_field_titre($arrayfields[
'label'][
'label'], $_SERVER[
"PHP_SELF"],
'v.label',
'', $param,
'', $sortfield, $sortorder);
625 $totalarray[
'nbfield']++;
627if ($arrayfields[
'datep'][
'checked']) {
628 print_liste_field_titre($arrayfields[
'datep'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datep,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
629 $totalarray[
'nbfield']++;
631if ($arrayfields[
'datev'][
'checked']) {
632 print_liste_field_titre($arrayfields[
'datev'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datev,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
633 $totalarray[
'nbfield']++;
635if ($arrayfields[
'type'][
'checked']) {
636 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
'type',
'', $param,
'', $sortfield, $sortorder,
'center ');
637 $totalarray[
'nbfield']++;
639if ($arrayfields[
'project'][
'checked']) {
640 print_liste_field_titre($arrayfields[
'project'][
'label'], $_SERVER[
"PHP_SELF"],
'fk_project',
'', $param,
'', $sortfield, $sortorder);
641 $totalarray[
'nbfield']++;
643if ($arrayfields[
'bank'][
'checked']) {
644 print_liste_field_titre($arrayfields[
'bank'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
645 $totalarray[
'nbfield']++;
647if ($arrayfields[
'entry'][
'checked']) {
648 print_liste_field_titre($arrayfields[
'entry'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
649 $totalarray[
'nbfield']++;
651if (!empty($arrayfields[
'account'][
'checked'])) {
653 print_liste_field_titre($arrayfields[
'account'][
'label'], $_SERVER[
"PHP_SELF"],
'v.accountancy_code',
'', $param,
'', $sortfield, $sortorder,
'left ');
654 $totalarray[
'nbfield']++;
656if (!empty($arrayfields[
'subledger'][
'checked'])) {
657 print_liste_field_titre($arrayfields[
'subledger'][
'label'], $_SERVER[
"PHP_SELF"],
'v.subledger_account',
'', $param,
'', $sortfield, $sortorder,
'left ');
658 $totalarray[
'nbfield']++;
660if ($arrayfields[
'debit'][
'checked']) {
661 print_liste_field_titre($arrayfields[
'debit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
662 $totalarray[
'nbfield']++;
664if ($arrayfields[
'credit'][
'checked']) {
665 print_liste_field_titre($arrayfields[
'credit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
666 $totalarray[
'nbfield']++;
669include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
671$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
672$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
673print $hookmanager->resPrint;
676 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
677 $totalarray[
'nbfield']++;
685$savnbfield = $totalarray[
'nbfield'];
686$totalarray = array();
687$totalarray[
'nbfield'] = 0;
688$totalarray[
'val'][
'total_cred'] = 0;
689$totalarray[
'val'][
'total_deb'] = 0;
690$imaxinloop = ($limit ? min($num, $limit) : $num);
691while ($i < $imaxinloop) {
692 $obj = $db->fetch_object($resql);
697 $variousstatic->id = $obj->rowid;
698 $variousstatic->ref = $obj->rowid;
699 $variousstatic->label = $obj->label;
700 $variousstatic->datep = $obj->datep;
701 $variousstatic->type_payment = $obj->payment_code;
702 $bankline->fetch($obj->fk_bank);
703 $variousstatic->fk_bank = $bankline->getNomUrl(1);
704 $variousstatic->amount = $obj->amount;
706 $accountingaccount->fetch(0, $obj->accountancy_code, 1);
707 $variousstatic->accountancy_code = $accountingaccount->getNomUrl(0, 0, 1, $obj->accountingaccount, 1);
709 if ($mode ==
'kanban') {
711 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
712 print
'<div class="box-flex-container kanban">';
715 print $variousstatic->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
716 if ($i == ($imaxinloop) - 1) {
723 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
728 $totalarray[
'nbfield']++;
734 print
'<td>'.(($offset * $limit) + $i).
'</td>';
738 if ($arrayfields[
'ref'][
'checked']) {
739 print
'<td>'.$variousstatic->getNomUrl(1).
"</td>";
741 $totalarray[
'nbfield']++;
746 if ($arrayfields[
'label'][
'checked']) {
747 print
'<td class="tdoverflowmax150" title="'.$variousstatic->label.
'">'.$variousstatic->label.
"</td>";
749 $totalarray[
'nbfield']++;
754 if ($arrayfields[
'datep'][
'checked']) {
755 print
'<td class="center">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>";
757 $totalarray[
'nbfield']++;
763 if ($arrayfields[
'datev'][
'checked']) {
764 print
'<td class="center">'.dol_print_date($db->jdate($obj->datev),
'day').
"</td>";
766 $totalarray[
'nbfield']++;
771 if ($arrayfields[
'type'][
'checked']) {
772 print
'<td class="center">';
773 if ($obj->payment_code) {
774 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
777 print $obj->num_payment;
780 $totalarray[
'nbfield']++;
785 if ($arrayfields[
'project'][
'checked']) {
786 print
'<td class="nowraponall">';
787 if ($obj->fk_project > 0 && is_object($proj)) {
788 $proj->fetch($obj->fk_project);
789 print $proj->getNomUrl(1);
793 $totalarray[
'nbfield']++;
798 if ($arrayfields[
'bank'][
'checked']) {
799 print
'<td class="nowraponall">';
801 $accountstatic->id = $obj->bid;
802 $accountstatic->ref = $obj->bref;
803 $accountstatic->number = $obj->bnumber;
805 if (isModEnabled(
'accounting')) {
806 $accountstatic->account_number = $obj->bank_account_number;
807 $accountingjournal->fetch($obj->accountancy_journal);
808 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
811 $accountstatic->label = $obj->blabel;
812 print $accountstatic->getNomUrl(1);
818 $totalarray[
'nbfield']++;
823 if ($arrayfields[
'entry'][
'checked']) {
824 $bankline->fetch($obj->fk_bank);
825 print
'<td>'.$bankline->getNomUrl(1).
'</td>';
827 $totalarray[
'nbfield']++;
832 if (!empty($arrayfields[
'account'][
'checked'])) {
833 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
834 $result = $accountingaccount->fetch(0, $obj->accountancy_code, 1);
836 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.
' '.$accountingaccount->label).
'">'.$accountingaccount->getNomUrl(0, 1, 1,
'', 1).
'</td>';
841 $totalarray[
'nbfield']++;
846 if (!empty($arrayfields[
'subledger'][
'checked'])) {
847 print
'<td class="tdoverflowmax150">'.length_accounta($obj->subledger_account).
'</td>';
849 $totalarray[
'nbfield']++;
854 if ($arrayfields[
'debit'][
'checked']) {
855 print
'<td class="nowrap right">';
856 if ($obj->sens == 0) {
857 print
'<span class="amount">'.price($obj->amount).
'</span>';
858 $totalarray[
'val'][
'total_deb'] += $obj->amount;
861 $totalarray[
'nbfield']++;
864 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_deb';
870 if ($arrayfields[
'credit'][
'checked']) {
871 print
'<td class="nowrap right">';
872 if ($obj->sens == 1) {
873 print
'<span class="amount">'.price($obj->amount).
'</span>';
874 $totalarray[
'val'][
'total_cred'] += $obj->amount;
877 $totalarray[
'nbfield']++;
880 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_cred';
888 $totalarray[
'nbfield']++;
898include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
903 foreach ($arrayfields as $key => $val) {
904 if (!empty($val[
'checked'])) {
908 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
913$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
914$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
915print $hookmanager->resPrint;
917print
'</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 accounts.
Class to manage accounting journals.
Class to manage various payments.
Class to manage projects.
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.
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.
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...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
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.