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

(-)a/installer/data/mysql/en/optional/patron_categories.yml (+5 lines)
Lines 99-104 tables: Link Here
99
          issuelimit: ~
99
          issuelimit: ~
100
          reservefee: '0.000000'
100
          reservefee: '0.000000'
101
          category_type: 'C'
101
          category_type: 'C'
102
          canbeguarantee: 1
102
103
103
        - categorycode: 'J'
104
        - categorycode: 'J'
104
          description: 'Juvenile'
105
          description: 'Juvenile'
Lines 112-117 tables: Link Here
112
          issuelimit: ~
113
          issuelimit: ~
113
          reservefee: '0.000000'
114
          reservefee: '0.000000'
114
          category_type: 'C'
115
          category_type: 'C'
116
          canbeguarantee: 1
115
117
116
        - categorycode: 'YA'
118
        - categorycode: 'YA'
117
          description: 'Young Adult'
119
          description: 'Young Adult'
Lines 125-130 tables: Link Here
125
          issuelimit: ~
127
          issuelimit: ~
126
          reservefee: '0.000000'
128
          reservefee: '0.000000'
127
          category_type: 'C'
129
          category_type: 'C'
130
          canbeguarantee: 1
128
131
129
        #  Professionals
132
        #  Professionals
130
        - categorycode: 'T'
133
        - categorycode: 'T'
Lines 139-144 tables: Link Here
139
          issuelimit: ~
142
          issuelimit: ~
140
          reservefee: '0.000000'
143
          reservefee: '0.000000'
141
          category_type: 'P'
144
          category_type: 'P'
145
          canbeguarantee: 1
142
146
143
        - categorycode: 'B'
147
        - categorycode: 'B'
144
          description: 'Board'
148
          description: 'Board'
Lines 152-157 tables: Link Here
152
          issuelimit: ~
156
          issuelimit: ~
153
          reservefee: '0.000000'
157
          reservefee: '0.000000'
154
          category_type: 'P'
158
          category_type: 'P'
159
          canbeguarantee: 1
155
160
156
        #  Institutional
161
        #  Institutional
157
        - categorycode: 'IL'
162
        - categorycode: 'IL'
(-)a/installer/data/mysql/nb-NO/2-Valgfritt/patron_categories.sql (+44 lines)
Line 0 Link Here
1
--
2
-- Default classification sources and filing rules
3
-- for Koha.
4
--
5
-- Copyright (C) 2011 Magnus Enger Libriotech
6
--
7
-- This file is part of Koha.
8
--
9
-- Koha is free software; you can redistribute it and/or modify it
10
-- under the terms of the GNU General Public License as published by
11
-- the Free Software Foundation; either version 3 of the License, or
12
-- (at your option) any later version.
13
--
14
-- Koha is distributed in the hope that it will be useful, but
15
-- WITHOUT ANY WARRANTY; without even the implied warranty of
16
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
-- GNU General Public License for more details.
18
--
19
-- You should have received a copy of the GNU General Public License
20
-- along with Koha; if not, see <http://www.gnu.org/licenses>.
21
22
INSERT INTO `categories` (`categorycode`, `description`, `enrolmentperiod`, `upperagelimit`, `dateofbirthrequired`, `finetype`, `bulk`, `enrolmentfee`, `overduenoticerequired`, `issuelimit`, `reservefee`, `category_type`, `canbeguarantee`) VALUES
23
24
-- Adult Patrons
25
('PT','Låner',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0),
26
('ST','Student',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0),
27
('HB','Hjemmelåner',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0),
28
29
-- Children
30
('K','Barn',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1),
31
('J','Ungdom',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1),
32
('YA','Ung voksen',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1),
33
34
-- Professionals
35
('T','Lærer',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P',1),
36
('B','Styremedlem',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','P',1),
37
38
-- Institutional
39
('IL','Fjernlån',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0),
40
('SC','Skole',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0),
41
('L','Bibliotek',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0),
42
43
-- Staff
44
('S','Bibliotekansatt',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','S',0);
(-)a/t/db_dependent/Patrons.t (-4 / +3 lines)
Lines 201-212 subtest "Update patron categories" => sub { Link Here
201
    is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->next->borrowernumber, $child1->borrowernumber );
201
    is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->next->borrowernumber, $child1->borrowernumber );
202
    is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category because too young');
202
    is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category because too young');
203
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantee was removed when made adult');
203
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantee was removed when made adult');
204
    is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2})->update_category_to({category=>$a_categorycode_2}),2,'Two child patrons updated to adult category');
205
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantees were not removed when made adult which can be guarantee');
206
204
207
    is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_old=>1})->next->borrowernumber, $child3->borrowernumber );
205
    is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_old=>1})->next->borrowernumber, $child3->borrowernumber );
208
    is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_old=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category because too old');
206
             is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_old=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category because too old');
209
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantee was removed when made adult');
207
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantee was removed when made adult');
208
    is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2})->update_category_to({category=>$a_categorycode_2}),1,'Two child patrons updated to adult category');
209
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantees were not removed when made adult which can be guarantee');
210
210
211
    is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantor has 1 guarantees');
211
    is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantor has 1 guarantees');
212
    is( Koha::Patrons->search_patrons_to_update_category({from=>$p_categorycode})->update_category_to({category=>$a_categorycode}),1,'One professional patron updated to adult category');
212
    is( Koha::Patrons->search_patrons_to_update_category({from=>$p_categorycode})->update_category_to({category=>$a_categorycode}),1,'One professional patron updated to adult category');
213
- 

Return to bug 12446