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_noteprivate =
GETPOST(
"search_noteprivate");
71$search_status =
GETPOST(
'search_status',
'intcomma');
76$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
77$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
80if (empty($page) || $page == -1) {
83$offset = $limit * $page;
94$search_all = trim(GETPOSTISSET(
"search_all") ?
GETPOST(
"search_all",
'alpha') :
GETPOST(
'sall'));
97$fieldstosearchall = array(
98 'p.ref' =>
"RefPayment",
99 's.nom' =>
"ThirdParty",
100 'p.num_paiement' =>
"Numero",
101 'p.amount' =>
"Amount",
105 'p.ref' => array(
'label' =>
"RefPayment",
'checked' => 1,
'position' => 10),
106 'p.datep' => array(
'label' =>
"Date",
'checked' => 1,
'position' => 20),
107 's.nom' => array(
'label' =>
"ThirdParty",
'checked' => 1,
'position' => 30),
108 'c.libelle' => array(
'label' =>
"Type",
'checked' => 1,
'position' => 40),
109 'transaction' => array(
'label' =>
"BankTransactionLine",
'checked' => 1,
'position' => 50,
'enabled' => (isModEnabled(
"bank"))),
110 'ba.label' => array(
'label' =>
"BankAccount",
'checked' => 1,
'position' => 60,
'enabled' => (isModEnabled(
"bank"))),
111 'p.num_paiement' => array(
'label' =>
"Numero",
'checked' => 1,
'position' => 70,
'tooltip' =>
"ChequeOrTransferNumber"),
112 'p.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 80),
113 'p.note' => array(
'label' =>
"Comment",
'checked' => -1,
'position' => 85),
114 'p.statut' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 90,
'enabled' => (
getDolGlobalString(
'BILL_ADD_PAYMENT_VALIDATION'))),
117'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
120$hookmanager->initHooks(array(
'paymentlist'));
123if (!$user->hasRight(
'societe',
'client',
'voir')) {
124 $search_sale = $user->id;
129 $socid = $user->socid;
138$parameters = array(
'socid' => $socid);
139$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
145if (empty($reshook)) {
146 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
149 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
151 $search_date_startday =
'';
152 $search_date_startmonth =
'';
153 $search_date_startyear =
'';
154 $search_date_endday =
'';
155 $search_date_endmonth =
'';
156 $search_date_endyear =
'';
157 $search_date_start =
'';
158 $search_date_end =
'';
159 $search_account =
'';
161 $search_paymenttype =
'';
162 $search_payment_num =
'';
163 $search_company =
'';
164 $search_noteprivate =
'';
168 $search_array_options = array();
177$form =
new Form($db);
179$accountstatic =
new Account($db);
180$companystatic =
new Societe($db);
183$title = $langs->trans(
'ListPayment');
185llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'bodyforlist');
187if (
GETPOST(
"orphelins",
"alpha")) {
189 $sql =
"SELECT p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement as num_payment, p.amount, p.note as private_note";
190 $sql .=
", c.code as paiement_code";
195 $parameters = array();
196 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
197 $sql .= $hookmanager->resPrint;
198 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement as p LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_paiement = c.id";
199 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf ON p.rowid = pf.fk_paiement";
200 $sql .=
" WHERE p.entity IN (".getEntity(
'invoice').
")";
201 $sql .=
" AND pf.fk_facture IS NULL";
204 $parameters = array();
205 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
206 $sql .= $hookmanager->resPrint;
208 $sql =
"SELECT p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement as num_payment, p.amount, p.note as note_private";
209 $sql .=
", c.code as paiement_code";
210 $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";
211 $sql .=
", s.rowid as socid, s.nom as name, s.email";
214 $sql .=
", SUM(pf.amount) as totalamount, COUNT(f.rowid) as nbinvoices";
217 $parameters = array();
218 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
219 $sql .= $hookmanager->resPrint;
223 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement as p";
224 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_paiement = c.id";
225 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON p.fk_bank = b.rowid";
226 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
228 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf ON p.rowid = pf.fk_paiement";
229 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture as f ON pf.fk_facture = f.rowid";
230 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON f.fk_soc = s.rowid";
232 $sql .=
" WHERE p.entity IN (".getEntity(
'invoice').
")";
234 $sql .=
" AND EXISTS (SELECT f.fk_soc FROM ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"paiement_facture as pf";
235 $sql .=
" WHERE p.rowid = pf.fk_paiement AND pf.fk_facture = f.rowid AND f.fk_soc = ".((int) $socid).
")";
239 $sql .=
" AND p.fk_user_creat IS NULL";
241 $sql .=
" AND p.fk_user_creat = ".((int) $userid);
249 if ($search_date_start) {
250 $sql .=
" AND p.datep >= '" . $db->idate($search_date_start) .
"'";
252 if ($search_date_end) {
253 $sql .=
" AND p.datep <= '" . $db->idate($search_date_end) .
"'";
255 if ($search_account > 0) {
256 $sql .=
" AND b.fk_account=".((int) $search_account);
258 if ($search_paymenttype !=
'') {
259 $sql .=
" AND c.code='".$db->escape($search_paymenttype).
"'";
261 if ($search_payment_num !=
'') {
264 if ($search_amount) {
265 $sql .=
" AND (".natural_search(
'p.amount', $search_amount, 1, 1);
270 if ($search_company) {
273 if ($search_noteprivate) {
277 if ($search_sale && $search_sale != -1) {
278 if ($search_sale == -2) {
279 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
280 } elseif ($search_sale > 0) {
281 $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).
")";
286 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
290 $parameters = array();
291 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
292 $sql .= $hookmanager->resPrint;
294 $sql .=
" GROUP BY p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement, p.amount, p.note";
296 $sql .=
", ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.fk_accountancy_journal";
297 $sql .=
", s.rowid, s.nom, s.email";
301$nbtotalofrecords =
'';
304 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(DISTINCT p.rowid) as nbtotalofrecords', $sql);
305 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
306 $resql = $db->query($sqlforcount);
308 $objforcount = $db->fetch_object($resql);
309 $nbtotalofrecords = $objforcount->nbtotalofrecords;
314 if (($page * $limit) > $nbtotalofrecords) {
322$sql .= $db->order($sortfield, $sortorder);
324 $sql .= $db->plimit($limit + 1, $offset);
328$resql = $db->query($sql);
336$num = $db->num_rows($resql);
339if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
340 $param .=
'&contextpage='.urlencode($contextpage);
342if ($limit > 0 && $limit != $conf->liste_limit) {
343 $param .=
'&limit='.((int) $limit);
345if ($optioncss !=
'') {
346 $param .=
'&optioncss='.urlencode($optioncss);
350 $param .=
'&orphelins=1';
353 $param .=
'&search_ref='.urlencode($search_ref);
355if ($search_date_startday) {
356 $param .=
'&search_date_startday='.urlencode((
string) ($search_date_startday));
358if ($search_date_startmonth) {
359 $param .=
'&search_date_startmonth='.urlencode((
string) ($search_date_startmonth));
361if ($search_date_startyear) {
362 $param .=
'&search_date_startyear='.urlencode((
string) ($search_date_startyear));
364if ($search_date_endday) {
365 $param .=
'&search_date_endday='.urlencode((
string) ($search_date_endday));
367if ($search_date_endmonth) {
368 $param .=
'&search_date_endmonth='.urlencode((
string) ($search_date_endmonth));
370if ($search_date_endyear) {
371 $param .=
'&search_date_endyear='.urlencode((
string) ($search_date_endyear));
373if ($search_company) {
374 $param .=
'&search_company='.urlencode($search_company);
376if ($search_amount !=
'') {
377 $param .=
'&search_amount='.urlencode($search_amount);
379if ($search_paymenttype) {
380 $param .=
'&search_paymenttype='.urlencode($search_paymenttype);
382if ($search_account) {
383 $param .=
'&search_account='.urlencode((
string) ($search_account));
385if ($search_payment_num) {
386 $param .=
'&search_payment_num='.urlencode($search_payment_num);
388if ($search_noteprivate) {
389 $param .=
'&search_noteprivate='.urlencode($search_noteprivate);
392print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
393if ($optioncss !=
'') {
394 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
396print
'<input type="hidden" name="token" value="'.newToken().
'">';
397print
'<input type="hidden" name="action" value="list">';
398print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
399print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
400print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
401print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
404print_barre_liste($langs->trans(
"ReceivedCustomersPayments"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'bill', 0,
'',
'', $limit, 0, 0, 1);
407 foreach ($fieldstosearchall as $key => $val) {
408 $fieldstosearchall[$key] = $langs->trans($val);
410 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
413$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
414$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
415$massactionbutton =
'';
416if ($massactionbutton) {
417 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
421print
'<div class="div-table-responsive">';
422print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
'').
'">';
426print
'<tr class="liste_titre_filter">';
430 print
'<td class="liste_titre center maxwidthsearch">';
431 $searchpicto = $form->showFilterButtons(
'left');
438 print
'<td class="liste_titre">';
443if (!empty($arrayfields[
'p.ref'][
'checked'])) {
444 print
'<td class="liste_titre left">';
445 print
'<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
450if (!empty($arrayfields[
'p.datep'][
'checked'])) {
451 print
'<td class="liste_titre center">';
452 print
'<div class="nowrapfordate">';
453 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
455 print
'<div class="nowrapfordate">';
456 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
462if (!empty($arrayfields[
's.nom'][
'checked'])) {
463 print
'<td class="liste_titre">';
464 print
'<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
469if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
470 print
'<td class="liste_titre">';
471 print $form->select_types_paiements($search_paymenttype,
'search_paymenttype',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
476if (!empty($arrayfields[
'transaction'][
'checked'])) {
477 print
'<td class="liste_titre">';
478 print
'<input class="flat" type="text" size="4" name="search_payment_num" value="'.dol_escape_htmltag($search_payment_num).
'">';
483if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
484 print
'<td class="liste_titre">';
489if (!empty($arrayfields[
'ba.label'][
'checked'])) {
490 print
'<td class="liste_titre">';
491 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth125');
496if (!empty($arrayfields[
'p.amount'][
'checked'])) {
497 print
'<td class="liste_titre right">';
498 print
'<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
503if (!empty($arrayfields[
'p.note'][
'checked'])) {
504 print
'<td class="liste_titre">';
505 print
'<input class="flat maxwidth150" type="text" name="search_noteprivate" value="'.dol_escape_htmltag($search_noteprivate).
'">';
510if (!empty($arrayfields[
'p.statut'][
'checked'])) {
511 print
'<td class="liste_titre right">';
516$parameters = array(
'arrayfields' => $arrayfields);
517$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
518print $hookmanager->resPrint;
522 print
'<td class="liste_titre center maxwidthsearch">';
523 $searchpicto = $form->showFilterButtons();
530$totalarray = array();
531$totalarray[
'nbfield'] = 0;
535print
'<tr class="liste_titre">';
538 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
539 $totalarray[
'nbfield']++;
543 $totalarray[
'nbfield']++;
545if (!empty($arrayfields[
'p.ref'][
'checked'])) {
547 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
548 $totalarray[
'nbfield']++;
550if (!empty($arrayfields[
'p.datep'][
'checked'])) {
551 print_liste_field_titre($arrayfields[
'p.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datep",
'', $param,
'', $sortfield, $sortorder,
'center ');
552 $totalarray[
'nbfield']++;
554if (!empty($arrayfields[
's.nom'][
'checked'])) {
555 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
'', $param,
'', $sortfield, $sortorder);
556 $totalarray[
'nbfield']++;
558if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
559 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle",
'', $param,
'', $sortfield, $sortorder);
560 $totalarray[
'nbfield']++;
562if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
563 print_liste_field_titre($arrayfields[
'p.num_paiement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.num_paiement",
'', $param,
'', $sortfield, $sortorder,
'', $arrayfields[
'p.num_paiement'][
'tooltip']);
564 $totalarray[
'nbfield']++;
566if (!empty($arrayfields[
'transaction'][
'checked'])) {
567 print_liste_field_titre($arrayfields[
'transaction'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder);
568 $totalarray[
'nbfield']++;
570if (!empty($arrayfields[
'ba.label'][
'checked'])) {
571 print_liste_field_titre($arrayfields[
'ba.label'][
'label'], $_SERVER[
"PHP_SELF"],
"ba.label",
'', $param,
'', $sortfield, $sortorder);
572 $totalarray[
'nbfield']++;
574if (!empty($arrayfields[
'p.amount'][
'checked'])) {
575 print_liste_field_titre($arrayfields[
'p.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"p.amount",
'', $param,
'class="right"', $sortfield, $sortorder);
576 $totalarray[
'nbfield']++;
578if (!empty($arrayfields[
'p.note'][
'checked'])) {
579 print_liste_field_titre($arrayfields[
'p.note'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note",
'', $param,
'', $sortfield, $sortorder);
580 $totalarray[
'nbfield']++;
582if (!empty($arrayfields[
'p.statut'][
'checked'])) {
583 print_liste_field_titre($arrayfields[
'p.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.statut",
'', $param,
'class="right"', $sortfield, $sortorder);
584 $totalarray[
'nbfield']++;
587include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
589$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
590$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
591print $hookmanager->resPrint;
594 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
595 $totalarray[
'nbfield']++;
601$needToFetchEachLine = 0;
602if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
603 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
604 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
605 $needToFetchEachLine++;
614$savnbfield = $totalarray[
'nbfield'];
615$totalarray = array();
616$totalarray[
'nbfield'] = 0;
617$imaxinloop = ($limit ? min($num, $limit) : $num);
618while ($i < $imaxinloop) {
619 $objp = $db->fetch_object($resql);
625 $object->ref = ($objp->ref ? $objp->ref : $objp->rowid);
626 $object->date = $db->jdate($objp->datep);
627 $object->amount = $objp->amount;
628 $object->note_private = $objp->note_private;
630 $companystatic->id = $objp->socid;
631 $companystatic->name = $objp->name;
632 $companystatic->email = $objp->email;
634 if ($mode ==
'kanban') {
636 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
637 print
'<div class="box-flex-container kanban">';
641 if ($massactionbutton || $massaction) {
643 if (in_array(
$object->id, $arrayofselected)) {
648 print
$object->getKanbanView(
'', array(
'selected' => $selected));
649 if ($i == ($imaxinloop - 1)) {
656 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
660 print
'<td class="nowrap center">';
661 if ($massactionbutton || $massaction) {
663 if (in_array(
$object->id, $arrayofselected)) {
666 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
670 $totalarray[
'nbfield']++;
676 print
'<td class="nowraponall">'.(($offset * $limit) + $i).
'</td>';
678 $totalarray[
'nbfield']++;
683 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
684 print
'<td class="nowraponall">'.$object->getNomUrl(1).
'</td>';
686 $totalarray[
'nbfield']++;
691 if (!empty($arrayfields[
'p.datep'][
'checked'])) {
692 $dateformatforpayment =
'dayhour';
693 print
'<td class="nowraponall center">'.dol_print_date($db->jdate($objp->datep), $dateformatforpayment,
'tzuser').
'</td>';
695 $totalarray[
'nbfield']++;
700 if (!empty($arrayfields[
's.nom'][
'checked'])) {
701 print
'<td class="tdoverflowmax125">';
702 if ($objp->socid > 0) {
703 print $companystatic->getNomUrl(1,
'', 24);
707 $totalarray[
'nbfield']++;
712 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
713 print
'<td>'.$langs->trans(
"PaymentTypeShort".$objp->paiement_code).
'</td>';
715 $totalarray[
'nbfield']++;
720 if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
721 print
'<td>'.$objp->num_payment.
'</td>';
723 $totalarray[
'nbfield']++;
728 if (!empty($arrayfields[
'transaction'][
'checked'])) {
729 print
'<td class="tdoverflowmax125">';
730 if ($objp->fk_bank > 0) {
731 $bankline->fetch($objp->fk_bank);
732 print $bankline->getNomUrl(1, 0);
736 $totalarray[
'nbfield']++;
741 if (!empty($arrayfields[
'ba.label'][
'checked'])) {
743 if ($objp->bid > 0) {
744 $accountstatic->id = $objp->bid;
745 $accountstatic->ref = $objp->bref;
746 $accountstatic->label = $objp->blabel;
747 $accountstatic->number = $objp->number;
748 $accountstatic->account_number = $objp->account_number;
751 $accountingjournal->fetch($objp->accountancy_journal);
752 $accountstatic->accountancy_journal = $accountingjournal->code;
754 print $accountstatic->getNomUrl(1);
758 $totalarray[
'nbfield']++;
763 if (!empty($arrayfields[
'p.amount'][
'checked'])) {
764 print
'<td class="right">';
765 if ($objp->nbinvoices > 1 || ($objp->totalamount && $objp->amount != $objp->totalamount)) {
766 print $form->textwithpicto(
'', $langs->trans(
"PaymentMadeForSeveralInvoices"));
768 print
'<span class="amount">'.price($objp->amount).
'</span>';
771 $totalarray[
'nbfield']++;
772 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'amount';
774 if (empty($totalarray[
'val'][
'amount'])) {
775 $totalarray[
'val'][
'amount'] = $objp->amount;
777 $totalarray[
'val'][
'amount'] += $objp->amount;
782 if (!empty($arrayfields[
'p.note'][
'checked'])) {
784 print
'<td class="tdoverflowmax200" title="'.dolPrintHTMLForAttribute($firstline).
'">';
788 $totalarray[
'nbfield']++;
793 if (!empty($arrayfields[
'p.statut'][
'checked'])) {
794 print
'<td class="right">';
795 if ($objp->statut == 0) {
796 print
'<a href="card.php?id='.$objp->rowid.
'&action=valide">';
798 print
$object->LibStatut($objp->statut, 5);
799 if ($objp->statut == 0) {
804 $totalarray[
'nbfield']++;
810 print
'<td class="nowrap center">';
811 if ($massactionbutton || $massaction) {
813 if (in_array(
$object->id, $arrayofselected)) {
816 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
820 $totalarray[
'nbfield']++;
831include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
836 foreach ($arrayfields as $key => $val) {
837 if (!empty($val[
'checked'])) {
841 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
846$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
847$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
848print $hookmanager->resPrint;
850print
'</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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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 a 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.