Bug 8682 - Renewals do not appear on quick slips
[koha.git] / C4 / Members.pm
index f1136c2..8042840 100644 (file)
@@ -1169,20 +1169,20 @@ Charges exempt from non-issue are:
 
 =cut
 
-my $ACCOUNT_TYPE_LENGTH = 5; # this is plain ridiculous...
-
-my @not_fines = ('Res');
-push @not_fines, 'Rent' unless C4::Context->preference('RentalsInNoissuesCharge');
-unless ( C4::Context->preference('ManInvInNoissuesCharge') ) {
-    my $dbh = C4::Context->dbh;
-    my $man_inv_types = $dbh->selectcol_arrayref(qq{SELECT authorised_value FROM authorised_values WHERE category = 'MANUAL_INV'});
-    push @not_fines, map substr($_, 0, $ACCOUNT_TYPE_LENGTH), @$man_inv_types;
-}
-my %not_fine = map {$_ => 1} @not_fines;
-
 sub GetMemberAccountBalance {
     my ($borrowernumber) = @_;
 
+    my $ACCOUNT_TYPE_LENGTH = 5; # this is plain ridiculous...
+
+    my @not_fines = ('Res');
+    push @not_fines, 'Rent' unless C4::Context->preference('RentalsInNoissuesCharge');
+    unless ( C4::Context->preference('ManInvInNoissuesCharge') ) {
+        my $dbh = C4::Context->dbh;
+        my $man_inv_types = $dbh->selectcol_arrayref(qq{SELECT authorised_value FROM authorised_values WHERE category = 'MANUAL_INV'});
+        push @not_fines, map substr($_, 0, $ACCOUNT_TYPE_LENGTH), @$man_inv_types;
+    }
+    my %not_fine = map {$_ => 1} @not_fines;
+
     my ($total, $acctlines) = GetMemberAccountRecords($borrowernumber);
     my $other_charges = 0;
     foreach (@$acctlines) {
@@ -2356,7 +2356,7 @@ sub IssueSlip {
 
     my $issueslist = GetPendingIssues($borrowernumber);
     foreach my $it (@$issueslist){
-        if ((substr $it->{'issuedate'}, 0, 10) eq $now) {
+        if ((substr $it->{'issuedate'}, 0, 10) eq $now || (substr $it->{'lastreneweddate'}, 0, 10) eq $now) {
             $it->{'now'} = 1;
         }
         elsif ((substr $it->{'date_due'}, 0, 10) le $now) {