X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FMyAccount.pm;h=92fcd0cf777826d5eed7cbb34387928d642e10a7;hb=dd825e780ad1e7d520f5c2d7f99c0f67fe892781;hp=3f7c00432a2ce37be45e03db182da0e325fca49a;hpb=97bd512eba99c5d3b6c6f5ae5bfeaa48eeee1cd4;p=freeside.git diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 3f7c00432..92fcd0cf7 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -391,12 +391,13 @@ sub customer_info { $return{balance} = $cust_main->balance; $return{next_bill_date} = $cust_main->next_bill_date; $return{next_bill_date_pretty} = - time2str('%m/%d/%Y', $return{next_bill_date} ); + $return{next_bill_date} ? time2str('%m/%d/%Y', $return{next_bill_date} ) + : '(none)'; } my @tickets = $cust_main->tickets; # unavoidable false laziness w/ httemplate/view/cust_main/tickets.html - if ( FS::TicketSystem->selfservice_priority ) { + if ( $FS::TicketSystem::system && FS::TicketSystem->selfservice_priority ) { my $dir = $conf->exists('ticket_system-priority_reverse') ? -1 : 1; $return{tickets} = [ sort { @@ -621,7 +622,8 @@ sub billing_history { $return{balance} = $cust_main->balance; $return{next_bill_date} = $cust_main->next_bill_date; $return{next_bill_date_pretty} = - time2str('%m/%d/%Y', $return{next_bill_date} ); + $return{next_bill_date} ? time2str('%m/%d/%Y', $return{next_bill_date} ) + : '(none)'; my @history = (); @@ -1799,6 +1801,44 @@ sub set_svc_status_hash { } +sub set_svc_status_listadd { + my $p = shift; + + my($context, $session, $custnum) = _custoragent_session_custnum($p); + return { 'error' => $session } if $context eq 'error'; + + #XXX only svc_acct for now + my $svc_x = _customer_svc_x( $custnum, $p->{'svcnum'}, 'svc_acct') + or return { 'error' => "Service not found" }; + + warn "set_svc_status_listadd ". join(' / ', map "$_=>".$p->{$_}, keys %$p ) + if $DEBUG; + my $error = $svc_x->export_setstatus_listadd($p); #$p? returns error? + return { 'error' => $error } if $error; + + return {}; #? { 'error' => '' } + +} + +sub set_svc_status_listdel { + my $p = shift; + + my($context, $session, $custnum) = _custoragent_session_custnum($p); + return { 'error' => $session } if $context eq 'error'; + + #XXX only svc_acct for now + my $svc_x = _customer_svc_x( $custnum, $p->{'svcnum'}, 'svc_acct') + or return { 'error' => "Service not found" }; + + warn "set_svc_status_listdel ". join(' / ', map "$_=>".$p->{$_}, keys %$p ) + if $DEBUG; + my $error = $svc_x->export_setstatus_listdel($p); #$p? returns error? + return { 'error' => $error } if $error; + + return {}; #? { 'error' => '' } + +} + sub acct_forward_info { my $p = shift; @@ -2037,6 +2077,9 @@ sub _usage_details { $p->{ending} = $end; } + die "illegal beginning" if $p->{beginning} !~ /^\d*$/; + die "illegal ending" if $p->{ending} !~ /^\d*$/; + my (@usage) = &$callback($svc_x, $p->{beginning}, $p->{ending}, %callback_opt );