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

(-)a/C4/Members.pm (+70 lines)
Lines 60-65 BEGIN { Link Here
60
        &GetBorrowersToExpunge
60
        &GetBorrowersToExpunge
61
61
62
        &IssueSlip
62
        &IssueSlip
63
        &CheckInSlip
63
    );
64
    );
64
65
65
    #Check data
66
    #Check data
Lines 612-617 sub IssueSlip { Link Here
612
    );
613
    );
613
}
614
}
614
615
616
=head2 GetTodaysReturnsForBorrower
617
618
    $returns = GetTodaysReturnsForBorrower($borrowernumber, $branch);
619
620
Return a list of items borrower has checked-in today in branch.
621
622
=cut
623
624
sub GetTodaysReturnsForBorrower {
625
    my ($borrowernumber, $branch) = @_;
626
    my $dbh  = C4::Context->dbh;
627
    my $date = POSIX::strftime("%Y-%m-%d",localtime());
628
629
    my $query = "
630
       SELECT itemnumber
631
       FROM old_issues
632
       WHERE DATE(returndate) = ?
633
         AND borrowernumber = ?
634
         AND branchcode = ?
635
    ";
636
637
    my $sth = $dbh->prepare($query);
638
    $sth->execute($date, $borrowernumber, $branch);
639
    my @results;
640
641
    while ( my $data = $sth->fetchrow_hashref ) {
642
        my $item =  Koha::Items->find( $data->{itemnumber} );
643
        my $biblio = $item->biblio->unblessed;
644
        my $biblioitem = $item->biblioitem->unblessed;
645
        $item = $item->unblessed; 
646
        my $merged = {%$item, %$biblio, %$biblioitem};
647
        push @results, $merged;
648
    }
649
    return \@results;
650
}
651
652
=head2 CheckInSlip
653
654
    $letter = CheckInSlip($borrowernumber, $branch [, $message_transport_type ] );
655
656
Returns the prepared letter data for items patron checked-in today in branch.
657
message_transport_type defaults to 'print'.
658
659
=cut
660
661
sub CheckInSlip {
662
    my ($borrowernumber, $branch, $mtt) = @_;
663
    my $issues = GetTodaysReturnsForBorrower($borrowernumber, $branch);
664
    my %repeat = (
665
            'checkedin' => [ map {
666
                'biblio' => $_,
667
                'items'  => $_,
668
                'issues' => $_,
669
            }, @$issues ],
670
        );
671
672
    return  C4::Letters::GetPreparedLetter (
673
        module => 'circulation',
674
        letter_code => 'CHECKINSLIP',
675
        branchcode => $branch,
676
        tables => {
677
            'branches'    => $branch,
678
            'borrowers'   => $borrowernumber,
679
        },
680
        repeat => \%repeat,
681
        message_transport_type => $mtt || 'print',
682
    );
683
}
684
615
=head2 DeleteExpiredOpacRegistrations
685
=head2 DeleteExpiredOpacRegistrations
616
686
617
    Delete accounts that haven't been upgraded from the 'temporary' category
687
    Delete accounts that haven't been upgraded from the 'temporary' category
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (+11 lines)
Lines 316-318 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
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
<<branches.branchname>>, <<today>><br>
322
You returned these items today:
323
<ul>
324
<checkedin>
325
<li><<biblio.author>>: <<biblio.title>><br>
326
Barcode: <<items.barcode>><br>
327
</checkedin>
328
</ul>', 'print'
329
);
(-)a/installer/data/mysql/updatedatabase.pl (+18 lines)
Lines 18881-18886 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
18884
# SEE bug 13068
18902
# SEE bug 13068
18885
# if there is anything in the atomicupdate, read and execute it.
18903
# if there is anything in the atomicupdate, read and execute it.
18886
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';
18904
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (+1 lines)
Lines 32-37 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
                [% IF Borrowers.HasOverdues( patron.borrowernumber ) %]
36
                [% IF Borrowers.HasOverdues( patron.borrowernumber ) %]
36
                    <li><a id="print_overdues" href="#">Print overdues</a></li>
37
                    <li><a id="print_overdues" href="#">Print overdues</a></li>
37
                [% END %]
38
                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js (+5 lines)
Lines 66-71 $(document).ready(function(){ Link Here
66
        $(".btn-group").removeClass("open");
66
        $(".btn-group").removeClass("open");
67
        return false;
67
        return false;
68
    });
68
    });
69
    $("#printcheckinslip").click(function(){
70
        printx_window("checkinslip");
71
        $(".btn-group").removeClass("open");
72
        return false;
73
    });
69
    $("#print_overdues").click(function(){
74
    $("#print_overdues").click(function(){
70
        window.open("/cgi-bin/koha/members/print_overdues.pl?borrowernumber=" + borrowernumber, "printwindow");
75
        window.open("/cgi-bin/koha/members/print_overdues.pl?borrowernumber=" + borrowernumber, "printwindow");
71
        $(".btn-group").removeClass("open");
76
        $(".btn-group").removeClass("open");
(-)a/members/printslip.pl (-2 / +6 lines)
Lines 80-86 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log Link Here
80
80
81
my $branch=C4::Context->userenv->{'branch'};
81
my $branch=C4::Context->userenv->{'branch'};
82
my ($slip, $is_html);
82
my ($slip, $is_html);
83
if (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) {
83
if ($print eq 'checkinslip') {
84
    if (my $letter = CheckInSlip($borrowernumber, $session->param('branch') || $branch)) {
85
        $slip = $letter->{content};
86
        $is_html = $letter->{is_html};
87
    }
88
} elsif (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) {
84
    $slip = $letter->{content};
89
    $slip = $letter->{content};
85
    $is_html = $letter->{is_html};
90
    $is_html = $letter->{is_html};
86
}
91
}
87
- 

Return to bug 12224