From: ivan Date: Sun, 24 Mar 2002 17:42:58 +0000 (+0000) Subject: "subscription" price plan from "Luke Pfeifer" X-Git-Tag: freeside_1_4_0_pre12~130 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=1858140b774bfe3a694a2ededf70de797da31c51 "subscription" price plan from "Luke Pfeifer" --- diff --git a/CREDITS b/CREDITS index f3396284a..13d286127 100644 --- a/CREDITS +++ b/CREDITS @@ -92,5 +92,10 @@ the "similar names warning" feature, and a number of other enhancements. Dave Burgess sent in a bunch of fixes and small changes and will doubtless send more once he's got his tree under control. +Luke Pfeifer contributed the "subscription" price plan. + +Noment Networks, LLC sponsored ICRADIUS/FreeRADIUS +groups. + Everything else is my (Ivan Kohler ) 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 ''; # 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' => {