Optional queue name for ticket additions
+=item invoice_details
+
+Optional arrayref of invoice detail strings to add (creates cust_pkg_detail detailtype 'I')
+
+=item package_comments
+
+Optional arrayref of package comment strings to add (creates cust_pkg_detail detailtype 'C')
+
=back
=cut
}
}
+ # add details/comments
+ if ($opt->{'invoice_details'}) {
+ $error = $cust_pkg->set_cust_pkg_detail('I', @{$opt->{'invoice_details'}});
+ }
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "setting invoice details: $error";
+ }
+ if ($opt->{'package_comments'}) {
+ $error = $cust_pkg->set_cust_pkg_detail('C', @{$opt->{'package_comments'}});
+ }
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "setting package comments: $error";
+ }
+
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
''; #no error
my $self = shift;
my $extra_qsearch = ref($_[0]) ? shift : { @_ };
- return $self->num_pkgs unless wantarray || keys %$extra_qsearch;
+ return $self->num_pkgs($extra_qsearch) unless wantarray;
my @cust_pkg = ();
if ( $self->{'_pkgnum'} && ! keys %$extra_qsearch ) {
sub ncancelled_pkgs {
my $self = shift;
- my $extra_qsearch = ref($_[0]) ? shift : {};
+ my $extra_qsearch = ref($_[0]) ? shift : { @_ };
local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
- return $self->num_ncancelled_pkgs unless wantarray;
+ return $self->num_ncancelled_pkgs($extra_qsearch) unless wantarray;
my @cust_pkg = ();
if ( $self->{'_pkgnum'} ) {