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

(-)a/Koha/Accounts.pm (+540 lines)
Line 0 Link Here
1
package Koha::Accounts;
2
3
# Copyright 2013 ByWater Solutions
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Carp;
23
use Data::Dumper qw(Dumper);
24
25
use C4::Context;
26
use C4::Log qw(logaction);
27
use Koha::DateUtils qw(get_timestamp);
28
29
use Koha::Accounts::CreditTypes;
30
use Koha::Accounts::DebitTypes;
31
32
use vars qw($VERSION @ISA @EXPORT);
33
34
BEGIN {
35
    require Exporter;
36
    @ISA    = qw(Exporter);
37
    @EXPORT = qw(
38
      AddDebit
39
      AddCredit
40
41
      NormalizeBalances
42
43
      RecalculateAccountBalance
44
45
      DebitLostItem
46
      CreditLostItem
47
    );
48
}
49
50
=head1 NAME
51
52
Koha::Accounts - Functions for dealing with Koha accounts
53
54
=head1 SYNOPSIS
55
56
use Koha::Accounts;
57
58
=head1 DESCRIPTION
59
60
The functions in this module deal with the monetary aspect of Koha,
61
including looking up and modifying the amount of money owed by a
62
patron.
63
64
=head1 FUNCTIONS
65
66
=head2 AddDebit
67
68
my $debit = AddDebit({
69
    borrower       => $borrower,
70
    amount         => $amount,
71
    [ type         => $type,        ]
72
    [ itemnumber   => $itemnumber,  ]
73
    [ issue_id     => $issue_id,    ]
74
    [ description  => $description, ]
75
    [ notes        => $notes,       ]
76
    [ branchcode   => $branchcode,  ]
77
    [ manager_id   => $manager_id,  ]
78
    [ accruing     => $accruing,    ] # Default 0 if not accruing, 1 if accruing
79
});
80
81
Create a new debit for a given borrower. To standardize nomenclature, any charge
82
against a borrower ( e.g. a fine, a new card charge, the cost of losing an item )
83
will be referred to as a 'debit'.
84
85
=cut
86
87
sub AddDebit {
88
    my ($params) = @_;
89
90
    my $borrower    = $params->{borrower};
91
    my $amount      = $params->{amount};
92
    my $type        = $params->{type};
93
    my $itemnumber  = $params->{itemnumber};
94
    my $issue_id    = $params->{issue_id};
95
    my $description = $params->{description};
96
    my $notes       = $params->{notes};
97
    my $branchcode  = $params->{branchcode};
98
    my $manager_id  = $params->{manager_id};
99
100
    my $userenv = C4::Context->userenv;
101
102
    $branchcode ||=
103
        $userenv
104
      ? $userenv->{branch}
105
      : undef;
106
107
    $manager_id ||=
108
        $userenv
109
      ? $userenv->{number}
110
      : undef;
111
112
    my $accruing = $params->{accruing} || 0;
113
114
    croak("Required parameter 'borrower' not passed in.")
115
      unless ($borrower);
116
    croak("Required parameter 'amount' not passed in.")
117
      unless ($amount);
118
    croak("Invalid debit type: '$type'!")
119
      unless ( Koha::Accounts::DebitTypes::IsValid($type) );
120
    croak("No issue id passed in for accruing debit!")
121
      if ( $accruing && !$issue_id );
122
123
    my $debit =
124
      Koha::Database->new()->schema->resultset('AccountDebit')->create(
125
        {
126
            borrowernumber        => $borrower->borrowernumber(),
127
            itemnumber            => $itemnumber,
128
            issue_id              => $issue_id,
129
            type                  => $type,
130
            accruing              => $accruing,
131
            amount_original       => $amount,
132
            amount_outstanding    => $amount,
133
            amount_last_increment => $amount,
134
            description           => $description,
135
            notes                 => $notes,
136
            branchcode            => $branchcode,
137
            manager_id            => $manager_id,
138
            created_on            => get_timestamp(),
139
        }
140
      );
141
142
    if ($debit) {
143
        $borrower->account_balance( $borrower->account_balance() + $amount );
144
        $borrower->update();
145
146
        NormalizeBalances( { borrower => $borrower } );
147
148
        if ( C4::Context->preference("FinesLog") ) {
149
            logaction( "FINES", "CREATE_FEE", $debit->id,
150
                Dumper( $debit->get_columns() ) );
151
        }
152
    }
153
    else {
154
        carp("Something went wrong! Debit not created!");
155
    }
156
157
    return $debit;
158
}
159
160
=head2 DebitLostItem
161
162
my $debit = DebitLostItem({
163
    borrower       => $borrower,
164
    issue          => $issue,
165
});
166
167
DebitLostItem adds a replacement fee charge for the item
168
of the given issue.
169
170
=cut
171
172
sub DebitLostItem {
173
    my ($params) = @_;
174
175
    my $borrower = $params->{borrower};
176
    my $issue    = $params->{issue};
177
178
    croak("Required param 'borrower' not passed in!") unless ($borrower);
179
    croak("Required param 'issue' not passed in!")    unless ($issue);
180
181
# Don't add lost debit if borrower has already been charged for this lost item before,
182
# for this issue. It seems reasonable that a borrower could lose an item, find and return it,
183
# check it out again, and lose it again, so we should do this based on issue_id, not itemnumber.
184
    unless (
185
        Koha::Database->new()->schema->resultset('AccountDebit')->search(
186
            {
187
                borrowernumber => $borrower->borrowernumber(),
188
                issue_id       => $issue->issue_id(),
189
                type           => Koha::Accounts::DebitTypes::Lost
190
            }
191
        )->count()
192
      )
193
    {
194
        my $item = $issue->item();
195
196
        $params->{accruing}   = 0;
197
        $params->{type}       = Koha::Accounts::DebitTypes::Lost;
198
        $params->{amount}     = $item->replacementprice();
199
        $params->{itemnumber} = $item->itemnumber();
200
        $params->{issue_id}   = $issue->issue_id();
201
202
        #TODO: Shouldn't we have a default replacement price as a syspref?
203
        if ( $params->{amount} ) {
204
            return AddDebit($params);
205
        }
206
        else {
207
            carp("Cannot add lost debit! Item has no replacement price!");
208
        }
209
    }
210
}
211
212
=head2 CreditLostItem
213
214
my $debit = CreditLostItem(
215
    {
216
        borrower => $borrower,
217
        debit    => $debit,
218
    }
219
);
220
221
CreditLostItem creates a payment in the amount equal
222
to the replacement price charge created by DebitLostItem.
223
224
=cut
225
226
sub CreditLostItem {
227
    my ($params) = @_;
228
229
    my $borrower = $params->{borrower};
230
    my $debit    = $params->{debit};
231
232
    croak("Required param 'borrower' not passed in!") unless ($borrower);
233
    croak("Required param 'debit' not passed in!")
234
      unless ($debit);
235
236
    my $item =
237
      Koha::Database->new()->schema->resultset('Item')
238
      ->find( $debit->itemnumber() );
239
    carp("No item found!") unless $item;
240
241
    $params->{type}     = Koha::Accounts::CreditTypes::Found;
242
    $params->{amount}   = $debit->amount_original();
243
    $params->{debit_id} = $debit->debit_id();
244
    $params->{notes}    = "Lost item found: " . $item->barcode();
245
246
    return AddCredit($params);
247
}
248
249
=head2 AddCredit
250
251
AddCredit({
252
    borrower       => $borrower,
253
    amount         => $amount,
254
    [ branchcode   => $branchcode, ]
255
    [ manager_id   => $manager_id, ]
256
    [ debit_id     => $debit_id, ] # The primary debit to be paid
257
    [ notes        => $notes, ]
258
});
259
260
Record credit by a patron. C<$borrowernumber> is the patron's
261
borrower number. C<$credit> is a floating-point number, giving the
262
amount that was paid.
263
264
Amounts owed are paid off oldest first. That is, if the patron has a
265
$1 fine from Feb. 1, another $1 fine from Mar. 1, and makes a credit
266
of $1.50, then the oldest fine will be paid off in full, and $0.50
267
will be credited to the next one.
268
269
debit_id can be passed as a scalar or an array ref to make the passed
270
in debit or debits the first to be credited.
271
272
=cut
273
274
sub AddCredit {
275
    my ($params) = @_;
276
277
    my $type            = $params->{type};
278
    my $borrower        = $params->{borrower};
279
    my $amount          = $params->{amount};
280
    my $amount_received = $params->{amount_received};
281
    my $debit_id        = $params->{debit_id};
282
    my $notes           = $params->{notes};
283
    my $branchcode      = $params->{branchcode};
284
    my $manager_id      = $params->{manager_id};
285
286
    my $userenv = C4::Context->userenv;
287
288
    $branchcode ||=
289
        $userenv
290
      ? $userenv->{branch}
291
      : undef;
292
293
    $manager_id ||=
294
        $userenv
295
      ? $userenv->{number}
296
      : undef;
297
298
    unless ($borrower) {
299
        croak("Required parameter 'borrower' not passed in");
300
    }
301
    unless ($amount) {
302
        croak("Required parameter amount not passed in");
303
    }
304
305
    unless ( Koha::Accounts::CreditTypes::IsValid($type) ) {
306
        carp("Invalid credit type! Returning without creating credit.");
307
        return;
308
    }
309
310
    unless ($type) {
311
        carp("No type passed in, assuming Payment");
312
        $type = Koha::Accounts::CreditTypes::Payment;
313
    }
314
315
    my $debit =
316
      Koha::Database->new()->schema->resultset('AccountDebit')->find($debit_id);
317
318
    # First, we make the credit. We'll worry about what we paid later on
319
    my $credit =
320
      Koha::Database->new()->schema->resultset('AccountCredit')->create(
321
        {
322
            borrowernumber   => $borrower->borrowernumber(),
323
            type             => $type,
324
            amount_received  => $amount_received,
325
            amount_paid      => $amount,
326
            amount_remaining => $amount,
327
            notes            => $notes,
328
            branchcode       => $branchcode,
329
            manager_id       => $manager_id,
330
            created_on       => get_timestamp(),
331
        }
332
      );
333
334
    if ( C4::Context->preference("FinesLog") ) {
335
        logaction( "FINES", "CREATE_PAYMENT", $credit->id,
336
            Dumper( $credit->get_columns() ) );
337
    }
338
339
    $borrower->account_balance( $borrower->account_balance() - $amount );
340
    $borrower->update();
341
342
    # If we are given specific debits, pay those ones first.
343
    if ($debit_id) {
344
        my @debit_ids = ref($debit_id) eq "ARRAY" ? @$debit_id : $debit_id;
345
        foreach my $debit_id (@debit_ids) {
346
            my $debit =
347
              Koha::Database->new()->schema->resultset('AccountDebit')
348
              ->find($debit_id);
349
350
            if ($debit) {
351
                CreditDebit( { credit => $credit, debit => $debit } );
352
            }
353
            else {
354
                carp("Invalid debit_id passed in!");
355
            }
356
        }
357
    }
358
359
    # We still have leftover money, or we weren't given a specific debit to pay
360
    if ( $credit->amount_remaining() > 0 ) {
361
        my @debits =
362
          Koha::Database->new()->schema->resultset('AccountDebit')->search(
363
            {
364
                borrowernumber     => $borrower->borrowernumber(),
365
                amount_outstanding => { '>' => '0' }
366
            }
367
          );
368
369
        foreach my $debit (@debits) {
370
            if ( $credit->amount_remaining() > 0 ) {
371
                CreditDebit(
372
                    {
373
                        credit   => $credit,
374
                        debit    => $debit,
375
                        borrower => $borrower,
376
                        type     => $type,
377
                    }
378
                );
379
            }
380
        }
381
    }
382
383
    return $credit;
384
}
385
386
=head2 CreditDebit
387
388
$account_offset = CreditDebit({
389
    credit => $credit,
390
    debit => $debit,
391
});
392
393
Given a credit and a debit, this subroutine
394
will pay the appropriate amount of the debit,
395
update the debit's amount outstanding, the credit's
396
amout remaining, and create the appropriate account
397
offset.
398
399
=cut
400
401
sub CreditDebit {
402
    my ($params) = @_;
403
404
    my $credit = $params->{credit};
405
    my $debit  = $params->{debit};
406
407
    croak("Required parameter 'credit' not passed in!")
408
      unless $credit;
409
    croak("Required parameter 'debit' not passed in!") unless $debit;
410
411
    my $amount_to_pay =
412
      ( $debit->amount_outstanding() > $credit->amount_remaining() )
413
      ? $credit->amount_remaining()
414
      : $debit->amount_outstanding();
415
416
    if ( $amount_to_pay > 0 ) {
417
        $debit->amount_outstanding(
418
            $debit->amount_outstanding() - $amount_to_pay );
419
        $debit->update();
420
421
        $credit->amount_remaining(
422
            $credit->amount_remaining() - $amount_to_pay );
423
        $credit->update();
424
425
        my $offset =
426
          Koha::Database->new()->schema->resultset('AccountOffset')->create(
427
            {
428
                amount     => $amount_to_pay * -1,
429
                debit_id   => $debit->id(),
430
                credit_id  => $credit->id(),
431
                created_on => get_timestamp(),
432
            }
433
          );
434
435
        if ( C4::Context->preference("FinesLog") ) {
436
            logaction( "FINES", "MODIFY", $offset->id,
437
                Dumper( $offset->get_columns() ) );
438
        }
439
440
        return $offset;
441
    }
442
}
443
444
=head2 RecalculateAccountBalance
445
446
$account_balance = RecalculateAccountBalance({
447
    borrower => $borrower
448
});
449
450
Recalculates a borrower's balance based on the
451
sum of the amount outstanding for the borrower's
452
debits minus the sum of the amount remaining for
453
the borrowers credits.
454
455
TODO: Would it be better to use af.amount_original - ap.amount_paid for any reason?
456
      Or, perhaps calculate both and compare the two, for error checking purposes.
457
=cut
458
459
sub RecalculateAccountBalance {
460
    my ($params) = @_;
461
462
    my $borrower = $params->{borrower};
463
    croak("Requred paramter 'borrower' not passed in!")
464
      unless ($borrower);
465
466
    my $debits =
467
      Koha::Database->new()->schema->resultset('AccountDebit')
468
      ->search( { borrowernumber => $borrower->borrowernumber() } );
469
    my $amount_outstanding = $debits->get_column('amount_outstanding')->sum() || 0;
470
471
    my $credits =
472
      Koha::Database->new()->schema->resultset('AccountCredit')
473
      ->search( { borrowernumber => $borrower->borrowernumber() } );
474
    my $amount_remaining = $credits->get_column('amount_remaining')->sum() || 0;
475
476
    my $account_balance = $amount_outstanding - $amount_remaining;
477
    $borrower->account_balance($account_balance);
478
    $borrower->update();
479
480
    return $account_balance;
481
}
482
483
=head2 NormalizeBalances
484
485
    $account_balance = NormalizeBalances({ borrower => $borrower });
486
487
    For a given borrower, this subroutine will find all debits
488
    with an outstanding balance and all credits with an unused
489
    amount remaining and will pay those debits with those credits.
490
491
=cut
492
493
sub NormalizeBalances {
494
    my ($params) = @_;
495
496
    my $borrower = $params->{borrower};
497
498
    croak("Required param 'borrower' not passed in!") unless $borrower;
499
500
    my @credits =
501
      Koha::Database->new()->schema->resultset('AccountCredit')->search(
502
        {
503
            borrowernumber   => $borrower->borrowernumber(),
504
            amount_remaining => { '>' => '0' }
505
        }
506
      );
507
508
    return unless @credits;
509
510
    my @debits =
511
      Koha::Database->new()->schema->resultset('AccountDebit')->search(
512
        {
513
            borrowernumber     => $borrower->borrowernumber(),
514
            amount_outstanding => { '>' => '0' }
515
        }
516
      );
517
518
    return unless @debits;
519
520
    foreach my $credit (@credits) {
521
        foreach my $debit (@debits) {
522
            if (   $credit->amount_remaining()
523
                && $debit->amount_outstanding() )
524
            {
525
                CreditDebit( { credit => $credit, debit => $debit } );
526
            }
527
        }
528
    }
529
530
    return RecalculateAccountBalance( { borrower => $borrower } );
531
}
532
533
1;
534
__END__
535
536
=head1 AUTHOR
537
538
Kyle M Hall <kyle@bywatersolutions.com>
539
540
=cut
(-)a/Koha/Accounts/CreditTypes.pm (+117 lines)
Line 0 Link Here
1
package Koha::Accounts::CreditTypes;
2
3
# Copyright 2013 ByWater Solutions
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
=head1 NAME
23
24
Koha::AccountsCreditTypes - Module representing the enumerated data types for account fees
25
26
=head1 SYNOPSIS
27
28
use Koha::Accounts::CreditTypes;
29
30
my $type = Koha::Accounts::CreditTypes::Payment;
31
32
=head1 DESCRIPTION
33
34
The subroutines in this modules act as enumerated data types for the
35
different credit types in Koha ( i.e. payments, writeoffs, etc. )
36
37
=head1 FUNCTIONS
38
39
=head2 IsValid
40
41
This subroutine takes a given string and returns 1 if
42
the string matches one of the data types, and 0 if not.
43
44
FIXME: Perhaps we should use Class::Inspector instead of hard
45
coding the subs? It seems like it would be a major trade off
46
of speed just so we don't update something in two separate places
47
in the same file.
48
49
=cut
50
51
sub IsValid {
52
    my ($string) = @_;
53
54
    my $is_valid =
55
      (      $string eq Koha::Accounts::CreditTypes::Payment()
56
          || $string eq Koha::Accounts::CreditTypes::WriteOff()
57
          || $string eq Koha::Accounts::CreditTypes::Found()
58
          || $string eq Koha::Accounts::CreditTypes::Credit()
59
          || $string eq Koha::Accounts::CreditTypes::Forgiven() );
60
61
    unless ($is_valid) {
62
        $is_valid =
63
          Koha::Database->new()->schema->resultset('AuthorisedValue')
64
          ->count(
65
            { category => 'MANUAL_CREDIT', authorised_value => $string } );
66
    }
67
68
    return $is_valid;
69
}
70
71
=head2 Credit
72
73
=cut
74
75
sub Credit {
76
    return 'CREDIT';
77
}
78
79
=head2 Payment
80
81
=cut
82
83
sub Payment {
84
    return 'PAYMENT';
85
}
86
87
=head2 Writeoff
88
89
=cut
90
91
sub WriteOff {
92
    return 'WRITEOFF';
93
}
94
95
=head2 Writeoff
96
97
=cut
98
99
sub Found {
100
    return 'FOUND';
101
}
102
103
=head2 Forgiven
104
105
=cut
106
107
sub Forgiven {
108
    return 'FORGIVEN';
109
}
110
111
1;
112
113
=head1 AUTHOR
114
115
Kyle M Hall <kyle@bywatersolutions.com>
116
117
=cut
(-)a/Koha/Accounts/DebitTypes.pm (+160 lines)
Line 0 Link Here
1
package Koha::Accounts::DebitTypes;
2
3
# Copyright 2013 ByWater Solutions
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
=head1 NAME
23
24
Koha::Accounts::DebitTypes - Module representing an enumerated data type for account fees
25
26
=head1 SYNOPSIS
27
28
use Koha::Accounts::DebitTypes;
29
30
my $type = Koha::Accounts::DebitTypes::Fine;
31
32
=head1 DESCRIPTION
33
34
The subroutines in this modules act as an enumerated data type
35
for debit types ( stored in account_debits.type ) in Koha.
36
37
=head1 FUNCTIONS
38
39
=head2 IsValid
40
41
This subroutine takes a given string and returns 1 if
42
the string matches one of the data types, and 0 if not.
43
44
=cut
45
46
sub IsValid {
47
    my ($string) = @_;
48
49
    my $is_valid =
50
      (      $string eq Koha::Accounts::DebitTypes::Fine()
51
          || $string eq Koha::Accounts::DebitTypes::AccountManagementFee()
52
          || $string eq Koha::Accounts::DebitTypes::Sundry()
53
          || $string eq Koha::Accounts::DebitTypes::Lost()
54
          || $string eq Koha::Accounts::DebitTypes::Hold()
55
          || $string eq Koha::Accounts::DebitTypes::Rental()
56
          || $string eq Koha::Accounts::DebitTypes::NewCard() );
57
58
    unless ($is_valid) {
59
        $is_valid =
60
          Koha::Database->new()->schema->resultset('AuthorisedValue')
61
          ->count( { category => 'MANUAL_INV', authorised_value => $string } );
62
    }
63
64
    return $is_valid;
65
}
66
67
=head2 Fine
68
69
This data type represents a standard fine within Koha.
70
71
A fine still accruing no longer needs to be differiated by type
72
from a fine done accuring. Instead, that differentication is made
73
by which table the fine exists in, account_fees_accruing vs account_fees_accrued.
74
75
In addition, fines can be checked for correctness based on the issue_id
76
they have. A fine in account_fees_accruing should always have a matching
77
issue_id in the issues table. A fine done accruing will almost always have
78
a matching issue_id in the old_issues table. However, in the case of an overdue
79
item with fines that has been renewed, and becomes overdue again, you may have
80
a case where a given issue may have a matching fine in account_fees_accruing and
81
one or more matching fines in account_fees_accrued ( one for each for the first
82
checkout and one each for any subsequent renewals )
83
84
=cut
85
86
sub Fine {
87
    return 'FINE';
88
}
89
90
=head2 AccountManagementFee
91
92
This fee type is usually reserved for payments for library cards,
93
in cases where a library must charge a patron for the ability to
94
check out items.
95
96
=cut
97
98
sub AccountManagementFee {
99
    return 'ACCOUNT_MANAGEMENT_FEE';
100
}
101
102
=head2 Sundry
103
104
This fee type is basically a 'misc' type, and should be used
105
when no other fee type is more appropriate.
106
107
=cut
108
109
sub Sundry {
110
    return 'SUNDRY';
111
}
112
113
=head2 Lost
114
115
This fee type is used when a library charges for lost items.
116
117
=cut
118
119
sub Lost {
120
    return 'LOST';
121
}
122
123
=head2 Hold
124
125
This fee type is used when a library charges for holds.
126
127
=cut
128
129
sub Hold {
130
    return 'HOLD';
131
}
132
133
=head2 Rental
134
135
This fee type is used when a library charges a rental fee for the item type.
136
137
=cut
138
139
sub Rental {
140
    return 'RENTAL';
141
}
142
143
=head2 NewCard
144
145
This fee type is used when a library charges for replacement
146
library cards.
147
148
=cut
149
150
sub NewCard {
151
    return 'NEW_CARD';
152
}
153
154
1;
155
156
=head1 AUTHOR
157
158
Kyle M Hall <kyle@bywatersolutions.com>
159
160
=cut
(-)a/Koha/Accounts/OffsetTypes.pm (-1 / +72 lines)
Line 0 Link Here
0
- 
1
package Koha::Accounts::OffsetTypes;
2
3
# Copyright 2013 ByWater Solutions
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
=head1 NAME
23
24
Koha::AccountsOffsetTypes - Module representing the enumerated data types for account fees
25
26
=head1 SYNOPSIS
27
28
use Koha::Accounts::OffsetTypes;
29
30
my $type = Koha::Accounts::OffsetTypes::Dropbox;
31
32
=head1 DESCRIPTION
33
34
The subroutines in this modules act as enumerated data types for the
35
different automatic offset types in Koha ( i.e. forgiveness, dropbox mode, etc )
36
37
These types are used for account offsets that have no corrosponding account credit,
38
e.g. automatic fine increments, dropbox mode, etc.
39
40
=head1 FUNCTIONS
41
42
=cut
43
44
=head2 Dropbox
45
46
Offset type for automatic fine reductions
47
via dropbox mode.
48
49
=cut
50
51
sub Dropbox {
52
    return 'DROPBOX';
53
}
54
55
=head2 Fine
56
57
Indicates this offset was an automatically
58
generated fine increment/decrement.
59
60
=cut
61
62
sub Fine {
63
    return 'FINE';
64
}
65
66
1;
67
68
=head1 AUTHOR
69
70
Kyle M Hall <kyle@bywatersolutions.com>
71
72
=cut

Return to bug 6427