31require
'../../../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
38$langs->loadLangs(array(
'banks',
'categories',
'bills',
'companies',
'compta'));
42$action =
GETPOST(
'action',
'aZ09');
43$confirm =
GETPOST(
'confirm',
'alpha');
52$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
53$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
59 $sortfield =
"b.dateo,b.rowid";
61if (empty($page) || $page == -1) {
65$offset = $limit * $page;
67$upload_dir = $conf->bank->multidir_output[
$object->entity ?
$object->entity : $conf->entity].
"/checkdeposits";
70$search_date_start_day =
GETPOSTINT(
'search_date_start_day');
71$search_date_start_month =
GETPOSTINT(
'search_date_start_month');
72$search_date_start_year =
GETPOSTINT(
'search_date_start_year');
73$search_date_end_day =
GETPOSTINT(
'search_date_end_day');
74$search_date_end_month =
GETPOSTINT(
'search_date_end_month');
75$search_date_end_year =
GETPOSTINT(
'search_date_end_year');
76$search_date_start =
dol_mktime(0, 0, 0, $search_date_start_month, $search_date_start_day, $search_date_start_year);
77$search_date_end =
dol_mktime(23, 59, 59, $search_date_end_month, $search_date_end_day, $search_date_end_year);
81$fieldname = (!empty($ref) ?
'ref' :
'rowid');
83 $socid = $user->socid;
85$result =
restrictedArea($user,
'cheque', $id,
'bordereau_cheque',
'',
'fk_user_author', $fieldname);
87$usercanread = $user->hasRight(
'banque',
'cheque');
88$usercancreate = $user->hasRight(
'banque',
'cheque');
89$usercandelete = $user->hasRight(
'banque',
'cheque');
91$permissiontodelete = $user->hasRight(
'banque',
'cheque');
95$arrayofpaymentmodetomanage = explode(
',',
getDolGlobalString(
'BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT',
'CHQ'));
102if ($action ==
'setdate' && $user->hasRight(
'banque',
'cheque')) {
107 $result =
$object->set_date($user, $date);
116if ($action ==
'setrefext' && $user->hasRight(
'banque',
'cheque')) {
121 $result =
$object->setValueFrom(
'ref_ext', $ref_ext,
'',
null,
'text',
'', $user,
'CHECKDEPOSIT_MODIFY');
130if ($action ==
'setref' && $user->hasRight(
'banque',
'cheque')) {
135 $result =
$object->set_number($user, $ref);
144if ($action ==
'create' &&
GETPOSTINT(
"accountid") > 0 && $user->hasRight(
'banque',
'cheque')) {
148 $arrayofid =
GETPOST(
'toRemise',
'array:int');
155 $outputlangs = $langs;
158 $newlang =
GETPOST(
'lang_id',
'aZ09');
161 if (!empty($newlang)) {
163 $outputlangs->setDefaultLang($newlang);
168 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".
$object->id);
180if ($action ==
'remove' && $id > 0 &&
GETPOSTINT(
"lineid") > 0 && $user->hasRight(
'banque',
'cheque')) {
184 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".
$object->id);
191if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->hasRight(
'banque',
'cheque')) {
193 $result =
$object->delete($user);
195 header(
"Location: index.php");
202if ($action ==
'confirm_validate' && $confirm ==
'yes' && $user->hasRight(
'banque',
'cheque')) {
204 $result =
$object->validate($user);
207 $outputlangs = $langs;
210 $newlang =
GETPOST(
'lang_id',
'aZ09');
213 if (!empty($newlang)) {
215 $outputlangs->setDefaultLang($newlang);
219 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".
$object->id);
226if ($action ==
'confirm_reject_check' && $confirm ==
'yes' && $user->hasRight(
'banque',
'cheque')) {
231 $paiement_id =
$object->rejectCheck($rejected_check, $reject_date);
232 if ($paiement_id > 0) {
233 setEventMessages($langs->trans(
"CheckRejectedAndInvoicesReopened"),
null,
'mesgs');
243if ($action ==
'builddoc' && $user->hasRight(
'banque',
'cheque')) {
249 $outputlangs = $langs;
252 $newlang =
GETPOST(
'lang_id',
'aZ09');
255 if (!empty($newlang)) {
257 $outputlangs->setDefaultLang($newlang);
267} elseif ($action ==
'remove_file' && $user->hasRight(
'banque',
'cheque')) {
270 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
272 $langs->load(
"other");
274 $filetodelete =
GETPOST(
'file',
'alpha');
275 $file = $upload_dir.
'/'.$filetodelete;
293 $search_date_start_day =
'';
294 $search_date_start_month =
'';
295 $search_date_start_year =
'';
296 $search_date_end_day =
'';
297 $search_date_end_month =
'';
298 $search_date_end_year =
'';
299 $search_date_start =
'';
300 $search_date_end =
'';
301 $filteraccountid = 0;
304if ($action ==
'new') {
305 $title = $langs->trans(
"NewChequeDeposit");
307 if ($type ==
'CHQ') {
308 $title = $langs->trans(
"Cheques");
310 $title = ($langs->trans(
"PaymentType".$type) !=
"PaymentType".$type ? $langs->trans(
"PaymentType".$type) : $langs->trans(
"PaymentMode").
' '.$type);
317$form =
new Form($db);
321if ($action ==
'new') {
324 $head[$h][0] = $_SERVER[
"PHP_SELF"].
'?action=new';
325 $head[$h][1] = $langs->trans(
"MenuChequeDeposits");
326 $hselected = (string) $h;
331 $result =
$object->fetch($id, $ref);
339 $head[$h][0] = $_SERVER[
"PHP_SELF"].
'?id='.
$object->id;
340 $head[$h][1] = $langs->trans(
"CheckReceipt");
341 $hselected = (string) $h;
352 if ($action ==
'delete') {
353 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"DeleteCheckReceipt"), $langs->trans(
"ConfirmDeleteCheckReceipt"),
'confirm_delete',
'',
'', 1);
359 if ($action ==
'valide') {
360 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"ValidateCheckReceipt"), $langs->trans(
"ConfirmValidateCheckReceipt"),
'confirm_validate',
'',
'', 1);
366 if ($action ==
'reject_check') {
367 $formquestion = array(
368 array(
'type' =>
'hidden',
'name' =>
'bankid',
'value' =>
GETPOSTINT(
'lineid')),
369 array(
'type' =>
'date',
'name' =>
'rejectdate_',
'label' => $langs->trans(
"RejectCheckDate"),
'value' =>
dol_now())
371 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"RejectCheck"), $langs->trans(
"ConfirmRejectCheck"),
'confirm_reject_check', $formquestion,
'', 1);
377if ($action ==
'new') {
385 $labeltype = ($langs->trans(
"PaymentType".$type) !=
"PaymentType".$type ? $langs->trans(
"PaymentType".$type) : $type);
386 if ($type ==
'CHQ') {
387 print
'<span class="opacitymedium">'.$langs->trans(
"SelectChequeTransactionAndGenerate").
'</span><br><br>'.
"\n";
389 print
'<span class="opacitymedium">'.$langs->trans(
"SelectPaymentTransactionAndGenerate", $labeltype).
'</span><br><br>'.
"\n";
392 print
'<form class="nocellnopadd" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
393 print
'<input type="hidden" name="token" value="'.newToken().
'">';
394 print
'<input type="hidden" name="action" value="new">';
398 print
'<table class="border centpercent">';
400 if (count($arrayofpaymentmodetomanage) > 1) {
401 $arrayoflabels = array();
402 foreach ($arrayofpaymentmodetomanage as $key => $val) {
403 $labelval = ($langs->trans(
"PaymentType".$val) !=
"PaymentType".$val ? $langs->trans(
"PaymentType".$val) : $val);
404 $arrayoflabels[$key] = $labelval;
408 print $langs->trans(
"Type");
410 print $form->selectarray(
'type', $arrayoflabels, $type);
414 print
'<tr><td class="titlefieldcreate">';
415 if ($type ==
'CHQ') {
416 print $langs->trans(
"DateChequeReceived");
418 print $langs->trans(
"DatePaymentReceived");
422 print
'<div class="nowrapfordate">';
423 print $form->selectDate($search_date_start,
'search_date_start_', 0, 0, 1,
'', 1, 1, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
425 print
'<div class="nowrapfordate">';
426 print $form->selectDate($search_date_end,
'search_date_end_', 0, 0, 1,
'', 1, 1, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
429 print
'<tr><td>'.$langs->trans(
"BankAccount").
'</td><td>';
430 $form->select_comptes($filteraccountid,
'accountid', 0,
'courant <> 2', 1);
436 print
'<div class="center">';
437 print
'<input type="submit" class="button small" name="filter" value="'.dol_escape_htmltag($langs->trans(
"ToFilter")).
'">';
438 if ($search_date_start || $search_date_end || $filteraccountid > 0) {
440 print
'<input type="submit" class="button" name="removefilter small" value="'.dol_escape_htmltag($langs->trans(
"RemoveFilter")).
'">';
447 $sql =
"SELECT ba.rowid as bid, ba.label,";
448 $sql .=
" b.rowid as transactionid, b.label as transactionlabel, b.datec as datec, b.dateo as date, ";
449 $sql .=
" b.amount, b.emetteur, b.num_chq, b.banque,";
450 $sql .=
" p.rowid as paymentid, p.ref as paymentref";
451 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
452 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement as p ON p.fk_bank = b.rowid";
453 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON (b.fk_account = ba.rowid)";
454 $sql .=
" WHERE b.fk_type = '".$db->escape($type).
"'";
455 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
456 $sql .=
" AND b.fk_bordereau = 0";
457 $sql .=
" AND b.amount > 0";
458 if ($search_date_start) {
459 $sql .=
" AND b.dateo >= '".$db->idate($search_date_start).
"'";
461 if ($search_date_end) {
462 $sql .=
" AND b.dateo <= '".$db->idate($search_date_end).
"'";
464 if ($filteraccountid > 0) {
465 $sql .=
" AND ba.rowid = ".((int) $filteraccountid);
467 $sql .= $db->order(
"b.dateo,b.rowid",
"ASC");
469 $resql = $db->query($sql);
472 while ($obj = $db->fetch_object($resql)) {
473 $accounts[$obj->bid] = $obj->label;
474 $lines[$obj->bid][$i][
"date"] = $db->jdate($obj->datec);
475 $lines[$obj->bid][$i][
"amount"] = $obj->amount;
476 $lines[$obj->bid][$i][
"emetteur"] = $obj->emetteur;
477 $lines[$obj->bid][$i][
"numero"] = $obj->num_chq;
478 $lines[$obj->bid][$i][
"banque"] = $obj->banque;
479 $lines[$obj->bid][$i][
"id"] = $obj->transactionid;
480 $lines[$obj->bid][$i][
"ref"] = $obj->transactionid;
481 $lines[$obj->bid][$i][
"label"] = $obj->transactionlabel;
482 $lines[$obj->bid][$i][
"paymentid"] = $obj->paymentid;
483 $lines[$obj->bid][$i][
"paymentref"] = $obj->paymentref;
484 $lines[$obj->bid][$i][
"paymentdate"] = $db->jdate($obj->date);
489 if ($type ==
'CHQ') {
490 print
'<div class="opacitymedium">'.$langs->trans(
"NoWaitingChecks").
'</div><br>';
492 print
'<div class="opacitymedium">'.$langs->trans(
"NoWaitingPaymentForDeposit", $labeltype).
'</div><br>';
497 foreach ($accounts as $bid => $account_label) {
499 <script type="text/javascript">
500 jQuery(document).ready(function()
502 jQuery("#checkall_'.$bid.
'").click(function()
504 jQuery(".checkforremise_'.$bid.
'").prop(\'checked\', true);
506 jQuery("#checknone_'.$bid.
'").click(function()
508 jQuery(".checkforremise_'.$bid.
'").prop(\'checked\', false);
514 $num = $db->num_rows($resql);
516 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
517 print
'<input type="hidden" name="token" value="'.newToken().
'">';
518 print
'<input type="hidden" name="action" value="create">';
519 print
'<input type="hidden" name="type" value="'.$type.
'">';
520 print
'<input type="hidden" name="accountid" value="'.$bid.
'">';
523 print
'<div class="div-table-responsive-no-min">';
524 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
526 print
'<tr class="liste_titre">';
528 if ($type ==
'CHQ') {
529 print $langs->trans(
"DateChequeReceived");
531 print $langs->trans(
"DatePaymentForDepositReceived", $type);
534 print
'<td>'.$langs->trans(
"ChequeNumber").
"</td>\n";
535 print
'<td>'.$langs->trans(
"CheckTransmitter").
"</td>\n";
536 print
'<td>'.$langs->trans(
"Bank").
"</td>\n";
537 print
'<td class="right">'.$langs->trans(
"Amount").
"</td>\n";
538 print
'<td class="center">'.$langs->trans(
"Payment").
"</td>\n";
539 print
'<td class="center">'.$langs->trans(
"LineRecord").
"</td>\n";
540 print
'<td class="center">'.$langs->trans(
"Select").
"<br>";
541 if ($conf->use_javascript_ajax) {
542 print
'<a href="#" id="checkall_'.$bid.
'">'.$langs->trans(
"All").
'</a> / <a href="#" id="checknone_'.$bid.
'">'.$langs->trans(
"None").
'</a>';
547 if (count($lines[$bid])) {
548 foreach ($lines[$bid] as $lid => $value) {
549 print
'<tr class="oddeven">';
550 print
'<td>'.dol_print_date($value[
"date"],
'day').
'</td>';
551 print
'<td>'.$value[
"numero"].
"</td>\n";
552 print
'<td>'.$value[
"emetteur"].
"</td>\n";
553 print
'<td>'.$value[
"banque"].
"</td>\n";
554 print
'<td class="right"><span class="amount">'.price($value[
"amount"], 0, $langs, 1, -1, -1, $conf->currency).
'</span></td>';
557 print
'<td class="center">';
558 $paymentstatic->id = $value[
"paymentid"];
559 $paymentstatic->ref = $value[
"paymentref"];
560 $paymentstatic->date = $value[
"paymentdate"];
561 if ($paymentstatic->id) {
562 print $paymentstatic->getNomUrl(1);
568 print
'<td class="center">';
569 $accountlinestatic->id = $value[
"id"];
570 $accountlinestatic->ref = $value[
"ref"];
571 if ($accountlinestatic->id > 0) {
572 print $accountlinestatic->getNomUrl(1);
578 print
'<td class="center">';
579 print
'<input id="'.$value[
"id"].
'" class="flat checkforremise_'.$bid.
'" checked type="checkbox" name="toRemise[]" value="'.$value[
"id"].
'">';
587 print
'<div class="tabsAction">';
588 if ($user->hasRight(
'banque',
'cheque')) {
589 print
'<input type="submit" class="button" value="'.$langs->trans(
'NewCheckDepositOn', $account_label).
'">';
591 print
'<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotEnoughPermissions").
'">'.$langs->trans(
'NewCheckDepositOn', $account_label).
'</a>';
599 $accountstatic =
new Account($db);
600 $accountstatic->fetch(
$object->account_id);
602 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/paiement/cheque/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
606 $moreghtmlright =
'';
608 $labelval = ($langs->trans(
"PaymentType".
$object->type) !=
"PaymentType".$object->type ? $langs->trans(
"PaymentType".
$object->type) :
$object->type);
609 $morehtmlref =
'<br><div class="refidno">'.$langs->trans(
"Type").
' : '.$labelval.
'</div>';
611 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0, $morehtmlleft,
'', 0, $moreghtmlright);
614 print
'<div class="fichecenter">';
615 print
'<div class="underbanner clearboth"></div>';
617 print
'<table class="border centpercent">';
619 print
'<tr><td class="titlefield">';
621 print
'<table class="nobordernopadding centpercent"><tr><td>';
622 print $langs->trans(
'Date');
624 if ($action !=
'editdate') {
625 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editdate&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->trans(
'SetDate'), 1).
'</a></td>';
627 print
'</tr></table>';
630 if ($action ==
'editdate') {
631 print
'<form name="setdate" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post">';
632 print
'<input type="hidden" name="token" value="'.newToken().
'">';
633 print
'<input type="hidden" name="action" value="setdate">';
634 print $form->selectDate(
$object->date_bordereau,
'datecreate_', 0, 0, 0,
"setdate");
635 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
647 print
'<table class="nobordernopadding" width="100%"><tr><td>';
648 print $langs->trans(
'RefExt');
650 if ($action !=
'editrefext') {
651 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editrefext&token='.
newToken().
'&id='.((int)
$object->id).
'">'.
img_edit($langs->trans(
'SetRefExt'), 1).
'</a></td>';
653 print
'</tr></table>';
655 if ($action ==
'editrefext') {
656 print
'<form name="setrefext" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post">';
657 print
'<input type="hidden" name="token" value="'.newToken().
'">';
658 print
'<input type="hidden" name="action" value="setrefext">';
659 print
'<input type="text" name="ref_ext" value="'.$object->ref_ext.
'">';
660 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
668 print
'<tr><td>'.$langs->trans(
'Account').
'</td><td>';
669 print $accountstatic->getNomUrl(1);
673 print
'<tr><td>'.$langs->trans(
'NbOfCheques').
'</td><td>';
677 print
'<tr><td>'.$langs->trans(
'Total').
'</td><td>';
678 print
'<span class="amount">'.price(
$object->amount).
'</span>';
681 print
'</table><br>';
687 $sql =
"SELECT b.rowid, b.rowid as ref, b.label, b.amount, b.num_chq, b.emetteur,";
688 $sql .=
" b.dateo as date, b.datec as datec, b.banque,";
689 $sql .=
" p.rowid as pid, p.ref as pref, ba.rowid as bid, p.statut";
690 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as ba";
691 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON (b.fk_account = ba.rowid)";
692 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement as p ON p.fk_bank = b.rowid";
693 $sql .=
" WHERE ba.entity IN (".getEntity(
'bank_account').
")";
694 $sql .=
" AND b.fk_type= '".$db->escape(
$object->type).
"'";
695 $sql .=
" AND b.fk_bordereau = ".((int)
$object->id);
696 $sql .= $db->order($sortfield, $sortorder);
698 $resql = $db->query($sql);
700 $num = $db->num_rows($resql);
702 print
'<div class="div-table-responsive">';
703 print
'<table class="noborder centpercent">';
705 $param =
"&id=".$object->id;
707 print
'<tr class="liste_titre">';
709 print_liste_field_titre(
"DateChequeReceived", $_SERVER[
"PHP_SELF"],
"b.dateo,b.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
710 print_liste_field_titre(
"Numero", $_SERVER[
"PHP_SELF"],
"b.num_chq",
"", $param,
'align="center"', $sortfield, $sortorder);
711 print_liste_field_titre(
"CheckTransmitter", $_SERVER[
"PHP_SELF"],
"b.emetteur",
"", $param,
"", $sortfield, $sortorder);
713 print_liste_field_titre(
"Amount", $_SERVER[
"PHP_SELF"],
"b.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
714 print_liste_field_titre(
"Payment", $_SERVER[
"PHP_SELF"],
"p.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
715 print_liste_field_titre(
"LineRecord", $_SERVER[
"PHP_SELF"],
"b.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
721 while ($objp = $db->fetch_object($resql)) {
722 $paymentstatic->id = $objp->pid;
723 $paymentstatic->ref = $objp->pref;
725 $accountlinestatic->id = $objp->rowid;
726 $accountlinestatic->ref = $objp->ref;
728 print
'<tr class="oddeven">';
729 print
'<td class="center">'.$i.
'</td>';
730 print
'<td class="center">'.dol_print_date($db->jdate($objp->date),
'day').
'</td>';
731 print
'<td class="center">'.($objp->num_chq ? $objp->num_chq :
' ').
'</td>';
732 print
'<td>'.dol_trunc($objp->emetteur, 24).
'</td>';
733 print
'<td>'.dol_trunc($objp->banque, 24).
'</td>';
734 print
'<td class="right"><span class="amount">'.price($objp->amount).
'</span></td>';
736 print
'<td class="center">';
737 if ($paymentstatic->id) {
738 print $paymentstatic->getNomUrl(1);
744 print
'<td class="center">';
745 if ($accountlinestatic->id > 0) {
746 print $accountlinestatic->getNomUrl(1);
752 print
'<td class="right">';
754 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=remove&token='.
newToken().
'&lineid='.$objp->rowid.
'">'.
img_delete().
'</a>';
756 if (
$object->statut == 1 && $objp->statut != 2) {
757 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=reject_check&token='.
newToken().
'&lineid='.$objp->rowid.
'">'.
img_picto($langs->trans(
"RejectCheck"),
'disable').
'</a>';
759 if ($objp->statut == 2) {
760 print
' '.img_picto($langs->trans(
'CheckRejected'),
'statut8').
'</a>';
768 print
'<td colspan="9"><span class="opacitymedium">';
769 print $langs->trans(
"None");
770 print
'</span></td>';
776 if ($num > 0 && $i < (
$object->nbcheque + 1)) {
778 $langs->load(
"errors");
779 print
info_admin($langs->trans(
"WarningSomeBankTransactionByChequeWereRemovedAfter"), 0, 0,
'warning');
798print
'<div class="tabsAction">';
800if ($user->socid == 0 && !empty(
$object->id) &&
$object->statut == 0 && $user->hasRight(
'banque',
'cheque')) {
801 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=valide&token='.
newToken().
'&sortfield='.$sortfield.
'&sortorder='.$sortorder.
'">'.$langs->trans(
'Validate').
'</a>';
804if ($user->socid == 0 && !empty(
$object->id) && $user->hasRight(
'banque',
'cheque')) {
805 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken(),
'delete', $permissiontodelete);
811if ($action !=
'new') {
815 $filedir = $upload_dir.
'/'.$objref;
816 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
817 $genallowed = $usercancreate;
818 $delallowed = $usercandelete;
819 print $formfile->showdocuments(
'remisecheque', $objref, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $langs->defaultlang);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage payments of customer invoices.
Class to manage cheque delivery receipts.
Class to manage translations.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
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...
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_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
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)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOSTISARRAY($paramname, $method=0)
Return true if the parameter $paramname is submit from a POST OR GET as an array.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
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.