28 require
'../../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
38 $langs->loadLangs(array(
"compta",
"banks",
"bills",
"accountancy"));
40 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'directdebitcredittransferlist';
43 $socid =
GETPOST(
"socid",
"int");
45 $socid = $user->socid;
48 $optioncss =
GETPOST(
'optioncss',
'alpha');
49 $mode =
GETPOST(
'mode',
'alpha');
50 $massaction =
GETPOST(
'massaction',
'aZ09');
52 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
53 $search_ref =
GETPOST(
'search_ref',
'int');
54 $search_user =
GETPOST(
'search_user',
'alpha');
55 $search_label =
GETPOST(
'search_label',
'alpha');
56 $search_datep_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_startmonth',
'int'),
GETPOST(
'search_date_startday',
'int'),
GETPOST(
'search_date_startyear',
'int'));
57 $search_datep_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_endmonth',
'int'),
GETPOST(
'search_date_endday',
'int'),
GETPOST(
'search_date_endyear',
'int'));
58 $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'));
59 $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'));
60 $search_amount_deb =
GETPOST(
'search_amount_deb',
'alpha');
61 $search_amount_cred =
GETPOST(
'search_amount_cred',
'alpha');
62 $search_bank_account =
GETPOST(
'search_account',
'int');
63 $search_bank_entry =
GETPOST(
'search_bank_entry',
'int');
64 $search_accountancy_account =
GETPOST(
"search_accountancy_account");
65 if ($search_accountancy_account == - 1) {
66 $search_accountancy_account =
'';
68 $search_accountancy_subledger =
GETPOST(
"search_accountancy_subledger");
69 if ($search_accountancy_subledger == - 1) {
70 $search_accountancy_subledger =
'';
72 if (empty($search_datep_start)) {
73 $search_datep_start =
GETPOST(
"search_datep_start",
'int');
75 if (empty($search_datep_end)) {
76 $search_datep_end =
GETPOST(
"search_datep_end",
'int');
78 if (empty($search_datev_start)) {
79 $search_datev_start =
GETPOST(
"search_datev_start",
'int');
81 if (empty($search_datev_end)) {
82 $search_datev_end =
GETPOST(
"search_datev_end",
'int');
84 $search_type_id =
GETPOST(
'search_type_id',
'int');
86 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
87 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
89 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
93 $offset = $limit * $page;
94 $pageprev = $page - 1;
95 $pagenext = $page + 1;
97 $sortfield =
"v.datep,v.rowid";
100 $sortorder =
"DESC,DESC";
103 $filtre =
GETPOST(
"filtre",
'alpha');
105 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
108 $search_datep_start =
'';
109 $search_datep_end =
'';
110 $search_datev_start =
'';
111 $search_datev_end =
'';
112 $search_amount_deb =
'';
113 $search_amount_cred =
'';
114 $search_bank_account =
'';
115 $search_bank_entry =
'';
116 $search_accountancy_account =
'';
117 $search_accountancy_subledger =
'';
118 $search_type_id =
'';
144 $fieldstosearchall = array(
147 'v.datep'=>
"DatePayment",
148 'v.datev'=>
"DateValue",
149 'v.amount'=>$langs->trans(
"Debit").
", ".$langs->trans(
"Credit"),
153 $arrayfields = array(
154 'ref' =>array(
'label'=>
"Ref",
'checked'=>1,
'position'=>100),
155 'label' =>array(
'label'=>
"Label",
'checked'=>1,
'position'=>110),
156 'datep' =>array(
'label'=>
"DatePayment",
'checked'=>1,
'position'=>120),
157 'datev' =>array(
'label'=>
"DateValue",
'checked'=>-1,
'position'=>130),
158 'type' =>array(
'label'=>
"PaymentMode",
'checked'=>1,
'position'=>140),
159 'project' =>array(
'label'=>
"Project",
'checked'=>1,
'position'=>200,
"enabled"=>
isModEnabled(
'project')),
160 'bank' =>array(
'label'=>
"BankAccount",
'checked'=>1,
'position'=>300,
"enabled"=>
isModEnabled(
"banque")),
161 'entry' =>array(
'label'=>
"BankTransactionLine",
'checked'=>1,
'position'=>310,
"enabled"=>
isModEnabled(
"banque")),
162 'account' =>array(
'label'=>
"AccountAccountingShort",
'checked'=>1,
'position'=>400,
"enabled"=>
isModEnabled(
'accounting')),
163 'subledger' =>array(
'label'=>
"SubledgerAccount",
'checked'=>1,
'position'=>410,
"enabled"=>
isModEnabled(
'accounting')),
164 'debit' =>array(
'label'=>
"Debit",
'checked'=>1,
'position'=>500),
165 'credit' =>array(
'label'=>
"Credit",
'checked'=>1,
'position'=>510),
179 if (
GETPOST(
'cancel',
'alpha')) {
183 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
187 $parameters = array();
188 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
193 if (empty($reshook)) {
195 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
198 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
199 foreach ($object->fields as $key => $val) {
201 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
202 $search[$key.
'_dtstart'] =
'';
203 $search[$key.
'_dtend'] =
'';
207 $search_array_options = array();
209 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
210 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
220 if ($arrayfields[
'account'][
'checked'] || $arrayfields[
'subledger'][
'checked']) {
223 if ($arrayfields[
'bank'][
'checked'] &&
isModEnabled(
'accounting')) {
226 if ($arrayfields[
'ref'][
'checked']) {
229 if ($arrayfields[
'bank'][
'checked']) {
230 $accountstatic =
new Account($db);
232 if ($arrayfields[
'project'][
'checked']) {
235 if ($arrayfields[
'entry'][
'checked']) {
238 if ($arrayfields[
'account'][
'checked']) {
242 $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,";
243 $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,";
244 $sql .=
" pst.code as payment_code";
248 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_various as v";
249 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON v.fk_typepayment = pst.id";
250 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON v.fk_bank = b.rowid";
251 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
252 $sql .=
" WHERE v.entity IN (".getEntity(
'payment_various').
")";
256 $sql .=
" AND v.rowid = ".((int) $search_ref);
261 if ($search_datep_start) {
262 $sql .=
" AND v.datep >= '".$db->idate($search_datep_start).
"'";
264 if ($search_datep_end) {
265 $sql .=
" AND v.datep <= '".$db->idate($search_datep_end).
"'";
267 if ($search_datev_start) {
268 $sql .=
" AND v.datev >= '".$db->idate($search_datev_start).
"'";
270 if ($search_datev_end) {
271 $sql .=
" AND v.datev <= '".$db->idate($search_datev_end).
"'";
273 if ($search_amount_deb) {
276 if ($search_amount_cred) {
279 if ($search_bank_account > 0) {
280 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
282 if ($search_bank_entry > 0) {
283 $sql .=
" AND b.fk_account = ".((int) $search_bank_account);
285 if ($search_accountancy_account > 0) {
286 $sql .=
" AND v.accountancy_code = ".((int) $search_accountancy_account);
288 if ($search_accountancy_subledger > 0) {
289 $sql .=
" AND v.subledger_account = ".((int) $search_accountancy_subledger);
291 if ($search_type_id > 0) {
292 $sql .=
" AND v.fk_typepayment=".((int) $search_type_id);
299 $nbtotalofrecords =
'';
302 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords',
$sql);
303 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
304 $resql = $db->query($sqlforcount);
306 $objforcount = $db->fetch_object($resql);
307 $nbtotalofrecords = $objforcount->nbtotalofrecords;
312 if (($page * $limit) > $nbtotalofrecords) {
320 $sql .= $db->order($sortfield, $sortorder);
322 $sql .= $db->plimit($limit + 1, $offset);
325 $resql = $db->query(
$sql);
331 $num = $db->num_rows($resql);
334 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
335 $obj = $db->fetch_object($resql);
337 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?id='.$id);
342 llxHeader(
'', $langs->trans(
"VariousPayments"));
349 $param .=
'&mode='.urlencode($mode);
351 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
352 $param .=
'&contextpage='.urlencode($contextpage);
354 if ($limit > 0 && $limit != $conf->liste_limit) {
355 $param .=
'&limit='.((int) $limit);
358 $param .=
'&search_ref='.urlencode($search_ref);
361 $param .=
'&search_label='.urlencode($search_label);
363 if ($search_datep_start) {
364 $param .=
'&search_datep_start='.urlencode($search_datep_start);
366 if ($search_datep_end) {
367 $param .=
'&search_datep_end='.urlencode($search_datep_end);
369 if ($search_datev_start) {
370 $param .=
'&search_datev_start='.urlencode($search_datev_start);
372 if ($search_datev_end) {
373 $param .=
'&search_datev_end='.urlencode($search_datev_end);
375 if ($search_type_id > 0) {
376 $param .=
'&search_type_id='.urlencode($search_type_id);
378 if ($search_amount_deb) {
379 $param .=
'&search_amount_deb='.urlencode($search_amount_deb);
381 if ($search_amount_cred) {
382 $param .=
'&search_amount_cred='.urlencode($search_amount_cred);
384 if ($search_bank_account > 0) {
385 $param .=
'&search_account='.urlencode($search_bank_account);
387 if ($search_accountancy_account > 0) {
388 $param .=
'&search_accountancy_account='.urlencode($search_accountancy_account);
390 if ($search_accountancy_subledger > 0) {
391 $param .=
'&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
393 if ($optioncss !=
'') {
394 $param .=
'&optioncss='.urlencode($optioncss);
397 $url = DOL_URL_ROOT.
'/compta/bank/various_payment/card.php?action=create';
398 if (!empty($socid)) {
399 $url .=
'&socid='.urlencode($socid);
402 $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'));
403 $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'));
404 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'MenuNewVariousPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->banque->modifier);
406 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
408 if ($optioncss !=
'') {
409 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
411 print
'<input type="hidden" name="token" value="'.newToken().
'">';
412 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
413 print
'<input type="hidden" name="action" value="list">';
414 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
415 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
416 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
417 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
420 print_barre_liste($langs->trans(
"MenuVariousPayment"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'object_payment', 0, $newcardbutton,
'', $limit, 0, 0, 1);
423 foreach ($fieldstosearchall as $key => $val) {
424 $fieldstosearchall[$key] = $langs->trans($val);
426 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
429 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
430 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
433 print
'<div class="div-table-responsive">';
434 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">';
436 print
'<tr class="liste_titre">';
439 print
'<td class="liste_titre maxwidthsearch">';
440 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
445 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
446 print
'<td class="liste_titre">';
451 if ($arrayfields[
'ref'][
'checked']) {
452 print
'<td class="liste_titre left">';
453 print
'<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
458 if ($arrayfields[
'label'][
'checked']) {
459 print
'<td class="liste_titre">';
460 print
'<input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
465 if ($arrayfields[
'datep'][
'checked']) {
466 print
'<td class="liste_titre center">';
467 print
'<div class="nowrap">';
468 print
$form->selectDate($search_datep_start ? $search_datep_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
470 print
'<div class="nowrap">';
471 print
$form->selectDate($search_datep_end ? $search_datep_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
477 if ($arrayfields[
'datev'][
'checked']) {
478 print
'<td class="liste_titre center">';
479 print
'<div class="nowrap">';
480 print
$form->selectDate($search_datev_start ? $search_datev_start : -1,
'search_date_value_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
482 print
'<div class="nowrap">';
483 print
$form->selectDate($search_datev_end ? $search_datev_end : -1,
'search_date_value_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
489 if ($arrayfields[
'type'][
'checked']) {
490 print
'<td class="liste_titre center">';
491 print
$form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'maxwidth100', 1);
496 if ($arrayfields[
'project'][
'checked']) {
497 print
'<td class="liste_titre">';
503 if ($arrayfields[
'bank'][
'checked']) {
504 print
'<td class="liste_titre">';
505 $form->select_comptes($search_bank_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth100');
510 if ($arrayfields[
'entry'][
'checked']) {
511 print
'<td class="liste_titre left">';
512 print
'<input name="search_bank_entry" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_bank_entry).
'">';
517 if (!empty($arrayfields[
'account'][
'checked'])) {
518 print
'<td class="liste_titre">';
519 print
'<div class="nowrap">';
520 print $formaccounting->select_account($search_accountancy_account,
'search_accountancy_account', 1, array(), 1, 1,
'maxwidth200');
526 if (!empty($arrayfields[
'subledger'][
'checked'])) {
527 print
'<td class="liste_titre">';
528 print
'<div class="nowrap">';
529 print $formaccounting->select_auxaccount($search_accountancy_subledger,
'search_accountancy_subledger', 1,
'maxwidth200');
535 if (!empty($arrayfields[
'debit'][
'checked'])) {
536 print
'<td class="liste_titre right">';
537 print
'<input name="search_amount_deb" class="flat maxwidth50" type="text" value="'.dol_escape_htmltag($search_amount_deb).
'">';
542 if ($arrayfields[
'credit'][
'checked']) {
543 print
'<td class="liste_titre right">';
544 print
'<input name="search_amount_cred" class="flat maxwidth50" type="text" size="8" value="'.dol_escape_htmltag($search_amount_cred).
'">';
549 print
'<td class="liste_titre maxwidthsearch">';
550 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
558 print
'<tr class="liste_titre">';
561 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
564 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
568 if ($arrayfields[
'ref'][
'checked']) {
569 print_liste_field_titre($arrayfields[
'ref'][
'label'], $_SERVER[
"PHP_SELF"],
'v.rowid',
'', $param,
'', $sortfield, $sortorder);
571 if ($arrayfields[
'label'][
'checked']) {
572 print_liste_field_titre($arrayfields[
'label'][
'label'], $_SERVER[
"PHP_SELF"],
'v.label',
'', $param,
'', $sortfield, $sortorder);
574 if ($arrayfields[
'datep'][
'checked']) {
575 print_liste_field_titre($arrayfields[
'datep'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datep,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
577 if ($arrayfields[
'datev'][
'checked']) {
578 print_liste_field_titre($arrayfields[
'datev'][
'label'], $_SERVER[
"PHP_SELF"],
'v.datev,v.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
580 if ($arrayfields[
'type'][
'checked']) {
581 print_liste_field_titre($arrayfields[
'type'][
'label'], $_SERVER[
"PHP_SELF"],
'type',
'', $param,
'', $sortfield, $sortorder,
'center ');
583 if ($arrayfields[
'project'][
'checked']) {
584 print_liste_field_titre($arrayfields[
'project'][
'label'], $_SERVER[
"PHP_SELF"],
'fk_project',
'', $param,
'', $sortfield, $sortorder);
586 if ($arrayfields[
'bank'][
'checked']) {
587 print_liste_field_titre($arrayfields[
'bank'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
589 if ($arrayfields[
'entry'][
'checked']) {
590 print_liste_field_titre($arrayfields[
'entry'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
592 if (!empty($arrayfields[
'account'][
'checked'])) {
593 print_liste_field_titre($arrayfields[
'account'][
'label'], $_SERVER[
"PHP_SELF"],
'v.accountancy_code',
'', $param,
'', $sortfield, $sortorder,
'left ');
595 if (!empty($arrayfields[
'subledger'][
'checked'])) {
596 print_liste_field_titre($arrayfields[
'subledger'][
'label'], $_SERVER[
"PHP_SELF"],
'v.subledger_account',
'', $param,
'', $sortfield, $sortorder,
'left ');
598 if ($arrayfields[
'debit'][
'checked']) {
599 print_liste_field_titre($arrayfields[
'debit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
601 if ($arrayfields[
'credit'][
'checked']) {
602 print_liste_field_titre($arrayfields[
'credit'][
'label'], $_SERVER[
"PHP_SELF"],
'v.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
606 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
607 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
608 print $hookmanager->resPrint;
611 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
616 $totalarray = array();
617 $savnbfield = $totalarray[
'nbfield'];
618 $totalarray[
'nbfield'] = 0;
619 $totalarray[
'val'][
'total_cred'] = 0;
620 $totalarray[
'val'][
'total_deb'] = 0;
622 $imaxinloop = ($limit ? min($num, $limit) : $num);
623 while ($i < $imaxinloop) {
624 $obj = $db->fetch_object($resql);
626 $variousstatic->id = $obj->rowid;
627 $variousstatic->ref = $obj->rowid;
628 $variousstatic->label = $obj->label;
629 $variousstatic->datep = $obj->datep;
630 $variousstatic->type_payment = $obj->payment_code;
631 $bankline->fetch($obj->fk_bank);
632 $variousstatic->fk_bank = $bankline->getNomUrl(1);
633 $variousstatic->amount = $obj->amount;
635 $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
636 $variousstatic->accountancy_code = $accountingaccount->getNomUrl(0, 0, 1, $obj->accountingaccount, 1);
638 if ($mode ==
'kanban') {
640 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
641 print
'<div class="box-flex-container kanban">';
644 print $variousstatic->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
645 if ($i == ($imaxinloop) - 1) {
652 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
657 $totalarray[
'nbfield']++;
662 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
663 print
'<td>'.(($offset * $limit) + $i).
'</td>';
667 if ($arrayfields[
'ref'][
'checked']) {
668 print
'<td>'.$variousstatic->getNomUrl(1).
"</td>";
670 $totalarray[
'nbfield']++;
675 if ($arrayfields[
'label'][
'checked']) {
676 print
'<td class="tdoverflowmax150" title="'.$variousstatic->label.
'">'.$variousstatic->label.
"</td>";
678 $totalarray[
'nbfield']++;
683 if ($arrayfields[
'datep'][
'checked']) {
684 print
'<td class="center">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>";
686 $totalarray[
'nbfield']++;
692 if ($arrayfields[
'datev'][
'checked']) {
693 print
'<td class="center">'.dol_print_date($db->jdate($obj->datev),
'day').
"</td>";
695 $totalarray[
'nbfield']++;
700 if ($arrayfields[
'type'][
'checked']) {
701 print
'<td class="center">';
702 if ($obj->payment_code) {
703 print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
706 print $obj->num_payment;
709 $totalarray[
'nbfield']++;
714 if ($arrayfields[
'project'][
'checked']) {
715 print
'<td class="nowraponall">';
716 if ($obj->fk_project > 0) {
717 $proj->fetch($obj->fk_project);
718 print $proj->getNomUrl(1);
722 $totalarray[
'nbfield']++;
727 if ($arrayfields[
'bank'][
'checked']) {
728 print
'<td class="nowraponall">';
730 $accountstatic->id = $obj->bid;
731 $accountstatic->ref = $obj->bref;
732 $accountstatic->number = $obj->bnumber;
735 $accountstatic->account_number = $obj->bank_account_number;
736 $accountingjournal->fetch($obj->accountancy_journal);
737 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
740 $accountstatic->label = $obj->blabel;
741 print $accountstatic->getNomUrl(1);
747 $totalarray[
'nbfield']++;
752 if ($arrayfields[
'entry'][
'checked']) {
753 $bankline->fetch($obj->fk_bank);
754 print
'<td>'.$bankline->getNomUrl(1).
'</td>';
756 $totalarray[
'nbfield']++;
761 if (!empty($arrayfields[
'account'][
'checked'])) {
762 $accountingaccount->fetch(
'', $obj->accountancy_code, 1);
764 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.
' '.$accountingaccount->label).
'">'.$accountingaccount->getNomUrl(0, 1, 1,
'', 1).
'</td>';
766 $totalarray[
'nbfield']++;
771 if (!empty($arrayfields[
'subledger'][
'checked'])) {
772 print
'<td class="tdoverflowmax150">'.length_accounta($obj->subledger_account).
'</td>';
774 $totalarray[
'nbfield']++;
779 if ($arrayfields[
'debit'][
'checked']) {
780 print
'<td class="nowrap right">';
781 if ($obj->sens == 0) {
782 print
'<span class="amount">'.price($obj->amount).
'</span>';
783 $totalarray[
'val'][
'total_deb'] += $obj->amount;
786 $totalarray[
'nbfield']++;
789 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_deb';
795 if ($arrayfields[
'credit'][
'checked']) {
796 print
'<td class="nowrap right">';
797 if ($obj->sens == 1) {
798 print
'<span class="amount">'.price($obj->amount).
'</span>';
799 $totalarray[
'val'][
'total_cred'] += $obj->amount;
802 $totalarray[
'nbfield']++;
805 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_cred';
813 $totalarray[
'nbfield']++;
823 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
828 foreach ($arrayfields as $key => $val) {
829 if (!empty($val[
'checked'])) {
833 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
838 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>
$sql);
839 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
840 print $hookmanager->resPrint;
842 print
'</table>'.
"\n";
845 print
'</form>'.
"\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.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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.