diff options
author | Ivan Kohler <ivan@freeside.biz> | 2016-06-10 14:21:31 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2016-06-10 14:21:31 -0700 |
commit | 87637af22ca494f84fb76cbf7591da6a7296ed76 (patch) | |
tree | 4c399b7fe9c91b80c25fd798f4345e9ea2287129 /bin/cust_pay-delete | |
parent | 6d821bf9a2419a177014cf882178370a0cdc748f (diff) |
quick payment deletion script, RT#71249
Diffstat (limited to 'bin/cust_pay-delete')
-rw-r--r-- | bin/cust_pay-delete | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/bin/cust_pay-delete b/bin/cust_pay-delete new file mode 100644 index 000000000..e266d0daa --- /dev/null +++ b/bin/cust_pay-delete @@ -0,0 +1,33 @@ +#!/usr/bin/perl + +use FS::UID qw( adminsuidsetup ); +use FS::Record qw( qsearch ); +use FS::cust_pay; + +adminsuidsetup shift or die usage(); + +my $custnum = shift or die usage(); + +my $paid = shift or die usage(); + +my $min_paynum = shift or die usage(); + +my @cust_pay = qsearch({ + 'table' => 'cust_pay', + 'hashref' => { 'custnum' => $custnum, + 'paid' => $paid, + 'paynum' => { op=>'>=', value=>$min_paynum, }, + 'payinfo' => '', + }, +}); + +die "Delete ". scalar(@cust_pay). " payments?\n"; + +#foreach my $cust_pay (@cust_pay) { +# my $error = $cust_pay->delete; +# die $error if $error; +#} + +sub usage { + "Usage: cust_pay delete username custnum paid min_paynum\n"; +} |