Merge pull request #560 from FHenry/develop
Fix [ bug #658 ] Seacrh on bank do not work for description
This commit is contained in:
commit
a9e9b761cc
@ -117,11 +117,6 @@ if (is_numeric($credit)) {
|
|||||||
$si++;
|
$si++;
|
||||||
$sqlw[$si] .= " b.amount = " . $credit;
|
$sqlw[$si] .= " b.amount = " . $credit;
|
||||||
}
|
}
|
||||||
// Search criteria description
|
|
||||||
if ($description) {
|
|
||||||
$si++;
|
|
||||||
$sqlw[$si] .= " b.label like '%" . $description . "%'";
|
|
||||||
}
|
|
||||||
// Other search criteria
|
// Other search criteria
|
||||||
for ($i = 1 ; $i <= $si; $i++) {
|
for ($i = 1 ; $i <= $si; $i++) {
|
||||||
$sql .= " AND " . $sqlw[$i];
|
$sql .= " AND " . $sqlw[$i];
|
||||||
@ -194,76 +189,88 @@ if ($resql)
|
|||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
$var=!$var;
|
$printline=false;
|
||||||
|
//Search Description
|
||||||
print "<tr $bc[$var]>";
|
if ($description) {
|
||||||
|
preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction
|
||||||
// Ref
|
if ($reg[1]) {
|
||||||
print '<td align="left" nowrap="nowrap">';
|
if ($langs->transnoentities($reg[1])==$description) {
|
||||||
print "<a href=\"ligne.php?rowid=".$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."</a> ";
|
$printline=true;
|
||||||
print '</td>';
|
}
|
||||||
|
}elseif ($objp->label==$description) {$printline=true;}
|
||||||
// Date ope
|
}else {$printline=true;}
|
||||||
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
|
|
||||||
|
if ($printline) {
|
||||||
// Date value
|
$var=!$var;
|
||||||
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->dv),"day")."</td>\n";
|
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
// Payment type
|
|
||||||
print "<td align=\"center\">";
|
// Ref
|
||||||
$labeltype=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$langs->getLabelFromKey($db,$objp->fk_type,'c_paiement','code','libelle');
|
print '<td align="left" nowrap="nowrap">';
|
||||||
if ($labeltype == 'SOLD') print ' '; //$langs->trans("InitialBankBalance");
|
print "<a href=\"ligne.php?rowid=".$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid."</a> ";
|
||||||
else print $labeltype;
|
print '</td>';
|
||||||
print "</td>\n";
|
|
||||||
|
// Date ope
|
||||||
// Num
|
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
|
||||||
print '<td nowrap>'.($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
|
||||||
|
// Date value
|
||||||
// Description
|
print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->dv),"day")."</td>\n";
|
||||||
print "<td>";
|
|
||||||
|
// Payment type
|
||||||
print "<a href=\"ligne.php?rowid=".$objp->rowid."&account=".$objp->fk_account."\">";
|
print "<td align=\"center\">";
|
||||||
$reg=array();
|
$labeltype=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$langs->getLabelFromKey($db,$objp->fk_type,'c_paiement','code','libelle');
|
||||||
preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction
|
if ($labeltype == 'SOLD') print ' '; //$langs->trans("InitialBankBalance");
|
||||||
if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
|
else print $labeltype;
|
||||||
else print dol_trunc($objp->label,40);
|
print "</td>\n";
|
||||||
print "</a> ";
|
|
||||||
|
// Num
|
||||||
print '</td>';
|
print '<td nowrap>'.($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
||||||
|
|
||||||
// Third party
|
// Description
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if ($objp->url_id)
|
|
||||||
{
|
print "<a href=\"ligne.php?rowid=".$objp->rowid."&account=".$objp->fk_account."\">";
|
||||||
$companystatic->id=$objp->url_id;
|
$reg=array();
|
||||||
$companystatic->nom=$objp->labelurl;
|
preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction
|
||||||
print $companystatic->getNomUrl(1);
|
if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
|
||||||
|
else print dol_trunc($objp->label,40);
|
||||||
|
print "</a> ";
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Third party
|
||||||
|
print "<td>";
|
||||||
|
if ($objp->url_id)
|
||||||
|
{
|
||||||
|
$companystatic->id=$objp->url_id;
|
||||||
|
$companystatic->nom=$objp->labelurl;
|
||||||
|
print $companystatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Debit/Credit
|
||||||
|
if ($objp->amount < 0)
|
||||||
|
{
|
||||||
|
print "<td align=\"right\">".price($objp->amount * -1)."</td><td> </td>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<td> </td><td align=\"right\">".price($objp->amount)."</td>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bank account
|
||||||
|
print '<td align="left" nowrap="nowrap">';
|
||||||
|
$bankaccountstatic->id=$objp->bankid;
|
||||||
|
$bankaccountstatic->label=$objp->bankref;
|
||||||
|
print $bankaccountstatic->getNomUrl(1);
|
||||||
|
print "</td>\n";
|
||||||
|
print "</tr>";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
print ' ';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Debit/Credit
|
|
||||||
if ($objp->amount < 0)
|
|
||||||
{
|
|
||||||
print "<td align=\"right\">".price($objp->amount * -1)."</td><td> </td>\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<td> </td><td align=\"right\">".price($objp->amount)."</td>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bank account
|
|
||||||
print '<td align="left" nowrap="nowrap">';
|
|
||||||
$bankaccountstatic->id=$objp->bankid;
|
|
||||||
$bankaccountstatic->label=$objp->bankref;
|
|
||||||
print $bankaccountstatic->getNomUrl(1);
|
|
||||||
print "</td>\n";
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user