projects
/
koha-dla
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d796d5b
)
AddReturn if item is issued
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 30 Oct 2018 08:43:30 +0000
(09:43 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 30 Oct 2018 08:43:30 +0000
(09:43 +0100)
barcode-seen.pl
patch
|
blob
|
history
diff --git
a/barcode-seen.pl
b/barcode-seen.pl
index
e53fb64
..
7c651c9
100755
(executable)
--- a/
barcode-seen.pl
+++ b/
barcode-seen.pl
@@
-6,19
+6,21
@@
BEGIN {
$ENV{KOHA_CONF} = '/etc/koha/sites/ffzg/koha-conf.xml';
}
use C4::Context;
$ENV{KOHA_CONF} = '/etc/koha/sites/ffzg/koha-conf.xml';
}
use C4::Context;
+use C4::Circulation;
use Data::Dump qw(dump);
use Data::Dump qw(dump);
-my $sql = qq{
+
+my $dbh = C4::Context->dbh;
+my $sth_items = $dbh->prepare(qq{
select
select
+ itemnumber,
+ items.biblionumber,
title,
author
from items
join biblio on biblio.biblionumber = items.biblionumber where barcode = ?
title,
author
from items
join biblio on biblio.biblionumber = items.biblionumber where barcode = ?
-};
-
-my $dbh = C4::Context->dbh;
-my $sth = $dbh->prepare($sql);
+});
my $sth_update = $dbh->prepare(qq{
update items set datelastseen = now() where barcode = ?
my $sth_update = $dbh->prepare(qq{
update items set datelastseen = now() where barcode = ?
@@
-27,18
+29,33
@@
update items set datelastseen = now() where barcode = ?
my $sth_inventura = $dbh->prepare(qq{
insert ignore into ffzg_inventura (date_scanned,barcode,source_id) values (date(now()), ?, 'abc')
});
my $sth_inventura = $dbh->prepare(qq{
insert ignore into ffzg_inventura (date_scanned,barcode,source_id) values (date(now()), ?, 'abc')
});
+
+my $sth_issues = $dbh->prepare(qq{
+select firstname,surname,userid,email from issues join borrowers on issues.borrowernumber = borrowers.borrowernumber where itemnumber = ?
+});
+
+
get '/' => sub {
my $c = shift;
my $barcode = $c->param('barcode');
warn "# $barcode";
get '/' => sub {
my $c = shift;
my $barcode = $c->param('barcode');
warn "# $barcode";
- $sth->execute( $barcode );
- while ( my $row = $sth->fetchrow_hashref ) {
- warn "# row ",dump($row);
+ $sth
_items
->execute( $barcode );
+ while ( my $row = $sth
_items
->fetchrow_hashref ) {
+ warn "#
items
row ",dump($row);
$c->stash( $_ => $row->{$_} ) foreach keys %$row;
}
$c->stash( $_ => $row->{$_} ) foreach keys %$row;
}
+
$sth_update->execute( $barcode );
$sth_inventura->execute( $barcode );
$sth_update->execute( $barcode );
$sth_inventura->execute( $barcode );
+
+ $sth_issues->execute( $c->stash('itemnumber') );
+ while ( my $row = $sth_issues->fetchrow_hashref ) {
+ warn "# issues row ",dump($row);
+ $c->stash( $_ => $row->{$_} ) foreach keys %$row;
+ AddReturn( $barcode, 'FFZG' );
+ }
+
$c->render(template => 'index');
};
$c->render(template => 'index');
};
@@
-57,6
+74,16
@@
__DATA__
<%= stash('author') %>
<b><%= stash('title') %></b>
<%= stash('author') %>
<b><%= stash('title') %></b>
+% if ( stash('userid') ) {
+<br>Borrower:
+
+<tt><%= stash('userid') %></tt>
+<%= stash('firstname') %>
+<%= stash('surname') %>
+<tt><%= stash('email') %></tt>
+
+% }
+
@@ layouts/default.html.ep
<!DOCTYPE html>
<html>
@@ layouts/default.html.ep
<!DOCTYPE html>
<html>
@@
-64,7
+91,7
@@
__DATA__
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<style>
body {
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<style>
body {
- font-size:
8
00%;
+ font-size:
2
00%;
}
</style>
<title>Inventura</title>
}
</style>
<title>Inventura</title>