X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FMyAccount.pm;h=4477611d0d6d1cc90efd7a641195f289e1288bd0;hb=e513d7cb331d7c7d99d1ea7b5f0a5f8e08e0d725;hp=151a2ed672fa93bf6a05de65521e765602396907;hpb=45346fd655ba53b82c80b920da945cc0b87ece01;p=freeside.git diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 151a2ed67..4477611d0 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -14,6 +14,7 @@ use Business::CreditCard; use HTML::Entities; use Text::CSV_XS; use Spreadsheet::WriteExcel; +use OLE::Storage_Lite; use FS::UI::Web::small_custview qw(small_custview); #less doh use FS::UI::Web; use FS::UI::bytecount qw( display_bytecount ); @@ -196,8 +197,6 @@ sub login { } else { -warn Dumper($p); - my $svc_domain = qsearchs('svc_domain', { 'domain' => $p->{'domain'} } ) or return { error => 'Domain '. $p->{'domain'}. ' not found' }; @@ -397,7 +396,7 @@ sub customer_info { 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 { @@ -931,8 +930,13 @@ sub validate_payment { #changing the hidden form values my $conf = new FS::Conf; my $fee_display = $conf->config('selfservice_process-display') || 'add'; - my $fee_pkgpart = $conf->config('selfservice_process-pkgpart'); - if ( $fee_display eq 'add' && $fee_pkgpart ) { + my $fee_pkgpart = $conf->config('selfservice_process-pkgpart', $cust_main->agentnum); + my $fee_skip_first = $conf->exists('selfservice_process-skip_first'); + if ( $fee_display eq 'add' + and $fee_pkgpart + and ! $fee_skip_first || scalar($cust_main->cust_pay) + ) + { my $fee_pkg = qsearchs('part_pkg', { pkgpart=>$fee_pkgpart } ); $amount = sprintf('%.2f', $amount + $fee_pkg->option('setup_fee') ); } @@ -1098,8 +1102,10 @@ sub do_process_payment { #no error, so order the fee package if applicable... my $conf = new FS::Conf; - my $fee_pkgpart = $conf->config('selfservice_process-pkgpart'); - if ( $fee_pkgpart ) { + my $fee_pkgpart = $conf->config('selfservice_process-pkgpart', $cust_main->agentnum); + my $fee_skip_first = $conf->exists('selfservice_process-skip_first'); + + if ( $fee_pkgpart and ! $fee_skip_first || scalar($cust_main->cust_pay) ) { my $cust_pkg = new FS::cust_pkg { 'pkgpart' => $fee_pkgpart }; @@ -2031,6 +2037,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 );