"subscription" price plan from "Luke Pfeifer" <freeside@globalli.com>
authorivan <ivan>
Sun, 24 Mar 2002 17:42:58 +0000 (17:42 +0000)
committerivan <ivan>
Sun, 24 Mar 2002 17:42:58 +0000 (17:42 +0000)
CREDITS
FS/FS/part_pkg.pm
httemplate/edit/part_pkg.cgi

diff --git a/CREDITS b/CREDITS
index f339628..13d2861 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -92,5 +92,10 @@ the "similar names warning" feature, and a number of other enhancements.
 Dave Burgess <burgess@neonramp.com> sent in a bunch of fixes and small changes
 and will doubtless send more once he's got his tree under control.
 
+Luke Pfeifer <freeside@globalli.com> contributed the "subscription" price plan.
+
+Noment Networks, LLC <http://www.noment.com/> sponsored ICRADIUS/FreeRADIUS
+groups.
+
 Everything else is my (Ivan Kohler <ivan@420.am>) fault.
 
index 3d536e7..00ce1d9 100644 (file)
@@ -198,6 +198,8 @@ sub check {
 
       or $r =~ /^my \$mnow = \$sdate; my \(\$sec,\$min,\$hour,\$mday,\$mon,\$year\) = \(localtime\(\$sdate\) \)\[0,1,2,3,4,5\]; my \$mstart = timelocal\(0,0,0,1,\$mon,\$year\); my \$mend = timelocal\(0,0,0,1, \$mon == 11 \? 0 : \$mon\+1, \$year\+\(\$mon==11\)\); \$sdate = \$mstart; \( \$part_pkg->freq \- 1 \) \* \d*\.?\d* \/ \$part_pkg\-\>freq \+ \d*\.?\d* \/ \$part_pkg\-\>freq \* \(\$mend\-\$mnow\) \/ \(\$mend\-\$mstart\) ;\s*$/
 
+      or $r =~ /^my \$mnow = \$sdate; my \(\$sec,\$min,\$hour,\$mday,\$mon,\$year\) = \(localtime\(\$sdate\) \)\[0,1,2,3,4,5\]; \$sdate = timelocal\(0,0,0,1,\$mon,\$year\); \s*\d*\.?\d*\s*;\s*$/
+
       or $r =~ /^my \$error = \$cust_pkg\->cust_main\->credit\( \s*\d*\.?\d*\s* \* scalar\(\$cust_pkg\->cust_main\->referral_cust_main_ncancelled\(\s*\d+\s*\)\), "commission" \); die \$error if \$error; \s*\d*\.?\d*\s*;\s*$/
 
       or $r =~ /^my \$error = \$cust_pkg\->cust_main\->credit\( \s*\d*\.?\d*\s* \* scalar\(\$cust_pkg\->cust_main->referral_cust_pkg\(\s*\d+\s*\)\), "commission" \); die \$error if \$error; \s*\d*\.?\d*\s*;\s*$/
@@ -264,7 +266,7 @@ sub svcpart {
 
 =head1 VERSION
 
-$Id: part_pkg.pm,v 1.8 2002-02-18 08:39:21 ivan Exp $
+$Id: part_pkg.pm,v 1.9 2002-03-24 17:42:58 ivan Exp $
 
 =head1 BUGS
 
index d3213dd..60319f9 100755 (executable)
@@ -160,7 +160,7 @@ print '<INPUT TYPE="hidden" NAME="pkgpart" VALUE="'. $part_pkg->pkgpart. '">';
 # prolly should be in database
 tie my %plans, 'Tie::IxHash',
   'flat' => {
-    'name' => 'Flat rate',
+    'name' => 'Flat rate (anniversary billing)',
     'fields' => {
       'setup_fee' => { 'name' => 'Setup fee for this package',
                        'default' => 0,
@@ -175,7 +175,7 @@ tie my %plans, 'Tie::IxHash',
   },
 
   'prorate' => {
-    'name' => 'First month pro-rated, then flat-rate',
+    'name' => 'First partial month pro-rated, then flat-rate (1st of month billing)',
     'fields' =>  {
       'setup_fee' => { 'name' => 'Setup fee for this package',
                        'default' => 0,
@@ -189,6 +189,21 @@ tie my %plans, 'Tie::IxHash',
     'recur' => '\'my $mnow = $sdate; my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($sdate) )[0,1,2,3,4,5]; my $mstart = timelocal(0,0,0,1,$mon,$year); my $mend = timelocal(0,0,0,1, $mon == 11 ? 0 : $mon+1, $year+($mon==11)); $sdate = $mstart; ( $part_pkg->freq - 1 ) * \' + what.recur_fee.value + \' / $part_pkg->freq + \' + what.recur_fee.value + \' / $part_pkg->freq * ($mend-$mnow) / ($mend-$mstart) ; \'',
   },
 
+  'subscription' => {
+    'name' => 'First partial month full charge, then flat-rate (1st of month billing)',
+    'fields' => {
+      'setup_fee' => { 'name' => 'Setup fee for this package',
+                       'default' => 0,
+                     },
+      'recur_fee' => { 'name' => 'Recurring fee for this package',
+                       'default' => 0,
+                      },
+    },
+    'fieldorder' => [ 'setup_fee', 'recur_fee' ],
+    'setup' => 'what.setup_fee.value',
+    'recur' => '\'my $mnow = $sdate; my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($sdate) )[0,1,2,3,4,5]; $sdate = timelocal(0,0,0,1,$mon,$year); \' + what.recur_fee.value',
+  },
+
   'flat_comission_cust' => {
     'name' => 'Flat rate with recurring comission per active customer',
     'fields' => {