projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
replace FS::CGI::header function with header-popup component, related to #71249
[freeside.git]
/
httemplate
/
edit
/
process
/
cust_pay.cgi
diff --git
a/httemplate/edit/process/cust_pay.cgi
b/httemplate/edit/process/cust_pay.cgi
index
2c77e6b
..
50878f9
100755
(executable)
--- a/
httemplate/edit/process/cust_pay.cgi
+++ b/
httemplate/edit/process/cust_pay.cgi
@@
-7,13
+7,14
@@
% if ( $cgi->param('apply') eq 'yes' ) {
% my $cust_main = qsearchs('cust_main', { 'custnum' => $linknum })
% or die "unknown custnum $linknum";
% if ( $cgi->param('apply') eq 'yes' ) {
% my $cust_main = qsearchs('cust_main', { 'custnum' => $linknum })
% or die "unknown custnum $linknum";
-% $cust_main->apply_payments( 'manual' => 1 );
+% $cust_main->apply_payments( 'manual' => 1,
+% 'backdate_application' => ($_date < time-86400) );
% }
% if ( $link eq 'popup' ) {
%
% }
% if ( $link eq 'popup' ) {
%
-<
% header(emt('Payment entered')) %
>
+<
& /elements/header-popup.html, emt('Payment entered') &
>
<SCRIPT TYPE="text/javascript">
<SCRIPT TYPE="text/javascript">
-
window.top.location.
reload();
+
top
reload();
</SCRIPT>
</BODY></HTML>
</SCRIPT>
</BODY></HTML>
@@
-27,6
+28,8
@@
%}
<%init>
%}
<%init>
+my $conf = FS::Conf->new;
+
$cgi->param('linknum') =~ /^(\d+)$/
or die "Illegal linknum: ". $cgi->param('linknum');
my $linknum = $1;
$cgi->param('linknum') =~ /^(\d+)$/
or die "Illegal linknum: ". $cgi->param('linknum');
my $linknum = $1;
@@
-36,17
+39,27
@@
$cgi->param('link') =~ /^(custnum|invnum|popup)$/
my $field = my $link = $1;
$field = 'custnum' if $field eq 'popup';
my $field = my $link = $1;
$field = 'custnum' if $field eq 'popup';
-my $_date = parse_datetime($cgi->param('_date'));
+my $_date;
+if ( $FS::CurrentUser::CurrentUser->access_right('Backdate payment') ) {
+ $_date = parse_datetime($cgi->param('_date'));
+}
+else {
+ $_date = time;
+}
my $new = new FS::cust_pay ( {
$field => $linknum,
_date => $_date,
my $new = new FS::cust_pay ( {
$field => $linknum,
_date => $_date,
+ no_auto_apply => ($cgi->param('apply') eq 'never') ? 'Y' : '',
map {
$_, scalar($cgi->param($_));
} qw( paid payby payinfo paybatch
pkgnum discount_term
map {
$_, scalar($cgi->param($_));
} qw( paid payby payinfo paybatch
pkgnum discount_term
+ bank depositor account teller
)
#} fields('cust_pay')
)
#} fields('cust_pay')
+ # gatewaynum, processor, auth, order_number
+ # are for realtime payments only, and can't be entered manually
} );
my @rights = ('Post payment');
} );
my @rights = ('Post payment');