projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a47374a
)
adding
author
ivan
<ivan>
Fri, 4 Oct 2002 12:30:19 +0000
(12:30 +0000)
committer
ivan
<ivan>
Fri, 4 Oct 2002 12:30:19 +0000
(12:30 +0000)
FS/bin/freeside-count-active-customers
[new file with mode: 0755]
patch
|
blob
diff --git a/FS/bin/freeside-count-active-customers
b/FS/bin/freeside-count-active-customers
new file mode 100755
(executable)
index 0000000..
759085a
--- /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
+