34require
'../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
42$langs->loadLangs(array(
'bills',
'banks',
'compta',
'companies'));
44$action =
GETPOST(
'action',
'alpha');
45$massaction =
GETPOST(
'massaction',
'alpha');
46$confirm =
GETPOST(
'confirm',
'alpha');
47$optioncss =
GETPOST(
'optioncss',
'alpha');
48$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'paymentlist';
49$facid =
GETPOST(
'facid',
'int');
50$socid =
GETPOST(
'socid',
'int');
51$userid =
GETPOST(
'userid',
'int');
53$search_ref =
GETPOST(
"search_ref",
"alpha");
54$search_date_startday =
GETPOST(
'search_date_startday',
'int');
55$search_date_startmonth =
GETPOST(
'search_date_startmonth',
'int');
56$search_date_startyear =
GETPOST(
'search_date_startyear',
'int');
57$search_date_endday =
GETPOST(
'search_date_endday',
'int');
58$search_date_endmonth =
GETPOST(
'search_date_endmonth',
'int');
59$search_date_endyear =
GETPOST(
'search_date_endyear',
'int');
60$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
61$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
62$search_company =
GETPOST(
"search_company",
'alpha');
63$search_paymenttype =
GETPOST(
"search_paymenttype");
64$search_account =
GETPOST(
"search_account",
"int");
65$search_payment_num =
GETPOST(
'search_payment_num',
'alpha');
66$search_amount =
GETPOST(
"search_amount",
'alpha');
67$search_status =
GETPOST(
'search_status',
'intcomma');
68$search_sale =
GETPOST(
'search_sale',
'int');
70$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
71$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
72$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
73$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
76if (empty($page) || $page == -1) {
79$offset = $limit * $page;
90$search_all = trim(GETPOSTISSET(
"search_all") ?
GETPOST(
"search_all",
'alpha') :
GETPOST(
'sall'));
93$fieldstosearchall = array(
94 'p.ref'=>
"RefPayment",
95 's.nom'=>
"ThirdParty",
96 'p.num_paiement'=>
"Numero",
101 'p.ref' => array(
'label'=>
"RefPayment",
'checked'=>1,
'position'=>10),
102 'p.datep' => array(
'label'=>
"Date",
'checked'=>1,
'position'=>20),
103 's.nom' => array(
'label'=>
"ThirdParty",
'checked'=>1,
'position'=>30),
104 'c.libelle' => array(
'label'=>
"Type",
'checked'=>1,
'position'=>40),
105 'transaction' => array(
'label'=>
"BankTransactionLine",
'checked'=>1,
'position'=>50,
'enabled'=>(isModEnabled(
"banque"))),
106 'ba.label' => array(
'label'=>
"Account",
'checked'=>1,
'position'=>60,
'enabled'=>(isModEnabled(
"banque"))),
107 'p.num_paiement' => array(
'label'=>
"Numero",
'checked'=>1,
'position'=>70,
'tooltip'=>
"ChequeOrTransferNumber"),
108 'p.amount' => array(
'label'=>
"Amount",
'checked'=>1,
'position'=>80),
109 'p.statut' => array(
'label'=>
"Status",
'checked'=>1,
'position'=>90,
'enabled'=>(
getDolGlobalString(
'BILL_ADD_PAYMENT_VALIDATION'))),
114$hookmanager->initHooks(array(
'paymentlist'));
117if (!$user->hasRight(
'societe',
'client',
'voir')) {
118 $search_sale = $user->id;
123 $socid = $user->socid;
132$parameters = array(
'socid'=>$socid);
133$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
139if (empty($reshook)) {
140 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
143 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
145 $search_date_startday =
'';
146 $search_date_startmonth =
'';
147 $search_date_startyear =
'';
148 $search_date_endday =
'';
149 $search_date_endmonth =
'';
150 $search_date_endyear =
'';
151 $search_date_start =
'';
152 $search_date_end =
'';
153 $search_account =
'';
155 $search_paymenttype =
'';
156 $search_payment_num =
'';
157 $search_company =
'';
161 $search_array_options = array();
170$form =
new Form($db);
172$accountstatic =
new Account($db);
173$companystatic =
new Societe($db);
176llxHeader(
'', $langs->trans(
'ListPayment'));
178if (
GETPOST(
"orphelins",
"alpha")) {
180 $sql =
"SELECT p.rowid, p.ref, p.datep, p.amount, p.statut, p.num_paiement as num_payment,";
181 $sql .=
" c.code as paiement_code";
186 $parameters = array();
187 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
188 $sql .= $hookmanager->resPrint;
189 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement as p LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_paiement = c.id";
190 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf ON p.rowid = pf.fk_paiement";
191 $sql .=
" WHERE p.entity IN (".getEntity(
'invoice').
")";
192 $sql .=
" AND pf.fk_facture IS NULL";
195 $parameters = array();
196 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
197 $sql .= $hookmanager->resPrint;
199 $sql =
"SELECT p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement as num_payment, p.amount";
200 $sql .=
", c.code as paiement_code";
201 $sql .=
", ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.fk_accountancy_journal as accountancy_journal";
202 $sql .=
", s.rowid as socid, s.nom as name, s.email";
205 $sql .=
", SUM(pf.amount) as totalamount, COUNT(f.rowid) as nbinvoices";
208 $parameters = array();
209 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
210 $sql .= $hookmanager->resPrint;
214 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement as p";
215 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_paiement = c.id";
216 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON p.fk_bank = b.rowid";
217 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
219 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf ON p.rowid = pf.fk_paiement";
220 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture as f ON pf.fk_facture = f.rowid";
221 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON f.fk_soc = s.rowid";
223 $sql .=
" WHERE p.entity IN (".getEntity(
'invoice').
")";
225 $sql .=
" AND EXISTS (SELECT f.fk_soc FROM ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"paiement_facture as pf";
226 $sql .=
" WHERE p.rowid = pf.fk_paiement AND pf.fk_facture = f.rowid AND f.fk_soc = ".((int) $socid).
")";
230 $sql .=
" AND p.fk_user_creat IS NULL";
232 $sql .=
" AND p.fk_user_creat = ".((int) $userid);
240 if ($search_date_start) {
241 $sql .=
" AND p.datep >= '" . $db->idate($search_date_start) .
"'";
243 if ($search_date_end) {
244 $sql .=
" AND p.datep <= '" . $db->idate($search_date_end) .
"'";
246 if ($search_account > 0) {
247 $sql .=
" AND b.fk_account=".((int) $search_account);
249 if ($search_paymenttype !=
'') {
250 $sql .=
" AND c.code='".$db->escape($search_paymenttype).
"'";
252 if ($search_payment_num !=
'') {
255 if ($search_amount) {
256 $sql .=
" AND (".natural_search(
'p.amount', $search_amount, 1, 1);
261 if ($search_company) {
265 if ($search_sale && $search_sale !=
'-1') {
266 if ($search_sale == -2) {
267 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
268 } elseif ($search_sale > 0) {
269 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
274 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
278 $parameters = array();
279 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
280 $sql .= $hookmanager->resPrint;
282 $sql .=
" GROUP BY p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement, p.amount";
284 $sql .=
", ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.fk_accountancy_journal";
285 $sql .=
", s.rowid, s.nom, s.email";
289$nbtotalofrecords =
'';
292 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(DISTINCT p.rowid) as nbtotalofrecords', $sql);
293 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
294 $resql = $db->query($sqlforcount);
296 $objforcount = $db->fetch_object($resql);
297 $nbtotalofrecords = $objforcount->nbtotalofrecords;
302 if (($page * $limit) > $nbtotalofrecords) {
310$sql .= $db->order($sortfield, $sortorder);
312 $sql .= $db->plimit($limit + 1, $offset);
316$resql = $db->query($sql);
324$num = $db->num_rows($resql);
327if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
328 $param .=
'&contextpage='.urlencode($contextpage);
330if ($limit > 0 && $limit != $conf->liste_limit) {
331 $param .=
'&limit='.((int) $limit);
335 $param .=
'&orphelins=1';
338 $param .=
'&search_ref='.urlencode($search_ref);
340if ($search_date_startday) {
341 $param .=
'&search_date_startday='.urlencode($search_date_startday);
343if ($search_date_startmonth) {
344 $param .=
'&search_date_startmonth='.urlencode($search_date_startmonth);
346if ($search_date_startyear) {
347 $param .=
'&search_date_startyear='.urlencode($search_date_startyear);
349if ($search_date_endday) {
350 $param .=
'&search_date_endday='.urlencode($search_date_endday);
352if ($search_date_endmonth) {
353 $param .=
'&search_date_endmonth='.urlencode($search_date_endmonth);
355if ($search_date_endyear) {
356 $param .=
'&search_date_endyear='.urlencode($search_date_endyear);
358if ($search_company) {
359 $param .=
'&search_company='.urlencode($search_company);
361if ($search_amount !=
'') {
362 $param .=
'&search_amount='.urlencode($search_amount);
364if ($search_paymenttype) {
365 $param .=
'&search_paymenttype='.urlencode($search_paymenttype);
367if ($search_account) {
368 $param .=
'&search_account='.urlencode($search_account);
370if ($search_payment_num) {
371 $param .=
'&search_payment_num='.urlencode($search_payment_num);
373if ($optioncss !=
'') {
374 $param .=
'&optioncss='.urlencode($optioncss);
377print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
378if ($optioncss !=
'') {
379 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
381print
'<input type="hidden" name="token" value="'.newToken().
'">';
382print
'<input type="hidden" name="action" value="list">';
383print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
384print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
385print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
386print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
388print_barre_liste($langs->trans(
"ReceivedCustomersPayments"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'bill', 0,
'',
'', $limit, 0, 0, 1);
391 foreach ($fieldstosearchall as $key => $val) {
392 $fieldstosearchall[$key] = $langs->trans($val);
394 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
397$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
398$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
399$massactionbutton =
'';
400if ($massactionbutton) {
401 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
405print
'<div class="div-table-responsive">';
406print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
'').
'">';
410print
'<tr class="liste_titre_filter">';
414 print
'<td class="liste_titre center maxwidthsearch">';
415 $searchpicto = $form->showFilterButtons(
'left');
422 print
'<td class="liste_titre">';
427if (!empty($arrayfields[
'p.ref'][
'checked'])) {
428 print
'<td class="liste_titre left">';
429 print
'<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
434if (!empty($arrayfields[
'p.datep'][
'checked'])) {
435 print
'<td class="liste_titre center">';
436 print
'<div class="nowrapfordate">';
437 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
439 print
'<div class="nowrapfordate">';
440 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
446if (!empty($arrayfields[
's.nom'][
'checked'])) {
447 print
'<td class="liste_titre">';
448 print
'<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
453if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
454 print
'<td class="liste_titre">';
455 print $form->select_types_paiements($search_paymenttype,
'search_paymenttype',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
460if (!empty($arrayfields[
'transaction'][
'checked'])) {
461 print
'<td class="liste_titre">';
462 print
'<input class="flat" type="text" size="4" name="search_payment_num" value="'.dol_escape_htmltag($search_payment_num).
'">';
467if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
468 print
'<td class="liste_titre">';
473if (!empty($arrayfields[
'ba.label'][
'checked'])) {
474 print
'<td class="liste_titre">';
475 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
480if (!empty($arrayfields[
'p.amount'][
'checked'])) {
481 print
'<td class="liste_titre right">';
482 print
'<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
487if (!empty($arrayfields[
'p.statut'][
'checked'])) {
488 print
'<td class="liste_titre right">';
493$parameters = array(
'arrayfields'=>$arrayfields);
494$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
495print $hookmanager->resPrint;
499 print
'<td class="liste_titre center maxwidthsearch">';
500 $searchpicto = $form->showFilterButtons();
507$totalarray = array();
508$totalarray[
'nbfield'] = 0;
512print
'<tr class="liste_titre">';
515 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
516 $totalarray[
'nbfield']++;
520 $totalarray[
'nbfield']++;
522if (!empty($arrayfields[
'p.ref'][
'checked'])) {
523 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
524 $totalarray[
'nbfield']++;
526if (!empty($arrayfields[
'p.datep'][
'checked'])) {
527 print_liste_field_titre($arrayfields[
'p.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datep",
'', $param,
'', $sortfield, $sortorder,
'center ');
528 $totalarray[
'nbfield']++;
530if (!empty($arrayfields[
's.nom'][
'checked'])) {
531 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
'', $param,
'', $sortfield, $sortorder);
532 $totalarray[
'nbfield']++;
534if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
535 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle",
'', $param,
'', $sortfield, $sortorder);
536 $totalarray[
'nbfield']++;
538if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
539 print_liste_field_titre($arrayfields[
'p.num_paiement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.num_paiement",
'', $param,
'', $sortfield, $sortorder,
'', $arrayfields[
'p.num_paiement'][
'tooltip']);
540 $totalarray[
'nbfield']++;
542if (!empty($arrayfields[
'transaction'][
'checked'])) {
543 print_liste_field_titre($arrayfields[
'transaction'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder);
544 $totalarray[
'nbfield']++;
546if (!empty($arrayfields[
'ba.label'][
'checked'])) {
547 print_liste_field_titre($arrayfields[
'ba.label'][
'label'], $_SERVER[
"PHP_SELF"],
"ba.label",
'', $param,
'', $sortfield, $sortorder);
548 $totalarray[
'nbfield']++;
550if (!empty($arrayfields[
'p.amount'][
'checked'])) {
551 print_liste_field_titre($arrayfields[
'p.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"p.amount",
'', $param,
'class="right"', $sortfield, $sortorder);
552 $totalarray[
'nbfield']++;
554if (!empty($arrayfields[
'p.statut'][
'checked'])) {
555 print_liste_field_titre($arrayfields[
'p.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.statut",
'', $param,
'class="right"', $sortfield, $sortorder);
556 $totalarray[
'nbfield']++;
559include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
561$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
562$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
563print $hookmanager->resPrint;
566 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
567 $totalarray[
'nbfield']++;
573$needToFetchEachLine = 0;
574if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
575 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
576 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
577 $needToFetchEachLine++;
586$savnbfield = $totalarray[
'nbfield'];
587$totalarray = array();
588$totalarray[
'nbfield'] = 0;
589$imaxinloop = ($limit ? min($num, $limit) : $num);
590while ($i < $imaxinloop) {
591 $objp = $db->fetch_object($resql);
596 $object->id = $objp->rowid;
597 $object->ref = ($objp->ref ? $objp->ref : $objp->rowid);
598 $object->date = $db->jdate($objp->datep);
599 $object->amount = $objp->amount;
601 $companystatic->id = $objp->socid;
602 $companystatic->name = $objp->name;
603 $companystatic->email = $objp->email;
605 if ($mode ==
'kanban') {
607 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
608 print
'<div class="box-flex-container kanban">';
612 if ($massactionbutton || $massaction) {
614 if (in_array($object->id, $arrayofselected)) {
619 print $object->getKanbanView(
'', array(
'selected' => $selected));
620 if ($i == ($imaxinloop - 1)) {
627 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
631 print
'<td class="nowrap center">';
632 if ($massactionbutton || $massaction) {
634 if (in_array($object->id, $arrayofselected)) {
637 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
641 $totalarray[
'nbfield']++;
647 print
'<td class="nowraponall">'.(($offset * $limit) + $i).
'</td>';
649 $totalarray[
'nbfield']++;
654 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
655 print
'<td class="nowraponall">'.$object->getNomUrl(1).
'</td>';
657 $totalarray[
'nbfield']++;
662 if (!empty($arrayfields[
'p.datep'][
'checked'])) {
663 $dateformatforpayment =
'dayhour';
664 print
'<td class="nowraponall center">'.dol_print_date($db->jdate($objp->datep), $dateformatforpayment,
'tzuser').
'</td>';
666 $totalarray[
'nbfield']++;
671 if (!empty($arrayfields[
's.nom'][
'checked'])) {
672 print
'<td class="tdoverflowmax125">';
673 if ($objp->socid > 0) {
674 print $companystatic->getNomUrl(1,
'', 24);
678 $totalarray[
'nbfield']++;
683 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
684 print
'<td>'.$langs->trans(
"PaymentTypeShort".$objp->paiement_code).
'</td>';
686 $totalarray[
'nbfield']++;
691 if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
692 print
'<td>'.$objp->num_payment.
'</td>';
694 $totalarray[
'nbfield']++;
699 if (!empty($arrayfields[
'transaction'][
'checked'])) {
700 print
'<td class="tdoverflowmax125">';
701 if ($objp->fk_bank > 0) {
702 $bankline->fetch($objp->fk_bank);
703 print $bankline->getNomUrl(1, 0);
707 $totalarray[
'nbfield']++;
712 if (!empty($arrayfields[
'ba.label'][
'checked'])) {
714 if ($objp->bid > 0) {
715 $accountstatic->id = $objp->bid;
716 $accountstatic->ref = $objp->bref;
717 $accountstatic->label = $objp->blabel;
718 $accountstatic->number = $objp->number;
719 $accountstatic->account_number = $objp->account_number;
722 $accountingjournal->fetch($objp->accountancy_journal);
723 $accountstatic->accountancy_journal = $accountingjournal->code;
725 print $accountstatic->getNomUrl(1);
729 $totalarray[
'nbfield']++;
734 if (!empty($arrayfields[
'p.amount'][
'checked'])) {
735 print
'<td class="right">';
736 if ($objp->nbinvoices > 1 || ($objp->totalamount && $objp->amount != $objp->totalamount)) {
737 print $form->textwithpicto(
'', $langs->trans(
"PaymentMadeForSeveralInvoices"));
739 print
'<span class="amount">'.price($objp->amount).
'</span>';
742 $totalarray[
'nbfield']++;
743 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'amount';
745 if (empty($totalarray[
'val'][
'amount'])) {
746 $totalarray[
'val'][
'amount'] = $objp->amount;
748 $totalarray[
'val'][
'amount'] += $objp->amount;
753 if (!empty($arrayfields[
'p.statut'][
'checked'])) {
754 print
'<td class="right">';
755 if ($objp->statut == 0) {
756 print
'<a href="card.php?id='.$objp->rowid.
'&action=valide">';
758 print $object->LibStatut($objp->statut, 5);
759 if ($objp->statut == 0) {
764 $totalarray[
'nbfield']++;
770 print
'<td class="nowrap center">';
771 if ($massactionbutton || $massaction) {
773 if (in_array($object->id, $arrayofselected)) {
776 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
780 $totalarray[
'nbfield']++;
791include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
796 foreach ($arrayfields as $key => $val) {
797 if (!empty($val[
'checked'])) {
801 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
806$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
807$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
808print $hookmanager->resPrint;
810print
'</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 journals.
Class to manage payments of customer invoices.
Class to manage third parties objects (customers, suppliers, prospects...)
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...
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.
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.