From 51984ac3d3da3006809c6866fdecd4ad83610731 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Jul 2001 07:36:04 +0000 Subject: templates!!! --- httemplate/edit/process/cust_main.cgi | 196 ++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100755 httemplate/edit/process/cust_main.cgi (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi new file mode 100755 index 000000000..6c52113ba --- /dev/null +++ b/httemplate/edit/process/cust_main.cgi @@ -0,0 +1,196 @@ +<% +# +# $Id: cust_main.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# Usage: post form to: +# http://server.name/path/cust_main.cgi +# +# ivan@voicenet.com 96-dec-04 +# +# added referral check +# ivan@voicenet.com 97-jun-4 +# +# rewrote for new API +# ivan@voicenet.com 97-jul-28 +# +# same as above (again) and clean up some stuff ivan@sisd.com 98-feb-23 +# +# Changes to allow page to work at a relative position in server +# Changed 'day' to 'daytime' because Pg6.3 reserves the day word +# bmccane@maxbaud.net 98-apr-3 +# +# $Log: cust_main.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.11 1999/08/10 12:54:06 ivan +# use FS::cust_pkg::pkgpart_href +# +# Revision 1.10 1999/04/14 07:47:53 ivan +# i18n fixes +# +# Revision 1.9 1999/04/07 15:22:19 ivan +# don't use anchor in redirect +# +# Revision 1.8 1999/03/25 13:55:10 ivan +# one-screen new customer entry (including package and service) for simple +# packages with one svc_acct service +# +# Revision 1.7 1999/02/28 00:03:42 ivan +# removed misleading comments +# +# Revision 1.6 1999/01/25 12:10:00 ivan +# yet more mod_perl stuff +# +# Revision 1.5 1999/01/19 05:13:50 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.4 1999/01/18 09:22:32 ivan +# changes to track email addresses for email invoicing +# +# Revision 1.3 1998/12/17 08:40:19 ivan +# s/CGI::Request/CGI.pm/; etc +# +# Revision 1.2 1998/11/18 08:57:36 ivan +# i18n, s/CGI-modules/CGI.pm/, FS::CGI::idiot instead of inline, FS::CGI::popurl +# + +use strict; +use vars qw( $cgi $payby @invoicing_list $new $custnum $error ); +use vars qw( $cust_pkg $cust_svc $svc_acct ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup getotaker); +use FS::CGI qw( popurl ); +use FS::Record qw( qsearch qsearchs fields ); +use FS::cust_main; +use FS::type_pkgs; +use FS::agent; + +$cgi = new CGI; +&cgisuidsetup($cgi); + +#unmunge stuff + +$cgi->param('tax','') unless defined($cgi->param('tax')); + +$cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] ); + +$cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ + or die "Oops, illegal \"state\" param: ". $cgi->param('state'); +$cgi->param('state', $1); +$cgi->param('county', $3 || ''); +$cgi->param('country', $4); + +if ( $payby = $cgi->param('payby') ) { + $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); + $cgi->param('paydate', + $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); + $cgi->param('payname', $cgi->param( $payby. '_payname' ) ); +} + +$cgi->param('otaker', &getotaker ); + +@invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); +push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); + +#create new record object + +$new = new FS::cust_main ( { + map { + $_, scalar($cgi->param($_)) +# } qw(custnum agentnum last first ss company address1 address2 city county +# state zip daytime night fax payby payinfo paydate payname tax +# otaker refnum) + } fields('cust_main') +} ); + +#perhaps the invocing_list magic should move to cust_main.pm? +$error = $new->check_invoicing_list( \@invoicing_list ); + +#perhaps this stuff should go to cust_main.pm as well +$cust_pkg = ''; +$svc_acct = ''; +if ( $new->custnum eq '' ) { + + if ( $cgi->param('pkgpart_svcpart') ) { + my $x = $cgi->param('pkgpart_svcpart'); + $x =~ /^(\d+)_(\d+)$/; + my($pkgpart, $svcpart) = ($1, $2); + #false laziness: copied from FS::cust_pkg::order (which should become a + #FS::cust_main method) + my(%part_pkg); + # generate %part_pkg + # $part_pkg{$pkgpart} is true iff $custnum may purchase $pkgpart + my $agent = qsearchs('agent',{'agentnum'=> $new->agentnum }); + #my($type_pkgs); + #foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) { + # my($pkgpart)=$type_pkgs->pkgpart; + # $part_pkg{$pkgpart}++; + #} + # $pkgpart_href->{PKGPART} is true iff $custnum may purchase $pkgpart + my $pkgpart_href = $agent->pkgpart_hashref; + #eslaf + + # this should wind up in FS::cust_pkg! + $error ||= "Agent ". $new->agentnum. " (type ". $agent->typenum. ") can't". + "purchase pkgpart ". $pkgpart + #unless $part_pkg{ $pkgpart }; + unless $pkgpart_href->{ $pkgpart }; + + $cust_pkg = new FS::cust_pkg ( { + #later 'custnum' => $custnum, + 'pkgpart' => $pkgpart, + } ); + $error ||= $cust_pkg->check; + + #$cust_svc = new FS::cust_svc ( { 'svcpart' => $svcpart } ); + + #$error ||= $cust_svc->check; + + $svc_acct = new FS::svc_acct ( { + 'svcpart' => $svcpart, + 'username' => $cgi->param('username'), + '_password' => $cgi->param('_password'), + 'popnum' => $cgi->param('popnum'), + } ); + + my $y = $svc_acct->setdefault; # arguably should be in new method + $error ||= $y unless ref($y); + #and just in case you were silly + $svc_acct->svcpart($svcpart); + $svc_acct->username($cgi->param('username')); + $svc_acct->_password($cgi->param('_password')); + $svc_acct->popnum($cgi->param('popnum')); + + $error ||= $svc_acct->check; + + } elsif ( $cgi->param('username') ) { #good thing to catch + $error = "Can't assign username without a package!"; + } + + $error ||= $new->insert; + if ( $cust_pkg && ! $error ) { + $cust_pkg->custnum( $new->custnum ); + $error ||= $cust_pkg->insert; + warn "WARNING: $error on pre-checked cust_pkg record!" if $error; + $svc_acct->pkgnum( $cust_pkg->pkgnum ); + $error ||= $svc_acct->insert; + warn "WARNING: $error on pre-checked svc_acct record!" if $error; + } +} else { #create old record object + my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } ); + $error ||= "Old record not found!" unless $old; + $error ||= $new->replace($old); +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "cust_main.cgi?". $cgi->query_string ); +} else { + $new->invoicing_list( \@invoicing_list ); + $custnum = $new->custnum; + print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); +} +%> -- cgit v1.2.1 From 77def6c1c51fc6f7273b7c23221f13850d6be1dd Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 12 Aug 2001 00:07:55 +0000 Subject: use transactional invoice_list setting & eliminate non-sticky "first package"! --- httemplate/edit/process/cust_main.cgi | 85 +++++++---------------------------- 1 file changed, 15 insertions(+), 70 deletions(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 6c52113ba..1b916b00b 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -1,60 +1,5 @@ <% -# -# $Id: cust_main.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# Usage: post form to: -# http://server.name/path/cust_main.cgi -# -# ivan@voicenet.com 96-dec-04 -# -# added referral check -# ivan@voicenet.com 97-jun-4 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-28 -# -# same as above (again) and clean up some stuff ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# Changed 'day' to 'daytime' because Pg6.3 reserves the day word -# bmccane@maxbaud.net 98-apr-3 -# -# $Log: cust_main.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.11 1999/08/10 12:54:06 ivan -# use FS::cust_pkg::pkgpart_href -# -# Revision 1.10 1999/04/14 07:47:53 ivan -# i18n fixes -# -# Revision 1.9 1999/04/07 15:22:19 ivan -# don't use anchor in redirect -# -# Revision 1.8 1999/03/25 13:55:10 ivan -# one-screen new customer entry (including package and service) for simple -# packages with one svc_acct service -# -# Revision 1.7 1999/02/28 00:03:42 ivan -# removed misleading comments -# -# Revision 1.6 1999/01/25 12:10:00 ivan -# yet more mod_perl stuff -# -# Revision 1.5 1999/01/19 05:13:50 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.4 1999/01/18 09:22:32 ivan -# changes to track email addresses for email invoicing -# -# Revision 1.3 1998/12/17 08:40:19 ivan -# s/CGI::Request/CGI.pm/; etc -# -# Revision 1.2 1998/11/18 08:57:36 ivan -# i18n, s/CGI-modules/CGI.pm/, FS::CGI::idiot instead of inline, FS::CGI::popurl -# +# $Id: cust_main.cgi,v 1.2 2001-08-12 00:07:55 ivan Exp $ use strict; use vars qw( $cgi $payby @invoicing_list $new $custnum $error ); @@ -71,6 +16,8 @@ use FS::agent; $cgi = new CGI; &cgisuidsetup($cgi); +$error = ''; + #unmunge stuff $cgi->param('tax','') unless defined($cgi->param('tax')); @@ -106,10 +53,14 @@ $new = new FS::cust_main ( { } fields('cust_main') } ); -#perhaps the invocing_list magic should move to cust_main.pm? -$error = $new->check_invoicing_list( \@invoicing_list ); +if ( defined($cgi->param('same')) && $cgi->param('same') eq "Y" ) { + $new->setfield("ship_$_", '') foreach qw( + last first company address1 address2 city county state zip + country daytime night fax + ); +} -#perhaps this stuff should go to cust_main.pm as well +#perhaps this stuff should go to cust_main.pm $cust_pkg = ''; $svc_acct = ''; if ( $new->custnum eq '' ) { @@ -170,26 +121,20 @@ if ( $new->custnum eq '' ) { $error = "Can't assign username without a package!"; } - $error ||= $new->insert; - if ( $cust_pkg && ! $error ) { - $cust_pkg->custnum( $new->custnum ); - $error ||= $cust_pkg->insert; - warn "WARNING: $error on pre-checked cust_pkg record!" if $error; - $svc_acct->pkgnum( $cust_pkg->pkgnum ); - $error ||= $svc_acct->insert; - warn "WARNING: $error on pre-checked svc_acct record!" if $error; - } + use Tie::RefHash; + tie my %hash, 'Tie::RefHash'; + %hash = ( $cust_pkg => [ $svc_acct ] ); + $error ||= $new->insert( \%hash, \@invoicing_list ); } else { #create old record object my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } ); $error ||= "Old record not found!" unless $old; - $error ||= $new->replace($old); + $error ||= $new->replace($old, \@invoicing_list); } if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "cust_main.cgi?". $cgi->query_string ); } else { - $new->invoicing_list( \@invoicing_list ); $custnum = $new->custnum; print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); } -- cgit v1.2.1 From 092cdf2ba5fbd1c94305688dd7f7821d4dbf06d3 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 13 Aug 2001 23:10:34 +0000 Subject: properly massage ship_state & work okay when no initial pkg is selected --- httemplate/edit/process/cust_main.cgi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 1b916b00b..86e6abef6 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -1,5 +1,5 @@ <% -# $Id: cust_main.cgi,v 1.2 2001-08-12 00:07:55 ivan Exp $ +# $Id: cust_main.cgi,v 1.3 2001-08-13 23:10:34 ivan Exp $ use strict; use vars qw( $cgi $payby @invoicing_list $new $custnum $error ); @@ -30,6 +30,12 @@ $cgi->param('state', $1); $cgi->param('county', $3 || ''); $cgi->param('country', $4); +$cgi->param('ship_state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ + or die "Oops, illegal \"ship_state\" param: ". $cgi->param('ship_state'); +$cgi->param('ship_state', $1); +$cgi->param('ship_county', $3 || ''); +$cgi->param('ship_country', $4); + if ( $payby = $cgi->param('payby') ) { $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); $cgi->param('paydate', @@ -123,7 +129,7 @@ if ( $new->custnum eq '' ) { use Tie::RefHash; tie my %hash, 'Tie::RefHash'; - %hash = ( $cust_pkg => [ $svc_acct ] ); + %hash = ( $cust_pkg => [ $svc_acct ] ) if $cust_pkg; $error ||= $new->insert( \%hash, \@invoicing_list ); } else { #create old record object my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } ); -- cgit v1.2.1 From f0915e1efec95afa1be6100c8d7e919fa0babc71 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 4 Sep 2001 15:06:03 +0000 Subject: oops indeed --- httemplate/edit/process/cust_main.cgi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 86e6abef6..cc5efd6b1 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -1,5 +1,5 @@ <% -# $Id: cust_main.cgi,v 1.3 2001-08-13 23:10:34 ivan Exp $ +# $Id: cust_main.cgi,v 1.4 2001-09-04 15:06:03 ivan Exp $ use strict; use vars qw( $cgi $payby @invoicing_list $new $custnum $error ); @@ -31,6 +31,7 @@ $cgi->param('county', $3 || ''); $cgi->param('country', $4); $cgi->param('ship_state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ + or $cgi->param('ship_state') =~ /^(((())))$/ or die "Oops, illegal \"ship_state\" param: ". $cgi->param('ship_state'); $cgi->param('ship_state', $1); $cgi->param('ship_county', $3 || ''); -- cgit v1.2.1 From 60c837e0aaf454dfa0b0c0283dc36928782d1b6c Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 20 Oct 2001 12:18:00 +0000 Subject: setup and recurring fee tax exempt flags, UI to edit rework part_pkg editing UI some more --- httemplate/edit/process/cust_main.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index cc5efd6b1..625a85052 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -1,5 +1,5 @@ <% -# $Id: cust_main.cgi,v 1.4 2001-09-04 15:06:03 ivan Exp $ +# $Id: cust_main.cgi,v 1.5 2001-10-20 12:18:00 ivan Exp $ use strict; use vars qw( $cgi $payby @invoicing_list $new $custnum $error ); @@ -20,7 +20,7 @@ $error = ''; #unmunge stuff -$cgi->param('tax','') unless defined($cgi->param('tax')); +$cgi->param('tax','') unless defined $cgi->param('tax'); $cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] ); -- cgit v1.2.1 From 1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 30 Jan 2002 14:18:09 +0000 Subject: remove use Module; and $cgi = new CGI; &cgisuidsetup(); from all templates. should work better under Mason. --- httemplate/edit/process/cust_main.cgi | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 625a85052..fa50dc626 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -1,22 +1,7 @@ + <% -# $Id: cust_main.cgi,v 1.5 2001-10-20 12:18:00 ivan Exp $ -use strict; -use vars qw( $cgi $payby @invoicing_list $new $custnum $error ); -use vars qw( $cust_pkg $cust_svc $svc_acct ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::CGI qw( popurl ); -use FS::Record qw( qsearch qsearchs fields ); -use FS::cust_main; -use FS::type_pkgs; -use FS::agent; - -$cgi = new CGI; -&cgisuidsetup($cgi); - -$error = ''; +my $error = ''; #unmunge stuff @@ -37,7 +22,8 @@ $cgi->param('ship_state', $1); $cgi->param('ship_county', $3 || ''); $cgi->param('ship_country', $4); -if ( $payby = $cgi->param('payby') ) { +my $payby = $cgi->param('payby'); +if ( $payby ) { $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); $cgi->param('paydate', $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); @@ -46,12 +32,12 @@ if ( $payby = $cgi->param('payby') ) { $cgi->param('otaker', &getotaker ); -@invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); +my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); #create new record object -$new = new FS::cust_main ( { +my $new = new FS::cust_main ( { map { $_, scalar($cgi->param($_)) # } qw(custnum agentnum last first ss company address1 address2 city county @@ -68,8 +54,8 @@ if ( defined($cgi->param('same')) && $cgi->param('same') eq "Y" ) { } #perhaps this stuff should go to cust_main.pm -$cust_pkg = ''; -$svc_acct = ''; +my $cust_pkg = ''; +my $svc_acct = ''; if ( $new->custnum eq '' ) { if ( $cgi->param('pkgpart_svcpart') ) { @@ -142,7 +128,6 @@ if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "cust_main.cgi?". $cgi->query_string ); } else { - $custnum = $new->custnum; - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); + print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new->custnum); } %> -- cgit v1.2.1 From 22a35047ecdffff80110e06cc08fc84f9ddba9b0 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 13:21:31 +0000 Subject: removed from all files to fix any redirects, whew Mason handler.pl overrides CGI::redirect fixed strict; problems in edit/part_pkg.cgi & edit/process/part_pkg.cgi --- httemplate/edit/process/cust_main.cgi | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index fa50dc626..c8038ecf6 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -1,4 +1,3 @@ - <% my $error = ''; -- cgit v1.2.1 From cd2371a35a0c416366fa1822d99571ca68a5ad1e Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 19 Mar 2002 17:48:28 +0000 Subject: changes dum big "state/county/country" select to three, linked with javascript closes: Bug#353 --- httemplate/edit/process/cust_main.cgi | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index c8038ecf6..6ce60d14a 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -8,19 +8,6 @@ $cgi->param('tax','') unless defined $cgi->param('tax'); $cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] ); -$cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ - or die "Oops, illegal \"state\" param: ". $cgi->param('state'); -$cgi->param('state', $1); -$cgi->param('county', $3 || ''); -$cgi->param('country', $4); - -$cgi->param('ship_state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ - or $cgi->param('ship_state') =~ /^(((())))$/ - or die "Oops, illegal \"ship_state\" param: ". $cgi->param('ship_state'); -$cgi->param('ship_state', $1); -$cgi->param('ship_county', $3 || ''); -$cgi->param('ship_country', $4); - my $payby = $cgi->param('payby'); if ( $payby ) { $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); -- cgit v1.2.1 From eb9d5b215af1fbe867b75c12328126f650f9fb06 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 12 Oct 2002 10:15:55 +0000 Subject: ACH support --- httemplate/edit/process/cust_main.cgi | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 6ce60d14a..c15ea0321 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -10,9 +10,14 @@ $cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] ); my $payby = $cgi->param('payby'); if ( $payby ) { - $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); + if ( $payby eq 'CHEK' ) { + $cgi->param('payinfo', + $cgi->param('CHEK_payinfo1'). '@'. $cgi->param('CHEK_payinfo2') ); + } else { + $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); + } $cgi->param('paydate', - $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); + $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); $cgi->param('payname', $cgi->param( $payby. '_payname' ) ); } -- cgit v1.2.1 From 2a5963390ddd68ecb2e40568ca272c0a2f8b831a Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 2 Apr 2003 03:25:15 +0000 Subject: fix disappearing email invoice on errors, finally (closes: Bug#35) --- httemplate/edit/process/cust_main.cgi | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index c15ea0321..5e6000c05 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -25,6 +25,7 @@ $cgi->param('otaker', &getotaker ); my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); +$cgi->param('invoicing_list', join(',', @invoicing_list) ); #create new record object -- cgit v1.2.1 From 030bef17868168b05a67d9f5866b55da1bb9439c Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 21 Apr 2003 20:53:57 +0000 Subject: on-demand vs. automatic cards & checks: added DCRD and DCHK payment types --- httemplate/edit/process/cust_main.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 5e6000c05..3700d9b96 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -10,9 +10,9 @@ $cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] ); my $payby = $cgi->param('payby'); if ( $payby ) { - if ( $payby eq 'CHEK' ) { + if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) { $cgi->param('payinfo', - $cgi->param('CHEK_payinfo1'). '@'. $cgi->param('CHEK_payinfo2') ); + $cgi->param($payby. '_payinfo1'). '@'. $cgi->param($payby. '_payinfo2') ); } else { $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); } -- cgit v1.2.1 From 1dd6907483dae3aab9dc7b112d1b38af9f4a7060 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Jul 2003 15:36:54 +0000 Subject: fix spurious "can't purchase pkgpart" errors --- httemplate/edit/process/cust_main.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 3700d9b96..818382856 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -52,7 +52,7 @@ if ( $new->custnum eq '' ) { if ( $cgi->param('pkgpart_svcpart') ) { my $x = $cgi->param('pkgpart_svcpart'); - $x =~ /^(\d+)_(\d+)$/; + $x =~ /^(\d+)_(\d+)$/ or die "illegal pkgpart_svcpart $x\n"; my($pkgpart, $svcpart) = ($1, $2); #false laziness: copied from FS::cust_pkg::order (which should become a #FS::cust_main method) @@ -70,7 +70,7 @@ if ( $new->custnum eq '' ) { #eslaf # this should wind up in FS::cust_pkg! - $error ||= "Agent ". $new->agentnum. " (type ". $agent->typenum. ") can't". + $error ||= "Agent ". $new->agentnum. " (type ". $agent->typenum. ") can't ". "purchase pkgpart ". $pkgpart #unless $part_pkg{ $pkgpart }; unless $pkgpart_href->{ $pkgpart }; -- cgit v1.2.1 From f63c0e821610c885f9f49d301eeccf804e1ca6d3 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 24 Oct 2003 19:30:44 +0000 Subject: cvv! --- httemplate/edit/process/cust_main.cgi | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 818382856..25c346e46 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -19,6 +19,8 @@ if ( $payby ) { $cgi->param('paydate', $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' ); } $cgi->param('otaker', &getotaker ); @@ -27,6 +29,7 @@ my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); $cgi->param('invoicing_list', join(',', @invoicing_list) ); + #create new record object my $new = new FS::cust_main ( { @@ -113,6 +116,11 @@ if ( $new->custnum eq '' ) { } 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') + && length($old->paycvv) + && $new->paycvv =~ /^\s*\*+\s*$/ ) { + $new->paycvv($old->paycvv); + } $error ||= $new->replace($old, \@invoicing_list); } -- cgit v1.2.1 From db69a9fb0dd93bf13b8b7501ef4829a568d2f6d8 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 8 Jul 2004 11:15:19 +0000 Subject: don't change otaker when just editing account, closes: Bug#921 --- httemplate/edit/process/cust_main.cgi | 2 -- 1 file changed, 2 deletions(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 25c346e46..0b13ba96b 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -23,8 +23,6 @@ if ( $payby ) { if defined $cgi->param( $payby. '_paycvv' ); } -$cgi->param('otaker', &getotaker ); - my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); $cgi->param('invoicing_list', join(',', @invoicing_list) ); -- cgit v1.2.1