From b11ef508e2753fd1361acb903ef7ea2fcada71dc Mon Sep 17 00:00:00 2001
From: Maryse Simard <maryse.simard@inlibro.com>
Date: Thu, 12 Nov 2020 16:01:35 -0500
Subject: [PATCH] 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: 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>
---
 installer/data/mysql/en/optional/patron_categories.yml | 10 +++++-----
 t/db_dependent/Patrons.t                               |  2 --
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/installer/data/mysql/en/optional/patron_categories.yml b/installer/data/mysql/en/optional/patron_categories.yml
index 3fb0a13ef8..7d0e76a554 100644
--- a/installer/data/mysql/en/optional/patron_categories.yml
+++ b/installer/data/mysql/en/optional/patron_categories.yml
@@ -102,7 +102,7 @@ tables:
           issuelimit: ~
           reservefee: '0.000000'
           category_type: 'C'
-          can_be_guarantee: 1
+          canbeguarantee: 1
 
         - categorycode: 'J'
           description: 'Juvenile'
@@ -116,7 +116,7 @@ tables:
           issuelimit: ~
           reservefee: '0.000000'
           category_type: 'C'
-          can_be_guarantee: 1
+          canbeguarantee: 1
 
         - categorycode: 'YA'
           description: 'Young Adult'
@@ -130,7 +130,7 @@ tables:
           issuelimit: ~
           reservefee: '0.000000'
           category_type: 'C'
-          can_be_guarantee: 1
+          canbeguarantee: 1
 
         #  Professionals
         - categorycode: 'T'
@@ -145,7 +145,7 @@ tables:
           issuelimit: ~
           reservefee: '0.000000'
           category_type: 'P'
-          can_be_guarantee: 1
+          canbeguarantee: 1
 
         - categorycode: 'B'
           description: 'Board'
@@ -159,7 +159,7 @@ tables:
           issuelimit: ~
           reservefee: '0.000000'
           category_type: 'P'
-          can_be_guarantee: 1
+          canbeguarantee: 1
 
         #  Institutional
         - categorycode: 'IL'
diff --git a/t/db_dependent/Patrons.t b/t/db_dependent/Patrons.t
index 6f1bae3f0c..6e34ec548f 100755
--- a/t/db_dependent/Patrons.t
+++ b/t/db_dependent/Patrons.t
@@ -201,8 +201,6 @@ 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');
-- 
2.34.1