diff options
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r-- | httemplate/edit/process/agent_payment_gateway.html | 25 | ||||
-rw-r--r-- | httemplate/edit/process/bulk-cust_svc.cgi | 3 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_credit_bill.cgi | 5 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_main.cgi | 39 | ||||
-rwxr-xr-x | httemplate/edit/process/part_pkg.cgi | 9 | ||||
-rwxr-xr-x | httemplate/edit/process/part_svc.cgi | 5 | ||||
-rw-r--r-- | httemplate/edit/process/payment_gateway.html | 33 | ||||
-rw-r--r-- | httemplate/edit/process/quick-charge.cgi | 27 | ||||
-rwxr-xr-x | httemplate/edit/process/rate.cgi | 5 |
9 files changed, 26 insertions, 125 deletions
diff --git a/httemplate/edit/process/agent_payment_gateway.html b/httemplate/edit/process/agent_payment_gateway.html deleted file mode 100644 index c306bfa3f..000000000 --- a/httemplate/edit/process/agent_payment_gateway.html +++ /dev/null @@ -1,25 +0,0 @@ -<% - -$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum"; -my $agent = qsearchs('agent', { 'agentnum' => $1 } ); -die "agentnum $1 not found" unless $agent; - -#my $old - -my @new = map { - my $cardtype = $_; - new FS::agent_payment_gateway { - ( map { $_ => scalar($cgi->param($_)) } - fields('agent_payment_gateway') - ), - 'cardtype' => $cardtype, - }; - } - $cgi->param('cardtype'); - -foreach my $new (@new) { - my $error = $new->insert; - die $error if $error; -} - -%><%= $cgi->redirect(popurl(3). "browse/agent.cgi") %> diff --git a/httemplate/edit/process/bulk-cust_svc.cgi b/httemplate/edit/process/bulk-cust_svc.cgi deleted file mode 100644 index dd9d1dbd2..000000000 --- a/httemplate/edit/process/bulk-cust_svc.cgi +++ /dev/null @@ -1,3 +0,0 @@ -<% - my $server = new FS::UI::Web::JSRPC 'FS::part_svc::process_bulk_cust_svc', $cgi; -%><%= $server->process %> diff --git a/httemplate/edit/process/cust_credit_bill.cgi b/httemplate/edit/process/cust_credit_bill.cgi index 28f892f62..23e2e6ce5 100755 --- a/httemplate/edit/process/cust_credit_bill.cgi +++ b/httemplate/edit/process/cust_credit_bill.cgi @@ -14,12 +14,11 @@ my $custnum = $cust_main->custnum; my $new; if ($cgi->param('invnum') =~ /^Refund$/) { $new = new FS::cust_refund ( { - 'reason' => ( $cust_credit->reason || 'refund from credit' ), + 'reason' => $cust_credit->reason, 'refund' => $cgi->param('amount'), 'payby' => 'BILL', #'_date' => $cgi->param('_date'), - #'payinfo' => 'Cash', - 'payinfo' => 'Refund', + 'payinfo' => 'Cash', 'crednum' => $crednum, } ); } else { diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 09a42544c..d2773a60e 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -8,25 +8,19 @@ $cgi->param('tax','') unless defined $cgi->param('tax'); $cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] ); -#my $payby = $cgi->param('payby'); -my $payby = $cgi->param('select'); # XXX key - -my %noauto = ( - 'CARD' => 'DCRD', - 'CHEK' => 'DCHK', -); -$payby = $noauto{$payby} - if ! $cgi->param('payauto') && exists $noauto{$payby}; - -$cgi->param('payby', $payby); - +my $payby = $cgi->param('payby'); if ( $payby ) { if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) { $cgi->param('payinfo', - $cgi->param('payinfo1'). '@'. $cgi->param('payinfo2') ); + $cgi->param($payby. '_payinfo1'). '@'. $cgi->param($payby. '_payinfo2') ); + } else { + $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); } $cgi->param('paydate', - $cgi->param( 'exp_month' ). '-'. $cgi->param( 'exp_year' ) ); + $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); + $cgi->param('payname', $cgi->param( $payby. '_payname' ) ); + $cgi->param('paycvv', $cgi->param( $payby. '_paycvv' ) ) + if defined $cgi->param( $payby. '_paycvv' ); } my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); @@ -53,9 +47,6 @@ if ( defined($cgi->param('same')) && $cgi->param('same') eq "Y" ) { ); } -$new->setfield('paid', $cgi->param('paid') ) - if $cgi->param('paid'); - #perhaps this stuff should go to cust_main.pm my $cust_pkg = ''; my $svc_acct = ''; @@ -121,20 +112,7 @@ if ( $new->custnum eq '' ) { tie my %hash, 'Tie::RefHash'; %hash = ( $cust_pkg => [ $svc_acct ] ) if $cust_pkg; $error ||= $new->insert( \%hash, \@invoicing_list ); - - my $conf = new FS::Conf; - if ( $conf->exists('backend-realtime') && ! $error ) { - - my $berror = $new->bill; - $new->apply_payments; - $new->apply_credits; - $berror ||= $new->collect; - warn "Warning, error billing during backend-realtime: $berror" if $berror; - - } - } else { #create old record object - my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } ); $error ||= "Old record not found!" unless $old; if ( defined dbdef->table('cust_main')->column('paycvv') @@ -143,7 +121,6 @@ if ( $new->custnum eq '' ) { $new->paycvv($old->paycvv); } $error ||= $new->replace($old, \@invoicing_list); - } if ( $error ) { diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 0d0a13491..1a7f52838 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -29,18 +29,12 @@ my %pkg_svc = map { $_ => scalar($cgi->param("pkg_svc$_")) } my $error; my $custnum = ''; -if ( $cgi->param('taxclass') eq '(select)' ) { - - $error = 'Must select a tax class'; - -} elsif ( $pkgpart ) { - +if ( $pkgpart ) { $error = $new->replace( $old, pkg_svc => \%pkg_svc, primary_svc => scalar($cgi->param('pkg_svc_primary')), ); } else { - $error = $new->insert( pkg_svc => \%pkg_svc, primary_svc => scalar($cgi->param('pkg_svc_primary')), cust_pkg => $cgi->param('pkgnum'), @@ -48,7 +42,6 @@ if ( $cgi->param('taxclass') eq '(select)' ) { ); $pkgpart = $new->pkgpart; } - if ( $error ) { $cgi->param('error', $error ); print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi index b92b62739..664e5212a 100755 --- a/httemplate/edit/process/part_svc.cgi +++ b/httemplate/edit/process/part_svc.cgi @@ -1,3 +1,4 @@ <% - my $server = new FS::UI::Web::JSRPC 'FS::part_svc::process', $cgi; -%><%= $server->process %> +my $server = new FS::UI::Web::JSRPC 'FS::part_svc::process'; +$server->process; +%> diff --git a/httemplate/edit/process/payment_gateway.html b/httemplate/edit/process/payment_gateway.html deleted file mode 100644 index b9e4d47da..000000000 --- a/httemplate/edit/process/payment_gateway.html +++ /dev/null @@ -1,33 +0,0 @@ -<% - -my $gatewaynum = $cgi->param('gatewaynum'); - -my $old = qsearchs('payment_gateway',{'gatewaynum'=>$gatewaynum}) if $gatewaynum; - -my $new = new FS::payment_gateway ( { - map { - $_, scalar($cgi->param($_)); - } fields('payment_gateway') -} ); - -my @options = split(/\r?\n/, $cgi->param('gateway_options') ); -pop @options - if scalar(@options) % 2 && $options[-1] =~ /^\s*$/; -my %options = @options; - -my $error; -if ( $gatewaynum ) { - $error=$new->replace($old); -} else { - $error=$new->insert(\%options); - $gatewaynum=$new->getfield('gatewaynum'); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/payment_gateway.html"); -} - -%> diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index 928e3daad..477f58508 100644 --- a/httemplate/edit/process/quick-charge.cgi +++ b/httemplate/edit/process/quick-charge.cgi @@ -9,24 +9,15 @@ $cgi->param('amount') =~ /^\s*(\d+(\.\d{1,2})?)\s*$/ or die 'illegal amount '. $cgi->param('amount'); my $amount = $1; -my( $error, $cust_main); -if ( $cgi->param('taxclass') eq '(select)' ) { - - - $error = 'Must select a tax class'; -} else { - - my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) - or die "unknown custnum $custnum"; - - $error = $cust_main->charge( - $amount, - $cgi->param('pkg'), - '$'. sprintf("%.2f",$amount), - $cgi->param('taxclass') - ); - -} +my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) + or die "unknown custnum $custnum"; + +my $error = $cust_main->charge( + $amount, + $cgi->param('pkg'), + '$'. sprintf("%.2f",$amount), + $cgi->param('taxclass') +); if ($error) { %> diff --git a/httemplate/edit/process/rate.cgi b/httemplate/edit/process/rate.cgi index 87c082d64..005caf90a 100755 --- a/httemplate/edit/process/rate.cgi +++ b/httemplate/edit/process/rate.cgi @@ -1,3 +1,4 @@ <% - my $server = new FS::UI::Web::JSRPC 'FS::rate::process', $cgi; -%><%= $server->process %> +my $server = new FS::UI::Web::JSRPC 'FS::rate::process'; +$server->process; +%> |