summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2006-08-13 10:25:58 +0000
committerivan <ivan>2006-08-13 10:25:58 +0000
commit8e3dfb380406e145494a5fffa7a0e4aab7b38253 (patch)
treeb810048e9a0ccd6976d3927da9224a956084e1ce /httemplate/edit
parenta2bddcaabfdaf11d4b726b21af7f6ffc13c458d3 (diff)
customer view work:
DONE 1. add status and balance to top DONE 2. add some sort of oldest date thing so the history doesn't get too big (# years and a link to "show older") 3. make the rest of the action links into js popups? maybe later, weird IENess when closing em DONE (finished) - so revert out or finish/commit the Enter check payment one - Process page can wait until another day.. it should be more of an *action* DONE 4. Ticket list config knobs for wtxs (grid it too) DONE 5. grid the package list
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/cust_pay.cgi20
-rwxr-xr-xhttemplate/edit/process/cust_pay.cgi30
2 files changed, 33 insertions, 17 deletions
diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi
index a03a245eb..e7734c1fc 100755
--- a/httemplate/edit/cust_pay.cgi
+++ b/httemplate/edit/cust_pay.cgi
@@ -9,22 +9,20 @@ my %payby = (
'MCRD' => 'Manual credit card',
);
-my($link, $linknum, $paid, $payby, $payinfo, $quickpay, $_date);
+my($link, $linknum, $paid, $payby, $payinfo, $_date);
if ( $cgi->param('error') ) {
$link = $cgi->param('link');
$linknum = $cgi->param('linknum');
$paid = $cgi->param('paid');
$payby = $cgi->param('payby');
$payinfo = $cgi->param('payinfo');
- $quickpay = $cgi->param('quickpay');
$_date = $cgi->param('_date') ? str2time($cgi->param('_date')) : time;
} elsif ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
- $link = 'custnum';
+ $link = $cgi->param('popup') ? 'popup' : 'custnum';
$linknum = $1;
$paid = '';
$payby = $cgi->param('payby') || 'BILL';
$payinfo = '';
- $quickpay = $cgi->param('quickpay');
$_date = time;
} elsif ( $cgi->param('invnum') =~ /^(\d+)$/ ) {
$link = 'invnum';
@@ -32,7 +30,6 @@ if ( $cgi->param('error') ) {
$paid = '';
$payby = $cgi->param('payby') || 'BILL';
$payinfo = "";
- $quickpay = '';
$_date = time;
} else {
die "illegal query ". $cgi->keywords;
@@ -43,9 +40,15 @@ my $paybatch = "webui-$_date-$$-". rand() * 2**32;
my $title = 'Post '. $payby{$payby}. ' payment';
$title .= " against Invoice #$linknum" if $link eq 'invnum';
-%>
+if ( $link eq 'popup' ) {
+
+%><%= include('/elements/header-popup.html', $title ) %>
+
+<% } else { %>
-<%= include("/elements/header.html",$title, '') %>
+<%= include("/elements/header.html", $title, '') %>
+
+<% } %>
<% if ( $cgi->param('error') ) { %>
<FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
@@ -60,7 +63,6 @@ $title .= " against Invoice #$linknum" if $link eq 'invnum';
<FORM ACTION="<%= popurl(1) %>process/cust_pay.cgi" METHOD=POST>
<INPUT TYPE="hidden" NAME="link" VALUE="<%= $link %>">
<INPUT TYPE="hidden" NAME="linknum" VALUE="<%= $linknum %>">
-<INPUT TYPE="hidden" NAME="quickpay" VALUE="<%= $quickpay %>">
<%
my $money_char = $conf->config('money_char') || '$';
@@ -74,7 +76,9 @@ if ( $link eq 'invnum' ) {
}
%>
+<% unless ( $link eq 'popup' ) { %>
<%= small_custview($custnum, $conf->config('countrydefault')) %>
+<% } %>
<INPUT TYPE="hidden" NAME="payby" VALUE="<%= $payby %>">
diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi
index 87d6011e7..cecccb59e 100755
--- a/httemplate/edit/process/cust_pay.cgi
+++ b/httemplate/edit/process/cust_pay.cgi
@@ -4,15 +4,16 @@ $cgi->param('linknum') =~ /^(\d+)$/
or die "Illegal linknum: ". $cgi->param('linknum');
my $linknum = $1;
-$cgi->param('link') =~ /^(custnum|invnum)$/
+$cgi->param('link') =~ /^(custnum|invnum|popup)$/
or die "Illegal link: ". $cgi->param('link');
-my $link = $1;
+my $field = my $link = $1;
+$field = 'custnum' if $field eq 'popup';
my $_date = str2time($cgi->param('_date'));
my $new = new FS::cust_pay ( {
- $link => $linknum,
- _date => $_date,
+ $field => $linknum,
+ _date => $_date,
map {
$_, scalar($cgi->param($_));
} qw(paid payby payinfo paybatch)
@@ -24,19 +25,30 @@ my $error = $new->insert;
if ($error) {
$cgi->param('error', $error);
print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string );
-} elsif ( $link eq 'invnum' ) {
+} elsif ( $field eq 'invnum' ) {
print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum");
-} elsif ( $link eq 'custnum' ) {
+} elsif ( $field eq 'custnum' ) {
if ( $cgi->param('apply') eq 'yes' ) {
my $cust_main = qsearchs('cust_main', { 'custnum' => $linknum })
or die "unknown custnum $linknum";
$cust_main->apply_payments;
}
- if ( $cgi->param('quickpay') eq 'yes' ) {
- print $cgi->redirect(popurl(3). "search/cust_main-quickpay.html");
- } else {
+ if ( $link eq 'popup' ) {
+
+ %><%= header('Payment entered') %>
+ <SCRIPT TYPE="text/javascript">
+ window.top.location.reload();
+ </SCRIPT>
+
+ </BODY></HTML>
+ <%
+
+ } elsif ( $link eq 'custnum' ) {
print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum");
+ } else {
+ die "unknown link $link";
}
+
}
%>