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 = '\'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.'*'; $string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'* '.$scripts.'*';
//print $string."<br>\n"; //print $string."<br>\n";
exec($string,$output); exec($string,$output);

View File

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

View File

@ -53,7 +53,20 @@ $search_dt_end = dol_mktime(0, 0, 0, GETPOST('search_end_dtmonth', 'int'), GETPO
$search_thirdparty=GETPOST("thirdparty",'alpha'); $search_thirdparty=GETPOST("thirdparty",'alpha');
$search_req_nb=GETPOST("req_nb",'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=''; $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($description)) $param.='&description='.$description;
if (!empty($type)) $param.='&type='.$type; if (!empty($type)) $param.='&type='.$type;
if (!empty($debit)) $param.='&debit='.$debit; if (!empty($debit)) $param.='&debit='.$debit;
@ -67,16 +80,10 @@ if (dol_strlen($search_dt_end) > 0)
if (GETPOST("req_nb")) $param.='&amp;req_nb='.urlencode(GETPOST("req_nb")); if (GETPOST("req_nb")) $param.='&amp;req_nb='.urlencode(GETPOST("req_nb"));
if (GETPOST("thirdparty")) $param.='&amp;thirdparty='.urlencode(GETPOST("thirdparty")); 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'); * Actions
$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';
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers 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=""; $bid="";
$search_req_nb=''; $search_req_nb='';
$search_thirdparty=''; $search_thirdparty='';
$thirdparty='';
} }
/* /*
* View * 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 = "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.= " b.fk_account, b.fk_type,";
$sql.= " ba.rowid as bankid, ba.ref as bankref,"; $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 "; $sql.= " FROM ";
if ($bid) $sql.= MAIN_DB_PREFIX."bank_class as l,"; if ($bid) $sql.= MAIN_DB_PREFIX."bank_class as l,";
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba,"; $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); $sql.= $db->plimit($limit+1,$offset);
//print $sql;
dol_syslog('compta/bank/search.php::', LOG_DEBUG); dol_syslog('compta/bank/search.php::', LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
@ -193,7 +202,7 @@ if ($resql)
$moreforfilter .= $langs->trans('Period') . ' ('.$langs->trans('DateOperationShort').') : ' . $langs->trans('DateStart') . ' '; $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 .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1);
$moreforfilter .= ' - '; $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>'; $moreforfilter .= '</div>';
if ($moreforfilter) 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('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('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("Type"),$_SERVER['PHP_SELF'],'','',$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Numero")); 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")); print_liste_field_titre($langs->trans("Description"),$_SERVER['PHP_SELF'],'','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ThirdParty")); 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("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("Credit"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Account"),$_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">'; print '<td class="liste_titre" align="center">';
$form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1); $form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1);
print '</td>'; 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 '<td class="liste_titre">';
print '<input type="text" class="flat" name="description" size="10" value="'.dol_escape_htmltag($description).'">'; print '<input type="text" class="flat" name="description" size="10" value="'.dol_escape_htmltag($description).'">';
print '</td>'; print '</td>';
@ -287,7 +297,7 @@ if ($resql)
print "</td>\n"; print "</td>\n";
// Num // 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 // Description
print "<td>"; print "<td>";
@ -306,7 +316,12 @@ if ($resql)
if ($objp->url_id) if ($objp->url_id)
{ {
$companystatic->id=$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); print $companystatic->getNomUrl(1);
} }
else else
@ -363,8 +378,9 @@ else
// If no data to display after a search // If no data to display after a search
if ($_POST["action"] == "search" && ! $num) if ($_POST["action"] == "search" && ! $num)
{ {
print $langs->trans("NoRecordFound"); print '<div class="opacitymedium">'.$langs->trans("NoRecordFound").'</div>';
} }
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -159,7 +159,7 @@ if ($resql)
} }
else 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>"; print "</table><br>";
} }

View File

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

View File

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