[freeside-commits] freeside/FS/FS/part_export ikano.pm,1.11,1.12

Erik Levinson levinse at wavetail.420.am
Sun Dec 5 22:36:04 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv15417/FS/FS/part_export

Modified Files:
	ikano.pm 
Log Message:
-tr-select-cust_location.html and elements/location.html: optionally support alternate address format and 
optional address
-nearly finished qualifications, RT7111


Index: ikano.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/ikano.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -d -r1.11 -r1.12
--- ikano.pm	3 Dec 2010 23:38:27 -0000	1.11
+++ ikano.pm	6 Dec 2010 06:36:01 -0000	1.12
@@ -278,6 +278,7 @@
 	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 @@
 	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_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 = "<B>Qualifying Packages:</B><UL>";
+    my @part_pkgs = qsearch( 'part_pkg', { 'disabled' => '' } );
+    foreach my $part_pkg ( @part_pkgs ) {
+	my $externalid = $part_pkg->option('externalid',1);
+	if ( $externalid ) {
+	    $list .= "<LI>".$part_pkg->pkgpart.": ".$part_pkg->pkg." - "
+		.$part_pkg->comment."</LI>" 
+	      if grep( $_ eq $externalid, @externalids );
+	}
+    }
+    $list .= "</UL>";
+    $list;
 }
 
 sub notes_html { 



More information about the freeside-commits mailing list