|
@@ -38,22 +38,29 @@ if ($user->societe_id > 0)
|
|
|
}
|
|
|
|
|
|
|
|
|
-/*
|
|
|
- * Affichage
|
|
|
- */
|
|
|
-
|
|
|
-llxHeader();
|
|
|
-
|
|
|
-$sortfield = GETPOST("sortfield",'alpha');
|
|
|
-$sortorder = GETPOST("sortorder",'alpha');
|
|
|
-$page = GETPOST("page",'int');
|
|
|
+$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 = $conf->liste_limit * $page;
|
|
|
+$offset = $limit * $page;
|
|
|
$pageprev = $page - 1;
|
|
|
$pagenext = $page + 1;
|
|
|
if (! $sortorder) $sortorder="DESC";
|
|
|
if (! $sortfield) $sortfield="p.rowid";
|
|
|
-$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ * Actions
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ * View
|
|
|
+ */
|
|
|
+
|
|
|
+llxHeader();
|
|
|
|
|
|
$sql = "SELECT p.rowid, p.datep as dp, p.amount, p.statut";
|
|
|
$sql.=", c.libelle as paiement_type, p.num_paiement";
|
|
@@ -70,10 +77,20 @@ if ($socid)
|
|
|
$sql.= " AND f.fk_soc = ".$socid;
|
|
|
}
|
|
|
$sql.= " AND p.statut = 0";
|
|
|
-$sql.= " ORDER BY $sortfield $sortorder";
|
|
|
-$sql.= $db->plimit($limit+1, $offset);
|
|
|
-$resql = $db->query($sql);
|
|
|
|
|
|
+$sql.= $db->order($sortfield,$sortorder);
|
|
|
+
|
|
|
+// Count total nb of records
|
|
|
+$nbtotalofrecords = '';
|
|
|
+if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|
|
+{
|
|
|
+ $result = $db->query($sql);
|
|
|
+ $nbtotalofrecords = $db->num_rows($result);
|
|
|
+}
|
|
|
+
|
|
|
+$sql.= $db->plimit($limit + 1,$offset);
|
|
|
+
|
|
|
+$resql = $db->query($sql);
|
|
|
if ($resql)
|
|
|
{
|
|
|
$num = $db->num_rows($resql);
|