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';
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(
"accountancy",
"banks",
"bills",
"categories",
"compta",
"users"));
56$action =
GETPOST(
'action',
'alpha');
58$cancel =
GETPOST(
'cancel',
'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 $resqlent = $db->query(
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"payment_various WHERE rowid = ".((
int) $id).
" AND entity IN (".
getEntity(
'payment_various').
")");
88 if (!$resqlent || !$db->num_rows($resqlent)) {
95$permissiontoadd = $user->hasRight(
'banque',
'modifier');
96$permissiontodelete = $user->hasRight(
'banque',
'modifier');
103$parameters = array();
104$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
109if (empty($reshook)) {
111 if ($action !=
'addlink' && $action !=
'setaccountancy_code' && $action !=
'setsubledger_account') {
112 $urltogo = $backtopage ? $backtopage :
dol_buildpath(
'/compta/bank/various_payment/list.php', 1);
113 header(
"Location: ".$urltogo);
123 if ($action ==
'classin' && $permissiontoadd) {
128 if ($action ==
'add' && $permissiontoadd) {
150 $object->fk_user_author = $user->id;
153 $object->accountancy_code = (
GETPOST(
"accountancy_code") !=
'-1' ?
GETPOST(
"accountancy_code",
"alpha") :
"");
154 $object->subledger_account = $subledger_account;
160 setEventMessages($langs->trans(
"ErrorAccountNotCentralized").
". " . $langs->trans(
"RemoveSubsidiaryAccountOrAdjustTheGeneralAccount"),
null,
'errors');
163 if (empty($datep) || empty($datev)) {
164 $langs->load(
'errors');
165 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Date")),
null,
'errors');
169 $langs->load(
'errors');
170 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Amount")),
null,
'errors');
174 $langs->load(
'errors');
175 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"BankAccount")),
null,
'errors');
179 $langs->load(
'errors');
180 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"PaymentMode")),
null,
'errors');
184 $langs->load(
'errors');
185 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountAccounting")),
null,
'errors');
189 $langs->load(
'errors');
190 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Sens")),
null,
'errors');
194 $bankaccount =
new Account($db);
195 $bankaccount->fetch(
$object->fk_account);
198 $currencyofpayment = $conf->currency;
202 if (
isModEnabled(
'multicurrency') && $currencyofpayment != $bankaccount->currency_code) {
205 setEventMessages($langs->trans(
"ErrorVariousPaymentOnBankAccountWithADifferentCurrencyNotYetSupported"),
null,
'errors');
215 $urltogo = ($backtopage ? $backtopage : DOL_URL_ROOT.
'/compta/bank/various_payment/list.php');
216 header(
"Location: ".$urltogo);
228 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontodelete) {
239 $result = $accountline->fetch(
$object->fk_bank);
241 $result = $accountline->delete($user);
247 header(
"Location: ".DOL_URL_ROOT.
'/compta/bank/various_payment/list.php');
250 $object->error = $accountline ? $accountline->error :
'No AccountLine';
259 setEventMessages(
'Error try do delete a line linked to a conciliated bank transaction',
null,
'errors');
263 if ($action ==
'setaccountancy_code' && $permissiontodelete) {
268 $object->accountancy_code =
GETPOST(
'accountancy_code',
'alphanohtml');
279 if ($action ==
'setsubledger_account' && $permissiontodelete) {
284 $object->subledger_account = $subledger_account;
297if ($action ==
'confirm_clone' && $confirm !=
'yes') {
301if ($action ==
'confirm_clone' && $confirm ==
'yes' && $permissiontoadd) {
312 if (
GETPOST(
'clone_label',
'alphanohtml')) {
320 if ($newdatepayment) {
321 $object->datep = $newdatepayment;
323 if (!empty($newdatevalue)) {
324 $object->datev = $newdatevalue;
326 $object->datev = $newdatepayment;
329 if (GETPOSTISSET(
"clone_sens")) {
333 if (GETPOSTISSET(
"clone_amount")) {
345 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
370$form =
new Form($db);
374 $formaccounting =
null;
391$title =
$object->ref.
" - ".$langs->trans(
'Card');
392if ($action ==
'create') {
393 $title = $langs->trans(
"NewVariousPayment");
395$help_url =
'EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores|DE:Modul_Lieferantenrechnungen';
401require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
404$arrayofbankcategs = $bankcateg->fetchAll();
406foreach ($arrayofbankcategs as $bankcategory) {
407 $options[$bankcategory->id] = $bankcategory->label;
411if ($action ==
'create') {
413 if (!empty($conf->use_javascript_ajax)) {
414 print
"\n".
'<script type="text/javascript">';
415 print
'$(document).ready(function () {
417 $("#selectpaymenttype").change(function() {
420 function setPaymentType()
422 console.log("setPaymentType");
423 var code = $("#selectpaymenttype option:selected").val();
424 if (code == \'CHQ\' || code == \'VIR\')
428 $(\'.fieldrequireddyn\').addClass(\'fieldrequired\');
430 if ($(\'#fieldchqemetteur\').val() == \'\')
432 var emetteur = jQuery(\'#thirdpartylabel\').val();
433 $(\'#fieldchqemetteur\').val(emetteur);
438 $(\'.fieldrequireddyn\').removeClass(\'fieldrequired\');
439 $(\'#fieldchqemetteur\').val(\'\');
442 function toggleSubledger() {
443 var isCentral = $("#accountancy_code option:selected").data("centralized");
444 console.log("the selected general ledger account is centralised?", isCentral);
446 $("#subledger_account").prop("disabled", false);
448 $("#subledger_account").prop("disabled", true);
453 $("#accountancy_code").on("change", toggleSubledger);
454 $("#accountancy_code").on("select2:select", toggleSubledger);
459 print
' </script>'.
"\n";
462 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
463 print
'<input type="hidden" name="token" value="'.newToken().
'">';
464 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
465 print
'<input type="hidden" name="action" value="add">';
467 print
load_fiche_titre($langs->trans(
"NewVariousPayment"),
'',
'object_payment');
471 print
'<table class="border centpercent">';
474 print
'<tr><td class="titlefieldcreate">';
475 print $form->editfieldkey(
'DatePayment',
'datep',
'', $object, 0,
'string',
'', 1).
'</td><td>';
476 print $form->selectDate((empty($datep) ? -1 : $datep),
"datep", 0, 0, 0,
'add', 1, 1);
481 print $form->editfieldkey(
'DateValue',
'datev',
'', $object, 0).
'</td><td>';
482 print $form->selectDate((empty($datev) ? -1 : $datev),
"datev", 0, 0, 0,
'add', 1, 1);
487 print $form->editfieldkey(
'Label',
'label',
'', $object, 0,
'string',
'', 1).
'</td><td>';
488 print
'<input name="label" id="label" class="minwidth300 maxwidth150onsmartphone" value="'.($label ? $label : $langs->trans(
"VariousPayment")).
'">';
493 print $form->editfieldkey(
'Amount',
'amount',
'', $object, 0,
'string',
'', 1).
'</td><td>';
494 print
'<input name="amount" id="amount" class="minwidth50 maxwidth100" value="'.$amount.
'">';
500 print $form->editfieldkey(
'BankAccount',
'selectaccountid',
'', $object, 0,
'string',
'', 1).
'</td><td>';
501 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
502 print $form->select_comptes($accountid,
"accountid", 0,
'', 2,
'', (
isModEnabled(
'multicurrency') ? 1 : 0),
'', 1);
507 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
'PaymentMode').
'</span></td><td>';
508 $form->select_types_paiements($paymenttype,
'paymenttype',
'', 2);
514 print
'<tr><td><label for="num_payment">'.$langs->trans(
'Numero');
515 print
' <em>('.$langs->trans(
"ChequeOrTransferNumber").
')</em>';
516 print
'</label></td>';
517 print
'<td><input name="num_payment" class="maxwidth150onsmartphone" id="num_payment" type="text" value="'.GETPOST(
"num_payment").
'"></td></tr>'.
"\n";
520 print
'<tr><td class="'.(GETPOST(
'paymenttype') ==
'CHQ' ?
'fieldrequired ' :
'').
'fieldrequireddyn"><label for="fieldchqemetteur">'.$langs->trans(
'CheckTransmitter');
521 print
' <em>('.$langs->trans(
"ChequeMaker").
')</em>';
522 print
'</label></td>';
523 print
'<td><input id="fieldchqemetteur" name="chqemetteur" size="30" type="text" value="'.GETPOST(
'chqemetteur',
'alphanohtml').
'"></td></tr>';
526 print
'<tr><td><label for="chqbank">'.$langs->trans(
'Bank');
527 print
' <em>('.$langs->trans(
"ChequeBank").
')</em>';
528 print
'</label></td>';
529 print
'<td><input id="chqbank" name="chqbank" size="30" type="text" value="'.GETPOST(
'chqbank',
'alphanohtml').
'"></td></tr>';
537 $langs->load(
"projects");
539 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
540 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
541 print $formproject->select_projects(-1, (
string) $projectid,
'fk_project', 0, 0, 1, 1, 0, 0, 0,
'', 1);
546 $parameters = array();
547 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
548 print $hookmanager->resPrint;
551 if (is_array($options) && count($options) &&
isModEnabled(
'category')) {
552 print
'<tr><td>'.$langs->trans(
"RubriquesTransactions").
'</td><td>';
553 print
img_picto(
'',
'category').Form::selectarray(
'category_transaction', $options,
GETPOST(
'category_transaction'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth300', 1);
557 print
'<tr><td colspan="2"><hr></td></tr>';
563 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"AccountAccounting").
'</td>';
565 print $formaccounting->select_account($accountancy_code,
'accountancy_code', 1, array(), 1, 1);
568 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"AccountAccounting").
'</td>';
569 print
'<td><input class="minwidth100 maxwidthonsmartphone" name="accountancy_code" value="'.$accountancy_code.
'">';
576 print
'<tr><td>'.$langs->trans(
"SubledgerAccount").
'</td>';
579 print $formaccounting->select_auxaccount($subledger_account,
'subledger_account', 1,
'');
581 print
'<input type="text" class="maxwidth200 maxwidthonsmartphone" name="subledger_account" value="'.$subledger_account.
'">';
585 print
'<tr><td>'.$langs->trans(
"SubledgerAccount").
'</td>';
586 print
'<td><input class="minwidth100 maxwidthonsmartphone" name="subledger_account" value="'.$subledger_account.
'">';
592 $labelsens = $form->textwithpicto($langs->trans(
'Sens'), $langs->trans(
"AccountingDirectionHelp"));
593 print $form->editfieldkey($labelsens,
'sens',
'', $object, 0,
'string',
'', 1).
'</td><td>';
594 $sensarray = array(
'0' => $langs->trans(
"Debit"),
'1' => $langs->trans(
"Credit"));
595 print $form->selectarray(
'sens', $sensarray, $sens, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
602 print $form->buttonsSaveCancel();
609 $alreadyaccounted =
$object->getVentilExportCompta();
614 if ($action ===
'clone') {
615 $set_value_help = $form->textwithpicto(
'', $langs->trans($langs->trans(
"AccountingDirectionHelp")));
616 $sensarray = array(
'0' => $langs->trans(
"Debit"),
'1' => $langs->trans(
"Credit"));
618 $formquestion = array(
619 array(
'type' =>
'text',
'name' =>
'clone_label',
'label' => $langs->trans(
"Label"),
'value' => $langs->trans(
"CopyOf").
' '.
$object->label),
620 array(
'type' =>
'date',
'tdclass' =>
'fieldrequired',
'name' =>
'clone_date_payment',
'label' => $langs->trans(
"DatePayment"),
'value' => -1),
621 array(
'type' =>
'date',
'name' =>
'clone_date_value',
'label' => $langs->trans(
"DateValue"),
'value' => -1),
622 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)),
623 array(
'type' =>
'text',
'name' =>
'clone_amount',
'label' => $langs->trans(
"Amount"),
'value' =>
price(
$object->amount)),
624 array(
'type' =>
'select',
'name' =>
'clone_sens',
'label' => $langs->trans(
"Sens").
' '.$set_value_help,
'values' => $sensarray,
'default' => (
string)
$object->sens),
627 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneVariousPayment',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1, 350);
631 if ($action ==
'delete') {
632 $text = $langs->trans(
'ConfirmDeleteVariousPayment');
633 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $langs->trans(
'DeleteVariousPayment'), $text,
'confirm_delete',
'',
'', 2);
638 $morehtmlref =
'<div class="refidno">';
641 $langs->load(
"projects");
643 if ($permissiontoadd) {
644 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
645 if ($action !=
'classify') {
646 $morehtmlref .=
'<a class="editfielda" href="'.dolBuildUrl($_SERVER[
'PHP_SELF'], [
'action' =>
'classify',
'id' =>
$object->id],
true).
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
648 if ($action ==
'classify') {
650 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
651 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
652 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
653 $morehtmlref .= $formproject->select_projects(-1, (
string)
$object->fk_project,
'projectid', 0, 0, 1, 1, 0, 0, 0,
'', 1, 0,
'maxwidth500 widthcentpercentminusxx');
654 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
655 $morehtmlref .=
'</form>';
657 $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');
660 if (!empty(
$object->fk_project)) {
662 $proj->fetch(
$object->fk_project);
663 $morehtmlref .= $proj->getNomUrl(1);
665 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
671 $morehtmlref .=
'</div>';
672 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/various_payment/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
674 $morehtmlstatus =
'';
676 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlstatus);
678 print
'<div class="fichecenter">';
679 print
'<div class="underbanner clearboth"></div>';
681 print
'<table class="border centpercent tableforfield">';
684 print
'<tr><td class="titlefield">'.$langs->trans(
"Label").
'</td><td>'.
$object->label.
'</td></tr>';
688 print
'<td>'.$langs->trans(
"DatePayment").
'</td><td>';
693 print
'<tr><td>'.$langs->trans(
"DateValue").
'</td><td>';
699 $sens = $langs->trans(
"Credit");
701 $sens = $langs->trans(
"Debit");
703 print
'<tr><td>'.$langs->trans(
"Sens").
'</td><td>'.$sens.
'</td></tr>';
705 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td><span class="amount">'.
price(
$object->amount, 0, $langs, 1, -1, -1, $conf->currency).
'</span></td></tr>';
711 print
'<tr><td class="nowrap">';
712 print $form->editfieldkey(
'AccountAccounting',
'accountancy_code',
$object->accountancy_code, $object, (
int) (!$alreadyaccounted && $permissiontoadd),
'string',
'', 0);
714 if ($action ==
'editaccountancy_code' && (!$alreadyaccounted && $permissiontoadd)) {
716 print $formaccounting->formAccountingAccount($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->accountancy_code,
'accountancy_code', 0, 1,
'', 1);
719 $accountingaccount->fetch(0,
$object->accountancy_code, 1);
721 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
725 print
'<tr><td class="nowrap">';
726 print $langs->trans(
"AccountAccounting");
728 print
$object->accountancy_code;
733 print
'<tr><td class="nowrap">';
734 print $form->editfieldkey(
'SubledgerAccount',
'subledger_account',
$object->subledger_account, $object, (
int) (!$alreadyaccounted && $permissiontoadd),
'string',
'', 0);
736 if ($action ==
'editsubledger_account' && (!$alreadyaccounted && $permissiontoadd)) {
739 print $formaccounting->formAccountingAccount($_SERVER[
'PHP_SELF'] .
'?id=' .
$object->id,
$object->subledger_account,
'subledger_account', 1, 1,
'', 1);
741 print $form->editfieldval(
'SubledgerAccount',
'subledger_account',
$object->subledger_account, $object, (!$alreadyaccounted && $permissiontoadd),
'string',
'',
null,
null,
'', 1,
'lengthAccounta');
748 $bankaccountnotfound = 0;
752 print
'<td>'.$langs->trans(
'BankTransactionLine').
'</td>';
753 print
'<td colspan="3">';
756 $result = $bankline->fetch(
$object->fk_bank);
759 $bankaccountnotfound = 1;
761 print $bankline->getNomUrl(1, 0,
'showall');
764 $bankaccountnotfound = 1;
766 print
'<span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span>';
773 $parameters = array(
'socid' =>
$object->id);
774 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
780 print
'<div class="clearboth"></div>';
788 print
'<div class="tabsAction">'.
"\n";
794 if ($permissiontoadd) {
795 print
'<div class="inline-block divButAction"><a class="butAction" href="'.dol_buildpath(
"/compta/bank/various_payment/card.php", 1).
'?id='.
$object->id.
'&action=clone&token='.
newToken().
'">'.$langs->trans(
"ToClone").
"</a></div>";
799 if (empty(
$object->rappro) || $bankaccountnotfound) {
800 if ($permissiontoadd) {
801 if ($alreadyaccounted) {
802 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"Accounted").
'">'.$langs->trans(
"Delete").
'</a></div>';
804 print
'<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?id='.$object->id.
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a></div>';
807 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.(dol_escape_htmltag($langs->trans(
"NotAllowed"))).
'">'.$langs->trans(
"Delete").
'</a></div>';
810 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(! $sortfield) if(! $sortorder) $object
length_accounta($accounta)
Return Auxiliary accounting account of thirdparties with defined length.
checkGeneralAccountAllowsAuxiliary($db, $general_account, $auxiliary_account, $general_account_id=0)
Check if a general accounting account allows the use of an auxiliary account.
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.
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.