35require
'../../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
43$langs->loadLangs(array(
'bills',
'banks',
'compta',
'companies'));
45$action =
GETPOST(
'action',
'alpha');
46$massaction =
GETPOST(
'massaction',
'alpha');
47$confirm =
GETPOST(
'confirm',
'alpha');
48$optioncss =
GETPOST(
'optioncss',
'alpha');
49$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'paymentlist';
50$mode =
GETPOST(
'mode',
'alpha');
52$facid =
GETPOST(
'facid',
'int');
53$socid =
GETPOST(
'socid',
'int');
54$userid =
GETPOST(
'userid',
'int');
56$search_ref =
GETPOST(
"search_ref",
"alpha");
57$search_date_startday =
GETPOSTINT(
'search_date_startday');
58$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
59$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
60$search_date_endday =
GETPOSTINT(
'search_date_endday');
61$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
62$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
63$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
64$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
65$search_company =
GETPOST(
"search_company",
'alpha');
66$search_paymenttype =
GETPOST(
"search_paymenttype");
67$search_account =
GETPOST(
"search_account",
'alpha');
68$search_payment_num =
GETPOST(
'search_payment_num',
'alpha');
69$search_amount =
GETPOST(
"search_amount",
'alpha');
70$search_status =
GETPOST(
'search_status',
'intcomma');
75$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
76$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
79if (empty($page) || $page == -1) {
82$offset = $limit * $page;
93$search_all = trim(GETPOSTISSET(
"search_all") ?
GETPOST(
"search_all",
'alpha') :
GETPOST(
'sall'));
96$fieldstosearchall = array(
97 'p.ref' =>
"RefPayment",
98 's.nom' =>
"ThirdParty",
99 'p.num_paiement' =>
"Numero",
100 'p.amount' =>
"Amount",
104 'p.ref' => array(
'label' =>
"RefPayment",
'checked' => 1,
'position' => 10),
105 'p.datep' => array(
'label' =>
"Date",
'checked' => 1,
'position' => 20),
106 's.nom' => array(
'label' =>
"ThirdParty",
'checked' => 1,
'position' => 30),
107 'c.libelle' => array(
'label' =>
"Type",
'checked' => 1,
'position' => 40),
108 'transaction' => array(
'label' =>
"BankTransactionLine",
'checked' => 1,
'position' => 50,
'enabled' => (isModEnabled(
"bank"))),
109 'ba.label' => array(
'label' =>
"BankAccount",
'checked' => 1,
'position' => 60,
'enabled' => (isModEnabled(
"bank"))),
110 'p.num_paiement' => array(
'label' =>
"Numero",
'checked' => 1,
'position' => 70,
'tooltip' =>
"ChequeOrTransferNumber"),
111 'p.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 80),
112 'p.statut' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 90,
'enabled' => (
getDolGlobalString(
'BILL_ADD_PAYMENT_VALIDATION'))),
115'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
118$hookmanager->initHooks(array(
'paymentlist'));
121if (!$user->hasRight(
'societe',
'client',
'voir')) {
122 $search_sale = $user->id;
127 $socid = $user->socid;
136$parameters = array(
'socid' => $socid);
137$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
143if (empty($reshook)) {
144 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
147 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
149 $search_date_startday =
'';
150 $search_date_startmonth =
'';
151 $search_date_startyear =
'';
152 $search_date_endday =
'';
153 $search_date_endmonth =
'';
154 $search_date_endyear =
'';
155 $search_date_start =
'';
156 $search_date_end =
'';
157 $search_account =
'';
159 $search_paymenttype =
'';
160 $search_payment_num =
'';
161 $search_company =
'';
165 $search_array_options = array();
174$form =
new Form($db);
176$accountstatic =
new Account($db);
177$companystatic =
new Societe($db);
180llxHeader(
'', $langs->trans(
'ListPayment'),
'', 0, 0,
'',
'',
'',
'bodyforlist');
182if (
GETPOST(
"orphelins",
"alpha")) {
184 $sql =
"SELECT p.rowid, p.ref, p.datep, p.amount, p.statut, p.num_paiement as num_payment,";
185 $sql .=
" c.code as paiement_code";
190 $parameters = array();
191 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
192 $sql .= $hookmanager->resPrint;
193 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement as p LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_paiement = c.id";
194 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf ON p.rowid = pf.fk_paiement";
195 $sql .=
" WHERE p.entity IN (".getEntity(
'invoice').
")";
196 $sql .=
" AND pf.fk_facture IS NULL";
199 $parameters = array();
200 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
201 $sql .= $hookmanager->resPrint;
203 $sql =
"SELECT p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement as num_payment, p.amount";
204 $sql .=
", c.code as paiement_code";
205 $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";
206 $sql .=
", s.rowid as socid, s.nom as name, s.email";
209 $sql .=
", SUM(pf.amount) as totalamount, COUNT(f.rowid) as nbinvoices";
212 $parameters = array();
213 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
214 $sql .= $hookmanager->resPrint;
218 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement as p";
219 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_paiement = c.id";
220 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON p.fk_bank = b.rowid";
221 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
223 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf ON p.rowid = pf.fk_paiement";
224 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture as f ON pf.fk_facture = f.rowid";
225 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON f.fk_soc = s.rowid";
227 $sql .=
" WHERE p.entity IN (".getEntity(
'invoice').
")";
229 $sql .=
" AND EXISTS (SELECT f.fk_soc FROM ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"paiement_facture as pf";
230 $sql .=
" WHERE p.rowid = pf.fk_paiement AND pf.fk_facture = f.rowid AND f.fk_soc = ".((int) $socid).
")";
234 $sql .=
" AND p.fk_user_creat IS NULL";
236 $sql .=
" AND p.fk_user_creat = ".((int) $userid);
244 if ($search_date_start) {
245 $sql .=
" AND p.datep >= '" . $db->idate($search_date_start) .
"'";
247 if ($search_date_end) {
248 $sql .=
" AND p.datep <= '" . $db->idate($search_date_end) .
"'";
250 if ($search_account > 0) {
251 $sql .=
" AND b.fk_account=".((int) $search_account);
253 if ($search_paymenttype !=
'') {
254 $sql .=
" AND c.code='".$db->escape($search_paymenttype).
"'";
256 if ($search_payment_num !=
'') {
259 if ($search_amount) {
260 $sql .=
" AND (".natural_search(
'p.amount', $search_amount, 1, 1);
265 if ($search_company) {
269 if ($search_sale && $search_sale != -1) {
270 if ($search_sale == -2) {
271 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
272 } elseif ($search_sale > 0) {
273 $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).
")";
278 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
282 $parameters = array();
283 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
284 $sql .= $hookmanager->resPrint;
286 $sql .=
" GROUP BY p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement, p.amount";
288 $sql .=
", ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.fk_accountancy_journal";
289 $sql .=
", s.rowid, s.nom, s.email";
293$nbtotalofrecords =
'';
296 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(DISTINCT p.rowid) as nbtotalofrecords', $sql);
297 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
298 $resql = $db->query($sqlforcount);
300 $objforcount = $db->fetch_object($resql);
301 $nbtotalofrecords = $objforcount->nbtotalofrecords;
306 if (($page * $limit) > $nbtotalofrecords) {
314$sql .= $db->order($sortfield, $sortorder);
316 $sql .= $db->plimit($limit + 1, $offset);
320$resql = $db->query($sql);
328$num = $db->num_rows($resql);
331if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
332 $param .=
'&contextpage='.urlencode($contextpage);
334if ($limit > 0 && $limit != $conf->liste_limit) {
335 $param .=
'&limit='.((int) $limit);
339 $param .=
'&orphelins=1';
342 $param .=
'&search_ref='.urlencode($search_ref);
344if ($search_date_startday) {
345 $param .=
'&search_date_startday='.urlencode((
string) ($search_date_startday));
347if ($search_date_startmonth) {
348 $param .=
'&search_date_startmonth='.urlencode((
string) ($search_date_startmonth));
350if ($search_date_startyear) {
351 $param .=
'&search_date_startyear='.urlencode((
string) ($search_date_startyear));
353if ($search_date_endday) {
354 $param .=
'&search_date_endday='.urlencode((
string) ($search_date_endday));
356if ($search_date_endmonth) {
357 $param .=
'&search_date_endmonth='.urlencode((
string) ($search_date_endmonth));
359if ($search_date_endyear) {
360 $param .=
'&search_date_endyear='.urlencode((
string) ($search_date_endyear));
362if ($search_company) {
363 $param .=
'&search_company='.urlencode($search_company);
365if ($search_amount !=
'') {
366 $param .=
'&search_amount='.urlencode($search_amount);
368if ($search_paymenttype) {
369 $param .=
'&search_paymenttype='.urlencode($search_paymenttype);
371if ($search_account) {
372 $param .=
'&search_account='.urlencode((
string) ($search_account));
374if ($search_payment_num) {
375 $param .=
'&search_payment_num='.urlencode($search_payment_num);
377if ($optioncss !=
'') {
378 $param .=
'&optioncss='.urlencode($optioncss);
381print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
382if ($optioncss !=
'') {
383 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
385print
'<input type="hidden" name="token" value="'.newToken().
'">';
386print
'<input type="hidden" name="action" value="list">';
387print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
388print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
389print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
390print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
393print_barre_liste($langs->trans(
"ReceivedCustomersPayments"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'bill', 0,
'',
'', $limit, 0, 0, 1);
396 foreach ($fieldstosearchall as $key => $val) {
397 $fieldstosearchall[$key] = $langs->trans($val);
399 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
402$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
403$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
404$massactionbutton =
'';
405if ($massactionbutton) {
406 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
410print
'<div class="div-table-responsive">';
411print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
'').
'">';
415print
'<tr class="liste_titre_filter">';
419 print
'<td class="liste_titre center maxwidthsearch">';
420 $searchpicto = $form->showFilterButtons(
'left');
427 print
'<td class="liste_titre">';
432if (!empty($arrayfields[
'p.ref'][
'checked'])) {
433 print
'<td class="liste_titre left">';
434 print
'<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
439if (!empty($arrayfields[
'p.datep'][
'checked'])) {
440 print
'<td class="liste_titre center">';
441 print
'<div class="nowrapfordate">';
442 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
444 print
'<div class="nowrapfordate">';
445 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
451if (!empty($arrayfields[
's.nom'][
'checked'])) {
452 print
'<td class="liste_titre">';
453 print
'<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
458if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
459 print
'<td class="liste_titre">';
460 print $form->select_types_paiements($search_paymenttype,
'search_paymenttype',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
465if (!empty($arrayfields[
'transaction'][
'checked'])) {
466 print
'<td class="liste_titre">';
467 print
'<input class="flat" type="text" size="4" name="search_payment_num" value="'.dol_escape_htmltag($search_payment_num).
'">';
472if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
473 print
'<td class="liste_titre">';
478if (!empty($arrayfields[
'ba.label'][
'checked'])) {
479 print
'<td class="liste_titre">';
480 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
485if (!empty($arrayfields[
'p.amount'][
'checked'])) {
486 print
'<td class="liste_titre right">';
487 print
'<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
492if (!empty($arrayfields[
'p.statut'][
'checked'])) {
493 print
'<td class="liste_titre right">';
498$parameters = array(
'arrayfields' => $arrayfields);
499$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
500print $hookmanager->resPrint;
504 print
'<td class="liste_titre center maxwidthsearch">';
505 $searchpicto = $form->showFilterButtons();
512$totalarray = array();
513$totalarray[
'nbfield'] = 0;
517print
'<tr class="liste_titre">';
520 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
521 $totalarray[
'nbfield']++;
525 $totalarray[
'nbfield']++;
527if (!empty($arrayfields[
'p.ref'][
'checked'])) {
528 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
529 $totalarray[
'nbfield']++;
531if (!empty($arrayfields[
'p.datep'][
'checked'])) {
532 print_liste_field_titre($arrayfields[
'p.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datep",
'', $param,
'', $sortfield, $sortorder,
'center ');
533 $totalarray[
'nbfield']++;
535if (!empty($arrayfields[
's.nom'][
'checked'])) {
536 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
'', $param,
'', $sortfield, $sortorder);
537 $totalarray[
'nbfield']++;
539if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
540 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle",
'', $param,
'', $sortfield, $sortorder);
541 $totalarray[
'nbfield']++;
543if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
544 print_liste_field_titre($arrayfields[
'p.num_paiement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.num_paiement",
'', $param,
'', $sortfield, $sortorder,
'', $arrayfields[
'p.num_paiement'][
'tooltip']);
545 $totalarray[
'nbfield']++;
547if (!empty($arrayfields[
'transaction'][
'checked'])) {
548 print_liste_field_titre($arrayfields[
'transaction'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder);
549 $totalarray[
'nbfield']++;
551if (!empty($arrayfields[
'ba.label'][
'checked'])) {
552 print_liste_field_titre($arrayfields[
'ba.label'][
'label'], $_SERVER[
"PHP_SELF"],
"ba.label",
'', $param,
'', $sortfield, $sortorder);
553 $totalarray[
'nbfield']++;
555if (!empty($arrayfields[
'p.amount'][
'checked'])) {
556 print_liste_field_titre($arrayfields[
'p.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"p.amount",
'', $param,
'class="right"', $sortfield, $sortorder);
557 $totalarray[
'nbfield']++;
559if (!empty($arrayfields[
'p.statut'][
'checked'])) {
560 print_liste_field_titre($arrayfields[
'p.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.statut",
'', $param,
'class="right"', $sortfield, $sortorder);
561 $totalarray[
'nbfield']++;
564include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
566$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
567$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
568print $hookmanager->resPrint;
571 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
572 $totalarray[
'nbfield']++;
578$needToFetchEachLine = 0;
579if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
580 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
581 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
582 $needToFetchEachLine++;
591$savnbfield = $totalarray[
'nbfield'];
592$totalarray = array();
593$totalarray[
'nbfield'] = 0;
594$imaxinloop = ($limit ? min($num, $limit) : $num);
595while ($i < $imaxinloop) {
596 $objp = $db->fetch_object($resql);
602 $object->ref = ($objp->ref ? $objp->ref : $objp->rowid);
603 $object->date = $db->jdate($objp->datep);
604 $object->amount = $objp->amount;
606 $companystatic->id = $objp->socid;
607 $companystatic->name = $objp->name;
608 $companystatic->email = $objp->email;
610 if ($mode ==
'kanban') {
612 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
613 print
'<div class="box-flex-container kanban">';
617 if ($massactionbutton || $massaction) {
619 if (in_array(
$object->id, $arrayofselected)) {
624 print
$object->getKanbanView(
'', array(
'selected' => $selected));
625 if ($i == ($imaxinloop - 1)) {
632 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
636 print
'<td class="nowrap center">';
637 if ($massactionbutton || $massaction) {
639 if (in_array(
$object->id, $arrayofselected)) {
642 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
646 $totalarray[
'nbfield']++;
652 print
'<td class="nowraponall">'.(($offset * $limit) + $i).
'</td>';
654 $totalarray[
'nbfield']++;
659 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
660 print
'<td class="nowraponall">'.$object->getNomUrl(1).
'</td>';
662 $totalarray[
'nbfield']++;
667 if (!empty($arrayfields[
'p.datep'][
'checked'])) {
668 $dateformatforpayment =
'dayhour';
669 print
'<td class="nowraponall center">'.dol_print_date($db->jdate($objp->datep), $dateformatforpayment,
'tzuser').
'</td>';
671 $totalarray[
'nbfield']++;
676 if (!empty($arrayfields[
's.nom'][
'checked'])) {
677 print
'<td class="tdoverflowmax125">';
678 if ($objp->socid > 0) {
679 print $companystatic->getNomUrl(1,
'', 24);
683 $totalarray[
'nbfield']++;
688 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
689 print
'<td>'.$langs->trans(
"PaymentTypeShort".$objp->paiement_code).
'</td>';
691 $totalarray[
'nbfield']++;
696 if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
697 print
'<td>'.$objp->num_payment.
'</td>';
699 $totalarray[
'nbfield']++;
704 if (!empty($arrayfields[
'transaction'][
'checked'])) {
705 print
'<td class="tdoverflowmax125">';
706 if ($objp->fk_bank > 0) {
707 $bankline->fetch($objp->fk_bank);
708 print $bankline->getNomUrl(1, 0);
712 $totalarray[
'nbfield']++;
717 if (!empty($arrayfields[
'ba.label'][
'checked'])) {
719 if ($objp->bid > 0) {
720 $accountstatic->id = $objp->bid;
721 $accountstatic->ref = $objp->bref;
722 $accountstatic->label = $objp->blabel;
723 $accountstatic->number = $objp->number;
724 $accountstatic->account_number = $objp->account_number;
727 $accountingjournal->fetch($objp->accountancy_journal);
728 $accountstatic->accountancy_journal = $accountingjournal->code;
730 print $accountstatic->getNomUrl(1);
734 $totalarray[
'nbfield']++;
739 if (!empty($arrayfields[
'p.amount'][
'checked'])) {
740 print
'<td class="right">';
741 if ($objp->nbinvoices > 1 || ($objp->totalamount && $objp->amount != $objp->totalamount)) {
742 print $form->textwithpicto(
'', $langs->trans(
"PaymentMadeForSeveralInvoices"));
744 print
'<span class="amount">'.price($objp->amount).
'</span>';
747 $totalarray[
'nbfield']++;
748 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'amount';
750 if (empty($totalarray[
'val'][
'amount'])) {
751 $totalarray[
'val'][
'amount'] = $objp->amount;
753 $totalarray[
'val'][
'amount'] += $objp->amount;
758 if (!empty($arrayfields[
'p.statut'][
'checked'])) {
759 print
'<td class="right">';
760 if ($objp->statut == 0) {
761 print
'<a href="card.php?id='.$objp->rowid.
'&action=valide">';
763 print
$object->LibStatut($objp->statut, 5);
764 if ($objp->statut == 0) {
769 $totalarray[
'nbfield']++;
775 print
'<td class="nowrap center">';
776 if ($massactionbutton || $massaction) {
778 if (in_array(
$object->id, $arrayofselected)) {
781 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
785 $totalarray[
'nbfield']++;
796include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
801 foreach ($arrayfields as $key => $val) {
802 if (!empty($val[
'checked'])) {
806 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
811$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
812$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
813print $hookmanager->resPrint;
815print
'</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 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 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.
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.
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.