projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 83122 Update method to merge dupe tax records
[freeside.git]
/
FS
/
FS
/
cust_bill.pm
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
dc63fdb
..
79a17b3
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]';
@@
-887,7
+888,7
@@
sub owed {
Returns the amount to be displayed as the "Balance Due" on this
invoice. Amount returned depends on conf flags for invoicing
Returns the amount to be displayed as the "Balance Due" on this
invoice. Amount returned depends on conf flags for invoicing
-See L<FS::cust_bill
::
owed> for the true amount currently owed
+See L<FS::cust_bill
/
owed> for the true amount currently owed
=cut
=cut
@@
-971,6
+972,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 }
@@
-1059,6
+1063,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";
}
@@
-1066,6
+1071,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
@@
-1363,7
+1369,7
@@
sub ftp_invoice {
=item spool_invoice [ TEMPLATENAME ]
=item spool_invoice [ TEMPLATENAME ]
-Spools this invoice data (see L<FS::spool_csv>)
+Spools this invoice data (see L<FS::
cust_bill/
spool_csv>)
TEMPLATENAME is unused?
TEMPLATENAME is unused?
@@
-3821,7
+3827,7
@@
The delete method.
=head1 SEE ALSO
L<FS::Record>, L<FS::cust_main>, L<FS::cust_bill_pay>, L<FS::cust_pay>,
=head1 SEE ALSO
L<FS::Record>, L<FS::cust_main>, L<FS::cust_bill_pay>, L<FS::cust_pay>,
-L<FS::cust_bill_pkg>, L<FS::cust_
bill_
credit>, schema.html from the base
+L<FS::cust_bill_pkg>, L<FS::cust_credit>, schema.html from the base
documentation.
=cut
documentation.
=cut