From 663b89d06a2c97fb0e7915ba409310fbefefea98 Mon Sep 17 00:00:00 2001 From: levinse Date: Mon, 6 Dec 2010 06:36:02 +0000 Subject: -tr-select-cust_location.html and elements/location.html: optionally support alternate address format and optional address -nearly finished qualifications, RT7111 --- FS/FS/part_export/ikano.pm | 27 +++++++++++++++++++++++++-- FS/FS/qual.pm | 25 ++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 3 deletions(-) (limited to 'FS') diff --git a/FS/FS/part_export/ikano.pm b/FS/FS/part_export/ikano.pm index bae683a12..d3715829b 100644 --- a/FS/FS/part_export/ikano.pm +++ b/FS/FS/part_export/ikano.pm @@ -278,6 +278,7 @@ sub qual { RequestClientIP => '127.0.0.1', CheckNetworks => $self->option('check_networks'), } ); + return $result unless ref($result); # error case return 'Invalid prequal response' unless defined $result->{'PrequalId'}; my $qoptions = {}; @@ -293,7 +294,7 @@ sub qual { foreach my $productgroup ( @productgroups ) { my $prefix = "ikano_Network_$netcount"."_ProductGroup_$pgcount"."_"; $qoptions->{$prefix."TermsId"} = $productgroup->{'TermsId'}; - my $products = $network->{'Product'}; + my $products = $productgroup->{'Product'}; my @products = defined $products ? @$products : (); my $prodcount = 0; foreach my $product ( @products ) { @@ -312,7 +313,29 @@ sub qual { } sub qual_html { - ''; + my($self,$qual) = (shift,shift); + + my %qual_options = $qual->options; + my @externalids = (); + my( $optionname, $optionvalue ); + while (($optionname, $optionvalue) = each %qual_options) { + push @externalids, $optionvalue + if ( $optionname =~ /^ikano_Network_(\d+)_ProductGroup_(\d+)_Product_(\d+)_ProductCustomId$/ + && $optionvalue ne '' ); + } + + my $list = "Qualifying Packages:"; + $list; } sub notes_html { diff --git a/FS/FS/qual.pm b/FS/FS/qual.pm index 553de136a..4859b7734 100644 --- a/FS/FS/qual.pm +++ b/FS/FS/qual.pm @@ -143,8 +143,31 @@ sub location { ''; } +sub cust_or_prospect { + my $self = shift; + if ( $self->locationnum ) { + my $l = qsearchs( 'cust_location', + { 'locationnum' => $self->locationnum }); + return qsearchs('cust_main',{ 'custnum' => $l->custnum }) + if $l->custnum; + return qsearchs('prospect_main',{ 'prospectnum' => $l->prospectnum }) + if $l->prospectnum; + } + return qsearchs('cust_main', { 'custnum' => $self->custnum }) + if $self->custnum; + return qsearchs('prospect_main', { 'prospectnum' => $self->prospectnum }) + if $self->prospectnum; +} + sub status_long { - + my $self = shift; + my $s = { + 'Q' => 'Qualified', + 'D' => 'Does not Qualify', + 'N' => 'New', + }; + return $s->{$self->status} if defined $s->{$self->status}; + return 'Unknown'; } =back -- cgit v1.2.1