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