projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tower tracking, RT#15538
[freeside.git]
/
httemplate
/
edit
/
cust_pay.cgi
diff --git
a/httemplate/edit/cust_pay.cgi
b/httemplate/edit/cust_pay.cgi
index
07e5198
..
3fd9c79
100755
(executable)
--- a/
httemplate/edit/cust_pay.cgi
+++ b/
httemplate/edit/cust_pay.cgi
@@
-1,12
+1,12
@@
% if ( $link eq 'popup' ) {
% if ( $link eq 'popup' ) {
- <
% include('/elements/header-popup.html', $title ) %
>
+ <
& /elements/header-popup.html, $title &
>
% } else {
% } else {
- <
% include("/elements/header.html", $title, '') %
>
+ <
& /elements/header.html, $title, '' &
>
% }
% }
-<
% include('/elements/init_calendar.html') %
>
+<
& /elements/init_calendar.html &
>
-<
% include('/elements/error.html') %
>
+<
& /elements/error.html &
>
% unless ( $link eq 'popup' ) {
<% small_custview($custnum, $conf->config('countrydefault')) %>
% unless ( $link eq 'popup' ) {
<% small_custview($custnum, $conf->config('countrydefault')) %>
@@
-20,35
+20,40
@@
<BR><BR>
<BR><BR>
-Payment
+<% mt('Payment') |h %>
<% ntable("#cccccc", 2) %>
<TR>
<% ntable("#cccccc", 2) %>
<TR>
- <TD ALIGN="right">
Date
</TD>
+ <TD ALIGN="right">
<% mt('Date') |h %>
</TD>
<TD COLSPAN=2>
<TD COLSPAN=2>
- <INPUT TYPE="text" NAME="_date" ID="_date_text" VALUE="<% time2str(
"%m/%d/%Y %r"
,$_date) %>">
- <IMG SRC="../images/calendar.png" ID="_date_button" STYLE="cursor: pointer" TITLE="
Select 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="
<% mt('Select date') |h %>
">
</TD>
</TR>
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "_date_text",
</TD>
</TR>
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "_date_text",
- ifFormat: "
%m/%d/%Y
",
+ ifFormat: "
<% $date_format %>
",
button: "_date_button",
align: "BR"
});
</SCRIPT>
<TR>
button: "_date_button",
align: "BR"
});
</SCRIPT>
<TR>
- <TD ALIGN="right">
Amount
</TD>
+ <TD ALIGN="right">
<% mt('Amount') |h %>
</TD>
<TD BGCOLOR="#ffffff" ALIGN="right"><% $money_char %></TD>
<TD BGCOLOR="#ffffff" ALIGN="right"><% $money_char %></TD>
- <TD><INPUT TYPE="text" NAME="paid"
VALUE="<% $paid %>" SIZE=8 MAXLENGTH=8> by <B><% FS::payby->payname($payby)
%></B></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>
</TR>
</TR>
+ <& /elements/tr-select-discount_term.html,
+ 'custnum' => $custnum,
+ 'amount_id' => 'paid',
+ &>
+
% if ( $payby eq 'BILL' ) {
<TR>
% if ( $payby eq 'BILL' ) {
<TR>
- <TD ALIGN="right">
Check #
</TD>
+ <TD ALIGN="right">
<% mt('Check #') |h %>
</TD>
<TD COLSPAN=2><INPUT TYPE="text" NAME="payinfo" VALUE="<% $payinfo %>" SIZE=10></TD>
</TR>
% }
<TD COLSPAN=2><INPUT TYPE="text" NAME="payinfo" VALUE="<% $payinfo %>" SIZE=10></TD>
</TR>
% }
@@
-56,16
+61,16
@@
Payment
<TR>
% if ( $link eq 'custnum' || $link eq 'popup' ) {
<TR>
% if ( $link eq 'custnum' || $link eq 'popup' ) {
- <TD ALIGN="right">
Auto-apply<BR>to invoices
</TD>
+ <TD ALIGN="right">
<% mt('Auto-apply to invoices') |h %>
</TD>
<TD COLSPAN=2>
<SELECT NAME="apply">
<TD COLSPAN=2>
<SELECT NAME="apply">
- <OPTION VALUE="yes" SELECTED>
yes
- <OPTION>
no
</SELECT>
+ <OPTION VALUE="yes" SELECTED>
<% mt('yes') |h %>
+ <OPTION>
<% mt('no') |h %>
</SELECT>
</TD>
% } elsif ( $link eq 'invnum' ) {
</TD>
% } elsif ( $link eq 'invnum' ) {
- <TD ALIGN="right">
Apply to
</TD>
+ <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">
<TD COLSPAN=2 BGCOLOR="#ffffff">Invoice #<B><% $linknum %></B> only</TD>
<INPUT TYPE="hidden" NAME="apply" VALUE="no">
@@
-73,11
+78,10
@@
Payment
</TR>
% if ( $conf->exists('pkg-balances') ) {
</TR>
% if ( $conf->exists('pkg-balances') ) {
- <
% include('/elements/tr-select-cust_pkg-balances.html'
,
+ <
& /elements/tr-select-cust_pkg-balances.html
,
'custnum' => $custnum,
'cgi' => $cgi
'custnum' => $custnum,
'cgi' => $cgi
- )
- %>
+ &>
% } else {
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
% }
% } else {
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
% }
@@
-85,7
+89,7
@@
Payment
</TABLE>
<BR>
</TABLE>
<BR>
-<INPUT TYPE="submit" VALUE="
Post payment
">
+<INPUT TYPE="submit" VALUE="
<% mt('Post payment') |h %>
">
</FORM>
</FORM>
@@
-93,17
+97,15
@@
Payment
</BODY>
</HTML>
% } else {
</BODY>
</HTML>
% } else {
- <
% include('/elements/footer.html') %
>
+ <
& /elements/footer.html &
>
% }
<%init>
my $conf = new FS::Conf;
% }
<%init>
my $conf = new FS::Conf;
-my $money_char = $conf->config('money_char') || '$';
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Post payment');
+my $money_char = $conf->config('money_char') || '$';
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
my($link, $linknum, $paid, $payby, $payinfo, $_date);
if ( $cgi->param('error') ) {
my($link, $linknum, $paid, $payby, $payinfo, $_date);
if ( $cgi->param('error') ) {
@@
-112,7
+114,7
@@
if ( $cgi->param('error') ) {
$paid = $cgi->param('paid');
$payby = $cgi->param('payby');
$payinfo = $cgi->param('payinfo');
$paid = $cgi->param('paid');
$payby = $cgi->param('payby');
$payinfo = $cgi->param('payinfo');
- $_date = $cgi->param('_date') ?
str2
time($cgi->param('_date')) : time;
+ $_date = $cgi->param('_date') ?
parse_date
time($cgi->param('_date')) : time;
} elsif ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
$link = $cgi->param('popup') ? 'popup' : 'custnum';
$linknum = $1;
} elsif ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
$link = $cgi->param('popup') ? 'popup' : 'custnum';
$linknum = $1;
@@
-131,10
+133,17
@@
if ( $cgi->param('error') ) {
die "illegal query ". $cgi->keywords;
}
die "illegal query ". $cgi->keywords;
}
+my @rights = ('Post payment');
+push @rights, 'Post check payment' if $payby eq 'BILL';
+push @rights, 'Post cash payment' if $payby eq 'CASH';
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right(\@rights);
+
my $paybatch = "webui-$_date-$$-". rand() * 2**32;
my $paybatch = "webui-$_date-$$-". rand() * 2**32;
-my $title =
'Post '. FS::payby->payname($payby). ' payment'
;
-$title .=
" against Invoice #$linknum"
if $link eq 'invnum';
+my $title =
mt('Post '. FS::payby->payname($payby). ' payment')
;
+$title .=
mt(" against Invoice #[_1]",$linknum)
if $link eq 'invnum';
my $custnum;
if ( $link eq 'invnum' ) {
my $custnum;
if ( $link eq 'invnum' ) {