better error message for no location_kind
[freeside.git] / FS / FS / part_export / ikano.pm
index 5d8285e..153b4a6 100644 (file)
@@ -42,6 +42,21 @@ sub rebless { shift; }
 
 sub external_pkg_map { 1; }
 
+sub location_types {
+  (
+    ''     => '(None)',
+    'APT'  => 'Apartment',
+    'BLDG' => 'Building',
+    'FLR'  => 'Floor',
+    'LOT'  => 'Lot',
+    'RM'   => 'Room',
+    'SLIP' => 'Slip',
+    'TRLR' => 'Trailer',
+    'UNIT' => 'Unit',
+    'WING' => 'Wing',
+  );
+}
+
 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 +273,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',