dolibarr  16.0.5
create.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2010-2020 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
6  * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
7  * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
8  * Copyright (C) 2019 Markus Welters <markus@welters.de>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <https://www.gnu.org/licenses/>.
22  */
23 
30 require '../../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
37 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
38 
39 // Load translation files required by the page
40 $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies', 'bills'));
41 
42 $type = GETPOST('type', 'aZ09');
43 
44 // Get supervariables
45 $action = GETPOST('action', 'aZ09');
46 $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
47 $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
48 
49 $mode = GETPOST('mode', 'alpha') ?GETPOST('mode', 'alpha') : 'real';
50 $format = GETPOST('format', 'aZ09');
51 $id_bankaccount = GETPOST('id_bankaccount', 'int');
52 $executiondate = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
53 
54 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
55 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
56 if (empty($page) || $page == -1) {
57  $page = 0;
58 } // If $page is not defined, or '' or -1
59 $offset = $limit * $page;
60 
61 $hookmanager->initHooks(array('directdebitcreatecard', 'globalcard'));
62 
63 // Security check
64 if ($user->socid) {
65  $socid = $user->socid;
66 }
67 if ($type == 'bank-transfer') {
68  $result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
69 } else {
70  $result = restrictedArea($user, 'prelevement', '', '', 'bons');
71 }
72 
73 $error = 0;
74 
75 
76 /*
77  * Actions
78  */
79 
80 if (GETPOST('cancel', 'alpha')) {
81  $massaction = '';
82 }
83 
84 $parameters = array('mode' => $mode, 'format' => $format, 'limit' => $limit, 'page' => $page, 'offset' => $offset);
85 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
86 if ($reshook < 0) {
87  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
88 }
89 
90 if (empty($reshook)) {
91  // Change customer bank information to withdraw
92  if ($action == 'modify') {
93  for ($i = 1; $i < 9; $i++) {
94  dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"), 'chaine', 0, '', $conf->entity);
95  }
96  }
97  if ($action == 'create') {
98  $default_account = ($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT');
99 
100  //var_dump($default_account);var_dump($conf->global->$default_account);var_dump($id_bankaccount);exit;
101 
102  if ($id_bankaccount != $conf->global->$default_account) {
103  $res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); // Set as default
104  }
105 
106  require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
107  $bank = new Account($db);
108  $bank->fetch($conf->global->{$default_account});
109  // ICS is not mandatory with payment by bank transfer
110  /*if ((empty($bank->ics) && $type !== 'bank-transfer')
111  || (empty($bank->ics_transfer) && $type === 'bank-transfer')
112  ) {*/
113  if (empty($bank->ics) && $type !== 'bank-transfer') {
114  $errormessage = str_replace('{url}', $bank->getNomUrl(1, '', '', -1, 1), $langs->trans("ErrorICSmissing", '{url}'));
115  setEventMessages($errormessage, null, 'errors');
116  $action = '';
117  $error++;
118  }
119 
120 
121  $bprev = new BonPrelevement($db);
122 
123  if (!$error) {
124  // $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty (we don't use them anymore)
125  $result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format, $executiondate, 0, $type);
126  if ($result < 0) {
127  setEventMessages($bprev->error, $bprev->errors, 'errors');
128  } elseif ($result == 0) {
129  $mesg = $langs->trans("NoInvoiceCouldBeWithdrawed", $format);
130  setEventMessages($mesg, null, 'errors');
131  $mesg .= '<br>'."\n";
132  foreach ($bprev->invoice_in_error as $key => $val) {
133  $mesg .= '<span class="warning">'.$val."</span><br>\n";
134  }
135  } else {
136  if ($type != 'bank-transfer') {
137  $texttoshow = $langs->trans("DirectDebitOrderCreated", '{s}');
138  $texttoshow = str_replace('{s}', $bprev->getNomUrl(1), $texttoshow);
139  setEventMessages($texttoshow, null);
140  } else {
141  $texttoshow = $langs->trans("CreditTransferOrderCreated", '{s}');
142  $texttoshow = str_replace('{s}', $bprev->getNomUrl(1), $texttoshow);
143  setEventMessages($texttoshow, null);
144  }
145 
146  header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.urlencode($bprev->id).'&type='.urlencode($type));
147  exit;
148  }
149  }
150  }
151  $objectclass = "BonPrelevement";
152  if ($type == 'bank-transfer') {
153  $uploaddir = $conf->paymentbybanktransfer->dir_output;
154  } else {
155  $uploaddir = $conf->prelevement->dir_output;
156  }
157  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
158 }
159 
160 
161 /*
162  * View
163  */
164 
165 $form = new Form($db);
166 
167 $thirdpartystatic = new Societe($db);
168 if ($type != 'bank-transfer') {
169  $invoicestatic = new Facture($db);
170 } else {
171  $invoicestatic = new FactureFournisseur($db);
172 }
173 $bprev = new BonPrelevement($db);
174 $arrayofselected = is_array($toselect) ? $toselect : array();
175 // List of mass actions available
176 $arrayofmassactions = array(
177 );
178 if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
179  $arrayofmassactions = array();
180 }
181 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
182 
183 llxHeader('', $langs->trans("NewStandingOrder"));
184 
185 if (prelevement_check_config($type) < 0) {
186  $langs->load("errors");
187  $modulenametoshow = "Withdraw";
188  if ($type == 'bank-transfer') {
189  $modulenametoshow = "PaymentByBankTransfer";
190  }
191  setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv($modulenametoshow)), null, 'errors');
192 }
193 
194 
195 /*$h=0;
196 $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/create.php';
197 $head[$h][1] = $langs->trans("NewStandingOrder");
198 $head[$h][2] = 'payment';
199 $hselected = 'payment';
200 $h++;
201 
202 print dol_get_fiche_head($head, $hselected, $langs->trans("StandingOrders"), 0, 'payment');
203 */
204 
205 $title = $langs->trans("NewStandingOrder");
206 if ($type == 'bank-transfer') {
207  $title = $langs->trans("NewPaymentByBankTransfer");
208 }
209 
210 print load_fiche_titre($title);
211 
212 print dol_get_fiche_head();
213 
214 $nb = $bprev->nbOfInvoiceToPay($type);
215 $pricetowithdraw = $bprev->SommeAPrelever($type);
216 if ($nb < 0) {
217  dol_print_error($bprev->error);
218 }
219 print '<table class="border centpercent tableforfield">';
220 
221 $title = $langs->trans("NbOfInvoiceToWithdraw");
222 if ($type == 'bank-transfer') {
223  $title = $langs->trans("NbOfInvoiceToPayByBankTransfer");
224 }
225 
226 print '<tr><td class="titlefieldcreate">'.$title.'</td>';
227 print '<td>';
228 print $nb;
229 print '</td></tr>';
230 
231 print '<tr><td>'.$langs->trans("AmountTotal").'</td>';
232 print '<td class="amount">';
233 print price($pricetowithdraw);
234 print '</td>';
235 print '</tr>';
236 
237 print '</table>';
238 print '</div>';
239 
240 if ($mesg) {
241  print $mesg;
242 }
243 
244 print '<div class="tabsAction">'."\n";
245 
246 print '<form action="'.$_SERVER['PHP_SELF'].'?action=create" method="POST">';
247 print '<input type="hidden" name="token" value="'.newToken().'">';
248 print '<input type="hidden" name="type" value="'.$type.'">';
249 if ($nb) {
250  if ($pricetowithdraw) {
251  $title = $langs->trans('BankToReceiveWithdraw').': ';
252  if ($type == 'bank-transfer') {
253  $title = $langs->trans('BankToPayCreditTransfer').': ';
254  }
255  print $title;
256  print img_picto('', 'bank_account');
257 
258  $default_account = ($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT');
259 
260  print $form->select_comptes($conf->global->$default_account, 'id_bankaccount', 0, "courant=1", 0, '', 0, '', 1);
261  print ' - ';
262 
263  if (empty($executiondate)) {
264  $delayindays = 0;
265  if ($type != 'bank-transfer') {
266  $delayindays = $conf->global->PRELEVEMENT_ADDDAYS;
267  } else {
268  $delayindays = $conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS;
269  }
270 
271  $executiondate = dol_time_plus_duree(dol_now(), $delayindays, 'd');
272  }
273 
274  print $langs->trans('ExecutionDate').' ';
275  $datere = $executiondate;
276  print $form->selectDate($datere, 're');
277 
278 
279  if ($mysoc->isInEEC()) {
280  $title = $langs->trans("CreateForSepa");
281  if ($type == 'bank-transfer') {
282  $title = $langs->trans("CreateSepaFileForPaymentByBankTransfer");
283  }
284 
285  if ($type != 'bank-transfer') {
286  print '<select name="format">';
287  print '<option value="FRST"'.(GETPOST('format', 'aZ09') == 'FRST' ? ' selected="selected"' : '').'>'.$langs->trans('SEPAFRST').'</option>';
288  print '<option value="RCUR"'.(GETPOST('format', 'aZ09') == 'RCUR' ? ' selected="selected"' : '').'>'.$langs->trans('SEPARCUR').'</option>';
289  print '</select>';
290  }
291  print '<input type="submit" class="butAction" value="'.$title.'"/>';
292  } else {
293  $title = $langs->trans("CreateAll");
294  if ($type == 'bank-transfer') {
295  $title = $langs->trans("CreateFileForPaymentByBankTransfer");
296  }
297  print '<input type="hidden" name="format" value="ALL">'."\n";
298  print '<input type="submit" class="butAction" value="'.$title.'">'."\n";
299  }
300  } else {
301  if ($mysoc->isInEEC()) {
302  $title = $langs->trans("CreateForSepaFRST");
303  if ($type == 'bank-transfer') {
304  $title = $langs->trans("CreateSepaFileForPaymentByBankTransfer");
305  }
306  print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("AmountMustBePositive").'">'.$title."</a>\n";
307 
308  if ($type != 'bank-transfer') {
309  $title = $langs->trans("CreateForSepaRCUR");
310  print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("AmountMustBePositive").'">'.$title."</a>\n";
311  }
312  } else {
313  $title = $langs->trans("CreateAll");
314  if ($type == 'bank-transfer') {
315  $title = $langs->trans("CreateFileForPaymentByBankTransfer");
316  }
317  print '<a class="butActionRefused classfortooltip" href="#">'.$title."</a>\n";
318  }
319  }
320 } else {
321  $titlefortab = $langs->transnoentitiesnoconv("StandingOrders");
322  $title = $langs->trans("CreateAll");
323  if ($type == 'bank-transfer') {
324  $titlefortab = $langs->transnoentitiesnoconv("PaymentByBankTransfers");
325  $title = $langs->trans("CreateFileForPaymentByBankTransfer");
326  }
327  print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NoInvoiceToWithdraw", $titlefortab, $titlefortab)).'">'.$title."</a>\n";
328 }
329 
330 print "</form>\n";
331 
332 print "</div>\n";
333 print '</form>';
334 print '<br>';
335 
336 
337 /*
338  * Invoices waiting for withdraw
339  */
340 
341 $sql = "SELECT f.ref, f.rowid, f.total_ttc, s.nom as name, s.rowid as socid,";
342 $sql .= " pfd.rowid as request_row_id, pfd.date_demande, pfd.amount";
343 if ($type == 'bank-transfer') {
344  $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,";
345 } else {
346  $sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
347 }
348 $sql .= " ".MAIN_DB_PREFIX."societe as s,";
349 $sql .= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
350 $sql .= " WHERE s.rowid = f.fk_soc";
351 $sql .= " AND f.entity IN (".getEntity('invoice').")";
352 if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) {
353  $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
354 }
355 //$sql .= " AND pfd.amount > 0";
356 $sql .= " AND f.total_ttc > 0"; // Avoid credit notes
357 $sql .= " AND pfd.traite = 0";
358 $sql .= " AND pfd.ext_payment_id IS NULL";
359 if ($type == 'bank-transfer') {
360  $sql .= " AND pfd.fk_facture_fourn = f.rowid";
361 } else {
362  $sql .= " AND pfd.fk_facture = f.rowid";
363 }
364 if ($socid > 0) {
365  $sql .= " AND f.fk_soc = ".((int) $socid);
366 }
367 
368 $nbtotalofrecords = '';
369 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
370  $result = $db->query($sql);
371  $nbtotalofrecords = $db->num_rows($result);
372  if (($page * $limit) > $nbtotalofrecords) {
373  // if total resultset is smaller then paging size (filtering), goto and load page 0
374  $page = 0;
375  $offset = 0;
376  }
377 }
378 
379 $sql .= $db->plimit($limit + 1, $offset);
380 
381 $resql = $db->query($sql);
382 if ($resql) {
383  $num = $db->num_rows($resql);
384  $i = 0;
385 
386  $param = '';
387  if ($limit > 0 && $limit != $conf->liste_limit) {
388  $param .= '&limit='.urlencode($limit);
389  }
390  if ($socid) {
391  $param .= '&socid='.urlencode($socid);
392  }
393  if ($option) {
394  $param .= "&option=".urlencode($option);
395  }
396 
397  print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
398  print '<input type="hidden" name="token" value="'.newToken().'">';
399  print '<input type="hidden" name="page" value="'.$page.'">';
400  if (!empty($limit)) {
401  print '<input type="hidden" name="limit" value="'.$limit.'"/>';
402  }
403  if ($type != '') {
404  print '<input type="hidden" name="type" value="'.$type.'">';
405  }
406 
407  $title = $langs->trans("InvoiceWaitingWithdraw");
408  if ($type == 'bank-transfer') {
409  $title = $langs->trans("InvoiceWaitingPaymentByBankTransfer");
410  }
411  print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, '', '', $massactionbutton, $num, $nbtotalofrecords, 'bill', 0, '', '', $limit);
412 
413  $tradinvoice = "Invoice";
414  if ($type == 'bank-transfer') {
415  $tradinvoice = "SupplierInvoice";
416  }
417 
418  print '<table class="noborder centpercent">';
419  print '<tr class="liste_titre">';
420  print '<td>'.$langs->trans($tradinvoice).'</td>';
421  print '<td>'.$langs->trans("ThirdParty").'</td>';
422  print '<td>'.$langs->trans("RIB").'</td>';
423  print '<td>'.$langs->trans("RUM").'</td>';
424  print '<td class="right">'.$langs->trans("AmountTTC").'</td>';
425  print '<td class="right">'.$langs->trans("DateRequest").'</td>';
426  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
427  print '<td align="center">'.$form->showCheckAddButtons('checkforselect', 1).'</td>';
428  }
429  print '</tr>';
430 
431  if ($num) {
432  require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
433  $bac = new CompanyBankAccount($db);
434 
435  while ($i < $num && $i < $limit) {
436  $obj = $db->fetch_object($resql);
437 
438  $bac->fetch(0, $obj->socid);
439 
440  print '<tr class="oddeven">';
441 
442  // Ref invoice
443  print '<td>';
444  $invoicestatic->id = $obj->rowid;
445  $invoicestatic->ref = $obj->ref;
446  print $invoicestatic->getNomUrl(1, 'withdraw');
447  print '</td>';
448 
449  // Thirdparty
450  print '<td>';
451  $thirdpartystatic->fetch($obj->socid);
452  print $thirdpartystatic->getNomUrl(1, 'ban');
453  print '</td>';
454 
455  // RIB
456  print '<td>';
457  if ($bac->id > 0) {
458  if (!empty($bac->iban) || !empty($bac->bic)) {
459  print $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
460  if ($bac->verif() <= 0) {
461  print img_warning('Error on default bank number for IBAN : '.$langs->trans($bac->error_message));
462  }
463  } else {
464  print img_warning($langs->trans("IBANNotDefined"));
465  }
466  } else {
467  print img_warning($langs->trans("NoBankAccountDefined"));
468  }
469  print '</td>';
470 
471  // RUM
472  print '<td>';
473  $rumtoshow = $thirdpartystatic->display_rib('rum');
474  if ($rumtoshow) {
475  print $rumtoshow;
476  $format = $thirdpartystatic->display_rib('format');
477  if ($type != 'bank-transfer') {
478  if ($format) {
479  print ' ('.$format.')';
480  }
481  }
482  } else {
483  print img_warning($langs->trans("NoBankAccountDefined"));
484  }
485  print '</td>';
486  // Amount
487  print '<td class="right amount">';
488  print price($obj->amount, 0, $langs, 0, 0, -1, $conf->currency);
489  print '</td>';
490  // Date
491  print '<td class="right">';
492  print dol_print_date($db->jdate($obj->date_demande), 'day');
493  print '</td>';
494  // Action column
495  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
496  print '<td class="nowrap center">';
497  $selected = 0;
498  if (in_array($obj->request_row_id, $arrayofselected)) {
499  $selected = 1;
500  }
501  print '<input id="cb'.$obj->request_row_id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->request_row_id.'"'.($selected ? ' checked="checked"' : '').'>';
502  print '</td>';
503  }
504  print '</tr>';
505  $i++;
506  }
507  } else {
508  print '<tr class="oddeven"><td colspan="6"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
509  }
510  print "</table>";
511  print "</form>";
512  print "<br>\n";
513 } else {
514  dol_print_error($db);
515 }
516 
517 
518 /*
519  * List of latest withdraws
520  */
521 /*
522 $limit=5;
523 
524 print load_fiche_titre($langs->trans("LastWithdrawalReceipts",$limit),'','');
525 
526 $sql = "SELECT p.rowid, p.ref, p.amount, p.statut";
527 $sql.= ", p.datec";
528 $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
529 $sql.= " WHERE p.entity IN (".getEntity('invoice').")";
530 $sql.= " ORDER BY datec DESC";
531 $sql.=$db->plimit($limit);
532 
533 $result = $db->query($sql);
534 if ($result)
535 {
536  $num = $db->num_rows($result);
537  $i = 0;
538 
539  print"\n<!-- debut table -->\n";
540  print '<table class="noborder centpercent">';
541  print '<tr class="liste_titre"><td>'.$langs->trans("Ref").'</td>';
542  print '<td class="center">'.$langs->trans("Date").'</td><td class="right">'.$langs->trans("Amount").'</td>';
543  print '</tr>';
544 
545  while ($i < min($num,$limit))
546  {
547  $obj = $db->fetch_object($result);
548 
549 
550  print '<tr class="oddeven">';
551 
552  print "<td>";
553  $bprev->id=$obj->rowid;
554  $bprev->ref=$obj->ref;
555  print $bprev->getNomUrl(1);
556  print "</td>\n";
557 
558  print '<td class="center">'.dol_print_date($db->jdate($obj->datec),'day')."</td>\n";
559 
560  print '<td class="right"><span class="amount">'.price($obj->amount,0,$langs,0,0,-1,$conf->currency)."</span></td>\n";
561 
562  print "</tr>\n";
563  $i++;
564  }
565  print "</table><br>";
566  $db->free($result);
567 }
568 else
569 {
570  dol_print_error($db);
571 }
572 */
573 
574 // End of page
575 llxFooter();
576 $db->close();
Societe
Class to manage third parties objects (customers, suppliers, prospects...)
Definition: societe.class.php:48
restrictedArea
restrictedArea($user, $features, $objectid=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.
Definition: security.lib.php:234
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
FactureFournisseur
Class to manage suppliers invoices.
Definition: fournisseur.facture.class.php:53
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
img_warning
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
Definition: functions.lib.php:4521
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
Facture
Class to manage invoices.
Definition: facture.class.php:60
CompanyBankAccount
Class to manage bank accounts description of third parties.
Definition: companybankaccount.class.php:34
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2514
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
BonPrelevement
Class to manage withdrawal receipts.
Definition: bonprelevement.class.php:43
print_barre_liste
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
Definition: functions.lib.php:5257
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
dolibarr_set_const
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:627
dol_time_plus_duree
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition: date.lib.php:121
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:386
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
price
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.
Definition: functions.lib.php:5541
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
dol_mktime
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
Definition: functions.lib.php:2757
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59
Account
Class to manage bank accounts.
Definition: account.class.php:38
prelevement_check_config
prelevement_check_config($type='direct-debit')
Check need data to create standigns orders receipt file.
Definition: prelevement.lib.php:85