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';
36if (isModEnabled(
'project')) {
37 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
41$langs->loadLangs(array(
"compta",
"banks",
"bills",
"accountancy"));
43$optioncss =
GETPOST(
'optioncss',
'alpha');
44$mode =
GETPOST(
'mode',
'alpha');
45$massaction =
GETPOST(
'massaction',
'aZ09');
46$toselect =
GETPOST(
'toselect',
'array');
47$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'directdebitcredittransferlist';
50$search_ref =
GETPOST(
'search_ref',
'alpha');
51$search_user =
GETPOST(
'search_user',
'alpha');
52$search_label =
GETPOST(
'search_label',
'alpha');
57$search_amount_deb =
GETPOST(
'search_amount_deb',
'alpha');
58$search_amount_cred =
GETPOST(
'search_amount_cred',
'alpha');
59$search_bank_account =
GETPOST(
'search_account',
"intcomma");
60$search_bank_entry =
GETPOST(
'search_bank_entry',
'alpha');
61$search_accountancy_account =
GETPOST(
"search_accountancy_account");
62if ($search_accountancy_account == - 1) {
63 $search_accountancy_account =
'';
65$search_accountancy_subledger =
GETPOST(
"search_accountancy_subledger");
66if ($search_accountancy_subledger == - 1) {
67 $search_accountancy_subledger =
'';
69if (empty($search_datep_start)) {
70 $search_datep_start =
GETPOSTINT(
"search_datep_start");
72if (empty($search_datep_end)) {
73 $search_datep_end =
GETPOSTINT(
"search_datep_end");
75if (empty($search_datev_start)) {
76 $search_datev_start =
GETPOSTINT(
"search_datev_start");
78if (empty($search_datev_end)) {
79 $search_datev_end =
GETPOSTINT(
"search_datev_end");
81$search_type_id =
GETPOST(
'search_type_id',
'int');
83$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
84$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
86if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
90$offset = $limit * $page;
98$hookmanager->initHooks(array($contextpage));
101$extrafields->fetch_name_optionals_label(
$object->table_element);
103$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
107 $sortfield =
"v.datep,v.rowid";
110 $sortorder =
"DESC,DESC";
113$filtre =
GETPOST(
"filtre",
'alpha');
115if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
118 $search_datep_start =
'';
119 $search_datep_end =
'';
120 $search_datev_start =
'';
121 $search_datev_end =
'';
122 $search_amount_deb =
'';
123 $search_amount_cred =
'';
124 $search_bank_account =
'';
125 $search_bank_entry =
'';
126 $search_accountancy_account =
'';
127 $search_accountancy_subledger =
'';
128 $search_type_id =
'';
131$search_all = GETPOSTISSET(
"search_all") ? trim(
GETPOST(
"search_all",
'alpha')) : trim(
GETPOST(
'sall'));
154$fieldstosearchall = array(
156 'v.label' =>
"Label",
157 'v.datep' =>
"DatePayment",
158 'v.datev' =>
"DateValue",
159 'v.amount' => $langs->trans(
"Debit").
", ".$langs->trans(
"Credit"),
164 'ref' => array(
'label' =>
"Ref",
'checked' => 1,
'position' => 100),
165 'label' => array(
'label' =>
"Label",
'checked' => 1,
'position' => 110),
166 'datep' => array(
'label' =>
"DatePayment",
'checked' => 1,
'position' => 120),
167 'datev' => array(
'label' =>
"DateValue",
'checked' => -1,
'position' => 130),
168 'type' => array(
'label' =>
"PaymentMode",
'checked' => 1,
'position' => 140),
169 'project' => array(
'label' =>
"Project",
'checked' => 1,
'position' => 200,
"enabled" => isModEnabled(
'project')),
170 'bank' => array(
'label' =>
"BankAccount",
'checked' => 1,
'position' => 300,
"enabled" => isModEnabled(
"bank")),
171 'entry' => array(
'label' =>
"BankTransactionLine",
'checked' => 1,
'position' => 310,
"enabled" => isModEnabled(
"bank")),
172 'account' => array(
'label' =>
"AccountAccountingShort",
'checked' => 1,
'position' => 400,
"enabled" => isModEnabled(
'accounting')),
173 'subledger' => array(
'label' =>
"SubledgerAccount",
'checked' => 1,
'position' => 410,
"enabled" => isModEnabled(
'accounting')),
174 'debit' => array(
'label' =>
"Debit",
'checked' => 1,
'position' => 500),
175 'credit' => array(
'label' =>
"Credit",
'checked' => 1,
'position' => 510),
179'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
184 $socid = $user->socid;
194if (
GETPOST(
'cancel',
'alpha')) {
198if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
202$parameters = array();
203$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
208if (empty($reshook)) {
210 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
213 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
214 foreach (
$object->fields as $key => $val) {
216 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
217 $search[$key.
'_dtstart'] =
'';
218 $search[$key.
'_dtend'] =
'';
222 $search_array_options = array();
224 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
225 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
234$form =
new Form($db);
235if ($arrayfields[
'account'][
'checked'] || $arrayfields[
'subledger'][
'checked']) {
238if ($arrayfields[
'bank'][
'checked'] && isModEnabled(
'accounting')) {
241if ($arrayfields[
'ref'][
'checked']) {
244if ($arrayfields[
'bank'][
'checked']) {
245 $accountstatic =
new Account($db);
247if (isModEnabled(
'project') && $arrayfields[
'project'][
'checked']) {
250if ($arrayfields[
'entry'][
'checked']) {
253if ($arrayfields[
'account'][
'checked']) {
257$title = $langs->trans(
"VariousPayments");
264$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,";
265$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,";
266$sql .=
" pst.code as payment_code";
270$sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as v";
271$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON v.fk_typepayment = pst.id";
272$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON v.fk_bank = b.rowid";
273$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
274$sql .=
" WHERE v.entity IN (".getEntity(
'payment_various').
")";
278 $sql .=
" AND v.rowid = ".((int) $search_ref);
283if ($search_datep_start) {
284 $sql .=
" AND v.datep >= '".$db->idate($search_datep_start).
"'";
286if ($search_datep_end) {
287 $sql .=
" AND v.datep <= '".$db->idate($search_datep_end).
"'";
289if ($search_datev_start) {
290 $sql .=
" AND v.datev >= '".$db->idate($search_datev_start).
"'";
292if ($search_datev_end) {
293 $sql .=
" AND v.datev <= '".$db->idate($search_datev_end).
"'";
295if ($search_amount_deb) {
298if ($search_amount_cred) {
301if ($search_bank_account > 0) {
302 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
304if ($search_bank_entry > 0) {
305 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
307if ($search_accountancy_account > 0) {
308 $sql .=
" AND v.accountancy_code = ".((int) $search_accountancy_account);
310if ($search_accountancy_subledger > 0) {
311 $sql .=
" AND v.subledger_account = ".((int) $search_accountancy_subledger);
313if ($search_type_id > 0) {
314 $sql .=
" AND v.fk_typepayment=".((int) $search_type_id);
317 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
321include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
323$parameters = array();
324$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
325$sql .= $hookmanager->resPrint;
328$nbtotalofrecords =
'';
331 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
332 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
333 $resql = $db->query($sqlforcount);
335 $objforcount = $db->fetch_object($resql);
336 $nbtotalofrecords = $objforcount->nbtotalofrecords;
341 if (($page * $limit) > $nbtotalofrecords) {
349$sql .= $db->order($sortfield, $sortorder);
351 $sql .= $db->plimit($limit + 1, $offset);
354$resql = $db->query($sql);
360$num = $db->num_rows($resql);
363if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
364 $obj = $db->fetch_object($resql);
366 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?id='.$id);
373llxHeader(
'', $title, $help_url, 0, 0,
'',
'',
'',
'bodyforlist');
375$arrayofselected = is_array($toselect) ? $toselect : array();
379 $param .=
'&mode='.urlencode($mode);
381if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
382 $param .=
'&contextpage='.urlencode($contextpage);
384if ($limit > 0 && $limit != $conf->liste_limit) {
385 $param .=
'&limit='.((int) $limit);
387if ($optioncss !=
'') {
388 $param .=
'&optioncss='.urlencode($optioncss);
391 $param .=
'&search_ref='.urlencode($search_ref);
394 $param .=
'&search_label='.urlencode($search_label);
396if ($search_datep_start) {
397 $param .=
'&search_datep_start='.urlencode($search_datep_start);
399if ($search_datep_end) {
400 $param .=
'&search_datep_end='.urlencode($search_datep_end);
402if ($search_datev_start) {
403 $param .=
'&search_datev_start='.urlencode($search_datev_start);
405if ($search_datev_end) {
406 $param .=
'&search_datev_end='.urlencode($search_datev_end);
408if ($search_type_id > 0) {
409 $param .=
'&search_type_id='.urlencode((
string) ($search_type_id));
411if ($search_amount_deb) {
412 $param .=
'&search_amount_deb='.urlencode($search_amount_deb);
414if ($search_amount_cred) {
415 $param .=
'&search_amount_cred='.urlencode($search_amount_cred);
417if ($search_bank_account > 0) {
418 $param .=
'&search_account='.urlencode((
string) ($search_bank_account));
420if ($search_accountancy_account > 0) {
421 $param .=
'&search_accountancy_account='.urlencode($search_accountancy_account);
423if ($search_accountancy_subledger > 0) {
424 $param .=
'&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
427$url = DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?action=create';
429 $url .=
'&socid='.urlencode((
string) ($socid));
433$arrayofmassactions = array();
434$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
436print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
437if ($optioncss !=
'') {
438 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
440print
'<input type="hidden" name="token" value="'.newToken().
'">';
441print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
442print
'<input type="hidden" name="action" value="list">';
443print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
444print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
445print
'<input type="hidden" name="page" value="'.$page.
'">';
446print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
447print
'<input type="hidden" name="page_y" value="">';
448print
'<input type="hidden" name="mode" value="'.$mode.
'">';
451$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'));
452$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'));
454$newcardbutton .=
dolGetButtonTitle($langs->trans(
'MenuNewVariousPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'banque',
'modifier'));
456print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
460 foreach ($fieldstosearchall as $key => $val) {
461 $fieldstosearchall[$key] = $langs->trans($val);
462 $setupstring .= $key.
"=".$val.
";";
464 print
'<!-- Search done like if VARIOUSPAYMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
465 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
468$arrayofmassactions = array();
472$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
473$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
474$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
475$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
478print
'<div class="div-table-responsive">';
479print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
483print
'<tr class="liste_titre_filter">';
486 print
'<td class="liste_titre center maxwidthsearch">';
487 $searchpicto = $form->showFilterButtons(
'left');
493 print
'<td class="liste_titre">';
498if ($arrayfields[
'ref'][
'checked']) {
499 print
'<td class="liste_titre left">';
500 print
'<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
505if ($arrayfields[
'label'][
'checked']) {
506 print
'<td class="liste_titre">';
507 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
512if ($arrayfields[
'datep'][
'checked']) {
513 print
'<td class="liste_titre center">';
514 print
'<div class="nowrapfordate">';
515 print $form->selectDate($search_datep_start ? $search_datep_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
517 print
'<div class="nowrapfordate">';
518 print $form->selectDate($search_datep_end ? $search_datep_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
524if ($arrayfields[
'datev'][
'checked']) {
525 print
'<td class="liste_titre center">';
526 print
'<div class="nowrapfordate">';
527 print $form->selectDate($search_datev_start ? $search_datev_start : -1,
'search_date_value_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
529 print
'<div class="nowrapfordate">';
530 print $form->selectDate($search_datev_end ? $search_datev_end : -1,
'search_date_value_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
536if ($arrayfields[
'type'][
'checked']) {
537 print
'<td class="liste_titre center">';
538 print $form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'maxwidth100', 1);
543if (isModEnabled(
'project') && $arrayfields[
'project'][
'checked']) {
544 print
'<td class="liste_titre">';
550if ($arrayfields[
'bank'][
'checked']) {
551 print
'<td class="liste_titre">';
552 $form->select_comptes($search_bank_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
557if ($arrayfields[
'entry'][
'checked']) {
558 print
'<td class="liste_titre left">';
559 print
'<input name="search_bank_entry" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_bank_entry).
'">';
564if (!empty($arrayfields[
'account'][
'checked'])) {
565 print
'<td class="liste_titre">';
566 print
'<div class="nowrap">';
567 print $formaccounting->select_account($search_accountancy_account,
'search_accountancy_account', 1, array(), 1, 1,
'maxwidth200');
573if (!empty($arrayfields[
'subledger'][
'checked'])) {
574 print
'<td class="liste_titre">';
575 print
'<div class="nowrap">';
576 print $formaccounting->select_auxaccount($search_accountancy_subledger,
'search_accountancy_subledger', 1,
'maxwidth200');
582if (!empty($arrayfields[
'debit'][
'checked'])) {
583 print
'<td class="liste_titre right">';
584 print
'<input name="search_amount_deb" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_amount_deb).
'">';
589if ($arrayfields[
'credit'][
'checked']) {
590 print
'<td class="liste_titre right">';
591 print
'<input name="search_amount_cred" class="flat maxwidth50" type="text" size="8" value="'.dol_escape_htmltag($search_amount_cred).
'">';
596 print
'<td class="liste_titre center maxwidthsearch">';
597 $searchpicto = $form->showFilterButtons();
604$totalarray = array();
605$totalarray[
'nbfield'] = 0;
609print
'<tr class="liste_titre">';
612 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
613 $totalarray[
'nbfield']++;
617 $totalarray[
'nbfield']++;
620if ($arrayfields[
'ref'][
'checked']) {
621 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
'v.rowid',
'', $param,
'', $sortfield, $sortorder);
622 $totalarray[
'nbfield']++;
624if ($arrayfields[
'label'][
'checked']) {
625 print_liste_field_titre($arrayfields[
'label'][
'label'], $_SERVER[
"PHP_SELF"],
'v.label',
'', $param,
'', $sortfield, $sortorder);
626 $totalarray[
'nbfield']++;
628if ($arrayfields[
'datep'][
'checked']) {
629 print_liste_field_titre($arrayfields[
'datep'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datep,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
630 $totalarray[
'nbfield']++;
632if ($arrayfields[
'datev'][
'checked']) {
633 print_liste_field_titre($arrayfields[
'datev'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datev,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
634 $totalarray[
'nbfield']++;
636if ($arrayfields[
'type'][
'checked']) {
637 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
'type',
'', $param,
'', $sortfield, $sortorder,
'center ');
638 $totalarray[
'nbfield']++;
640if (isModEnabled(
'project') && $arrayfields[
'project'][
'checked']) {
641 print_liste_field_titre($arrayfields[
'project'][
'label'], $_SERVER[
"PHP_SELF"],
'fk_project',
'', $param,
'', $sortfield, $sortorder);
642 $totalarray[
'nbfield']++;
644if ($arrayfields[
'bank'][
'checked']) {
645 print_liste_field_titre($arrayfields[
'bank'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
646 $totalarray[
'nbfield']++;
648if ($arrayfields[
'entry'][
'checked']) {
649 print_liste_field_titre($arrayfields[
'entry'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
650 $totalarray[
'nbfield']++;
652if (!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(
'', $obj->accountancy_code, 1);
707 $variousstatic->accountancy_code = $accountingaccount->getNomUrl(0, 0, 1, $obj->accountancy_code, 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 (isModEnabled(
'project') && $arrayfields[
'project'][
'checked']) {
786 print
'<td class="nowraponall">';
787 if ($obj->fk_project > 0) {
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(
'', $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()
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.