Fixed bug related to preferred name mismatches with hometeaching family name.
authorAlan Jack Pippin <ajp@pippin.(none)>
Mon, 11 Sep 2006 03:37:32 +0000 (21:37 -0600)
committerAlan J. Pippin <ajp@pippins.net>
Mon, 11 Sep 2006 03:37:32 +0000 (21:37 -0600)
import_ward_data

index d54f8fc77d7429cce6bd0caf34fb4ec0fc4f96ce..da23ae4ed07291314712423e04d0b63c31301fac 100755 (executable)
@@ -401,8 +401,11 @@ sub update_eq_family_table
                    $hashref = $hometeaching_data{$index};
                    foreach $key (keys %$hashref) {
                        if($hometeaching_data{$index}{'Household'} =~ /(\S+)\s+(\S+),\s+(\S+)\s+(.*)/) {
-                           print "I: Adjusting hometeaching match from: $hometeaching_data{$index}{'Household'} to $1, $3 $4\n";
-                           $hometeaching_data{$index}{'Household'} = "$1, $3 $4";
+                           $a = $1; $b = $2; $c = $3; $d = $4;
+                           if($family_name =~ /$a/ && $hometeaching_data{$index}{'Household'} !~ /$family_name/i) { 
+                               print "I: Adjusting hometeaching match from: $hometeaching_data{$index}{'Household'} to $a, $c $d\n";
+                               $hometeaching_data{$index}{'Household'} = "$a, $c $d";
+                           }
                        }
                        if($key =~ /Quorum/i &&
                           $hometeaching_data{$index}{$key} =~ /Elders/i &&