X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fpayment.cgi;h=de060b01045899653b8fe21ed3e8619626730252;hp=7afdfd1598d56c79e068ae9c5485fc575635d9b6;hb=01c9143a54bf5e1513537547fd362822f58d1e2a;hpb=768ab093771b3305a67c9d929b461ef777ecdad8 diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index 7afdfd159..de060b010 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -1,6 +1,6 @@ -<& /elements/header.html, mt("Process [_1] payment",$type{$payby}) &> -<& /elements/small_custview.html, $cust_main, '', '', popurl(2) . "view/cust_main.cgi" &> -
+<& /elements/header-cust_main.html, view=>'payment_history', cust_main=>$cust_main &> + +

<% emt("Process [_1] payment",$type{$payby}) %>

@@ -12,8 +12,9 @@ - <& /elements/tr-amount_fee.html, - 'amount' => $amount, + <& /elements/tr-select-payment_options.html, + 'custnum' => $cust_main->custnum, + 'amount' => $balance, 'process-pkgpart' => scalar($conf->config('manual_process-pkgpart', $cust_main->agentnum)), 'process-display' => scalar($conf->config('manual_process-display')), @@ -21,7 +22,12 @@ 'num_payments' => scalar($cust_main->cust_pay), 'surcharge_percentage' => ( $payby eq 'CARD' - ? scalar($conf->config('credit-card-surcharge-percentage')) + ? scalar($conf->config('credit-card-surcharge-percentage', $cust_main->agentnum)) + : 0 + ), + 'surcharge_flatfee:Q' => + ( $payby eq 'CARD' + ? scalar($conf->config('credit-card-surcharge-flatfee', $cust_main->agentnum)) : 0 ), &> @@ -33,23 +39,108 @@ &> % } +% my $disallow_no_auto_apply = 0; +% if ( $conf->exists("batch-enable") +% || grep $payby eq $_, $conf->config('batch-enable_payby') +% ) { +% +% if ( grep $payby eq $_, $conf->config('realtime-disable_payby') ) { +% $disallow_no_auto_apply = 1; + + + +% } else { + + + + + + +% } +% } + +% unless ($disallow_no_auto_apply) { +% # false laziness with edit/cust_pay.cgi + + + + + + +% # this can go away if no_auto_apply handling gets added to batch payment processing + + +% } + + + +% #can't quite handle CARD/CHEK on the same page yet, but very close +% #does it make sense from a UI/usability perspective? +% +% my @cust_payby = (); +% if ( $payby eq 'CARD' ) { +% @cust_payby = $cust_main->cust_payby('CARD','DCRD'); +% } elsif ( $payby eq 'CHEK' ) { +% @cust_payby = $cust_main->cust_payby('CHEK','DCHK'); +% } else { +% die "unknown payby $payby"; +% } +% +% my $custpaybynum = length(scalar($cgi->param('custpaybynum'))) +% ? scalar($cgi->param('custpaybynum')) +% : scalar(@cust_payby) && $cust_payby[0]->custpaybynum; + +<& /elements/tr-select-cust_payby.html, + 'cust_payby' => \@cust_payby, + 'curr_value' => $custpaybynum, + 'onchange' => 'cust_payby_changed(this)', +&> + +
   <% mt('Add to current batch') |h %> + +
<% mt('Auto-apply to invoices') |h %> + +
+
+
+> + + % my $auto = 0; % if ( $payby eq 'CARD' ) { % % my( $payinfo, $paycvv, $month, $year ) = ( '', '', '', '' ); % my $payname = $cust_main->first. ' '. $cust_main->getfield('last'); % my $location = $cust_main->bill_location; -% -% #auto-fill with the highest weighted match -% my ($cust_payby) = $cust_main->cust_payby('CARD','DCRD'); -% if ($cust_payby) { -% $payinfo = $cust_payby->paymask; -% $paycvv = $cust_payby->paycvv; -% ( $month, $year ) = $cust_payby->paydate_monthyear; -% $payname = $cust_payby->payname if $cust_payby->payname; -% $location = $cust_payby->cust_location || $location; -% $auto = 1 if $cust_payby->payby eq 'CARD'; -% } @@ -104,22 +195,6 @@ % my( $account, $aba, $branch, $payname, $ss, $paytype, $paystate, % $stateid, $stateid_state ) % = ( '', '', '', '', '', '', '', '', '' ); -% my ($cust_payby) = $cust_main->cust_payby('CHEK','DCHK'); -% if ($cust_payby) { -% $cust_payby->paymask =~ /^([\dx]+)\@([\d\.x]*)$/i -% or die "unparsable paymask ". $cust_payby->paymask; -% ($account, $aba) = ($1, $2); -% ($branch,$aba) = split('\.',$aba) -% if $conf->config('echeck-country') eq 'CA'; -% $payname = $cust_payby->payname; -% $paytype = $cust_payby->getfield('paytype'); -% $paystate = $cust_payby->getfield('paystate'); -% $auto = 1 if $cust_payby->payby eq 'CHEK'; -% # these values aren't in cust_payby, but maybe should be... -% $ss = $cust_main->ss; -% $stateid = $cust_main->getfield('stateid'); -% $stateid_state = $cust_main->getfield('stateid_state'); -% } % % #false laziness w/{edit,view}/cust_main/billing.html % my $routing_label = $conf->config('echeck-country') eq 'US' @@ -210,46 +285,50 @@ - -% if ( $conf->exists("batch-enable") -% || grep $payby eq $_, $conf->config('batch-enable_payby') -% ) { -% -% if ( grep $payby eq $_, $conf->config('realtime-disable_payby') ) { - - - -% } else { - - - - - -% } -% } - -
<% mt('Card number') |h %>
+ <% mt('Remember this information') |h %>
- - <% mt('Add to current batch') |h %> -
+ NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }"> <% mt("Charge future payments to this [_1] automatically",$type{$payby}) |h %> +% if ( @cust_payby ) { + <% mt('as') |h %> + +% } else { + +% }
+

-<& /elements/footer.html &> +<& /elements/footer-cust_main.html &> +<%once> + +my %weight = ( + 1 => 'Primary', + 2 => 'Secondary', + 3 => 'Tertiary', + 4 => 'Fourth', + 5 => 'Fifth', + 6 => 'Sixth', + 7 => 'Seventh', +); + + <%init> die "access denied" @@ -283,15 +362,6 @@ my %states = map { $_->state => 1 } } ); my @states = sort { $a cmp $b } keys %states; -my $amount = ''; -if ( $balance > 0 ) { - # when configured to do so, amount will only auto-fill with balance - # if balance represents a single invoice - $amount = $balance - unless $conf->exists('manual_process-single_invoice_amount') - && ($cust_main->open_cust_bill != 1); -} - my $payunique = "webui-payment-". time. "-$$-". rand() * 2**32;