summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg/sql_generic.pm
diff options
context:
space:
mode:
authorivan <ivan>2008-04-15 19:43:54 +0000
committerivan <ivan>2008-04-15 19:43:54 +0000
commitbdbfd5c5a3bb7bc193b82dc39b98ae9ffe99da44 (patch)
tree3d8209a37d8b5e4b083fba182f5726c3283ad40c /FS/FS/part_pkg/sql_generic.pm
parent477015901c379f8cd6ba46cfaa4a9ae284ae582d (diff)
s/recur_flat/recur_fee/
Diffstat (limited to 'FS/FS/part_pkg/sql_generic.pm')
-rw-r--r--FS/FS/part_pkg/sql_generic.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/FS/FS/part_pkg/sql_generic.pm b/FS/FS/part_pkg/sql_generic.pm
index 9047294..5a6a11a 100644
--- a/FS/FS/part_pkg/sql_generic.pm
+++ b/FS/FS/part_pkg/sql_generic.pm
@@ -15,9 +15,9 @@ use FS::part_pkg::flat;
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
},
- 'recur_flat' => { 'name' => 'Base recurring fee for this package',
- 'default' => 0,
- },
+ 'recur_fee' => { 'name' => 'Base recurring fee for this package',
+ 'default' => 0,
+ },
'unused_credit' => { 'name' => 'Credit the customer for the unused portion'.
' of service at cancellation',
'type' => 'checkbox',
@@ -41,11 +41,11 @@ use FS::part_pkg::flat;
'default' => '',
},
},
- 'fieldorder' => [qw( setup_fee recur_flat unused_credit recur_included recur_unit_charge datasrc db_username db_password query )],
+ 'fieldorder' => [qw( setup_fee recur_fee unused_credit recur_included recur_unit_charge datasrc db_username db_password query )],
# 'setup' => 'what.setup_fee.value',
# 'recur' => '\'my $dbh = DBI->connect(\"\' + what.datasrc.value + \'\", \"\' + what.db_username.value + \'\") or die $DBI::errstr; \'',
- #'recur' => '\'my $dbh = DBI->connect(\"\' + what.datasrc.value + \'\", \"\' + what.db_username.value + \'\", \"\' + what.db_password.value + \'\" ) or die $DBI::errstr; my $sth = $dbh->prepare(\"\' + what.query.value + \'\") or die $dbh->errstr; my $units = 0; foreach my $cust_svc ( grep { $_->part_svc->svcdb eq \"svc_domain\" } $cust_pkg->cust_svc ) { my $domain = $cust_svc->svc_x->domain; $sth->execute($domain) or die $sth->errstr; $units += $sth->fetchrow_arrayref->[0]; } $units -= \' + what.recur_included.value + \'; $units = 0 if $units < 0; \' + what.recur_flat.value + \' + $units * \' + what.recur_unit_charge.value + \';\'',
- #'recur' => '\'my $dbh = DBI->connect("\' + what.datasrc.value + \'", "\' + what.db_username.value + \'", "\' what.db_password.value + \'" ) or die $DBI::errstr; my $sth = $dbh->prepare("\' + what.query.value + \'") or die $dbh->errstr; my $units = 0; foreach my $cust_svc ( grep { $_->part_svc->svcdb eq "svc_domain" } $cust_pkg->cust_svc ) { my $domain = $cust_svc->svc_x->domain; $sth->execute($domain) or die $sth->errstr; $units += $sth->fetchrow_arrayref->[0]; } $units -= \' + what.recur_included.value + \'; $units = 0 if $units < 0; \' + what.recur_flat.value + \' + $units * \' + what.recur_unit_charge + \';\'',
+ #'recur' => '\'my $dbh = DBI->connect(\"\' + what.datasrc.value + \'\", \"\' + what.db_username.value + \'\", \"\' + what.db_password.value + \'\" ) or die $DBI::errstr; my $sth = $dbh->prepare(\"\' + what.query.value + \'\") or die $dbh->errstr; my $units = 0; foreach my $cust_svc ( grep { $_->part_svc->svcdb eq \"svc_domain\" } $cust_pkg->cust_svc ) { my $domain = $cust_svc->svc_x->domain; $sth->execute($domain) or die $sth->errstr; $units += $sth->fetchrow_arrayref->[0]; } $units -= \' + what.recur_included.value + \'; $units = 0 if $units < 0; \' + what.recur_fee.value + \' + $units * \' + what.recur_unit_charge.value + \';\'',
+ #'recur' => '\'my $dbh = DBI->connect("\' + what.datasrc.value + \'", "\' + what.db_username.value + \'", "\' what.db_password.value + \'" ) or die $DBI::errstr; my $sth = $dbh->prepare("\' + what.query.value + \'") or die $dbh->errstr; my $units = 0; foreach my $cust_svc ( grep { $_->part_svc->svcdb eq "svc_domain" } $cust_pkg->cust_svc ) { my $domain = $cust_svc->svc_x->domain; $sth->execute($domain) or die $sth->errstr; $units += $sth->fetchrow_arrayref->[0]; } $units -= \' + what.recur_included.value + \'; $units = 0 if $units < 0; \' + what.recur_fee.value + \' + $units * \' + what.recur_unit_charge + \';\'',
'weight' => '56',
);
@@ -73,16 +73,16 @@ sub calc_recur {
$units -= $self->option('recur_included');
$units = 0 if $units < 0;
- $self->option('recur_flat') + $units * $self->option('recur_unit_charge');
+ $self->option('recur_fee') + $units * $self->option('recur_unit_charge');
}
sub is_free_options {
- qw( setup_fee recur_flat recur_unit_charge );
+ qw( setup_fee recur_fee recur_unit_charge );
}
sub base_recur {
my($self, $cust_pkg) = @_;
- $self->option('recur_flat');
+ $self->option('recur_fee');
}
1;