# If it costs to borrow this book, charge it to the patron's account.
my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} );
if ( $charge > 0 ) {
- my $description = "Rental";
- AddIssuingCharge( $issue, $charge, $description );
+ AddIssuingCharge( $issue, $charge, 'rent' );
}
my $itemtype_object = Koha::ItemTypes->find( $item_object->effective_itemtype );
if ( $itemtype_object ) {
my $accumulate_charge = $fees->accumulate_rentalcharge();
if ( $accumulate_charge > 0 ) {
- AddIssuingCharge( $issue, $accumulate_charge, 'Daily rental' ) if $accumulate_charge > 0;
+ AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily' ) if $accumulate_charge > 0;
$charge += $accumulate_charge;
$item_unblessed->{charge} = $charge;
}
# Charge a new rental fee, if applicable
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
if ( $charge > 0 ) {
- my $description = "Renewal of Rental Item " . $biblio->title . " " .$item_object->barcode;
- AddIssuingCharge($issue, $charge, $description);
+ AddIssuingCharge($issue, $charge, 'rent_renew');
}
# Charge a new accumulate rental fee, if applicable
if ( $itemtype_object ) {
my $accumulate_charge = $fees->accumulate_rentalcharge();
if ( $accumulate_charge > 0 ) {
- my $type_desc = "Renewal of Daily Rental Item " . $biblio->title . " $item_unblessed->{'barcode'}";
- AddIssuingCharge( $issue, $accumulate_charge, $type_desc )
+ AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily_renew' )
}
$charge += $accumulate_charge;
}
=head2 AddIssuingCharge
- &AddIssuingCharge( $checkout, $charge, [$description] )
+ &AddIssuingCharge( $checkout, $charge, $type )
=cut
sub AddIssuingCharge {
- my ( $checkout, $charge, $description ) = @_;
+ my ( $checkout, $charge, $type ) = @_;
# FIXME What if checkout does not exist?
my $accountline = $account->add_debit(
{
amount => $charge,
- description => $description,
note => undef,
user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
interface => C4::Context->interface,
- type => 'rent',
+ type => $type,
item_id => $checkout->itemnumber,
issue_id => $checkout->issue_id,
}
- sundry
- processing
- rent
+ - rent_daily
+ - rent_renewal
+ - rent_daily_renewal
- reserve
- manual
'processing' => 'Processing Fee',
'lost_item' => 'Lost Item',
'rent' => 'Rental Fee',
+ 'rent_daily' => 'Rental Fee',
+ 'rent_renew' => 'Rental Fee',
+ 'rent_daily_renew' => 'Rental Fee',
'overdue' => 'OVERDUE',
'manual_debit' => 'Manual Debit',
'hold_expired' => 'Hold Expired'
=cut
our $account_type_debit = {
- 'account' => 'A',
- 'overdue' => 'OVERDUE',
- 'lost_item' => 'LOST',
- 'new_card' => 'N',
- 'sundry' => 'M',
- 'processing' => 'PF',
- 'rent' => 'Rent',
- 'reserve' => 'Res',
- 'manual_debit' => 'M',
- 'hold_expired' => 'HE'
+ 'account' => 'A',
+ 'overdue' => 'OVERDUE',
+ 'lost_item' => 'LOST',
+ 'new_card' => 'N',
+ 'sundry' => 'M',
+ 'processing' => 'PF',
+ 'rent' => 'RENT',
+ 'rent_daily' => 'RENT_DAILY',
+ 'rent_renew' => 'RENT_RENEW',
+ 'rent_daily_renew' => 'RENT_DAILY_RENEW',
+ 'reserve' => 'Res',
+ 'manual_debit' => 'M',
+ 'hold_expired' => 'HE'
};
=head1 AUTHORS
[%- BLOCK account_type_description -%]
[%- SWITCH account.accounttype -%]
- [%- CASE 'Pay' -%]<span>Payment
- [%- CASE 'Pay00' -%]<span>Payment (cash via SIP2)
- [%- CASE 'Pay01' -%]<span>Payment (VISA via SIP2)
- [%- CASE 'Pay02' -%]<span>Payment (credit card via SIP2)
- [%- CASE 'N' -%]<span>New card
- [%- CASE 'OVERDUE' -%]<span>Fine
- [%- CASE 'A' -%]<span>Account management fee
- [%- CASE 'M' -%]<span>Sundry
- [%- CASE 'LOST' -%]<span>Lost item
- [%- CASE 'W' -%]<span>Writeoff
- [%- CASE 'HE' -%]<span>Hold waiting too long
- [%- CASE 'Rent' -%]<span>Rental fee
- [%- CASE 'FOR' -%]<span>Forgiven
- [%- CASE 'PF' -%]<span>Lost item processing fee
- [%- CASE 'PAY' -%]<span>Payment
- [%- CASE 'WO' -%]<span>Writeoff
- [%- CASE 'C' -%]<span>Credit
- [%- CASE 'LOST_RETURN' -%]<span>Lost item fee refund
- [%- CASE 'Res' -%]<span>Hold fee
- [%- CASE -%]<span>[% account.accounttype | html %]
+ [%- CASE 'Pay' -%]<span>Payment
+ [%- CASE 'Pay00' -%]<span>Payment (cash via SIP2)
+ [%- CASE 'Pay01' -%]<span>Payment (VISA via SIP2)
+ [%- CASE 'Pay02' -%]<span>Payment (credit card via SIP2)
+ [%- CASE 'N' -%]<span>New card
+ [%- CASE 'OVERDUE' -%]<span>Fine
+ [%- CASE 'A' -%]<span>Account management fee
+ [%- CASE 'M' -%]<span>Sundry
+ [%- CASE 'LOST' -%]<span>Lost item
+ [%- CASE 'W' -%]<span>Writeoff
+ [%- CASE 'HE' -%]<span>Hold waiting too long
+ [%- CASE 'RENT' -%]<span>Rental fee
+ [%- CASE 'RENT_DAILY' -%]<span>Daily rental fee
+ [%- CASE 'RENT_RENEW' -%]<span>Renewal of rental item
+ [%- CASE 'RENT_DAILY_RENEW' -%]<span>Rewewal of daily rental item
+ [%- CASE 'FOR' -%]<span>Forgiven
+ [%- CASE 'PF' -%]<span>Lost item processing fee
+ [%- CASE 'PAY' -%]<span>Payment
+ [%- CASE 'WO' -%]<span>Writeoff
+ [%- CASE 'C' -%]<span>Credit
+ [%- CASE 'LOST_RETURN' -%]<span>Lost item fee refund
+ [%- CASE 'Res' -%]<span>Hold fee
+ [%- CASE -%][% account.accounttype | html %]
[%- END -%]
[%- PROCESS account_status_description account=account -%]</span>
[%- END -%]
[%- BLOCK account_type_description -%]
[%- SWITCH account.accounttype -%]
- [%- CASE 'Pay' -%]<span>Payment
- [%- CASE 'Pay00' -%]<span>Payment (cash via SIP2)
- [%- CASE 'Pay01' -%]<span>Payment (VISA via SIP2)
- [%- CASE 'Pay02' -%]<span>Payment (credit card via SIP2)
- [%- CASE 'N' -%]<span>New card
- [%- CASE 'OVERDUE' -%]<span>Fine
- [%- CASE 'A' -%]<span>Account management fee
- [%- CASE 'M' -%]<span>Sundry
- [%- CASE 'LOST' -%]<span>Lost item
- [%- CASE 'W' -%]<span>Writeoff
- [%- CASE 'HE' -%]<span>Hold waiting too long
- [%- CASE 'Rent' -%]<span>Rental fee
- [%- CASE 'FOR' -%]<span>Forgiven
- [%- CASE 'LR' -%]<span>Lost item fee refund
- [%- CASE 'PF' -%]<span>Lost item processing fee
- [%- CASE 'PAY' -%]<span>Payment
- [%- CASE 'WO' -%]<span>Writeoff
- [%- CASE 'C' -%]<span>Credit
- [%- CASE 'CR' -%]<span>Credit
- [%- CASE 'Res' -%]<span>Hold fee
- [%- CASE -%]<span>[% account.accounttype | html %]
+ [%- CASE 'Pay' -%]<span>Payment
+ [%- CASE 'Pay00' -%]<span>Payment (cash via SIP2)
+ [%- CASE 'Pay01' -%]<span>Payment (VISA via SIP2)
+ [%- CASE 'Pay02' -%]<span>Payment (credit card via SIP2)
+ [%- CASE 'VOID' -%]<span>Voided
+ [%- CASE 'N' -%]<span>New card
+ [%- CASE 'OVERDUE' -%]<span>Fine
+ [%- CASE 'A' -%]<span>Account management fee
+ [%- CASE 'M' -%]<span>Sundry
+ [%- CASE 'LOST' -%]<span>Lost item
+ [%- CASE 'W' -%]<span>Writeoff
+ [%- CASE 'HE' -%]<span>Hold waiting too long
+ [%- CASE 'RENT' -%]<span>Rental fee
+ [%- CASE 'RENT_DAILY' -%]<span>Daily rental fee
+ [%- CASE 'RENT_RENEW' -%]<span>Renewal of rental item
+ [%- CASE 'RENT_DAILT_RENEW' -%]<span>Renewal of dailt rental item
+ [%- CASE 'FOR' -%]<span>Forgiven
+ [%- CASE 'PF' -%]<span>Lost item processing fee
+ [%- CASE 'PAY' -%]<span>Payment
+ [%- CASE 'WO' -%]<span>Writeoff
+ [%- CASE 'C' -%]<span>Credit
+ [%- CASE 'LOST_RETURN' -%]<span>Lost item fee refund
+ [%- CASE 'Res' -%]<span>Hold fee
+ [%- CASE -%]<span>[% account.accounttype | html %]
[%- END -%]
[%- PROCESS account_status_description account=account -%]</span>
[%- END -%]