summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorivan <ivan>2005-06-09 00:18:35 +0000
committerivan <ivan>2005-06-09 00:18:35 +0000
commitc6c8e2d15723eb0aed516664025b9bd9d57a2528 (patch)
treeb205d68da7a1035e406309abe8e0ea6b0fbdd5af /FS/FS
parentd7ca7fe2132e626d6f4e65905f7592ce1789e39c (diff)
add ignore_noapply flag to make sure payments are forced in anyway on import
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/cust_pay.pm13
1 files 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";
+ }
}
}