Fix sort on thirdparty on bank transaction list

This commit is contained in:
Laurent Destailleur 2016-06-20 11:30:43 +02:00
parent 10f2d7cd67
commit b01eed697e
6 changed files with 50 additions and 28 deletions

View File

@ -331,7 +331,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
}
//$search = '\'trans("'.$value.'")\'';
$search = '-e "\''.$value.'\'" -e \'"'.$value.'"\'';
$search = '-e "\''.$value.'\'" -e \'"'.$value.'"\' -e "('.$value.')"';
$string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'* '.$scripts.'*';
//print $string."<br>\n";
exec($string,$output);

View File

@ -312,8 +312,11 @@ if ($result)
}
else if ($links[$key]['type']=='company') {
print '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowCompany'),'company').' ';
print $links[$key]['label'];
//print img_object($langs->trans('ShowCompany'),'company').' ';
$societe=new Societe($db);
$societe->fetch($links[$key]['url_id']);
//print $links[$key]['label'];
print $societe->getNomUrl(1);
print '</a>';
}
else if ($links[$key]['type']=='sc') {

View File

@ -53,20 +53,6 @@ $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');
$param='';
if (!empty($description)) $param.='&description='.$description;
if (!empty($type)) $param.='&type='.$type;
if (!empty($debit)) $param.='&debit='.$debit;
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');
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');
if (GETPOST("req_nb")) $param.='&amp;req_nb='.urlencode(GETPOST("req_nb"));
if (GETPOST("thirdparty")) $param.='&amp;thirdparty='.urlencode(GETPOST("thirdparty"));
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@ -78,6 +64,27 @@ $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;
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');
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');
if (GETPOST("req_nb")) $param.='&amp;req_nb='.urlencode(GETPOST("req_nb"));
if (GETPOST("thirdparty")) $param.='&amp;thirdparty='.urlencode(GETPOST("thirdparty"));
/*
* Actions
*/
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$description="";
@ -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();

View File

@ -159,7 +159,7 @@ if ($resql)
}
else
{
print '<tr '.$bc[false].'><td colspan="2">'.$langs->trans("NoInvoiceToWithdraw").'</td></tr>';
print '<tr '.$bc[false].'><td colspan="2" class="opacitymedium">'.$langs->trans("NoInvoiceToWithdraw").'</td></tr>';
}
print "</table><br>";
}

View File

@ -88,6 +88,8 @@ ConciliatedBy=Reconciled by
DateConciliating=Reconcile date
BankLineConciliated=Transaction reconciled
CustomerInvoicePayment=Customer payment
SupplierInvoicePayment=Supplier payment
SubscriptionPayment=Subscription payment
WithdrawalPayment=Withdrawal payment
SocialContributionPayment=Social/fiscal tax payment
BankTransfer=Bank transfer

View File

@ -56,6 +56,7 @@ SupplierBill=Supplier invoice
SupplierBills=suppliers invoices
Payment=Payment
PaymentBack=Payment back
CustomerInvoicePaymentBack=Payment back
Payments=Payments
PaymentsBack=Payments back
paymentInInvoiceCurrency=in invoices currency