projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6161489
)
fix one-time charge quantities &
author
ivan
<ivan>
Thu, 5 Jun 2008 20:09:21 +0000
(20:09 +0000)
committer
ivan
<ivan>
Thu, 5 Jun 2008 20:09:21 +0000
(20:09 +0000)
FS/FS/cust_main.pm
patch
|
blob
|
history
FS/FS/part_pkg/flat.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main.pm
b/FS/FS/cust_main.pm
index
1f2fe88
..
33788f3
100644
(file)
--- a/
FS/FS/cust_main.pm
+++ b/
FS/FS/cust_main.pm
@@
-2107,6
+2107,7
@@
sub bill {
###
my $setup = 0;
###
my $setup = 0;
+ my $unitsetup = 0;
if ( ! $cust_pkg->setup &&
(
( $conf->exists('disable_setup_suspended_pkgs') &&
if ( ! $cust_pkg->setup &&
(
( $conf->exists('disable_setup_suspended_pkgs') &&
@@
-2125,6
+2126,8
@@
sub bill {
return "$@ running calc_setup for $cust_pkg\n";
}
return "$@ running calc_setup for $cust_pkg\n";
}
+ $unitsetup = $cust_pkg->part_pkg->unit_setup || $setup; #XXX uuh
+
$cust_pkg->setfield('setup', $time)
unless $cust_pkg->setup;
#do need it, but it won't get written to the db
$cust_pkg->setfield('setup', $time)
unless $cust_pkg->setup;
#do need it, but it won't get written to the db
@@
-2136,7
+2139,9
@@
sub bill {
# bill recurring fee
###
# bill recurring fee
###
+ #XXX unit stuff here too
my $recur = 0;
my $recur = 0;
+ my $unitrecur = 0;
my $sdate;
if ( $part_pkg->getfield('freq') ne '0' &&
! $cust_pkg->getfield('susp') &&
my $sdate;
if ( $part_pkg->getfield('freq') ne '0' &&
! $cust_pkg->getfield('susp') &&
@@
-2240,11
+2245,14
@@
sub bill {
warn " charges (setup=$setup, recur=$recur); adding line items\n"
if $DEBUG > 1;
my $cust_bill_pkg = new FS::cust_bill_pkg {
warn " charges (setup=$setup, recur=$recur); adding line items\n"
if $DEBUG > 1;
my $cust_bill_pkg = new FS::cust_bill_pkg {
- 'pkgnum' => $cust_pkg->pkgnum,
- 'setup' => $setup,
- 'recur' => $recur,
- 'sdate' => $sdate,
- 'edate' => $cust_pkg->bill,
+ 'pkgnum' => $cust_pkg->pkgnum,
+ 'setup' => $setup,
+ 'unitsetup' => $unitsetup,
+ 'recur' => $recur,
+ 'unitrecur' => $unitrecur,
+ 'quantity' => $cust_pkg->quantity,
+ 'sdate' => $sdate,
+ 'edate' => $cust_pkg->bill,
'details' => \@details,
};
$cust_bill_pkg->pkgpart_override($part_pkg->pkgpart)
'details' => \@details,
};
$cust_bill_pkg->pkgpart_override($part_pkg->pkgpart)
diff --git
a/FS/FS/part_pkg/flat.pm
b/FS/FS/part_pkg/flat.pm
index
1d93e55
..
3480964
100644
(file)
--- a/
FS/FS/part_pkg/flat.pm
+++ b/
FS/FS/part_pkg/flat.pm
@@
-101,7
+101,13
@@
sub calc_setup {
my $quantity = $cust_pkg->quantity || 1;
my $quantity = $cust_pkg->quantity || 1;
- sprintf("%.2f", $quantity * $self->option('setup_fee') );
+ sprintf("%.2f", $quantity * $self->unit_setup($cust_pkg, $sdate, $details) );
+}
+
+sub unit_setup {
+ my($self, $cust_pkg, $sdate, $details ) = @_;
+
+ $self->option('setup_fee');
}
sub calc_recur {
}
sub calc_recur {