{
borrowernumber => $patron->{borrowernumber},
itemnumber => $item->itemnumber,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => 10,
interface => 'commandline',
})->store;
my $debit_1 = Koha::Account::Line->new(
{ borrowernumber => $patron->id,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => 10,
amountoutstanding => 10,
interface => 'commandline',
my $debit_2 = Koha::Account::Line->new(
{ borrowernumber => $patron->id,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => 10,
amountoutstanding => 10,
interface => 'commandline',
my $credit_1 = Koha::Account::Line->new(
{ borrowernumber => $patron->id,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => -10,
amountoutstanding => -10,
interface => 'commandline',
my $credit_2 = Koha::Account::Line->new(
{ borrowernumber => $patron->id,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => -10,
amountoutstanding => -10,
interface => 'commandline',
my $credit_3 = Koha::Account::Line->new(
{ borrowernumber => $patron->id,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => -100,
amountoutstanding => -100,
interface => 'commandline',
my $debit = Koha::Account::Line->new(
{
borrowernumber => $patron->id,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => 10,
interface => 'commandline',
})->store;
my $debit_1 = Koha::Account::Line->new(
{ borrowernumber => $patron->id,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => 10,
amountoutstanding => 10,
interface => 'commandline',
my $debit_2 = Koha::Account::Line->new(
{ borrowernumber => $patron->id,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => 100,
amountoutstanding => 100,
interface => 'commandline',
my $credit_2 = $account->add_credit({ amount => 20, interface => 'commandline' });
my $debit_3 = Koha::Account::Line->new(
{ borrowernumber => $patron->id,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => 100,
amountoutstanding => 100,
interface => 'commandline',
borrowernumber => $patron->borrowernumber,
manager_id => $staff->borrowernumber,
itemnumber => $item->itemnumber,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => 10,
interface => 'commandline',
})->store;
my $debit_1 = Koha::Account::Line->new(
{ borrowernumber => $patron->id,
- accounttype => "F",
+ accounttype => "OVERDUE",
+ status => "RETURNED",
amount => 10,
amountoutstanding => 10,
interface => 'commandline',
my $debit_2 = Koha::Account::Line->new(
{ borrowernumber => $patron->id,
- accounttype => "FU",
+ accounttype => "OVERDUE",
+ status => "UNRETURNED",
amount => 100,
amountoutstanding => 100,
interface => 'commandline'
throws_ok { $debit_1->adjust( { amount => 50, type => 'bad', interface => 'commandline' } ) }
qr/Update type not recognised/, 'Exception thrown for unrecognised type';
- throws_ok { $debit_1->adjust( { amount => 50, type => 'fine_update', interface => 'commandline' } ) }
+ throws_ok { $debit_1->adjust( { amount => 50, type => 'overdue_update', interface => 'commandline' } ) }
qr/Update type not allowed on this accounttype/,
'Exception thrown for type conflict';
# Increment an unpaid fine
- $debit_2->adjust( { amount => 150, type => 'fine_update', interface => 'commandline' } )->discard_changes;
+ $debit_2->adjust( { amount => 150, type => 'overdue_update', interface => 'commandline' } )->discard_changes;
is( $debit_2->amount * 1, 150, 'Fine amount was updated in full' );
is( $debit_2->amountoutstanding * 1, 150, 'Fine amountoutstanding was update in full' );
is( $offsets->count, 1, 'An offset is generated for the increment' );
my $THIS_offset = $offsets->next;
is( $THIS_offset->amount * 1, 50, 'Amount was calculated correctly (increment by 50)' );
- is( $THIS_offset->type, 'fine_increase', 'Adjust type stored correctly' );
+ is( $THIS_offset->type, 'OVERDUE_INCREASE', 'Adjust type stored correctly' );
is( $schema->resultset('ActionLog')->count(), $action_logs + 0, 'No log was added' );
t::lib::Mocks::mock_preference( 'FinesLog', 1 );
# Increment the partially paid fine
- $debit_2->adjust( { amount => 160, type => 'fine_update', interface => 'commandline' } )->discard_changes;
+ $debit_2->adjust( { amount => 160, type => 'overdue_update', interface => 'commandline' } )->discard_changes;
is( $debit_2->amount * 1, 160, 'Fine amount was updated in full' );
is( $debit_2->amountoutstanding * 1, 120, 'Fine amountoutstanding was updated by difference' );
is( $offsets->count, 3, 'An offset is generated for the increment' );
$THIS_offset = $offsets->last;
is( $THIS_offset->amount * 1, 10, 'Amount was calculated correctly (increment by 10)' );
- is( $THIS_offset->type, 'fine_increase', 'Adjust type stored correctly' );
+ is( $THIS_offset->type, 'OVERDUE_INCREASE', 'Adjust type stored correctly' );
is( $schema->resultset('ActionLog')->count(), $action_logs + 1, 'Log was added' );
# Decrement the partially paid fine, less than what was paid
- $debit_2->adjust( { amount => 50, type => 'fine_update', interface => 'commandline' } )->discard_changes;
+ $debit_2->adjust( { amount => 50, type => 'overdue_update', interface => 'commandline' } )->discard_changes;
is( $debit_2->amount * 1, 50, 'Fine amount was updated in full' );
is( $debit_2->amountoutstanding * 1, 10, 'Fine amountoutstanding was updated by difference' );
is( $offsets->count, 4, 'An offset is generated for the decrement' );
$THIS_offset = $offsets->last;
is( $THIS_offset->amount * 1, -110, 'Amount was calculated correctly (decrement by 110)' );
- is( $THIS_offset->type, 'fine_decrease', 'Adjust type stored correctly' );
+ is( $THIS_offset->type, 'OVERDUE_DECREASE', 'Adjust type stored correctly' );
# Decrement the partially paid fine, more than what was paid
- $debit_2->adjust( { amount => 30, type => 'fine_update', interface => 'commandline' } )->discard_changes;
+ $debit_2->adjust( { amount => 30, type => 'overdue_update', interface => 'commandline' } )->discard_changes;
is( $debit_2->amount * 1, 30, 'Fine amount was updated in full' );
is( $debit_2->amountoutstanding * 1, 0, 'Fine amountoutstanding was zeroed (payment was 40)' );
is( $offsets->count, 5, 'An offset is generated for the decrement' );
$THIS_offset = $offsets->last;
is( $THIS_offset->amount * 1, -20, 'Amount was calculated correctly (decrement by 20)' );
- is( $THIS_offset->type, 'fine_decrease', 'Adjust type stored correctly' );
+ is( $THIS_offset->type, 'OVERDUE_DECREASE', 'Adjust type stored correctly' );
my $overpayment_refund = $account->lines->last;
is( $overpayment_refund->amount * 1, -10, 'A new credit has been added' );
interface => 'commandline',
item_id => $item->itemnumber,
issue_id => $checkout->issue_id,
- type => 'fine',
+ type => 'overdue',
});
my $line_checkout = $line->checkout;