FFZG #390 - sigurature zs -- perl replacement for function, encoding
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 12 Mar 2015 18:39:06 +0000 (19:39 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 25 Mar 2019 14:43:15 +0000 (15:43 +0100)
cataloguing/additem.pl
cataloguing/value_builder/ffzg-signatura-zatvoreno-spremiste.pl

index 09784fd..7dd339f 100755 (executable)
@@ -417,9 +417,14 @@ sub ffzg_zs_callnumber {
        my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.itemcallnumber",$frameworkcode);
        if ($record->field($tagfield)->subfield($tagsubfield) =~ m/^ZS#(\w\w)\s(\d+)-(\d+)$/ ) {
                my ( $prefix, $min, $max ) = ( $1, $2, $3 );
-               my $sth = $dbh->prepare(qq{ select ffzg_zs_nextval(?) });
+
+               $dbh->begin_work;
+               my $sth = $dbh->prepare(qq{ update ffzg_zs_seq set current = current + 1 where name = ? });
+               $sth->execute( $prefix );
+               $sth = $dbh->prepare(qq{ select current from ffzg_zs_seq where name = ? });
                $sth->execute( $prefix );
                my ($itemcallnumber) = $sth->fetchrow;
+               $dbh->commit;
 
 warn "ZS: $prefix $min - $max => $itemcallnumber\n";