diff options
| -rw-r--r-- | CREDITS | 5 | ||||
| -rw-r--r-- | FS/FS/part_pkg.pm | 4 | ||||
| -rwxr-xr-x | httemplate/edit/part_pkg.cgi | 19 | 
3 files changed, 25 insertions, 3 deletions
| @@ -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. diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 3d536e7d9..00ce1d944 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -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 diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index d3213dd46..60319f9d9 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -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' => { | 
