summaryrefslogtreecommitdiff
path: root/FS/bin
diff options
context:
space:
mode:
authorivan <ivan>2007-07-13 23:52:23 +0000
committerivan <ivan>2007-07-13 23:52:23 +0000
commit9035034a53d60cb7a7687dfee899c1d0c775ea74 (patch)
tree80a6dc3d257fa24b2097746e4b8f074a420dfdd9 /FS/bin
parentae5b57a84d549166bae637c0c01db0b9e09b138f (diff)
fix race condition where ->apply_payments_and_credits could double-apply in rare cases
Diffstat (limited to 'FS/bin')
-rw-r--r--FS/bin/freeside-prepaidd8
1 files changed, 5 insertions, 3 deletions
diff --git a/FS/bin/freeside-prepaidd b/FS/bin/freeside-prepaidd
index 73f7523c4..a68db3913 100644
--- a/FS/bin/freeside-prepaidd
+++ b/FS/bin/freeside-prepaidd
@@ -52,9 +52,11 @@ while (1) {
warn "Error billing customer #". $cust_main->custnum;
next;
}
- #$b_error = $cust_main->apply_payments_and_credits;
- $b_error = $cust_main->apply_payments;
- $b_error = $cust_main->apply_credits;
+ $b_error = $cust_main->apply_payments_and_credits;
+ if ( $b_error ) {
+ warn "Error applying payments&credits, customer #". $cust_main->custnum;
+ next;
+ }
$work_cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $work_cust_pkg->pkgnum } );