summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorivan <ivan>2009-07-27 09:07:24 +0000
committerivan <ivan>2009-07-27 09:07:24 +0000
commitb00657d2dd62614568501df47d1be4cbfa15eb48 (patch)
tree54d8d9537e42dc6bf4de56e0aaccbfc4adb36e37 /httemplate/search
parent44a63e5978af2b5b4e00cabbc4b3541df4144305 (diff)
voided payment report, RT#5786
Diffstat (limited to 'httemplate/search')
-rwxr-xr-xhttemplate/search/cust_pay_void.html13
-rwxr-xr-xhttemplate/search/elements/cust_pay_or_refund.html4
-rw-r--r--httemplate/search/report_cust_pay.html8
3 files changed, 22 insertions, 3 deletions
diff --git a/httemplate/search/cust_pay_void.html b/httemplate/search/cust_pay_void.html
new file mode 100755
index 000000000..431bb2c6b
--- /dev/null
+++ b/httemplate/search/cust_pay_void.html
@@ -0,0 +1,13 @@
+<% include( 'elements/cust_pay_or_refund.html',
+ 'thing' => 'pay_void',
+ 'amount_field' => 'paid',
+ 'name_singular' => 'voided payment',
+ 'name_verb' => 'voided', # 'paid',
+ 'disable_by' => 1, #showing original not voiding otaker
+ 'addl_header' => [ 'Void Date', ], # 'Void Reason' ],
+ 'addl_fields' => [
+ sub { time2str('%b %d %Y', shift->void_date ) },
+ #'reason',
+ ],
+ )
+%>
diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html
index add8427ca..acd57912f 100755
--- a/httemplate/search/elements/cust_pay_or_refund.html
+++ b/httemplate/search/elements/cust_pay_or_refund.html
@@ -288,7 +288,9 @@ if ( ( $curuser->access_right('View invoices') #XXX for now
&& ! $opt{'disable_link'}
)
{
- $link = [ "${p}view/cust_$thing.html?${thing}num=", $thing.'num' ]
+ my $key = $thing eq 'pay_void' ? 'paynum' : $thing.'num';
+ my $q = ( $thing eq 'pay_void' ? 'void=1;' : '' ). "$key=";
+ $link = [ "${p}view/cust_$thing.html?$q", $key ]
}
my $cust_link = sub {
diff --git a/httemplate/search/report_cust_pay.html b/httemplate/search/report_cust_pay.html
index 06271313f..a9695acb7 100644
--- a/httemplate/search/report_cust_pay.html
+++ b/httemplate/search/report_cust_pay.html
@@ -1,6 +1,6 @@
-<% include('/elements/header.html', 'Payment report' ) %>
+<% include('/elements/header.html', $title ) %>
-<FORM ACTION="cust_pay.cgi" METHOD="GET">
+<FORM ACTION="<% $void ? 'cust_pay_void.html' : 'cust_pay.cgi' %>" METHOD="GET">
<INPUT TYPE="hidden" NAME="magic" VALUE="_date">
<TABLE>
@@ -76,4 +76,8 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+my $void = $cgi->param('void') ? 1 : 0;
+
+my $title = $void ? 'Voided payment report' : 'Payment report';
+
</%init>