fix swapped dates
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 14 Jul 2013 19:38:11 +0000 (21:38 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 14 Jul 2013 19:38:11 +0000 (21:38 +0200)
casopisi2koha.pl

index 3cf5e46..963f7dd 100755 (executable)
@@ -114,8 +114,8 @@ select distinct
   posj_br.sif_orgjed as branchcode,
 
   'v.' || broj.vol_broj || ':no.' || broj.broj as serialseq,
-  broj.god_izd || '-' || broj.mjes_izd || '-' || broj.dan_izd as planneddate,
-  primj_bruk.dat_prim as publisheddate,
+  broj.god_izd || '-' || broj.mjes_izd || '-' || broj.dan_izd as publisheddate,
+  primj_bruk.dat_prim as planneddate,
   'ND:' || primj_bruk.ozn_nacdob || ' INV:' || primj.inv_broj || ' ; napomena: ' || broj.koment_broj || ' ; ' || primj_bruk.komentar || ' ; ' || primj.komentar as notes
 
 from broj
@@ -156,9 +156,9 @@ while (my $row = $sth->fetchrow_hashref ) {
 
        }
 
-       $row->{planneddate} =~ s/-$/-01/;
-       $row->{planneddate} =~ s/--/-01-/;
-       $row->{publisheddate} =~ s/(\d+)\.(\d+)\.(\d\d\d\d)/$3-$2-$1/;
+       $row->{publisheddate} =~ s/-$/-01/;
+       $row->{publisheddate} =~ s/--/-01-/;
+       $row->{plannedddate} =~ s/(\d+)\.(\d+)\.(\d\d\d\d)/$3-$2-$1/;
 
        $row->{notes} =~ s/ ; $//;
        $row->{notes} =~ s/:  ; /: /;
@@ -167,7 +167,7 @@ while (my $row = $sth->fetchrow_hashref ) {
        insert 'serial' => {
                biblionumber =>   $row->{biblionumber},
                subscriptionid => $subscriptionid,
-               status => 1,
+               status => 2,
                serialseq => $row->{serialseq},
                planneddate => $row->{planneddate},
                publisheddate => $row->{publisheddate},