New / Susp / Cancel Service Report
Troy Hammonds
troyh at netsignia.net
Fri Nov 19 20:57:22 PST 2004
Just wondering if I can have the following code added to freeside so
that I dont have to do it again if I update.
Monthly.pm:
sub canceled { #active
my( $self, $speriod, $eperiod ) = ( shift, shift, shift );
$self->scalar_sql("
SELECT COUNT(*) FROM cust_pkg
WHERE cust_pkg.custnum = cust_main.custnum
AND 0 = ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.custnum =
cust_main.custnum AND ( cust_pkg.cancel IS NULL OR cust_pkg
.cancel = 0 ) )
AND cust_pkg.cancel > $speriod AND cust_pkg.cancel < $eperiod
");
}
sub newaccount { #newaccount
my( $self, $speriod, $eperiod ) = ( shift, shift, shift );
$self->scalar_sql("
SELECT COUNT(*) FROM cust_pkg
WHERE cust_pkg.custnum = cust_main.custnum
AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 ) AND (
cust_pkg.susp IS NULL OR cust_pkg.susp = 0 )
AND cust_pkg.setup > $speriod AND cust_pkg.setup < $eperiod
");
}
sub suspended { #suspended
my( $self, $speriod, $eperiod ) = ( shift, shift, shift );
$self->scalar_sql("
SELECT COUNT(*) FROM cust_pkg
WHERE cust_pkg.custnum = cust_main.custnum
AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 )
AND 0 = ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.custnum =
cust_main.custnum AND ( cust_pkg.susp IS NULL OR cust_pkg.
susp = 0 ) )
AND cust_pkg.susp > $speriod AND cust_pkg.susp < $eperiod
");
}
and the attached files in graph folder
Thanks
-Troy
--
This message has been scanned for viruses and
dangerous content by Netsignia Online, and is
believed to be clean.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: accounts_all-graph.cgi
Type: application/x-cgi
Size: 1772 bytes
Desc: not available
Url : http://420.am/pipermail/freeside-users/attachments/20041120/5eb64432/accounts_all-graph.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: accounts_all.cgi
Type: application/x-cgi
Size: 3216 bytes
Desc: not available
Url : http://420.am/pipermail/freeside-users/attachments/20041120/5eb64432/accounts_all.bin
More information about the freeside-users
mailing list