[freeside-commits] freeside/FS/FS part_pkg.pm, 1.68, 1.69 cust_main.pm, 1.339, 1.340
Ivan,,,
ivan at wavetail.420.am
Wed Apr 16 14:52:40 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv18674
Modified Files:
part_pkg.pm cust_main.pm
Log Message:
start implementing billing add-ons
Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- part_pkg.pm 16 Apr 2008 21:12:38 -0000 1.68
+++ part_pkg.pm 16 Apr 2008 21:52:37 -0000 1.69
@@ -755,6 +755,19 @@
);
}
+sub self_and_bill_linked {
+ shift->_self_and_linked('bill', @_);
+}
+
+sub _self_and_linked {
+ my( $self, $type ) = @_;
+
+ ( $self,
+ map { $_->dst_pkg->_self_and_linked($type) }
+ $self->_part_pkg_link($type)
+ );
+}
+
=item part_pkg_taxoverride
Returns all associated FS::part_pkg_taxoverride objects (see
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.339
retrieving revision 1.340
diff -u -d -r1.339 -r1.340
--- cust_main.pm 15 Apr 2008 20:47:59 -0000 1.339
+++ cust_main.pm 16 Apr 2008 21:52:38 -0000 1.340
@@ -2093,7 +2093,8 @@
$cust_pkg->setfield('bill', '')
unless defined($cust_pkg->bill);
- my $part_pkg = $cust_pkg->part_pkg;
+ #my $part_pkg = $cust_pkg->part_pkg;
+ my @part_pkg = $cust_pkg->part_pkg->self_and_bill_linked;
my %hash = $cust_pkg->hash;
my $old_cust_pkg = new FS::cust_pkg \%hash;
@@ -2138,7 +2139,7 @@
# XXX should this be a package event? probably. events are called
# at collection time at the moment, though...
- if ( $part_pkg->can('reset_usage') ) {
+ foreach my $part_pkg ( grep { $_->can('reset_usage') } @part_pkg ) {
warn " resetting usage counters" if $DEBUG > 1;
$part_pkg->reset_usage($cust_pkg);
}
More information about the freeside-commits
mailing list