Go to the documentation of this file.
28 require
'../../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35 $langs->loadLangs(array(
'banks',
'categories',
'bills'));
39 $socid = $user->socid;
43 $search_ref =
GETPOST(
'search_ref',
'alpha');
44 $search_account =
GETPOST(
'search_account',
'int');
45 $search_amount =
GETPOST(
'search_amount',
'alpha');
47 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
48 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
49 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
51 if (empty($page) || $page == -1) {
54 $offset = $limit * $page;
55 $pageprev = $page - 1;
56 $pagenext = $page + 1;
70 $accountstatic =
new Account($db);
78 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
92 llxHeader(
'', $langs->trans(
"ChequesReceipts"));
94 $sql =
"SELECT bc.rowid, bc.ref as ref, bc.date_bordereau as dp,";
95 $sql .=
" bc.nbcheque, bc.amount, bc.statut,";
96 $sql .=
" ba.rowid as bid, ba.label";
97 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bordereau_cheque as bc,";
98 $sql .=
" ".MAIN_DB_PREFIX.
"bank_account as ba";
99 $sql .=
" WHERE bc.fk_bank_account = ba.rowid";
100 $sql .=
" AND bc.entity = ".$conf->entity;
106 if ($search_account > 0) {
107 $sql .=
" AND bc.fk_bank_account = ".((int) $search_account);
109 if ($search_amount) {
114 $sql .= $db->order($sortfield, $sortorder);
116 $nbtotalofrecords =
'';
117 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
118 $result = $db->query($sql);
119 $nbtotalofrecords = $db->num_rows($result);
120 if (($page * $limit) > $nbtotalofrecords) {
126 $sql .= $db->plimit($limit + 1, $offset);
129 $resql = $db->query($sql);
131 $num = $db->num_rows(
$resql);
134 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
135 $param .=
'&contextpage='.$contextpage;
137 if ($limit > 0 && $limit != $conf->liste_limit) {
138 $param .=
'&limit='.$limit;
141 $url = DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?action=new';
142 if (!empty($socid)) {
143 $url .=
'&socid='.$socid;
145 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewCheckDeposit'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->banque->cheque);
147 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
148 if ($optioncss !=
'') {
149 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
151 print
'<input type="hidden" name="token" value="'.newToken().
'">';
152 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
153 print
'<input type="hidden" name="view" value="'.dol_escape_htmltag($view).
'">';
154 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
155 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
156 print
'<input type="hidden" name="page" value="'.$page.
'">';
158 print_barre_liste($langs->trans(
"MenuChequeDeposits"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
162 print
'<div class="div-table-responsive">';
163 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
166 print
'<tr class="liste_titre">';
167 print
'<td class="liste_titre" align="left">';
168 print
'<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.
'">';
170 print
'<td class="liste_titre" align="center">';
171 if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
172 print
'<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.
'">';
174 print
'<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.
'">';
175 print $formother->selectyear($year ? $year : -1,
'year', 1, 20, 5);
177 print
'<td class="liste_titre">';
178 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
180 print
'<td class="liste_titre"> </td>';
181 print
'<td class="liste_titre right">';
182 print
'<input class="flat maxwidth50" type="text" name="search_amount" value="'.$search_amount.
'">';
184 print
'<td class="liste_titre"></td>';
185 print
'<td class="liste_titre maxwidthsearch">';
186 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
191 print
'<tr class="liste_titre">';
193 print_liste_field_titre(
"DateCreation", $_SERVER[
"PHP_SELF"],
"dp",
"", $param,
'align="center"', $sortfield, $sortorder);
195 print_liste_field_titre(
"NbOfCheques", $_SERVER[
"PHP_SELF"],
"bc.nbcheque",
"", $param,
'class="right"', $sortfield, $sortorder);
196 print_liste_field_titre(
"Amount", $_SERVER[
"PHP_SELF"],
"bc.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
197 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"bc.statut",
"", $param,
'class="right"', $sortfield, $sortorder);
202 while ($i < min($num, $limit)) {
203 $objp = $db->fetch_object(
$resql);
205 print
'<tr class="oddeven">';
209 $checkdepositstatic->id = $objp->rowid;
210 $checkdepositstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
211 $checkdepositstatic->statut = $objp->statut;
212 print $checkdepositstatic->getNomUrl(1);
216 print
'<td class="center">'.dol_print_date($db->jdate($objp->dp),
'day').
'</td>';
221 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/bankentries_list.php?account='.$objp->bid.
'">'.
img_object($langs->trans(
"ShowAccount"),
'account').
' '.$objp->label.
'</a>';
228 print
'<td class="right">'.$objp->nbcheque.
'</td>';
231 print
'<td class="right"><span class="amount">'.price($objp->amount).
'</span></td>';
234 print
'<td class="right">';
235 print $checkdepositstatic->LibStatut($objp->statut, 5);
244 print
'<tr class="oddeven">';
245 print
'<td colspan="7" class="opacitymedium">'.$langs->trans(
"None").
"</td>";
restrictedArea($user, $features, $objectid=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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
Class to manage cheque delivery receipts.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0, $gm=false)
Generate a SQL string to make a filter into a range (for second of date until last second of date).
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.