- my $svc = FS::cust_svc->by_key($svcnum)->svc_x;
- my $username = $export->export_username($svc);
- my $usage = $export->usage_sessions({ %usage_param, 'svc' => $svc });
- # returns arrayref with one row
- $upbytes += $usage->[0]->{'acctinputoctets'};
- $downbytes += $usage->[0]->{'acctoutputoctets'};
- # in combined services mode with multiple users/MAC addresses per
- # package, this will just show one of them arbitrarily.
- $display_username ||= $username;
+ if ( $export_svcparts{ $export->exportnum }{ $cust_svc->svcpart } ) {
+ my $username = $export->export_username($svc);
+ my $usage = $export->usage_sessions({ %usage_param, 'svc' => $svc });
+ # returns arrayref with one row
+ $upbytes += $usage->[0]->{'acctinputoctets'};
+ $downbytes += $usage->[0]->{'acctoutputoctets'};
+ # in combined services mode with multiple users/MAC addresses per
+ # package, this will just show one of them arbitrarily.
+ $display_username ||= $username;
+ }
+ # else this export doesn't apply so skip it