Fixed HT apps to sort families under a companionship in alphabetical order.
[eq/.git] / import_ward_data
index a691a91446f9f3e8f6e080ecf7945969d30c45f6..8a7983b4d986b19380cd7437db3a402fae96d057 100755 (executable)
@@ -265,7 +265,7 @@ sub update_eq_companionship_table
                    my $rows = scalar @data;
                    if($rows == 0) {
                        # No existing records found for this companionship, make a new entry
-                       print "   Adding Elder to companionship: $elder_name -> $id\n";
+                       print "   Adding Companion to companionship: $elder_name -> $id\n";
                        $sth = $dbh->prepare("insert into eq_companionship values ($id,'$elder','$aaronic','$district',1)");
                        $sth->execute or die "-E- DB error: $DBI::errstr\n";
                    } else {
@@ -317,6 +317,8 @@ sub update_eq_family_table
     # Set all records to be invalid. Only mark them as valid if they appear on the new list.
     $sth = $dbh->prepare("update eq_family set valid=0");
     $sth->execute or die "-E- DB error: $DBI::errstr\n";
+    $sth = $dbh->prepare("update eq_family set companionship=0");
+    $sth->execute or die "-E- DB error: $DBI::errstr\n";
     
     foreach $index (keys %membership_data)
     {