Bug 40445: Add CASHUP_SURPLUS and CASHUP_DEFICIT account types

This patch adds two new system account types to support cashup reconciliation:

- CASHUP_SURPLUS (credit type): Used when actual cash found exceeds expected amount
- CASHUP_DEFICIT (debit type): Used when actual cash found is less than expected amount

Both types are system-managed and cannot be manually added by staff. They will be
automatically created during cashup processes when discrepancies are detected.

Changes include:
- Atomicupdate script for existing installations
- Mandatory YAML files for fresh installations

Sponsored-by: OpenFifth <https://openfifth.co.uk/>
Signed-off-by: Jackie Usher <jackie.usher@westsussex.gov.uk>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2025-08-08 13:17:50 +01:00 committed by Pedro Amorim
parent 86d54c2c4a
commit 6a38111462
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,37 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "40445",
description => "Add cashup reconciliation support with surplus/deficit tracking",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
# Add CASHUP_SURPLUS credit type
$dbh->do(
q{
INSERT IGNORE INTO account_credit_types
(code, description, can_be_added_manually, credit_number_enabled, is_system, archived)
VALUES ('CASHUP_SURPLUS', 'Cash register surplus found during cashup', 0, 0, 1, 0)
}
);
# Add CASHUP_DEFICIT debit type
$dbh->do(
q{
INSERT IGNORE INTO account_debit_types
(code, description, can_be_invoiced, can_be_sold, default_amount, is_system, archived, restricts_checkouts)
VALUES ('CASHUP_DEFICIT', 'Cash register deficit found during cashup', 0, 0, NULL, 1, 0, 0)
}
);
say $out "Added new account credit type 'CASHUP_SURPLUS'";
say $out "Added new account debit type 'CASHUP_DEFICIT'";
say_success( $out, "Cashup reconciliation account types created successfully" );
say_info(
$out,
"Staff can now record actual cash amounts during cashup with automatic surplus/deficit tracking"
);
},
};

View File

@ -79,3 +79,9 @@ tables:
description: "Lost item processing fee refund"
can_be_added_manually: "0"
is_system: "1"
- code: "CASHUP_SURPLUS"
description: "Cash register surplus found during cashup"
can_be_added_manually: "0"
credit_number_enabled: "0"
is_system: "1"

View File

@ -136,3 +136,11 @@ tables:
can_be_sold: "0"
default_amount: ~
is_system: "1"
- code: "CASHUP_DEFICIT"
description: "Cash register deficit found during cashup"
can_be_invoiced: "0"
can_be_sold: "0"
default_amount: ~
is_system: "1"
restricts_checkouts: "0"