| 
      
            Lines 18-24
          
      
      
        Link Here
      
     | 
  
        
          | 18 | 
          # along with Koha; if not, see <http://www.gnu.org/licenses>.  | 
          18 | 
          # along with Koha; if not, see <http://www.gnu.org/licenses>.  | 
        
        
          | 19 | 
           | 
          19 | 
           | 
        
        
          | 20 | 
          use Modern::Perl;  | 
          20 | 
          use Modern::Perl;  | 
        
          
            
              | 21 | 
              use Test::More tests => 172;  | 
              21 | 
              use Test::More tests => 174;  | 
            
        
          | 22 | 
          use Test::Warn;  | 
          22 | 
          use Test::Warn;  | 
        
        
          | 23 | 
          use Encode qw( encode_utf8 );  | 
          23 | 
          use Encode qw( encode_utf8 );  | 
        
        
          | 24 | 
          use utf8;  | 
          24 | 
          use utf8;  | 
        
  
    | 
      
            Lines 188-194
          is($result_3a->{overwritten}, 1, 'Got the expected 1 overwritten result from imp
      
      
        Link Here
      
     | 
  
        
          | 188 | 
          # overwrite but firstname is not  | 
          188 | 
          # overwrite but firstname is not  | 
        
        
          | 189 | 
          my $filename_3c = make_csv($temp_dir, $csv_headers, $csv_one_line_b);  | 
          189 | 
          my $filename_3c = make_csv($temp_dir, $csv_headers, $csv_one_line_b);  | 
        
        
          | 190 | 
          open(my $handle_3c, "<", $filename_3c) or die "cannot open < $filename_3: $!";  | 
          190 | 
          open(my $handle_3c, "<", $filename_3c) or die "cannot open < $filename_3: $!";  | 
        
          
            
              | 191 | 
              my $params_3c = { file => $handle_3c, matchpoint => 'cardnumber', overwrite_cardnumber => 1, preserve_fields => [ 'firstname' ] }; | 
              191 | 
              my $params_3c = { file => $handle_3c, matchpoint => 'cardnumber', overwrite_cardnumber => 1, preserve_fields => [ 'firstname' ], update_dateexpiry => 1 }; | 
            
            
               | 
               | 
              192 | 
               | 
            
            
              | 193 | 
              my $patron_3 = Koha::Patrons->find({ cardnumber => '1000' }); | 
            
            
              | 194 | 
              is( $patron_3->dateexpiry, '2015-07-01', "Expiration date is correct with update_dateexpiry = false" );  | 
            
        
          | 192 | 
           | 
          195 | 
           | 
        
        
          | 193 | 
          # When ...  | 
          196 | 
          # When ...  | 
        
        
          | 194 | 
          my $result_3c;  | 
          197 | 
          my $result_3c;  | 
        
  
    | 
      
            Lines 210-215
          is($result_3c->{invalid}, 0, 'Got the expected 0 invalid result from import_patr
      
      
        Link Here
      
     | 
  
        
          | 210 | 
          is($result_3c->{overwritten}, 1, 'Got the expected 1 overwritten result from import_patrons that matched'); | 
          213 | 
          is($result_3c->{overwritten}, 1, 'Got the expected 1 overwritten result from import_patrons that matched'); | 
        
        
          | 211 | 
           | 
          214 | 
           | 
        
        
          | 212 | 
          my $patron_3c = Koha::Patrons->find({ cardnumber => '1000' }); | 
          215 | 
          my $patron_3c = Koha::Patrons->find({ cardnumber => '1000' }); | 
        
            
               | 
               | 
              216 | 
              is( $patron_3c->dateexpiry, '2023-03-28', "Expiration date is correct with update_dateexpiry = true" );  | 
            
            
              | 217 | 
               | 
            
        
          | 213 | 
          is( $patron_3c->surname, "Nancy2", "Surname field is preserved from original" );  | 
          218 | 
          is( $patron_3c->surname, "Nancy2", "Surname field is preserved from original" );  | 
        
        
          | 214 | 
          is( $patron_3c->firstname, "Jenkins", "Firstname field is overwritten" );  | 
          219 | 
          is( $patron_3c->firstname, "Jenkins", "Firstname field is overwritten" );  | 
        
        
          | 215 | 
           | 
          220 | 
           |