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