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

(-)a/C4/Circulation.pm (-4 / +4 lines)
Lines 714-720 sub CanBookBeIssued { Link Here
714
    #
714
    #
715
    if ( $borrower->{'category_type'} eq 'X' && (  $item->{barcode}  )) { 
715
    if ( $borrower->{'category_type'} eq 'X' && (  $item->{barcode}  )) { 
716
    	# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
716
    	# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
717
        &UpdateStats(C4::Context->userenv->{'branch'},'localuse','','',$item->{'itemnumber'},$item->{'itemtype'},$borrower->{'borrowernumber'});
717
        &UpdateStats(C4::Context->userenv->{'branch'},'localuse','','',$item->{'itemnumber'},$item->{'itemtype'},$borrower->{'borrowernumber'}, undef, $item->{'ccode'});
718
        ModDateLastSeen( $item->{'itemnumber'} );
718
        ModDateLastSeen( $item->{'itemnumber'} );
719
        return( { STATS => 1 }, {});
719
        return( { STATS => 1 }, {});
720
    }
720
    }
Lines 1095-1101 sub AddIssue { Link Here
1095
            C4::Context->userenv->{'branch'},
1095
            C4::Context->userenv->{'branch'},
1096
            'issue', $charge,
1096
            'issue', $charge,
1097
            ($sipmode ? "SIP-$sipmode" : ''), $item->{'itemnumber'},
1097
            ($sipmode ? "SIP-$sipmode" : ''), $item->{'itemnumber'},
1098
            $item->{'itype'}, $borrower->{'borrowernumber'}
1098
            $item->{'itype'}, $borrower->{'borrowernumber'}, undef, $item->{'ccode'}
1099
        );
1099
        );
1100
1100
1101
        # Send a checkout slip.
1101
        # Send a checkout slip.
Lines 1694-1700 sub AddReturn { Link Here
1694
        $branch, $stat_type, '0', '',
1694
        $branch, $stat_type, '0', '',
1695
        $item->{'itemnumber'},
1695
        $item->{'itemnumber'},
1696
        $biblio->{'itemtype'},
1696
        $biblio->{'itemtype'},
1697
        $borrowernumber
1697
        $borrowernumber, undef, $item->{'ccode'}
1698
    );
1698
    );
1699
1699
1700
    # Send a check-in slip. # NOTE: borrower may be undef.  probably shouldn't try to send messages then.
1700
    # Send a check-in slip. # NOTE: borrower may be undef.  probably shouldn't try to send messages then.
Lines 2419-2425 sub AddRenewal { Link Here
2419
            'Rent', $charge, $itemnumber );
2419
            'Rent', $charge, $itemnumber );
2420
    }
2420
    }
2421
    # Log the renewal
2421
    # Log the renewal
2422
    UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber);
2422
    UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber, undef, $item->{'ccode'});
2423
	return $datedue;
2423
	return $datedue;
2424
}
2424
}
2425
2425
(-)a/C4/Stats.pm (-5 / +4 lines)
Lines 76-95 sub UpdateStats { Link Here
76
    my (
76
    my (
77
        $branch,         $type,
77
        $branch,         $type,
78
        $amount,   $other,          $itemnum,
78
        $amount,   $other,          $itemnum,
79
        $itemtype, $borrowernumber, $accountno
79
        $itemtype, $borrowernumber, $accountno, $ccode
80
      )
80
      )
81
      = @_;
81
      = @_;
82
    my $dbh = C4::Context->dbh;
82
    my $dbh = C4::Context->dbh;
83
    my $sth = $dbh->prepare(
83
    my $sth = $dbh->prepare(
84
        "INSERT INTO statistics
84
        "INSERT INTO statistics
85
        (datetime, branch, type, value,
85
        (datetime, branch, type, value,
86
         other, itemnumber, itemtype, borrowernumber, proccode)
86
         other, itemnumber, itemtype, borrowernumber, proccode, ccode)
87
         VALUES (now(),?,?,?,?,?,?,?,?)"
87
         VALUES (now(),?,?,?,?,?,?,?,?,?)"
88
    );
88
    );
89
    $sth->execute(
89
    $sth->execute(
90
        $branch,    $type,    $amount,
90
        $branch,    $type,    $amount,
91
        $other,     $itemnum, $itemtype, $borrowernumber,
91
        $other,     $itemnum, $itemtype, $borrowernumber,
92
		$accountno
92
		$accountno, $ccode
93
    );
93
    );
94
}
94
}
95
95
96
- 

Return to bug 4118