Line 0
Link Here
|
|
|
1 |
use Modern::Perl; |
2 |
use Koha::Installer::Output qw(say_warning say_success say_info); |
3 |
|
4 |
return { |
5 |
bug_number => "40445", |
6 |
description => "Add cashup reconciliation support with surplus/deficit tracking", |
7 |
up => sub { |
8 |
my ($args) = @_; |
9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
10 |
|
11 |
# Add CASHUP_SURPLUS credit type |
12 |
$dbh->do( |
13 |
q{ |
14 |
INSERT IGNORE INTO account_credit_types |
15 |
(code, description, can_be_added_manually, credit_number_enabled, is_system, archived) |
16 |
VALUES ('CASHUP_SURPLUS', 'Cash register surplus found during cashup', 0, 0, 1, 0) |
17 |
} |
18 |
); |
19 |
|
20 |
# Add CASHUP_DEFICIT debit type |
21 |
$dbh->do( |
22 |
q{ |
23 |
INSERT IGNORE INTO account_debit_types |
24 |
(code, description, can_be_invoiced, can_be_sold, default_amount, is_system, archived, restricts_checkouts) |
25 |
VALUES ('CASHUP_DEFICIT', 'Cash register deficit found during cashup', 0, 0, NULL, 1, 0, 0) |
26 |
} |
27 |
); |
28 |
|
29 |
say $out "Added new account credit type 'CASHUP_SURPLUS'"; |
30 |
say $out "Added new account debit type 'CASHUP_DEFICIT'"; |
31 |
say_success( $out, "Cashup reconciliation account types created successfully" ); |
32 |
say_info( |
33 |
$out, |
34 |
"Staff can now record actual cash amounts during cashup with automatic surplus/deficit tracking" |
35 |
); |
36 |
}, |
37 |
}; |