summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/browse/agent_type.cgi6
-rwxr-xr-xhttemplate/browse/nas.cgi1
-rwxr-xr-xhttemplate/misc/delete-cust_pay.cgi17
-rwxr-xr-xhttemplate/view/cust_main.cgi25
4 files changed, 42 insertions, 7 deletions
diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi
index 8321048e7..d75c45081 100755
--- a/httemplate/browse/agent_type.cgi
+++ b/httemplate/browse/agent_type.cgi
@@ -1,4 +1,4 @@
-<!-- $Id: agent_type.cgi,v 1.7 2002-01-30 14:18:08 ivan Exp $ -->
+<!-- $Id: agent_type.cgi,v 1.8 2002-02-07 22:29:34 ivan Exp $ -->
<%
print header("Agent Type Listing", menubar(
@@ -7,7 +7,7 @@ print header("Agent Type Listing", menubar(
" particular agents.<BR><BR>", &table(), <<END;
<TR>
<TH COLSPAN=2>Agent Type</TH>
- <TH COLSPAN="2">Packages</TH>
+ <TH COLSPAN=2>Packages</TH>
</TR>
END
@@ -47,7 +47,7 @@ END
}
print <<END;
- <TR><TD COLSPAN=2><I><A HREF="${p}edit/agent_type.cgi">Add a new agent type</A></I></TD></TR>
+ <TR><TD COLSPAN=4><I><A HREF="${p}edit/agent_type.cgi">Add a new agent type</A></I></TD></TR>
</TABLE>
</BODY>
</HTML>
diff --git a/httemplate/browse/nas.cgi b/httemplate/browse/nas.cgi
index b392dc083..2bac9909f 100755
--- a/httemplate/browse/nas.cgi
+++ b/httemplate/browse/nas.cgi
@@ -45,6 +45,7 @@ foreach my $nas ( sort { $a->nasnum <=> $b->nasnum } qsearch( 'nas', {} ) ) {
print "</TABLE><BR>";
}
+#Time::Duration??
sub pretty_interval {
my $interval = shift;
my %howlong = (
diff --git a/httemplate/misc/delete-cust_pay.cgi b/httemplate/misc/delete-cust_pay.cgi
new file mode 100755
index 000000000..3fb786d7d
--- /dev/null
+++ b/httemplate/misc/delete-cust_pay.cgi
@@ -0,0 +1,17 @@
+<!-- $Id: delete-cust_pay.cgi,v 1.1 2002-02-07 22:29:35 ivan Exp $ -->
+<%
+
+#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;
+
+my $error = $cust_pay->delete;
+eidiot($error) if $error;
+
+print $cgi->redirect($p. "view/cust_main.cgi?". $custnum);
+
+%>
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 9595a07e1..dc4760d73 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -1,4 +1,4 @@
-<!-- $Id: cust_main.cgi,v 1.19 2002-01-30 14:18:09 ivan Exp $ -->
+<!-- $Id: cust_main.cgi,v 1.20 2002-02-07 22:29:35 ivan Exp $ -->
<%
my $conf = new FS::Conf;
@@ -324,6 +324,16 @@ print "</TR>";
#formatting
print "</TABLE>";
+print <<END;
+<SCRIPT>
+function areyousure(href) {
+ if (confirm("Are you sure you want to delete this payment?")
+ == true)
+ window.location.href = href;
+}
+</SCRIPT>
+END
+
#formatting
print qq!<BR><BR><A NAME="history">Payment History!.
qq!</A> ( !.
@@ -371,8 +381,11 @@ foreach my $bill (@bills) {
my $target = "$payby$payinfo";
$payby =~ s/^BILL$/Check #/ if $payinfo;
$payby =~ s/^(CARD|COMP)$/$1 /;
+ my $delete = $payment->closed !~ /^Y/i && $conf->exists('deletepayments')
+ ? qq! (<A HREF="javascript:areyousure('${p}misc/delete-cust_pay.cgi?!. $payment->paynum. qq!')">delete</A>)!
+ : '';
push @history,
- "$date\tPayment, Invoice #$invnum ($payby$payinfo)\t\t$paid\t\t\t$target";
+ "$date\tPayment, Invoice #$invnum ($payby$payinfo)$delete\t\t$paid\t\t\t$target";
}
my(@cust_credit_bill)=
@@ -430,11 +443,15 @@ foreach my $payment (@unapplied_payments) {
my $target = "$payby$payinfo";
$payby =~ s/^BILL$/Check #/ if $payinfo;
$payby =~ s/^(CARD|COMP)$/$1 /;
+ my $delete = $payment->closed !~ /^Y/i && $conf->exists('deletepayments')
+ ? qq! (<A HREF="javascript:areyousure('${p}misc/delete-cust_pay.cgi?!. $payment->paynum. qq!')">delete</A>)!
+ : '';
push @history,
$payment->_date. "\t".
- '<A HREF="'. popurl(2). 'edit/cust_bill_pay.cgi?'. $payment->paynum. '">'.
'<b><font size="+1" color="#ff0000">Unapplied payment #' .
- $payment->paynum . " ($payby$payinfo)</font></b></A>".
+ $payment->paynum . " ($payby$payinfo)</font></b> ".
+ '(<A HREF="'. popurl(2). 'edit/cust_bill_pay.cgi?'. $payment->paynum. '">'.
+ "apply</A>)$delete".
"\t\t" . $payment->unapplied . "\t\t\t$target";
}