28require
'../../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
38$langs->loadLangs(array(
"compta",
"banks",
"bills",
"accountancy"));
40$optioncss =
GETPOST(
'optioncss',
'alpha');
41$mode =
GETPOST(
'mode',
'alpha');
42$massaction =
GETPOST(
'massaction',
'aZ09');
43$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'directdebitcredittransferlist';
45$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
46$search_ref =
GETPOST(
'search_ref',
'int');
47$search_user =
GETPOST(
'search_user',
'alpha');
48$search_label =
GETPOST(
'search_label',
'alpha');
49$search_datep_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
50$search_datep_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
51$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'));
52$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'));
53$search_amount_deb =
GETPOST(
'search_amount_deb',
'alpha');
54$search_amount_cred =
GETPOST(
'search_amount_cred',
'alpha');
55$search_bank_account =
GETPOST(
'search_account',
'int');
56$search_bank_entry =
GETPOST(
'search_bank_entry',
'int');
57$search_accountancy_account =
GETPOST(
"search_accountancy_account");
58if ($search_accountancy_account == - 1) {
59 $search_accountancy_account =
'';
61$search_accountancy_subledger =
GETPOST(
"search_accountancy_subledger");
62if ($search_accountancy_subledger == - 1) {
63 $search_accountancy_subledger =
'';
65if (empty($search_datep_start)) {
66 $search_datep_start =
GETPOST(
"search_datep_start",
'int');
68if (empty($search_datep_end)) {
69 $search_datep_end =
GETPOST(
"search_datep_end",
'int');
71if (empty($search_datev_start)) {
72 $search_datev_start =
GETPOST(
"search_datev_start",
'int');
74if (empty($search_datev_end)) {
75 $search_datev_end =
GETPOST(
"search_datev_end",
'int');
77$search_type_id =
GETPOST(
'search_type_id',
'int');
79$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
80$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
81$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
82if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
86$offset = $limit * $page;
94$hookmanager->initHooks(array($contextpage));
97$extrafields->fetch_name_optionals_label($object->table_element);
99$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
103 $sortfield =
"v.datep,v.rowid";
106 $sortorder =
"DESC,DESC";
109$filtre =
GETPOST(
"filtre",
'alpha');
111if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
114 $search_datep_start =
'';
115 $search_datep_end =
'';
116 $search_datev_start =
'';
117 $search_datev_end =
'';
118 $search_amount_deb =
'';
119 $search_amount_cred =
'';
120 $search_bank_account =
'';
121 $search_bank_entry =
'';
122 $search_accountancy_account =
'';
123 $search_accountancy_subledger =
'';
124 $search_type_id =
'';
127$search_all = GETPOSTISSET(
"search_all") ? trim(
GETPOST(
"search_all",
'alpha')) : trim(
GETPOST(
'sall'));
150$fieldstosearchall = array(
153 'v.datep'=>
"DatePayment",
154 'v.datev'=>
"DateValue",
155 'v.amount'=>$langs->trans(
"Debit").
", ".$langs->trans(
"Credit"),
160 'ref' =>array(
'label'=>
"Ref",
'checked'=>1,
'position'=>100),
161 'label' =>array(
'label'=>
"Label",
'checked'=>1,
'position'=>110),
162 'datep' =>array(
'label'=>
"DatePayment",
'checked'=>1,
'position'=>120),
163 'datev' =>array(
'label'=>
"DateValue",
'checked'=>-1,
'position'=>130),
164 'type' =>array(
'label'=>
"PaymentMode",
'checked'=>1,
'position'=>140),
165 'project' =>array(
'label'=>
"Project",
'checked'=>1,
'position'=>200,
"enabled"=>isModEnabled(
'project')),
166 'bank' =>array(
'label'=>
"BankAccount",
'checked'=>1,
'position'=>300,
"enabled"=>isModEnabled(
"banque")),
167 'entry' =>array(
'label'=>
"BankTransactionLine",
'checked'=>1,
'position'=>310,
"enabled"=>isModEnabled(
"banque")),
168 'account' =>array(
'label'=>
"AccountAccountingShort",
'checked'=>1,
'position'=>400,
"enabled"=>isModEnabled(
'accounting')),
169 'subledger' =>array(
'label'=>
"SubledgerAccount",
'checked'=>1,
'position'=>410,
"enabled"=>isModEnabled(
'accounting')),
170 'debit' =>array(
'label'=>
"Debit",
'checked'=>1,
'position'=>500),
171 'credit' =>array(
'label'=>
"Credit",
'checked'=>1,
'position'=>510),
177$socid =
GETPOST(
"socid",
"int");
179 $socid = $user->socid;
189if (
GETPOST(
'cancel',
'alpha')) {
193if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
197$parameters = array();
198$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
203if (empty($reshook)) {
205 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
208 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
209 foreach ($object->fields as $key => $val) {
211 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
212 $search[$key.
'_dtstart'] =
'';
213 $search[$key.
'_dtend'] =
'';
217 $search_array_options = array();
219 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
220 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
229$form =
new Form($db);
230if ($arrayfields[
'account'][
'checked'] || $arrayfields[
'subledger'][
'checked']) {
233if ($arrayfields[
'bank'][
'checked'] && isModEnabled(
'accounting')) {
236if ($arrayfields[
'ref'][
'checked']) {
239if ($arrayfields[
'bank'][
'checked']) {
240 $accountstatic =
new Account($db);
242if ($arrayfields[
'project'][
'checked']) {
245if ($arrayfields[
'entry'][
'checked']) {
248if ($arrayfields[
'account'][
'checked']) {
252$title = $langs->trans(
"VariousPayments");
259$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,";
260$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,";
261$sql .=
" pst.code as payment_code";
265$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as v";
266$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON v.fk_typepayment = pst.id";
267$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON v.fk_bank = b.rowid";
268$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
269$sql .=
" WHERE v.entity IN (".getEntity(
'payment_various').
")";
273 $sql .=
" AND v.rowid = ".((int) $search_ref);
278if ($search_datep_start) {
279 $sql .=
" AND v.datep >= '".$db->idate($search_datep_start).
"'";
281if ($search_datep_end) {
282 $sql .=
" AND v.datep <= '".$db->idate($search_datep_end).
"'";
284if ($search_datev_start) {
285 $sql .=
" AND v.datev >= '".$db->idate($search_datev_start).
"'";
287if ($search_datev_end) {
288 $sql .=
" AND v.datev <= '".$db->idate($search_datev_end).
"'";
290if ($search_amount_deb) {
293if ($search_amount_cred) {
296if ($search_bank_account > 0) {
297 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
299if ($search_bank_entry > 0) {
300 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
302if ($search_accountancy_account > 0) {
303 $sql .=
" AND v.accountancy_code = ".((int) $search_accountancy_account);
305if ($search_accountancy_subledger > 0) {
306 $sql .=
" AND v.subledger_account = ".((int) $search_accountancy_subledger);
308if ($search_type_id > 0) {
309 $sql .=
" AND v.fk_typepayment=".((int) $search_type_id);
312 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
316include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
318$parameters = array();
319$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
320$sql .= $hookmanager->resPrint;
323$nbtotalofrecords =
'';
326 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
327 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
328 $resql = $db->query($sqlforcount);
330 $objforcount = $db->fetch_object($resql);
331 $nbtotalofrecords = $objforcount->nbtotalofrecords;
336 if (($page * $limit) > $nbtotalofrecords) {
344$sql .= $db->order($sortfield, $sortorder);
346 $sql .= $db->plimit($limit + 1, $offset);
349$resql = $db->query($sql);
355$num = $db->num_rows($resql);
358if ($num == 1 && !
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
359 $obj = $db->fetch_object($resql);
361 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?id='.$id);
370$arrayofselected = is_array($toselect) ? $toselect : array();
374 $param .=
'&mode='.urlencode($mode);
376if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
377 $param .=
'&contextpage='.urlencode($contextpage);
379if ($limit > 0 && $limit != $conf->liste_limit) {
380 $param .=
'&limit='.((int) $limit);
382if ($optioncss !=
'') {
383 $param .=
'&optioncss='.urlencode($optioncss);
386 $param .=
'&search_ref='.urlencode($search_ref);
389 $param .=
'&search_label='.urlencode($search_label);
391if ($search_datep_start) {
392 $param .=
'&search_datep_start='.urlencode($search_datep_start);
394if ($search_datep_end) {
395 $param .=
'&search_datep_end='.urlencode($search_datep_end);
397if ($search_datev_start) {
398 $param .=
'&search_datev_start='.urlencode($search_datev_start);
400if ($search_datev_end) {
401 $param .=
'&search_datev_end='.urlencode($search_datev_end);
403if ($search_type_id > 0) {
404 $param .=
'&search_type_id='.urlencode($search_type_id);
406if ($search_amount_deb) {
407 $param .=
'&search_amount_deb='.urlencode($search_amount_deb);
409if ($search_amount_cred) {
410 $param .=
'&search_amount_cred='.urlencode($search_amount_cred);
412if ($search_bank_account > 0) {
413 $param .=
'&search_account='.urlencode($search_bank_account);
415if ($search_accountancy_account > 0) {
416 $param .=
'&search_accountancy_account='.urlencode($search_accountancy_account);
418if ($search_accountancy_subledger > 0) {
419 $param .=
'&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
422$url = DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?action=create';
424 $url .=
'&socid='.urlencode($socid);
428$arrayofmassactions = array();
429$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
431print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
432if ($optioncss !=
'') {
433 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
435print
'<input type="hidden" name="token" value="'.newToken().
'">';
436print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
437print
'<input type="hidden" name="action" value="list">';
438print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
439print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
440print
'<input type="hidden" name="page" value="'.$page.
'">';
441print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
442print
'<input type="hidden" name="page_y" value="">';
443print
'<input type="hidden" name="mode" value="'.$mode.
'">';
446$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'));
447$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'));
449$newcardbutton .=
dolGetButtonTitle($langs->trans(
'MenuNewVariousPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->banque->modifier);
451print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
455 foreach ($fieldstosearchall as $key => $val) {
456 $fieldstosearchall[$key] = $langs->trans($val);
457 $setupstring .= $key.
"=".$val.
";";
459 print
'<!-- Search done like if VARIOUSPAYMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
460 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
463$arrayofmassactions = array();
467$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
468$selectedfields = ($mode !=
'kanban' ? $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
'')) :
'');
469$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
472print
'<div class="div-table-responsive">';
473print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
477print
'<tr class="liste_titre_filter">';
480 print
'<td class="liste_titre center maxwidthsearch">';
481 $searchpicto = $form->showFilterButtons(
'left');
486if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
487 print
'<td class="liste_titre">';
492if ($arrayfields[
'ref'][
'checked']) {
493 print
'<td class="liste_titre left">';
494 print
'<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
499if ($arrayfields[
'label'][
'checked']) {
500 print
'<td class="liste_titre">';
501 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
506if ($arrayfields[
'datep'][
'checked']) {
507 print
'<td class="liste_titre center">';
508 print
'<div class="nowrap">';
509 print $form->selectDate($search_datep_start ? $search_datep_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
511 print
'<div class="nowrap">';
512 print $form->selectDate($search_datep_end ? $search_datep_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
518if ($arrayfields[
'datev'][
'checked']) {
519 print
'<td class="liste_titre center">';
520 print
'<div class="nowrap">';
521 print $form->selectDate($search_datev_start ? $search_datev_start : -1,
'search_date_value_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
523 print
'<div class="nowrap">';
524 print $form->selectDate($search_datev_end ? $search_datev_end : -1,
'search_date_value_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
530if ($arrayfields[
'type'][
'checked']) {
531 print
'<td class="liste_titre center">';
532 print $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'maxwidth100', 1);
537if ($arrayfields[
'project'][
'checked']) {
538 print
'<td class="liste_titre">';
544if ($arrayfields[
'bank'][
'checked']) {
545 print
'<td class="liste_titre">';
546 $form->select_comptes($search_bank_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
551if ($arrayfields[
'entry'][
'checked']) {
552 print
'<td class="liste_titre left">';
553 print
'<input name="search_bank_entry" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_bank_entry).
'">';
558if (!empty($arrayfields[
'account'][
'checked'])) {
559 print
'<td class="liste_titre">';
560 print
'<div class="nowrap">';
561 print $formaccounting->select_account($search_accountancy_account,
'search_accountancy_account', 1, array(), 1, 1,
'maxwidth200');
567if (!empty($arrayfields[
'subledger'][
'checked'])) {
568 print
'<td class="liste_titre">';
569 print
'<div class="nowrap">';
570 print $formaccounting->select_auxaccount($search_accountancy_subledger,
'search_accountancy_subledger', 1,
'maxwidth200');
576if (!empty($arrayfields[
'debit'][
'checked'])) {
577 print
'<td class="liste_titre right">';
578 print
'<input name="search_amount_deb" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_amount_deb).
'">';
583if ($arrayfields[
'credit'][
'checked']) {
584 print
'<td class="liste_titre right">';
585 print
'<input name="search_amount_cred" class="flat maxwidth50" type="text" size="8" value="'.dol_escape_htmltag($search_amount_cred).
'">';
590 print
'<td class="liste_titre center maxwidthsearch">';
591 $searchpicto = $form->showFilterButtons();
598$totalarray = array();
599$totalarray[
'nbfield'] = 0;
603print
'<tr class="liste_titre">';
606 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
607 $totalarray[
'nbfield']++;
609if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
611 $totalarray[
'nbfield']++;
614if ($arrayfields[
'ref'][
'checked']) {
615 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
'v.rowid',
'', $param,
'', $sortfield, $sortorder);
616 $totalarray[
'nbfield']++;
618if ($arrayfields[
'label'][
'checked']) {
619 print_liste_field_titre($arrayfields[
'label'][
'label'], $_SERVER[
"PHP_SELF"],
'v.label',
'', $param,
'', $sortfield, $sortorder);
620 $totalarray[
'nbfield']++;
622if ($arrayfields[
'datep'][
'checked']) {
623 print_liste_field_titre($arrayfields[
'datep'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datep,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
624 $totalarray[
'nbfield']++;
626if ($arrayfields[
'datev'][
'checked']) {
627 print_liste_field_titre($arrayfields[
'datev'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datev,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
628 $totalarray[
'nbfield']++;
630if ($arrayfields[
'type'][
'checked']) {
631 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
'type',
'', $param,
'', $sortfield, $sortorder,
'center ');
632 $totalarray[
'nbfield']++;
634if ($arrayfields[
'project'][
'checked']) {
635 print_liste_field_titre($arrayfields[
'project'][
'label'], $_SERVER[
"PHP_SELF"],
'fk_project',
'', $param,
'', $sortfield, $sortorder);
636 $totalarray[
'nbfield']++;
638if ($arrayfields[
'bank'][
'checked']) {
639 print_liste_field_titre($arrayfields[
'bank'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
640 $totalarray[
'nbfield']++;
642if ($arrayfields[
'entry'][
'checked']) {
643 print_liste_field_titre($arrayfields[
'entry'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
644 $totalarray[
'nbfield']++;
646if (!empty($arrayfields[
'account'][
'checked'])) {
647 print_liste_field_titre($arrayfields[
'account'][
'label'], $_SERVER[
"PHP_SELF"],
'v.accountancy_code',
'', $param,
'', $sortfield, $sortorder,
'left ');
648 $totalarray[
'nbfield']++;
650if (!empty($arrayfields[
'subledger'][
'checked'])) {
651 print_liste_field_titre($arrayfields[
'subledger'][
'label'], $_SERVER[
"PHP_SELF"],
'v.subledger_account',
'', $param,
'', $sortfield, $sortorder,
'left ');
652 $totalarray[
'nbfield']++;
654if ($arrayfields[
'debit'][
'checked']) {
655 print_liste_field_titre($arrayfields[
'debit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
656 $totalarray[
'nbfield']++;
658if ($arrayfields[
'credit'][
'checked']) {
659 print_liste_field_titre($arrayfields[
'credit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
660 $totalarray[
'nbfield']++;
663include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
665$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
666$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
667print $hookmanager->resPrint;
670 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
671 $totalarray[
'nbfield']++;
679$savnbfield = $totalarray[
'nbfield'];
680$totalarray = array();
681$totalarray[
'nbfield'] = 0;
682$totalarray[
'val'][
'total_cred'] = 0;
683$totalarray[
'val'][
'total_deb'] = 0;
684$imaxinloop = ($limit ? min($num, $limit) : $num);
685while ($i < $imaxinloop) {
686 $obj = $db->fetch_object($resql);
691 $variousstatic->id = $obj->rowid;
692 $variousstatic->ref = $obj->rowid;
693 $variousstatic->label = $obj->label;
694 $variousstatic->datep = $obj->datep;
695 $variousstatic->type_payment = $obj->payment_code;
696 $bankline->fetch($obj->fk_bank);
697 $variousstatic->fk_bank = $bankline->getNomUrl(1);
698 $variousstatic->amount = $obj->amount;
700 $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
701 $variousstatic->accountancy_code = $accountingaccount->getNomUrl(0, 0, 1, $obj->accountingaccount, 1);
703 if ($mode ==
'kanban') {
705 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
706 print
'<div class="box-flex-container kanban">';
709 print $variousstatic->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
710 if ($i == ($imaxinloop) - 1) {
717 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
722 $totalarray[
'nbfield']++;
727 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
728 print
'<td>'.(($offset * $limit) + $i).
'</td>';
732 if ($arrayfields[
'ref'][
'checked']) {
733 print
'<td>'.$variousstatic->getNomUrl(1).
"</td>";
735 $totalarray[
'nbfield']++;
740 if ($arrayfields[
'label'][
'checked']) {
741 print
'<td class="tdoverflowmax150" title="'.$variousstatic->label.
'">'.$variousstatic->label.
"</td>";
743 $totalarray[
'nbfield']++;
748 if ($arrayfields[
'datep'][
'checked']) {
749 print
'<td class="center">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>";
751 $totalarray[
'nbfield']++;
757 if ($arrayfields[
'datev'][
'checked']) {
758 print
'<td class="center">'.dol_print_date($db->jdate($obj->datev),
'day').
"</td>";
760 $totalarray[
'nbfield']++;
765 if ($arrayfields[
'type'][
'checked']) {
766 print
'<td class="center">';
767 if ($obj->payment_code) {
768 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
771 print $obj->num_payment;
774 $totalarray[
'nbfield']++;
779 if ($arrayfields[
'project'][
'checked']) {
780 print
'<td class="nowraponall">';
781 if ($obj->fk_project > 0) {
782 $proj->fetch($obj->fk_project);
783 print $proj->getNomUrl(1);
787 $totalarray[
'nbfield']++;
792 if ($arrayfields[
'bank'][
'checked']) {
793 print
'<td class="nowraponall">';
795 $accountstatic->id = $obj->bid;
796 $accountstatic->ref = $obj->bref;
797 $accountstatic->number = $obj->bnumber;
799 if (isModEnabled(
'accounting')) {
800 $accountstatic->account_number = $obj->bank_account_number;
801 $accountingjournal->fetch($obj->accountancy_journal);
802 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
805 $accountstatic->label = $obj->blabel;
806 print $accountstatic->getNomUrl(1);
812 $totalarray[
'nbfield']++;
817 if ($arrayfields[
'entry'][
'checked']) {
818 $bankline->fetch($obj->fk_bank);
819 print
'<td>'.$bankline->getNomUrl(1).
'</td>';
821 $totalarray[
'nbfield']++;
826 if (!empty($arrayfields[
'account'][
'checked'])) {
827 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
828 $result = $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
830 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.
' '.$accountingaccount->label).
'">'.$accountingaccount->getNomUrl(0, 1, 1,
'', 1).
'</td>';
835 $totalarray[
'nbfield']++;
840 if (!empty($arrayfields[
'subledger'][
'checked'])) {
841 print
'<td class="tdoverflowmax150">'.length_accounta($obj->subledger_account).
'</td>';
843 $totalarray[
'nbfield']++;
848 if ($arrayfields[
'debit'][
'checked']) {
849 print
'<td class="nowrap right">';
850 if ($obj->sens == 0) {
851 print
'<span class="amount">'.price($obj->amount).
'</span>';
852 $totalarray[
'val'][
'total_deb'] += $obj->amount;
855 $totalarray[
'nbfield']++;
858 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_deb';
864 if ($arrayfields[
'credit'][
'checked']) {
865 print
'<td class="nowrap right">';
866 if ($obj->sens == 1) {
867 print
'<span class="amount">'.price($obj->amount).
'</span>';
868 $totalarray[
'val'][
'total_cred'] += $obj->amount;
871 $totalarray[
'nbfield']++;
874 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_cred';
882 $totalarray[
'nbfield']++;
892include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
897 foreach ($arrayfields as $key => $val) {
898 if (!empty($val[
'checked'])) {
902 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
907$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
908$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
909print $hookmanager->resPrint;
911print
'</table>'.
"\n";
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage accounting accounts.
Class to manage accounting accounts.
Class to manage various payments.
Class to manage projects.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
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.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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.