projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
661bc3f
)
added -f flag to continue voiding even if an error is received, RT#78977
author
Ivan Kohler
<ivan@freeside.biz>
Wed, 20 Dec 2017 20:47:49 +0000
(12:47 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Wed, 20 Dec 2017 20:47:49 +0000
(12:47 -0800)
bin/bulk_void
patch
|
blob
|
history
diff --git
a/bin/bulk_void
b/bin/bulk_void
index
f31eea5
..
5da7d15
100755
(executable)
--- a/
bin/bulk_void
+++ b/
bin/bulk_void
@@
-8,7
+8,7
@@
use File::Slurp;
use FS::Misc::Getopt;
use FS::Record qw(qsearch qsearchs dbh);
use FS::Misc::Getopt;
use FS::Record qw(qsearch qsearchs dbh);
-getopts('cpiXr:t:u:vk:');
+getopts('cpiXr:t:u:vk:
f
');
my $dbh = dbh;
$FS::UID::AutoCommit = 0;
my $dbh = dbh;
$FS::UID::AutoCommit = 0;
@@
-29,6
+29,7
@@
sub usage() {
-u: specifies a filename of customer numbers - only void for those customers
-k: skip invoices with only this pkgpart
-t: only void payments with this payby
-u: specifies a filename of customer numbers - only void for those customers
-k: skip invoices with only this pkgpart
-t: only void payments with this payby
+-f: force - continue voiding invoices even if some have errors
-v: verbose - show more detail
-X: commit changes
";
-v: verbose - show more detail
-X: commit changes
";
@@
-95,7
+96,7
@@
foreach my $k (keys %tables) {
$error = "$table #" . $record->get($record->primary_key) . ": $error";
print "$error\n";
$error_count++;
$error = "$table #" . $record->get($record->primary_key) . ": $error";
print "$error\n";
$error_count++;
- if ( $opt{X} ) {
+ if ( $opt{X}
&& ! $opt{f}
) {
$dbh->rollback;
exit(1);
}
$dbh->rollback;
exit(1);
}