X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fpayment.cgi;h=a3db58f723f993289f28b417f23947614a9e062c;hb=fb4c3b9051c1019c6c24dc92cd7f016484aac711;hp=f4f0b56dd6f3de2ee6836c51dc03c56f13c50a53;hpb=1b5b8ba6c06143c639efeb6095a51f9b2ae7c80b;p=freeside.git
diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi
index f4f0b56dd..a3db58f72 100644
--- a/httemplate/misc/payment.cgi
+++ b/httemplate/misc/payment.cgi
@@ -33,16 +33,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 {
+
+
+ <% mt('Add to current batch') |h %> |
+
+
+ |
+
+
+% }
+% }
+
+% unless ($disallow_no_auto_apply) {
+% # false laziness with edit/cust_pay.cgi
+
+
+ <% mt('Auto-apply to invoices') |h %> |
+
+
+ |
+
+
+% # 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)',
+&>
+
+
+
+
+>
+
+
+% my $auto = 0;
% if ( $payby eq 'CARD' ) {
%
% my( $payinfo, $paycvv, $month, $year ) = ( '', '', '', '' );
% my $payname = $cust_main->first. ' '. $cust_main->getfield('last');
-% if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
-% $payinfo = $cust_main->paymask;
-% $paycvv = $cust_main->paycvv;
-% ( $month, $year ) = $cust_main->paydate_monthyear;
-% $payname = $cust_main->payname if $cust_main->payname;
-% }
+% my $location = $cust_main->bill_location;
<% mt('Card number') |h %> |
@@ -87,7 +179,7 @@
<& /elements/location.html,
- 'object' => $cust_main->bill_location,
+ 'object' => $location,
'no_asterisks' => 1,
'address1_label' => emt('Card billing address'),
&>
@@ -97,19 +189,6 @@
% my( $account, $aba, $branch, $payname, $ss, $paytype, $paystate,
% $stateid, $stateid_state )
% = ( '', '', '', '', '', '', '', '', '' );
-% if ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
-% $cust_main->paymask =~ /^([\dx]+)\@([\d\.x]*)$/i
-% or die "unparsable payinfo ". $cust_main->payinfo;
-% ($account, $aba) = ($1, $2);
-% ($branch,$aba) = split('\.',$aba)
-% if $conf->config('echeck-country') eq 'CA';
-% $payname = $cust_main->payname;
-% $ss = $cust_main->ss;
-% $paytype = $cust_main->getfield('paytype');
-% $paystate = $cust_main->getfield('paystate');
-% $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'
@@ -200,46 +279,50 @@
-
+ |
<% mt('Remember this information') |h %>
|
-% if ( $conf->exists("batch-enable")
-% || grep $payby eq $_, $conf->config('batch-enable_payby')
-% ) {
-%
-% if ( grep $payby eq $_, $conf->config('realtime-disable_payby') ) {
-
-
-
-% } else {
-
-
-
-
- <% mt('Add to current batch') |h %>
- |
-
-
-% }
-% }
-
-
- payby ne 'DCRD' ) || ( $payby eq 'CHEK' && $cust_main->payby eq 'CHEK' ) ) ? ' CHECKED' : '' %> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }">
+ |
+ 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 &>
+<%once>
+
+my %weight = (
+ 1 => 'Primary',
+ 2 => 'Secondary',
+ 3 => 'Tertiary',
+ 4 => 'Fourth',
+ 5 => 'Fifth',
+ 6 => 'Sixth',
+ 7 => 'Seventh',
+);
+
+%once>
<%init>
die "access denied"
@@ -260,10 +343,6 @@ my $custnum = $1;
my $cust_main = qsearchs( 'cust_main', { 'custnum'=>$custnum } );
die "unknown custnum $custnum" unless $cust_main;
-my $location = $cust_main->bill_location;
-# no proper error handling on this anyway, but when we have it,
-# remember to repopulate fields in $location
-
my $balance = $cust_main->balance;
my $payinfo = '';