|
Lines 45-56
use C4::Context;
Link Here
|
| 45 |
sub get_barcode { |
45 |
sub get_barcode { |
| 46 |
my ($args) = @_; |
46 |
my ($args) = @_; |
| 47 |
my $nextnum = 0; |
47 |
my $nextnum = 0; |
|
|
48 |
<<<<<<< HEAD |
| 48 |
my $year = substr( $args->{year}, -2 ); |
49 |
my $year = substr( $args->{year}, -2 ); |
| 49 |
my $month = $args->{mon}; |
50 |
my $month = $args->{mon}; |
| 50 |
my $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?"; |
51 |
my $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?"; |
| 51 |
my $sth = C4::Context->dbh->prepare($query); |
52 |
my $sth = C4::Context->dbh->prepare($query); |
| 52 |
$sth->execute("^[-a-zA-Z]{1,}$year$month"); |
53 |
$sth->execute("^[-a-zA-Z]{1,}$year$month"); |
| 53 |
while ( my ($count) = $sth->fetchrow_array ) { |
54 |
while ( my ($count) = $sth->fetchrow_array ) { |
|
|
55 |
======= |
| 56 |
my $year = substr($args->{year}, -2); |
| 57 |
my $month = $args->{mon}; |
| 58 |
my $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?"; |
| 59 |
my $sth = C4::Context->dbh->prepare($query); |
| 60 |
$sth->execute("^[-a-zA-Z0-9]{1,}$year$month"); |
| 61 |
while (my ($count)= $sth->fetchrow_array) { |
| 62 |
>>>>>>> Bug 19113: Barcode value builder not working with numeric branchcode |
| 54 |
$nextnum = $count if $count; |
63 |
$nextnum = $count if $count; |
| 55 |
$nextnum = 0 if $nextnum == 9999; # this sequence only allows for cataloging 9999 items per month |
64 |
$nextnum = 0 if $nextnum == 9999; # this sequence only allows for cataloging 9999 items per month |
| 56 |
} |
65 |
} |
| 57 |
- |
|
|