X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_credit.pm;h=026b92e84431c3f8f0936bfcbe5e011454b0cd31;hb=e96a3fd1c8ee8c711a7e119c0937da6866bbd4f0;hp=19a54534f1c2aea886b406792b2fee50d5adbcd5;hpb=c085c3ba3bd0677719407ce613dd24466f05abe2;p=freeside.git diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm index 19a54534f..026b92e84 100644 --- a/FS/FS/cust_credit.pm +++ b/FS/FS/cust_credit.pm @@ -106,6 +106,8 @@ sub insert { return "error inserting $self: $error"; } + $dbh->commit or die $dbh->errstr if $oldAutoCommit; + #false laziness w/ cust_credit::insert if ( $unsuspendauto && $old_balance && $cust_main->balance <= 0 ) { my @errors = $cust_main->unsuspend; @@ -300,6 +302,18 @@ sub credited { sprintf( "%.2f", $amount ); } +=item cust_main + +Returns the customer (see L) for this credit. + +=cut + +sub cust_main { + my $self = shift; + qsearchs( 'cust_main', { 'custnum' => $self->custnum } ); +} + + =back =head1 BUGS