Bugzilla – Attachment 3671 Details for
Bug 6057
Improve finding next stock number
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for: Improve finding next stock number
0001-Bug-6057-Improve-finding-next-stock-number.patch (text/plain), 1.19 KB, created by
Alex Arnaud
on 2011-04-05 12:11:44 UTC
(
hide
)
Description:
patch for: Improve finding next stock number
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2011-04-05 12:11:44 UTC
Size:
1.19 KB
patch
obsolete
>From 9274bc49508c56f4bf904dacd4fc1770a3a1ce51 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Tue, 5 Apr 2011 14:10:19 +0200 >Subject: [PATCH] Bug #6057 - Improve finding next stock number > >--- > cataloguing/value_builder/stocknumber.pl | 9 +++------ > 1 files changed, 3 insertions(+), 6 deletions(-) > >diff --git a/cataloguing/value_builder/stocknumber.pl b/cataloguing/value_builder/stocknumber.pl >index 005f011..4c9b267 100755 >--- a/cataloguing/value_builder/stocknumber.pl >+++ b/cataloguing/value_builder/stocknumber.pl >@@ -53,14 +53,11 @@ sub plugin_javascript { > > my $branchcode = C4::Context->userenv->{'branch'}; > >- $query = "SELECT MAX(CAST(SUBSTRING_INDEX(stocknumber,'_',-1) AS SIGNED)) FROM items WHERE homebranch = ?"; >+ $query = "SELECT MAX(CAST(SUBSTRING_INDEX(stocknumber,'_',-1) AS SIGNED))+1 FROM items WHERE homebranch = ? AND stocknumber LIKE ?"; > my $sth=$dbh->prepare($query); >- $sth->execute($branchcode); >- while (my ($count)= $sth->fetchrow_array) { >- $nextnum = $count; >- } >- $nextnum++; > >+ $sth->execute($branchcode,$branchcode."_%"); >+ my ($nextnum) = $sth->fetchrow; > my $nextnum = $branchcode.'_'.$nextnum; > > my $scr = <<END_OF_JS; >-- >1.6.3.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6057
:
3671
|
4717