|
@@ -53,7 +53,20 @@ $search_dt_end = dol_mktime(0, 0, 0, GETPOST('search_end_dtmonth', 'int'), GETPO
|
|
|
$search_thirdparty=GETPOST("thirdparty",'alpha');
|
|
|
$search_req_nb=GETPOST("req_nb",'alpha');
|
|
|
|
|
|
+$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
|
|
+$sortfield = GETPOST("sortfield",'alpha');
|
|
|
+$sortorder = GETPOST("sortorder",'alpha');
|
|
|
+$page = GETPOST("page",'int');
|
|
|
+if ($page == -1) { $page = 0; }
|
|
|
+$offset = $limit * $page;
|
|
|
+$pageprev = $page - 1;
|
|
|
+$pagenext = $page + 1;
|
|
|
+if (! $sortorder) $sortorder='DESC';
|
|
|
+if (! $sortfield) $sortfield='b.dateo';
|
|
|
+
|
|
|
$param='';
|
|
|
+if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
|
|
+if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
|
|
if (!empty($description)) $param.='&description='.$description;
|
|
|
if (!empty($type)) $param.='&type='.$type;
|
|
|
if (!empty($debit)) $param.='&debit='.$debit;
|
|
@@ -61,22 +74,16 @@ if (!empty($credit)) $param.='&credit='.$credit;
|
|
|
if (!empty($account)) $param.='&account='.$account;
|
|
|
if (!empty($bid)) $param.='&bid='.$bid;
|
|
|
if (dol_strlen($search_dt_start) > 0)
|
|
|
- $param .= '&search_start_dtmonth=' . GETPOST('search_start_dtmonth', 'int') . '&search_start_dtday=' . GETPOST('search_start_dtday', 'int') . '&search_start_dtyear=' . GETPOST('search_start_dtyear', 'int');
|
|
|
+ $param .= '&search_start_dtmonth=' . GETPOST('search_start_dtmonth', 'int') . '&search_start_dtday=' . GETPOST('search_start_dtday', 'int') . '&search_start_dtyear=' . GETPOST('search_start_dtyear', 'int');
|
|
|
if (dol_strlen($search_dt_end) > 0)
|
|
|
- $param .= '&search_end_dtmonth=' . GETPOST('search_end_dtmonth', 'int') . '&search_end_dtday=' . GETPOST('search_end_dtday', 'int') . '&search_end_dtyear=' . GETPOST('search_end_dtyear', 'int');
|
|
|
+ $param .= '&search_end_dtmonth=' . GETPOST('search_end_dtmonth', 'int') . '&search_end_dtday=' . GETPOST('search_end_dtday', 'int') . '&search_end_dtyear=' . GETPOST('search_end_dtyear', 'int');
|
|
|
if (GETPOST("req_nb")) $param.='&req_nb='.urlencode(GETPOST("req_nb"));
|
|
|
if (GETPOST("thirdparty")) $param.='&thirdparty='.urlencode(GETPOST("thirdparty"));
|
|
|
|
|
|
-$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
|
|
-$sortfield = GETPOST("sortfield",'alpha');
|
|
|
-$sortorder = GETPOST("sortorder",'alpha');
|
|
|
-$page = GETPOST("page",'int');
|
|
|
-if ($page == -1) { $page = 0; }
|
|
|
-$offset = $limit * $page;
|
|
|
-$pageprev = $page - 1;
|
|
|
-$pagenext = $page + 1;
|
|
|
-if (! $sortorder) $sortorder='DESC';
|
|
|
-if (! $sortfield) $sortfield='b.dateo';
|
|
|
+
|
|
|
+/*
|
|
|
+ * Actions
|
|
|
+ */
|
|
|
|
|
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
|
|
{
|
|
@@ -88,8 +95,10 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|
|
$bid="";
|
|
|
$search_req_nb='';
|
|
|
$search_thirdparty='';
|
|
|
+ $thirdparty='';
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* View
|
|
|
*/
|
|
@@ -108,7 +117,8 @@ else $viewline = 50;
|
|
|
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq,";
|
|
|
$sql.= " b.fk_account, b.fk_type,";
|
|
|
$sql.= " ba.rowid as bankid, ba.ref as bankref,";
|
|
|
-$sql.= " bu.label as labelurl, bu.url_id";
|
|
|
+$sql.= " bu.url_id,";
|
|
|
+$sql.= " s.nom, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
|
|
$sql.= " FROM ";
|
|
|
if ($bid) $sql.= MAIN_DB_PREFIX."bank_class as l,";
|
|
|
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba,";
|
|
@@ -155,7 +165,6 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|
|
}
|
|
|
|
|
|
$sql.= $db->plimit($limit+1,$offset);
|
|
|
-//print $sql;
|
|
|
|
|
|
dol_syslog('compta/bank/search.php::', LOG_DEBUG);
|
|
|
$resql = $db->query($sql);
|
|
@@ -193,7 +202,7 @@ if ($resql)
|
|
|
$moreforfilter .= $langs->trans('Period') . ' ('.$langs->trans('DateOperationShort').') : ' . $langs->trans('DateStart') . ' ';
|
|
|
$moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1);
|
|
|
$moreforfilter .= ' - ';
|
|
|
- $moreforfilter .= $langs->trans('EndDate') . ' ' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1);
|
|
|
+ $moreforfilter .= $langs->trans('DateEnd') . ' ' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1);
|
|
|
$moreforfilter .= '</div>';
|
|
|
|
|
|
if ($moreforfilter)
|
|
@@ -209,9 +218,9 @@ if ($resql)
|
|
|
print_liste_field_titre($langs->trans('DateOperationShort'),$_SERVER['PHP_SELF'],'b.dateo','',$param,'align="center"',$sortfield,$sortorder);
|
|
|
print_liste_field_titre($langs->trans('Value'),$_SERVER['PHP_SELF'],'b.datev','',$param,'align="center"',$sortfield,$sortorder);
|
|
|
print_liste_field_titre($langs->trans("Type"),$_SERVER['PHP_SELF'],'','',$param,'align="center"',$sortfield,$sortorder);
|
|
|
- print_liste_field_titre($langs->trans("Numero"));
|
|
|
- print_liste_field_titre($langs->trans("Description"));
|
|
|
- print_liste_field_titre($langs->trans("ThirdParty"));
|
|
|
+ print_liste_field_titre($langs->trans("Numero"),$_SERVER['PHP_SELF'],'b.num_releve','',$param,'align="center"',$sortfield,$sortorder);
|
|
|
+ print_liste_field_titre($langs->trans("Description"),$_SERVER['PHP_SELF'],'','',$param,'',$sortfield,$sortorder);
|
|
|
+ print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER['PHP_SELF'],'bu.label','',$param,'',$sortfield,$sortorder);
|
|
|
print_liste_field_titre($langs->trans("Debit"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
|
|
print_liste_field_titre($langs->trans("Credit"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
|
|
print_liste_field_titre($langs->trans("Account"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
|
@@ -225,7 +234,8 @@ if ($resql)
|
|
|
print '<td class="liste_titre" align="center">';
|
|
|
$form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1);
|
|
|
print '</td>';
|
|
|
- print '<td class="liste_titre"><input type="text" class="flat" name="req_nb" value="'.dol_escape_htmltag($search_req_nb).'" size="2"></td>';
|
|
|
+ // Numero
|
|
|
+ print '<td class="liste_titre" align="center"><input type="text" class="flat" name="req_nb" value="'.dol_escape_htmltag($search_req_nb).'" size="2"></td>';
|
|
|
print '<td class="liste_titre">';
|
|
|
print '<input type="text" class="flat" name="description" size="10" value="'.dol_escape_htmltag($description).'">';
|
|
|
print '</td>';
|
|
@@ -287,7 +297,7 @@ if ($resql)
|
|
|
print "</td>\n";
|
|
|
|
|
|
// Num
|
|
|
- print '<td class="nowrap">'.($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
|
|
+ print '<td class="nowrap" align="center">'.($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
|
|
|
|
|
// Description
|
|
|
print "<td>";
|
|
@@ -306,7 +316,12 @@ if ($resql)
|
|
|
if ($objp->url_id)
|
|
|
{
|
|
|
$companystatic->id=$objp->url_id;
|
|
|
- $companystatic->name=$objp->labelurl;
|
|
|
+ $companystatic->name=$objp->nom;
|
|
|
+ $companystatic->name_alias=$objp->name_alias;
|
|
|
+ $companystatic->client=$objp->client;
|
|
|
+ $companystatic->fournisseur=$objp->fournisseur;
|
|
|
+ $companystatic->code_client=$objp->code_client;
|
|
|
+ $companystatic->code_fournisseur=$objp->code_fournisseur;
|
|
|
print $companystatic->getNomUrl(1);
|
|
|
}
|
|
|
else
|
|
@@ -363,8 +378,9 @@ else
|
|
|
// If no data to display after a search
|
|
|
if ($_POST["action"] == "search" && ! $num)
|
|
|
{
|
|
|
- print $langs->trans("NoRecordFound");
|
|
|
+ print '<div class="opacitymedium">'.$langs->trans("NoRecordFound").'</div>';
|
|
|
}
|
|
|
|
|
|
llxFooter();
|
|
|
+
|
|
|
$db->close();
|