Bugzilla – Attachment 100074 Details for
Bug 24081
Add a 'discount' process to accounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24081: Add credit_types, offset_types and permissions
Bug-24081-Add-credittypes-offsettypes-and-permissi.patch (text/plain), 3.66 KB, created by
Michal Denar
on 2020-03-03 20:32:08 UTC
(
hide
)
Description:
Bug 24081: Add credit_types, offset_types and permissions
Filename:
MIME Type:
Creator:
Michal Denar
Created:
2020-03-03 20:32:08 UTC
Size:
3.66 KB
patch
obsolete
>From fe763c1526845b38dedda417387215ab5bf14766 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 9 Jan 2020 14:13:25 +0000 >Subject: [PATCH] Bug 24081: Add credit_types, offset_types and permissions > >This patch adds the credit_type, offset_type and permissions required >for the addition of a discounting workflow in the accounts system. > >Signed-off-by: Michal Denar <black23@gmail.com> >--- > installer/data/mysql/account_credit_types.sql | 1 + > installer/data/mysql/account_offset_types.sql | 1 + > installer/data/mysql/atomicupdate/bug_24081.perl | 26 ++++++++++++++++++++++++ > installer/data/mysql/userpermissions.sql | 1 + > 4 files changed, 29 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_24081.perl > >diff --git a/installer/data/mysql/account_credit_types.sql b/installer/data/mysql/account_credit_types.sql >index 70a51629d8..178b98b1c6 100644 >--- a/installer/data/mysql/account_credit_types.sql >+++ b/installer/data/mysql/account_credit_types.sql >@@ -3,6 +3,7 @@ INSERT INTO account_credit_types ( code, description, can_be_added_manually, is_ > ('WRITEOFF', 'Writeoff', 0, 1), > ('FORGIVEN', 'Forgiven', 1, 1), > ('CREDIT', 'Credit', 1, 1), >+('DISCOUNT', 'A discount applied to a patrons fine', 0, 1), > ('REFUND', 'A refund applied to a patrons fine', 0, 1), > ('LOST_FOUND', 'Lost item fee refund', 0, 1), > ('PURCHASE', 'Purchase', 0, 1); >diff --git a/installer/data/mysql/account_offset_types.sql b/installer/data/mysql/account_offset_types.sql >index f0cb80ece9..4b6ce8311d 100644 >--- a/installer/data/mysql/account_offset_types.sql >+++ b/installer/data/mysql/account_offset_types.sql >@@ -20,4 +20,5 @@ INSERT INTO account_offset_types ( type ) VALUES > ('Void Payment'), > ('Credit Applied'), > ('PAYOUT'), >+('DISOUNT'), > ('REFUND'); >diff --git a/installer/data/mysql/atomicupdate/bug_24081.perl b/installer/data/mysql/atomicupdate/bug_24081.perl >new file mode 100644 >index 0000000000..a81fdc6a19 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_24081.perl >@@ -0,0 +1,26 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if ( CheckVersion($DBversion) ) { >+ >+ $dbh->do( >+ qq{ >+ INSERT IGNORE INTO account_credit_types (code, description, can_be_added_manually, is_system) >+ VALUES >+ ('DISCOUNT', 'A discount applied to a patrons fine', 0, 1) >+ } >+ ); >+ >+ $dbh->do(qq{ >+ INSERT IGNORE INTO account_offset_types ( type ) VALUES ('DISCOUNT'); >+ }); >+ >+ $dbh->do(qq{ >+ INSERT IGNORE permissions (module_bit, code, description) >+ VALUES >+ (10, 'discount', 'Perform account discount action') >+ }); >+ >+ SetVersion($DBversion); >+ print "Upgrade to $DBversion done (Bug 24081 - Add DISCOUNT to account_credit_types)\n"; >+ print "Upgrade to $DBversion done (Bug 24081 - Add DISCOUNT to account_offset_types)\n"; >+ print "Upgrade to $DBversion done (Bug 24081 - Add accounts discount permission)\n"; >+} >diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql >index bad1b9ad44..75126f131a 100644 >--- a/installer/data/mysql/userpermissions.sql >+++ b/installer/data/mysql/userpermissions.sql >@@ -46,6 +46,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'delete_all_items', 'Delete all items at once'), > (10, 'payout', 'Perform account payout action'), > (10, 'refund', 'Perform account refund action'), >+ (10, 'discount', 'Perform account discount action'), > (10, 'writeoff', 'Write off fines and fees'), > (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), > (11, 'currencies_manage', 'Manage currencies and exchange rates'), >-- >2.11.0
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 24081
:
97090
|
97091
|
100044
|
100045
|
100046
|
100074
|
100075
|
100076
|
100084
|
100085
|
100086
|
100087
|
100088
|
100089
|
100111
|
100112
|
100113
|
100114