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$toselect =
GETPOST(
'toselect',
'array');
44$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'directdebitcredittransferlist';
46$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
47$search_ref =
GETPOST(
'search_ref',
'int');
48$search_user =
GETPOST(
'search_user',
'alpha');
49$search_label =
GETPOST(
'search_label',
'alpha');
50$search_datep_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
51$search_datep_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
52$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'));
53$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'));
54$search_amount_deb =
GETPOST(
'search_amount_deb',
'alpha');
55$search_amount_cred =
GETPOST(
'search_amount_cred',
'alpha');
56$search_bank_account =
GETPOST(
'search_account',
'int');
57$search_bank_entry =
GETPOST(
'search_bank_entry',
'int');
58$search_accountancy_account =
GETPOST(
"search_accountancy_account");
59if ($search_accountancy_account == - 1) {
60 $search_accountancy_account =
'';
62$search_accountancy_subledger =
GETPOST(
"search_accountancy_subledger");
63if ($search_accountancy_subledger == - 1) {
64 $search_accountancy_subledger =
'';
66if (empty($search_datep_start)) {
67 $search_datep_start =
GETPOST(
"search_datep_start",
'int');
69if (empty($search_datep_end)) {
70 $search_datep_end =
GETPOST(
"search_datep_end",
'int');
72if (empty($search_datev_start)) {
73 $search_datev_start =
GETPOST(
"search_datev_start",
'int');
75if (empty($search_datev_end)) {
76 $search_datev_end =
GETPOST(
"search_datev_end",
'int');
78$search_type_id =
GETPOST(
'search_type_id',
'int');
80$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
81$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
82$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
83if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
87$offset = $limit * $page;
95$hookmanager->initHooks(array($contextpage));
98$extrafields->fetch_name_optionals_label($object->table_element);
100$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
104 $sortfield =
"v.datep,v.rowid";
107 $sortorder =
"DESC,DESC";
110$filtre =
GETPOST(
"filtre",
'alpha');
112if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
115 $search_datep_start =
'';
116 $search_datep_end =
'';
117 $search_datev_start =
'';
118 $search_datev_end =
'';
119 $search_amount_deb =
'';
120 $search_amount_cred =
'';
121 $search_bank_account =
'';
122 $search_bank_entry =
'';
123 $search_accountancy_account =
'';
124 $search_accountancy_subledger =
'';
125 $search_type_id =
'';
128$search_all = GETPOSTISSET(
"search_all") ? trim(
GETPOST(
"search_all",
'alpha')) : trim(
GETPOST(
'sall'));
151$fieldstosearchall = array(
154 'v.datep'=>
"DatePayment",
155 'v.datev'=>
"DateValue",
156 'v.amount'=>$langs->trans(
"Debit").
", ".$langs->trans(
"Credit"),
161 'ref' =>array(
'label'=>
"Ref",
'checked'=>1,
'position'=>100),
162 'label' =>array(
'label'=>
"Label",
'checked'=>1,
'position'=>110),
163 'datep' =>array(
'label'=>
"DatePayment",
'checked'=>1,
'position'=>120),
164 'datev' =>array(
'label'=>
"DateValue",
'checked'=>-1,
'position'=>130),
165 'type' =>array(
'label'=>
"PaymentMode",
'checked'=>1,
'position'=>140),
166 'project' =>array(
'label'=>
"Project",
'checked'=>1,
'position'=>200,
"enabled"=>isModEnabled(
'project')),
167 'bank' =>array(
'label'=>
"BankAccount",
'checked'=>1,
'position'=>300,
"enabled"=>isModEnabled(
"banque")),
168 'entry' =>array(
'label'=>
"BankTransactionLine",
'checked'=>1,
'position'=>310,
"enabled"=>isModEnabled(
"banque")),
169 'account' =>array(
'label'=>
"AccountAccountingShort",
'checked'=>1,
'position'=>400,
"enabled"=>isModEnabled(
'accounting')),
170 'subledger' =>array(
'label'=>
"SubledgerAccount",
'checked'=>1,
'position'=>410,
"enabled"=>isModEnabled(
'accounting')),
171 'debit' =>array(
'label'=>
"Debit",
'checked'=>1,
'position'=>500),
172 'credit' =>array(
'label'=>
"Credit",
'checked'=>1,
'position'=>510),
178$socid =
GETPOST(
"socid",
"int");
180 $socid = $user->socid;
190if (
GETPOST(
'cancel',
'alpha')) {
194if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
198$parameters = array();
199$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
204if (empty($reshook)) {
206 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
209 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
210 foreach ($object->fields as $key => $val) {
212 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
213 $search[$key.
'_dtstart'] =
'';
214 $search[$key.
'_dtend'] =
'';
218 $search_array_options = array();
220 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
221 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
230$form =
new Form($db);
231if ($arrayfields[
'account'][
'checked'] || $arrayfields[
'subledger'][
'checked']) {
234if ($arrayfields[
'bank'][
'checked'] && isModEnabled(
'accounting')) {
237if ($arrayfields[
'ref'][
'checked']) {
240if ($arrayfields[
'bank'][
'checked']) {
241 $accountstatic =
new Account($db);
243if ($arrayfields[
'project'][
'checked']) {
246if ($arrayfields[
'entry'][
'checked']) {
249if ($arrayfields[
'account'][
'checked']) {
253$title = $langs->trans(
"VariousPayments");
260$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,";
261$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,";
262$sql .=
" pst.code as payment_code";
266$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as v";
267$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON v.fk_typepayment = pst.id";
268$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON v.fk_bank = b.rowid";
269$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
270$sql .=
" WHERE v.entity IN (".getEntity(
'payment_various').
")";
274 $sql .=
" AND v.rowid = ".((int) $search_ref);
279if ($search_datep_start) {
280 $sql .=
" AND v.datep >= '".$db->idate($search_datep_start).
"'";
282if ($search_datep_end) {
283 $sql .=
" AND v.datep <= '".$db->idate($search_datep_end).
"'";
285if ($search_datev_start) {
286 $sql .=
" AND v.datev >= '".$db->idate($search_datev_start).
"'";
288if ($search_datev_end) {
289 $sql .=
" AND v.datev <= '".$db->idate($search_datev_end).
"'";
291if ($search_amount_deb) {
294if ($search_amount_cred) {
297if ($search_bank_account > 0) {
298 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
300if ($search_bank_entry > 0) {
301 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
303if ($search_accountancy_account > 0) {
304 $sql .=
" AND v.accountancy_code = ".((int) $search_accountancy_account);
306if ($search_accountancy_subledger > 0) {
307 $sql .=
" AND v.subledger_account = ".((int) $search_accountancy_subledger);
309if ($search_type_id > 0) {
310 $sql .=
" AND v.fk_typepayment=".((int) $search_type_id);
313 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
317include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
319$parameters = array();
320$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
321$sql .= $hookmanager->resPrint;
324$nbtotalofrecords =
'';
327 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
328 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
329 $resql = $db->query($sqlforcount);
331 $objforcount = $db->fetch_object($resql);
332 $nbtotalofrecords = $objforcount->nbtotalofrecords;
337 if (($page * $limit) > $nbtotalofrecords) {
345$sql .= $db->order($sortfield, $sortorder);
347 $sql .= $db->plimit($limit + 1, $offset);
350$resql = $db->query($sql);
356$num = $db->num_rows($resql);
359if ($num == 1 && !
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
360 $obj = $db->fetch_object($resql);
362 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?id='.$id);
371$arrayofselected = is_array($toselect) ? $toselect : array();
375 $param .=
'&mode='.urlencode($mode);
377if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
378 $param .=
'&contextpage='.urlencode($contextpage);
380if ($limit > 0 && $limit != $conf->liste_limit) {
381 $param .=
'&limit='.((int) $limit);
383if ($optioncss !=
'') {
384 $param .=
'&optioncss='.urlencode($optioncss);
387 $param .=
'&search_ref='.urlencode($search_ref);
390 $param .=
'&search_label='.urlencode($search_label);
392if ($search_datep_start) {
393 $param .=
'&search_datep_start='.urlencode($search_datep_start);
395if ($search_datep_end) {
396 $param .=
'&search_datep_end='.urlencode($search_datep_end);
398if ($search_datev_start) {
399 $param .=
'&search_datev_start='.urlencode($search_datev_start);
401if ($search_datev_end) {
402 $param .=
'&search_datev_end='.urlencode($search_datev_end);
404if ($search_type_id > 0) {
405 $param .=
'&search_type_id='.urlencode($search_type_id);
407if ($search_amount_deb) {
408 $param .=
'&search_amount_deb='.urlencode($search_amount_deb);
410if ($search_amount_cred) {
411 $param .=
'&search_amount_cred='.urlencode($search_amount_cred);
413if ($search_bank_account > 0) {
414 $param .=
'&search_account='.urlencode($search_bank_account);
416if ($search_accountancy_account > 0) {
417 $param .=
'&search_accountancy_account='.urlencode($search_accountancy_account);
419if ($search_accountancy_subledger > 0) {
420 $param .=
'&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
423$url = DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?action=create';
425 $url .=
'&socid='.urlencode($socid);
429$arrayofmassactions = array();
430$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
432print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
433if ($optioncss !=
'') {
434 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
436print
'<input type="hidden" name="token" value="'.newToken().
'">';
437print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
438print
'<input type="hidden" name="action" value="list">';
439print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
440print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
441print
'<input type="hidden" name="page" value="'.$page.
'">';
442print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
443print
'<input type="hidden" name="page_y" value="">';
444print
'<input type="hidden" name="mode" value="'.$mode.
'">';
447$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'));
448$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'));
450$newcardbutton .=
dolGetButtonTitle($langs->trans(
'MenuNewVariousPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'banque',
'modifier'));
452print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
456 foreach ($fieldstosearchall as $key => $val) {
457 $fieldstosearchall[$key] = $langs->trans($val);
458 $setupstring .= $key.
"=".$val.
";";
460 print
'<!-- Search done like if VARIOUSPAYMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
461 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
464$arrayofmassactions = array();
468$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
469$selectedfields = ($mode !=
'kanban' ? $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
'')) :
'');
470$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
473print
'<div class="div-table-responsive">';
474print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
478print
'<tr class="liste_titre_filter">';
481 print
'<td class="liste_titre center maxwidthsearch">';
482 $searchpicto = $form->showFilterButtons(
'left');
488 print
'<td class="liste_titre">';
493if ($arrayfields[
'ref'][
'checked']) {
494 print
'<td class="liste_titre left">';
495 print
'<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
500if ($arrayfields[
'label'][
'checked']) {
501 print
'<td class="liste_titre">';
502 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
507if ($arrayfields[
'datep'][
'checked']) {
508 print
'<td class="liste_titre center">';
509 print
'<div class="nowrapfordate">';
510 print $form->selectDate($search_datep_start ? $search_datep_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
512 print
'<div class="nowrapfordate">';
513 print $form->selectDate($search_datep_end ? $search_datep_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
519if ($arrayfields[
'datev'][
'checked']) {
520 print
'<td class="liste_titre center">';
521 print
'<div class="nowrapfordate">';
522 print $form->selectDate($search_datev_start ? $search_datev_start : -1,
'search_date_value_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
524 print
'<div class="nowrapfordate">';
525 print $form->selectDate($search_datev_end ? $search_datev_end : -1,
'search_date_value_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
531if ($arrayfields[
'type'][
'checked']) {
532 print
'<td class="liste_titre center">';
533 print $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'maxwidth100', 1);
538if ($arrayfields[
'project'][
'checked']) {
539 print
'<td class="liste_titre">';
545if ($arrayfields[
'bank'][
'checked']) {
546 print
'<td class="liste_titre">';
547 $form->select_comptes($search_bank_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
552if ($arrayfields[
'entry'][
'checked']) {
553 print
'<td class="liste_titre left">';
554 print
'<input name="search_bank_entry" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_bank_entry).
'">';
559if (!empty($arrayfields[
'account'][
'checked'])) {
560 print
'<td class="liste_titre">';
561 print
'<div class="nowrap">';
562 print $formaccounting->select_account($search_accountancy_account,
'search_accountancy_account', 1, array(), 1, 1,
'maxwidth200');
568if (!empty($arrayfields[
'subledger'][
'checked'])) {
569 print
'<td class="liste_titre">';
570 print
'<div class="nowrap">';
571 print $formaccounting->select_auxaccount($search_accountancy_subledger,
'search_accountancy_subledger', 1,
'maxwidth200');
577if (!empty($arrayfields[
'debit'][
'checked'])) {
578 print
'<td class="liste_titre right">';
579 print
'<input name="search_amount_deb" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_amount_deb).
'">';
584if ($arrayfields[
'credit'][
'checked']) {
585 print
'<td class="liste_titre right">';
586 print
'<input name="search_amount_cred" class="flat maxwidth50" type="text" size="8" value="'.dol_escape_htmltag($search_amount_cred).
'">';
591 print
'<td class="liste_titre center maxwidthsearch">';
592 $searchpicto = $form->showFilterButtons();
599$totalarray = array();
600$totalarray[
'nbfield'] = 0;
604print
'<tr class="liste_titre">';
607 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
608 $totalarray[
'nbfield']++;
612 $totalarray[
'nbfield']++;
615if ($arrayfields[
'ref'][
'checked']) {
616 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
'v.rowid',
'', $param,
'', $sortfield, $sortorder);
617 $totalarray[
'nbfield']++;
619if ($arrayfields[
'label'][
'checked']) {
620 print_liste_field_titre($arrayfields[
'label'][
'label'], $_SERVER[
"PHP_SELF"],
'v.label',
'', $param,
'', $sortfield, $sortorder);
621 $totalarray[
'nbfield']++;
623if ($arrayfields[
'datep'][
'checked']) {
624 print_liste_field_titre($arrayfields[
'datep'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datep,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
625 $totalarray[
'nbfield']++;
627if ($arrayfields[
'datev'][
'checked']) {
628 print_liste_field_titre($arrayfields[
'datev'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datev,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
629 $totalarray[
'nbfield']++;
631if ($arrayfields[
'type'][
'checked']) {
632 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
'type',
'', $param,
'', $sortfield, $sortorder,
'center ');
633 $totalarray[
'nbfield']++;
635if ($arrayfields[
'project'][
'checked']) {
636 print_liste_field_titre($arrayfields[
'project'][
'label'], $_SERVER[
"PHP_SELF"],
'fk_project',
'', $param,
'', $sortfield, $sortorder);
637 $totalarray[
'nbfield']++;
639if ($arrayfields[
'bank'][
'checked']) {
640 print_liste_field_titre($arrayfields[
'bank'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
641 $totalarray[
'nbfield']++;
643if ($arrayfields[
'entry'][
'checked']) {
644 print_liste_field_titre($arrayfields[
'entry'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
645 $totalarray[
'nbfield']++;
647if (!empty($arrayfields[
'account'][
'checked'])) {
648 print_liste_field_titre($arrayfields[
'account'][
'label'], $_SERVER[
"PHP_SELF"],
'v.accountancy_code',
'', $param,
'', $sortfield, $sortorder,
'left ');
649 $totalarray[
'nbfield']++;
651if (!empty($arrayfields[
'subledger'][
'checked'])) {
652 print_liste_field_titre($arrayfields[
'subledger'][
'label'], $_SERVER[
"PHP_SELF"],
'v.subledger_account',
'', $param,
'', $sortfield, $sortorder,
'left ');
653 $totalarray[
'nbfield']++;
655if ($arrayfields[
'debit'][
'checked']) {
656 print_liste_field_titre($arrayfields[
'debit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
657 $totalarray[
'nbfield']++;
659if ($arrayfields[
'credit'][
'checked']) {
660 print_liste_field_titre($arrayfields[
'credit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
661 $totalarray[
'nbfield']++;
664include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
666$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
667$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
668print $hookmanager->resPrint;
671 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
672 $totalarray[
'nbfield']++;
680$savnbfield = $totalarray[
'nbfield'];
681$totalarray = array();
682$totalarray[
'nbfield'] = 0;
683$totalarray[
'val'][
'total_cred'] = 0;
684$totalarray[
'val'][
'total_deb'] = 0;
685$imaxinloop = ($limit ? min($num, $limit) : $num);
686while ($i < $imaxinloop) {
687 $obj = $db->fetch_object($resql);
692 $variousstatic->id = $obj->rowid;
693 $variousstatic->ref = $obj->rowid;
694 $variousstatic->label = $obj->label;
695 $variousstatic->datep = $obj->datep;
696 $variousstatic->type_payment = $obj->payment_code;
697 $bankline->fetch($obj->fk_bank);
698 $variousstatic->fk_bank = $bankline->getNomUrl(1);
699 $variousstatic->amount = $obj->amount;
701 $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
702 $variousstatic->accountancy_code = $accountingaccount->getNomUrl(0, 0, 1, $obj->accountingaccount, 1);
704 if ($mode ==
'kanban') {
706 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
707 print
'<div class="box-flex-container kanban">';
710 print $variousstatic->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
711 if ($i == ($imaxinloop) - 1) {
718 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
723 $totalarray[
'nbfield']++;
729 print
'<td>'.(($offset * $limit) + $i).
'</td>';
733 if ($arrayfields[
'ref'][
'checked']) {
734 print
'<td>'.$variousstatic->getNomUrl(1).
"</td>";
736 $totalarray[
'nbfield']++;
741 if ($arrayfields[
'label'][
'checked']) {
742 print
'<td class="tdoverflowmax150" title="'.$variousstatic->label.
'">'.$variousstatic->label.
"</td>";
744 $totalarray[
'nbfield']++;
749 if ($arrayfields[
'datep'][
'checked']) {
750 print
'<td class="center">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>";
752 $totalarray[
'nbfield']++;
758 if ($arrayfields[
'datev'][
'checked']) {
759 print
'<td class="center">'.dol_print_date($db->jdate($obj->datev),
'day').
"</td>";
761 $totalarray[
'nbfield']++;
766 if ($arrayfields[
'type'][
'checked']) {
767 print
'<td class="center">';
768 if ($obj->payment_code) {
769 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
772 print $obj->num_payment;
775 $totalarray[
'nbfield']++;
780 if ($arrayfields[
'project'][
'checked']) {
781 print
'<td class="nowraponall">';
782 if ($obj->fk_project > 0) {
783 $proj->fetch($obj->fk_project);
784 print $proj->getNomUrl(1);
788 $totalarray[
'nbfield']++;
793 if ($arrayfields[
'bank'][
'checked']) {
794 print
'<td class="nowraponall">';
796 $accountstatic->id = $obj->bid;
797 $accountstatic->ref = $obj->bref;
798 $accountstatic->number = $obj->bnumber;
800 if (isModEnabled(
'accounting')) {
801 $accountstatic->account_number = $obj->bank_account_number;
802 $accountingjournal->fetch($obj->accountancy_journal);
803 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
806 $accountstatic->label = $obj->blabel;
807 print $accountstatic->getNomUrl(1);
813 $totalarray[
'nbfield']++;
818 if ($arrayfields[
'entry'][
'checked']) {
819 $bankline->fetch($obj->fk_bank);
820 print
'<td>'.$bankline->getNomUrl(1).
'</td>';
822 $totalarray[
'nbfield']++;
827 if (!empty($arrayfields[
'account'][
'checked'])) {
828 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
829 $result = $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
831 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.
' '.$accountingaccount->label).
'">'.$accountingaccount->getNomUrl(0, 1, 1,
'', 1).
'</td>';
836 $totalarray[
'nbfield']++;
841 if (!empty($arrayfields[
'subledger'][
'checked'])) {
842 print
'<td class="tdoverflowmax150">'.length_accounta($obj->subledger_account).
'</td>';
844 $totalarray[
'nbfield']++;
849 if ($arrayfields[
'debit'][
'checked']) {
850 print
'<td class="nowrap right">';
851 if ($obj->sens == 0) {
852 print
'<span class="amount">'.price($obj->amount).
'</span>';
853 $totalarray[
'val'][
'total_deb'] += $obj->amount;
856 $totalarray[
'nbfield']++;
859 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_deb';
865 if ($arrayfields[
'credit'][
'checked']) {
866 print
'<td class="nowrap right">';
867 if ($obj->sens == 1) {
868 print
'<span class="amount">'.price($obj->amount).
'</span>';
869 $totalarray[
'val'][
'total_cred'] += $obj->amount;
872 $totalarray[
'nbfield']++;
875 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_cred';
883 $totalarray[
'nbfield']++;
893include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
898 foreach ($arrayfields as $key => $val) {
899 if (!empty($val[
'checked'])) {
903 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
908$parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
909$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
910print $hookmanager->resPrint;
912print
'</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 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 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 a 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.