diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index d3d6ff8a945..81fbea30baa 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -108,8 +108,7 @@ if (! empty($id)) { print ''; print ''; - $linkback=''.$langs->trans("Back").''; - print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'title_setup'); + print_fiche_titre($langs->trans('CustomersVentilation'),'','title_setup'); dol_fiche_head(); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 7941a7df4a8..fa549487fbb 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -45,6 +45,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.facnumber"; +if (! $sortorder) $sortorder="DESC"; + // Security check if ($user->societe_id > 0) accessforbidden(); @@ -117,7 +129,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product $sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 "; $sql .= " AND aa.rowid = l.fk_code_ventilation"; if (strlen(trim(GETPOST("search_facture")))) { - $sql .= " AND f.facnumber like '%" . GETPOST("search_facture") . "%'"; + $sql .= " AND f.facnumber like '%" . $search_facture . "%'"; } if (strlen(trim($search_ref))) { $sql .= " AND p.ref like '%" . $search_ref . "%'"; @@ -134,16 +146,11 @@ if (strlen(trim($search_amount))) { if (strlen(trim($search_account))) { $sql .= " AND aa.account_number like '%" . $search_account . "%'"; } - if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity IN (" . getEntity("facture", 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/customer/lines.php sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); @@ -151,7 +158,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 '' . $langs->trans("DescVentilDoneCustomer") . ''; @@ -159,29 +165,30 @@ if ($result) { print '
'; print ''; - print '

' . $langs->trans("ChangeAccount"); + print '

' . $langs->trans("ChangeAccount") . '
'; print $formventilation->select_account($account_parent, 'account_parent', 1); print '
'; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print_liste_field_titre($langs->trans("Invoices"), $_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); + 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 "\n"; print ''; print ''; print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print '\n"; @@ -214,7 +221,7 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; print ''; print '
' . $langs->trans("Invoice") . '' . $langs->trans("Ref") . '' . $langs->trans("Label") . '' . $langs->trans("Description") . '' . $langs->trans("Amount") . '' . $langs->trans("Account") . '  
  '; + print ' '; print ''; print "
' . dol_trunc($objp->product_label, 24) . '' . nl2br(dol_trunc($objp->description, 32)) . '' . price($objp->total_ht) . '' . $codecompta . '' . $codecompta . '' . $objp->rowid . ''; print img_edit(); diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 42837680428..c293418b669 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -107,12 +107,11 @@ if (! empty($id)) { print ''; print ''; - $linkback=''.$langs->trans("Back").''; - print_fiche_titre($langs->trans('SuppliersVentilation'),$linkback,'title_setup'); + print_fiche_titre($langs->trans('SuppliersVentilation'),'','title_setup'); dol_fiche_head(); - print ''; + print '
'; // ref invoice print ''; @@ -121,7 +120,7 @@ if (! empty($id)) { print ''; print ''; - print ''; + print ''; print ''; print ''; print '';
' . $langs->trans("BillsSuppliers") . '' . $facturefournisseur_static->getNomUrl(1) . '
Ligne
' . $langs->trans("Line") . '' . stripslashes(nl2br($objp->description)) . '
' . $langs->trans("ProductLabel") . '' . dol_trunc($objp->product_label, 24) . '