payment posting styled inside customer
[freeside.git] / httemplate / edit / cust_pay.cgi
index f0826f6..acc67c4 100755 (executable)
@@ -1,65 +1,50 @@
 % if ( $link eq 'popup' ) { 
   <& /elements/header-popup.html, $title  &>
 % } else { 
-  <& /elements/header.html, $title, '' &>
+  <& /elements/header-cust_main.html, view=>'payment_history', custnum=>$custnum &>
+  <h2><% $title |h %></h2>
 % } 
 
 <& /elements/init_calendar.html &>
 
 <& /elements/error.html &>
 
-% unless ( $link eq 'popup' ) { 
-    <% small_custview($custnum, $conf->config('countrydefault')) %>
-% } 
-
-<FORM NAME="PaymentForm" ACTION="<% popurl(1) %>process/cust_pay.cgi" METHOD=POST onSubmit="document.PaymentForm.submit.disabled=true">
+<FORM NAME="PaymentForm" ACTION="<% popurl(1) %>process/cust_pay.cgi" METHOD=POST onSubmit="document.PaymentForm.submitButton.disabled=true">
 <INPUT TYPE="hidden" NAME="link" VALUE="<% $link %>">
 <INPUT TYPE="hidden" NAME="linknum" VALUE="<% $linknum %>">
 <INPUT TYPE="hidden" NAME="payby" VALUE="<% $payby %>">
 <INPUT TYPE="hidden" NAME="paybatch" VALUE="<% $paybatch %>">
 
-<BR>
-
-<% mt('Payment') |h %> 
 <% ntable("#cccccc", 2) %>
 
-% if ( $FS::CurrentUser::CurrentUser->access_right(['Backdate payment']) ) {
-<TR>
-  <TD ALIGN="right"><% mt('Date') |h %></TD>
-  <TD COLSPAN=2>
-    <INPUT TYPE="text" NAME="_date" ID="_date_text" VALUE="<% time2str($date_format.' %r',$_date) %>">
-    <IMG SRC="../images/calendar.png" ID="_date_button" STYLE="cursor: pointer" TITLE="<% mt('Select date') |h %>">
-  </TD>
-</TR>
+% my %date_args = (
+%   'name'    =>  '_date',
+%   'label'   => emt('Date'),
+%   'value'   => $_date,
+%   'format'  => $date_format. ' %r',
+%   'colspan' => 2,
+% );
+% if ( $FS::CurrentUser::CurrentUser->access_right('Backdate payment') ) {
+
+  <& /elements/tr-input-date-field.html, \%date_args &>
+
+% } else {
+
+  <& /elements/tr-fixed-date.html, \%date_args &>
 
-<SCRIPT TYPE="text/javascript">
-  Calendar.setup({
-    inputField: "_date_text",
-    ifFormat:   "<% $date_format %>",
-    button:     "_date_button",
-    align:      "BR"
-  });
-</SCRIPT>
-% }
-% else {
-<TR>
-  <TD ALIGN="right"><% mt('Date') |h %></TD>
-  <TD COLSPAN=2>
-    <% time2str($date_format.' %r',$_date) %>
-  </TD>
-</TR>
 % }
 
 <TR>
   <TD ALIGN="right"><% mt('Amount') |h %></TD>
-  <TD BGCOLOR="#ffffff" ALIGN="right"><% $money_char %></TD>
-  <TD><INPUT TYPE="text" NAME="paid" ID="paid" VALUE="<% $paid %>" SIZE=8 MAXLENGTH=9> <% mt('by') |h %> <B><% mt(FS::payby->payname($payby)) |h %></B></TD>
+  <TD BGCOLOR="#ffffff"><% $money_char |h %><INPUT TYPE="text" NAME="paid" ID="paid" VALUE="<% $paid %>" SIZE=8 MAXLENGTH=9> <% mt('by') |h %> <B><% mt(FS::payby->payname($payby)) |h %></B></TD>
 </TR>
 
-  <& /elements/tr-select-discount_term.html,
-               'custnum' => $custnum,
-               'amount_id' => 'paid',
-  &>
+% if ( $conf->exists('part_pkg-term_discounts') ) {
+    <& /elements/tr-select-discount_term.html,
+         'custnum'   => $custnum,
+         'amount_id' => 'paid',
+    &>
+% }
 
 % if ( $payby eq 'BILL' ) { 
   <TR>
   <TD ALIGN="right"><% mt('Auto-apply to invoices') |h %></TD>
   <TD COLSPAN=2>
     <SELECT NAME="apply">
-      <OPTION VALUE="yes" SELECTED><% mt('yes') |h %> 
-      <OPTION><% mt('no') |h %></SELECT>
-    </TD>
+      <OPTION VALUE="yes" SELECTED><% mt('yes') |h %></OPTION> 
+      <OPTION VALUE=""><% mt('not now') |h %></OPTION>
+      <OPTION VALUE="never"><% mt('never') |h %></OPTION>
+    </SELECT>
+  </TD>
 
 % } elsif ( $link eq 'invnum' ) { 
 
   <TD ALIGN="right"><% mt('Apply to') |h %></TD>
   <TD COLSPAN=2 BGCOLOR="#ffffff">Invoice #<B><% $linknum %></B> only</TD>
-  <INPUT TYPE="hidden" NAME="apply" VALUE="no">
+  <INPUT TYPE="hidden" NAME="apply" VALUE="">
 
 % } 
 </TR>
 </TABLE>
 
 <BR>
-<INPUT TYPE="submit" VALUE="<% mt('Post payment') |h %>">
+<INPUT NAME="submitButton" TYPE="submit" VALUE="<% mt('Post payment') |h %>">
 
 </FORM>
 
     </BODY>
     </HTML>
 % } else { 
-    <& /elements/footer.html &>
+    <& /elements/footer-cust_main.html &>
 % } 
 
 <%init>