X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fikano.pm;h=303952cfb510f7850b689d0f5c6e6908483a6832;hb=f0f1d277947922b81bcc4d77971a43ed125d72f5;hp=ac1e5785aca8d6cae37917a014e597154f8271b3;hpb=57fecbd959fd5d72b20105161b7e3df94cbedd03;p=freeside.git diff --git a/FS/FS/part_export/ikano.pm b/FS/FS/part_export/ikano.pm index ac1e5785a..303952cfb 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,15 @@ 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; + + return 'Location kind is required' unless $location_hash{location_kind}; + my $svctn = $qual->phonenum; my $result = $self->ikano_command('PREQUAL', @@ -313,7 +343,7 @@ sub qual { }; } -sub qual_html { +sub qual_result { my($self,$qual) = (shift,shift); my %qual_options = $qual->options; @@ -325,23 +355,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 { @@ -650,6 +709,7 @@ sub export_expire { $svc_dsl->last_pull((time)+1); $svc_dsl->vendor_order_id($result->{'OrderId'}); $svc_dsl->vendor_order_status($result->{'Status'}); + $svc_dsl->monitored('Y'); local $FS::svc_Common::noexport_hack = 1; $result = $svc_dsl->replace; return "Error setting DSL fields: $result" if $result;