Bug 12446: Add canbeguarantee value to patron categories sample data

This patch changes sample data so patron categories of type 'C' or
'P' can be guarantees by default.

Signed-off-by: Salman Ali <salman.ali@inlibro.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Maryse Simard 2020-11-12 16:01:35 -05:00 committed by Tomas Cohen Arazi
parent eae7eb4dc0
commit 58e6cf9845
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 7 additions and 2 deletions

View file

@ -99,6 +99,7 @@ tables:
issuelimit: ~
reservefee: '0.000000'
category_type: 'C'
canbeguarantee: 1
- categorycode: 'J'
description: 'Juvenile'
@ -112,6 +113,7 @@ tables:
issuelimit: ~
reservefee: '0.000000'
category_type: 'C'
canbeguarantee: 1
- categorycode: 'YA'
description: 'Young Adult'
@ -125,6 +127,7 @@ tables:
issuelimit: ~
reservefee: '0.000000'
category_type: 'C'
canbeguarantee: 1
# Professionals
- categorycode: 'T'
@ -139,6 +142,7 @@ tables:
issuelimit: ~
reservefee: '0.000000'
category_type: 'P'
canbeguarantee: 1
- categorycode: 'B'
description: 'Board'
@ -152,6 +156,7 @@ tables:
issuelimit: ~
reservefee: '0.000000'
category_type: 'P'
canbeguarantee: 1
# Institutional
- categorycode: 'IL'

View file

@ -201,12 +201,12 @@ subtest "Update patron categories" => sub {
is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->next->borrowernumber, $child1->borrowernumber );
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');
is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantee was removed when made adult');
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');
is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantees were not removed when made adult which can be guarantee');
is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_old=>1})->next->borrowernumber, $child3->borrowernumber );
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');
is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantee was removed when made adult');
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');
is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantees were not removed when made adult which can be guarantee');
is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantor has 1 guarantees');
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');