Koha/Koha/Exceptions.pm
Martin Renvoize 9bd650f98b
Bug 24080: Add 'payout' method to Koha::Account::Line
This enhancement adds a 'payout' method to Koha::Account::Line which can
be used to 'pay out' a credit to a patron.

When such a credit is 'paid out' this method will create a corresponding
account debit line with an amount equal to the amountoutstanding on the
original credit and the two acocuntlines will be immediately applied against
each other.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-03 16:35:38 +00:00

76 lines
2.7 KiB
Perl

package Koha::Exceptions;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::BadParameter' => {
isa => 'Koha::Exceptions::Exception',
description => 'A bad parameter was given',
fields => ['parameter'],
},
'Koha::Exceptions::DuplicateObject' => {
isa => 'Koha::Exceptions::Exception',
description => 'Same object already exists',
},
'Koha::Exceptions::ObjectNotFound' => {
isa => 'Koha::Exceptions::Exception',
description => 'The required object doesn\'t exist',
},
'Koha::Exceptions::CannotDeleteDefault' => {
isa => 'Koha::Exceptions::Exception',
description => 'The default value cannot be deleted'
},
'Koha::Exceptions::MissingParameter' => {
isa => 'Koha::Exceptions::Exception',
description => 'A required parameter is missing'
},
'Koha::Exceptions::ParameterTooHigh' => {
isa => 'Koha::Exceptions::Exception',
description => 'A passed parameter value is too high'
},
'Koha::Exceptions::NoChanges' => {
isa => 'Koha::Exceptions::Exception',
description => 'No changes were made',
},
'Koha::Exceptions::WrongParameter' => {
isa => 'Koha::Exceptions::Exception',
description => 'One or more parameters are wrong',
},
'Koha::Exceptions::NoPermission' => {
isa => 'Koha::Exceptions::Exception',
description => 'You do not have permission for this action',
},
'Koha::Exceptions::CannotAddLibraryLimit' => {
isa => 'Koha::Exceptions::Exception',
description => 'General problem adding a library limit'
},
'Koha::Exceptions::UnderMaintenance' => {
isa => 'Koha::Exceptions::Exception',
description => 'Koha is under maintenance.'
},
# Virtualshelves exceptions
'Koha::Exceptions::Virtualshelves::DuplicateObject' => {
isa => 'Koha::Exceptions::DuplicateObject',
description => "Duplicate shelf object",
},
'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => {
isa => 'Koha::Exceptions::Exception',
description => 'Invalid key on accepting the share',
},
'Koha::Exceptions::Virtualshelves::InvalidKeyOnSharing' => {
isa => 'Koha::Exceptions::Exception',
description=> 'Invalid key on sharing a shelf',
},
'Koha::Exceptions::Virtualshelves::ShareHasExpired' => {
isa => 'Koha::Exceptions::Exception',
description=> 'Cannot share this shelf, the share has expired',
},
'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' => {
isa => 'Koha::Exceptions::Exception',
description => "Invalid use of database administrator account",
}
);
1;