|
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 |