projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git]
/
FS
/
FS
/
part_pkg
/
cdr_termination.pm
diff --git
a/FS/FS/part_pkg/cdr_termination.pm
b/FS/FS/part_pkg/cdr_termination.pm
index
840da82
..
5413c18
100644
(file)
--- a/
FS/FS/part_pkg/cdr_termination.pm
+++ b/
FS/FS/part_pkg/cdr_termination.pm
@@
-1,7
+1,7
@@
package FS::part_pkg::cdr_termination;
package FS::part_pkg::cdr_termination;
+use base qw( FS::part_pkg::recur_Common );
use strict;
use strict;
-use base qw( FS::part_pkg::recur_Common );
use vars qw( $DEBUG %info );
use Tie::IxHash;
use FS::Record qw( qsearch ); #qsearchs );
use vars qw( $DEBUG %info );
use Tie::IxHash;
use FS::Record qw( qsearch ); #qsearchs );
@@
-16,7
+16,7
@@
tie my %temporalities, 'Tie::IxHash',
%info = (
'name' => 'VoIP rating of CDR records for termination partners.',
'shortname' => 'VoIP/telco CDR termination',
%info = (
'name' => 'VoIP rating of CDR records for termination partners.',
'shortname' => 'VoIP/telco CDR termination',
- 'inherit_fields' => [ 'global_Mixin' ],
+ 'inherit_fields' => [ '
prorate_Mixin', '
global_Mixin' ],
'fields' => {
#'cdr_column' => { 'name' => 'Column from CDR records',
# 'type' => 'select',
'fields' => {
#'cdr_column' => { 'name' => 'Column from CDR records',
# 'type' => 'select',
@@
-46,11
+46,6
@@
tie my %temporalities, 'Tie::IxHash',
'subscription',
'default' => '1',
},
'subscription',
'default' => '1',
},
- 'add_full_period'=> { 'name' => 'When prorating first month, also bill '.
- 'for one full period after that',
- 'type' => 'checkbox',
- },
-
'recur_method' => { 'name' => 'Recurring fee method',
#'type' => 'radio',
#'options' => \%recur_method,
'recur_method' => { 'name' => 'Recurring fee method',
#'type' => 'radio',
#'options' => \%recur_method,
@@
-79,22
+74,17
@@
tie my %temporalities, 'Tie::IxHash',
},
#cdr_column
},
#cdr_column
- 'fieldorder' => [
qw(
- recur_temporality recur_method cutoff_day
- add_full_period
+ 'fieldorder' => [
qw( recur_temporality recur_method cutoff_day ),
+ FS::part_pkg::prorate_Mixin::fieldorder,
+ qw(
output_format usage_section summarize_usage usage_mandate
output_format usage_section summarize_usage usage_mandate
- )
+ ),
],
'weight' => 48,
);
],
'weight' => 48,
);
-sub calc_setup {
- my($self, $cust_pkg ) = @_;
- $self->option('setup_fee');
-}
-
sub calc_recur {
my $self = shift;
my($cust_pkg, $sdate, $details, $param ) = @_;
sub calc_recur {
my $self = shift;
my($cust_pkg, $sdate, $details, $param ) = @_;
@@
-103,7
+93,7
@@
sub calc_recur {
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
- if $self->
option('recur_temporality', 1)
eq 'preceding'
+ if $self->
recur_temporality
eq 'preceding'
&& ( $last_bill eq '' || $last_bill == 0 );
# termination calculations
&& ( $last_bill eq '' || $last_bill == 0 );
# termination calculations
@@
-116,9
+106,8
@@
sub calc_recur {
my $charges = 0;
#find an svc_external record
my $charges = 0;
#find an svc_external record
- my @svc_external = map { $_->svc_x }
- grep { $_->part_svc->svcdb eq 'svc_external' }
- $cust_pkg->cust_svc;
+ my @svc_external = map { $_->svc_x }
+ $cust_pkg->cust_svc_unsorted( svcdb=>'svc_external' );
die "cdr_termination package has no svc_external service"
unless @svc_external;
die "cdr_termination package has no svc_external service"
unless @svc_external;
@@
-192,13
+181,13
@@
sub calc_recur {
# eotermiation calculation
# eotermiation calculation
- $charges += $self->calc_recur_Common(@_);
+ $charges +=
($cust_pkg->quantity || 1) *
$self->calc_recur_Common(@_);
$charges;
}
$charges;
}
-sub is_free {
- 0;
-}
+sub is_free {
0; }
+
+
sub can_usageprice { 0;
}
1;
1;