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);
233if ($arrayfields[
'account'][
'checked'] || $arrayfields[
'subledger'][
'checked']) {
236if ($arrayfields[
'bank'][
'checked'] && isModEnabled(
'accounting')) {
239if ($arrayfields[
'ref'][
'checked']) {
242if ($arrayfields[
'bank'][
'checked']) {
243 $accountstatic =
new Account($db);
245if ($arrayfields[
'project'][
'checked']) {
248if ($arrayfields[
'entry'][
'checked']) {
251if ($arrayfields[
'account'][
'checked']) {
255$title = $langs->trans(
"VariousPayments");
262$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,";
263$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,";
264$sql .=
" pst.code as payment_code";
268$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as v";
269$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON v.fk_typepayment = pst.id";
270$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON v.fk_bank = b.rowid";
271$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
272$sql .=
" WHERE v.entity IN (".getEntity(
'payment_various').
")";
276 $sql .=
" AND v.rowid = ".((int) $search_ref);
281if ($search_datep_start) {
282 $sql .=
" AND v.datep >= '".$db->idate($search_datep_start).
"'";
284if ($search_datep_end) {
285 $sql .=
" AND v.datep <= '".$db->idate($search_datep_end).
"'";
287if ($search_datev_start) {
288 $sql .=
" AND v.datev >= '".$db->idate($search_datev_start).
"'";
290if ($search_datev_end) {
291 $sql .=
" AND v.datev <= '".$db->idate($search_datev_end).
"'";
293if ($search_amount_deb) {
296if ($search_amount_cred) {
299if ($search_bank_account > 0) {
300 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
302if ($search_bank_entry > 0) {
303 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
305if ($search_accountancy_account > 0) {
306 $sql .=
" AND v.accountancy_code = ".((int) $search_accountancy_account);
308if ($search_accountancy_subledger > 0) {
309 $sql .=
" AND v.subledger_account = ".((int) $search_accountancy_subledger);
311if ($search_type_id > 0) {
312 $sql .=
" AND v.fk_typepayment=".((int) $search_type_id);
315 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
319include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
321$parameters = array();
322$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
323$sql .= $hookmanager->resPrint;
326$nbtotalofrecords =
'';
329 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
330 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
331 $resql = $db->query($sqlforcount);
333 $objforcount = $db->fetch_object($resql);
334 $nbtotalofrecords = $objforcount->nbtotalofrecords;
339 if (($page * $limit) > $nbtotalofrecords) {
347$sql .= $db->order($sortfield, $sortorder);
349 $sql .= $db->plimit($limit + 1, $offset);
352$resql = $db->query($sql);
358$num = $db->num_rows($resql);
361if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
362 $obj = $db->fetch_object($resql);
364 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?id='.$id);
371llxHeader(
'', $title, $help_url, 0, 0,
'',
'',
'',
'bodyforlist');
373$arrayofselected = is_array($toselect) ? $toselect : array();
377 $param .=
'&mode='.urlencode($mode);
379if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
380 $param .=
'&contextpage='.urlencode($contextpage);
382if ($limit > 0 && $limit != $conf->liste_limit) {
383 $param .=
'&limit='.((int) $limit);
385if ($optioncss !=
'') {
386 $param .=
'&optioncss='.urlencode($optioncss);
389 $param .=
'&search_ref='.urlencode($search_ref);
392 $param .=
'&search_label='.urlencode($search_label);
394if ($search_datep_start) {
395 $param .=
'&search_datep_start='.urlencode($search_datep_start);
397if ($search_datep_end) {
398 $param .=
'&search_datep_end='.urlencode($search_datep_end);
400if ($search_datev_start) {
401 $param .=
'&search_datev_start='.urlencode($search_datev_start);
403if ($search_datev_end) {
404 $param .=
'&search_datev_end='.urlencode($search_datev_end);
406if ($search_type_id > 0) {
407 $param .=
'&search_type_id='.urlencode((
string) ($search_type_id));
409if ($search_amount_deb) {
410 $param .=
'&search_amount_deb='.urlencode($search_amount_deb);
412if ($search_amount_cred) {
413 $param .=
'&search_amount_cred='.urlencode($search_amount_cred);
415if ($search_bank_account > 0) {
416 $param .=
'&search_account='.urlencode((
string) ($search_bank_account));
418if ($search_accountancy_account > 0) {
419 $param .=
'&search_accountancy_account='.urlencode($search_accountancy_account);
421if ($search_accountancy_subledger > 0) {
422 $param .=
'&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
425$url = DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?action=create';
427 $url .=
'&socid='.urlencode((
string) ($socid));
431$arrayofmassactions = array();
432$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
434print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
435if ($optioncss !=
'') {
436 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
438print
'<input type="hidden" name="token" value="'.newToken().
'">';
439print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
440print
'<input type="hidden" name="action" value="list">';
441print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
442print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
443print
'<input type="hidden" name="page" value="'.$page.
'">';
444print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
445print
'<input type="hidden" name="page_y" value="">';
446print
'<input type="hidden" name="mode" value="'.$mode.
'">';
449$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'));
450$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'));
452$newcardbutton .=
dolGetButtonTitle($langs->trans(
'MenuNewVariousPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'banque',
'modifier'));
454print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
458 foreach ($fieldstosearchall as $key => $val) {
459 $fieldstosearchall[$key] = $langs->trans($val);
460 $setupstring .= $key.
"=".$val.
";";
462 print
'<!-- Search done like if VARIOUSPAYMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
463 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
466$arrayofmassactions = array();
470$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
471$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
472$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
473$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
476print
'<div class="div-table-responsive">';
477print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
481print
'<tr class="liste_titre_filter">';
484 print
'<td class="liste_titre center maxwidthsearch">';
485 $searchpicto = $form->showFilterButtons(
'left');
491 print
'<td class="liste_titre">';
496if ($arrayfields[
'ref'][
'checked']) {
497 print
'<td class="liste_titre left">';
498 print
'<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
503if ($arrayfields[
'label'][
'checked']) {
504 print
'<td class="liste_titre">';
505 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
510if ($arrayfields[
'datep'][
'checked']) {
511 print
'<td class="liste_titre center">';
512 print
'<div class="nowrapfordate">';
513 print $form->selectDate($search_datep_start ? $search_datep_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
515 print
'<div class="nowrapfordate">';
516 print $form->selectDate($search_datep_end ? $search_datep_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
522if ($arrayfields[
'datev'][
'checked']) {
523 print
'<td class="liste_titre center">';
524 print
'<div class="nowrapfordate">';
525 print $form->selectDate($search_datev_start ? $search_datev_start : -1,
'search_date_value_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
527 print
'<div class="nowrapfordate">';
528 print $form->selectDate($search_datev_end ? $search_datev_end : -1,
'search_date_value_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
534if ($arrayfields[
'type'][
'checked']) {
535 print
'<td class="liste_titre center">';
536 print $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'maxwidth100', 1);
541if ($arrayfields[
'project'][
'checked']) {
542 print
'<td class="liste_titre">';
548if ($arrayfields[
'bank'][
'checked']) {
549 print
'<td class="liste_titre">';
550 $form->select_comptes($search_bank_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
555if ($arrayfields[
'entry'][
'checked']) {
556 print
'<td class="liste_titre left">';
557 print
'<input name="search_bank_entry" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_bank_entry).
'">';
562if (!empty($arrayfields[
'account'][
'checked'])) {
563 print
'<td class="liste_titre">';
564 print
'<div class="nowrap">';
565 print $formaccounting->select_account($search_accountancy_account,
'search_accountancy_account', 1, array(), 1, 1,
'maxwidth200');
571if (!empty($arrayfields[
'subledger'][
'checked'])) {
572 print
'<td class="liste_titre">';
573 print
'<div class="nowrap">';
574 print $formaccounting->select_auxaccount($search_accountancy_subledger,
'search_accountancy_subledger', 1,
'maxwidth200');
580if (!empty($arrayfields[
'debit'][
'checked'])) {
581 print
'<td class="liste_titre right">';
582 print
'<input name="search_amount_deb" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_amount_deb).
'">';
587if ($arrayfields[
'credit'][
'checked']) {
588 print
'<td class="liste_titre right">';
589 print
'<input name="search_amount_cred" class="flat maxwidth50" type="text" size="8" value="'.dol_escape_htmltag($search_amount_cred).
'">';
594 print
'<td class="liste_titre center maxwidthsearch">';
595 $searchpicto = $form->showFilterButtons();
602$totalarray = array();
603$totalarray[
'nbfield'] = 0;
607print
'<tr class="liste_titre">';
610 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
611 $totalarray[
'nbfield']++;
615 $totalarray[
'nbfield']++;
618if ($arrayfields[
'ref'][
'checked']) {
619 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
'v.rowid',
'', $param,
'', $sortfield, $sortorder);
620 $totalarray[
'nbfield']++;
622if ($arrayfields[
'label'][
'checked']) {
623 print_liste_field_titre($arrayfields[
'label'][
'label'], $_SERVER[
"PHP_SELF"],
'v.label',
'', $param,
'', $sortfield, $sortorder);
624 $totalarray[
'nbfield']++;
626if ($arrayfields[
'datep'][
'checked']) {
627 print_liste_field_titre($arrayfields[
'datep'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datep,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
628 $totalarray[
'nbfield']++;
630if ($arrayfields[
'datev'][
'checked']) {
631 print_liste_field_titre($arrayfields[
'datev'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datev,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
632 $totalarray[
'nbfield']++;
634if ($arrayfields[
'type'][
'checked']) {
635 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
'type',
'', $param,
'', $sortfield, $sortorder,
'center ');
636 $totalarray[
'nbfield']++;
638if ($arrayfields[
'project'][
'checked']) {
639 print_liste_field_titre($arrayfields[
'project'][
'label'], $_SERVER[
"PHP_SELF"],
'fk_project',
'', $param,
'', $sortfield, $sortorder);
640 $totalarray[
'nbfield']++;
642if ($arrayfields[
'bank'][
'checked']) {
643 print_liste_field_titre($arrayfields[
'bank'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
644 $totalarray[
'nbfield']++;
646if ($arrayfields[
'entry'][
'checked']) {
647 print_liste_field_titre($arrayfields[
'entry'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
648 $totalarray[
'nbfield']++;
650if (!empty($arrayfields[
'account'][
'checked'])) {
651 print_liste_field_titre($arrayfields[
'account'][
'label'], $_SERVER[
"PHP_SELF"],
'v.accountancy_code',
'', $param,
'', $sortfield, $sortorder,
'left ');
652 $totalarray[
'nbfield']++;
654if (!empty($arrayfields[
'subledger'][
'checked'])) {
655 print_liste_field_titre($arrayfields[
'subledger'][
'label'], $_SERVER[
"PHP_SELF"],
'v.subledger_account',
'', $param,
'', $sortfield, $sortorder,
'left ');
656 $totalarray[
'nbfield']++;
658if ($arrayfields[
'debit'][
'checked']) {
659 print_liste_field_titre($arrayfields[
'debit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
660 $totalarray[
'nbfield']++;
662if ($arrayfields[
'credit'][
'checked']) {
663 print_liste_field_titre($arrayfields[
'credit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
664 $totalarray[
'nbfield']++;
667include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
669$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
670$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
671print $hookmanager->resPrint;
674 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
675 $totalarray[
'nbfield']++;
683$savnbfield = $totalarray[
'nbfield'];
684$totalarray = array();
685$totalarray[
'nbfield'] = 0;
686$totalarray[
'val'][
'total_cred'] = 0;
687$totalarray[
'val'][
'total_deb'] = 0;
688$imaxinloop = ($limit ? min($num, $limit) : $num);
689while ($i < $imaxinloop) {
690 $obj = $db->fetch_object($resql);
695 $variousstatic->id = $obj->rowid;
696 $variousstatic->ref = $obj->rowid;
697 $variousstatic->label = $obj->label;
698 $variousstatic->datep = $obj->datep;
699 $variousstatic->type_payment = $obj->payment_code;
700 $bankline->fetch($obj->fk_bank);
701 $variousstatic->fk_bank = $bankline->getNomUrl(1);
702 $variousstatic->amount = $obj->amount;
704 $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
705 $variousstatic->accountancy_code = $accountingaccount->getNomUrl(0, 0, 1, $obj->accountingaccount, 1);
707 if ($mode ==
'kanban') {
709 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
710 print
'<div class="box-flex-container kanban">';
713 print $variousstatic->getKanbanView(
'', array(
'selected' => in_array(
$object->id, $arrayofselected)));
714 if ($i == ($imaxinloop) - 1) {
721 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
726 $totalarray[
'nbfield']++;
732 print
'<td>'.(($offset * $limit) + $i).
'</td>';
736 if ($arrayfields[
'ref'][
'checked']) {
737 print
'<td>'.$variousstatic->getNomUrl(1).
"</td>";
739 $totalarray[
'nbfield']++;
744 if ($arrayfields[
'label'][
'checked']) {
745 print
'<td class="tdoverflowmax150" title="'.$variousstatic->label.
'">'.$variousstatic->label.
"</td>";
747 $totalarray[
'nbfield']++;
752 if ($arrayfields[
'datep'][
'checked']) {
753 print
'<td class="center">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>";
755 $totalarray[
'nbfield']++;
761 if ($arrayfields[
'datev'][
'checked']) {
762 print
'<td class="center">'.dol_print_date($db->jdate($obj->datev),
'day').
"</td>";
764 $totalarray[
'nbfield']++;
769 if ($arrayfields[
'type'][
'checked']) {
770 print
'<td class="center">';
771 if ($obj->payment_code) {
772 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
775 print $obj->num_payment;
778 $totalarray[
'nbfield']++;
783 if ($arrayfields[
'project'][
'checked']) {
784 print
'<td class="nowraponall">';
785 if ($obj->fk_project > 0) {
786 $proj->fetch($obj->fk_project);
787 print $proj->getNomUrl(1);
791 $totalarray[
'nbfield']++;
796 if ($arrayfields[
'bank'][
'checked']) {
797 print
'<td class="nowraponall">';
799 $accountstatic->id = $obj->bid;
800 $accountstatic->ref = $obj->bref;
801 $accountstatic->number = $obj->bnumber;
803 if (isModEnabled(
'accounting')) {
804 $accountstatic->account_number = $obj->bank_account_number;
805 $accountingjournal->fetch($obj->accountancy_journal);
806 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
809 $accountstatic->label = $obj->blabel;
810 print $accountstatic->getNomUrl(1);
816 $totalarray[
'nbfield']++;
821 if ($arrayfields[
'entry'][
'checked']) {
822 $bankline->fetch($obj->fk_bank);
823 print
'<td>'.$bankline->getNomUrl(1).
'</td>';
825 $totalarray[
'nbfield']++;
830 if (!empty($arrayfields[
'account'][
'checked'])) {
831 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
832 $result = $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
834 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.
' '.$accountingaccount->label).
'">'.$accountingaccount->getNomUrl(0, 1, 1,
'', 1).
'</td>';
839 $totalarray[
'nbfield']++;
844 if (!empty($arrayfields[
'subledger'][
'checked'])) {
845 print
'<td class="tdoverflowmax150">'.length_accounta($obj->subledger_account).
'</td>';
847 $totalarray[
'nbfield']++;
852 if ($arrayfields[
'debit'][
'checked']) {
853 print
'<td class="nowrap right">';
854 if ($obj->sens == 0) {
855 print
'<span class="amount">'.price($obj->amount).
'</span>';
856 $totalarray[
'val'][
'total_deb'] += $obj->amount;
859 $totalarray[
'nbfield']++;
862 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_deb';
868 if ($arrayfields[
'credit'][
'checked']) {
869 print
'<td class="nowrap right">';
870 if ($obj->sens == 1) {
871 print
'<span class="amount">'.price($obj->amount).
'</span>';
872 $totalarray[
'val'][
'total_cred'] += $obj->amount;
875 $totalarray[
'nbfield']++;
878 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_cred';
886 $totalarray[
'nbfield']++;
896include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
901 foreach ($arrayfields as $key => $val) {
902 if (!empty($val[
'checked'])) {
906 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
911$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
912$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
913print $hookmanager->resPrint;
915print
'</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()
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...
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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 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.