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

(-)a/installer/data/mysql/atomicupdate/bug_12224_checkin_syspref.sql (+14 lines)
Line 0 Link Here
1
INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
2
VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<h3><<branches.branchname>></h3>
3
Checked in by <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
4
(<<borrowers.cardnumber>>) <br />
5
6
<<today>><br />
7
<h4>Checked In Today</h4>
8
<checkedin>
9
<p>
10
<<biblio.title>><br>
11
Barcode: <<items.barcode>><br>
12
</p>
13
</checkedin>', 'print'
14
);
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (-7 / +10 lines)
Lines 164-176 VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Overdues Slip', '0', 'OVERDUES_SLI Link Here
164
', 'print' );
164
', 'print' );
165
165
166
INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
166
INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
167
VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<<borrowers.firstname>> <<borrowers.surname>><br>
167
VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<h3><<branches.branchname>></h3>
168
<<branches.branchname>>, <<today>><br>
168
Checked in by <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
169
You returned these items today:
169
(<<borrowers.cardnumber>>) <br />
170
<ul>
170
171
<<today>><br />
172
<h4>Checked In Today</h4>
171
<checkedin>
173
<checkedin>
172
<li><<biblio.author>>: <<biblio.title>><br>
174
<p>
175
<<biblio.title>><br>
173
Barcode: <<items.barcode>><br>
176
Barcode: <<items.barcode>><br>
174
</checkedin>
177
</p>
175
</ul>', 'print'
178
</checkedin>'', 'print'
176
);
179
);
(-)a/installer/data/mysql/updatedatabase.pl (-18 lines)
Lines 11341-11364 if ( CheckVersion($DBversion) ) { Link Here
11341
    SetVersion($DBversion);
11341
    SetVersion($DBversion);
11342
}
11342
}
11343
11343
11344
$DBversion = "3.21.00.054";
11345
if ( CheckVersion($DBversion) ) {
11346
    $dbh->do("
11347
INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
11348
VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<<borrowers.firstname>> <<borrowers.surname>><br>
11349
<<branches.branchname>>, <<today>><br>
11350
You returned these items today:
11351
<ul>
11352
<checkedin>
11353
<li><<biblio.author>>: <<biblio.title>><br>
11354
Barcode: <<items.barcode>><br>
11355
</checkedin>
11356
</ul>', 'print'
11357
);");
11358
    print "Upgrade to $DBversion done (Bug 12224 - Easy printing of patron check-in slip)\n";
11359
    SetVersion($DBversion);
11360
}
11361
11362
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
11344
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
11363
# SEE bug 13068
11345
# SEE bug 13068
11364
# if there is anything in the atomicupdate, read and execute it.
11346
# if there is anything in the atomicupdate, read and execute it.
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-1 / +1 lines)
Lines 165-171 function searchToHold(){ Link Here
165
                [% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %]
165
                [% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %]
166
                <li><a id="printslip" href="#">Print slip</a></li>
166
                <li><a id="printslip" href="#">Print slip</a></li>
167
                <li><a id="printquickslip" href="#">Print quick slip</a></li>
167
                <li><a id="printquickslip" href="#">Print quick slip</a></li>
168
                <li><a id="printcheckinslip" href="#">Print checked-in today -slip</a></li>
168
                <li><a id="printcheckinslip" href="#">Print check-in slip</a></li>
169
                [% IF Borrowers.HasOverdues( borrowernumber ) %]
169
                [% IF Borrowers.HasOverdues( borrowernumber ) %]
170
                    <li><a id="print_overdues" href="#">Print overdues</a></li>
170
                    <li><a id="print_overdues" href="#">Print overdues</a></li>
171
                [% END %]
171
                [% END %]
(-)a/t/db_dependent/Members/IssueSlip.t (-2 / +97 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 3;
5
use Test::More tests => 4;
6
use Test::MockModule;
6
use Test::MockModule;
7
7
8
use C4::Biblio;
8
use C4::Biblio;
Lines 74-79 $dbh->do(q| Link Here
74
    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')
74
    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')
75
|, {}, $quick_slip_content);
75
|, {}, $quick_slip_content);
76
76
77
my $checkin_slip_content = <<EOS;
78
Checked in today:
79
<checkedin>
80
Title: <<biblio.title>>
81
Barcode: <<items.barcode>>
82
</checkedin>
83
EOS
84
85
$dbh->do(q|
86
    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')
87
|, {}, $checkin_slip_content);
88
77
my ( $title1, $title2 ) = ( 'My title 1', 'My title 2' );
89
my ( $title1, $title2 ) = ( 'My title 1', 'My title 2' );
78
my ( $barcode1, $barcode2 ) = ('BC0101', 'BC0202' );
90
my ( $barcode1, $barcode2 ) = ('BC0101', 'BC0202' );
79
my $record = MARC::Record->new;
91
my $record = MARC::Record->new;
Lines 108-113 $module->mock( 'userenv', sub { { branch => $branchcode } } ); Link Here
108
my $today = dt_from_string;
120
my $today = dt_from_string;
109
my $yesterday = dt_from_string->subtract_duration( DateTime::Duration->new( days => 1 ) );
121
my $yesterday = dt_from_string->subtract_duration( DateTime::Duration->new( days => 1 ) );
110
122
123
subtest 'Check-in slip' => sub {
124
    plan tests => 2;
125
126
    subtest 'Empty slip' => sub {
127
        plan tests => 1;
128
129
        my $today_daily = $today->clone->set( hour => 23, minute => 59 );
130
        my ( $date_due, $issue_date );
131
        $date_due = $today_daily;
132
        $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) );
133
        AddIssue( $borrower, $barcode1, $date_due, undef, $issue_date );
134
135
        my $slip = CheckInSlip($borrowernumber, $branchcode );
136
        my $empty_slip = <<EOS;
137
Checked in today:
138
139
EOS
140
        is( $slip->{content}, $empty_slip, 'No checked in returns an empty slip' );
141
        
142
        AddReturn( $barcode1, $branchcode );
143
    };
144
145
    subtest 'Daily returns' => sub {
146
        plan tests => 3;
147
        my $slip = CheckInSlip($borrowernumber, $branchcode );
148
        my $expected_slip = <<EOS;
149
Checked in today:
150
151
Title: $title1
152
Barcode: $barcode1
153
154
EOS
155
        is( $slip->{content}, $expected_slip, 'CheckInSlip should return a slip with one check-in' );
156
        
157
        my $today_daily = $today->clone->set( hour => 23, minute => 59 );
158
        my ( $date_due, $issue_date );
159
        $date_due = $today_daily;
160
        $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) );
161
        AddIssue( $borrower, $barcode1, $date_due, undef, $issue_date );
162
        AddReturn( $barcode1, $branchcode );
163
        
164
        my $slip = CheckInSlip($borrowernumber, $branchcode );
165
        my $expected_slip = <<EOS;
166
Checked in today:
167
168
Title: $title1
169
Barcode: $barcode1
170
171
172
Title: $title1
173
Barcode: $barcode1
174
175
EOS
176
        is( $slip->{content}, $expected_slip, 'CheckInSlip should return a slip with 2 same check-in' );
177
178
        my $today_daily = $today->clone->set( hour => 01, minute => 59 );
179
        my ( $date_due, $issue_date );
180
        $date_due = $today_daily;
181
        $issue_date = $today_daily->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) );
182
        AddIssue( $borrower, $barcode2, $date_due, undef, $issue_date );
183
        AddReturn( $barcode2, $branchcode );
184
        
185
        my $slip = CheckInSlip($borrowernumber, $branchcode );
186
        my $expected_slip = <<EOS;
187
Checked in today:
188
189
Title: $title1
190
Barcode: $barcode1
191
192
193
Title: $title1
194
Barcode: $barcode1
195
196
197
Title: $title2
198
Barcode: $barcode2
199
200
EOS
201
        is( $slip->{content}, $expected_slip, 'CheckInSlip should return a slip with 3 check-in' );
202
203
    };
204
    
205
};
206
111
subtest 'Issue slip' => sub {
207
subtest 'Issue slip' => sub {
112
    plan tests => 3;
208
    plan tests => 3;
113
209
114
- 

Return to bug 12224