Skip to content
Snippets Groups Projects
Commit 6e1a5ca4 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #3078 from aspangaro/develop-patch38

Fix: Accountancy list: Use print_liste_field_titre
parents 5975536f 390c670c
No related branches found
No related tags found
No related merge requests found
......@@ -106,20 +106,6 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
llxHeader('', $langs->trans("CustomersVentilation") . ' - ' . $langs->trans("Dispatched"));
$page = GETPOST("page");
if ($page < 0)
$page = 0;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} elseif ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit;
} else {
$limit = $conf->liste_limit;
}
$offset = $limit * $page;
$sql = "SELECT l.rowid , f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.qty, l.tva_tx, l.fk_code_ventilation, aa.label, aa.account_number,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
......@@ -170,7 +156,7 @@ if ($result) {
print '<input type="submit" class="butAction" value="' . $langs->trans("Validate") . '"/></div>';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Invoices"), $_SERVER["PHP_SELF"],"f.facnumber","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"],"f.facnumber","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
......@@ -181,7 +167,7 @@ if ($result) {
print_liste_field_titre('');
print "</tr>\n";
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . $search_facture . '"></td>';
print '<tr class="liste_titre"><td><input type="text" class="flat" name="search_facture" size="8" value="' . $search_facture . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
......
......@@ -46,6 +46,18 @@ $search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha');
$search_account = GETPOST('search_account','alpha');
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$limit = $conf->liste_limit;
if (! $sortfield) $sortfield="f.ref";
if (! $sortorder) $sortorder="DESC";
// Security check
if ($user->societe_id > 0)
accessforbidden();
......@@ -95,20 +107,6 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
llxHeader('', $langs->trans("SuppliersVentilation") . ' - ' . $langs->trans("Dispatched"));
$page = GETPOST("page");
if ($page < 0)
$page = 0;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit;
} else {
$limit = $conf->liste_limit;
}
$offset = $limit * $page;
$sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht , l.qty, l.rowid, l.tva_tx, aa.label, aa.account_number, ";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
......@@ -138,12 +136,8 @@ if (strlen(trim($search_account))) {
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
}
$sql .= " ORDER BY l.rowid";
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
$sql .= " DESC ";
}
$sql .= $db->plimit($limit + 1, $offset);
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1,$offset);
dol_syslog('accountancy/supplier/lines.php::list sql= ' . $sql1);
$result = $db->query($sql);
......@@ -152,7 +146,6 @@ if ($result) {
$num_lines = $db->num_rows($result);
$i = 0;
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list...
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
print '<td align="left"><b>' . $langs->trans("DescVentilDoneSupplier") . '</b></td>';
......@@ -160,29 +153,30 @@ if ($result) {
print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">';
print '<table class="noborder" width="100%">';
print '<br><br><div class="inline-block divButAction">'. $langs->trans("ChangeAccount");
print '<br><br><div class="inline-block divButAction">'. $langs->trans("ChangeAccount") . '<br>';
print $formventilation->select_account(GETPOST('account_parent'), 'account_parent', 1);
print '<input type="submit" class="butAction" value="' . $langs->trans("Validate") . '" /></div>';
print '<tr class="liste_titre"><td>' . $langs->trans("Invoice") . '</td>';
print '<td>' . $langs->trans("Ref") . '</td>';
print '<td>' . $langs->trans("Label") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td align="left">' . $langs->trans("Amount") . '</td>';
print '<td colspan="2" align="left">' . $langs->trans("Account") . '</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"],"f.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"],"l.total_ht","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"],"aa.account_number","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print_liste_field_titre('');
print_liste_field_titre('');
print "</tr>\n";
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . $search_facture . '"></td>';
print '<tr class="liste_titre"><td><input type="text" class="flat" name="search_facture" size="8" value="' . $search_facture . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_amount" value="' . $search_amount . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="8" name="search_amount" value="' . $search_amount . '"></td>';
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
print '<td class="liste_titre" colspan="2">&nbsp;</td>';
print '<td class="liste_titre" align="center"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print "</td></tr>\n";
......@@ -215,8 +209,8 @@ if ($result) {
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
print '<td align="left">' . price($objp->total_ht) . '</td>';
print '<td align="left">' . $codeCompta . '</td>';
print '<td align="right">' . price($objp->total_ht) . '</td>';
print '<td align="center">' . $codeCompta . '</td>';
print '<td>' . $objp->rowid . '</td>';
print '<td><a href="./card.php?id=' . $objp->rowid . '">';
print img_edit();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment