enable CardFortress in test database, #71513
[freeside.git] / httemplate / edit / cust_credit.cgi
index a3565f1..18416c5 100755 (executable)
@@ -6,15 +6,25 @@
 <INPUT TYPE="hidden" NAME="crednum" VALUE="">
 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum |h %>">
 <INPUT TYPE="hidden" NAME="paybatch" VALUE="">
-<INPUT TYPE="hidden" NAME="_date" VALUE="<% $_date %>">
 <INPUT TYPE="hidden" NAME="credited" VALUE="">
 
 <% ntable("#cccccc", 2) %>
 
-  <TR>
-    <TD ALIGN="right"><% mt('Date') |h %></TD>
-    <TD BGCOLOR="#ffffff"><% time2str($date_format, $_date) %></TD>
-  </TR>
+% my %date_args = (
+%   'name'   =>  '_date',
+%   'label'  => emt('Date'),
+%   'value'  => $_date,
+%   'format' => $date_format. ' %r',
+% );
+% if ( $FS::CurrentUser::CurrentUser->access_right('Backdate credit') ) {
+
+  <& /elements/tr-input-date-field.html, \%date_args &>
+
+% } else {
+
+  <& /elements/tr-fixed-date.html, \%date_args &>
+
+% }
 
   <TR>
     <TD ALIGN="right"><% mt('Amount') |h %></TD>
@@ -24,7 +34,7 @@
 <& /elements/tr-select-reason.html,
               'field'          => 'reasonnum',
               'reason_class'   => 'R',
-              'control_button' => "document.getElementById('confirm_credit_button')",
+              'control_button' => 'confirm_credit_button',
               'cgi'            => $cgi,
 &>