31require
'../../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
52 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
53 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
57$langs->loadLangs(array(
"accountancy",
"banks",
"bills",
"categories",
"compta",
"users"));
61$action =
GETPOST(
'action',
'alpha');
63$cancel =
GETPOST(
'cancel',
'alpha');
64$backtopage =
GETPOST(
'backtopage',
'alpha');
67$label =
GETPOST(
"label",
"alpha");
70$paymenttype =
GETPOST(
"paymenttype",
"aZ09");
71$accountancy_code =
GETPOST(
"accountancy_code",
"alpha");
75 $subledger_account =
GETPOST(
"subledger_account",
"alpha") > 0 ?
GETPOST(
"subledger_account",
"alpha") :
'';
77 $subledger_account =
GETPOST(
"subledger_account",
"alpha");
83 $socid = $user->socid;
87$hookmanager->initHooks(array(
'variouscard',
'globalcard'));
93 $resqlent = $db->query(
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"payment_various WHERE rowid = ".((
int) $id).
" AND entity IN (".
getEntity(
'payment_various').
")");
94 if (!$resqlent || !$db->num_rows($resqlent)) {
102include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
104$extrafields->fetch_name_optionals_label(
$object->table_element);
106$permissiontoadd = $user->hasRight(
'banque',
'modifier');
107$permissiontodelete = $user->hasRight(
'banque',
'modifier');
114$parameters = array();
115$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
117 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
120if (empty($reshook)) {
122 if ($action !=
'addlink' && $action !=
'setaccountancy_code' && $action !=
'setsubledger_account') {
123 $urltogo = $backtopage ? $backtopage :
dol_buildpath(
'/compta/bank/various_payment/list.php', 1);
124 header(
"Location: ".$urltogo);
131 if ($action ==
'classin' && $permissiontoadd) {
135 if ($action ==
'add' && $permissiontoadd) {
157 $object->fk_user_author = $user->id;
160 $object->accountancy_code = (
GETPOST(
"accountancy_code") !=
'-1' ?
GETPOST(
"accountancy_code",
"alpha") :
"");
161 $object->subledger_account = $subledger_account;
167 $object->fk_soc = ($fk_soc > 0 ? $fk_soc : 0);
172 $ret = $extrafields->setOptionalsFromPost(
null, $object);
178 setEventMessages($langs->trans(
"ErrorAccountNotCentralized").
". " . $langs->trans(
"RemoveSubsidiaryAccountOrAdjustTheGeneralAccount"),
null,
'errors');
181 if (empty($datep) || empty($datev)) {
182 $langs->load(
'errors');
183 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Date")),
null,
'errors');
187 $langs->load(
'errors');
188 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Amount")),
null,
'errors');
192 $langs->load(
'errors');
193 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"BankAccount")),
null,
'errors');
197 $langs->load(
'errors');
198 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"PaymentMode")),
null,
'errors');
202 $langs->load(
'errors');
203 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountAccounting")),
null,
'errors');
207 $langs->load(
'errors');
208 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Sens")),
null,
'errors');
212 $bankaccount =
new Account($db);
214 $bankaccount->fetch((
int)
$object->fk_account);
218 $currencyofpayment =
$conf->currency;
220 if (
isModEnabled(
'multicurrency') && $currencyofpayment != $bankaccount->currency_code) {
223 setEventMessages($langs->trans(
"ErrorVariousPaymentOnBankAccountWithADifferentCurrencyNotYetSupported"),
null,
'errors');
233 $urltogo = ($backtopage ? $backtopage :
dolBuildUrl(DOL_URL_ROOT.
'/compta/bank/various_payment/list.php'));
234 header(
"Location: ".$urltogo);
246 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontodelete) {
256 $result = $accountline->fetch(
$object->fk_bank);
258 $result = $accountline->delete($user);
264 header(
"Location: ".
dolBuildUrl(DOL_URL_ROOT.
'/compta/bank/various_payment/list.php'));
267 $object->error = $accountline ? $accountline->error :
'No AccountLine';
276 setEventMessages(
'Error try do delete a line linked to a conciliated bank transaction',
null,
'errors');
280 if ($action ==
'setaccountancy_code' && $permissiontodelete) {
283 $object->accountancy_code =
GETPOST(
'accountancy_code',
'alphanohtml');
294 if ($action ==
'setsubledger_account' && $permissiontodelete) {
297 $object->subledger_account = $subledger_account;
310if ($action ==
'confirm_clone' && $confirm !=
'yes') {
314if ($action ==
'confirm_clone' && $confirm ==
'yes' && $permissiontoadd) {
323 if (
GETPOST(
'clone_label',
'alphanohtml')) {
331 if ($newdatepayment) {
332 $object->datep = $newdatepayment;
334 if (!empty($newdatevalue)) {
335 $object->datev = $newdatevalue;
337 $object->datev = $newdatepayment;
340 if (
GETPOSTINT(
'selectclone_accountid') > 0) {
361 header(
"Location: ".
dolBuildUrl($_SERVER[
"PHP_SELF"], [
"id" => $id]));
377 dol_print_error($db,
$object->error);
386$form =
new Form($db);
390 $formaccounting =
null;
398if ($action !=
'create' && !
$object->id) {
402$title =
$object->ref.
" - ".$langs->trans(
'Card');
403if ($action ==
'create') {
404 $title = $langs->trans(
"NewVariousPayment");
406$help_url =
'EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores|DE:Modul_Lieferantenrechnungen';
412require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
415$arrayofbankcategs = $bankcateg->fetchAll();
417foreach ($arrayofbankcategs as $bankcategory) {
418 $options[$bankcategory->id] = $bankcategory->label;
422if ($action ==
'create') {
424 if (!empty(
$conf->use_javascript_ajax)) {
426 <script
type=
"text/javascript">
427 $(document).ready(
function() {
429 $(
"#selectpaymenttype").change(
function() {
433 function setPaymentType() {
434 console.log(
"setPaymentType");
435 var code = $(
"#selectpaymenttype option:selected").val();
436 if (code ==
"CHQ" || code ==
"VIR") {
438 $(
'.fieldrequireddyn').addClass(
'fieldrequired');
440 if ($(
'#fieldchqemetteur').val() ==
'') {
441 var emetteur = jQuery(
'#thirdpartylabel').val();
442 $(
'#fieldchqemetteur').val(emetteur);
445 $(
".fieldrequireddyn").removeClass(
"fieldrequired");
446 $(
"#fieldchqemetteur").val(
"");
450 function toggleSubledger() {
451 var isCentral = $(
"#accountancy_code option:selected").data(
"centralized");
452 console.log(
"the selected general ledger account is centralised?", isCentral);
454 $(
"#subledger_account").prop(
"disabled",
false);
456 $(
"#subledger_account").prop(
"disabled",
true);
461 $(
"#accountancy_code").on(
"change", toggleSubledger);
462 $(
"#accountancy_code").on(
"select2:select", toggleSubledger);
468 print
'<form action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'" method="POST">';
469 print
'<input type="hidden" name="token" value="'.newToken().
'">';
470 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
471 print
'<input type="hidden" name="action" value="add">';
473 print
load_fiche_titre($langs->trans(
"NewVariousPayment"),
'',
'object_payment');
477 print
'<table class="border centpercent">';
480 print
'<tr><td class="titlefieldcreate">';
481 print $form->editfieldkey(
'DatePayment',
'datep',
'', $object, 0,
'string',
'', 1).
'</td><td>';
482 print $form->selectDate((empty($datep) ? -1 : $datep),
"datep", 0, 0, 0,
'add', 1, 1);
487 print $form->editfieldkey(
'DateValue',
'datev',
'', $object, 0).
'</td><td>';
488 print $form->selectDate((empty($datev) ? -1 : $datev),
"datev", 0, 0, 0,
'add', 1, 1);
493 print $form->editfieldkey(
'Label',
'label',
'', $object, 0,
'string',
'', 1).
'</td><td>';
494 print
'<input name="label" id="label" class="minwidth300 maxwidth150onsmartphone" value="'.($label ? $label : $langs->trans(
"VariousPayment")).
'">';
499 print $form->editfieldkey(
'Amount',
'amount',
'', $object, 0,
'string',
'', 1).
'</td><td>';
500 print
'<input name="amount" id="amount" class="minwidth50 maxwidth100" value="'.$amount.
'">';
501 print
' '.$langs->getCurrencySymbol();
507 print $form->editfieldkey(
'BankAccount',
'selectaccountid',
'', $object, 0,
'string',
'', 1).
'</td><td>';
508 print img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
509 print $form->select_comptes($accountid,
"accountid", 0,
'', 2,
'', (
isModEnabled(
'multicurrency') ? 1 : 0),
'', 1);
514 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
'PaymentMode').
'</span></td><td>';
515 $form->select_types_paiements($paymenttype,
'paymenttype',
'', 2);
521 print
'<tr><td><label for="num_payment">'.$langs->trans(
'Numero');
522 print
' <em class="opacitymedium">('.$langs->trans(
"ChequeOrTransferNumber").
')</em>';
523 print
'</label></td>';
524 print
'<td><input name="num_payment" class="maxwidth150onsmartphone" id="num_payment" type="text" value="'.GETPOST(
"num_payment").
'"></td></tr>'.
"\n";
527 print
'<tr><td class="'.(GETPOST(
'paymenttype') ==
'CHQ' ?
'fieldrequired ' :
'').
'fieldrequireddyn"><label for="fieldchqemetteur">'.$langs->trans(
'CheckTransmitter');
528 print
' <em class="opacitymedium">('.$langs->trans(
"ChequeMaker").
')</em>';
529 print
'</label></td>';
530 print
'<td><input id="fieldchqemetteur" name="chqemetteur" size="30" type="text" value="'.GETPOST(
'chqemetteur',
'alphanohtml').
'"></td></tr>';
533 print
'<tr><td><label for="chqbank">'.$langs->trans(
'Bank');
534 print
' <em class="opacitymedium">('.$langs->trans(
"ChequeBank").
')</em>';
535 print
'</label></td>';
536 print
'<td><input id="chqbank" name="chqbank" size="30" type="text" value="'.GETPOST(
'chqbank',
'alphanohtml').
'"></td></tr>';
541 print
'<tr><td>'.$langs->trans(
"ThirdParty").
'</td><td>';
542 print img_picto(
'',
'company',
'class="pictofixedwidth"');
543 print $form->select_company($fk_soc,
'fk_soc',
'',
'SelectThirdParty', 0, 0, array(), 0,
'minwidth300 widthcentpercentminusx maxwidth500');
552 $langs->load(
"projects");
554 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
555 print img_picto(
'',
'project',
'class="pictofixedwidth"');
556 print $formproject->select_projects(-1, (
string) $projectid,
'fk_project', 0, 0, 1, 1, 0, 0, 0,
'', 1);
561 print
$object->showOptionals($extrafields,
'create');
563 $parameters = array();
564 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
565 print $hookmanager->resPrint;
568 if (is_array($options) && count($options) &&
isModEnabled(
'category')) {
569 print
'<tr><td>'.$langs->trans(
"RubriquesTransactions").
'</td><td>';
570 print img_picto(
'',
'category',
'class="pictofixedwidth"') .
Form::selectarray(
'category_transaction', $options,
GETPOST(
'category_transaction'), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth300', 1);
574 print
'<tr><td colspan="2"><hr></td></tr>';
580 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"AccountAccounting").
'</td>';
582 print $formaccounting->select_account($accountancy_code,
'accountancy_code', 1, array(), 1, 1);
585 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"AccountAccounting").
'</td>';
586 print
'<td><input class="minwidth100 maxwidthonsmartphone" name="accountancy_code" value="'.$accountancy_code.
'">';
593 print
'<tr><td>'.$langs->trans(
"SubledgerAccount").
'</td>';
595 print $formaccounting->select_auxaccount($subledger_account,
'subledger_account', 1,
'');
598 print
'<tr><td>'.$langs->trans(
"SubledgerAccount").
'</td>';
599 print
'<td><input class="minwidth100 maxwidthonsmartphone" name="subledger_account" value="'.$subledger_account.
'">';
605 $labelsens = $form->textwithpicto($langs->trans(
'Sens'), $langs->trans(
"AccountingDirectionHelp"));
606 print $form->editfieldkey($labelsens,
'sens',
'', $object, 0,
'string',
'', 1).
'</td><td>';
608 '0' => array(
'label' => $langs->trans(
"Debit")),
609 '1' => array(
'label' => $langs->trans(
"Credit"))
612 include_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
614 $sensarray[
'1'][
'disabled'] = 1;
617 print $form->selectarray(
'sens', $sensarray, $sens, 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth100', 1);
624 print $form->buttonsSaveCancel();
631 $alreadyaccounted =
$object->getVentilExportCompta();
636 if ($action ===
'clone') {
637 $set_value_help = $form->textwithpicto(
'', $langs->trans($langs->trans(
"AccountingDirectionHelp")));
638 $sensarray = array(
'0' => $langs->trans(
"Debit"),
'1' => $langs->trans(
"Credit"));
640 $formquestion = array(
641 array(
'type' =>
'text',
'name' =>
'clone_label',
'label' => $langs->trans(
"Label"),
'value' => $langs->trans(
"CopyOf").
' '.
$object->label),
642 array(
'type' =>
'date',
'tdclass' =>
'fieldrequired',
'name' =>
'clone_date_payment',
'label' => $langs->trans(
"DatePayment"),
'value' => -1),
643 array(
'type' =>
'date',
'name' =>
'clone_date_value',
'label' => $langs->trans(
"DateValue"),
'value' => -1),
644 array(
'type' =>
'other',
'tdclass' =>
'fieldrequired',
'name' =>
'selectclone_accountid',
'label' => $langs->trans(
"BankAccount"),
'value' => $form->select_comptes(
$object->fk_account,
"clone_accountid", 0,
'', 1,
'', 0,
'minwidth200', 1)),
645 array(
'type' =>
'text',
'name' =>
'clone_amount',
'label' => $langs->trans(
"Amount"),
'value' =>
price(
$object->amount)),
646 array(
'type' =>
'select',
'name' =>
'clone_sens',
'label' => $langs->trans(
"Sens").
' ' . $set_value_help,
'values' => $sensarray,
'default' => (
string)
$object->sens),
649 print $form->formconfirm(
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id]), $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneVariousPayment',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1, 350);
653 if ($action ==
'delete') {
654 $text = $langs->trans(
'ConfirmDeleteVariousPayment');
655 print $form->formconfirm(
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'id' =>
$object->id]), $langs->trans(
'DeleteVariousPayment'), $text,
'confirm_delete',
'',
'', 2);
658 print
dol_get_fiche_head($head,
'card', $langs->trans(
"VariousPayment"), -1,
$object->picto, 0,
'',
'', 0,
'', 1);
660 $morehtmlref =
'<div class="refidno">';
663 $langs->load(
"projects");
665 if ($permissiontoadd) {
666 $morehtmlref .= img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
667 if ($action !=
'classify') {
668 $morehtmlref .=
'<a class="editfielda" href="' .
dolBuildUrl($_SERVER[
'PHP_SELF'], [
'action' =>
'classify',
'id' =>
$object->id],
true).
'">' . img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
670 if ($action ==
'classify') {
672 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
673 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
674 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
675 $morehtmlref .= $formproject->select_projects(-1, (
string)
$object->fk_project,
'projectid', 0, 0, 1, 1, 0, 0, 0,
'', 1, 0,
'maxwidth500 widthcentpercentminusxx');
676 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
677 $morehtmlref .=
'</form>';
679 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, (
int)
$object->socid, (
string)
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
682 if (!empty(
$object->fk_project)) {
684 $proj->fetch(
$object->fk_project);
685 $morehtmlref .= $proj->getNomUrl(1);
687 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
693 $morehtmlref .=
'</div>';
694 $linkback =
'<a href="' . DOL_URL_ROOT .
'/compta/bank/various_payment/list.php?restore_lastsearch_values=1' . (!empty($socid) ?
'&socid=' . $socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
696 $morehtmlstatus =
'';
698 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlstatus);
700 print
'<div class="fichecenter">';
701 print
'<div class="underbanner clearboth"></div>';
703 print
'<table class="border centpercent tableforfield">';
706 print
'<tr><td class="titlefield">'.$langs->trans(
"Label").
'</td><td>'.
$object->label.
'</td></tr>';
710 print
'<tr><td>'.$langs->trans(
"ThirdParty").
'</td><td>';
712 $thirdparty =
new Societe($db);
713 if ($thirdparty->fetch(
$object->fk_soc) > 0) {
714 print $thirdparty->getNomUrl(1);
722 print
'<td>'.$langs->trans(
"DatePayment").
'</td><td>';
727 print
'<tr><td>'.$langs->trans(
"DateValue").
'</td><td>';
733 $sens = $langs->trans(
"Credit");
735 $sens = $langs->trans(
"Debit");
737 print
'<tr><td>'.$langs->trans(
"Sens").
'</td><td>'.$sens.
'</td></tr>';
739 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td><span class="amount">' .
price(
$object->amount, 0, $langs, 1, -1, -1,
$conf->currency).
'</span></td></tr>';
745 print
'<tr><td class="nowrap">';
746 print $form->editfieldkey(
'AccountAccounting',
'accountancy_code',
$object->accountancy_code, $object, (
int) (!$alreadyaccounted && $permissiontoadd),
'string',
'', 0);
748 if ($action ==
'editaccountancy_code' && (!$alreadyaccounted && $permissiontoadd)) {
750 print $formaccounting->formAccountingAccount($_SERVER[
'PHP_SELF'] .
'?id=' .
$object->id,
$object->accountancy_code,
'accountancy_code', 0, 1,
'', 1);
753 $accountingaccount->fetch(0,
$object->accountancy_code, 1);
755 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
759 print
'<tr><td class="nowrap">';
760 print $langs->trans(
"AccountAccounting");
762 print
$object->accountancy_code;
767 print
'<tr><td class="nowrap">';
768 print $form->editfieldkey(
'SubledgerAccount',
'subledger_account',
$object->subledger_account, $object, (
int) (!$alreadyaccounted && $permissiontoadd),
'string',
'', 0);
770 if ($action ==
'editsubledger_account' && (!$alreadyaccounted && $permissiontoadd)) {
773 print $formaccounting->formAccountingAccount($_SERVER[
'PHP_SELF'] .
'?id=' .
$object->id,
$object->subledger_account,
'subledger_account', 1, 1,
'', 1);
775 print $form->editfieldval(
'SubledgerAccount',
'subledger_account',
$object->subledger_account, $object, (!$alreadyaccounted && $permissiontoadd),
'string',
'',
null,
null,
'', 1,
'lengthAccounta');
782 $bankaccountnotfound = 0;
786 print
'<td>'.$langs->trans(
'BankTransactionLine').
'</td>';
787 print
'<td colspan="3">';
790 $result = $bankline->fetch(
$object->fk_bank);
793 $bankaccountnotfound = 1;
795 print $bankline->getNomUrl(1, 0,
'showall');
798 $bankaccountnotfound = 1;
800 print
'<span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span>';
807 $parameters = array(
'socid' =>
$object->id);
808 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
814 print
'<div class="clearboth"></div>';
822 print
'<div class="tabsAction">' .
"\n";
828 if ($permissiontoadd) {
829 print
'<div class="inline-block divButAction">'.dolGetButtonAction($langs->trans(
"ToClone"), $langs->trans(
"ToClone"),
'clone',
dolBuildUrl(DOL_URL_ROOT.
"/compta/bank/various_payment/card.php", [
'id' =>
$object->id,
'action' =>
'clone'],
true),
'',
true, array(
'attr' => array(
'class' =>
'reposition'))).
'</div>';
833 if (empty(
$object->rappro) || $bankaccountnotfound) {
834 if ($permissiontoadd) {
835 if ($alreadyaccounted) {
836 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"Accounted").
'">'.$langs->trans(
"Delete").
'</a></div>';
838 print
'<div class="inline-block divButAction">'.dolGetButtonAction($langs->trans(
"Delete"), $langs->trans(
"Delete"),
'delete',
'card.php?id='.$object->id.
'&action=delete&token=' .
newToken(),
'',
true, array(
'attr' => array(
'class' =>
'reposition'))).
'</div>'.
"\n";
841 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.(dol_escape_htmltag($langs->trans(
"NotAllowed"))).
'">'.$langs->trans(
"Delete").
'</a></div>';
844 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.
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
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.
isALNERunningVersion($blockedlogusagealreadychecked=0, $blockedlogmoduleonalreadychecked=0)
Return if the application is executed with the LNE requirements on.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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.
Class to manage third parties objects (customers, suppliers, prospects...)
recordNotFound($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Displays an error page when a record is not found.
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.
price2num($amount, $rounding='', $option=0, $currencycode='')
Function that return a number with universal decimal format (decimal separator is '.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
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'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
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).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
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.