projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
internationalization/localization, RT12515
[freeside.git]
/
httemplate
/
edit
/
cust_pay.cgi
diff --git
a/httemplate/edit/cust_pay.cgi
b/httemplate/edit/cust_pay.cgi
index
a6b73b1
..
353a041
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,14
+20,14
@@
<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>
<INPUT TYPE="text" NAME="_date" ID="_date_text" VALUE="<% time2str($date_format.' %r',$_date) %>">
<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="
Select date
">
+ <IMG SRC="../images/calendar.png" ID="_date_button" STYLE="cursor: pointer" TITLE="
<% mt('Select date') |h %>
">
</TD>
</TR>
</TD>
</TR>
@@
-41,14
+41,19
@@
Payment
</SCRIPT>
<TR>
</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" VALUE="<% $paid %>" SIZE=8 MAXLENGTH=
9
> by <B><% FS::payby->payname($payby) %></B></TD>
</TR>
</TR>
+ <& /elements/tr-select-discount_term.html,
+ 'custnum' => $custnum,
+ 'cgi' => $cgi
+ &>
+
% 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,7
+97,7
@@
Payment
</BODY>
</HTML>
% } else {
</BODY>
</HTML>
% } else {
- <
% include('/elements/footer.html') %
>
+ <
& /elements/footer.html &
>
% }
<%init>
% }
<%init>
@@
-103,9
+107,6
@@
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
my $date_format = $conf->config('date_format') || '%m/%d/%Y';
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);
if ( $cgi->param('error') ) {
$link = $cgi->param('link');
my($link, $linknum, $paid, $payby, $payinfo, $_date);
if ( $cgi->param('error') ) {
$link = $cgi->param('link');
@@
-113,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;
@@
-132,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 =
emt('Post '. FS::payby->payname($payby). ' payment')
;
+$title .=
emt(" against Invoice #[_1]",$linknum)
if $link eq 'invnum';
my $custnum;
if ( $link eq 'invnum' ) {
my $custnum;
if ( $link eq 'invnum' ) {