[Koha] Where to set exemption from rental charges

Chris Cormack chris at bigballofwax.co.nz
Sun Dec 14 14:38:09 NZDT 2008


On Sun, Dec 14, 2008 at 2:19 PM, Joe Atzberger <ohiocore at gmail.com> wrote:
> All --
>
> If this were a question about overdue fines, there would be nothing
> preventing this kind of rule from being expressed in the current structure
> under "Circulation and fines rules", as Lino suggests.  But Joann is not
> asking about an overdue fine.  She is talking about a rental charge,
> specified under "Item types and circulation codes".  The itemtype logic does
> not break out into pieces like the circ/fine rules.
>
> The idea of a percent discount is the part that does not exist in any
> version of Koha that I have seen.  It would add a level of complexity
> inasmuch as the logic has to retrieve and synthesize two rules to get the
> correct result.  But Jesse is correct that % off rental charge could be
> implemented as a single additional field.  This %-off other overdue fine
> would be more complicated I think.
>
Ahh you must have missed seeing some versions of Koha then Joe :)

The rentaldiscount column in categoryitem was used exactly for this purpose.

my $q2 = "select rentaldiscount from borrowers,categoryitem
        where (borrowers.borrowernumber = '$bornum')
        and (borrowers.categorycode = categoryitem.categorycode)
        and (categoryitem.itemtype = '$item_type')";
     my $sth2=$dbh->prepare($q2);
     $sth2->execute;
     if (my $data2=$sth2->fetchrow_hashref) {
        my $discount = $data2->{'rentaldiscount'};
        $charge = ($charge *(100 - $discount)) / 100;

This snippet is from calc_charges in C4::Circulation::Issue, which is
called by issueitem, in the same module. And was still there until at
least 2003-12-08.

Grepping my current git repo, GetIssuingCharges in C4::Circulation
still checks this column

 my $q2 = "SELECT rentaldiscount FROM borrowers
            LEFT JOIN issuingrules ON borrowers.categorycode =
issuingrules.categorycode
            WHERE borrowers.borrowernumber = ?
            AND issuingrules.itemtype = ?";
        my $sth2 = $dbh->prepare($q2);
        $sth2->execute( $borrowernumber, $item_type );
        if ( my $data2 = $sth2->fetchrow_hashref ) {
            my $discount = $data2->{'rentaldiscount'};
            if ( $discount eq 'NULL' ) {
                $discount = 0;
            }
            $charge = ( $charge * ( 100 - $discount ) ) / 100;
        }

So all that may be missing is the interface to edit/add data to this column

Chris


More information about the Koha mailing list