Browse Source

Merge branch 'master' of https://code.ffdn.org/franciliens.net/fcn-toolbox

Guillaume 6 years ago
parent
commit
a6ff497e26
1 changed files with 5 additions and 3 deletions
  1. 5 3
      fcn-ispdb

+ 5 - 3
fcn-ispdb

@@ -18,15 +18,17 @@ def getMemberCount():
   return cur.fetchone()[0]
 
 def getSubscriberCount(product):
+  # statut: 4 = STATUS_OPEN (cf. dolibarr/htdocs/contrat/class/contrat.class.php
   cur.execute("""SELECT COUNT(*)
 FROM llx_contratdet d 
 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,))
   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-%')
 members = getMemberCount()