$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;
# 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);
}
);
}
+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