dolibarr  9.0.0
paiement.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
4  * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
5  * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
6  * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
7  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
8  * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
9  * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
10  * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
11  * Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
12  * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program. If not, see <http://www.gnu.org/licenses/>.
26  */
27 
34 require '../../main.inc.php';
35 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
38 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
39 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
40 
41 $langs->loadLangs(array('companies', 'bills', 'banks', 'compta'));
42 
43 // Security check
44 $action = GETPOST('action','alpha');
45 $confirm = GETPOST('confirm');
46 $facid = GETPOST('facid','int');
47 $socid = GETPOST('socid','int');
48 $accountid = GETPOST('accountid');
49 $day = GETPOST('day','int');
50 $month = GETPOST('month','int');
51 $year = GETPOST('year','int');
52 
53 $search_ref=GETPOST("search_ref","int");
54 $search_account=GETPOST("search_account","int");
55 $search_paymenttype=GETPOST("search_paymenttype");
56 $search_amount=GETPOST("search_amount",'alpha'); // alpha because we must be able to search on "< x"
57 $search_company=GETPOST("search_company",'alpha');
58 $search_payment_num=GETPOST('search_payment_num','alpha');
59 
60 $sortfield = GETPOST("sortfield",'alpha');
61 $sortorder = GETPOST("sortorder",'alpha');
62 $page = GETPOST("page",'int');
63 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
64 $offset = $conf->liste_limit * $page;
65 $pageprev = $page - 1;
66 $pagenext = $page + 1;
67 $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
68 if (! $sortorder) $sortorder="DESC";
69 if (! $sortfield) $sortfield="p.rowid";
70 $optioncss = GETPOST('optioncss','alpha');
71 
72 $amounts = array();array();
73 $amountsresttopay=array();
74 $addwarning=0;
75 
76 $multicurrency_amounts=array();
77 $multicurrency_amountsresttopay=array();
78 
79 // Security check
80 if ($user->societe_id > 0)
81 {
82  $socid = $user->societe_id;
83 }
84 
85 
86 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
87 $hookmanager->initHooks(array('paymentsupplier'));
88 $extrafields = new ExtraFields($db);
89 
90 // fetch optionals attributes and labels
91 $extralabels = $extrafields->fetch_name_optionals_label('paymentsupplier');
92 $search_array_options=$extrafields->getOptionalsFromPost('paymentsupplier','','search_');
93 
94 $arrayfields=array();
95 
96 
97 
98 /*
99  * Actions
100  */
101 
102 if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
103 {
104  $search_ref="";
105  $search_account="";
106  $search_amount="";
107  $search_paymenttype="";
108  $search_payment_num="";
109  $search_company="";
110  $day='';
111  $year='';
112  $month='';
113  $search_array_options=array();
114 }
115 
116 $parameters=array('socid'=>$socid);
117 $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
118 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
119 
120 if (empty($reshook))
121 {
122  if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
123  {
124  $error = 0;
125 
126  $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
127  $paiement_id = 0;
128  $totalpayment = 0;
129  $atleastonepaymentnotnull = 0;
130 
131  // Generate payment array and check if there is payment higher than invoice and payment date before invoice date
132  $tmpinvoice=new FactureFournisseur($db);
133  foreach ($_POST as $key => $value)
134  {
135  if (substr($key,0,7) == 'amount_')
136  {
137  $cursorfacid = substr($key,7);
138  $amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
139  $totalpayment = $totalpayment + $amounts[$cursorfacid];
140  if (! empty($amounts[$cursorfacid])) $atleastonepaymentnotnull++;
141  $result=$tmpinvoice->fetch($cursorfacid);
142  if ($result <= 0) dol_print_error($db);
143  $amountsresttopay[$cursorfacid]=price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement());
144  if ($amounts[$cursorfacid])
145  {
146  // Check amount
147  if ($amounts[$cursorfacid] && (abs($amounts[$cursorfacid]) > abs($amountsresttopay[$cursorfacid])))
148  {
149  $addwarning=1;
150  $formquestion['text'] = img_warning($langs->trans("PaymentHigherThanReminderToPaySupplier")).' '.$langs->trans("HelpPaymentHigherThanReminderToPaySupplier");
151  }
152  // Check date
153  if ($datepaye && ($datepaye < $tmpinvoice->date))
154  {
155  $langs->load("errors");
156  //$error++;
157  setEventMessages($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), null, 'warnings');
158  }
159  }
160 
161  $formquestion[$i++]=array('type' => 'hidden','name' => $key, 'value' => $_POST[$key]);
162  }
163  elseif (substr($key,0,21) == 'multicurrency_amount_')
164  {
165  $cursorfacid = substr($key,21);
166  $multicurrency_amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
167  $multicurrency_totalpayment += $multicurrency_amounts[$cursorfacid];
168  if (! empty($multicurrency_amounts[$cursorfacid])) $atleastonepaymentnotnull++;
169  $result=$tmpinvoice->fetch($cursorfacid);
170  if ($result <= 0) dol_print_error($db);
171  $multicurrency_amountsresttopay[$cursorfacid]=price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement(1));
172  if ($multicurrency_amounts[$cursorfacid])
173  {
174  // Check amount
175  if ($multicurrency_amounts[$cursorfacid] && (abs($multicurrency_amounts[$cursorfacid]) > abs($multicurrency_amountsresttopay[$cursorfacid])))
176  {
177  $addwarning=1;
178  $formquestion['text'] = img_warning($langs->trans("PaymentHigherThanReminderToPaySupplier")).' '.$langs->trans("HelpPaymentHigherThanReminderToPaySupplier");
179  }
180  // Check date
181  if ($datepaye && ($datepaye < $tmpinvoice->date))
182  {
183  $langs->load("errors");
184  //$error++;
185  setEventMessages($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), null, 'warnings');
186  }
187  }
188 
189  $formquestion[$i++]=array('type' => 'hidden','name' => $key, 'value' => GETPOST($key, 'int'));
190  }
191  }
192 
193  // Check parameters
194  if ($_POST['paiementid'] <= 0)
195  {
196  setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), null, 'errors');
197  $error++;
198  }
199 
200  if (! empty($conf->banque->enabled))
201  {
202  // If bank module is on, account is required to enter a payment
203  if (GETPOST('accountid') <= 0)
204  {
205  setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), null, 'errors');
206  $error++;
207  }
208  }
209 
210  if (empty($totalpayment) && empty($multicurrency_totalpayment) && empty($atleastonepaymentnotnull))
211  {
212  setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), null, 'errors');
213  $error++;
214  }
215 
216  if (empty($datepaye))
217  {
218  setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), null, 'errors');
219  $error++;
220  }
221 
222  // Check if payments in both currency
223  if ($totalpayment > 0 && $multicurrency_totalpayment > 0)
224  {
225  setEventMessages($langs->transnoentities('ErrorPaymentInBothCurrency'), null, 'errors');
226  $error++;
227  }
228  }
229 
230  /*
231  * Action add_paiement
232  */
233  if ($action == 'add_paiement')
234  {
235  if ($error)
236  {
237  $action = 'create';
238  }
239  // Le reste propre a cette action s'affiche en bas de page.
240  }
241 
242 
243  /*
244  * Action confirm_paiement
245  */
246  if ($action == 'confirm_paiement' && $confirm == 'yes')
247  {
248  $error=0;
249 
250  $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
251 
252  if (! $error)
253  {
254  $db->begin();
255 
256  // Creation de la ligne paiement
257  $paiement = new PaiementFourn($db);
258  $paiement->datepaye = $datepaye;
259  $paiement->amounts = $amounts; // Array of amounts
260  $paiement->multicurrency_amounts = $multicurrency_amounts;
261  $paiement->paiementid = $_POST['paiementid'];
262  $paiement->num_paiement = $_POST['num_paiement'];
263  $paiement->note = $_POST['comment'];
264  if (! $error)
265  {
266  $paiement_id = $paiement->create($user,(GETPOST('closepaidinvoices')=='on'?1:0));
267  if ($paiement_id < 0)
268  {
269  setEventMessages($paiement->error, $paiement->errors, 'errors');
270  $error++;
271  }
272  }
273 
274  if (! $error)
275  {
276  $result=$paiement->addPaymentToBank($user,'payment_supplier','(SupplierInvoicePayment)',$accountid,'','');
277  if ($result < 0)
278  {
279  setEventMessages($paiement->error, $paiement->errors, 'errors');
280  $error++;
281  }
282  }
283 
284  if (! $error)
285  {
286  $db->commit();
287 
288  // If payment dispatching on more than one invoice, we keep on summary page, otherwise go on invoice card
289  $invoiceid=0;
290  foreach ($paiement->amounts as $key => $amount)
291  {
292  $facid = $key;
293  if (is_numeric($amount) && $amount <> 0)
294  {
295  if ($invoiceid != 0) $invoiceid=-1; // There is more than one invoice payed by this payment
296  else $invoiceid=$facid;
297  }
298  }
299  if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$invoiceid;
300  else $loc = DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$paiement_id;
301  header('Location: '.$loc);
302  exit;
303  }
304  else
305  {
306  $db->rollback();
307  }
308  }
309  }
310 }
311 
312 
313 /*
314  * View
315  */
316 
317 $supplierstatic=new Societe($db);
318 $invoicesupplierstatic = new FactureFournisseur($db);
319 
320 llxHeader('',$langs->trans('ListPayment'));
321 
322 $form=new Form($db);
323 $formother=new FormOther($db);
324 
325 if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement')
326 {
327  $object = new FactureFournisseur($db);
328  $result = $object->fetch($facid);
329 
330  $datefacture=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
331  $dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datefacture);
332 
333  $sql = 'SELECT s.nom as name, s.rowid as socid,';
334  $sql.= ' f.rowid, f.ref, f.ref_supplier, f.amount, f.total_ttc as total, f.fk_mode_reglement, f.fk_account';
335  if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
336  $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f';
337  if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
338  $sql.= ' WHERE f.fk_soc = s.rowid';
339  $sql.= ' AND f.rowid = '.$facid;
340  if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
341  $resql = $db->query($sql);
342  if ($resql)
343  {
344  $num = $db->num_rows($resql);
345  if ($num)
346  {
347  $obj = $db->fetch_object($resql);
348  $total = $obj->total;
349 
350  print load_fiche_titre($langs->trans('DoPayment'));
351 
352  // Add realtime total information
353  if (! empty($conf->use_javascript_ajax))
354  {
355  print "\n".'<script type="text/javascript" language="javascript">';
356  print '$(document).ready(function () {
357 
358  function _elemToJson(selector)
359  {
360  var subJson = {};
361  $.map(selector.serializeArray(), function(n,i)
362  {
363  subJson[n["name"]] = n["value"];
364  });
365 
366  return subJson;
367  }
368  function callForResult(imgId)
369  {
370  var json = {};
371  var form = $("#payment_form");
372 
373  json["invoice_type"] = $("#invoice_type").val();
374  json["amountPayment"] = $("#amountpayment").attr("value");
375  json["amounts"] = _elemToJson(form.find("input.amount"));
376  json["remains"] = _elemToJson(form.find("input.remain"));
377 
378  if (imgId != null) {
379  json["imgClicked"] = imgId;
380  }
381 
382  $.post("'.DOL_URL_ROOT.'/compta/ajaxpayment.php", json, function(data)
383  {
384  json = $.parseJSON(data);
385 
386  form.data(json);
387 
388  for (var key in json)
389  {
390  if (key == "result") {
391  if (json["makeRed"]) {
392  $("#"+key).addClass("error");
393  } else {
394  $("#"+key).removeClass("error");
395  }
396  json[key]=json["label"]+" "+json[key];
397  $("#"+key).text(json[key]);
398  } else {console.log(key);
399  form.find("input[name*=\""+key+"\"]").each(function() {
400  $(this).attr("value", json[key]);
401  });
402  }
403  }
404  });
405  }
406  $("#payment_form").find("input.amount").change(function() {
407  callForResult();
408  });
409  $("#payment_form").find("input.amount").keyup(function() {
410  callForResult();
411  });
412  ';
413 
414  print ' });'."\n";
415 
416  //Add js for AutoFill
417  print ' $(document).ready(function () {';
418  print ' $(".AutoFillAmout").on(\'click touchstart\', function(){
419  $("input[name="+$(this).data(\'rowname\')+"]").val($(this).data("value")).trigger("change");
420  });';
421  print ' });'."\n";
422 
423  print ' </script>'."\n";
424  }
425 
426  print '<form id="payment_form" name="addpaiement" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
427  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
428  print '<input type="hidden" name="action" value="add_paiement">';
429  print '<input type="hidden" name="facid" value="'.$facid.'">';
430  print '<input type="hidden" name="ref_supplier" value="'.$obj->ref_supplier.'">';
431  print '<input type="hidden" name="socid" value="'.$obj->socid.'">';
432  print '<input type="hidden" name="societe" value="'.$obj->name.'">';
433 
434  dol_fiche_head(null);
435 
436  print '<table class="border" width="100%">';
437 
438  print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans('Company').'</td><td>';
439  $supplierstatic->id=$obj->socid;
440  $supplierstatic->name=$obj->name;
441  print $supplierstatic->getNomUrl(1,'supplier');
442  print '</td></tr>';
443  print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
444  print $form->selectDate($dateinvoice, '', '', '', 0, "addpaiement", 1, 1, 0, '', '', $object->date);
445  print '</td></tr>';
446  print '<tr><td class="fieldrequired">'.$langs->trans('PaymentMode').'</td><td>';
447  $form->select_types_paiements(empty($_POST['paiementid'])?$obj->fk_mode_reglement:$_POST['paiementid'],'paiementid');
448  print '</td>';
449  if (! empty($conf->banque->enabled))
450  {
451  print '<tr><td class="fieldrequired">'.$langs->trans('Account').'</td><td>';
452  $form->select_comptes(empty($accountid)?$obj->fk_account:$accountid,'accountid',0,'',2);
453  print '</td></tr>';
454  }
455  else
456  {
457  print '<tr><td>&nbsp;</td></tr>';
458  }
459  print '<tr><td>'.$langs->trans('Numero').'</td><td><input name="num_paiement" type="text" value="'.(empty($_POST['num_paiement'])?'':$_POST['num_paiement']).'"></td></tr>';
460  print '<tr><td>'.$langs->trans('Comments').'</td>';
461  print '<td class="tdtop">';
462  print '<textarea name="comment" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.(empty($_POST['comment'])?'':$_POST['comment']).'</textarea></td></tr>';
463  print '</table>';
464  dol_fiche_end();
465 
466 
467  $parameters=array('facid'=>$facid, 'ref'=>$ref, 'objcanvas'=>$objcanvas);
468  $reshook=$hookmanager->executeHooks('paymentsupplierinvoices',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
469  $error=$hookmanager->error; $errors=$hookmanager->errors;
470  if (empty($reshook))
471  {
472  /*
473  * Autres factures impayees
474  */
475  $sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef as df,';
476  $sql.= ' SUM(pf.amount) as am, SUM(pf.multicurrency_amount) as multicurrency_am, f.date_lim_reglement as dlr';
477  $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
478  $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
479  $sql.= " WHERE f.entity = ".$conf->entity;
480  $sql.= ' AND f.fk_soc = '.$object->socid;
481  $sql.= ' AND f.paye = 0';
482  $sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
483  $sql.= ' GROUP BY f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef, f.date_lim_reglement';
484  $resql = $db->query($sql);
485  if ($resql)
486  {
487  $num = $db->num_rows($resql);
488  if ($num > 0)
489  {
490  $sign=1;
491  if ($object->type == 2) $sign=-1;
492 
493  $i = 0;
494  print '<br>';
495 
496  if (!empty($conf->use_javascript_ajax)){
497  //Add js for AutoFill
498  print "\n".'<script type="text/javascript" language="javascript">';
499  print ' $(document).ready(function () {';
500  print ' $(".AutoFillAmout").on(\'click touchstart\', function(){
501  $("input[name="+$(this).data(\'rowname\')+"]").val($(this).data("value"));
502  });';
503  print ' });'."\n";
504  print ' </script>'."\n";
505  }
506 
507  print '<div class="div-table-responsive-no-min">';
508  print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
509 
510  print '<tr class="liste_titre">';
511  print '<td>'.$langs->trans('Invoice').'</td>';
512  print '<td>'.$langs->trans('RefSupplier').'</td>';
513  print '<td align="center">'.$langs->trans('Date').'</td>';
514  print '<td align="center">'.$langs->trans('DateMaxPayment').'</td>';
515  if (!empty($conf->multicurrency->enabled)) print '<td>'.$langs->trans('Currency').'</td>';
516  if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
517  if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAlreadyPaid').'</td>';
518  if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyRemainderToPay').'</td>';
519  print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
520  print '<td align="right">'.$langs->trans('AlreadyPaid').'</td>';
521  print '<td align="right">'.$langs->trans('RemainderToPay').'</td>';
522  print '<td align="center">'.$langs->trans('PaymentAmount').'</td>';
523  if (!empty($conf->multicurrency->enabled)) print '<td align="center">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
524  print '</tr>';
525 
526  $total=0;
527  $total_ttc=0;
528  $totalrecu=0;
529  while ($i < $num)
530  {
531  $objp = $db->fetch_object($resql);
532 
533  $invoice=new FactureFournisseur($db);
534  $invoice->fetch($objp->facid);
535  $paiement = $invoice->getSommePaiement();
536  $creditnotes=$invoice->getSumCreditNotesUsed();
537  $deposits=$invoice->getSumDepositsUsed();
538  $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT');
539  $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
540 
541  // Multicurrency Price
542  if (!empty($conf->multicurrency->enabled))
543  {
544  $multicurrency_payment = $invoice->getSommePaiement(1);
545  $multicurrency_creditnotes=$invoice->getSumCreditNotesUsed(1);
546  $multicurrency_deposits=$invoice->getSumDepositsUsed(1);
547  $multicurrency_alreadypayed=price2num($multicurrency_payment + $multicurrency_creditnotes + $multicurrency_deposits,'MT');
548  $multicurrency_remaintopay=price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits,'MT');
549  }
550 
551  print '<tr class="oddeven">';
552 
553  // Ref
554  print '<td>';
555  $invoicesupplierstatic->ref=$objp->ref;
556  $invoicesupplierstatic->id=$objp->facid;
557  print $invoicesupplierstatic->getNomUrl(1);
558  print '</td>';
559 
560  // Ref supplier
561  print '<td>'.$objp->ref_supplier.'</td>';
562 
563  // Date
564  if ($objp->df > 0 )
565  {
566  print '<td align="center">';
567  print dol_print_date($db->jdate($objp->df), 'day').'</td>';
568  }
569  else
570  {
571  print '<td align="center"><b>!!!</b></td>';
572  }
573 
574  // Date Max Payment
575  if ($objp->dlr > 0 )
576  {
577  print '<td align="center">';
578  print dol_print_date($db->jdate($objp->dlr), 'day');
579 
580  if ($invoice->hasDelay())
581  {
582  print img_warning($langs->trans('Late'));
583  }
584 
585  print '</td>';
586  }
587  else
588  {
589  print '<td align="center"><b>--</b></td>';
590  }
591 
592  // Multicurrency
593  if (!empty($conf->multicurrency->enabled))
594  {
595  // Currency
596  print '<td align="center">'.$objp->multicurrency_code."</td>\n";
597 
598  print '<td align="right">';
599  if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
600  {
601  print price($objp->multicurrency_total_ttc);
602  }
603  print '</td>';
604 
605  print '<td align="right">';
606  if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
607  {
608  print price($objp->multicurrency_am);
609  }
610  print '</td>';
611 
612  print '<td align="right">';
613  if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
614  {
615  print price($objp->multicurrency_total_ttc - $objp->multicurrency_am);
616  }
617  print '</td>';
618  }
619 
620  print '<td align="right">'.price($objp->total_ttc).'</td>';
621 
622  print '<td align="right">'.price($objp->am).'</td>';
623 
624  print '<td align="right">'.price($remaintopay).'</td>';
625 
626  // Amount
627  print '<td align="center">';
628 
629  $namef = 'amount_'.$objp->facid;
630  $nameRemain = 'remain_'.$objp->facid;
631 
632  if ($action != 'add_paiement')
633  {
634  if (!empty($conf->use_javascript_ajax))
635  print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'");
636  print '<input type="hidden" class="remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
637  print '<input type="text" size="8" class="amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';
638  }
639  else
640  {
641  print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.dol_escape_htmltag(GETPOST($namef)).'" disabled>';
642  print '<input type="hidden" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';
643  }
644  print "</td>";
645 
646  // Multicurrency Price
647  if (! empty($conf->multicurrency->enabled))
648  {
649  print '<td align="right">';
650 
651  // Add remind multicurrency amount
652  $namef = 'multicurrency_amount_'.$objp->facid;
653  $nameRemain = 'multicurrency_remain_'.$objp->facid;
654 
655  if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
656  {
657  if ($action != 'add_paiement')
658  {
659  if (!empty($conf->use_javascript_ajax))
660  print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
661  print '<input type=hidden class="multicurrency_remain" name="'.$nameRemain.'" value="'.$multicurrency_remaintopay.'">';
662  print '<input type="text" size="8" class="multicurrency_amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
663  }
664  else
665  {
666  print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
667  print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
668  }
669  }
670  print "</td>";
671  }
672 
673  print "</tr>\n";
674  $total+=$objp->total_ht;
675  $total_ttc+=$objp->total_ttc;
676  $totalrecu+=$objp->am;
677  $i++;
678  }
679  if ($i > 1)
680  {
681  // Print total
682  print '<tr class="liste_total">';
683  print '<td colspan="4" align="left">'.$langs->trans('TotalTTC').':</td>';
684  if (!empty($conf->multicurrency->enabled)) print '<td>&nbsp;</td>';
685  if (!empty($conf->multicurrency->enabled)) print '<td>&nbsp;</td>';
686  if (!empty($conf->multicurrency->enabled)) print '<td>&nbsp;</td>';
687  if (!empty($conf->multicurrency->enabled)) print '<td>&nbsp;</td>';
688  print '<td align="right"><b>'.price($total_ttc).'</b></td>';
689  print '<td align="right"><b>'.price($totalrecu).'</b></td>';
690  print '<td align="right"><b>'.price($total_ttc - $totalrecu).'</b></td>';
691  print '<td align="center" id="result" style="font-weight: bold;"></td>'; // Autofilled
692  if (!empty($conf->multicurrency->enabled)) print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>';
693  print "</tr>\n";
694  }
695  print "</table>\n";
696 
697  print "</div>";
698  }
699  $db->free($resql);
700  }
701  else
702  {
703  dol_print_error($db);
704  }
705  }
706 
707  // Bouton Enregistrer
708  if ($action != 'add_paiement')
709  {
710  print '<br><div class="center"><input type="checkbox" checked name="closepaidinvoices"> '.$langs->trans("ClosePaidInvoicesAutomatically");
711  print '<br><input type="submit" class="button" value="'.$langs->trans('ToMakePayment').'"></div>';
712  }
713 
714  // Form to confirm payment
715  if ($action == 'add_paiement')
716  {
717  $preselectedchoice=$addwarning?'no':'yes';
718 
719  print '<br>';
720  if (!empty($totalpayment)) $text=$langs->trans('ConfirmSupplierPayment',price($totalpayment),$langs->trans("Currency".$conf->currency));
721  if (!empty($multicurrency_totalpayment))
722  {
723  $text.='<br>'.$langs->trans('ConfirmSupplierPayment',price($multicurrency_totalpayment),$langs->trans("paymentInInvoiceCurrency"));
724  }
725  if (GETPOST('closepaidinvoices'))
726  {
727  $text.='<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");
728  print '<input type="hidden" name="closepaidinvoices" value="'.GETPOST('closepaidinvoices').'">';
729  }
730  print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('PayedSuppliersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice);
731  }
732 
733  print '</form>';
734  }
735  }
736  else dol_print_error($db);
737 }
738 
739 /*
740  * Show list
741  */
742 if (empty($action))
743 {
744  $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
745  $sortfield = GETPOST("sortfield",'alpha');
746  $sortorder = GETPOST("sortorder",'alpha');
747  $page=GETPOST("page",'int');
748  if ($page == -1 || $page == null) { $page = 0 ; }
749  $offset = $limit * $page ;
750  $pageprev = $page - 1;
751  $pagenext = $page + 1;
752  if (! $sortorder) $sortorder='DESC';
753  if (! $sortfield) $sortfield='p.datep';
754 
755  $sql = 'SELECT p.rowid as pid, p.datep as dp, p.amount as pamount, p.num_paiement,';
756  $sql.= ' s.rowid as socid, s.nom as name,';
757  $sql.= ' c.code as paiement_type, c.libelle as paiement_libelle,';
758  $sql.= ' ba.rowid as bid, ba.label,';
759  if (!$user->rights->societe->client->voir) $sql .= ' sc.fk_soc, sc.fk_user,';
760  $sql.= ' SUM(f.amount)';
761  $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn AS p';
762  $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn AS pf ON p.rowid=pf.fk_paiementfourn';
763  $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn AS f ON f.rowid=pf.fk_facturefourn';
764  $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement AS c ON p.fk_paiement = c.id';
765  $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON s.rowid = f.fk_soc';
766  $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
767  $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
768  if (!$user->rights->societe->client->voir) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
769  $sql.= " WHERE f.entity = ".$conf->entity;
770  if (!$user->rights->societe->client->voir) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
771  if ($socid > 0) $sql .= ' AND f.fk_soc = '.$socid;
772  // Search criteria
773  if ($month > 0)
774  {
775  if ($year > 0 && empty($day))
776  $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
777  else if ($year > 0 && ! empty($day))
778  $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
779  else
780  $sql.= " AND date_format(p.datep, '%m') = '".$month."'";
781  }
782  else if ($year > 0)
783  {
784  $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
785  }
786  if ($search_ref) $sql .= natural_search('p.rowid', $search_ref);
787  if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
788  if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'";
789  if ($search_payment_num != '') $sql .= natural_search('p.num_paiement', $search_payment_num);
790  if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1);
791  if ($search_company) $sql .= natural_search('s.nom', $search_company);
792  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
793  $sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.code, c.libelle, ba.rowid, ba.label";
794  if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
795  // Add where from extra fields
796 
797  $sql.= $db->order($sortfield,$sortorder);
798 
799  $nbtotalofrecords = '';
800  if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
801  {
802  $result = $db->query($sql);
803  $nbtotalofrecords = $db->num_rows($result);
804  if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
805  {
806  $page = 0;
807  $offset = 0;
808  }
809  }
810 
811  $sql.= $db->plimit($limit+1, $offset);
812 
813  $resql = $db->query($sql);
814  if ($resql)
815  {
816  $num = $db->num_rows($resql);
817  $i = 0;
818 
819  $param='';
820  if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
821  if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
822  if ($day) $param.=($day?"&day=".urlencode($day):"");
823  if ($month) $param.=($month?"&month=".urlencode($month):"");
824  if ($year) $param.=($year?"&year=".urlencode($year):"");
825  if ($search_ref) $param.=($search_ref?"&search_ref=".urlencode($search_ref):"");
826  if ($search_company) $param.=($search_company?"&search_company=".urlencode($search_company):"");
827  if ($search_amount != '') $param.=($search_amount?"&search_amount=".urlencode($search_amount):"");
828  if ($search_payment_num) $param.=($search_payment_num?"&search_payment_num=".urlencode($search_payment_num):"");
829  if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
830  // Add $param from extra fields
831  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
832 
833  $massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
834 
835  print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit);
836 
837  print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
838  if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
839  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
840  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
841  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
842  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
843  print '<input type="hidden" name="page" value="'.$page.'">';
844 
845  $moreforfilter='';
846 
847  $parameters=array();
848  $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
849  if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
850  else $moreforfilter = $hookmanager->resPrint;
851 
852  if ($moreforfilter)
853  {
854  print '<div class="liste_titre liste_titre_bydiv centpercent">';
855  print $moreforfilter;
856  print '</div>';
857  }
858 
859  $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
860  $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
861 
862  print '<div class="div-table-responsive">';
863  print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
864 
865  // Lines for filters fields
866  print '<tr class="liste_titre_filter">';
867  print '<td class="liste_titre" align="left">';
868  print '<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
869  print '</td>';
870  print '<td class="liste_titre" align="center">';
871  if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="day" value="'.dol_escape_htmltag($day).'">';
872  print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="month" value="'.dol_escape_htmltag($month).'">';
873  $formother->select_year($year?$year:-1,'year',1, 20, 5);
874  print '</td>';
875  print '<td class="liste_titre" align="left">';
876  print '<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
877  print '</td>';
878  print '<td class="liste_titre">';
879  $form->select_types_paiements($search_paymenttype,'search_paymenttype','',2,1,1);
880  print '</td>';
881  print '<td class="liste_titre" align="left">';
882  print '<input class="flat" type="text" size="4" name="search_payment_num" value="'.dol_escape_htmltag($search_payment_num).'">';
883  print '</td>';
884  print '<td class="liste_titre">';
885  $form->select_comptes($search_account,'search_account',0,'',1);
886  print '</td>';
887  print '<td class="liste_titre" align="right">';
888  print '<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
889  print '</td>';
890  print '<td class="liste_titre" align="right">';
891  $searchpicto=$form->showFilterAndCheckAddButtons(0);
892  print $searchpicto;
893  print '</td>';
894  print "</tr>\n";
895 
896  print '<tr class="liste_titre">';
897  print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],'p.rowid','',$param,'',$sortfield,$sortorder);
898  print_liste_field_titre("Date",$_SERVER["PHP_SELF"],'dp','',$param,'align="center"',$sortfield,$sortorder);
899  print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
900  print_liste_field_titre("Type",$_SERVER["PHP_SELF"],'c.libelle','',$param,'',$sortfield,$sortorder);
901  print_liste_field_titre("Numero",$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder);
902  print_liste_field_titre("Account",$_SERVER["PHP_SELF"],'ba.label','',$param,'',$sortfield,$sortorder);
903  print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],'p.amount','',$param,'align="right"',$sortfield,$sortorder);
904  //print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],'ref_supplier','',$param,'',$sortfield,$sortorder);
906  print "</tr>\n";
907 
908  while ($i < min($num,$limit))
909  {
910  $objp = $db->fetch_object($resql);
911 
912  print '<tr class="oddeven">';
913 
914  // Ref payment
915  print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$objp->pid.'">'.img_object($langs->trans('ShowPayment'),'payment').' '.$objp->pid.'</a></td>';
916 
917  // Date
918  $dateformatforpayment = 'day';
919  if (! empty($conf->global->INVOICE_USE_HOURS_FOR_PAYMENT)) $dateformatforpayment='dayhour';
920  print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->dp), $dateformatforpayment)."</td>\n";
921 
922  // Thirdparty
923  print '<td>';
924  if ($objp->socid) print '<a href="'.DOL_URL_ROOT.'/societe/card.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.dol_trunc($objp->name,32).'</a>';
925  else print '&nbsp;';
926  print '</td>';
927 
928  // Type
929  $payment_type = $langs->trans("PaymentType".$objp->paiement_type)!=("PaymentType".$objp->paiement_type)?$langs->trans("PaymentType".$objp->paiement_type):$objp->paiement_libelle;
930  print '<td>'.$payment_type.' '.dol_trunc($objp->num_paiement,32)."</td>\n";
931 
932  // Payment number
933  print '<td>'.$objp->num_paiement.'</td>';
934 
935  print '<td>';
936  if ($objp->bid) print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).'</a>';
937  else print '&nbsp;';
938  print '</td>';
939 
940  print '<td align="right">'.price($objp->pamount).'</td>';
941 
942  // Ref invoice
943  /*$invoicesupplierstatic->ref=$objp->ref_supplier;
944  $invoicesupplierstatic->id=$objp->facid;
945  print '<td class="nowrap">';
946  print $invoicesupplierstatic->getNomUrl(1);
947  print '</td>';*/
948 
949  print '<td>&nbsp;</td>';
950  print '</tr>';
951  $i++;
952  }
953  print "</table>";
954  print "</div>";
955  print "</form>\n";
956  }
957  else
958  {
959  dol_print_error($db);
960  }
961 }
962 
963 // End of page
964 llxFooter();
965 $db->close();
img_warning($titlealt='default', $moreatt='')
Show warning logo.
llxFooter()
Empty footer.
Definition: wrapper.php:56
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
Definition: index.php:91
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding &#39;...&#39; if string larger than length.
if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) if(! empty($conf->don->enabled) && $user->rights->societe->lire) if(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) if(! empty($conf->facture->enabled) &&! empty($conf->commande->enabled) && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1053
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm=false, $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:453
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
Class to manage suppliers invoices.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0)
Print a title with navigation controls for pagination.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_fiche_end($notab=0)
Show tab footer of a card.
Classe permettant la generation de composants html autre Only common components are here...
llxHeader()
Empty header.
Definition: wrapper.php:44
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...
if(GETPOST('cancel', 'alpha')) if(! GETPOST( 'confirmmassaction', 'alpha') &&$massaction !='presend' &&$massaction !='confirm_presend')
Draft customers invoices.
Definition: list.php:156
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:467
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="")
Show title line of an array.
Class to manage payments for supplier invoices.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it&#39;s its name (generic function)
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is &#39;...
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='')
Show tab header of a card.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)