From abb51ac1ee5d841b6abed4f7bc719e5a24f47bf4 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 24 Apr 2019 14:20:49 +0100 Subject: [PATCH] Bug 22610: Update SIP payment accounttypes This DB update updates the Pay00, Pay01 and Pay02 accounttypes to all be 'Pay' and adds the corresponding payment_types into the authorised_values --- .../data/mysql/atomicupdate/bug_22610.perl | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_22610.perl diff --git a/installer/data/mysql/atomicupdate/bug_22610.perl b/installer/data/mysql/atomicupdate/bug_22610.perl new file mode 100644 index 0000000000..ea122a18c5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_22610.perl @@ -0,0 +1,45 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if ( CheckVersion($DBversion) ) { + + $dbh->do(qq{ + INSERT INTO + authorised_values (category,authorised_value,lib) + VALUES + ('PAYMENT_TYPE','SIP00','Cash via SIP2'), + ('PAYMENT_TYPE','SIP01','VISA via SIP2'), + ('PAYMENT_TYPE','SIP02','Creditcard via SIP2') + }); + + $dbh->do(qq{ + UPDATE + accountlines + SET + accounttype = 'Pay', + payment_type = 'SIP00' + WHERE + accounttype = 'Pay00'; + }); + + $dbh->do(qq{ + UPDATE + accountlines + SET + accounttype = 'Pay', + payment_type = 'SIP01' + WHERE + accounttype = 'Pay01'; + }); + + $dbh->do(qq{ + UPDATE + accountlines + SET + accounttype = 'Pay', + payment_type = 'SIP02' + WHERE + accounttype = 'Pay02'; + }); + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 22610 - Fix accounttypes for SIP2 payments)\n"; +} -- 2.20.1