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