projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
faster (cached) fuzzy searches
[freeside.git]
/
FS
/
bin
/
freeside-bill
diff --git
a/FS/bin/freeside-bill
b/FS/bin/freeside-bill
index
3462fa1
..
82b3321
100755
(executable)
--- a/
FS/bin/freeside-bill
+++ b/
FS/bin/freeside-bill
@@
-1,3
+1,5
@@
+#!/usr/bin/perl -w
+# don't take any world-facing input
#!/usr/bin/perl -Tw
use strict;
#!/usr/bin/perl -Tw
use strict;
@@
-55,15
+57,19
@@
foreach $cust_main (
warn "Error billing, customer #" . $cust_main->getfield('custnum') .
":" . $error if $error;
warn "Error billing, customer #" . $cust_main->getfield('custnum') .
":" . $error if $error;
+ if ($main::opt_p) {
+ $cust_main->apply_payments;
+ $error=$cust_main->apply_credits;
+ }
+
if ($main::opt_c) {
$error=$cust_main->collect('invoice_time'=>$time,
'batch_card' => $main::opt_i ? 'no' : 'yes',
);
if ($main::opt_c) {
$error=$cust_main->collect('invoice_time'=>$time,
'batch_card' => $main::opt_i ? 'no' : 'yes',
);
- warn "Error collecting customer #" . $cust_main->getfield('custnum') .
- ":" . $error if $error;
-
- #sleep 1;
+ warn "Error collecting from customer #" . $cust_main->gcustnum. ":$error"
+ if $error;
+ #sleep 1;
}
}
}
}
@@
-89,7
+95,7
@@
freeside-bill - Command line (crontab, script) interface to customer billing.
=head1 SYNOPSIS
=head1 SYNOPSIS
- freeside-bill [ -c [ -a ] [ -i ] ] [ -d 'date' ] user [ custnum custnum ... ]
+ freeside-bill [ -c [ -
p ] [ -
a ] [ -i ] ] [ -d 'date' ] user [ custnum custnum ... ]
=head1 DESCRIPTION
=head1 DESCRIPTION
@@
-98,6
+104,9
@@
the bill and collect methods of a cust_main object. See L<FS::cust_main>.
-c: Turn on collecting (you probably want this).
-c: Turn on collecting (you probably want this).
+ -p: Apply unapplied payments and credits before collecting (you probably want
+ this too)
+
-a: Call collect even if there isn't a new invoice (probably a bad idea for
daily use)
-a: Call collect even if there isn't a new invoice (probably a bad idea for
daily use)
@@
-114,7
+123,7
@@
customers. Otherwise, bills all customers.
=head1 VERSION
=head1 VERSION
-$Id: freeside-bill,v 1.
7 2001-08-21 09:34:13
ivan Exp $
+$Id: freeside-bill,v 1.
9 2001-09-11 00:08:18
ivan Exp $
=head1 BUGS
=head1 BUGS