29 require
'../../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
36 $langs->loadLangs(array(
'banks',
'categories',
'bills'));
40 $socid = $user->socid;
44 $search_ref =
GETPOST(
'search_ref',
'alpha');
45 $search_account =
GETPOST(
'search_account',
'int');
46 $search_amount =
GETPOST(
'search_amount',
'alpha');
48 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
49 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
50 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
52 if (empty($page) || $page == -1) {
55 $offset = $limit * $page;
56 $pageprev = $page - 1;
57 $pagenext = $page + 1;
62 $sortfield =
"bc.date_bordereau";
67 $optioncss =
GETPOST(
'optioncss',
'alpha');
68 $view =
GETPOST(
"view",
'alpha');
73 $accountstatic =
new Account($db);
81 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
95 llxHeader(
'', $langs->trans(
"ChequesReceipts"));
97 $sql =
"SELECT bc.rowid, bc.ref, bc.date_bordereau,";
98 $sql .=
" bc.nbcheque, bc.amount, bc.statut,";
99 $sql .=
" ba.rowid as bid, ba.label";
103 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bordereau_cheque as bc,";
104 $sql .=
" ".MAIN_DB_PREFIX.
"bank_account as ba";
105 $sql .=
" WHERE bc.fk_bank_account = ba.rowid";
106 $sql .=
" AND bc.entity = ".$conf->entity;
112 if ($search_account > 0) {
113 $sql .=
" AND bc.fk_bank_account = ".((int) $search_account);
115 if ($search_amount) {
122 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
124 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
125 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
126 $resql = $db->query($sqlforcount);
128 $objforcount = $db->fetch_object(
$resql);
141 $sql .= $db->order($sortfield, $sortorder);
143 $sql .= $db->plimit($limit + 1, $offset);
147 $resql = $db->query($sql);
149 $num = $db->num_rows(
$resql);
152 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
153 $param .=
'&contextpage='.$contextpage;
155 if ($limit > 0 && $limit != $conf->liste_limit) {
156 $param .=
'&limit='.$limit;
159 $url = DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?action=new';
160 if (!empty($socid)) {
161 $url .=
'&socid='.$socid;
163 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewCheckDeposit'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->banque->cheque);
165 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
166 if ($optioncss !=
'') {
167 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
169 print
'<input type="hidden" name="token" value="'.newToken().
'">';
170 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
171 print
'<input type="hidden" name="view" value="'.dol_escape_htmltag($view).
'">';
172 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
173 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
174 print
'<input type="hidden" name="page" value="'.$page.
'">';
176 print_barre_liste($langs->trans(
"MenuChequeDeposits"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num,
$nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
180 print
'<div class="div-table-responsive">';
181 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
184 print
'<tr class="liste_titre">';
185 print
'<td class="liste_titre" align="left">';
186 print
'<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.
'">';
188 print
'<td class="liste_titre" align="center">';
189 if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
190 print
'<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.
'">';
192 print
'<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.
'">';
193 print $formother->selectyear($year ? $year : -1,
'year', 1, 20, 5);
195 print
'<td class="liste_titre">';
196 $form->select_comptes($search_account,
'search_account', 0,
'', 1);
198 print
'<td class="liste_titre"> </td>';
199 print
'<td class="liste_titre right">';
200 print
'<input class="flat maxwidth50" type="text" name="search_amount" value="'.$search_amount.
'">';
202 print
'<td class="liste_titre"></td>';
203 print
'<td class="liste_titre maxwidthsearch">';
204 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
209 print
'<tr class="liste_titre">';
211 print_liste_field_titre(
"DateCreation", $_SERVER[
"PHP_SELF"],
"bc.date_bordereau",
"", $param,
'align="center"', $sortfield, $sortorder);
213 print_liste_field_titre(
"NbOfCheques", $_SERVER[
"PHP_SELF"],
"bc.nbcheque",
"", $param,
'class="right"', $sortfield, $sortorder);
214 print_liste_field_titre(
"Amount", $_SERVER[
"PHP_SELF"],
"bc.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
215 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"bc.statut",
"", $param,
'class="right"', $sortfield, $sortorder);
220 while ($i < min($num, $limit)) {
221 $objp = $db->fetch_object(
$resql);
223 print
'<tr class="oddeven">';
227 $checkdepositstatic->id = $objp->rowid;
228 $checkdepositstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
229 $checkdepositstatic->statut = $objp->statut;
230 print $checkdepositstatic->getNomUrl(1);
234 print
'<td class="center">'.dol_print_date($db->jdate($objp->date_bordereau),
'day').
'</td>';
239 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/bankentries_list.php?account='.$objp->bid.
'">'.
img_object($langs->trans(
"ShowAccount"),
'account').
' '.$objp->label.
'</a>';
246 print
'<td class="right">'.$objp->nbcheque.
'</td>';
249 print
'<td class="right"><span class="amount">'.price($objp->amount).
'</span></td>';
252 print
'<td class="right">';
253 print $checkdepositstatic->LibStatut($objp->statut, 5);
262 print
'<tr class="oddeven">';
263 print
'<td colspan="7" class="opacitymedium">'.$langs->trans(
"None").
"</td>";
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 cheque delivery receipts.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("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->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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).
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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...
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.
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.
$nbtotalofrecords
Count total nb of records.
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.