diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index dd6455a3932ac8b5eda3cc2374ccadd64f23fa0a..ca03e11bcba8cd27ea093aba7a5c0273e9194ae8 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -102,7 +102,7 @@ if ($conf->salaries->enabled) // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire $sql.= " AND s.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } - if (preg_match('/^s/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); + if (preg_match('/^s\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder); $result = $db->query($sql); if ($result) @@ -204,7 +204,7 @@ if ($conf->tax->enabled) $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= ")"; } - if (! preg_match('/^pv/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); + if (preg_match('/^cs\./',$sortfield) || preg_match('/^c\./',$sortfield) || preg_match('/^pc\./',$sortfield) || preg_match('/^pct\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder); //$sql.= $db->plimit($limit+1,$offset); //print $sql; @@ -295,7 +295,7 @@ if ($conf->tax->enabled) // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire $sql.= " AND pv.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } - if (preg_match('/^pv/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); + if (preg_match('/^pv\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder); $result = $db->query($sql); if ($result)