36require
'../../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
52$langs->loadLangs(array(
'bills',
'banks',
'compta',
'companies'));
54$action =
GETPOST(
'action',
'alpha');
55$massaction =
GETPOST(
'massaction',
'alpha');
56$confirm =
GETPOST(
'confirm',
'alpha');
57$optioncss =
GETPOST(
'optioncss',
'alpha');
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'paymentlist';
59$mode =
GETPOST(
'mode',
'alpha');
61$facid =
GETPOST(
'facid',
'int');
62$socid =
GETPOST(
'socid',
'int');
63$userid =
GETPOST(
'userid',
'int');
65$search_ref =
GETPOST(
"search_ref",
"alpha");
66$search_date_startday =
GETPOSTINT(
'search_date_startday');
67$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
68$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
69$search_date_endday =
GETPOSTINT(
'search_date_endday');
70$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
71$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
72$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
73$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
74$search_company =
GETPOST(
"search_company",
'alpha');
75$search_paymenttype =
GETPOST(
"search_paymenttype");
76$search_account =
GETPOST(
"search_account",
'alpha');
77$search_payment_num =
GETPOST(
'search_payment_num',
'alpha');
78$search_amount =
GETPOST(
"search_amount",
'alpha');
79$search_noteprivate =
GETPOST(
"search_noteprivate");
80$search_status =
GETPOST(
'search_status',
'intcomma');
85$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
86$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
89if (empty($page) || $page == -1) {
92$offset = $limit * $page;
100 $sortfield =
"p.ref";
103$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
106$fieldstosearchall = array(
107 'p.ref' =>
"RefPayment",
108 's.nom' =>
"ThirdParty",
109 'p.num_paiement' =>
"Numero",
110 'p.amount' =>
"Amount",
114 'p.ref' => array(
'label' =>
"RefPayment",
'checked' => 1,
'position' => 10),
115 'p.datep' => array(
'label' =>
"Date",
'checked' => 1,
'position' => 20),
116 's.nom' => array(
'label' =>
"ThirdParty",
'checked' => 1,
'position' => 30),
117 'c.libelle' => array(
'label' =>
"Type",
'checked' => 1,
'position' => 40),
118 'transaction' => array(
'label' =>
"BankTransactionLine",
'checked' => 1,
'position' => 50,
'enabled' => (isModEnabled(
"bank"))),
119 'ba.label' => array(
'label' =>
"BankAccount",
'checked' => 1,
'position' => 60,
'enabled' => (isModEnabled(
"bank"))),
120 'p.num_paiement' => array(
'label' =>
"Numero",
'checked' => 1,
'position' => 70,
'tooltip' =>
"ChequeOrTransferNumber"),
121 'p.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 80),
122 'p.note' => array(
'label' =>
"Comment",
'checked' => -1,
'position' => 85),
123 'p.statut' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 90,
'enabled' => (
getDolGlobalString(
'BILL_ADD_PAYMENT_VALIDATION'))),
126'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
129$hookmanager->initHooks(array(
'paymentlist'));
132if (!$user->hasRight(
'societe',
'client',
'voir')) {
133 $search_sale = $user->id;
138 $socid = $user->socid;
147$parameters = array(
'socid' => $socid);
148$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
154if (empty($reshook)) {
155 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
158 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
160 $search_date_startday =
'';
161 $search_date_startmonth =
'';
162 $search_date_startyear =
'';
163 $search_date_endday =
'';
164 $search_date_endmonth =
'';
165 $search_date_endyear =
'';
166 $search_date_start =
'';
167 $search_date_end =
'';
168 $search_account =
'';
170 $search_paymenttype =
'';
171 $search_payment_num =
'';
172 $search_company =
'';
173 $search_noteprivate =
'';
177 $search_array_options = array();
186$form =
new Form($db);
188$accountstatic =
new Account($db);
189$companystatic =
new Societe($db);
192$title = $langs->trans(
'ListPayment');
194llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'bodyforlist');
196if (
GETPOST(
"orphelins",
"alpha")) {
198 $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";
199 $sql .=
", c.code as paiement_code";
204 $parameters = array();
205 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
206 $sql .= $hookmanager->resPrint;
207 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement as p LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_paiement = c.id";
208 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf ON p.rowid = pf.fk_paiement";
209 $sql .=
" WHERE p.entity IN (".getEntity(
'invoice').
")";
210 $sql .=
" AND pf.fk_facture IS NULL";
213 $parameters = array();
214 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
215 $sql .= $hookmanager->resPrint;
217 $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";
218 $sql .=
", c.code as paiement_code";
219 $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";
220 $sql .=
", s.rowid as socid, s.nom as name, s.email";
223 $sql .=
", SUM(pf.amount) as totalamount, COUNT(f.rowid) as nbinvoices";
226 $parameters = array();
227 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
228 $sql .= $hookmanager->resPrint;
232 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement as p";
233 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_paiement = c.id";
234 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON p.fk_bank = b.rowid";
235 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON b.fk_account = ba.rowid";
237 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf ON p.rowid = pf.fk_paiement";
238 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture as f ON pf.fk_facture = f.rowid";
239 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON f.fk_soc = s.rowid";
241 $sql .=
" WHERE p.entity IN (".getEntity(
'invoice').
")";
243 $sql .=
" AND EXISTS (SELECT f.fk_soc FROM ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"paiement_facture as pf";
244 $sql .=
" WHERE p.rowid = pf.fk_paiement AND pf.fk_facture = f.rowid AND f.fk_soc = ".((int) $socid).
")";
248 $sql .=
" AND p.fk_user_creat IS NULL";
250 $sql .=
" AND p.fk_user_creat = ".((int) $userid);
258 if ($search_date_start) {
259 $sql .=
" AND p.datep >= '" . $db->idate($search_date_start) .
"'";
261 if ($search_date_end) {
262 $sql .=
" AND p.datep <= '" . $db->idate($search_date_end) .
"'";
264 if ($search_account > 0) {
265 $sql .=
" AND b.fk_account=".((int) $search_account);
267 if ($search_paymenttype !=
'') {
268 $sql .=
" AND c.code='".$db->escape($search_paymenttype).
"'";
270 if ($search_payment_num !=
'') {
273 if ($search_amount) {
274 $sql .=
" AND (".natural_search(
'p.amount', $search_amount, 1, 1);
279 if ($search_company) {
282 if ($search_noteprivate) {
286 if ($search_sale && $search_sale != -1) {
287 if ($search_sale == -2) {
288 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
289 } elseif ($search_sale > 0) {
290 $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).
")";
295 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
299 $parameters = array();
300 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
301 $sql .= $hookmanager->resPrint;
303 $sql .=
" GROUP BY p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement, p.amount, p.note";
305 $sql .=
", ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.fk_accountancy_journal";
306 $sql .=
", s.rowid, s.nom, s.email";
310$nbtotalofrecords =
'';
313 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(DISTINCT p.rowid) as nbtotalofrecords', $sql);
314 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
315 $resql = $db->query($sqlforcount);
317 $objforcount = $db->fetch_object($resql);
318 $nbtotalofrecords = $objforcount->nbtotalofrecords;
323 if (($page * $limit) > $nbtotalofrecords) {
331$sql .= $db->order($sortfield, $sortorder);
333 $sql .= $db->plimit($limit + 1, $offset);
337$resql = $db->query($sql);
345$num = $db->num_rows($resql);
348if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
349 $param .=
'&contextpage='.urlencode($contextpage);
351if ($limit > 0 && $limit !=
$conf->liste_limit) {
352 $param .=
'&limit='.((int) $limit);
354if ($optioncss !=
'') {
355 $param .=
'&optioncss='.urlencode($optioncss);
359 $param .=
'&orphelins=1';
362 $param .=
'&search_ref='.urlencode($search_ref);
364if ($search_date_startday) {
365 $param .=
'&search_date_startday='.urlencode((
string) ($search_date_startday));
367if ($search_date_startmonth) {
368 $param .=
'&search_date_startmonth='.urlencode((
string) ($search_date_startmonth));
370if ($search_date_startyear) {
371 $param .=
'&search_date_startyear='.urlencode((
string) ($search_date_startyear));
373if ($search_date_endday) {
374 $param .=
'&search_date_endday='.urlencode((
string) ($search_date_endday));
376if ($search_date_endmonth) {
377 $param .=
'&search_date_endmonth='.urlencode((
string) ($search_date_endmonth));
379if ($search_date_endyear) {
380 $param .=
'&search_date_endyear='.urlencode((
string) ($search_date_endyear));
382if ($search_company) {
383 $param .=
'&search_company='.urlencode($search_company);
385if ($search_amount !=
'') {
386 $param .=
'&search_amount='.urlencode($search_amount);
388if ($search_paymenttype) {
389 $param .=
'&search_paymenttype='.urlencode($search_paymenttype);
391if ($search_account) {
392 $param .=
'&search_account='.urlencode((
string) ($search_account));
394if ($search_payment_num) {
395 $param .=
'&search_payment_num='.urlencode($search_payment_num);
397if ($search_noteprivate) {
398 $param .=
'&search_noteprivate='.urlencode($search_noteprivate);
401print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
402if ($optioncss !=
'') {
403 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
405print
'<input type="hidden" name="token" value="'.newToken().
'">';
406print
'<input type="hidden" name="action" value="list">';
407print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
408print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
409print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
410print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
413print_barre_liste($langs->trans(
"ReceivedCustomersPayments"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'bill', 0,
'',
'', $limit, 0, 0, 1);
416 foreach ($fieldstosearchall as $key => $val) {
417 $fieldstosearchall[$key] = $langs->trans($val);
419 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
422$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
423$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
424$massactionbutton =
'';
425if ($massactionbutton) {
426 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
430print
'<div class="div-table-responsive">';
431print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
'').
'">';
435print
'<tr class="liste_titre_filter">';
439 print
'<td class="liste_titre center maxwidthsearch">';
440 $searchpicto = $form->showFilterButtons(
'left');
447 print
'<td class="liste_titre">';
452if (!empty($arrayfields[
'p.ref'][
'checked'])) {
453 print
'<td class="liste_titre left">';
454 print
'<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
459if (!empty($arrayfields[
'p.datep'][
'checked'])) {
460 print
'<td class="liste_titre center">';
461 print
'<div class="nowrapfordate">';
462 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
464 print
'<div class="nowrapfordate">';
465 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
471if (!empty($arrayfields[
's.nom'][
'checked'])) {
472 print
'<td class="liste_titre">';
473 print
'<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
478if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
479 print
'<td class="liste_titre">';
480 print $form->select_types_paiements($search_paymenttype,
'search_paymenttype',
'', 2, 1, 1, 0, 1,
'maxwidth100', 1);
485if (!empty($arrayfields[
'transaction'][
'checked'])) {
486 print
'<td class="liste_titre">';
487 print
'<input class="flat" type="text" size="4" name="search_payment_num" value="'.dol_escape_htmltag($search_payment_num).
'">';
492if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
493 print
'<td class="liste_titre">';
498if (!empty($arrayfields[
'ba.label'][
'checked'])) {
499 print
'<td class="liste_titre">';
500 $form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth125');
505if (!empty($arrayfields[
'p.amount'][
'checked'])) {
506 print
'<td class="liste_titre right">';
507 print
'<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
512if (!empty($arrayfields[
'p.note'][
'checked'])) {
513 print
'<td class="liste_titre">';
514 print
'<input class="flat maxwidth150" type="text" name="search_noteprivate" value="'.dol_escape_htmltag($search_noteprivate).
'">';
519if (!empty($arrayfields[
'p.statut'][
'checked'])) {
520 print
'<td class="liste_titre right">';
525$parameters = array(
'arrayfields' => $arrayfields);
526$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
527print $hookmanager->resPrint;
531 print
'<td class="liste_titre center maxwidthsearch">';
532 $searchpicto = $form->showFilterButtons();
539$totalarray = array();
540$totalarray[
'nbfield'] = 0;
544print
'<tr class="liste_titre">';
547 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
548 $totalarray[
'nbfield']++;
552 $totalarray[
'nbfield']++;
554if (!empty($arrayfields[
'p.ref'][
'checked'])) {
556 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
557 $totalarray[
'nbfield']++;
559if (!empty($arrayfields[
'p.datep'][
'checked'])) {
560 print_liste_field_titre($arrayfields[
'p.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datep",
'', $param,
'', $sortfield, $sortorder,
'center ');
561 $totalarray[
'nbfield']++;
563if (!empty($arrayfields[
's.nom'][
'checked'])) {
564 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
'', $param,
'', $sortfield, $sortorder);
565 $totalarray[
'nbfield']++;
567if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
568 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle",
'', $param,
'', $sortfield, $sortorder);
569 $totalarray[
'nbfield']++;
571if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
572 print_liste_field_titre($arrayfields[
'p.num_paiement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.num_paiement",
'', $param,
'', $sortfield, $sortorder,
'', $arrayfields[
'p.num_paiement'][
'tooltip']);
573 $totalarray[
'nbfield']++;
575if (!empty($arrayfields[
'transaction'][
'checked'])) {
576 print_liste_field_titre($arrayfields[
'transaction'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder);
577 $totalarray[
'nbfield']++;
579if (!empty($arrayfields[
'ba.label'][
'checked'])) {
580 print_liste_field_titre($arrayfields[
'ba.label'][
'label'], $_SERVER[
"PHP_SELF"],
"ba.label",
'', $param,
'', $sortfield, $sortorder);
581 $totalarray[
'nbfield']++;
583if (!empty($arrayfields[
'p.amount'][
'checked'])) {
584 print_liste_field_titre($arrayfields[
'p.amount'][
'label'], $_SERVER[
"PHP_SELF"],
"p.amount",
'', $param,
'class="right"', $sortfield, $sortorder);
585 $totalarray[
'nbfield']++;
587if (!empty($arrayfields[
'p.note'][
'checked'])) {
588 print_liste_field_titre($arrayfields[
'p.note'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note",
'', $param,
'', $sortfield, $sortorder);
589 $totalarray[
'nbfield']++;
591if (!empty($arrayfields[
'p.statut'][
'checked'])) {
592 print_liste_field_titre($arrayfields[
'p.statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.statut",
'', $param,
'class="right"', $sortfield, $sortorder);
593 $totalarray[
'nbfield']++;
596include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
598$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
599$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
600print $hookmanager->resPrint;
603 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
604 $totalarray[
'nbfield']++;
610$needToFetchEachLine = 0;
611if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
612 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
613 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
614 $needToFetchEachLine++;
623$savnbfield = $totalarray[
'nbfield'];
624$totalarray = array();
625$totalarray[
'nbfield'] = 0;
626$imaxinloop = ($limit ? min($num, $limit) : $num);
627while ($i < $imaxinloop) {
628 $objp = $db->fetch_object($resql);
634 $object->ref = ($objp->ref ? $objp->ref : $objp->rowid);
635 $object->date = $db->jdate($objp->datep);
636 $object->amount = $objp->amount;
637 $object->note_private = $objp->note_private;
639 $companystatic->id = $objp->socid;
640 $companystatic->name = $objp->name;
641 $companystatic->email = $objp->email;
643 if ($mode ==
'kanban') {
645 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
646 print
'<div class="box-flex-container kanban">';
650 if ($massactionbutton || $massaction) {
652 if (in_array(
$object->id, $arrayofselected)) {
657 print
$object->getKanbanView(
'', array(
'selected' => $selected));
658 if ($i == ($imaxinloop - 1)) {
665 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
669 print
'<td class="nowrap center">';
670 if ($massactionbutton || $massaction) {
672 if (in_array(
$object->id, $arrayofselected)) {
675 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
679 $totalarray[
'nbfield']++;
685 print
'<td class="nowraponall">'.(($offset * $limit) + $i).
'</td>';
687 $totalarray[
'nbfield']++;
692 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
693 print
'<td class="nowraponall">'.$object->getNomUrl(1).
'</td>';
695 $totalarray[
'nbfield']++;
700 if (!empty($arrayfields[
'p.datep'][
'checked'])) {
701 $dateformatforpayment =
'dayhour';
702 print
'<td class="nowraponall center">'.dol_print_date($db->jdate($objp->datep), $dateformatforpayment,
'tzuser').
'</td>';
704 $totalarray[
'nbfield']++;
709 if (!empty($arrayfields[
's.nom'][
'checked'])) {
710 print
'<td class="tdoverflowmax125">';
711 if ($objp->socid > 0) {
712 print $companystatic->getNomUrl(1,
'', 24);
716 $totalarray[
'nbfield']++;
721 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
722 print
'<td>'.$langs->trans(
"PaymentTypeShort".$objp->paiement_code).
'</td>';
724 $totalarray[
'nbfield']++;
729 if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
730 print
'<td>'.$objp->num_payment.
'</td>';
732 $totalarray[
'nbfield']++;
737 if (!empty($arrayfields[
'transaction'][
'checked'])) {
738 print
'<td class="tdoverflowmax125">';
739 if ($objp->fk_bank > 0) {
740 $bankline->fetch($objp->fk_bank);
741 print $bankline->getNomUrl(1, 0);
745 $totalarray[
'nbfield']++;
750 if (!empty($arrayfields[
'ba.label'][
'checked'])) {
752 if ($objp->bid > 0) {
753 $accountstatic->id = $objp->bid;
754 $accountstatic->ref = $objp->bref;
755 $accountstatic->label = $objp->blabel;
756 $accountstatic->number = $objp->number;
757 $accountstatic->account_number = $objp->account_number;
760 $accountingjournal->fetch($objp->accountancy_journal);
761 $accountstatic->accountancy_journal = $accountingjournal->code;
763 print $accountstatic->getNomUrl(1);
767 $totalarray[
'nbfield']++;
772 if (!empty($arrayfields[
'p.amount'][
'checked'])) {
773 print
'<td class="right">';
774 if ($objp->nbinvoices > 1 || ($objp->totalamount && $objp->amount != $objp->totalamount)) {
775 print $form->textwithpicto(
'', $langs->trans(
"PaymentMadeForSeveralInvoices"));
777 print
'<span class="amount">'.price($objp->amount).
'</span>';
780 $totalarray[
'nbfield']++;
781 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'amount';
783 if (empty($totalarray[
'val'][
'amount'])) {
784 $totalarray[
'val'][
'amount'] = $objp->amount;
786 $totalarray[
'val'][
'amount'] += $objp->amount;
791 if (!empty($arrayfields[
'p.note'][
'checked'])) {
793 print
'<td class="tdoverflowmax200" title="'.dolPrintHTMLForAttribute($firstline).
'">';
797 $totalarray[
'nbfield']++;
802 if (!empty($arrayfields[
'p.statut'][
'checked'])) {
803 print
'<td class="right">';
804 if ($objp->statut == 0) {
805 print
'<a href="card.php?id='.$objp->rowid.
'&action=valide">';
807 print
$object->LibStatut($objp->statut, 5);
808 if ($objp->statut == 0) {
813 $totalarray[
'nbfield']++;
819 print
'<td class="nowrap center">';
820 if ($massactionbutton || $massaction) {
822 if (in_array(
$object->id, $arrayofselected)) {
825 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
829 $totalarray[
'nbfield']++;
840include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
845 foreach ($arrayfields as $key => $val) {
846 if (!empty($val[
'checked'])) {
850 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
855$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
856$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
857print $hookmanager->resPrint;
859print
'</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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.