X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FMyAccount.pm;h=9a20285d7a7337ab7c2a1086b9f431527b5435e1;hp=ecabe31c79d0f80913b89a6605ff40d1b96b8ee8;hb=90393980e5f2859ee1e186fa461f48f5129e803e;hpb=d6741df87df9e3352d7ae47a02d0e3f46154fef9 diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index ecabe31c7..9a20285d7 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -1577,7 +1577,25 @@ sub provision_phone { @_ ); } -#XXX: finish bulk orders + +# bulk case + my $error; + foreach my $did ( @bulkdid ) { + $did =~ s/[^0-9]//g; + $error = _provision( 'FS::svc_phone', + [qw(phonenum countrycode)], + [qw(phonenum countrycode)], + { + 'pkgnum' => $p->{'pkgnum'}, + 'svcpart' => $p->{'svcpart'}, + 'phonenum' => $did, + 'countrycode' => $p->{'countrycode'}, + 'session_id' => $p->{'session_id'}, + } + ); + return $error if ($error->{'error'} && length($error->{'error'}) > 1); + } + { 'bulkdid' => [ @bulkdid ], 'svc' => $error->{'svc'} } } sub provision_acct { @@ -1939,16 +1957,24 @@ sub get_ticket { # the requested ticket was actually linked to this customer my @custs = @{$err_or_ticket->{'custs'}}; my @txns = @{$err_or_ticket->{'txns'}}; + my @filtered_txns; return { 'error' => 'no customer' } unless ( $custnum && scalar(@custs) ); return { 'error' => 'invalid ticket requested' } unless grep($_ eq $custnum, @custs); + foreach my $txn ( @txns ) { + push @filtered_txns, $txn + if ($txn->{'type'} eq 'EmailRecord' + || $txn->{'type'} eq 'Correspond' + || $txn->{'type'} eq 'Create'); + } + warn "$me get_ticket: sucessful: \n" if $DEBUG; return { 'error' => '', - 'transactions' => \@txns, + 'transactions' => \@filtered_txns, 'ticket_id' => $p->{'ticket_id'}, }; } else {