From 68b0527d574792ae1294044d7cc1d00ed89ae701 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 21 Nov 2019 14:50:12 +0000 Subject: [PATCH] Bug 24080: Payout account debit type Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/account_debit_types.sql | 1 + installer/data/mysql/account_offset_types.sql | 3 ++- .../data/mysql/atomicupdate/bug_24080.perl | 25 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24080.perl diff --git a/installer/data/mysql/account_debit_types.sql b/installer/data/mysql/account_debit_types.sql index 731c461e80..a5b93cac7a 100644 --- a/installer/data/mysql/account_debit_types.sql +++ b/installer/data/mysql/account_debit_types.sql @@ -6,6 +6,7 @@ INSERT INTO account_debit_types ( code, description, can_be_added_manually, defa ('NEW_CARD', 'New card fee', 1, NULL, 1), ('OVERDUE', 'Overdue fine', 0, NULL, 1), ('PROCESSING', 'Lost item processing fee', 0, NULL, 1), +('PAYOUT', 'Payment from library to patron', 0, NULL, 1), ('RENT', 'Rental fee', 0, NULL, 1), ('RENT_DAILY', 'Daily rental fee', 0, NULL, 1), ('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1), diff --git a/installer/data/mysql/account_offset_types.sql b/installer/data/mysql/account_offset_types.sql index 78f3a3ba53..95d4296f06 100644 --- a/installer/data/mysql/account_offset_types.sql +++ b/installer/data/mysql/account_offset_types.sql @@ -16,4 +16,5 @@ INSERT INTO account_offset_types ( type ) VALUES ('OVERDUE_DECREASE'), ('OVERDUE'), ('Void Payment'), -('Credit Applied'); +('Credit Applied'), +('PAYOUT'); diff --git a/installer/data/mysql/atomicupdate/bug_24080.perl b/installer/data/mysql/atomicupdate/bug_24080.perl new file mode 100644 index 0000000000..dd8de49e93 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24080.perl @@ -0,0 +1,25 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if ( CheckVersion($DBversion) ) { + + $dbh->do( + qq{ + INSERT IGNORE INTO account_debit_types ( + code, + description, + can_be_added_manually, + default_amount, + is_system + ) + VALUES + ('PAYOUT', 'Payment from library to patron', 0, NULL, 1) + } + ); + + $dbh->do(qq{ + INSERT IGNORE INTO account_offset_types ( type ) VALUES ('PAYOUT'); + }); + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 24080 - Add PAYOUT account_debit_type)\n"; + print "Upgrade to $DBversion done (Bug 24080 - Add PAYOUT account_offset_type)\n"; +} -- 2.24.1