Bugzilla – Attachment 111271 Details for
Bug 22750
Partial writeoff of lost fee causes item to be returned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22750: (24592: Database Update)
Bug-22750-24592-Database-Update.patch (text/plain), 3.14 KB, created by
Martin Renvoize (ashimema)
on 2020-10-06 09:53:33 UTC
(
hide
)
Description:
Bug 22750: (24592: Database Update)
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-10-06 09:53:33 UTC
Size:
3.14 KB
patch
obsolete
>From a997750f79515f13d16f53a343e3ca3cf5273c05 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 5 Feb 2020 12:19:34 +0000 >Subject: [PATCH] Bug 22750: (24592: Database Update) >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >--- > installer/data/mysql/account_credit_types.sql | 2 +- > installer/data/mysql/account_offset_types.sql | 1 + > .../data/mysql/atomicupdate/bug_24592.perl | 49 +++++++++++++++++++ > 3 files changed, 51 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_24592.perl > >diff --git a/installer/data/mysql/account_credit_types.sql b/installer/data/mysql/account_credit_types.sql >index 1105ab9b85..da8c0a7dff 100644 >--- a/installer/data/mysql/account_credit_types.sql >+++ b/installer/data/mysql/account_credit_types.sql >@@ -3,4 +3,4 @@ INSERT INTO account_credit_types ( code, description, can_be_added_manually, is_ > ('WRITEOFF', 'Writeoff', 0, 1), > ('FORGIVEN', 'Forgiven', 1, 1), > ('CREDIT', 'Credit', 1, 1), >-('LOST_RETURN', 'Lost item fee refund', 0, 1); >+('LOST_FOUND', 'Lost item fee refund', 0, 1); >diff --git a/installer/data/mysql/account_offset_types.sql b/installer/data/mysql/account_offset_types.sql >index 78f3a3ba53..e17ff7db2c 100644 >--- a/installer/data/mysql/account_offset_types.sql >+++ b/installer/data/mysql/account_offset_types.sql >@@ -2,6 +2,7 @@ INSERT INTO account_offset_types ( type ) VALUES > ('Writeoff'), > ('Payment'), > ('Lost Item'), >+('Lost Item Found'), > ('Processing Fee'), > ('Manual Credit'), > ('Manual Debit'), >diff --git a/installer/data/mysql/atomicupdate/bug_24592.perl b/installer/data/mysql/atomicupdate/bug_24592.perl >new file mode 100644 >index 0000000000..fcfcc067a8 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_24592.perl >@@ -0,0 +1,49 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ >+ # Add LOST_FOUND debit type >+ $dbh->do(qq{ >+ INSERT IGNORE INTO >+ account_credit_types ( code, description, can_be_added_manually, is_system ) >+ VALUES >+ ('LOST_FOUND', 'Lost item fee refund', 0, 1) >+ }); >+ >+ # Migrate LOST_RETURN to LOST_FOUND >+ $dbh->do(qq{ >+ UPDATE >+ accountlines >+ SET >+ credit_type_code = 'LOST_FOUND' >+ WHERE >+ credit_type_code = 'LOST_RETURN' >+ }); >+ >+ # Migrate LOST + RETURNED to LOST + FOUND >+ $dbh->do(qq{ >+ UPDATE >+ accountlines >+ SET >+ status = 'FOUND' >+ WHERE >+ debit_type_code = 'LOST' >+ AND >+ status = 'RETURNED' >+ }); >+ >+ # Drop LOST_RETURNED credit type >+ $dbh->do(qq{ >+ DELETE FROM account_credit_types WHERE code = 'LOST_RETURN' >+ }); >+ >+ # Add Lost Item Found offset type >+ $dbh->do(qq{ >+ INSERT IGNORE INTO >+ account_offset_types ( type ) >+ VALUES >+ ( 'Lost Item Found' ) >+ }); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 24592 - Update LOST_RETURN to LOST_FOUND)\n"; >+} >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22750
:
111271
|
111272
|
111273
|
111274
|
111275
|
111276
|
111277
|
111278
|
111738
|
111739
|
111740
|
111741
|
111742
|
111743
|
111744
|
111745