From 6c420cf8a5f93e425840c0cb8ba841affa081f76 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 10 Jul 2004 14:31:00 +0000 Subject: [PATCH] tyop; --- FS/FS/ClientAPI/MyAccount.pm | 56 ++++++++++++++++++++++++++++---------------- FS/FS/cust_svc.pm | 2 +- FS/FS/part_pkg.pm | 4 +++- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 58ab6c0b7..ceb1e65e7 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -212,7 +212,41 @@ sub payment_info { my $session = $cache->get($p->{'session_id'}) or return { 'error' => "Can't resume session" }; #better error message - my %return; + ## + #generic + ## + + my $conf = new FS::Conf; + my %states = map { $_->state => 1 } + qsearch('cust_main_county', { + 'country' => $conf->config('defaultcountry') || 'US' + } ); + + use vars qw($payment_info); #cache for performance + $payment_info ||= { + + #list all counties/states/countries + 'cust_main_county' => + [ map { $_->hashref } qsearch('cust_main_county', {}) ], + + #shortcut for one-country folks + 'states' => + [ sort { $a cmp $b } keys %states ], + + 'card_types' => { + 'VISA' => 'VISA card', + 'MasterCard' => 'MasterCard', + 'Discover' => 'Discover card', + 'American Express' => 'American Express card', + }, + + }; + + ## + #customer-specific + ## + + my %return = %$payment_info; my $custnum = $session->{'custnum'}; @@ -236,25 +270,7 @@ sub payment_info { } - #list all counties/states/countries - $return{'cust_main_county'} = - [ map { $_->hashref } qsearch('cust_main_county', {}) ]; - - #shortcut for one-country folks - my $conf = new FS::Conf; - my %states = map { $_->state => 1 } - qsearch('cust_main_county', { - 'country' => $conf->config('defaultcountry') || 'US' - } ); - $return{'states'} = [ sort { $a cmp $b } keys %states ]; - - $return{card_types} = { - 'VISA' => 'VISA card', - 'MasterCard' => 'MasterCard', - 'Discover' => 'Discover card', - 'American Express' => 'American Express card', - }; - + #doubleclick protection my $_date = time; $return{paybatch} = "webui-MyAccount-$_date-$$-". rand() * 2**32; diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index 384b23add..7ee9b3f40 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -11,7 +11,7 @@ use FS::pkg_svc; use FS::svc_acct; use FS::svc_domain; use FS::svc_forward; -use FS::svc_broadband +use FS::svc_broadband; use FS::svc_external; use FS::domain_record; use FS::part_export; diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index dcce66b38..df1f02e46 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -262,7 +262,9 @@ definition (with non-zero quantity). sub pkg_svc { my $self = shift; - grep { $_->quantity } qsearch( 'pkg_svc', { 'pkgpart' => $self->pkgpart } ); + #sort { $b->primary cmp $a->primary } + grep { $_->quantity } + qsearch( 'pkg_svc', { 'pkgpart' => $self->pkgpart } ); } =item svcpart [ SVCDB ] -- 2.11.0