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/fr-FR/2-Optionel/patron_categories.sql (-9 / +9 lines)
Lines 1-15 Link Here
1
SET NAMES utf8;
1
SET NAMES utf8;
2
INSERT INTO `categories` (`categorycode`, `description`, `enrolmentperiod`, `upperagelimit`, `dateofbirthrequired`, `finetype`, `bulk`, `enrolmentfee`, `overduenoticerequired`, `issuelimit`, `reservefee`, `category_type`) VALUES 
2
INSERT INTO `categories` (`categorycode`, `description`, `enrolmentperiod`, `upperagelimit`, `dateofbirthrequired`, `finetype`, `bulk`, `enrolmentfee`, `overduenoticerequired`, `issuelimit`, `reservefee`, `category_type`, `canbeguarantee`) VALUES
3
('ADULT','Adulte',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A'),
3
('ADULT','Adulte',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0),
4
('ETUD','Etudiant',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A'),
4
('ETUD','Etudiant',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0),
5
5
6
('ENF','Enfant',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C'),
6
('ENF','Enfant',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1),
7
('ADO','Adolescent',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C'),
7
('ADO','Adolescent',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1),
8
8
9
('PROF','Professeur',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P'),
9
('PROF','Professeur',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P',1),
10
('PERS','Personnel bibliothèque',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P'),
10
('PERS','Personnel bibliothèque',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P',1),
11
11
12
('PEB','Prêt Entre Bibliothèque',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I'),
12
('PEB','Prêt Entre Bibliothèque',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0),
13
('PMI','PMI',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I'),
13
('PMI','PMI',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I'),
14
('BDP','Bibliothèque Départementale',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I');
14
('BDP','Bibliothèque Départementale',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0);
15
15
(-)a/installer/data/mysql/nb-NO/2-Valgfritt/patron_categories.sql (-13 / +13 lines)
Lines 19-44 Link Here
19
-- You should have received a copy of the GNU General Public License
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>.
20
-- along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
INSERT INTO `categories` (`categorycode`, `description`, `enrolmentperiod`, `upperagelimit`, `dateofbirthrequired`, `finetype`, `bulk`, `enrolmentfee`, `overduenoticerequired`, `issuelimit`, `reservefee`, `category_type`) VALUES 
22
INSERT INTO `categories` (`categorycode`, `description`, `enrolmentperiod`, `upperagelimit`, `dateofbirthrequired`, `finetype`, `bulk`, `enrolmentfee`, `overduenoticerequired`, `issuelimit`, `reservefee`, `category_type`, `canbeguarantee`) VALUES
23
23
24
-- Adult Patrons
24
-- Adult Patrons
25
('PT','Låner',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A'),
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'),
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'),
27
('HB','Hjemmelåner',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0),
28
28
29
-- Children
29
-- Children
30
('K','Barn',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C'),
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'),
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'),
32
('YA','Ung voksen',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1),
33
33
34
-- Professionals
34
-- Professionals
35
('T','Lærer',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P'),
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'),
36
('B','Styremedlem',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','P',1),
37
37
38
-- Institutional
38
-- Institutional
39
('IL','Fjernlån',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I'),
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'),
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'),
41
('L','Bibliotek',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0),
42
42
43
-- Staff
43
-- Staff
44
('S','Bibliotekansatt',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','S');
44
('S','Bibliotekansatt',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','S',0);
(-)a/t/db_dependent/Patrons.t (-6 / +5 lines)
Lines 201-213 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');
204
 
205
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantees were not removed when made adult which can be guarantee');
206
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');
210
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
 
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
    is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,0,'Guarantee was removed when made adult');
213
    is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,0,'Guarantee was removed when made adult');
214
- 

Return to bug 12446