From f91fafbbcb1d5a978092ca7bcb2a859ec59ba4d0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 18 Oct 2019 13:12:39 +0100 Subject: [PATCH] Bug 23049: (QA follow-up) Correction for 'M' => 'MANUAL' Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize --- C4/Overdues.pm | 4 ++-- installer/data/mysql/account_debit_types.sql | 2 +- installer/data/mysql/atomicupdate/bug_23049_debit.perl | 9 ++++++++- .../data/mysql/en/mandatory/account_debit_types.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc | 2 +- .../opac-tmpl/bootstrap/en/includes/account-table.inc | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 14c5980414..78e16230bb 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -523,7 +523,7 @@ sub UpdateFine { my $overdues = Koha::Account::Lines->search( { borrowernumber => $borrowernumber, - debit_type_code => [ 'OVERDUE', 'M' ], + debit_type_code => 'OVERDUE', amountoutstanding => { '<>' => 0 } } ); @@ -637,7 +637,7 @@ sub GetFine { my ( $itemnum, $borrowernumber ) = @_; my $dbh = C4::Context->dbh(); my $query = q|SELECT sum(amountoutstanding) as fineamount FROM accountlines - WHERE debit_type_code LIKE 'OVERDUE' + WHERE debit_type_code = 'OVERDUE' AND amountoutstanding > 0 AND borrowernumber=?|; my @query_param; push @query_param, $borrowernumber; diff --git a/installer/data/mysql/account_debit_types.sql b/installer/data/mysql/account_debit_types.sql index 7391a1f9a6..731c461e80 100644 --- a/installer/data/mysql/account_debit_types.sql +++ b/installer/data/mysql/account_debit_types.sql @@ -2,7 +2,7 @@ INSERT INTO account_debit_types ( code, description, can_be_added_manually, defa ('ACCOUNT', 'Account creation fee', 0, NULL, 1), ('ACCOUNT_RENEW', 'Account renewal fee', 0, NULL, 1), ('LOST', 'Lost item', 1, NULL, 1), -('M', 'Manual fee', 1, NULL, 0), +('MANUAL', 'Manual fee', 1, NULL, 0), ('NEW_CARD', 'New card fee', 1, NULL, 1), ('OVERDUE', 'Overdue fine', 0, NULL, 1), ('PROCESSING', 'Lost item processing fee', 0, NULL, 1), diff --git a/installer/data/mysql/atomicupdate/bug_23049_debit.perl b/installer/data/mysql/atomicupdate/bug_23049_debit.perl index cd5cfa7be4..505b1fc59a 100644 --- a/installer/data/mysql/atomicupdate/bug_23049_debit.perl +++ b/installer/data/mysql/atomicupdate/bug_23049_debit.perl @@ -43,7 +43,7 @@ if ( CheckVersion($DBversion) ) { ('ACCOUNT_RENEW', 'Account renewal fee', 0, NULL, 1), ('RESERVE_EXPIRED', 'Hold waiting too long', 0, NULL, 1), ('LOST', 'Lost item', 1, NULL, 1), - ('M', 'Manual fee', 1, NULL, 0), + ('MANUAL', 'Manual fee', 1, NULL, 0), ('NEW_CARD', 'New card fee', 1, NULL, 1), ('OVERDUE', 'Overdue fine', 0, NULL, 1), ('PROCESSING', 'Lost item processing fee', 0, NULL, 1), @@ -83,6 +83,13 @@ if ( CheckVersion($DBversion) ) { } ); + # Update accountype 'M' to 'MANUAL' + $dbh->do( + qq{ + UPDATE accountlines SET accounttype = 'MANUAL' WHERE accounttype = 'M' + } + ); + # Catch 'F' cases introduced since bug 22521 $dbh->do(qq{ UPDATE diff --git a/installer/data/mysql/en/mandatory/account_debit_types.sql b/installer/data/mysql/en/mandatory/account_debit_types.sql index 7391a1f9a6..731c461e80 100644 --- a/installer/data/mysql/en/mandatory/account_debit_types.sql +++ b/installer/data/mysql/en/mandatory/account_debit_types.sql @@ -2,7 +2,7 @@ INSERT INTO account_debit_types ( code, description, can_be_added_manually, defa ('ACCOUNT', 'Account creation fee', 0, NULL, 1), ('ACCOUNT_RENEW', 'Account renewal fee', 0, NULL, 1), ('LOST', 'Lost item', 1, NULL, 1), -('M', 'Manual fee', 1, NULL, 0), +('MANUAL', 'Manual fee', 1, NULL, 0), ('NEW_CARD', 'New card fee', 1, NULL, 1), ('OVERDUE', 'Overdue fine', 0, NULL, 1), ('PROCESSING', 'Lost item processing fee', 0, NULL, 1), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc index 528ab7882b..8a5c20b81a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc @@ -16,7 +16,7 @@ [%- CASE 'ACCOUNT' -%]Account creation fee [%- CASE 'ACCOUNT_RENEW' -%]Account renewal fee [%- CASE 'LOST' -%]Lost item - [%- CASE 'M' -%]Sundry + [%- CASE 'MANUAL' -%]Manual fee [%- CASE 'NEW_CARD' -%]New card [%- CASE 'OVERDUE' -%]Fine [%- CASE 'PROCESSING' -%]Lost item processing fee diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc index b45a169fe6..2d5093a030 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc @@ -187,7 +187,7 @@ [%- CASE 'ACCOUNT' -%]Account creation fee [%- CASE 'ACCOUNT_RENEW' -%]Account renewal fee [%- CASE 'LOST' -%]Lost item - [%- CASE 'M' -%]Sundry + [%- CASE 'MANUAL' -%]Manual fee [%- CASE 'NEW_CARD' -%]New card [%- CASE 'OVERDUE' -%]Fine [%- CASE 'PROCESSING' -%]Lost item processing fee -- 2.39.5