summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2002-10-04 12:29:56 +0000
committerivan <ivan>2002-10-04 12:29:56 +0000
commit0ec650fe20ec3f3df4d815ed4d70f7611fdba04f (patch)
treeabd9d996ddf180782c532b82aa69bcee8ae6f699
parent828ae9eb32a96163289bdd2c517a24d5f2edb7b9 (diff)
adding
-rwxr-xr-xFS/bin/freeside-count-active-customers17
1 files changed, 17 insertions, 0 deletions
diff --git a/FS/bin/freeside-count-active-customers b/FS/bin/freeside-count-active-customers
new file mode 100755
index 000000000..759085a73
--- /dev/null
+++ b/FS/bin/freeside-count-active-customers
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+domain=$1
+
+echo "\t
+select count(*) from cust_main where
+ 0 < ( SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ AND ( cust_pkg.cancel IS NULL
+ OR cust_pkg.cancel = 0
+ )
+ )
+ OR 0 = ( SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ );
+" | psql -U freeside -q $domain | head -1
+