X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_Common.pm;h=659255eaaf7b3547f01b87622b770643ec736807;hb=619b5649552e11eeef2cae712b923d7e0f6d3f43;hp=3993d3d64aeb011032f427cc386c386a1441ef4f;hpb=f1a024ad18faf7246176f7679f0443e0377785b6;p=freeside.git diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm index 3993d3d64..659255eaa 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -335,6 +335,8 @@ sub preinsert_hook_first { ''; } sub _check_duplcate { ''; } sub preinsert_hook { ''; } sub table_dupcheck_fields { (); } +sub prereplace_hook { ''; } +sub prereplace_hook_first { ''; } sub predelete_hook { ''; } sub predelete_hook_first { ''; } @@ -472,15 +474,10 @@ sub replace { local $FS::UID::AutoCommit = 0; my $dbh = dbh; - my $error = $new->set_auto_inventory($old); - if ( $error ) { - $dbh->rollback if $oldAutoCommit; - return $error; - } - - #redundant, but so any duplicate fields are maniuplated as appropriate - # (svc_phone.phonenum) - $error = $new->check; + my $error = $new->prereplace_hook_first($old) + || $new->set_auto_inventory($old) + || $new->check; #redundant, but so any duplicate fields are + #maniuplated as appropriate (svc_phone.phonenum) if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error;