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

(-)a/C4/Circulation.pm (-29 / +11 lines)
Lines 3226-3261 sub AddIssuingCharge { Link Here
3226
3226
3227
    # FIXME What if checkout does not exist?
3227
    # FIXME What if checkout does not exist?
3228
3228
3229
    my $nextaccntno = C4::Accounts::getnextacctno( $checkout->borrowernumber );
3229
    my $account = Koha::Account->new({ patron_id => $checkout->borrowernumber });
3230
3230
    my $accountline = $account->add_debit(
3231
    my $manager_id  = 0;
3232
    $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
3233
3234
    my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
3235
3236
    my $accountline = Koha::Account::Line->new(
3237
        {
3231
        {
3238
            borrowernumber    => $checkout->borrowernumber,
3232
            amount      => $charge,
3239
            itemnumber        => $checkout->itemnumber,
3233
            description => 'Rental',
3240
            issue_id          => $checkout->issue_id,
3234
            note        => undef,
3241
            accountno         => $nextaccntno,
3235
            user_id     => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0,
3242
            amount            => $charge,
3236
            library_id  => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
3243
            amountoutstanding => $charge,
3237
            type        => 'rent',
3244
            manager_id        => $manager_id,
3238
            item_id     => $checkout->itemnumber,
3245
            branchcode        => $branchcode,
3239
            issue_id    => $checkout->issue_id,
3246
            description       => 'Rental',
3247
            accounttype       => 'Rent',
3248
            date              => \'NOW()',
3249
        }
3240
        }
3250
    )->store();
3241
    );
3251
3252
    Koha::Account::Offset->new(
3253
        {
3254
            debit_id => $accountline->id,
3255
            type     => 'Rental Fee',
3256
            amount   => $charge,
3257
        }
3258
    )->store();
3259
}
3242
}
3260
3243
3261
=head2 GetTransfers
3244
=head2 GetTransfers
3262
- 

Return to bug 21720