add LEC billing
[freeside.git] / FS / FS / part_pkg.pm
index 1f31065..99d88d5 100644 (file)
@@ -59,7 +59,7 @@ inherits from FS::Record.  The following fields are currently supported:
 
 =item recurtax - Recurring fee tax exempt flag, empty or `Y'
 
-=item taxclass - Texas tax class flag, empty or "none", "access", or "hosting"
+=item taxclass - Tax class flag
 
 =item plan - Price plan
 
@@ -218,6 +218,8 @@ sub check {
 
       or $r =~ /^my \$min = \$cust_pkg\->seconds_since\(\$cust_pkg\->bill \|\| 0\) \/ 60 \- \s*\d*\.?\d*\s*; \$min = 0 if \$min < 0; \s*\d*\.?\d*\s* \+ \s*\d*\.?\d*\s* \* \$min;\s*$/
 
+      or $r =~ /^my \$last_bill = \$cust_pkg\->last_bill; my \$hours = \$cust_pkg\->seconds_since_sqlradacct\(\$last_bill, \$sdate \) \/ 3600 - \s*\d\.?\d*\s*; \$hours = 0 if \$hours < 0; my \$input = \$cust_pkg\->attribute_since_sqlradacct\(\$last_bill, \$sdate, "AcctInputOctets" \) \/ 1048576; my \$output = \$cust_pkg\->attribute_since_sqlradacct\(\$last_bill, \$sdate, "AcctOutputOctets" \) \/ 1048576; my \$total = \$input \+ \$output \- \s*\d\.?\d*\s*; \$total = 0 if \$total < 0; my \$input = \$input - \s*\d\.?\d*\s*; \$input = 0 if \$input < 0; my \$output = \$output - \s*\d\.?\d*\s*; \$output = 0 if \$output < 0; \s*\d\.?\d*\s* \+ \s*\d\.?\d*\s* \* \$hours \+ \s*\d\.?\d*\s* \* \$input \+ \s*\d\.?\d*\s* \* \$output \+ \s*\d\.?\d*\s* \* \$total *;\s*$/
+
       or do {
         #log!
         return "illegal recur: $r";
@@ -235,7 +237,7 @@ sub check {
       || $self->ut_anything('plandata')
       || $self->ut_enum('setuptax', [ '', 'Y' ] )
       || $self->ut_enum('recurtax', [ '', 'Y' ] )
-      || $self->ut_enum('taxclass', [ '', 'none', 'access', 'hosting' ] )
+      || $self->ut_textn('taxclass')
       || $self->ut_enum('disabled', [ '', 'Y' ] )
     ;
 }
@@ -280,6 +282,8 @@ following logic instead;
 If the package has B<0> setup and B<0> recur, the single item B<BILL> is
 returned, otherwise, the single item B<CARD> is returned.
 
+(CHEK?  LEC?  Probably shouldn't accept those by default, prone to abuse)
+
 =cut
 
 sub payby {
@@ -295,10 +299,6 @@ sub payby {
 
 =back
 
-=head1 VERSION
-
-$Id: part_pkg.pm,v 1.13 2002-05-04 15:00:18 ivan Exp $
-
 =head1 BUGS
 
 The delete method is unimplemented.