29require
'../../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
38if (isModEnabled(
'project')) {
39 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
52$langs->loadLangs(array(
"compta",
"banks",
"bills",
"users",
"accountancy",
"categories"));
56$action =
GETPOST(
'action',
'alpha');
59$backtopage =
GETPOST(
'backtopage',
'alpha');
62$label =
GETPOST(
"label",
"alpha");
65$paymenttype =
GETPOST(
"paymenttype",
"aZ09");
66$accountancy_code =
GETPOST(
"accountancy_code",
"alpha");
69 $subledger_account =
GETPOST(
"subledger_account",
"alpha") > 0 ?
GETPOST(
"subledger_account",
"alpha") :
'';
71 $subledger_account =
GETPOST(
"subledger_account",
"alpha");
77 $socid = $user->socid;
81$hookmanager->initHooks(array(
'variouscard',
'globalcard'));
87$permissiontoadd = $user->hasRight(
'banque',
'modifier');
88$permissiontodelete = $user->hasRight(
'banque',
'modifier');
96$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
101if (empty($reshook)) {
103 if ($action !=
'addlink' && $action !=
'setaccountancy_code' && $action !=
'setsubledger_account') {
104 $urltogo = $backtopage ? $backtopage :
dol_buildpath(
'/compta/bank/various_payment/list.php', 1);
105 header(
"Location: ".$urltogo);
115 if ($action ==
'classin' && $permissiontoadd) {
120 if ($action ==
'add' && $permissiontoadd) {
142 $object->fk_user_author = $user->id;
145 $object->accountancy_code = (
GETPOST(
"accountancy_code") !=
'-1' ?
GETPOST(
"accountancy_code",
"alpha") :
"");
146 $object->subledger_account = $subledger_account;
151 if (empty($datep) || empty($datev)) {
152 $langs->load(
'errors');
153 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Date")),
null,
'errors');
157 $langs->load(
'errors');
158 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Amount")),
null,
'errors');
161 if (isModEnabled(
"bank") && !
$object->accountid > 0) {
162 $langs->load(
'errors');
163 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"BankAccount")),
null,
'errors');
167 $langs->load(
'errors');
168 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"PaymentMode")),
null,
'errors');
171 if (isModEnabled(
'accounting') && !
$object->accountancy_code) {
172 $langs->load(
'errors');
173 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountAccounting")),
null,
'errors');
177 $langs->load(
'errors');
178 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Sens")),
null,
'errors');
182 $bankaccount =
new Account($db);
183 $bankaccount->fetch(
$object->fk_account);
186 $currencyofpayment =
$conf->currency;
190 if (isModEnabled(
'multicurrency') && $currencyofpayment != $bankaccount->currency_code) {
193 setEventMessages($langs->trans(
"ErrorVariousPaymentOnBankAccountWithADifferentCurrencyNotYetSupported"),
null,
'errors');
203 $urltogo = ($backtopage ? $backtopage : DOL_URL_ROOT.
'/compta/bank/various_payment/list.php');
204 header(
"Location: ".$urltogo);
216 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontodelete) {
227 $result = $accountline->fetch(
$object->fk_bank);
229 $result = $accountline->delete($user);
235 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/list.php');
238 $object->error = $accountline ? $accountline->error :
'No AccountLine';
247 setEventMessages(
'Error try do delete a line linked to a conciliated bank transaction',
null,
'errors');
251 if ($action ==
'setaccountancy_code' && $permissiontodelete) {
256 $object->accountancy_code =
GETPOST(
'accountancy_code',
'alphanohtml');
267 if ($action ==
'setsubledger_account' && $permissiontodelete) {
272 $object->subledger_account = $subledger_account;
285if ($action ==
'confirm_clone' && $confirm !=
'yes') {
289if ($action ==
'confirm_clone' && $confirm ==
'yes' && $permissiontoadd) {
300 if (
GETPOST(
'clone_label',
'alphanohtml')) {
308 if ($newdatepayment) {
309 $object->datep = $newdatepayment;
311 if (!empty($newdatevalue)) {
312 $object->datev = $newdatevalue;
314 $object->datev = $newdatepayment;
317 if (GETPOSTISSET(
"clone_sens")) {
321 if (GETPOSTISSET(
"clone_amount")) {
333 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
358$form =
new Form($db);
359if (isModEnabled(
'accounting')) {
362 $formaccounting =
null;
364if (isModEnabled(
'project')) {
379$title =
$object->ref.
" - ".$langs->trans(
'Card');
380if ($action ==
'create') {
381 $title = $langs->trans(
"NewVariousPayment");
383$help_url =
'EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores|DE:Modul_Lieferantenrechnungen';
389require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
392$arrayofbankcategs = $bankcateg->fetchAll();
394foreach ($arrayofbankcategs as $bankcategory) {
395 $options[$bankcategory->id] = $bankcategory->label;
399if ($action ==
'create') {
401 if (!empty(
$conf->use_javascript_ajax)) {
402 print
"\n".
'<script type="text/javascript">';
403 print
'$(document).ready(function () {
405 $("#selectpaymenttype").change(function() {
408 function setPaymentType()
410 console.log("setPaymentType");
411 var code = $("#selectpaymenttype option:selected").val();
412 if (code == \'CHQ\' || code == \'VIR\')
416 $(\'.fieldrequireddyn\').addClass(\'fieldrequired\');
418 if ($(\'#fieldchqemetteur\').val() == \'\')
420 var emetteur = jQuery(\'#thirdpartylabel\').val();
421 $(\'#fieldchqemetteur\').val(emetteur);
426 $(\'.fieldrequireddyn\').removeClass(\'fieldrequired\');
427 $(\'#fieldchqemetteur\').val(\'\');
434 print
' </script>'.
"\n";
437 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
438 print
'<input type="hidden" name="token" value="'.newToken().
'">';
439 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
440 print
'<input type="hidden" name="action" value="add">';
442 print
load_fiche_titre($langs->trans(
"NewVariousPayment"),
'',
'object_payment');
446 print
'<table class="border centpercent">';
449 print
'<tr><td class="titlefieldcreate">';
450 print $form->editfieldkey(
'DatePayment',
'datep',
'',
$object, 0,
'string',
'', 1).
'</td><td>';
451 print $form->selectDate((empty($datep) ? -1 : $datep),
"datep", 0, 0, 0,
'add', 1, 1);
456 print $form->editfieldkey(
'DateValue',
'datev',
'',
$object, 0).
'</td><td>';
457 print $form->selectDate((empty($datev) ? -1 : $datev),
"datev", 0, 0, 0,
'add', 1, 1);
462 print $form->editfieldkey(
'Label',
'label',
'',
$object, 0,
'string',
'', 1).
'</td><td>';
463 print
'<input name="label" id="label" class="minwidth300 maxwidth150onsmartphone" value="'.($label ? $label : $langs->trans(
"VariousPayment")).
'">';
468 print $form->editfieldkey(
'Amount',
'amount',
'',
$object, 0,
'string',
'', 1).
'</td><td>';
469 print
'<input name="amount" id="amount" class="minwidth50 maxwidth100" value="'.$amount.
'">';
473 if (isModEnabled(
"bank")) {
475 print $form->editfieldkey(
'BankAccount',
'selectaccountid',
'',
$object, 0,
'string',
'', 1).
'</td><td>';
476 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
477 print $form->select_comptes($accountid,
"accountid", 0,
'', 2,
'', (isModEnabled(
'multicurrency') ? 1 : 0),
'', 1);
482 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
'PaymentMode').
'</span></td><td>';
483 $form->select_types_paiements($paymenttype,
'paymenttype',
'', 2);
488 if (isModEnabled(
"bank")) {
489 print
'<tr><td><label for="num_payment">'.$langs->trans(
'Numero');
490 print
' <em>('.$langs->trans(
"ChequeOrTransferNumber").
')</em>';
491 print
'</label></td>';
492 print
'<td><input name="num_payment" class="maxwidth150onsmartphone" id="num_payment" type="text" value="'.GETPOST(
"num_payment").
'"></td></tr>'.
"\n";
495 print
'<tr><td class="'.(GETPOST(
'paymenttype') ==
'CHQ' ?
'fieldrequired ' :
'').
'fieldrequireddyn"><label for="fieldchqemetteur">'.$langs->trans(
'CheckTransmitter');
496 print
' <em>('.$langs->trans(
"ChequeMaker").
')</em>';
497 print
'</label></td>';
498 print
'<td><input id="fieldchqemetteur" name="chqemetteur" size="30" type="text" value="'.GETPOST(
'chqemetteur',
'alphanohtml').
'"></td></tr>';
501 print
'<tr><td><label for="chqbank">'.$langs->trans(
'Bank');
502 print
' <em>('.$langs->trans(
"ChequeBank").
')</em>';
503 print
'</label></td>';
504 print
'<td><input id="chqbank" name="chqbank" size="30" type="text" value="'.GETPOST(
'chqbank',
'alphanohtml').
'"></td></tr>';
508 if (isModEnabled(
'project')) {
512 $langs->load(
"projects");
514 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
515 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
516 print $formproject->select_projects(-1, (
string) $projectid,
'fk_project', 0, 0, 1, 1, 0, 0, 0,
'', 1);
521 $parameters = array();
522 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters,
$object, $action);
523 print $hookmanager->resPrint;
526 if (is_array($options) && count($options) &&
$conf->categorie->enabled) {
527 print
'<tr><td>'.$langs->trans(
"RubriquesTransactions").
'</td><td>';
528 print
img_picto(
'',
'category').Form::selectarray(
'category_transaction', $options,
GETPOST(
'category_transaction'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth300', 1);
532 print
'<tr><td colspan="2"><hr></td></tr>';
535 if (isModEnabled(
'accounting')) {
538 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"AccountAccounting").
'</td>';
540 print $formaccounting->select_account($accountancy_code,
'accountancy_code', 1, array(), 1, 1);
543 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"AccountAccounting").
'</td>';
544 print
'<td><input class="minwidth100 maxwidthonsmartphone" name="accountancy_code" value="'.$accountancy_code.
'">';
549 if (isModEnabled(
'accounting')) {
551 print
'<tr><td>'.$langs->trans(
"SubledgerAccount").
'</td>';
554 print $formaccounting->select_auxaccount($subledger_account,
'subledger_account', 1,
'');
556 print
'<input type="text" class="maxwidth200 maxwidthonsmartphone" name="subledger_account" value="'.$subledger_account.
'">';
560 print
'<tr><td>'.$langs->trans(
"SubledgerAccount").
'</td>';
561 print
'<td><input class="minwidth100 maxwidthonsmartphone" name="subledger_account" value="'.$subledger_account.
'">';
567 $labelsens = $form->textwithpicto($langs->trans(
'Sens'), $langs->trans(
"AccountingDirectionHelp"));
568 print $form->editfieldkey($labelsens,
'sens',
'',
$object, 0,
'string',
'', 1).
'</td><td>';
569 $sensarray = array(
'0' => $langs->trans(
"Debit"),
'1' => $langs->trans(
"Credit"));
570 print $form->selectarray(
'sens', $sensarray, $sens, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
577 print $form->buttonsSaveCancel();
584 $alreadyaccounted =
$object->getVentilExportCompta();
589 if ($action ===
'clone') {
590 $set_value_help = $form->textwithpicto(
'', $langs->trans($langs->trans(
"AccountingDirectionHelp")));
591 $sensarray = array(
'0' => $langs->trans(
"Debit"),
'1' => $langs->trans(
"Credit"));
593 $formquestion = array(
594 array(
'type' =>
'text',
'name' =>
'clone_label',
'label' => $langs->trans(
"Label"),
'value' => $langs->trans(
"CopyOf").
' '.
$object->label),
595 array(
'type' =>
'date',
'tdclass' =>
'fieldrequired',
'name' =>
'clone_date_payment',
'label' => $langs->trans(
"DatePayment"),
'value' => -1),
596 array(
'type' =>
'date',
'name' =>
'clone_date_value',
'label' => $langs->trans(
"DateValue"),
'value' => -1),
597 array(
'type' =>
'other',
'tdclass' =>
'fieldrequired',
'name' =>
'clone_accountid',
'label' => $langs->trans(
"BankAccount"),
'value' => $form->select_comptes(
$object->fk_account,
"accountid", 0,
'', 1,
'', 0,
'minwidth200', 1)),
598 array(
'type' =>
'text',
'name' =>
'clone_amount',
'label' => $langs->trans(
"Amount"),
'value' =>
price(
$object->amount)),
599 array(
'type' =>
'select',
'name' =>
'clone_sens',
'label' => $langs->trans(
"Sens").
' '.$set_value_help,
'values' => $sensarray,
'default' => (
string)
$object->sens),
602 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneVariousPayment',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1, 350);
606 if ($action ==
'delete') {
607 $text = $langs->trans(
'ConfirmDeleteVariousPayment');
608 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $langs->trans(
'DeleteVariousPayment'), $text,
'confirm_delete',
'',
'', 2);
613 $morehtmlref =
'<div class="refidno">';
615 if (isModEnabled(
'project') && $formproject !==
null) {
616 $langs->load(
"projects");
618 if ($permissiontoadd) {
619 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
620 if ($action !=
'classify') {
621 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
623 if ($action ==
'classify') {
625 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
626 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
627 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
628 $morehtmlref .= $formproject->select_projects(-1, (
string)
$object->fk_project,
'projectid', 0, 0, 1, 1, 0, 0, 0,
'', 1, 0,
'maxwidth500 widthcentpercentminusxx');
629 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
630 $morehtmlref .=
'</form>';
632 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, (property_exists(
$object,
'socid') ?
$object->socid : 0), (string)
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
635 if (!empty(
$object->fk_project)) {
637 $proj->fetch(
$object->fk_project);
638 $morehtmlref .= $proj->getNomUrl(1);
640 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
646 $morehtmlref .=
'</div>';
647 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/various_payment/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
649 $morehtmlstatus =
'';
651 dol_banner_tab(
$object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlstatus);
653 print
'<div class="fichecenter">';
654 print
'<div class="underbanner clearboth"></div>';
656 print
'<table class="border centpercent tableforfield">';
659 print
'<tr><td class="titlefield">'.$langs->trans(
"Label").
'</td><td>'.
$object->label.
'</td></tr>';
663 print
'<td>'.$langs->trans(
"DatePayment").
'</td><td>';
668 print
'<tr><td>'.$langs->trans(
"DateValue").
'</td><td>';
674 $sens = $langs->trans(
"Credit");
676 $sens = $langs->trans(
"Debit");
678 print
'<tr><td>'.$langs->trans(
"Sens").
'</td><td>'.$sens.
'</td></tr>';
680 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td><span class="amount">'.
price(
$object->amount, 0, $langs, 1, -1, -1,
$conf->currency).
'</span></td></tr>';
684 if (isModEnabled(
'accounting')) {
686 print
'<tr><td class="nowrap">';
687 print $form->editfieldkey(
'AccountAccounting',
'accountancy_code',
$object->accountancy_code,
$object, (
int) (!$alreadyaccounted && $permissiontoadd),
'string',
'', 0);
689 if ($action ==
'editaccountancy_code' && (!$alreadyaccounted && $permissiontoadd)) {
691 print $formaccounting->formAccountingAccount($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->accountancy_code,
'accountancy_code', 0, 1,
'', 1);
694 $accountingaccount->fetch(0,
$object->accountancy_code, 1);
696 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
700 print
'<tr><td class="nowrap">';
701 print $langs->trans(
"AccountAccounting");
703 print
$object->accountancy_code;
708 print
'<tr><td class="nowrap">';
709 print $form->editfieldkey(
'SubledgerAccount',
'subledger_account',
$object->subledger_account,
$object, (
int) (!$alreadyaccounted && $permissiontoadd),
'string',
'', 0);
711 if ($action ==
'editsubledger_account' && (!$alreadyaccounted && $permissiontoadd)) {
714 print $formaccounting->formAccountingAccount($_SERVER[
'PHP_SELF'] .
'?id=' .
$object->id,
$object->subledger_account,
'subledger_account', 1, 1,
'', 1);
716 print $form->editfieldval(
'SubledgerAccount',
'subledger_account',
$object->subledger_account,
$object, (!$alreadyaccounted && $permissiontoadd),
'string',
'',
null,
null,
'', 1,
'lengthAccounta');
723 $bankaccountnotfound = 0;
725 if (isModEnabled(
'bank')) {
727 print
'<td>'.$langs->trans(
'BankTransactionLine').
'</td>';
728 print
'<td colspan="3">';
731 $result = $bankline->fetch(
$object->fk_bank);
734 $bankaccountnotfound = 1;
736 print $bankline->getNomUrl(1, 0,
'showall');
739 $bankaccountnotfound = 1;
741 print
'<span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span>';
748 $parameters = array(
'socid' =>
$object->id);
749 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
755 print
'<div class="clearboth"></div>';
763 print
'<div class="tabsAction">'.
"\n";
769 if ($permissiontoadd) {
770 print
'<div class="inline-block divButAction"><a class="butAction" href="'.dol_buildpath(
"/compta/bank/various_payment/card.php", 1).
'?id='.
$object->id.
'&action=clone">'.$langs->trans(
"ToClone").
"</a></div>";
774 if (empty(
$object->rappro) || $bankaccountnotfound) {
775 if ($permissiontoadd) {
776 if ($alreadyaccounted) {
777 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"Accounted").
'">'.$langs->trans(
"Delete").
'</a></div>';
779 print
'<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?id='.$object->id.
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a></div>';
782 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.(dol_escape_htmltag($langs->trans(
"NotAllowed"))).
'">'.$langs->trans(
"Delete").
'</a></div>';
785 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"LinkedToAConciliatedTransaction").
'">'.$langs->trans(
"Delete").
'</a></div>';
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
length_accounta($accounta)
Return Auxiliary accounting account of thirdparties with defined length.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
various_payment_prepare_head($object)
Prepare array with list of tabs.
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage accounting accounts.
Class to manage bank categories.
Class to manage various payments.
Class to manage projects.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='')
Return the value of a $_GET or $_POST supervariable, converted into float.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.