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')) {
147 $arrayofid =
GETPOST(
'toRemise',
'array:int');
154 $outputlangs = $langs;
157 $newlang =
GETPOST(
'lang_id',
'aZ09');
160 if (!empty($newlang)) {
162 $outputlangs->setDefaultLang($newlang);
167 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".
$object->id);
178if ($action ==
'remove' && $id > 0 &&
GETPOSTINT(
"lineid") > 0 && $user->hasRight(
'banque',
'cheque')) {
182 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".
$object->id);
189if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->hasRight(
'banque',
'cheque')) {
191 $result =
$object->delete($user);
193 header(
"Location: index.php");
200if ($action ==
'confirm_validate' && $confirm ==
'yes' && $user->hasRight(
'banque',
'cheque')) {
202 $result =
$object->validate($user);
205 $outputlangs = $langs;
208 $newlang =
GETPOST(
'lang_id',
'aZ09');
211 if (!empty($newlang)) {
213 $outputlangs->setDefaultLang($newlang);
217 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".
$object->id);
224if ($action ==
'confirm_reject_check' && $confirm ==
'yes' && $user->hasRight(
'banque',
'cheque')) {
229 $paiement_id =
$object->rejectCheck($rejected_check, $reject_date);
230 if ($paiement_id > 0) {
231 setEventMessages($langs->trans(
"CheckRejectedAndInvoicesReopened"),
null,
'mesgs');
241if ($action ==
'builddoc' && $user->hasRight(
'banque',
'cheque')) {
247 $outputlangs = $langs;
250 $newlang =
GETPOST(
'lang_id',
'aZ09');
253 if (!empty($newlang)) {
255 $outputlangs->setDefaultLang($newlang);
265} elseif ($action ==
'remove_file' && $user->hasRight(
'banque',
'cheque')) {
268 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
270 $langs->load(
"other");
272 $filetodelete =
GETPOST(
'file',
'alpha');
273 $file = $upload_dir.
'/'.$filetodelete;
291 $search_date_start_day =
'';
292 $search_date_start_month =
'';
293 $search_date_start_year =
'';
294 $search_date_end_day =
'';
295 $search_date_end_month =
'';
296 $search_date_end_year =
'';
297 $search_date_start =
'';
298 $search_date_end =
'';
299 $filteraccountid = 0;
302if ($action ==
'new') {
303 $title = $langs->trans(
"NewChequeDeposit");
305 if ($type ==
'CHQ') {
306 $title = $langs->trans(
"Cheques");
308 $title = ($langs->trans(
"PaymentType".$type) !=
"PaymentType".$type ? $langs->trans(
"PaymentType".$type) : $langs->trans(
"PaymentMode").
' '.$type);
315$form =
new Form($db);
319if ($action ==
'new') {
322 $head[$h][0] = $_SERVER[
"PHP_SELF"].
'?action=new';
323 $head[$h][1] = $langs->trans(
"MenuChequeDeposits");
329 $result =
$object->fetch($id, $ref);
337 $head[$h][0] = $_SERVER[
"PHP_SELF"].
'?id='.
$object->id;
338 $head[$h][1] = $langs->trans(
"CheckReceipt");
350 if ($action ==
'delete') {
351 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"DeleteCheckReceipt"), $langs->trans(
"ConfirmDeleteCheckReceipt"),
'confirm_delete',
'',
'', 1);
357 if ($action ==
'valide') {
358 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"ValidateCheckReceipt"), $langs->trans(
"ConfirmValidateCheckReceipt"),
'confirm_validate',
'',
'', 1);
364 if ($action ==
'reject_check') {
365 $formquestion = array(
366 array(
'type' =>
'hidden',
'name' =>
'bankid',
'value' =>
GETPOSTINT(
'lineid')),
367 array(
'type' =>
'date',
'name' =>
'rejectdate_',
'label' => $langs->trans(
"RejectCheckDate"),
'value' =>
dol_now())
369 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"RejectCheck"), $langs->trans(
"ConfirmRejectCheck"),
'confirm_reject_check', $formquestion,
'', 1);
375if ($action ==
'new') {
383 $labeltype = ($langs->trans(
"PaymentType".$type) !=
"PaymentType".$type ? $langs->trans(
"PaymentType".$type) : $type);
384 if ($type ==
'CHQ') {
385 print
'<span class="opacitymedium">'.$langs->trans(
"SelectChequeTransactionAndGenerate").
'</span><br><br>'.
"\n";
387 print
'<span class="opacitymedium">'.$langs->trans(
"SelectPaymentTransactionAndGenerate", $labeltype).
'</span><br><br>'.
"\n";
390 print
'<form class="nocellnopadd" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
391 print
'<input type="hidden" name="token" value="'.newToken().
'">';
392 print
'<input type="hidden" name="action" value="new">';
396 print
'<table class="border centpercent">';
398 if (count($arrayofpaymentmodetomanage) > 1) {
399 $arrayoflabels = array();
400 foreach ($arrayofpaymentmodetomanage as $key => $val) {
401 $labelval = ($langs->trans(
"PaymentType".$val) !=
"PaymentType".$val ? $langs->trans(
"PaymentType".$val) : $val);
402 $arrayoflabels[$key] = $labelval;
406 print $langs->trans(
"Type");
408 print $form->selectarray(
'type', $arrayoflabels, $type);
412 print
'<tr><td class="titlefieldcreate">';
413 if ($type ==
'CHQ') {
414 print $langs->trans(
"DateChequeReceived");
416 print $langs->trans(
"DatePaymentReceived");
420 print
'<div class="nowrapfordate">';
421 print $form->selectDate($search_date_start,
'search_date_start_', 0, 0, 1,
'', 1, 1, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
423 print
'<div class="nowrapfordate">';
424 print $form->selectDate($search_date_end,
'search_date_end_', 0, 0, 1,
'', 1, 1, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
427 print
'<tr><td>'.$langs->trans(
"BankAccount").
'</td><td>';
428 $form->select_comptes($filteraccountid,
'accountid', 0,
'courant <> 2', 1);
434 print
'<div class="center">';
435 print
'<input type="submit" class="button small" name="filter" value="'.dol_escape_htmltag($langs->trans(
"ToFilter")).
'">';
436 if ($search_date_start || $search_date_end || $filteraccountid > 0) {
438 print
'<input type="submit" class="button" name="removefilter small" value="'.dol_escape_htmltag($langs->trans(
"RemoveFilter")).
'">';
445 $sql =
"SELECT ba.rowid as bid, ba.label,";
446 $sql .=
" b.rowid as transactionid, b.label as transactionlabel, b.datec as datec, b.dateo as date, ";
447 $sql .=
" b.amount, b.emetteur, b.num_chq, b.banque,";
448 $sql .=
" p.rowid as paymentid, p.ref as paymentref";
449 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
450 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement as p ON p.fk_bank = b.rowid";
451 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON (b.fk_account = ba.rowid)";
452 $sql .=
" WHERE b.fk_type = '".$db->escape($type).
"'";
453 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
454 $sql .=
" AND b.fk_bordereau = 0";
455 $sql .=
" AND b.amount > 0";
456 if ($search_date_start) {
457 $sql .=
" AND b.dateo >= '".$db->idate($search_date_start).
"'";
459 if ($search_date_end) {
460 $sql .=
" AND b.dateo <= '".$db->idate($search_date_end).
"'";
462 if ($filteraccountid > 0) {
463 $sql .=
" AND ba.rowid = ".((int) $filteraccountid);
465 $sql .= $db->order(
"b.dateo,b.rowid",
"ASC");
467 $resql = $db->query($sql);
470 while ($obj = $db->fetch_object($resql)) {
471 $accounts[$obj->bid] = $obj->label;
472 $lines[$obj->bid][$i][
"date"] = $db->jdate($obj->datec);
473 $lines[$obj->bid][$i][
"amount"] = $obj->amount;
474 $lines[$obj->bid][$i][
"emetteur"] = $obj->emetteur;
475 $lines[$obj->bid][$i][
"numero"] = $obj->num_chq;
476 $lines[$obj->bid][$i][
"banque"] = $obj->banque;
477 $lines[$obj->bid][$i][
"id"] = $obj->transactionid;
478 $lines[$obj->bid][$i][
"ref"] = $obj->transactionid;
479 $lines[$obj->bid][$i][
"label"] = $obj->transactionlabel;
480 $lines[$obj->bid][$i][
"paymentid"] = $obj->paymentid;
481 $lines[$obj->bid][$i][
"paymentref"] = $obj->paymentref;
482 $lines[$obj->bid][$i][
"paymentdate"] = $db->jdate($obj->date);
487 if ($type ==
'CHQ') {
488 print
'<div class="opacitymedium">'.$langs->trans(
"NoWaitingChecks").
'</div><br>';
490 print
'<div class="opacitymedium">'.$langs->trans(
"NoWaitingPaymentForDeposit", $labeltype).
'</div><br>';
495 foreach ($accounts as $bid => $account_label) {
497 <script type="text/javascript">
498 jQuery(document).ready(function()
500 jQuery("#checkall_'.$bid.
'").click(function()
502 jQuery(".checkforremise_'.$bid.
'").prop(\'checked\', true);
504 jQuery("#checknone_'.$bid.
'").click(function()
506 jQuery(".checkforremise_'.$bid.
'").prop(\'checked\', false);
512 $num = $db->num_rows($resql);
514 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
515 print
'<input type="hidden" name="token" value="'.newToken().
'">';
516 print
'<input type="hidden" name="action" value="create">';
517 print
'<input type="hidden" name="type" value="'.$type.
'">';
518 print
'<input type="hidden" name="accountid" value="'.$bid.
'">';
521 print
'<div class="div-table-responsive-no-min">';
522 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
524 print
'<tr class="liste_titre">';
526 if ($type ==
'CHQ') {
527 print $langs->trans(
"DateChequeReceived");
529 print $langs->trans(
"DatePaymentForDepositReceived", $type);
532 print
'<td>'.$langs->trans(
"ChequeNumber").
"</td>\n";
533 print
'<td>'.$langs->trans(
"CheckTransmitter").
"</td>\n";
534 print
'<td>'.$langs->trans(
"Bank").
"</td>\n";
535 print
'<td class="right">'.$langs->trans(
"Amount").
"</td>\n";
536 print
'<td class="center">'.$langs->trans(
"Payment").
"</td>\n";
537 print
'<td class="center">'.$langs->trans(
"LineRecord").
"</td>\n";
538 print
'<td class="center">'.$langs->trans(
"Select").
"<br>";
539 if ($conf->use_javascript_ajax) {
540 print
'<a href="#" id="checkall_'.$bid.
'">'.$langs->trans(
"All").
'</a> / <a href="#" id="checknone_'.$bid.
'">'.$langs->trans(
"None").
'</a>';
545 if (count($lines[$bid])) {
546 foreach ($lines[$bid] as $lid => $value) {
547 print
'<tr class="oddeven">';
548 print
'<td>'.dol_print_date($value[
"date"],
'day').
'</td>';
549 print
'<td>'.$value[
"numero"].
"</td>\n";
550 print
'<td>'.$value[
"emetteur"].
"</td>\n";
551 print
'<td>'.$value[
"banque"].
"</td>\n";
552 print
'<td class="right"><span class="amount">'.price($value[
"amount"], 0, $langs, 1, -1, -1, $conf->currency).
'</span></td>';
555 print
'<td class="center">';
556 $paymentstatic->id = $value[
"paymentid"];
557 $paymentstatic->ref = $value[
"paymentref"];
558 $paymentstatic->date = $value[
"paymentdate"];
559 if ($paymentstatic->id) {
560 print $paymentstatic->getNomUrl(1);
566 print
'<td class="center">';
567 $accountlinestatic->id = $value[
"id"];
568 $accountlinestatic->ref = $value[
"ref"];
569 if ($accountlinestatic->id > 0) {
570 print $accountlinestatic->getNomUrl(1);
576 print
'<td class="center">';
577 print
'<input id="'.$value[
"id"].
'" class="flat checkforremise_'.$bid.
'" checked type="checkbox" name="toRemise[]" value="'.$value[
"id"].
'">';
585 print
'<div class="tabsAction">';
586 if ($user->hasRight(
'banque',
'cheque')) {
587 print
'<input type="submit" class="button" value="'.$langs->trans(
'NewCheckDepositOn', $account_label).
'">';
589 print
'<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotEnoughPermissions").
'">'.$langs->trans(
'NewCheckDepositOn', $account_label).
'</a>';
597 $accountstatic =
new Account($db);
598 $accountstatic->fetch(
$object->account_id);
600 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/paiement/cheque/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
604 $moreghtmlright =
'';
606 $labelval = ($langs->trans(
"PaymentType".
$object->type) !=
"PaymentType".$object->type ? $langs->trans(
"PaymentType".
$object->type) :
$object->type);
607 $morehtmlref =
'<br><div class="refidno">'.$langs->trans(
"Type").
' : '.$labelval.
'</div>';
609 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0, $morehtmlleft,
'', 0, $moreghtmlright);
612 print
'<div class="fichecenter">';
613 print
'<div class="underbanner clearboth"></div>';
615 print
'<table class="border centpercent">';
617 print
'<tr><td class="titlefield">';
619 print
'<table class="nobordernopadding centpercent"><tr><td>';
620 print $langs->trans(
'Date');
622 if ($action !=
'editdate') {
623 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>';
625 print
'</tr></table>';
628 if ($action ==
'editdate') {
629 print
'<form name="setdate" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post">';
630 print
'<input type="hidden" name="token" value="'.newToken().
'">';
631 print
'<input type="hidden" name="action" value="setdate">';
632 print $form->selectDate(
$object->date_bordereau,
'datecreate_', 0, 0, 0,
"setdate");
633 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
645 print
'<table class="nobordernopadding" width="100%"><tr><td>';
646 print $langs->trans(
'RefExt');
648 if ($action !=
'editrefext') {
649 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>';
651 print
'</tr></table>';
653 if ($action ==
'editrefext') {
654 print
'<form name="setrefext" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post">';
655 print
'<input type="hidden" name="token" value="'.newToken().
'">';
656 print
'<input type="hidden" name="action" value="setrefext">';
657 print
'<input type="text" name="ref_ext" value="'.$object->ref_ext.
'">';
658 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
666 print
'<tr><td>'.$langs->trans(
'Account').
'</td><td>';
667 print $accountstatic->getNomUrl(1);
671 print
'<tr><td>'.$langs->trans(
'NbOfCheques').
'</td><td>';
675 print
'<tr><td>'.$langs->trans(
'Total').
'</td><td>';
676 print
'<span class="amount">'.price(
$object->amount).
'</span>';
679 print
'</table><br>';
685 $sql =
"SELECT b.rowid, b.rowid as ref, b.label, b.amount, b.num_chq, b.emetteur,";
686 $sql .=
" b.dateo as date, b.datec as datec, b.banque,";
687 $sql .=
" p.rowid as pid, p.ref as pref, ba.rowid as bid, p.statut";
688 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as ba";
689 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON (b.fk_account = ba.rowid)";
690 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement as p ON p.fk_bank = b.rowid";
691 $sql .=
" WHERE ba.entity IN (".getEntity(
'bank_account').
")";
692 $sql .=
" AND b.fk_type= '".$db->escape(
$object->type).
"'";
693 $sql .=
" AND b.fk_bordereau = ".((int)
$object->id);
694 $sql .= $db->order($sortfield, $sortorder);
696 $resql = $db->query($sql);
698 $num = $db->num_rows($resql);
700 print
'<div class="div-table-responsive">';
701 print
'<table class="noborder centpercent">';
703 $param =
"&id=".$object->id;
705 print
'<tr class="liste_titre">';
707 print_liste_field_titre(
"DateChequeReceived", $_SERVER[
"PHP_SELF"],
"b.dateo,b.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
708 print_liste_field_titre(
"Numero", $_SERVER[
"PHP_SELF"],
"b.num_chq",
"", $param,
'align="center"', $sortfield, $sortorder);
709 print_liste_field_titre(
"CheckTransmitter", $_SERVER[
"PHP_SELF"],
"b.emetteur",
"", $param,
"", $sortfield, $sortorder);
711 print_liste_field_titre(
"Amount", $_SERVER[
"PHP_SELF"],
"b.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
712 print_liste_field_titre(
"Payment", $_SERVER[
"PHP_SELF"],
"p.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
713 print_liste_field_titre(
"LineRecord", $_SERVER[
"PHP_SELF"],
"b.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
719 while ($objp = $db->fetch_object($resql)) {
720 $paymentstatic->id = $objp->pid;
721 $paymentstatic->ref = $objp->pref;
723 $accountlinestatic->id = $objp->rowid;
724 $accountlinestatic->ref = $objp->ref;
726 print
'<tr class="oddeven">';
727 print
'<td class="center">'.$i.
'</td>';
728 print
'<td class="center">'.dol_print_date($db->jdate($objp->date),
'day').
'</td>';
729 print
'<td class="center">'.($objp->num_chq ? $objp->num_chq :
' ').
'</td>';
730 print
'<td>'.dol_trunc($objp->emetteur, 24).
'</td>';
731 print
'<td>'.dol_trunc($objp->banque, 24).
'</td>';
732 print
'<td class="right"><span class="amount">'.price($objp->amount).
'</span></td>';
734 print
'<td class="center">';
735 if ($paymentstatic->id) {
736 print $paymentstatic->getNomUrl(1);
742 print
'<td class="center">';
743 if ($accountlinestatic->id > 0) {
744 print $accountlinestatic->getNomUrl(1);
750 print
'<td class="right">';
752 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=remove&token='.
newToken().
'&lineid='.$objp->rowid.
'">'.
img_delete().
'</a>';
754 if (
$object->statut == 1 && $objp->statut != 2) {
755 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=reject_check&token='.
newToken().
'&lineid='.$objp->rowid.
'">'.
img_picto($langs->trans(
"RejectCheck"),
'disable').
'</a>';
757 if ($objp->statut == 2) {
758 print
' '.img_picto($langs->trans(
'CheckRejected'),
'statut8').
'</a>';
766 print
'<td colspan="9"><span class="opacitymedium">';
767 print $langs->trans(
"None");
768 print
'</span></td>';
774 if ($num > 0 && $i < (
$object->nbcheque + 1)) {
776 $langs->load(
"errors");
777 print
info_admin($langs->trans(
"WarningSomeBankTransactionByChequeWereRemovedAfter"), 0, 0,
'warning');
796print
'<div class="tabsAction">';
798if ($user->socid == 0 && !empty(
$object->id) &&
$object->statut == 0 && $user->hasRight(
'banque',
'cheque')) {
799 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=valide&token='.
newToken().
'&sortfield='.$sortfield.
'&sortorder='.$sortorder.
'">'.$langs->trans(
'Validate').
'</a>';
802if ($user->socid == 0 && !empty(
$object->id) && $user->hasRight(
'banque',
'cheque')) {
803 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken(),
'delete', $permissiontodelete);
809if ($action !=
'new') {
813 $filedir = $upload_dir.
'/'.$objref;
814 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
815 $genallowed = $usercancreate;
816 $delallowed = $usercandelete;
817 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()
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.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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 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.