djelat
[ferlib2koha.git] / ferlib2koha.pl
index fd94298..4cca07a 100755 (executable)
@@ -63,6 +63,28 @@ select
 from studk
 };
 
+$sql = qq{
+select
+  'D' as categorycode,
+  'SRE' as branchcode,
+  sif_djel as cardnumber,
+  ime_djel as firstname,
+  prez_djel as surname,
+  ozn_titula as title, -- FIXME 
+--  sif_orgjed (REF orgjed) as B_address,
+--  sif_strsp_djel as ??,
+  tel_djel as phonepro,
+  dat_prekid_ro as dateexpiry,
+--  tel_poduz as ??,
+  fax_poduz as fax,
+  ozn_drzava as country,
+  post_ozn as zipcode,
+  post_ozn as city,
+  adr_stan as address,
+  tel_stan as phone
+from djelat
+};
+
 my $sth = $f->prepare($sql);
 $sth->execute;
 
@@ -96,8 +118,7 @@ while (my $row = $sth->fetchrow_hashref ) {
                $row->{$c} =~ s/(\d\d)\.(\d\d)\.(\d\d\d\d)/$3-$2-$1/;
        }
 
-       $row->{sex} =~ s/Ž/F/;
-
+       $row->{sex} =~ s/\x{17D}/F/;
 
        $row->{city} ||= '?'; # not null