$row->{borrowernotes} = lookup($f, 'clanorg', 'ozn_vrclan||ozn_clan', 'napom_clan', $row->{'cardnumber'}, undef);
+ $row->{title} = lookup($f, 'titula', 'ozn_titula', 'opis_titula', $row->{title}, $row->{title});
+
my $jmbg = delete $row->{jmbg};
insert 'borrowers' => $row;
'D' || sif_djel as cardnumber,
ime_djel as firstname,
prez_djel as surname,
- ozn_titula as title, -- FIXME
+ ozn_titula as title,
-- sif_orgjed (REF orgjed) as B_address,
-- sif_strsp_djel as ??,
tel_djel as phonepro,
'O' || mbr_clan as cardnumber,
ime_clan as firstname,
prez_clan as surname,
- ozn_titula as title, -- ?
+ ozn_titula as title,
zvanje_clan as ethnicity, -- XXX we are not allowerd by low to collect ethnicity
-- krat_poduz (REF poduz) as B_address,
tel_poduz as B_phone,
from clost
};
+my $sth_syspref = $k->prepare(qq{ update systempreferences set value=? where variable=? });
+my $BorrowersTitles = join('|', @{ $k->selectcol_arrayref(qq{ select distinct title from borrowers where title != '' }) });
+$sth_syspref->execute( $BorrowersTitles => 'BorrowersTitles' );
+warn "# BorrowersTitles [$BorrowersTitles]";
+
} # import->{borrowers}
sub issues {