|
@@ -18,15 +18,17 @@ def getMemberCount():
|
|
return cur.fetchone()[0]
|
|
return cur.fetchone()[0]
|
|
|
|
|
|
def getSubscriberCount(product):
|
|
def getSubscriberCount(product):
|
|
|
|
+ # statut: 4 = STATUS_OPEN (cf. dolibarr/htdocs/contrat/class/contrat.class.php
|
|
cur.execute("""SELECT COUNT(*)
|
|
cur.execute("""SELECT COUNT(*)
|
|
FROM llx_contratdet d
|
|
FROM llx_contratdet d
|
|
JOIN llx_product p on d.fk_product = p.rowid
|
|
JOIN llx_product p on d.fk_product = p.rowid
|
|
-WHERE d.date_ouverture IS NOT null
|
|
|
|
- AND d.date_cloture IS null
|
|
|
|
|
|
+WHERE d.statut = 4
|
|
AND p.ref LIKE %s""", (product,))
|
|
AND p.ref LIKE %s""", (product,))
|
|
return cur.fetchone()[0]
|
|
return cur.fetchone()[0]
|
|
|
|
|
|
-subscribersADSL = getSubscriberCount('ADSL-%')
|
|
|
|
|
|
+# L'ancien format de service xDSL avec Nerim était ADSL-XX-X.
|
|
|
|
+# À supprimer quand il n'y en aura plus.
|
|
|
|
+subscribersADSL = getSubscriberCount('ADSL-%') + getSubscriberCount('DSL-%')
|
|
subscibersVPN = getSubscriberCount('VPN-%')
|
|
subscibersVPN = getSubscriberCount('VPN-%')
|
|
members = getMemberCount()
|
|
members = getMemberCount()
|
|
|
|
|