1 package FS::part_pkg::subscription;
4 use vars qw(@ISA %info);
5 use Time::Local qw(timelocal);
6 #use FS::Record qw(qsearch qsearchs);
7 use FS::part_pkg::flat;
9 @ISA = qw(FS::part_pkg::flat);
12 'name' => 'First partial month full charge, then flat-rate (selectable billing day)',
14 'setup_fee' => { 'name' => 'Setup fee for this package',
17 'recur_fee' => { 'name' => 'Recurring fee for this package',
20 'cutoff_day' => { 'name' => 'billing day',
25 'fieldorder' => [ 'setup_fee', 'recur_fee','cutoff_day'],
31 my($self, $cust_pkg, $sdate ) = @_;
32 my $cutoff_day=$self->option('cutoff_day') or 1;
34 my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($mnow) )[0,1,2,3,4,5];
36 if($mday <$cutoff_day){
37 if ($mon==0) {$mon=11;$year--;}
40 $$sdate = timelocal(0,0,0,$cutoff_day,$mon,$year);
42 $self->option('recur_fee');