X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fikano.pm;h=b04defafa16a01204e4445d8d1b3aec109ebe915;hp=fe645e479e326c7543f6231d34f554adcba8f633;hb=528e7e1cb1a6d05f87847bf9fd9b7e0e9fc33f6f;hpb=6568e7bb436d6ac4ae2ec984446e8fc4a999f0af diff --git a/FS/FS/part_export/ikano.pm b/FS/FS/part_export/ikano.pm index fe645e479..b04defafa 100644 --- a/FS/FS/part_export/ikano.pm +++ b/FS/FS/part_export/ikano.pm @@ -42,6 +42,33 @@ sub rebless { shift; } sub external_pkg_map { 1; } +sub location_types { + ( + '' => '(None)', + 'APT' => 'Apartment', + 'BLDG' => 'Building', + 'FLR' => 'Floor', + 'LOT' => 'Lot', + 'RM' => 'Room', + 'SLIP' => 'Slip', + 'SUIT' => 'Suite', + 'TRLR' => 'Trailer', + 'UNIT' => 'Unit', + 'WING' => 'Wing', + ); +} + +sub location_types_parse { + my $class = shift; + my %t = $class->location_types; + delete $t{''}; + ( + (map { $_ => $_ } keys %t), + (reverse %t), + 'STE' => 'SUIT', #USPS + ); +} + sub dsl_pull { # we distinguish between invalid new data (return error) versus data that # has legitimately changed (may eventually execute hooks; now just update) @@ -258,12 +285,16 @@ sub ikano2fsnote { } ); } +# address always required for Ikano qual, TN optional (assume dry if not given) sub qual { my($self,$qual) = (shift,shift); -# address always required for Ikano qual, TN optional (assume dry if not given) - my %location_hash = $qual->location; - return 'No address provided' unless %location_hash; + my %location_hash = $qual->location_hash; + return 'No address provided' unless keys %location_hash; + + warn Dumper(\%location_hash); + return 'Location kind is required' unless $location_hash{location_kind}; + my $svctn = $qual->phonenum; my $result = $self->ikano_command('PREQUAL', @@ -313,7 +344,7 @@ sub qual { }; } -sub qual_html { +sub qual_result { my($self,$qual) = (shift,shift); my %qual_options = $qual->options; @@ -325,23 +356,52 @@ sub qual_html { && $optionvalue ne '' ); } - # XXX: eventually perhaps this should return both the packages a link to - # order each package and go to the svc prov with the prequal id filled in - # but only if cust, not prospect! - my $list = "Qualifying Packages:"; - $list; + + @filtered_quals; } sub notes_html {