Bugzilla – Attachment 92083 Details for
Bug 23321
Add 'cash registers' to the accounts system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23321: Add cash_registers table
Bug-23321-Add-cashregisters-table.patch (text/plain), 5.36 KB, created by
Martin Renvoize (ashimema)
on 2019-08-08 15:26:39 UTC
(
hide
)
Description:
Bug 23321: Add cash_registers table
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-08-08 15:26:39 UTC
Size:
5.36 KB
patch
obsolete
>From b6efdd881ced9a78b394d4875a4c0b714f80b16e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 16 Jul 2019 15:16:18 +0100 >Subject: [PATCH] Bug 23321: Add cash_registers table > >--- > .../data/mysql/atomicupdate/bug_23321.perl | 30 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 22 +++++++++++++- > 2 files changed, 51 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_23321.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_23321.perl b/installer/data/mysql/atomicupdate/bug_23321.perl >new file mode 100644 >index 0000000000..1dd0c1a630 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_23321.perl >@@ -0,0 +1,30 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if ( CheckVersion($DBversion) ) { >+ >+ $dbh->do(qq{ >+CREATE TABLE `cash_registers` ( >+ `id` int(11) NOT NULL auto_increment, -- unique identifier for each account register >+ `name` varchar(24) NOT NULL, -- the user friendly identifier for each account register >+ `description` longtext NOT NULL, -- the user friendly description for each account register >+ `branch` varchar(10) NOT NULL, -- the foreign key the library this account register belongs >+ `branch_default` tinyint(1) NOT NULL DEFAULT 0, -- boolean flag to denote that this till is the branch default >+ `starting_float` decimal(28, 6), -- the starting float this account register should be assigned >+ `archived` tinyint(1) NOT NULL DEFAULT 0, -- boolean flag to denote if this till is archived or not >+ PRIMARY KEY (`id`), >+ UNIQUE KEY `name` (`name`,`branch`), >+ CONSTRAINT cash_registers_branch FOREIGN KEY (branch) REFERENCES branches (branchcode) ON UPDATE CASCADE ON DELETE CASCADE >+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; >+ }); >+ >+ unless ( column_exists( 'accountlines', 'register_id' ) ) { >+ $dbh->do(qq{ALTER TABLE `accountlines` ADD `register_id` int(11) NULL DEFAULT NULL AFTER `manager_id`}); >+ $dbh->do(qq{ >+ ALTER TABLE `accountlines` >+ ADD CONSTRAINT `accountlines_ibfk_registers` FOREIGN KEY (`register_id`) >+ REFERENCES `cash_registers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+ }); >+ } >+ >+ SetVersion($DBversion); >+ print "Upgrade to $DBversion done (Bug 23321 - Add cash_registers table)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 5016b68c51..777cb0e6f4 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2621,6 +2621,7 @@ CREATE TABLE `accountlines` ( > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, > `note` MEDIUMTEXT NULL default NULL, > `manager_id` int(11) NULL DEFAULT NULL, >+ `register_id` int(11) NULL DEFAULT NULL, > `interface` VARCHAR(16) NOT NULL, > `branchcode` VARCHAR( 10 ) NULL DEFAULT NULL, -- the branchcode of the library where a payment was made, a manual invoice created, etc. > PRIMARY KEY (`accountlines_id`), >@@ -2632,7 +2633,8 @@ CREATE TABLE `accountlines` ( > CONSTRAINT `accountlines_ibfk_borrowers` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `accountlines_ibfk_items` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `accountlines_ibfk_borrowers_2` FOREIGN KEY (`manager_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, >- CONSTRAINT `accountlines_ibfk_branches` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE >+ CONSTRAINT `accountlines_ibfk_branches` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE, >+ CONSTRAINT `accountlines_ibfk_registers` FOREIGN KEY (`register_id`) REFERENCES `cash_registers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > > -- >@@ -2663,6 +2665,24 @@ CREATE TABLE `account_offsets` ( > CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > >+-- >+-- Table structure for table `cash_registers` >+-- >+ >+DROP TABLE IF EXISTS `cash_registers`; >+CREATE TABLE `cash_registers` ( >+ `id` int(11) NOT NULL auto_increment, -- unique identifier for each account register >+ `name` varchar(24) NOT NULL, -- the user friendly identifier for each account register >+ `description` longtext NOT NULL, -- the user friendly description for each account register >+ `branch` varchar(10) NOT NULL, -- the foreign key the library this account register belongs >+ `branch_default` tinyint(1) NOT NULL DEFAULT 0, -- boolean flag to denote that this till is the branch default >+ `starting_float` decimal(28, 6), -- the starting float this account register should be assigned >+ `archived` tinyint(1) NOT NULL DEFAULT 0, -- boolean flag to denote if this till is archived or not >+ PRIMARY KEY (`id`), >+ UNIQUE KEY `name` (`name`,`branch`), >+ CONSTRAINT cash_registers_branch FOREIGN KEY (branch) REFERENCES branches (branchcode) ON UPDATE CASCADE ON DELETE CASCADE >+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; >+ > -- > -- Table structure for table `action_logs` > -- >-- >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 23321
:
91596
|
91597
|
91598
|
91599
|
91600
|
91601
|
91602
|
91621
|
92057
|
92058
|
92059
|
92060
|
92061
|
92062
|
92063
|
92064
|
92065
|
92083
|
92084
|
92085
|
92086
|
92087
|
92088
|
92089
|
92090
|
92091
|
92394
|
92395
|
92396
|
92397
|
92398
|
92399
|
92400
|
92401
|
92402
|
92467
|
92468
|
92469
|
92470
|
92471
|
92472
|
92473
|
92474
|
92475
|
92803
|
92804
|
92805
|
92806
|
92807
|
92808
|
92809
|
92810
|
92811
|
92812
|
92813
|
92814
|
92829
|
92879
|
92880
|
92881
|
92882
|
92883
|
92884
|
92885
|
92886
|
92887
|
92888
|
92889
|
93019
|
93020
|
93021
|
93022
|
93023
|
93024
|
93025
|
93026
|
93027
|
93028
|
93029
|
93030
|
93031
|
93032
|
93033
|
93034
|
93035
|
93188