32require
'../../../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
47$langs->loadLangs(array(
'banks',
'categories',
'bills',
'companies',
'compta'));
51$action =
GETPOST(
'action',
'aZ09');
52$confirm =
GETPOST(
'confirm',
'alpha');
61$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
62$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
68 $sortfield =
"b.dateo,b.rowid";
70if (empty($page) || $page == -1) {
74$offset = $limit * $page;
79$search_date_start_day =
GETPOSTINT(
'search_date_start_day');
80$search_date_start_month =
GETPOSTINT(
'search_date_start_month');
81$search_date_start_year =
GETPOSTINT(
'search_date_start_year');
82$search_date_end_day =
GETPOSTINT(
'search_date_end_day');
83$search_date_end_month =
GETPOSTINT(
'search_date_end_month');
84$search_date_end_year =
GETPOSTINT(
'search_date_end_year');
85$search_date_start =
dol_mktime(0, 0, 0, $search_date_start_month, $search_date_start_day, $search_date_start_year);
86$search_date_end =
dol_mktime(23, 59, 59, $search_date_end_month, $search_date_end_day, $search_date_end_year);
90$fieldname = (!empty($ref) ?
'ref' :
'rowid');
92 $socid = $user->socid;
94$result =
restrictedArea($user,
'cheque', $id,
'bordereau_cheque',
'',
'fk_user_author', $fieldname);
96$usercanread = $user->hasRight(
'banque',
'cheque');
97$usercancreate = $user->hasRight(
'banque',
'cheque');
98$usercandelete = $user->hasRight(
'banque',
'cheque');
100$permissiontodelete = $user->hasRight(
'banque',
'cheque');
104$arrayofpaymentmodetomanage = explode(
',',
getDolGlobalString(
'BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT',
'CHQ'));
111if ($action ==
'setdate' && $user->hasRight(
'banque',
'cheque')) {
116 $result =
$object->set_date($user, $date);
125if ($action ==
'setrefext' && $user->hasRight(
'banque',
'cheque')) {
130 $result =
$object->setValueFrom(
'ref_ext', $ref_ext,
'',
null,
'text',
'', $user,
'CHECKDEPOSIT_MODIFY');
139if ($action ==
'setref' && $user->hasRight(
'banque',
'cheque')) {
144 $result =
$object->set_number($user, $ref);
153if ($action ==
'create' &&
GETPOSTINT(
"accountid") > 0 && $user->hasRight(
'banque',
'cheque')) {
157 $arrayofid =
GETPOST(
'toRemise',
'array:int');
164 $outputlangs = $langs;
167 $newlang =
GETPOST(
'lang_id',
'aZ09');
170 if (!empty($newlang)) {
172 $outputlangs->setDefaultLang($newlang);
177 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".
$object->id);
189if ($action ==
'remove' && $id > 0 &&
GETPOSTINT(
"lineid") > 0 && $user->hasRight(
'banque',
'cheque')) {
193 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".
$object->id);
200if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->hasRight(
'banque',
'cheque')) {
202 $result =
$object->delete($user);
204 header(
"Location: index.php");
211if ($action ==
'confirm_validate' && $confirm ==
'yes' && $user->hasRight(
'banque',
'cheque')) {
213 $result =
$object->validate($user);
216 $outputlangs = $langs;
219 $newlang =
GETPOST(
'lang_id',
'aZ09');
222 if (!empty($newlang)) {
224 $outputlangs->setDefaultLang($newlang);
228 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".
$object->id);
235if ($action ==
'confirm_reject_check' && $confirm ==
'yes' && $user->hasRight(
'banque',
'cheque')) {
240 $paiement_id =
$object->rejectCheck($rejected_check, $reject_date);
241 if ($paiement_id > 0) {
242 setEventMessages($langs->trans(
"CheckRejectedAndInvoicesReopened"),
null,
'mesgs');
252if ($action ==
'builddoc' && $user->hasRight(
'banque',
'cheque')) {
258 $outputlangs = $langs;
261 $newlang =
GETPOST(
'lang_id',
'aZ09');
264 if (!empty($newlang)) {
266 $outputlangs->setDefaultLang($newlang);
276} elseif ($action ==
'remove_file' && $user->hasRight(
'banque',
'cheque')) {
279 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
281 $langs->load(
"other");
283 $filetodelete =
GETPOST(
'file',
'alpha');
284 $file = $upload_dir.
'/'.$filetodelete;
302 $search_date_start_day =
'';
303 $search_date_start_month =
'';
304 $search_date_start_year =
'';
305 $search_date_end_day =
'';
306 $search_date_end_month =
'';
307 $search_date_end_year =
'';
308 $search_date_start =
'';
309 $search_date_end =
'';
310 $filteraccountid = 0;
313if ($action ==
'new') {
314 $title = $langs->trans(
"NewChequeDeposit");
316 if ($type ==
'CHQ') {
317 $title = $langs->trans(
"Cheques");
319 $title = ($langs->trans(
"PaymentType".$type) !=
"PaymentType".$type ? $langs->trans(
"PaymentType".$type) : $langs->trans(
"PaymentMode").
' '.$type);
326$form =
new Form($db);
330if ($action ==
'new') {
333 $head[$h][0] = $_SERVER[
"PHP_SELF"].
'?action=new';
334 $head[$h][1] = $langs->trans(
"MenuChequeDeposits");
335 $hselected = (string) $h;
340 $result =
$object->fetch($id, $ref);
348 $head[$h][0] = $_SERVER[
"PHP_SELF"].
'?id='.
$object->id;
349 $head[$h][1] = $langs->trans(
"CheckReceipt");
350 $hselected = (string) $h;
361 if ($action ==
'delete') {
362 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"DeleteCheckReceipt"), $langs->trans(
"ConfirmDeleteCheckReceipt"),
'confirm_delete',
'',
'', 1);
368 if ($action ==
'valide') {
369 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"ValidateCheckReceipt"), $langs->trans(
"ConfirmValidateCheckReceipt"),
'confirm_validate',
'',
'', 1);
375 if ($action ==
'reject_check') {
376 $formquestion = array(
377 array(
'type' =>
'hidden',
'name' =>
'bankid',
'value' =>
GETPOSTINT(
'lineid')),
378 array(
'type' =>
'date',
'name' =>
'rejectdate_',
'label' => $langs->trans(
"RejectCheckDate"),
'value' =>
dol_now())
380 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"RejectCheck"), $langs->trans(
"ConfirmRejectCheck"),
'confirm_reject_check', $formquestion,
'', 1);
386if ($action ==
'new') {
394 $labeltype = ($langs->trans(
"PaymentType".$type) !=
"PaymentType".$type ? $langs->trans(
"PaymentType".$type) : $type);
395 if ($type ==
'CHQ') {
396 print
'<span class="opacitymedium">'.$langs->trans(
"SelectChequeTransactionAndGenerate").
'</span><br><br>'.
"\n";
398 print
'<span class="opacitymedium">'.$langs->trans(
"SelectPaymentTransactionAndGenerate", $labeltype).
'</span><br><br>'.
"\n";
401 print
'<form class="nocellnopadd" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
402 print
'<input type="hidden" name="token" value="'.newToken().
'">';
403 print
'<input type="hidden" name="action" value="new">';
407 print
'<table class="border centpercent">';
409 if (count($arrayofpaymentmodetomanage) > 1) {
410 $arrayoflabels = array();
411 foreach ($arrayofpaymentmodetomanage as $key => $val) {
412 $labelval = ($langs->trans(
"PaymentType".$val) !=
"PaymentType".$val ? $langs->trans(
"PaymentType".$val) : $val);
413 $arrayoflabels[$key] = $labelval;
417 print $langs->trans(
"Type");
419 print $form->selectarray(
'type', $arrayoflabels, $type);
423 print
'<tr><td class="titlefieldcreate">';
424 if ($type ==
'CHQ') {
425 print $langs->trans(
"DateChequeReceived");
427 print $langs->trans(
"DatePaymentReceived");
431 print
'<div class="nowrapfordate">';
432 print $form->selectDate($search_date_start,
'search_date_start_', 0, 0, 1,
'', 1, 1, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
434 print
'<div class="nowrapfordate">';
435 print $form->selectDate($search_date_end,
'search_date_end_', 0, 0, 1,
'', 1, 1, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
438 print
'<tr><td>'.$langs->trans(
"BankAccount").
'</td><td>';
439 $form->select_comptes($filteraccountid,
'accountid', 0,
'courant <> 2', 1);
445 print
'<div class="center">';
446 print
'<input type="submit" class="button small" name="filter" value="'.dol_escape_htmltag($langs->trans(
"ToFilter")).
'">';
447 if ($search_date_start || $search_date_end || $filteraccountid > 0) {
449 print
'<input type="submit" class="button" name="removefilter small" value="'.dol_escape_htmltag($langs->trans(
"RemoveFilter")).
'">';
456 $sql =
"SELECT ba.rowid as bid, ba.label,";
457 $sql .=
" b.rowid as transactionid, b.label as transactionlabel, b.datec as datec, b.dateo as date, ";
458 $sql .=
" b.amount, b.emetteur, b.num_chq, b.banque,";
459 $sql .=
" p.rowid as paymentid, p.ref as paymentref";
460 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
461 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement as p ON p.fk_bank = b.rowid";
462 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON (b.fk_account = ba.rowid)";
463 $sql .=
" WHERE b.fk_type = '".$db->escape($type).
"'";
464 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
465 $sql .=
" AND b.fk_bordereau = 0";
466 $sql .=
" AND b.amount > 0";
467 if ($search_date_start) {
468 $sql .=
" AND b.dateo >= '".$db->idate($search_date_start).
"'";
470 if ($search_date_end) {
471 $sql .=
" AND b.dateo <= '".$db->idate($search_date_end).
"'";
473 if ($filteraccountid > 0) {
474 $sql .=
" AND ba.rowid = ".((int) $filteraccountid);
476 $sql .= $db->order(
"b.dateo,b.rowid",
"ASC");
478 $resql = $db->query($sql);
481 while ($obj = $db->fetch_object($resql)) {
482 $accounts[$obj->bid] = $obj->label;
483 $lines[$obj->bid][$i][
"date"] = $db->jdate($obj->datec);
484 $lines[$obj->bid][$i][
"amount"] = $obj->amount;
485 $lines[$obj->bid][$i][
"emetteur"] = $obj->emetteur;
486 $lines[$obj->bid][$i][
"numero"] = $obj->num_chq;
487 $lines[$obj->bid][$i][
"banque"] = $obj->banque;
488 $lines[$obj->bid][$i][
"id"] = $obj->transactionid;
489 $lines[$obj->bid][$i][
"ref"] = $obj->transactionid;
490 $lines[$obj->bid][$i][
"label"] = $obj->transactionlabel;
491 $lines[$obj->bid][$i][
"paymentid"] = $obj->paymentid;
492 $lines[$obj->bid][$i][
"paymentref"] = $obj->paymentref;
493 $lines[$obj->bid][$i][
"paymentdate"] = $db->jdate($obj->date);
498 if ($type ==
'CHQ') {
499 print
'<div class="opacitymedium">'.$langs->trans(
"NoWaitingChecks").
'</div><br>';
501 print
'<div class="opacitymedium">'.$langs->trans(
"NoWaitingPaymentForDeposit", $labeltype).
'</div><br>';
506 foreach ($accounts as $bid => $account_label) {
508 <script type="text/javascript">
509 jQuery(document).ready(function()
511 jQuery("#checkall_'.$bid.
'").click(function()
513 jQuery(".checkforremise_'.$bid.
'").prop(\'checked\', true);
515 jQuery("#checknone_'.$bid.
'").click(function()
517 jQuery(".checkforremise_'.$bid.
'").prop(\'checked\', false);
523 $num = $db->num_rows($resql);
525 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
526 print
'<input type="hidden" name="token" value="'.newToken().
'">';
527 print
'<input type="hidden" name="action" value="create">';
528 print
'<input type="hidden" name="type" value="'.$type.
'">';
529 print
'<input type="hidden" name="accountid" value="'.$bid.
'">';
532 print
'<div class="div-table-responsive-no-min">';
533 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
535 print
'<tr class="liste_titre">';
537 if ($type ==
'CHQ') {
538 print $langs->trans(
"DateChequeReceived");
540 print $langs->trans(
"DatePaymentForDepositReceived", $type);
543 print
'<td>'.$langs->trans(
"ChequeNumber").
"</td>\n";
544 print
'<td>'.$langs->trans(
"CheckTransmitter").
"</td>\n";
545 print
'<td>'.$langs->trans(
"Bank").
"</td>\n";
546 print
'<td class="right">'.$langs->trans(
"Amount").
"</td>\n";
547 print
'<td class="center">'.$langs->trans(
"Payment").
"</td>\n";
548 print
'<td class="center">'.$langs->trans(
"LineRecord").
"</td>\n";
549 print
'<td class="center">'.$langs->trans(
"Select").
"<br>";
550 if (
$conf->use_javascript_ajax) {
551 print
'<a href="#" id="checkall_'.$bid.
'">'.$langs->trans(
"All").
'</a> / <a href="#" id="checknone_'.$bid.
'">'.$langs->trans(
"None").
'</a>';
556 if (count($lines[$bid])) {
557 foreach ($lines[$bid] as $lid => $value) {
558 print
'<tr class="oddeven">';
559 print
'<td>'.dol_print_date($value[
"date"],
'day').
'</td>';
560 print
'<td>'.$value[
"numero"].
"</td>\n";
561 print
'<td>'.$value[
"emetteur"].
"</td>\n";
562 print
'<td>'.$value[
"banque"].
"</td>\n";
563 print
'<td class="right"><span class="amount">'.price($value[
"amount"], 0, $langs, 1, -1, -1,
$conf->currency).
'</span></td>';
566 print
'<td class="center">';
567 $paymentstatic->id = $value[
"paymentid"];
568 $paymentstatic->ref = $value[
"paymentref"];
569 $paymentstatic->date = $value[
"paymentdate"];
570 if ($paymentstatic->id) {
571 print $paymentstatic->getNomUrl(1);
577 print
'<td class="center">';
578 $accountlinestatic->id = $value[
"id"];
579 $accountlinestatic->ref = $value[
"ref"];
580 if ($accountlinestatic->id > 0) {
581 print $accountlinestatic->getNomUrl(1);
587 print
'<td class="center">';
588 print
'<input id="'.$value[
"id"].
'" class="flat checkforremise_'.$bid.
'" checked type="checkbox" name="toRemise[]" value="'.$value[
"id"].
'">';
596 print
'<div class="tabsAction">';
597 if ($user->hasRight(
'banque',
'cheque')) {
598 print
'<input type="submit" class="button" value="'.$langs->trans(
'NewCheckDepositOn', $account_label).
'">';
600 print
'<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotEnoughPermissions").
'">'.$langs->trans(
'NewCheckDepositOn', $account_label).
'</a>';
608 $accountstatic =
new Account($db);
609 $accountstatic->fetch(
$object->account_id);
611 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/paiement/cheque/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
615 $moreghtmlright =
'';
617 $labelval = ($langs->trans(
"PaymentType".
$object->type) !=
"PaymentType".$object->type ? $langs->trans(
"PaymentType".
$object->type) :
$object->type);
618 $morehtmlref =
'<br><div class="refidno">'.$langs->trans(
"Type").
' : '.$labelval.
'</div>';
620 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0, $morehtmlleft,
'', 0, $moreghtmlright);
623 print
'<div class="fichecenter">';
624 print
'<div class="underbanner clearboth"></div>';
626 print
'<table class="border centpercent">';
628 print
'<tr><td class="titlefield">';
630 print
'<table class="nobordernopadding centpercent"><tr><td>';
631 print $langs->trans(
'Date');
633 if ($action !=
'editdate') {
634 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>';
636 print
'</tr></table>';
639 if ($action ==
'editdate') {
640 print
'<form name="setdate" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post">';
641 print
'<input type="hidden" name="token" value="'.newToken().
'">';
642 print
'<input type="hidden" name="action" value="setdate">';
643 print $form->selectDate(
$object->date_bordereau,
'datecreate_', 0, 0, 0,
"setdate");
644 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
656 print
'<table class="nobordernopadding" width="100%"><tr><td>';
657 print $langs->trans(
'RefExt');
659 if ($action !=
'editrefext') {
660 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>';
662 print
'</tr></table>';
664 if ($action ==
'editrefext') {
665 print
'<form name="setrefext" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post">';
666 print
'<input type="hidden" name="token" value="'.newToken().
'">';
667 print
'<input type="hidden" name="action" value="setrefext">';
668 print
'<input type="text" name="ref_ext" value="'.$object->ref_ext.
'">';
669 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
677 print
'<tr><td>'.$langs->trans(
'Account').
'</td><td>';
678 print $accountstatic->getNomUrl(1);
682 print
'<tr><td>'.$langs->trans(
'NbOfCheques').
'</td><td>';
686 print
'<tr><td>'.$langs->trans(
'Total').
'</td><td>';
687 print
'<span class="amount">'.price(
$object->amount).
'</span>';
690 print
'</table><br>';
696 $sql =
"SELECT b.rowid, b.rowid as ref, b.label, b.amount, b.num_chq, b.emetteur,";
697 $sql .=
" b.dateo as date, b.datec as datec, b.banque,";
698 $sql .=
" p.rowid as pid, p.ref as pref, ba.rowid as bid, p.statut";
699 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as ba";
700 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON (b.fk_account = ba.rowid)";
701 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement as p ON p.fk_bank = b.rowid";
702 $sql .=
" WHERE ba.entity IN (".getEntity(
'bank_account').
")";
703 $sql .=
" AND b.fk_type= '".$db->escape(
$object->type).
"'";
704 $sql .=
" AND b.fk_bordereau = ".((int)
$object->id);
705 $sql .= $db->order($sortfield, $sortorder);
707 $resql = $db->query($sql);
709 $num = $db->num_rows($resql);
711 print
'<div class="div-table-responsive">';
712 print
'<table class="noborder centpercent">';
714 $param =
"&id=".$object->id;
716 print
'<tr class="liste_titre">';
718 print_liste_field_titre(
"DateChequeReceived", $_SERVER[
"PHP_SELF"],
"b.dateo,b.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
719 print_liste_field_titre(
"Numero", $_SERVER[
"PHP_SELF"],
"b.num_chq",
"", $param,
'align="center"', $sortfield, $sortorder);
720 print_liste_field_titre(
"CheckTransmitter", $_SERVER[
"PHP_SELF"],
"b.emetteur",
"", $param,
"", $sortfield, $sortorder);
722 print_liste_field_titre(
"Amount", $_SERVER[
"PHP_SELF"],
"b.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
723 print_liste_field_titre(
"Payment", $_SERVER[
"PHP_SELF"],
"p.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
724 print_liste_field_titre(
"LineRecord", $_SERVER[
"PHP_SELF"],
"b.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
730 while ($objp = $db->fetch_object($resql)) {
731 $paymentstatic->id = $objp->pid;
732 $paymentstatic->ref = $objp->pref;
734 $accountlinestatic->id = $objp->rowid;
735 $accountlinestatic->ref = $objp->ref;
737 print
'<tr class="oddeven">';
738 print
'<td class="center">'.$i.
'</td>';
739 print
'<td class="center">'.dol_print_date($db->jdate($objp->date),
'day').
'</td>';
740 print
'<td class="center">'.($objp->num_chq ? $objp->num_chq :
' ').
'</td>';
741 print
'<td>'.dol_trunc($objp->emetteur, 24).
'</td>';
742 print
'<td>'.dol_trunc($objp->banque, 24).
'</td>';
743 print
'<td class="right"><span class="amount">'.price($objp->amount).
'</span></td>';
745 print
'<td class="center">';
746 if ($paymentstatic->id) {
747 print $paymentstatic->getNomUrl(1);
753 print
'<td class="center">';
754 if ($accountlinestatic->id > 0) {
755 print $accountlinestatic->getNomUrl(1);
761 print
'<td class="right">';
763 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=remove&token='.
newToken().
'&lineid='.$objp->rowid.
'">'.
img_delete().
'</a>';
765 if (
$object->statut == 1 && $objp->statut != 2) {
766 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=reject_check&token='.
newToken().
'&lineid='.$objp->rowid.
'">'.
img_picto($langs->trans(
"RejectCheck"),
'disable').
'</a>';
768 if ($objp->statut == 2) {
769 print
' '.img_picto($langs->trans(
'CheckRejected'),
'statut8').
'</a>';
777 print
'<td colspan="9"><span class="opacitymedium">';
778 print $langs->trans(
"None");
779 print
'</span></td>';
785 if ($num > 0 && $i < (
$object->nbcheque + 1)) {
787 $langs->load(
"errors");
788 print
info_admin($langs->trans(
"WarningSomeBankTransactionByChequeWereRemovedAfter"), 0, 0,
'warning');
807print
'<div class="tabsAction">';
809if ($user->socid == 0 && !empty(
$object->id) &&
$object->statut == 0 && $user->hasRight(
'banque',
'cheque')) {
810 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=valide&token='.
newToken().
'&sortfield='.$sortfield.
'&sortorder='.$sortorder.
'">'.$langs->trans(
'Validate').
'</a>';
813if ($user->socid == 0 && !empty(
$object->id) && $user->hasRight(
'banque',
'cheque')) {
814 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken(),
'delete', $permissiontodelete);
820if ($action !=
'new') {
824 $filedir = $upload_dir.
'/'.$objref;
825 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
826 $genallowed = $usercancreate;
827 $delallowed = $usercandelete;
828 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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.