          'dateofbirth'  => scalar $cgi->param('fdato'),
          'cardnumber'   => scalar $cgi->param('lnr'),
          'userid'       => scalar $cgi->param('lnr'),
-@@ -118,13 +118,12 @@ if ( $op && $op eq 'search' ) {
+@@ -118,13 +119,12 @@ if ( $op && $op eq 'search' ) {
          'address2'     => scalar $cgi->param('p_adresse2'),
          'zipcode'      => scalar $cgi->param('p_postnr'),
          'city'         => scalar $cgi->param('p_sted'),

+            if ( $response->{'status'} && $response->{'status'} == 1 || ($cause && $cause =~ /Oppdaterte felt/)) {
+                $sync->update( { 'syncstatus' => 'synced', 'lastsync' => $response->{'server_tid'} } );
+            }
+        }
+
     }
     return $response;

@@ -564,6 +610,23 @@ sub _format_soap_error {

 }


 =head2 _soap_to_koha_patron

 Convert a SOAP object of type "Laaner" into a hash that can be sent to AddMember or ModMember.
@@ -635,13 +705,13 @@ sub _koha_patron_to_soap {
             SOAP::Data->name( 'fnr_hash'    => $patron_attributes->{ 'fnr' } )->type( 'string' )->type( 'string' ),
             SOAP::Data->name( 'navn'        => $patron->surname . ', ' . $patron->firstname    )->type( 'string' ),
             SOAP::Data->name( 'sist_endret' => $sync->lastsync      )->type( 'string' ),
