      }
      return $response;
 
-@@ -426,7 +479,7 @@ sub NLUpdateHashedPIN {
-     my $borrowersync = Koha::Database->new->schema->resultset('BorrowerSync')->find({
-         'synctype'       => 'norwegianpatrondb',
-         'borrowernumber' => $borrowernumber,
--        });
-+    });
-     return $borrowersync->update({ 'hashed_pin', _encrypt_pin( $pin ) });
-
- }
 @@ -564,6 +617,23 @@ sub _format_soap_error {
 
  }

         'dateexpiry'   => scalar $cgi->param('gyldig_til'),
         'email'        => scalar $cgi->param('epost'),
         'mobile'       => scalar $cgi->param('tlf_mobil'),
@@ -133,6 +132,10 @@ if ( $op && $op eq 'search' ) {
         'branchcode'   => $userenv->{'branch'},
         'categorycode' => scalar $cgi->param('categorycode'),
     );
+    # Some patrons do not have a PIN-code in NL
+    if ( $cgi->param('pin') ne "" ) {
+         $borrower{'password'} = NLDecodePin( $cgi->param('pin') );
+    }
     # Add the new patron
     my $borrowernumber = &AddMember(%borrower);
     if ( $borrowernumber ) {
@@ -147,7 +150,9 @@ if ( $op && $op eq 'search' ) {
         });
         $borrowersync->update({ 'syncstatus', 'synced' });
         $borrowersync->update({ 'lastsync',   $cgi->param('sist_endret') });
-        $borrowersync->update({ 'hashed_pin', $cgi->param('pin') });
+        if ( $cgi->param('pin') ne "" ) {
+            $borrowersync->update({ 'hashed_pin', $cgi->param('pin') });
+        }
         # Try to sync in real time. If this fails it will be picked up by the cronjob
         NLSync({ 'borrowernumber' => $borrowernumber });
         # Redirect to the edit screen
diff --git a/misc/cronjobs/nl-sync-from-koha.pl b/misc/cronjobs/nl-sync-from-koha.pl
index 81e3218..96911a9 100755
--- a/misc/cronjobs/nl-sync-from-koha.pl



diff --git a/Koha/NorwegianPatronDB.pm b/Koha/NorwegianPatronDB.pm
index 237ddd7..c4209c7 100644
--- a/Koha/NorwegianPatronDB.pm
+++ b/Koha/NorwegianPatronDB.pm
@@ -74,6 +74,7 @@ our %EXPORT_TAGS = ( all => [qw(
