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

(-)a/C4/Members.pm (+66 lines)
Lines 104-109 BEGIN { Link Here
104
        &GetMessagesCount
104
        &GetMessagesCount
105
105
106
        &IssueSlip
106
        &IssueSlip
107
        &CheckInSlip
107
        GetBorrowersWithEmail
108
        GetBorrowersWithEmail
108
109
109
        HasOverdues
110
        HasOverdues
Lines 2432-2437 sub IssueSlip { Link Here
2432
    );
2433
    );
2433
}
2434
}
2434
2435
2436
=head2 GetTodaysReturnsForBorrower
2437
2438
    $returns = GetTodaysReturnsForBorrower($borrowernumber, $branch);
2439
2440
Return a list of items borrower has checked-in today in branch.
2441
2442
=cut
2443
2444
sub GetTodaysReturnsForBorrower {
2445
    my ($borrowernumber, $branch) = @_;
2446
    my $dbh  = C4::Context->dbh;
2447
    my $date = POSIX::strftime("%Y-%m-%d",localtime());
2448
2449
    my $query = "
2450
       SELECT itemnumber
2451
       FROM old_issues
2452
       WHERE DATE(returndate) = ?
2453
         AND borrowernumber = ?
2454
         AND branchcode = ?
2455
    ";
2456
2457
    my $sth = $dbh->prepare($query);
2458
    $sth->execute($date, $borrowernumber, $branch);
2459
    my @results;
2460
2461
    while ( my $data = $sth->fetchrow_hashref ) {
2462
        my $bibdata = GetBiblioFromItemNumber($data->{itemnumber});
2463
        push @results, $bibdata;
2464
    }
2465
    return \@results;
2466
}
2467
2468
=head2 CheckInSlip
2469
2470
    $letter = CheckInSlip($borrowernumber, $branch [, $message_transport_type ] );
2471
2472
Returns the prepared letter data for items patron checked-in today in branch.
2473
message_transport_type defaults to 'print'.
2474
2475
=cut
2476
2477
sub CheckInSlip {
2478
    my ($borrowernumber, $branch, $mtt) = @_;
2479
    my $issues = GetTodaysReturnsForBorrower($borrowernumber, $branch);
2480
    my %repeat = (
2481
            'checkedin' => [ map {
2482
                'biblio' => $_,
2483
                'items'  => $_,
2484
                'issues' => $_,
2485
            }, @$issues ],
2486
        );
2487
2488
    return  C4::Letters::GetPreparedLetter (
2489
        module => 'circulation',
2490
        letter_code => 'CHECKINSLIP',
2491
        branchcode => $branch,
2492
        tables => {
2493
            'branches'    => $branch,
2494
            'borrowers'   => $borrowernumber,
2495
        },
2496
        repeat => \%repeat,
2497
        message_transport_type => $mtt || 'print',
2498
    );
2499
}
2500
2435
=head2 GetBorrowersWithEmail
2501
=head2 GetBorrowersWithEmail
2436
2502
2437
    ([$borrnum,$userid], ...) = GetBorrowersWithEmail('me@example.com');
2503
    ([$borrnum,$userid], ...) = GetBorrowersWithEmail('me@example.com');
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (+12 lines)
Lines 155-157 Your library.' Link Here
155
155
156
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
156
INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
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
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>
161
<<branches.branchname>>, <<today>><br>
162
You returned these items today:
163
<ul>
164
<checkedin>
165
<li><<biblio.author>>: <<biblio.title>><br>
166
Barcode: <<items.barcode>><br>
167
</checkedin>
168
</ul>', 'print'
169
);
(-)a/installer/data/mysql/updatedatabase.pl (+18 lines)
Lines 10761-10766 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
10764
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
10782
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
10765
# SEE bug 13068
10783
# SEE bug 13068
10766
# if there is anything in the atomicupdate, read and execute it.
10784
# if there is anything in the atomicupdate, read and execute it.
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (+6 lines)
Lines 58-63 $(document).ready(function(){ Link Here
58
        $(".btn-group").removeClass("open");
58
        $(".btn-group").removeClass("open");
59
        return false;
59
        return false;
60
    });
60
    });
61
    $("#printcheckinslip").click(function(){
62
        printx_window("checkinslip");
63
        $(".btn-group").removeClass("open");
64
        return false;
65
    });
61
    $("#searchtohold").click(function(){
66
    $("#searchtohold").click(function(){
62
        searchToHold();
67
        searchToHold();
63
        return false;
68
        return false;
Lines 154-159 function searchToHold(){ Link Here
154
                [% 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 %]
155
                <li><a id="printslip" href="#">Print slip</a></li>
160
                <li><a id="printslip" href="#">Print slip</a></li>
156
                <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>
157
            </ul>
163
            </ul>
158
    </div>
164
    </div>
159
    <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/members/printslip.pl (-2 / +6 lines)
Lines 76-82 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
76
my $borrowernumber = $input->param('borrowernumber');
76
my $borrowernumber = $input->param('borrowernumber');
77
my $branch=C4::Context->userenv->{'branch'};
77
my $branch=C4::Context->userenv->{'branch'};
78
my ($slip, $is_html);
78
my ($slip, $is_html);
79
if (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) {
79
if ($print eq 'checkinslip') {
80
    if (my $letter = CheckInSlip($borrowernumber, $session->param('branch') || $branch)) {
81
        $slip = $letter->{content};
82
        $is_html = $letter->{is_html};
83
    }
84
} elsif (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) {
80
    $slip = $letter->{content};
85
    $slip = $letter->{content};
81
    $is_html = $letter->{is_html};
86
    $is_html = $letter->{is_html};
82
}
87
}
83
- 

Return to bug 12224