summaryrefslogtreecommitdiff
path: root/FS/bin/freeside-prepaidd
diff options
context:
space:
mode:
authorcvs2git <cvs2git>2010-11-05 19:05:57 +0000
committercvs2git <cvs2git>2010-11-05 19:05:57 +0000
commitaaf8baf3662e16e9414de236a39f8801a8c41b01 (patch)
tree2cda603e4311b3e80f79b93d9bcce3a7c7c2d053 /FS/bin/freeside-prepaidd
parent995a145c931164347683071c95c6754379d36604 (diff)
parent9b2de4257b6a2877434008188e52b8ef71ff339d (diff)
This commit was manufactured by cvs2svn to create branch
'FREESIDE_2_1_BRANCH'.
Diffstat (limited to 'FS/bin/freeside-prepaidd')
-rw-r--r--FS/bin/freeside-prepaidd15
1 files changed, 12 insertions, 3 deletions
diff --git a/FS/bin/freeside-prepaidd b/FS/bin/freeside-prepaidd
index 86bfe8794..05b068b02 100644
--- a/FS/bin/freeside-prepaidd
+++ b/FS/bin/freeside-prepaidd
@@ -41,21 +41,30 @@ while (1) {
my $work_cust_pkg = $cust_pkg;
my $cust_main = $cust_pkg->cust_main;
+
+ #insurance: somehow winding up here without things properly applied...
+ my $a_error = $cust_main->apply_payments_and_credits;
+ if ( $a_error ) {
+ warn "Error applying payments&credits, customer #". $cust_main->custnum;
+ next;
+ }
+
if ( $cust_main->total_unapplied_payments > 0
- or $cust_main->total_credited > 0
+ || $cust_main->total_unapplied_credits > 0
)
{
+
#this needs a flag to say only do the prepaid packages...
# and only try em if the renewal price matches.. but this will do for now
my $b_error = $cust_main->bill;
if ( $b_error ) {
warn "Error billing customer #". $cust_main->custnum;
- next;
+ next;
}
$b_error = $cust_main->apply_payments_and_credits;
if ( $b_error ) {
warn "Error applying payments&credits, customer #". $cust_main->custnum;
- next;
+ next;
}
$work_cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $work_cust_pkg->pkgnum } );