View | Details | Raw Unified | Return to bug 12224
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_12224_checkin_syspref.perl (+21 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do("INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
4
        VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<h3><<branches.branchname>></h3>
5
        Checked in by <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
6
        (<<borrowers.cardnumber>>) <br />
7
8
        <<today>><br />
9
        <h4>Checked In Today</h4>
10
        <checkedin>
11
        <p>
12
        <<biblio.title>><br>
13
        Barcode: <<items.barcode>><br>
14
        </p>
15
        </checkedin>', 'print'
16
        );");
17
18
    # Always end with this (adjust the bug info)
19
    SetVersion( $DBversion );
20
    print "Upgrade to $DBversion done (Bug 12224 - Allow easy printing of patron check-in slip)\n";
21
}
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (-7 / +11 lines)
Lines 316-329 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, Link Here
316
316
317
INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES
317
INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES
318
('circulation', 'SR_SLIP', '', 'Stock rotation slip', 0, 'Stock rotation report', 'Stock rotation report for [% branch.name %]:\r\n\r\n[% IF branch.items.size %][% branch.items.size %] items to be processed for this branch.\r\n[% ELSE %]No items to be processed for this branch\r\n[% END %][% FOREACH item IN branch.items %][% IF item.reason != \'in-demand\' %]Title: [% item.title %]\r\nAuthor: [% item.author %]\r\nCallnumber: [% item.callnumber %]\r\nLocation: [% item.location %]\r\nBarcode: [% item.barcode %]\r\nOn loan?: [% item.onloan %]\r\nStatus: [% item.reason %]\r\nCurrent library: [% item.branch.branchname %] [% item.branch.branchcode %]\r\n\r\n[% END %][% END %]', 'email');
318
('circulation', 'SR_SLIP', '', 'Stock rotation slip', 0, 'Stock rotation report', 'Stock rotation report for [% branch.name %]:\r\n\r\n[% IF branch.items.size %][% branch.items.size %] items to be processed for this branch.\r\n[% ELSE %]No items to be processed for this branch\r\n[% END %][% FOREACH item IN branch.items %][% IF item.reason != \'in-demand\' %]Title: [% item.title %]\r\nAuthor: [% item.author %]\r\nCallnumber: [% item.callnumber %]\r\nLocation: [% item.location %]\r\nBarcode: [% item.barcode %]\r\nOn loan?: [% item.onloan %]\r\nStatus: [% item.reason %]\r\nCurrent library: [% item.branch.branchname %] [% item.branch.branchcode %]\r\n\r\n[% END %][% END %]', 'email');
319
319
INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
320
INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
320
VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<<borrowers.firstname>> <<borrowers.surname>><br>
321
VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<h3><<branches.branchname>></h3>
321
<<branches.branchname>>, <<today>><br>
322
Checked in by <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
322
You returned these items today:
323
(<<borrowers.cardnumber>>) <br />
323
<ul>
324
325
<<today>><br />
326
<h4>Checked In Today</h4>
324
<checkedin>
327
<checkedin>
325
<li><<biblio.author>>: <<biblio.title>><br>
328
<p>
329
<<biblio.title>><br>
326
Barcode: <<items.barcode>><br>
330
Barcode: <<items.barcode>><br>
327
</checkedin>
331
</p>
328
</ul>', 'print'
332
</checkedin>'', 'print'
329
);
333
);
(-)a/installer/data/mysql/updatedatabase.pl (-18 lines)
Lines 18881-18904 if( CheckVersion( $DBversion ) ) { Link Here
18881
    print "Upgrade to $DBversion done (Bug 18928 - Move holdallowed, hold_fulfillment_policy, returnbranch to circulation_rules)\n";
18881
    print "Upgrade to $DBversion done (Bug 18928 - Move holdallowed, hold_fulfillment_policy, returnbranch to circulation_rules)\n";
18882
}
18882
}
18883
18883
18884
$DBversion = '19.06.00.011';
18885
if ( CheckVersion($DBversion) ) {
18886
    $dbh->do("
18887
        INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
18888
        VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<<borrowers.firstname>> <<borrowers.surname>><br>
18889
        <<branches.branchname>>, <<today>><br>
18890
        You returned these items today:
18891
        <ul>
18892
        <checkedin>
18893
        <li><<biblio.author>>: <<biblio.title>><br>
18894
        Barcode: <<items.barcode>><br>
18895
        </checkedin>
18896
        </ul>', 'print'
18897
        );");
18898
    SetVersion($DBversion);
18899
    print "Upgrade to $DBversion done (Bug 12224 - Easy printing of patron check-in slip)\n";
18900
}
18901
18902
# SEE bug 13068
18884
# SEE bug 13068
18903
# if there is anything in the atomicupdate, read and execute it.
18885
# if there is anything in the atomicupdate, read and execute it.
18904
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';
18886
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-2 / +2 lines)
Lines 32-39 Link Here
32
                <li><a id="printsummary" href="#">Print summary</a></li>
32
                <li><a id="printsummary" href="#">Print summary</a></li>
33
                <li><a id="printslip" href="#">Print slip</a></li>
33
                <li><a id="printslip" href="#">Print slip</a></li>
34
                <li><a id="printquickslip" href="#">Print quick slip</a></li>
34
                <li><a id="printquickslip" href="#">Print quick slip</a></li>
35
                <li><a id="printcheckinslip" href="#">Print checked-in today -slip</a></li>
35
                <li><a id="printcheckinslip" href="#">Print check-in slip</a></li>
36
                [% IF Borrowers.HasOverdues( patron.borrowernumber ) %]
36
                [% IF Borrowers.HasOverdues( borrowernumber ) %]
37
                    <li><a id="print_overdues" href="#">Print overdues</a></li>
37
                    <li><a id="print_overdues" href="#">Print overdues</a></li>
38
                [% END %]
38
                [% END %]
39
            </ul>
39
            </ul>
(-)a/t/db_dependent/Members/IssueSlip.t (-2 / +96 lines)
Lines 19-25 Link Here
19
use Modern::Perl;
19
use Modern::Perl;
20
20
21
use Data::Dumper; # REMOVEME with diag
21
use Data::Dumper; # REMOVEME with diag
22
use Test::More tests => 3;
22
use Test::More tests => 4;
23
use Test::MockModule;
23
use Test::MockModule;
24
use Test::MockTime qw( set_fixed_time );
24
use Test::MockTime qw( set_fixed_time );
25
use t::lib::TestBuilder;
25
use t::lib::TestBuilder;
Lines 94-99 $dbh->do(q| Link Here
94
    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')
94
    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')
95
|, {}, $quick_slip_content);
95
|, {}, $quick_slip_content);
96
96
97
my $checkin_slip_content = <<EOS;
98
Checked in today:
99
<checkedin>
100
Title: <<biblio.title>>
101
Barcode: <<items.barcode>>
102
</checkedin>
103
EOS
104
105
$dbh->do(q|
106
    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')
107
|, {}, $checkin_slip_content);
108
97
my ( $title1, $title2 ) = ( 'My title 1', 'My title 2' );
109
my ( $title1, $title2 ) = ( 'My title 1', 'My title 2' );
98
my ( $barcode1, $barcode2 ) = ('BC0101', 'BC0202' );
110
my ( $barcode1, $barcode2 ) = ('BC0101', 'BC0202' );
99
my $record = MARC::Record->new;
111
my $record = MARC::Record->new;
Lines 128-133 $module->mock( 'userenv', sub { { branch => $branchcode } } ); Link Here
128
my $today = dt_from_string;
140
my $today = dt_from_string;
129
my $yesterday = dt_from_string->subtract_duration( DateTime::Duration->new( days => 1 ) );
141
my $yesterday = dt_from_string->subtract_duration( DateTime::Duration->new( days => 1 ) );
130
142
143
subtest 'Check-in slip' => sub {
144
    plan tests => 2;
145
146
    subtest 'Empty slip' => sub {
147
        plan tests => 1;
148
149
        my $today_daily = $today->clone->set( hour => 23, minute => 59 );
150
        my ( $date_due, $issue_date );
151
        $date_due = $today_daily;
152
        $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) );
153
        AddIssue( $borrower, $barcode1, $date_due, undef, $issue_date );
154
155
        my $slip = CheckInSlip($borrowernumber, $branchcode );
156
        my $empty_slip = <<EOS;
157
Checked in today:
158
159
EOS
160
        is( $slip->{content}, $empty_slip, 'No checked in returns an empty slip' );
161
        
162
        AddReturn( $barcode1, $branchcode );
163
    };
164
165
    subtest 'Daily returns' => sub {
166
        plan tests => 3;
167
        my $slip = CheckInSlip($borrowernumber, $branchcode );
168
        my $expected_slip = <<EOS;
169
Checked in today:
170
171
Title: $title1
172
Barcode: $barcode1
173
174
EOS
175
        is( $slip->{content}, $expected_slip, 'CheckInSlip should return a slip with one check-in' );
176
        
177
        my $today_daily = $today->clone->set( hour => 23, minute => 59 );
178
        my ( $date_due, $issue_date );
179
        $date_due = $today_daily;
180
        $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) );
181
        AddIssue( $borrower, $barcode1, $date_due, undef, $issue_date );
182
        AddReturn( $barcode1, $branchcode );
183
        
184
        $slip = CheckInSlip($borrowernumber, $branchcode );
185
        $expected_slip = <<EOS;
186
Checked in today:
187
188
Title: $title1
189
Barcode: $barcode1
190
191
192
Title: $title1
193
Barcode: $barcode1
194
195
EOS
196
        is( $slip->{content}, $expected_slip, 'CheckInSlip should return a slip with 2 same check-in' );
197
198
        $today_daily = $today->clone->set( hour => 01, minute => 59 );
199
        $date_due = $today_daily;
200
        $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) );
201
        AddIssue( $borrower, $barcode2, $date_due, undef, $issue_date );
202
        AddReturn( $barcode2, $branchcode );
203
        
204
        $slip = CheckInSlip($borrowernumber, $branchcode );
205
        $expected_slip = <<EOS;
206
Checked in today:
207
208
Title: $title1
209
Barcode: $barcode1
210
211
212
Title: $title1
213
Barcode: $barcode1
214
215
216
Title: $title2
217
Barcode: $barcode2
218
219
EOS
220
        is( $slip->{content}, $expected_slip, 'CheckInSlip should return a slip with 3 check-in' );
221
222
    };
223
    
224
};
225
131
subtest 'Issue slip' => sub {
226
subtest 'Issue slip' => sub {
132
    plan tests => 3;
227
    plan tests => 3;
133
228
134
- 

Return to bug 12224