Bug 24902: Join different mc- limits with AND (elasticsearch)
[koha.git] / Koha / Exceptions / Account.pm
blobc598dd92da148a027feb4805dbd3e7c7fe485655
1 package Koha::Exceptions::Account;
3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
18 use Modern::Perl;
20 use Exception::Class (
22 'Koha::Exceptions::Account' => {
23 description => 'Something went wrong!',
25 'Koha::Exceptions::Account::IsNotCredit' => {
26 isa => 'Koha::Exceptions::Account',
27 description => 'Account line is not a credit'
29 'Koha::Exceptions::Account::IsNotDebit' => {
30 isa => 'Koha::Exceptions::Account',
31 description => 'Account line is not a credit'
33 'Koha::Exceptions::Account::NoAvailableCredit' => {
34 isa => 'Koha::Exceptions::Account',
35 description => 'No outstanding credit'
37 'Koha::Exceptions::Account::AmountNotPositive' => {
38 isa => 'Koha::Exceptions::Account',
39 description => 'Amount should be a positive decimal'
41 'Koha::Exceptions::Account::UnrecognisedType' => {
42 isa => 'Koha::Exceptions::Account',
43 description => 'Account type was not recognised'
45 'Koha::Exceptions::Account::RegisterRequired' => {
46 isa => 'Koha::Exceptions::Account',
47 description => 'Account transaction requires a cash register'
51 =head1 NAME
53 Koha::Exceptions::Account - Base class for Account exceptions
55 =head1 Exceptions
57 =head2 Koha::Exceptions::Account
59 Generic Account exception
61 =head2 Koha::Exceptions::Account::IsNotCredit
63 Exception to be used when an action on an account line requires it to be a
64 credit and it isn't.
66 =head2 Koha::Exceptions::Account::IsNotDebit
68 Exception to be used when an action on an account line requires it to be a
69 debit and it isn't.
71 =head2 Koha::Exceptions::Account::NoAvailableCredit
73 Exception to be used when a credit has no amount outstanding and is required
74 to be applied to outstanding debits.
76 =head2 Koha::Exceptions::Account::AmountNotPositive
78 Exception to be used when a passed credit or debit amount is not a positive
79 decimal value.
81 =head2 Koha::Exceptions::Account::UnrecognisedType
83 Exception to be used when a passed credit or debit is not of a recognised type.
85 =cut
87 =head2 Koha::Exceptions::Account::RegisterRequired
89 Exception to be used when UseCashRegisters is enabled and one is not passed for a transaction.
91 =cut