dolibarr  16.0.5
card.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
5  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2013 Marcos GarcĂ­a <marcosgdf@gmail.com>
7  * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  */
22 
30 require '../../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
35 if (isModEnabled('banque')) {
36  require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
37 }
38 
39 // Load translation files required by the page
40 $langs->loadLangs(array('bills', 'banks', 'companies'));
41 
42 $id = GETPOST('id', 'int');
43 $ref = GETPOST('ref', 'alpha');
44 $action = GETPOST('action', 'aZ09');
45 $confirm = GETPOST('confirm', 'alpha');
46 $backtopage = GETPOST('backtopage', 'alpha');
47 
48 $object = new Paiement($db);
49 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
50 $hookmanager->initHooks(array('paymentcard', 'globalcard'));
51 
52 // Load object
53 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
54 
55 $result = restrictedArea($user, $object->element, $object->id, 'paiement');
56 
57 // Security check
58 if ($user->socid) {
59  $socid = $user->socid;
60 }
61 // Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
62 // It should be enough because all payments are done on invoices of the same thirdparty.
63 if ($socid && $socid != $object->thirdparty->id) {
65 }
66 
67 $error = 0;
68 
69 
70 /*
71  * Actions
72  */
73 
74 if ($action == 'setnote' && $user->rights->facture->paiement) {
75  $db->begin();
76 
77  $result = $object->update_note(GETPOST('note', 'restricthtml'));
78  if ($result > 0) {
79  $db->commit();
80  $action = '';
81  } else {
82  setEventMessages($object->error, $object->errors, 'errors');
83  $db->rollback();
84  }
85 }
86 
87 if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->paiement) {
88  $db->begin();
89 
90  $result = $object->delete();
91  if ($result > 0) {
92  $db->commit();
93 
94  if ($backtopage) {
95  header("Location: ".$backtopage);
96  exit;
97  } else {
98  header("Location: list.php");
99  exit;
100  }
101  } else {
102  $langs->load("errors");
103  setEventMessages($object->error, $object->errors, 'errors');
104  $db->rollback();
105  }
106 }
107 
108 if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture->paiement) {
109  $db->begin();
110 
111  if ($object->validate($user) > 0) {
112  $db->commit();
113 
114  // Loop on each invoice linked to this payment to rebuild PDF
115  if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
116  $outputlangs = $langs;
117  if (GETPOST('lang_id', 'aZ09')) {
118  $outputlangs = new Translate("", $conf);
119  $outputlangs->setDefaultLang(GETPOST('lang_id', 'aZ09'));
120  }
121 
122  $hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
123  $hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
124  $hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
125 
126  $sql = 'SELECT f.rowid as facid';
127  $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
128  $sql .= ' WHERE pf.fk_facture = f.rowid';
129  $sql .= ' AND f.fk_soc = s.rowid';
130  $sql .= ' AND f.entity IN ('.getEntity('invoice').')';
131  $sql .= ' AND pf.fk_paiement = '.((int) $object->id);
132  $resql = $db->query($sql);
133  if ($resql) {
134  $i = 0;
135  $num = $db->num_rows($resql);
136 
137  if ($num > 0) {
138  while ($i < $num) {
139  $objp = $db->fetch_object($resql);
140 
141  $invoice = new Facture($db);
142 
143  if ($invoice->fetch($objp->facid) <= 0) {
144  $errors++;
145  setEventMessages($invoice->error, $invoice->errors, 'errors');
146  break;
147  }
148 
149  if ($invoice->generateDocument($invoice->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref) < 0) {
150  $errors++;
151  setEventMessages($invoice->error, $invoice->errors, 'errors');
152  break;
153  }
154 
155  $i++;
156  }
157  }
158 
159  $db->free($resql);
160  } else {
161  $errors++;
162  setEventMessages($db->error, $db->errors, 'errors');
163  }
164  }
165 
166  if (! $errors) {
167  header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
168  exit;
169  }
170  } else {
171  $db->rollback();
172 
173  $langs->load("errors");
174  setEventMessages($object->error, $object->errors, 'errors');
175  }
176 }
177 
178 if ($action == 'setnum_paiement' && GETPOST('num_paiement')) {
179  $res = $object->update_num(GETPOST('num_paiement'));
180  if ($res === 0) {
181  setEventMessages($langs->trans('PaymentNumberUpdateSucceeded'), null, 'mesgs');
182  } else {
183  setEventMessages($langs->trans('PaymentNumberUpdateFailed'), null, 'errors');
184  }
185 }
186 
187 if ($action == 'setdatep' && GETPOST('datepday')) {
188  $datepaye = dol_mktime(GETPOST('datephour', 'int'), GETPOST('datepmin', 'int'), GETPOST('datepsec', 'int'), GETPOST('datepmonth', 'int'), GETPOST('datepday', 'int'), GETPOST('datepyear', 'int'));
189  $res = $object->update_date($datepaye);
190  if ($res === 0) {
191  setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs');
192  } else {
193  setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors');
194  }
195 }
196 if ($action == 'createbankpayment' && !empty($user->rights->facture->paiement)) {
197  $db->begin();
198 
199  // Create the record into bank for the amount of payment $object
200  if (!$error) {
201  $label = '(CustomerInvoicePayment)';
202  if (GETPOST('type') == Facture::TYPE_CREDIT_NOTE) {
203  $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note
204  }
205 
206  $bankaccountid = GETPOST('accountid', 'int');
207  if ($bankaccountid > 0) {
208  $object->paiementcode = $object->type_code;
209  $object->amounts = $object->getAmountsArray();
210 
211  $result = $object->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', '');
212  if ($result < 0) {
213  setEventMessages($object->error, $object->errors, 'errors');
214  $error++;
215  }
216  } else {
217  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
218  $error++;
219  }
220  }
221 
222 
223  if (!$error) {
224  $db->commit();
225  } else {
226  $db->rollback();
227  }
228 }
229 
230 
231 /*
232  * View
233  */
234 
235 llxHeader('', $langs->trans("Payment"));
236 
237 $thirdpartystatic = new Societe($db);
238 
239 $result = $object->fetch($id, $ref);
240 if ($result <= 0) {
241  dol_print_error($db, 'Payement '.$id.' not found in database');
242  exit;
243 }
244 
245 $form = new Form($db);
246 
247 $head = payment_prepare_head($object);
248 
249 print dol_get_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), -1, 'payment');
250 
251 // Confirmation of payment delete
252 if ($action == 'delete') {
253  print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete', '', 0, 2);
254 }
255 
256 // Confirmation of payment validation
257 if ($action == 'valide') {
258  $facid = $_GET['facid'];
259  print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_validate', '', 0, 2);
260 }
261 
262 $linkback = '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
263 
264 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '');
265 
266 
267 print '<div class="fichecenter">';
268 print '<div class="underbanner clearboth"></div>';
269 
270 print '<table class="border centpercent">'."\n";
271 
272 // Date payment
273 print '<tr><td class="titlefield">'.$form->editfieldkey("Date", 'datep', $object->date, $object, $user->rights->facture->paiement).'</td><td>';
274 print $form->editfieldval("Date", 'datep', $object->date, $object, $user->rights->facture->paiement, 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded'), '', 0, '', 'id', 'tzuser');
275 print '</td></tr>';
276 
277 // Payment type (VIR, LIQ, ...)
278 $labeltype = $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label;
279 print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>'.$labeltype;
280 print $object->num_payment ? ' - '.$object->num_payment : '';
281 print '</td></tr>';
282 
283 // Amount
284 print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount, '', $langs, 0, -1, -1, $conf->currency).'</td></tr>';
285 
286 $disable_delete = 0;
287 // Bank account
288 if (isModEnabled('banque')) {
289  $bankline = new AccountLine($db);
290 
291  if ($object->fk_account > 0) {
292  $bankline->fetch($object->bank_line);
293  if ($bankline->rappro) {
294  $disable_delete = 1;
295  $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment"));
296  }
297 
298  print '<tr>';
299  print '<td>'.$langs->trans('BankAccount').'</td>';
300  print '<td>';
301  $accountstatic = new Account($db);
302  $accountstatic->fetch($bankline->fk_account);
303  print $accountstatic->getNomUrl(1);
304  print '</td>';
305  print '</tr>';
306  }
307 }
308 
309 // Payment numero
310 /*
311 $titlefield=$langs->trans('Numero').' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
312 print '<tr><td>'.$form->editfieldkey($titlefield,'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
313 print $form->editfieldval($titlefield,'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
314 print '</td></tr>';
315 
316 // Check transmitter
317 $titlefield=$langs->trans('CheckTransmitter').' <em>('.$langs->trans("ChequeMaker").')</em>';
318 print '<tr><td>'.$form->editfieldkey($titlefield,'chqemetteur',$object->,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
319 print $form->editfieldval($titlefield,'chqemetteur',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('ChequeMakeUpdateSucceeded'));
320 print '</td></tr>';
321 
322 // Bank name
323 $titlefield=$langs->trans('Bank').' <em>('.$langs->trans("ChequeBank").')</em>';
324 print '<tr><td>'.$form->editfieldkey($titlefield,'chqbank',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
325 print $form->editfieldval($titlefield,'chqbank',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('ChequeBankUpdateSucceeded'));
326 print '</td></tr>';
327 */
328 
329 // Bank account
330 if (isModEnabled('banque')) {
331  if ($object->fk_account > 0) {
332  if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) {
333  include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
334  $bordereau = new RemiseCheque($db);
335  $bordereau->fetch($bankline->fk_bordereau);
336 
337  print '<tr>';
338  print '<td>'.$langs->trans('CheckReceipt').'</td>';
339  print '<td>';
340  print $bordereau->getNomUrl(1);
341  print '</td>';
342  print '</tr>';
343  }
344  }
345 
346  print '<tr>';
347  print '<td>'.$langs->trans('BankTransactionLine').'</td>';
348  print '<td>';
349  if ($object->fk_account > 0) {
350  print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
351  } else {
352  $langs->load("admin");
353  print '<span class="opacitymedium">';
354  print $langs->trans("NoRecordFoundIBankcAccount", $langs->transnoentitiesnoconv("Module85Name"));
355  print '</span>';
356  if (!empty($user->rights->facture->paiement)) {
357  // Try to guess $bankaccountidofinvoices that is ID of bank account defined on invoice.
358  // Return null if not found, return 0 if it has different value for at least 2 invoices, return the value if same on all invoices where a bank is defined.
359  $amountofpayments = $object->getAmountsArray();
360  $bankaccountidofinvoices = null;
361  foreach ($amountofpayments as $idinvoice => $amountofpayment) {
362  $tmpinvoice = new Facture($db);
363  $tmpinvoice->fetch($idinvoice);
364  if ($tmpinvoice->fk_account > 0 && $bankaccountidofinvoices !== 0) {
365  if (is_null($bankaccountidofinvoices)) {
366  $bankaccountidofinvoices = $tmpinvoice->fk_account;
367  } elseif ($bankaccountidofinvoices != $tmpinvoice->fk_account) {
368  $bankaccountidofinvoices = 0;
369  }
370  }
371  }
372 
373  print '<form method="POST" name="createbankpayment">';
374  print '<input type="hidden" name="token" value="'.newToken().'">';
375  print '<input type="hidden" name="action" value="createbankpayment">';
376  print '<input type="hidden" name="id" value="'.$object->id.'">';
377  print ' '.$langs->trans("ToCreateRelatedRecordIntoBank").': ';
378  print $form->select_comptes($bankaccountidofinvoices, 'accountid', 0, '', 2, '', 0, '', 1);
379  //print '<span class="opacitymedium">';
380  print '<input type="submit" class="button small smallpaddingimp" name="createbankpayment" value="'.$langs->trans("ClickHere").'">';
381  //print '</span>';
382  print '</form>';
383  }
384  }
385  print '</td>';
386  print '</tr>';
387 }
388 
389 // Comments
390 print '<tr><td class="tdtop">'.$form->editfieldkey("Comments", 'note', $object->note, $object, $user->rights->facture->paiement).'</td><td>';
391 print $form->editfieldval("Note", 'note', $object->note, $object, $user->rights->facture->paiement, 'textarea:'.ROWS_3.':90%');
392 print '</td></tr>';
393 
394 print '</table>';
395 
396 print '</div>';
397 
398 print dol_get_fiche_end();
399 
400 
401 /*
402  * List of invoices
403  */
404 
405 $sql = 'SELECT f.rowid as facid, f.ref, f.type, f.total_ttc, f.paye, f.entity, f.fk_statut, pf.amount, s.nom as name, s.rowid as socid';
406 $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
407 $sql .= ' WHERE pf.fk_facture = f.rowid';
408 $sql .= ' AND f.fk_soc = s.rowid';
409 $sql .= ' AND f.entity IN ('.getEntity('invoice').')';
410 $sql .= ' AND pf.fk_paiement = '.((int) $object->id);
411 $resql = $db->query($sql);
412 if ($resql) {
413  $num = $db->num_rows($resql);
414 
415  $i = 0;
416  $total = 0;
417 
418  $moreforfilter = '';
419 
420  print '<br>';
421 
422  print '<div class="div-table-responsive">';
423  print '<table class="noborder centpercent">';
424 
425  print '<tr class="liste_titre">';
426  print '<td>'.$langs->trans('Bill').'</td>';
427  print '<td>'.$langs->trans('Company').'</td>';
428  if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
429  print '<td>'.$langs->trans('Entity').'</td>';
430  }
431  print '<td class="right">'.$langs->trans('ExpectedToPay').'</td>';
432  print '<td class="right">'.$langs->trans('PayedByThisPayment').'</td>';
433  print '<td class="right">'.$langs->trans('RemainderToPay').'</td>';
434  print '<td class="right">'.$langs->trans('Status').'</td>';
435  print "</tr>\n";
436 
437  if ($num > 0) {
438  while ($i < $num) {
439  $objp = $db->fetch_object($resql);
440 
441  $thirdpartystatic->fetch($objp->socid);
442 
443  $invoice = new Facture($db);
444  $invoice->fetch($objp->facid);
445 
446  $paiement = $invoice->getSommePaiement();
447  $creditnotes = $invoice->getSumCreditNotesUsed();
448  $deposits = $invoice->getSumDepositsUsed();
449  $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
450  $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
451 
452  print '<tr class="oddeven">';
453 
454  // Invoice
455  print '<td>';
456  print $invoice->getNomUrl(1);
457  print "</td>\n";
458 
459  // Third party
460  print '<td class="tdoverflowmax150">';
461  print $thirdpartystatic->getNomUrl(1);
462  print '</td>';
463 
464  // Expected to pay
465  if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
466  print '<td>';
467  $mc->getInfo($objp->entity);
468  print $mc->label;
469  print '</td>';
470  }
471  // Expected to pay
472  print '<td class="right"><span class="amount">'.price($objp->total_ttc).'</span></td>';
473 
474  // Amount payed
475  print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
476 
477  // Remain to pay
478  print '<td class="right"><span class="amount">'.price($remaintopay).'</span></td>';
479 
480  // Status
481  print '<td class="right">'.$invoice->getLibStatut(5, $alreadypayed).'</td>';
482 
483  print "</tr>\n";
484 
485  // If at least one invoice is paid, disable delete. INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED Can be use for maintenance purpose. Never use this in production
486  if ($objp->paye == 1 && empty($conf->global->INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED)) {
487  $disable_delete = 1;
488  $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid"));
489  }
490 
491  $total = $total + $objp->amount;
492  $i++;
493  }
494  }
495 
496 
497  print "</table>\n";
498  print '</div>';
499 
500  $db->free($resql);
501 } else {
502  dol_print_error($db);
503 }
504 
505 
506 
507 /*
508  * Actions Buttons
509  */
510 
511 print '<div class="tabsAction">';
512 
513 if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) {
514  if ($user->socid == 0 && $object->statut == 0 && $_GET['action'] == '') {
515  if ($user->rights->facture->paiement) {
516  print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&facid='.$objp->facid.'&action=valide&token='.newToken().'">'.$langs->trans('Valid').'</a>';
517  }
518  }
519 }
520 
521 if ($user->socid == 0 && $action == '') {
522  if ($user->rights->facture->paiement) {
523  if (!$disable_delete) {
524  print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>';
525  } else {
526  print '<a class="butActionRefused classfortooltip" href="#" title="'.$title_button.'">'.$langs->trans('Delete').'</a>';
527  }
528  }
529 }
530 
531 print '</div>';
532 
533 // End of page
534 llxFooter();
535 $db->close();
Societe
Class to manage third parties objects (customers, suppliers, prospects...)
Definition: societe.class.php:48
dol_escape_htmltag
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
Definition: functions.lib.php:1468
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
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
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
Translate
Class to manage translations.
Definition: translate.class.php:30
$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
dol_banner_tab
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
Definition: functions.lib.php:2046
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5661
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
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:105
Facture\TYPE_CREDIT_NOTE
const TYPE_CREDIT_NOTE
Credit note invoice.
Definition: facture.class.php:392
Paiement
Class to manage payments of customer invoices.
Definition: paiement.class.php:41
RemiseCheque
Class to manage cheque delivery receipts.
Definition: remisecheque.class.php:34
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
AccountLine
Class to manage bank transaction lines.
Definition: account.class.php:1779
$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
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
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