backport, bug 421 suppression de tel impossible
[platal.git] / include / money / trezo.inc.php
index 6f9b72a..624bd61 100644 (file)
@@ -51,12 +51,11 @@ function isDate($date)
 
 function solde_until($date='')
 {
-    global $globals;
     $sql = "SELECT SUM(credit)-SUM(debit) FROM money_trezo";
     if (empty($date)) {
-        $res = $globals->xdb->query($sql);
+        $res = XDB::query($sql);
     } else {
-        $res = $globals->xdb->query($sql." WHERE date <= {?}", $date);
+        $res = XDB::query($sql." WHERE date <= {?}", $date);
     }
     return $res->fetchOneCell();
 }