jmbg
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 12 Jun 2011 20:34:39 +0000 (22:34 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 12 Jun 2011 20:34:39 +0000 (22:34 +0200)
ferlib2koha.pl

index ada5c30..85f40d7 100755 (executable)
@@ -80,14 +80,21 @@ sub borrowers {
 
                $row->{city} ||= '?'; # not null
 
+               my $jmbg = delete $row->{jmbg};
+
                insert 'borrowers' => $row;
 
+               insert 'borrower_attributes' => {
+                       borrowernumber => $k->{mysql_insertid},
+                       code => 'JMBG',
+                       attribute => $jmbg,
+               } if $jmbg;
+
        }
 }
 
-$k->do(qq{
-delete from borrowers where borrowernumber > 57
-});
+$k->do(qq{ delete from borrowers where borrowernumber > 57 });
+$k->do(qq{ delete from borrower_attributes where borrowernumber > 57 });
 
 borrowers qq{
 select
@@ -110,8 +117,9 @@ select
   post_ozn_stan as B_city,
   adr_stan as B_address,
   tel_stud as phone,
-  dat_prava_do as dateexpiry
+  dat_prava_do as dateexpiry,
 --  aktivan as ??,
+  jmbg_stud as jmbg
 from studk
 };
 
@@ -133,7 +141,8 @@ select
   post_ozn as zipcode,
   post_ozn as city,
   adr_stan as address,
-  tel_stan as phone
+  tel_stan as phone,
+  jmbg_djel as jmbg
 from djelat
 };
 
@@ -153,8 +162,9 @@ select
   post_ozn as zipcode,
   post_ozn as city,
   adr_stan as address,
-  tel_stan as phone
+  tel_stan as phone,
 --  aktivan as ??,
+  jmbg_clan as jmbg
 from clost
 };