+ my($self, $new, $old) = (shift, shift, shift);
+
+ my %schema = $self->_schema_map;
+ my %static = $self->_static_map;
+
+ my @primary_key = ();
+ if ( $self->option('primary_key') =~ /,/ ) {
+ foreach my $key ( split(/\s*,\s*/, $self->option('primary_key') ) ) {
+ my $keymap = $schema{$key};
+ push @primary_key, $old->$keymap();
+ }
+ } else {
+ my $keymap = $schema{$self->option('primary_key')};
+ push @primary_key, $old->$keymap();
+ }
+
+ my %record = (
+
+ ( map { $_ => $static{$_} } keys %static ),
+
+ ( map { my $value = $schema{$_};
+ my @arg = ();
+ push @arg, $self->option('crypt')
+ if $value eq 'crypt_password' && $self->option('crypt');
+ $_ => $new->$value(@arg);
+ } keys %schema
+ ),
+
+ );
+
+ my $err_or_queue = $self->acct_sql_queue(
+ $new->svcnum,
+ 'replace',
+ $self->option('table'),
+ $self->option('primary_key'), @primary_key,
+ %record,
+ );
+ return $err_or_queue unless ref($err_or_queue);
+ '';