projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cf73071
)
package expiration
author
ivan
<ivan>
Thu, 19 Sep 2002 08:43:03 +0000
(08:43 +0000)
committer
ivan
<ivan>
Thu, 19 Sep 2002 08:43:03 +0000
(08:43 +0000)
FS/bin/freeside-daily
patch
|
blob
|
history
diff --git
a/FS/bin/freeside-daily
b/FS/bin/freeside-daily
index
142b0c7
..
22bf2c9
100755
(executable)
--- a/
FS/bin/freeside-daily
+++ b/
FS/bin/freeside-daily
@@
-28,15
+28,23
@@
my($time)= $opt_d ? str2time($opt_d) : $^T;
my($cust_main,%saw);
foreach $cust_main ( @cust_main ) {
my($cust_main,%saw);
foreach $cust_main ( @cust_main ) {
- my $error;
+ # $^T not $time because -d is for pre-printing invoices
+ foreach my $cust_pkg (
+ grep { $_->expire && $_->expire >= $^T } $cust_main->ncancelled_pkgs
+ ) {
+ my $error = $cust_pkg->cancel;
+ warn "Error cancelling expired pkg ". $cust_pkg->pkgnum. " for custnum ".
+ $cust_main->custnum. ": $error"
+ if $error;
+ }
- $error = $cust_main->bill( 'time' => $time );
+
my
$error = $cust_main->bill( 'time' => $time );
warn "Error billing, custnum ". $cust_main->custnum. ": $error" if $error;
$cust_main->apply_payments;
$cust_main->apply_credits;
warn "Error billing, custnum ". $cust_main->custnum. ": $error" if $error;
$cust_main->apply_payments;
$cust_main->apply_credits;
- $error
=
$cust_main->collect( 'invoice_time' => $time );
+ $error
=
$cust_main->collect( 'invoice_time' => $time );
warn "Error collecting, custnum". $cust_main->custnum. ": $error" if $error;
}
warn "Error collecting, custnum". $cust_main->custnum. ": $error" if $error;
}