From c6c8e2d15723eb0aed516664025b9bd9d57a2528 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 9 Jun 2005 00:18:35 +0000 Subject: [PATCH] add ignore_noapply flag to make sure payments are forced in anyway on import --- FS/FS/cust_pay.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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"; + } } } -- 2.11.0