View | Details | Raw Unified | Return to bug 34355
Collapse All | Expand All

(-)a/Koha/Schema/Result/Aqbookseller.pm (-2 / +17 lines)
Lines 494-499 __PACKAGE__->belongs_to( Link Here
494
  },
494
  },
495
);
495
);
496
496
497
=head2 marc_order_accounts
498
499
Type: has_many
500
501
Related object: L<Koha::Schema::Result::MarcOrderAccount>
502
503
=cut
504
505
__PACKAGE__->has_many(
506
  "marc_order_accounts",
507
  "Koha::Schema::Result::MarcOrderAccount",
508
  { "foreign.vendor_id" => "self.id" },
509
  { cascade_copy => 0, cascade_delete => 0 },
510
);
511
497
=head2 vendor_edi_accounts
512
=head2 vendor_edi_accounts
498
513
499
Type: has_many
514
Type: has_many
Lines 510-517 __PACKAGE__->has_many( Link Here
510
);
525
);
511
526
512
527
513
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-06-30 09:54:35
528
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-12 16:43:09
514
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xjeOqpcdN3Kb1wmLGDjzLg
529
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4L14+X0NSAgyWGrKaFPR5w
515
530
516
__PACKAGE__->add_columns(
531
__PACKAGE__->add_columns(
517
    '+active' => { is_boolean => 1 },
532
    '+active' => { is_boolean => 1 },
(-)a/Koha/Schema/Result/Aqbudget.pm (-2 / +17 lines)
Lines 308-313 __PACKAGE__->belongs_to( Link Here
308
  },
308
  },
309
);
309
);
310
310
311
=head2 marc_order_accounts
312
313
Type: has_many
314
315
Related object: L<Koha::Schema::Result::MarcOrderAccount>
316
317
=cut
318
319
__PACKAGE__->has_many(
320
  "marc_order_accounts",
321
  "Koha::Schema::Result::MarcOrderAccount",
322
  { "foreign.budget_id" => "self.budget_id" },
323
  { cascade_copy => 0, cascade_delete => 0 },
324
);
325
311
=head2 suggestions
326
=head2 suggestions
312
327
313
Type: has_many
328
Type: has_many
Lines 349-356 Composing rels: L</aqbudgetborrowers> -> borrowernumber Link Here
349
__PACKAGE__->many_to_many("borrowernumbers", "aqbudgetborrowers", "borrowernumber");
364
__PACKAGE__->many_to_many("borrowernumbers", "aqbudgetborrowers", "borrowernumber");
350
365
351
366
352
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
367
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-12 16:51:53
353
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sl+TGQXY85UWwS+Ld/vvyQ
368
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pCgGAZOv1TPHe6LIQhb1BQ
354
369
355
__PACKAGE__->belongs_to(
370
__PACKAGE__->belongs_to(
356
  "budget",
371
  "budget",
(-)a/Koha/Schema/Result/MarcOrderAccount.pm (+208 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::MarcOrderAccount;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
=head1 NAME
8
9
Koha::Schema::Result::MarcOrderAccount
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<marc_order_accounts>
19
20
=cut
21
22
__PACKAGE__->table("marc_order_accounts");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
unique identifier and primary key
33
34
=head2 description
35
36
  data_type: 'varchar'
37
  is_nullable: 0
38
  size: 250
39
40
description of this account
41
42
=head2 vendor_id
43
44
  data_type: 'integer'
45
  is_foreign_key: 1
46
  is_nullable: 1
47
48
vendor id for this account
49
50
=head2 budget_id
51
52
  data_type: 'integer'
53
  is_foreign_key: 1
54
  is_nullable: 1
55
56
budget id for this account
57
58
=head2 download_directory
59
60
  data_type: 'mediumtext'
61
  is_nullable: 1
62
63
download directory for this account
64
65
=head2 matcher_id
66
67
  data_type: 'integer'
68
  is_nullable: 1
69
70
the id of the match rule used (matchpoints.matcher_id)
71
72
=head2 overlay_action
73
74
  data_type: 'varchar'
75
  is_nullable: 1
76
  size: 50
77
78
how to handle duplicate records
79
80
=head2 nomatch_action
81
82
  data_type: 'varchar'
83
  is_nullable: 1
84
  size: 50
85
86
how to handle records where no match is found
87
88
=head2 item_action
89
90
  data_type: 'varchar'
91
  is_nullable: 1
92
  size: 50
93
94
what to do with item records
95
96
=head2 parse_items
97
98
  data_type: 'tinyint'
99
  is_nullable: 1
100
101
should items be parsed
102
103
=head2 record_type
104
105
  data_type: 'varchar'
106
  is_nullable: 1
107
  size: 50
108
109
type of record in the file
110
111
=head2 encoding
112
113
  data_type: 'varchar'
114
  is_nullable: 1
115
  size: 50
116
117
file encoding
118
119
=cut
120
121
__PACKAGE__->add_columns(
122
  "id",
123
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
124
  "description",
125
  { data_type => "varchar", is_nullable => 0, size => 250 },
126
  "vendor_id",
127
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
128
  "budget_id",
129
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
130
  "download_directory",
131
  { data_type => "mediumtext", is_nullable => 1 },
132
  "matcher_id",
133
  { data_type => "integer", is_nullable => 1 },
134
  "overlay_action",
135
  { data_type => "varchar", is_nullable => 1, size => 50 },
136
  "nomatch_action",
137
  { data_type => "varchar", is_nullable => 1, size => 50 },
138
  "item_action",
139
  { data_type => "varchar", is_nullable => 1, size => 50 },
140
  "parse_items",
141
  { data_type => "tinyint", is_nullable => 1 },
142
  "record_type",
143
  { data_type => "varchar", is_nullable => 1, size => 50 },
144
  "encoding",
145
  { data_type => "varchar", is_nullable => 1, size => 50 },
146
);
147
148
=head1 PRIMARY KEY
149
150
=over 4
151
152
=item * L</id>
153
154
=back
155
156
=cut
157
158
__PACKAGE__->set_primary_key("id");
159
160
=head1 RELATIONS
161
162
=head2 budget
163
164
Type: belongs_to
165
166
Related object: L<Koha::Schema::Result::Aqbudget>
167
168
=cut
169
170
__PACKAGE__->belongs_to(
171
  "budget",
172
  "Koha::Schema::Result::Aqbudget",
173
  { budget_id => "budget_id" },
174
  {
175
    is_deferrable => 1,
176
    join_type     => "LEFT",
177
    on_delete     => "CASCADE",
178
    on_update     => "CASCADE",
179
  },
180
);
181
182
=head2 vendor
183
184
Type: belongs_to
185
186
Related object: L<Koha::Schema::Result::Aqbookseller>
187
188
=cut
189
190
__PACKAGE__->belongs_to(
191
  "vendor",
192
  "Koha::Schema::Result::Aqbookseller",
193
  { id => "vendor_id" },
194
  {
195
    is_deferrable => 1,
196
    join_type     => "LEFT",
197
    on_delete     => "CASCADE",
198
    on_update     => "CASCADE",
199
  },
200
);
201
202
203
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-18 16:31:16
204
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vMLrmisXQnn2e60qW7ppnA
205
206
207
# You can replace this text with custom code or comments, and it will be preserved on regeneration
208
1;
(-)a/installer/data/mysql/atomicupdate/bug_34355-add_marc_order_accounts.pl (+43 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "34355",
5
    description => "Add a table to allow creation of MARC order accounts and a syspref to activate it.",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        unless( TableExists('marc_order_accounts') ) {
11
            $dbh->do(q{
12
                CREATE TABLE `marc_order_accounts` (
13
                `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier and primary key',
14
                `description` varchar(250) NOT NULL COMMENT 'description of this account',
15
                `vendor_id` int(11) DEFAULT NULL COMMENT 'vendor id for this account',
16
                `budget_id` int(11) DEFAULT NULL COMMENT 'budget id for this account',
17
                `download_directory` mediumtext DEFAULT NULL COMMENT 'download directory for this account',
18
                `matcher_id` int(11) DEFAULT NULL COMMENT 'the id of the match rule used (matchpoints.matcher_id)',
19
                `overlay_action` varchar(50) DEFAULT NULL COMMENT 'how to handle duplicate records',
20
                `nomatch_action` varchar(50) DEFAULT NULL COMMENT 'how to handle records where no match is found',
21
                `item_action` varchar(50) DEFAULT NULL COMMENT 'what to do with item records',
22
                `parse_items` tinyint(1) DEFAULT NULL COMMENT 'should items be parsed',
23
                `record_type` varchar(50) DEFAULT NULL COMMENT 'type of record in the file',
24
                `encoding` varchar(50) DEFAULT NULL COMMENT 'file encoding',
25
                PRIMARY KEY (`id`),
26
                CONSTRAINT `marc_ordering_account_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
27
                CONSTRAINT `marc_ordering_account_ibfk_2` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE
28
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
29
            });
30
31
            say $out "Added new table 'marc_order_accounts'";
32
        } else {
33
            say $out "Table 'marc_order_accounts' already exists";
34
        }
35
36
        $dbh->do(
37
            q{
38
            INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('MarcOrderingAutomation', '0', 'NULL', 'Enables automatic order line creation from MARC records', 'YesNo');
39
            }
40
        );
41
42
    },
43
};
(-)a/installer/data/mysql/kohastructure.sql (+26 lines)
Lines 4092-4097 CREATE TABLE `marc_modification_templates` ( Link Here
4092
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4092
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4093
/*!40101 SET character_set_client = @saved_cs_client */;
4093
/*!40101 SET character_set_client = @saved_cs_client */;
4094
4094
4095
--
4096
-- Table structure for table `marc_order_accounts`
4097
--
4098
4099
DROP TABLE IF EXISTS `marc_order_accounts`;
4100
/*!40101 SET @saved_cs_client     = @@character_set_client */;
4101
/*!40101 SET character_set_client = utf8 */;
4102
CREATE TABLE `marc_order_accounts` (
4103
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier and primary key',
4104
  `description` varchar(250) NOT NULL COMMENT 'description of this account',
4105
  `vendor_id` int(11) DEFAULT NULL COMMENT 'vendor id for this account',
4106
  `budget_id` int(11) DEFAULT NULL COMMENT 'budget id for this account',
4107
  `download_directory` mediumtext DEFAULT NULL COMMENT 'download directory for this account',
4108
  `matcher_id` int(11) DEFAULT NULL COMMENT 'the id of the match rule used (matchpoints.matcher_id)',
4109
  `overlay_action` varchar(50) DEFAULT NULL COMMENT 'how to handle duplicate records',
4110
  `nomatch_action` varchar(50) DEFAULT NULL COMMENT 'how to handle records where no match is found',
4111
  `item_action` varchar(50) DEFAULT NULL COMMENT 'what to do with item records',
4112
  `parse_items` tinyint(1) DEFAULT NULL COMMENT 'should items be parsed',
4113
  `record_type` varchar(50) DEFAULT NULL COMMENT 'type of record in the file',
4114
  `encoding` varchar(50) DEFAULT NULL COMMENT 'file encoding',
4115
  PRIMARY KEY (`id`),
4116
  CONSTRAINT `marc_ordering_account_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
4117
  CONSTRAINT `marc_ordering_account_ibfk_2` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE
4118
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4119
/*!40101 SET character_set_client = @saved_cs_client */;
4120
4095
--
4121
--
4096
-- Table structure for table `marc_overlay_rules`
4122
-- Table structure for table `marc_overlay_rules`
4097
--
4123
--
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 373-378 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
373
('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'),
373
('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'),
374
('MarcItemFieldsToOrder','',NULL,'Set the mapping values for new item records created from a MARC record in a staged file. In a YAML format.','textarea'),
374
('MarcItemFieldsToOrder','',NULL,'Set the mapping values for new item records created from a MARC record in a staged file. In a YAML format.','textarea'),
375
('MarkLostItemsAsReturned','batchmod,moredetail,cronjob,additem,pendingreserves,onpayment','claim_returned|batchmod|moredetail|cronjob|additem|pendingreserves|onpayment','Mark items as returned when flagged as lost','multiple'),
375
('MarkLostItemsAsReturned','batchmod,moredetail,cronjob,additem,pendingreserves,onpayment','claim_returned|batchmod|moredetail|cronjob|additem|pendingreserves|onpayment','Mark items as returned when flagged as lost','multiple'),
376
('MarcOrderingAutomation','0',NULL,'Enables automatic order line creation from MARC records','YesNo'),
376
('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'),
377
('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'),
377
('MARCOverlayRules','0',NULL,'Use the MARC record overlay rules system to decide what actions to take for each field when modifying records.','YesNo'),
378
('MARCOverlayRules','0',NULL,'Use the MARC record overlay rules system to decide what actions to take for each field when modifying records.','YesNo'),
378
('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'),
379
('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'),
379
- 

Return to bug 34355