Bugzilla – Attachment 44584 Details for
Bug 12224
Allow easy printing of patron check-in slip
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12224: (follow-up) Allow easy printing of patron check-ins for today
Bug-12224-follow-up-Allow-easy-printing-of-patron-.patch (text/plain), 9.41 KB, created by
Joonas Kylmälä
on 2015-11-06 15:54:11 UTC
(
hide
)
Description:
Bug 12224: (follow-up) Allow easy printing of patron check-ins for today
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2015-11-06 15:54:11 UTC
Size:
9.41 KB
patch
obsolete
>From 90056a6093abbf965e684c3c77136afb5d2917fe Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <j.kylmala@gmail.com> >Date: Mon, 24 Aug 2015 09:08:31 +0000 >Subject: [PATCH] Bug 12224: (follow-up) Allow easy printing of patron > check-ins for today > >This adds a printing option to the staff client patron details page >to print a list of items the patron returned today at this branch. > >To test: > >1) Apply patch. >2) Check in tools > Notices & Slips that you have CHECKINSLIP slip, > and have print message there. If not, run updatedatabase.pl >3) Check-in items for a patron. >4) Go to that patron's detail page, and from the Print-menu in > the toolbar, select "Print check-in slip" >5) You should get a slip of the patron's checked-in items. >6) Optionally, test Check-ins for the same patron, but in different > branches - should only print items for the current branch. >7) Optionally, test Check-ins for the same patron, but returned > in different day - should only print items for today. >8) Run unit test t/db_dependent/Members/IssueSlip.t >--- > .../atomicupdate/bug_12224_checkin_syspref.sql | 14 ++++ > .../data/mysql/en/mandatory/sample_notices.sql | 17 ++-- > installer/data/mysql/updatedatabase.pl | 18 ---- > .../prog/en/includes/members-toolbar.inc | 2 +- > t/db_dependent/Members/IssueSlip.t | 98 +++++++++++++++++++++- > 5 files changed, 122 insertions(+), 27 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_12224_checkin_syspref.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_12224_checkin_syspref.sql b/installer/data/mysql/atomicupdate/bug_12224_checkin_syspref.sql >new file mode 100644 >index 0000000..ee394c2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_12224_checkin_syspref.sql >@@ -0,0 +1,14 @@ >+INSERT INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type) >+VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<h3><<branches.branchname>></h3> >+Checked in by <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br /> >+(<<borrowers.cardnumber>>) <br /> >+ >+<<today>><br /> >+<h4>Checked In Today</h4> >+<checkedin> >+<p> >+<<biblio.title>><br> >+Barcode: <<items.barcode>><br> >+</p> >+</checkedin>', 'print' >+); >\ No newline at end of file >diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql >index cfc6ba3..7f048b7 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.sql >+++ b/installer/data/mysql/en/mandatory/sample_notices.sql >@@ -164,13 +164,16 @@ VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Overdues Slip', '0', 'OVERDUES_SLI > ', 'print' ); > > INSERT INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type) >-VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<<borrowers.firstname>> <<borrowers.surname>><br> >-<<branches.branchname>>, <<today>><br> >-You returned these items today: >-<ul> >+VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<h3><<branches.branchname>></h3> >+Checked in by <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br /> >+(<<borrowers.cardnumber>>) <br /> >+ >+<<today>><br /> >+<h4>Checked In Today</h4> > <checkedin> >-<li><<biblio.author>>: <<biblio.title>><br> >+<p> >+<<biblio.title>><br> > Barcode: <<items.barcode>><br> >-</checkedin> >-</ul>', 'print' >+</p> >+</checkedin>'', 'print' > ); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 47a3efc..8a1d1b0 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -11341,24 +11341,6 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >-$DBversion = "3.21.00.054"; >-if ( CheckVersion($DBversion) ) { >- $dbh->do(" >-INSERT INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type) >-VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<<borrowers.firstname>> <<borrowers.surname>><br> >-<<branches.branchname>>, <<today>><br> >-You returned these items today: >-<ul> >-<checkedin> >-<li><<biblio.author>>: <<biblio.title>><br> >-Barcode: <<items.barcode>><br> >-</checkedin> >-</ul>', 'print' >-);"); >- print "Upgrade to $DBversion done (Bug 12224 - Easy printing of patron check-in slip)\n"; >- SetVersion($DBversion); >-} >- > # DEVELOPER PROCESS, search for anything to execute in the db_update directory > # SEE bug 13068 > # if there is anything in the atomicupdate, read and execute it. >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index 3766064..169574f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -165,7 +165,7 @@ function searchToHold(){ > [% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %] > <li><a id="printslip" href="#">Print slip</a></li> > <li><a id="printquickslip" href="#">Print quick slip</a></li> >- <li><a id="printcheckinslip" href="#">Print checked-in today -slip</a></li> >+ <li><a id="printcheckinslip" href="#">Print check-in slip</a></li> > [% IF Borrowers.HasOverdues( borrowernumber ) %] > <li><a id="print_overdues" href="#">Print overdues</a></li> > [% END %] >diff --git a/t/db_dependent/Members/IssueSlip.t b/t/db_dependent/Members/IssueSlip.t >index 8c32c21..d100670 100644 >--- a/t/db_dependent/Members/IssueSlip.t >+++ b/t/db_dependent/Members/IssueSlip.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 4; > use Test::MockModule; > > use C4::Biblio; >@@ -74,6 +74,18 @@ $dbh->do(q| > INSERT INTO letter( module, code, branchcode, name, is_html, title, content, message_transport_type) VALUES ('circulation', 'ISSUEQSLIP', '', 'Issue Quick Slip', 0, 'Issue Quick Slip', ?, 'email') > |, {}, $quick_slip_content); > >+my $checkin_slip_content = <<EOS; >+Checked in today: >+<checkedin> >+Title: <<biblio.title>> >+Barcode: <<items.barcode>> >+</checkedin> >+EOS >+ >+$dbh->do(q| >+ INSERT INTO letter( module, code, branchcode, name, is_html, title, content, message_transport_type) VALUES ('circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '0', 'Items returned today', ?, 'print') >+|, {}, $checkin_slip_content); >+ > my ( $title1, $title2 ) = ( 'My title 1', 'My title 2' ); > my ( $barcode1, $barcode2 ) = ('BC0101', 'BC0202' ); > my $record = MARC::Record->new; >@@ -108,6 +120,90 @@ $module->mock( 'userenv', sub { { branch => $branchcode } } ); > my $today = dt_from_string; > my $yesterday = dt_from_string->subtract_duration( DateTime::Duration->new( days => 1 ) ); > >+subtest 'Check-in slip' => sub { >+ plan tests => 2; >+ >+ subtest 'Empty slip' => sub { >+ plan tests => 1; >+ >+ my $today_daily = $today->clone->set( hour => 23, minute => 59 ); >+ my ( $date_due, $issue_date ); >+ $date_due = $today_daily; >+ $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) ); >+ AddIssue( $borrower, $barcode1, $date_due, undef, $issue_date ); >+ >+ my $slip = CheckInSlip($borrowernumber, $branchcode ); >+ my $empty_slip = <<EOS; >+Checked in today: >+ >+EOS >+ is( $slip->{content}, $empty_slip, 'No checked in returns an empty slip' ); >+ >+ AddReturn( $barcode1, $branchcode ); >+ }; >+ >+ subtest 'Daily returns' => sub { >+ plan tests => 3; >+ my $slip = CheckInSlip($borrowernumber, $branchcode ); >+ my $expected_slip = <<EOS; >+Checked in today: >+ >+Title: $title1 >+Barcode: $barcode1 >+ >+EOS >+ is( $slip->{content}, $expected_slip, 'CheckInSlip should return a slip with one check-in' ); >+ >+ my $today_daily = $today->clone->set( hour => 23, minute => 59 ); >+ my ( $date_due, $issue_date ); >+ $date_due = $today_daily; >+ $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) ); >+ AddIssue( $borrower, $barcode1, $date_due, undef, $issue_date ); >+ AddReturn( $barcode1, $branchcode ); >+ >+ my $slip = CheckInSlip($borrowernumber, $branchcode ); >+ my $expected_slip = <<EOS; >+Checked in today: >+ >+Title: $title1 >+Barcode: $barcode1 >+ >+ >+Title: $title1 >+Barcode: $barcode1 >+ >+EOS >+ is( $slip->{content}, $expected_slip, 'CheckInSlip should return a slip with 2 same check-in' ); >+ >+ my $today_daily = $today->clone->set( hour => 01, minute => 59 ); >+ my ( $date_due, $issue_date ); >+ $date_due = $today_daily; >+ $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) ); >+ AddIssue( $borrower, $barcode2, $date_due, undef, $issue_date ); >+ AddReturn( $barcode2, $branchcode ); >+ >+ my $slip = CheckInSlip($borrowernumber, $branchcode ); >+ my $expected_slip = <<EOS; >+Checked in today: >+ >+Title: $title1 >+Barcode: $barcode1 >+ >+ >+Title: $title1 >+Barcode: $barcode1 >+ >+ >+Title: $title2 >+Barcode: $barcode2 >+ >+EOS >+ is( $slip->{content}, $expected_slip, 'CheckInSlip should return a slip with 3 check-in' ); >+ >+ }; >+ >+}; >+ > subtest 'Issue slip' => sub { > plan tests => 3; > >-- >1.9.1
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 12224
:
28194
|
29693
|
41819
|
41820
|
44574
|
44576
|
44582
|
44584
|
91476
|
91477
|
91478
|
96970
|
96972
|
110308
|
110395
|
110396
|
110403
|
110404
|
110516
|
110529
|
110530
|
110531
|
110576
|
110577
|
110578
|
114121
|
114122
|
114123
|
114124
|
116135
|
116482
|
116485
|
116486
|
116487
|
116488
|
116489
|
117245
|
117246
|
117247
|
117248
|
117249
|
117250
|
117620
|
117812
|
117813
|
117814
|
117815
|
117816
|
117817
|
117818
|
117819