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 157-169 INSERT INTO letter(module, code, branchcode, name, title, content, message_trans Link Here
157
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
157
VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
158
158
159
INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
159
INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
160
VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<<borrowers.firstname>> <<borrowers.surname>><br>
160
VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<h3><<branches.branchname>></h3>
161
<<branches.branchname>>, <<today>><br>
161
Checked in by <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
162
You returned these items today:
162
(<<borrowers.cardnumber>>) <br />
163
<ul>
163
164
<<today>><br />
165
<h4>Checked In Today</h4>
164
<checkedin>
166
<checkedin>
165
<li><<biblio.author>>: <<biblio.title>><br>
167
<p>
168
<<biblio.title>><br>
166
Barcode: <<items.barcode>><br>
169
Barcode: <<items.barcode>><br>
167
</checkedin>
170
</p>
168
</ul>', 'print'
171
</checkedin>'', 'print'
169
);
172
);
(-)a/installer/data/mysql/updatedatabase.pl (-18 lines)
Lines 10761-10784 if ( CheckVersion($DBversion) ) { Link Here
10761
    SetVersion ($DBversion);
10761
    SetVersion ($DBversion);
10762
}
10762
}
10763
10763
10764
$DBversion = "3.21.00.019";
10765
if ( CheckVersion($DBversion) ) {
10766
    $dbh->do("
10767
INSERT INTO  letter (module, code, branchcode, name, is_html, title, content, message_transport_type)
10768
VALUES ( 'circulation', 'CHECKINSLIP', '', 'Printed check-in slip', '1', 'Items returned today', '<<borrowers.firstname>> <<borrowers.surname>><br>
10769
<<branches.branchname>>, <<today>><br>
10770
You returned these items today:
10771
<ul>
10772
<checkedin>
10773
<li><<biblio.author>>: <<biblio.title>><br>
10774
Barcode: <<items.barcode>><br>
10775
</checkedin>
10776
</ul>', 'print'
10777
);");
10778
    print "Upgrade to $DBversion done (Bug 12224 - Easy printing of patron check-in slip)\n";
10779
    SetVersion($DBversion);
10780
}
10781
10782
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
10764
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
10783
# SEE bug 13068
10765
# SEE bug 13068
10784
# if there is anything in the atomicupdate, read and execute it.
10766
# 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 159-165 function searchToHold(){ Link Here
159
                [% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %]
159
                [% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %]
160
                <li><a id="printslip" href="#">Print slip</a></li>
160
                <li><a id="printslip" href="#">Print slip</a></li>
161
                <li><a id="printquickslip" href="#">Print quick slip</a></li>
161
                <li><a id="printquickslip" href="#">Print quick slip</a></li>
162
                <li><a id="printcheckinslip" href="#">Print checked-in today -slip</a></li>
162
                <li><a id="printcheckinslip" href="#">Print check-in slip</a></li>
163
            </ul>
163
            </ul>
164
    </div>
164
    </div>
165
    <a id="searchtohold" class="btn btn-small" href="#"><i class="icon-search"></i> Search to hold</a>
165
    <a id="searchtohold" class="btn btn-small" href="#"><i class="icon-search"></i> Search to hold</a>
(-)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