|
Lines 3372-3390
sub GetIssuingCharges {
Link Here
|
| 3372 |
if ( my $item_data = $sth->fetchrow_hashref ) { |
3372 |
if ( my $item_data = $sth->fetchrow_hashref ) { |
| 3373 |
$item_type = $item_data->{itemtype}; |
3373 |
$item_type = $item_data->{itemtype}; |
| 3374 |
$charge = $item_data->{rentalcharge}; |
3374 |
$charge = $item_data->{rentalcharge}; |
| 3375 |
# FIXME This should follow CircControl |
|
|
| 3376 |
my $branch = C4::Context::mybranch(); |
| 3377 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
| 3378 |
my $discount = Koha::CirculationRules->get_effective_rule({ |
| 3379 |
categorycode => $patron->categorycode, |
| 3380 |
branchcode => $branch, |
| 3381 |
itemtype => $item_type, |
| 3382 |
rule_name => 'rentaldiscount' |
| 3383 |
}); |
| 3384 |
if ($discount) { |
| 3385 |
$charge = ( $charge * ( 100 - $discount->rule_value ) ) / 100; |
| 3386 |
} |
| 3387 |
if ($charge) { |
3375 |
if ($charge) { |
|
|
3376 |
# FIXME This should follow CircControl |
| 3377 |
my $branch = C4::Context::mybranch(); |
| 3378 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
| 3379 |
my $discount = Koha::CirculationRules->get_effective_rule({ |
| 3380 |
categorycode => $patron->categorycode, |
| 3381 |
branchcode => $branch, |
| 3382 |
itemtype => $item_type, |
| 3383 |
rule_name => 'rentaldiscount' |
| 3384 |
}); |
| 3385 |
if ($discount) { |
| 3386 |
$charge = ( $charge * ( 100 - $discount->rule_value ) ) / 100; |
| 3387 |
} |
| 3388 |
$charge = sprintf '%.2f', $charge; # ensure no fractions of a penny returned |
3388 |
$charge = sprintf '%.2f', $charge; # ensure no fractions of a penny returned |
| 3389 |
} |
3389 |
} |
| 3390 |
} |
3390 |
} |