From: ivan Date: Thu, 9 Jun 2005 00:18:35 +0000 (+0000) Subject: add ignore_noapply flag to make sure payments are forced in anyway on import X-Git-Tag: BEFORE_FINAL_MASONIZE~484 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=c6c8e2d15723eb0aed516664025b9bd9d57a2528 add ignore_noapply flag to make sure payments are forced in anyway on import --- diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 201ada91c..ccf991dc1 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -1,7 +1,7 @@ package FS::cust_pay; use strict; -use vars qw( @ISA $conf $unsuspendauto ); +use vars qw( @ISA $conf $unsuspendauto $ignore_noapply ); use Date::Format; use Business::CreditCard; use Text::Template; @@ -15,6 +15,8 @@ use FS::cust_pay_void; @ISA = qw( FS::Record ); +$ignore_noapply = 0; + #ask FS::UID to run this stuff for us later FS::UID->install_callback( sub { $conf = new FS::Conf; @@ -134,8 +136,13 @@ sub insert { }; $error = $cust_bill_pay->insert; if ( $error ) { - $dbh->rollback if $oldAutoCommit; - return "error inserting $cust_bill_pay: $error"; + if ( $ignore_noapply ) { + warn "warning: error inserting $cust_bill_pay: $error ". + "(ignore_noapply flag set; inserting cust_pay record anyway)\n"; + } else { + $dbh->rollback if $oldAutoCommit; + return "error inserting $cust_bill_pay: $error"; + } } }