summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2002-10-23 15:49:36 +0000
committerivan <ivan>2002-10-23 15:49:36 +0000
commitecd7a1cdcae16f2f59c9c75cac8aeec2e3c3d7a1 (patch)
tree16cd32e31ca71f00a8a4792ec234709036a43a0c
parent15fa242e2c0e69107f6122b4f7402a0e7302c1fb (diff)
add option to unapply payments
-rw-r--r--FS/FS/Conf.pm7
-rwxr-xr-xhttemplate/misc/unapply-cust_pay.cgi18
2 files changed, 25 insertions, 0 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 8befed451..3f6d652e0 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -325,6 +325,13 @@ httemplate/docs/config.html
},
{
+ 'key' => 'unapplypayments',
+ 'section' => 'UI',
+ 'description' => 'Enable "unapplication" of unclosed payments.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'dirhash',
'section' => 'shell',
'description' => 'Optional numeric value to control directory hashing. If positive, hashes directories for the specified number of levels from the front of the username. If negative, hashes directories for the specified number of levels from the end of the username. Some examples: <ul><li>1: user -> <a href="#home">/home</a>/u/user<li>2: user -> <a href="#home">/home</a>/u/s/user<li>-1: user -> <a href="#home">/home</a>/r/user<li>-2: user -> <a href="#home">home</a>/r/e/user</ul>',
diff --git a/httemplate/misc/unapply-cust_pay.cgi b/httemplate/misc/unapply-cust_pay.cgi
new file mode 100755
index 000000000..28643ef6e
--- /dev/null
+++ b/httemplate/misc/unapply-cust_pay.cgi
@@ -0,0 +1,18 @@
+<%
+
+#untaint paynum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal paynum";
+my $paynum = $1;
+
+my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } );
+my $custnum = $cust_pay->custnum;
+
+foreach my $cust_bill_pay ( $cust_pay->cust_bill_pay ) {
+ my $error = $cust_bill_pay->delete;
+ eidiot($error) if $error;
+}
+
+print $cgi->redirect($p. "view/cust_main.cgi?". $custnum);
+
+%>