summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2020-11-09 13:18:07 -0800
committerIvan Kohler <ivan@freeside.biz>2020-11-09 13:18:07 -0800
commit4d4171d7ad39732b07839d90e1d74b9f84772d45 (patch)
treeb9f0b99447b09113626d5dfbfb8d38508b07d14c /httemplate
parent2f3c7f47203f2a1e1590425dc32fd9cf76b6f165 (diff)
add credit reason selection, RT#85046
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/elements/tr-select-reason.html2
-rwxr-xr-xhttemplate/search/cust_credit.html4
-rw-r--r--httemplate/search/report_cust_credit.html9
3 files changed, 14 insertions, 1 deletions
diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html
index 64648ba54..8174420a7 100755
--- a/httemplate/elements/tr-select-reason.html
+++ b/httemplate/elements/tr-select-reason.html
@@ -16,7 +16,7 @@ Example:
'control_button' => 'element_name', #button to be enabled when a reason is
#selected
'id' => 'element_id',
- 'hide_add' => '1', # setting this will hide the add new reason link,
+ 'hide_addnew' => '1', # setting this will hide the add new reason link,
# even if the user has access to add a new reason.
'hide_onload' => '1', # setting this will hide reason select box on page load,
# allowing for it do be displayed later.
diff --git a/httemplate/search/cust_credit.html b/httemplate/search/cust_credit.html
index 1ffa302c8..88f9bca13 100755
--- a/httemplate/search/cust_credit.html
+++ b/httemplate/search/cust_credit.html
@@ -195,6 +195,10 @@ if ( $cgi->param('credbatch') =~ /^([\w\-\/\.\:]+)$/ ) {
push @search, "cust_credit.credbatch = '$1'";
}
+if ( $cgi->param('reasonnum') =~ /^(\d+)$/ && $1 ) {
+ push @search, "cust_credit.reasonnum = $1";
+}
+
# commission_salesnum
if ( $cgi->param('commission_salesnum') =~ /^(\d+)$/ ) {
push @search, "commission_salesnum = $1";
diff --git a/httemplate/search/report_cust_credit.html b/httemplate/search/report_cust_credit.html
index cafe556ba..c37b578b4 100644
--- a/httemplate/search/report_cust_credit.html
+++ b/httemplate/search/report_cust_credit.html
@@ -24,6 +24,15 @@
'field' => 'amount',
&>
+ <& /elements/tr-select-reason.html,
+ 'label' => emt('Reason').':',
+ 'field' => 'reasonnum',
+ 'reason_class' => 'R',
+ 'cgi' => $cgi,
+ 'hide_addnew' => 1,
+ 'pre_options' => [ 0 => emt('(any reason)') ],
+ &>
+
<& /elements/tr-checkbox.html,
'label' => emt('Show Voided Credits').':',
'field' => 'show_voided_credits',