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
/
sql_external.pm
diff --git
a/FS/FS/part_pkg/sql_external.pm
b/FS/FS/part_pkg/sql_external.pm
index
7185487
..
813e808
100644
(file)
--- a/
FS/FS/part_pkg/sql_external.pm
+++ b/
FS/FS/part_pkg/sql_external.pm
@@
-1,7
+1,7
@@
package FS::part_pkg::sql_external;
package FS::part_pkg::sql_external;
+use base qw( FS::part_pkg::discount_Mixin FS::part_pkg::recur_Common );
use strict;
use strict;
-use base qw( FS::part_pkg::recur_Common FS::part_pkg::discount_Mixin );
use vars qw( %info );
use DBI;
#use FS::Record qw(qsearch qsearchs);
use vars qw( %info );
use DBI;
#use FS::Record qw(qsearch qsearchs);
@@
-9,16
+9,12
@@
use DBI;
%info = (
'name' => 'Base charge plus additional fees for external services from a configurable SQL query',
'shortname' => 'External SQL query',
%info = (
'name' => 'Base charge plus additional fees for external services from a configurable SQL query',
'shortname' => 'External SQL query',
- 'inherit_fields' => [ 'global_Mixin' ],
+ 'inherit_fields' => [ '
prorate_Mixin', '
global_Mixin' ],
'fields' => {
'cutoff_day' => { 'name' => 'Billing Day (1 - 28) for prorating or '.
'subscription',
'default' => '1',
},
'fields' => {
'cutoff_day' => { 'name' => 'Billing Day (1 - 28) for prorating or '.
'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',
'recur_method' => { 'name' => 'Recurring fee method',
#'type' => 'radio',
@@
-39,12
+35,20
@@
use DBI;
'default' => '',
},
},
'default' => '',
},
},
- 'fieldorder' => [qw( recur_method cutoff_day
- add_full_period datasrc db_username db_password query
+ 'fieldorder' => [qw( recur_method cutoff_day ),
+ FS::part_pkg::prorate_Mixin::fieldorder,
+ qw( datasrc db_username db_password query
)],
'weight' => '58',
);
)],
'weight' => '58',
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ $str .= " plus per-service charges" if $str;
+ $str;
+}
+
sub calc_recur {
my $self = shift;
my($cust_pkg, $sdate, $details, $param ) = @_;
sub calc_recur {
my $self = shift;
my($cust_pkg, $sdate, $details, $param ) = @_;
@@
-67,7
+71,7
@@
sub calc_recur {
}
$param->{'override_charges'} = $price;
}
$param->{'override_charges'} = $price;
- $self->calc_recur_Common($cust_pkg,$sdate,$details,$param);
+
($cust_pkg->quantity || 1) *
$self->calc_recur_Common($cust_pkg,$sdate,$details,$param);
}
sub can_discount { 1; }
}
sub can_discount { 1; }