proper use of date_format config for international date formats, RT#7009
[freeside.git] / httemplate / edit / cust_pay.cgi
index 3c28774..a6b73b1 100755 (executable)
@@ -26,7 +26,7 @@ Payment
 <TR>
   <TD ALIGN="right">Date</TD>
   <TD COLSPAN=2>
-    <INPUT TYPE="text" NAME="_date" ID="_date_text" VALUE="<% time2str("%m/%d/%Y %r",$_date) %>">
+    <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="Select date">
   </TD>
 </TR>
@@ -34,7 +34,7 @@ Payment
 <SCRIPT TYPE="text/javascript">
   Calendar.setup({
     inputField: "_date_text",
-    ifFormat:   "%m/%d/%Y",
+    ifFormat:   "<% $date_format %>",
     button:     "_date_button",
     align:      "BR"
   });
@@ -72,6 +72,16 @@ Payment
 % } 
 </TR>
 
+% if ( $conf->exists('pkg-balances') ) {
+  <% include('/elements/tr-select-cust_pkg-balances.html',
+               'custnum' => $custnum,
+               'cgi'     => $cgi
+            )
+  %>
+% } else {
+  <INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
+% }
+
 </TABLE>
 
 <BR>
@@ -90,12 +100,13 @@ Payment
 
 my $conf = new FS::Conf;
 
-my $money_char = $conf->config('money_char') || '$';
+my $money_char  = $conf->config('money_char')  || '$';
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
 
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Post payment');
 
-my($link, $linknum, $paid, $payby, $payinfo, $_date); 
+my($link, $linknum, $paid, $payby, $payinfo, $_date);
 if ( $cgi->param('error') ) {
   $link     = $cgi->param('link');
   $linknum  = $cgi->param('linknum');
@@ -131,7 +142,7 @@ if ( $link eq 'invnum' ) {
   my $cust_bill = qsearchs('cust_bill', { 'invnum' => $linknum } )
     or die "unknown invnum $linknum";
   $custnum = $cust_bill->custnum;
-} elsif ( $link eq 'custnum' ) {
+} elsif ( $link eq 'custnum' || $link eq 'popup' ) {
   $custnum = $linknum;
 }