projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 81249 - added ability to validate price plan option fields
[freeside.git]
/
FS
/
FS
/
cust_bill.pm
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
0a735f7
..
7158cb2
100644
(file)
--- a/
FS/FS/cust_bill.pm
+++ b/
FS/FS/cust_bill.pm
@@
-41,6
+41,7
@@
use FS::cust_bill_void;
use FS::reason;
use FS::reason_type;
use FS::L10N;
use FS::reason;
use FS::reason_type;
use FS::L10N;
+use FS::Misc::Savepoint;
$DEBUG = 0;
$me = '[FS::cust_bill]';
$DEBUG = 0;
$me = '[FS::cust_bill]';
@@
-974,6
+975,9
@@
sub apply_payments_and_credits {
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
+ my $savepoint_label = 'cust_bill__apply_payments_and_credits';
+ savepoint_create( $savepoint_label );
+
$self->select_for_update; #mutex
my @payments = grep { $_->unapplied > 0 }
$self->select_for_update; #mutex
my @payments = grep { $_->unapplied > 0 }
@@
-1062,6
+1066,7
@@
sub apply_payments_and_credits {
my $error = $app->insert(%options);
if ( $error ) {
my $error = $app->insert(%options);
if ( $error ) {
+ savepoint_rollback_and_release( $savepoint_label );
$dbh->rollback if $oldAutoCommit;
return "Error inserting ". $app->table. " record: $error";
}
$dbh->rollback if $oldAutoCommit;
return "Error inserting ". $app->table. " record: $error";
}
@@
-1069,6
+1074,7
@@
sub apply_payments_and_credits {
}
}
+ savepoint_release( $savepoint_label );
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
''; #no error
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
''; #no error
@@
-1405,6
+1411,11
@@
See L</print_csv> for a description of the output format.
sub send_csv {
my($self, %opt) = @_;
sub send_csv {
my($self, %opt) = @_;
+ if ( $FS::Misc::DISABLE_ALL_NOTICES ) {
+ warn 'send_csv() disabled by $FS::Misc::DISABLE_ALL_NOTICES' if $DEBUG;
+ return;
+ }
+
#create file(s)
my $spooldir = "/usr/local/etc/freeside/export.". datasrc. "/cust_bill";
#create file(s)
my $spooldir = "/usr/local/etc/freeside/export.". datasrc. "/cust_bill";
@@
-1481,6
+1492,11
@@
in the ICS format.
sub spool_csv {
my($self, %opt) = @_;
sub spool_csv {
my($self, %opt) = @_;
+ if ( $FS::Misc::DISABLE_ALL_NOTICES ) {
+ warn 'spool_csv() disabled by $FS::Misc::DISABLE_ALL_NOTICES' if $DEBUG;
+ return;
+ }
+
my $time = $opt{'time'} || time;
my $cust_main = $self->cust_main;
my $time = $opt{'time'} || time;
my $cust_main = $self->cust_main;