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/agent.cgi | 73 ++++++++ httemplate/edit/process/agent_type.cgi | 100 +++++++++++ httemplate/edit/process/cust_credit.cgi | 80 +++++++++ httemplate/edit/process/cust_main.cgi | 196 +++++++++++++++++++++ .../edit/process/cust_main_county-expand.cgi | 104 +++++++++++ httemplate/edit/process/cust_main_county.cgi | 64 +++++++ httemplate/edit/process/cust_pay.cgi | 71 ++++++++ httemplate/edit/process/cust_pkg.cgi | 84 +++++++++ httemplate/edit/process/part_pkg.cgi | 152 ++++++++++++++++ httemplate/edit/process/part_referral.cgi | 69 ++++++++ httemplate/edit/process/part_svc.cgi | 30 ++++ httemplate/edit/process/svc_acct.cgi | 100 +++++++++++ httemplate/edit/process/svc_acct_pop.cgi | 70 ++++++++ httemplate/edit/process/svc_acct_sm.cgi | 87 +++++++++ httemplate/edit/process/svc_domain.cgi | 84 +++++++++ 15 files changed, 1364 insertions(+) create mode 100755 httemplate/edit/process/agent.cgi create mode 100755 httemplate/edit/process/agent_type.cgi create mode 100755 httemplate/edit/process/cust_credit.cgi create mode 100755 httemplate/edit/process/cust_main.cgi create mode 100755 httemplate/edit/process/cust_main_county-expand.cgi create mode 100755 httemplate/edit/process/cust_main_county.cgi create mode 100755 httemplate/edit/process/cust_pay.cgi create mode 100755 httemplate/edit/process/cust_pkg.cgi create mode 100755 httemplate/edit/process/part_pkg.cgi create mode 100755 httemplate/edit/process/part_referral.cgi create mode 100755 httemplate/edit/process/part_svc.cgi create mode 100755 httemplate/edit/process/svc_acct.cgi create mode 100755 httemplate/edit/process/svc_acct_pop.cgi create mode 100755 httemplate/edit/process/svc_acct_sm.cgi create mode 100755 httemplate/edit/process/svc_domain.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/agent.cgi b/httemplate/edit/process/agent.cgi new file mode 100755 index 000000000..2b4991363 --- /dev/null +++ b/httemplate/edit/process/agent.cgi @@ -0,0 +1,73 @@ +<% +# +# $Id: agent.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# ivan@sisd.com 97-dec-12 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: agent.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.7 1999/01/25 12:09:57 ivan +# yet more mod_perl stuff +# +# Revision 1.6 1999/01/19 05:13:47 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.5 1999/01/18 22:47:49 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.4 1998/12/30 23:03:26 ivan +# bugfixes; fields isn't exported by derived classes +# +# Revision 1.3 1998/12/17 08:40:16 ivan +# s/CGI::Request/CGI.pm/; etc +# +# Revision 1.2 1998/11/23 07:52:29 ivan +# *** empty log message *** +# + +use strict; +use vars qw ( $cgi $agentnum $old $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::Record qw(qsearch qsearchs fields); +use FS::agent; +use FS::CGI qw(popurl); + +$cgi = new CGI; + +&cgisuidsetup($cgi); + +$agentnum = $cgi->param('agentnum'); + +$old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; + +$new = new FS::agent ( { + map { + $_, scalar($cgi->param($_)); + } fields('agent') +} ); + +if ( $agentnum ) { + $error=$new->replace($old); +} else { + $error=$new->insert; + $agentnum=$new->getfield('agentnum'); +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "browse/agent.cgi"); +} + +%> diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi new file mode 100755 index 000000000..5c6b2b8e0 --- /dev/null +++ b/httemplate/edit/process/agent_type.cgi @@ -0,0 +1,100 @@ +<% +# +# $Id: agent_type.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# ivan@sisd.com 97-dec-11 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: agent_type.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.7 1999/01/25 12:09:58 ivan +# yet more mod_perl stuff +# +# Revision 1.6 1999/01/19 05:13:48 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.5 1999/01/18 22:47:50 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.4 1998/12/30 23:03:27 ivan +# bugfixes; fields isn't exported by derived classes +# +# Revision 1.3 1998/12/17 08:40:17 ivan +# s/CGI::Request/CGI.pm/; etc +# +# Revision 1.2 1998/11/21 07:49:20 ivan +# s/CGI::Request/CGI.pm/ +# + +use strict; +use vars qw ( $cgi $typenum $old $new $error $part_pkg ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::CGI qw( popurl); +use FS::UID qw(cgisuidsetup); +use FS::Record qw(qsearch qsearchs fields); +use FS::agent_type; +use FS::type_pkgs; +use FS::part_pkg; + +$cgi = new CGI; +&cgisuidsetup($cgi); + +$typenum = $cgi->param('typenum'); +$old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; + +$new = new FS::agent_type ( { + map { + $_, scalar($cgi->param($_)); + } fields('agent_type') +} ); + +if ( $typenum ) { + $error=$new->replace($old); +} else { + $error=$new->insert; + $typenum=$new->getfield('typenum'); +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string ); + exit; +} + +foreach $part_pkg (qsearch('part_pkg',{})) { + my($pkgpart)=$part_pkg->getfield('pkgpart'); + + my($type_pkgs)=qsearchs('type_pkgs',{ + 'typenum' => $typenum, + 'pkgpart' => $pkgpart, + }); + if ( $type_pkgs && ! $cgi->param("pkgpart$pkgpart") ) { + my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below. + $error=$d_type_pkgs->delete; + die $error if $error; + + } elsif ( $cgi->param("pkgpart$pkgpart") + && ! $type_pkgs + ) { + #ok to clobber it now (but bad form nonetheless?) + $type_pkgs=new FS::type_pkgs ({ + 'typenum' => $typenum, + 'pkgpart' => $pkgpart, + }); + $error= $type_pkgs->insert; + die $error if $error; + } + +} + +print $cgi->redirect(popurl(3). "browse/agent_type.cgi"); + +%> diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi new file mode 100755 index 000000000..3cacab26e --- /dev/null +++ b/httemplate/edit/process/cust_credit.cgi @@ -0,0 +1,80 @@ +<% +# +# $Id: cust_credit.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# Usage: post form to: +# http://server.name/path/cust_credit.cgi +# +# ivan@voicenet.com 96-dec-05 -> 96-dec-08 +# +# post a refund if $new_paybatch +# ivan@voicenet.com 96-dec-08 +# +# refunds are no longer applied against a specific payment (paybatch) +# paybatch field removed +# ivan@voicenet.com 97-apr-22 +# +# rewrite ivan@sisd.com 98-mar-16 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# $Log: cust_credit.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.7 1999/04/07 15:23:05 ivan +# don't use anchor in redirect +# +# Revision 1.6 1999/02/28 00:03:41 ivan +# removed misleading comments +# +# Revision 1.5 1999/01/25 12:09:59 ivan +# yet more mod_perl stuff +# +# Revision 1.4 1999/01/19 05:13:49 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.3 1999/01/18 22:47:51 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.2 1998/12/17 08:40:18 ivan +# s/CGI::Request/CGI.pm/; etc +# + +use strict; +use vars qw( $cgi $custnum $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup getotaker); +use FS::CGI qw(popurl); +use FS::Record qw(fields); +use FS::cust_credit; + +$cgi = new CGI; +cgisuidsetup($cgi); + +$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; +$custnum = $1; + +$cgi->param('otaker',getotaker); + +$new = new FS::cust_credit ( { + map { + $_, scalar($cgi->param($_)); + #} qw(custnum _date amount otaker reason) + } fields('cust_credit') +} ); + +$error=$new->insert; + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "cust_credit.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); +} + + +%> 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"); +} +%> diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi new file mode 100755 index 000000000..b7c4547f6 --- /dev/null +++ b/httemplate/edit/process/cust_main_county-expand.cgi @@ -0,0 +1,104 @@ +<% +# +# $Id: cust_main_county-expand.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# ivan@sisd.com 97-dec-16 +# +# Changes to allow page to work at a relative position in server +# Added import of datasrc from UID.pm for Pg6.3 +# Default tax to 0.0 if using Pg6.3 +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI +# undo default tax to 0.0 if using Pg6.3: comes from pre-expanded record +# for that state +# ivan@sisd.com 98-sep-2 +# +# $Log: cust_main_county-expand.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.7 2000/12/21 05:22:30 ivan +# perldoc -f split +# +# Revision 1.6 1999/01/25 12:19:07 ivan +# yet more mod_perl stuff +# +# Revision 1.5 1999/01/19 05:13:51 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 22:47:52 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.3 1998/12/17 08:40:20 ivan +# s/CGI::Request/CGI.pm/; etc +# +# Revision 1.2 1998/11/18 09:01:40 ivan +# i18n! i18n! +# + +use strict; +use vars qw ( $cgi $taxnum $cust_main_county @expansion $expansion ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup datasrc); +use FS::Record qw(qsearch qsearchs); +use FS::CGI qw(popurl); +use FS::cust_main_county; +use FS::cust_main; + +$cgi = new CGI; +&cgisuidsetup($cgi); + +$cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; +$taxnum = $1; +$cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) + or die ("Unknown taxnum!"); + +if ( $cgi->param('delim') eq 'n' ) { + @expansion=split(/\n/,$cgi->param('expansion')); +} elsif ( $cgi->param('delim') eq 's' ) { + @expansion=split(' ',$cgi->param('expansion')); +} else { + die "Illegal delim!"; +} + +@expansion=map { + unless ( /^\s*([\w\- ]+)\s*$/ ) { + $cgi->param('error', "Illegal item in expansion"); + print $cgi->redirect(popurl(2). "cust_main_county-expand.cgi?". $cgi->query_string ); + exit; + } + $1; +} @expansion; + +foreach ( @expansion) { + my(%hash)=$cust_main_county->hash; + my($new)=new FS::cust_main_county \%hash; + $new->setfield('taxnum',''); + if ( ! $cust_main_county->state ) { + $new->setfield('state',$_); + } else { + $new->setfield('county',$_); + } + #if (datasrc =~ m/Pg/) + #{ + # $new->setfield('tax',0.0); + #} + my($error)=$new->insert; + die $error if $error; +} + +unless ( qsearch('cust_main',{ + 'state' => $cust_main_county->getfield('state'), + 'county' => $cust_main_county->getfield('county'), + 'country' => $cust_main_county->getfield('country'), +} ) ) { + my($error)=($cust_main_county->delete); + die $error if $error; +} + +print $cgi->redirect(popurl(3). "edit/cust_main_county.cgi"); + +%> diff --git a/httemplate/edit/process/cust_main_county.cgi b/httemplate/edit/process/cust_main_county.cgi new file mode 100755 index 000000000..1ff2047f1 --- /dev/null +++ b/httemplate/edit/process/cust_main_county.cgi @@ -0,0 +1,64 @@ +<% +# +# $Id: cust_main_county.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# ivan@sisd.com 97-dec-16 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: cust_main_county.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.6 1999/01/25 12:19:08 ivan +# yet more mod_perl stuff +# +# Revision 1.5 1999/01/19 05:13:52 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 22:47:53 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.3 1998/12/17 08:40:21 ivan +# s/CGI::Request/CGI.pm/; etc +# +# Revision 1.2 1998/11/18 09:01:41 ivan +# i18n! i18n! +# + +use strict; +use vars qw( $cgi ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::CGI qw(popurl); +use FS::Record qw(qsearch qsearchs); +use FS::cust_main_county; + +$cgi = new CGI; +&cgisuidsetup($cgi); + +foreach ( $cgi->param ) { + /^tax(\d+)$/ or die "Illegal form $_!"; + my($taxnum)=$1; + my($old)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}) + or die "Couldn't find taxnum $taxnum!"; + next unless $old->getfield('tax') ne $cgi->param("tax$taxnum"); + my(%hash)=$old->hash; + $hash{tax}=$cgi->param("tax$taxnum"); + my($new)=new FS::cust_main_county \%hash; + my($error)=$new->replace($old); + if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string ); + exit; + } +} + +print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); + +%> diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi new file mode 100755 index 000000000..f21ff490a --- /dev/null +++ b/httemplate/edit/process/cust_pay.cgi @@ -0,0 +1,71 @@ +<% +# +# $Id: cust_pay.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# Usage: post form to: +# http://server.name/path/cust_pay.cgi +# +# ivan@voicenet.com 96-dec-11 +# +# rewrite ivan@sisd.com 98-mar-16 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# $Log: cust_pay.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.7 1999/02/28 00:03:43 ivan +# removed misleading comments +# +# Revision 1.6 1999/01/25 12:19:09 ivan +# yet more mod_perl stuff +# +# Revision 1.5 1999/01/19 05:13:53 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 22:47:54 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.3 1998/12/30 23:03:28 ivan +# bugfixes; fields isn't exported by derived classes +# +# Revision 1.2 1998/12/17 08:40:22 ivan +# s/CGI::Request/CGI.pm/; etc +# + +use strict; +use vars qw( $cgi $invnum $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::CGI qw(popurl); +use FS::Record qw(fields); +use FS::cust_pay; + +$cgi = new CGI; +&cgisuidsetup($cgi); + +$cgi->param('invnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; +$invnum = $1; + +$new = new FS::cust_pay ( { + map { + $_, scalar($cgi->param($_)); + #} qw(invnum paid _date payby payinfo paybatch) + } fields('cust_pay') +} ); + +$error=$new->insert; + +if ($error) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string ); + exit; +} else { + print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$invnum"); +} + +%> diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi new file mode 100755 index 000000000..0074466c8 --- /dev/null +++ b/httemplate/edit/process/cust_pkg.cgi @@ -0,0 +1,84 @@ +<% +# +# $Id: cust_pkg.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# this is for changing packages around, not for editing things within the +# package +# +# Usage: post form to: +# http://server.name/path/cust_pkg.cgi +# +# ivan@voicenet.com 97-mar-21 - 97-mar-24 +# +# rewrote for new API +# ivan@voicenet.com 97-jul-7 - 15 +# +# &cgisuidsetup($cgi) ivan@sisd.com 98-mar-7 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# $Log: cust_pkg.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.7 1999/04/07 15:24:06 ivan +# don't use anchor in redirect +# +# Revision 1.6 1999/02/28 00:03:44 ivan +# removed misleading comments +# +# Revision 1.5 1999/02/07 09:59:26 ivan +# more mod_perl fixes, and bugfixes Peter Wemm sent via email +# +# Revision 1.3 1999/01/19 05:13:54 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.2 1998/12/17 08:40:23 ivan +# s/CGI::Request/CGI.pm/; etc +# + +use strict; +use vars qw( $cgi $custnum @remove_pkgnums @pkgparts $pkgpart $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::CGI qw(popurl); +use FS::cust_pkg; + +$cgi = new CGI; # create form object +&cgisuidsetup($cgi); +$error = ''; + +#untaint custnum +$cgi->param('custnum') =~ /^(\d+)$/; +$custnum = $1; + +@remove_pkgnums = map { + /^(\d+)$/ or die "Illegal remove_pkg value!"; + $1; +} $cgi->param('remove_pkg'); + +foreach $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { + if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { + my $num_pkgs = $1; + while ( $num_pkgs-- ) { + push @pkgparts,$pkgpart; + } + } else { + $error = "Illegal quantity"; + last; + } +} + +$error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); + +if ($error) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "cust_pkg.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); +} + +%> diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi new file mode 100755 index 000000000..3e1c07d1e --- /dev/null +++ b/httemplate/edit/process/part_pkg.cgi @@ -0,0 +1,152 @@ +<% +# +# $Id: part_pkg.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# process/part_pkg.cgi: Edit package definitions (process form) +# +# ivan@sisd.com 97-dec-10 +# +# don't update non-changing records in part_svc (causing harmless but annoying +# "Records identical" errors). ivan@sisd.com 98-feb-19 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# Added `|| 0 ' when getting quantity off web page ivan@sisd.com 98-jun-4 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: part_pkg.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.9 2001/04/09 23:05:16 ivan +# Transactions Part I!!! +# +# Revision 1.8 1999/02/07 09:59:27 ivan +# more mod_perl fixes, and bugfixes Peter Wemm sent via email +# +# Revision 1.7 1999/01/19 05:13:55 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.6 1999/01/18 22:47:56 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.5 1998/12/30 23:03:29 ivan +# bugfixes; fields isn't exported by derived classes +# +# Revision 1.4 1998/12/17 08:40:24 ivan +# s/CGI::Request/CGI.pm/; etc +# +# Revision 1.3 1998/11/21 07:17:58 ivan +# bugfix to work for regular aswell as custom pricing +# +# Revision 1.2 1998/11/15 13:16:15 ivan +# first pass as per-user custom pricing +# + +use strict; +use vars qw( $cgi $pkgpart $old $new $part_svc $error $dbh ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::CGI qw(popurl); +use FS::Record qw(qsearch qsearchs fields); +use FS::part_pkg; +use FS::pkg_svc; +use FS::cust_pkg; + +$cgi = new CGI; +$dbh = &cgisuidsetup($cgi); + +$pkgpart = $cgi->param('pkgpart'); + +$old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; + +$new = new FS::part_pkg ( { + map { + $_, scalar($cgi->param($_)); + } fields('part_pkg') +} ); + +#most of the stuff below should move to part_pkg.pm + +foreach $part_svc ( qsearch('part_svc', {} ) ) { + my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0; + unless ( $quantity =~ /^(\d+)$/ ) { + $cgi->param('error', "Illegal quantity" ); + print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); + exit; + } +} + +local $SIG{HUP} = 'IGNORE'; +local $SIG{INT} = 'IGNORE'; +local $SIG{QUIT} = 'IGNORE'; +local $SIG{TERM} = 'IGNORE'; +local $SIG{TSTP} = 'IGNORE'; +local $SIG{PIPE} = 'IGNORE'; + +local $FS::UID::AutoCommit = 0; + +if ( $pkgpart ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $pkgpart=$new->pkgpart; +} +if ( $error ) { + $dbh->rollback; + $cgi->param('error', $error ); + print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); + exit; +} + +foreach $part_svc (qsearch('part_svc',{})) { + my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0; + my $old_pkg_svc = qsearchs('pkg_svc', { + 'pkgpart' => $pkgpart, + 'svcpart' => $part_svc->svcpart, + } ); + my $old_quantity = $old_pkg_svc ? $old_pkg_svc->quantity : 0; + next unless $old_quantity != $quantity; #!here + my $new_pkg_svc = new FS::pkg_svc( { + 'pkgpart' => $pkgpart, + 'svcpart' => $part_svc->svcpart, + 'quantity' => $quantity, + } ); + if ( $old_pkg_svc ) { + my $myerror = $new_pkg_svc->replace($old_pkg_svc); + if ( $myerror ) { + $dbh->rollback; + die $myerror; + } + } else { + my $myerror = $new_pkg_svc->insert; + if ( $myerror ) { + $dbh->rollback; + die $myerror; + } + } +} + +unless ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) { + $dbh->commit or die $dbh->errstr; + print $cgi->redirect(popurl(3). "browse/part_pkg.cgi"); +} else { + my($old_cust_pkg) = qsearchs( 'cust_pkg', { 'pkgnum' => $1 } ); + my %hash = $old_cust_pkg->hash; + $hash{'pkgpart'} = $pkgpart; + my($new_cust_pkg) = new FS::cust_pkg \%hash; + my $myerror = $new_cust_pkg->replace($old_cust_pkg); + if ( $myerror ) { + $dbh->rollback; + die "Error modifying cust_pkg record: $myerror\n"; + } + + $dbh->commit or die $dbh->errstr; + print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new_cust_pkg->custnum); +} + +%> diff --git a/httemplate/edit/process/part_referral.cgi b/httemplate/edit/process/part_referral.cgi new file mode 100755 index 000000000..c79ebb608 --- /dev/null +++ b/httemplate/edit/process/part_referral.cgi @@ -0,0 +1,69 @@ +<% +# +# $Id: part_referral.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# ivan@sisd.com 98-feb-23 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: part_referral.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.6 1999/02/07 09:59:28 ivan +# more mod_perl fixes, and bugfixes Peter Wemm sent via email +# +# Revision 1.5 1999/01/19 05:13:56 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 22:47:57 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.3 1998/12/30 23:03:30 ivan +# bugfixes; fields isn't exported by derived classes +# +# Revision 1.2 1998/12/17 08:40:25 ivan +# s/CGI::Request/CGI.pm/; etc +# + +use strict; +use vars qw( $cgi $refnum $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::Record qw(qsearchs fields); +use FS::part_referral; +use FS::CGI qw(popurl); + +$cgi = new CGI; +&cgisuidsetup($cgi); + +$refnum = $cgi->param('refnum'); + +$new = new FS::part_referral ( { + map { + $_, scalar($cgi->param($_)); + } fields('part_referral') +} ); + +if ( $refnum ) { + my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } ); + die "(Old) Record not found!" unless $old; + $error = $new->replace($old); +} else { + $error = $new->insert; +} +$refnum=$new->refnum; + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "part_referral.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "browse/part_referral.cgi"); +} + +%> diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi new file mode 100755 index 000000000..4c972e4d7 --- /dev/null +++ b/httemplate/edit/process/part_svc.cgi @@ -0,0 +1,30 @@ +<% + +my $svcpart = $cgi->param('svcpart'); + +my $old = qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart; + +my $new = new FS::part_svc ( { + map { + $_, scalar($cgi->param($_)); +# } qw(svcpart svc svcdb) + } fields('part_svc') +} ); + +my $error; +if ( $svcpart ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $svcpart=$new->getfield('svcpart'); +} + +if ( $error ) { + $cgi->param('error', $error); + $Response->Redirect(popurl(2). "part_svc.cgi?". $cgi->query_string ); +} else { + warn "redirecting to ". popurl(3)."browse/part_svc.cgi via $Response"; + $Response->Redirect(popurl(3)."browse/part_svc.cgi"); +} + +%> diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi new file mode 100755 index 000000000..e895e5ddf --- /dev/null +++ b/httemplate/edit/process/svc_acct.cgi @@ -0,0 +1,100 @@ +<% +# +# $Id: svc_acct.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# Usage: post form to: +# http://server.name/path/svc_acct.cgi +# +# ivan@voicenet.com 96-dec-18 +# +# Changed /u to /u2 +# ivan@voicenet.com 97-may-6 +# +# rewrote for new API +# ivan@voicenet.com 97-jul-17 - 21 +# +# no FS::Search, FS::svc_acct creates FS::cust_svc record, used for adding +# and editing ivan@sisd.com 98-mar-8 +# +# Changes to allow page to work at a relative position in server +# Changed 'password' to '_password' because Pg6.3 reserves the password word +# bmccane@maxbaud.net 98-apr-3 +# +# $Log: svc_acct.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.7 1999/08/27 00:26:33 ivan +# better error messages +# +# Revision 1.6 1999/02/28 00:03:45 ivan +# removed misleading comments +# +# Revision 1.5 1999/02/07 09:59:30 ivan +# more mod_perl fixes, and bugfixes Peter Wemm sent via email +# +# Revision 1.4 1999/01/19 05:13:58 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.3 1999/01/18 22:47:59 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.2 1998/12/17 08:40:27 ivan +# s/CGI::Request/CGI.pm/; etc +# + +use strict; +use vars qw( $cgi $svcnum $old $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::CGI qw(popurl); +use FS::Record qw(qsearchs fields); +use FS::svc_acct; + +$cgi = new CGI; +&cgisuidsetup($cgi); + +$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; +$svcnum = $1; + +if ( $svcnum ) { + $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } ) + or die "fatal: can't find account (svcnum $svcnum)!"; +} else { + $old = ''; +} + +#unmunge popnum +$cgi->param('popnum', (split(/:/, $cgi->param('popnum') ))[0] ); + +#unmunge passwd +if ( $cgi->param('_password') eq '*HIDDEN*' ) { + die "fatal: no previous account to recall hidden password from!" unless $old; + $cgi->param('_password',$old->getfield('_password')); +} + +$new = new FS::svc_acct ( { + map { + $_, scalar($cgi->param($_)); + #} qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir + # shell quota slipip) + } ( fields('svc_acct'), qw( pkgnum svcpart ) ) +} ); + +if ( $svcnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $svcnum = $new->svcnum; +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "svc_acct.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/svc_acct.cgi?" . $svcnum ); +} + +%> diff --git a/httemplate/edit/process/svc_acct_pop.cgi b/httemplate/edit/process/svc_acct_pop.cgi new file mode 100755 index 000000000..95415f201 --- /dev/null +++ b/httemplate/edit/process/svc_acct_pop.cgi @@ -0,0 +1,70 @@ +<% +# +# $Id: svc_acct_pop.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# ivan@sisd.com 98-mar-8 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: svc_acct_pop.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.6 1999/02/07 09:59:31 ivan +# more mod_perl fixes, and bugfixes Peter Wemm sent via email +# +# Revision 1.5 1999/01/19 05:13:59 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 22:48:00 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.3 1998/12/30 23:03:32 ivan +# bugfixes; fields isn't exported by derived classes +# +# Revision 1.2 1998/12/17 08:40:28 ivan +# s/CGI::Request/CGI.pm/; etc +# + +use strict; +use vars qw( $cgi $popnum $old $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::Record qw(qsearch qsearchs fields); +use FS::svc_acct_pop; +use FS::CGI qw(popurl); + +$cgi = new CGI; # create form object + +&cgisuidsetup($cgi); + +$popnum = $cgi->param('popnum'); + +$old = qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum; + +$new = new FS::svc_acct_pop ( { + map { + $_, scalar($cgi->param($_)); + } fields('svc_acct_pop') +} ); + +if ( $popnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $popnum=$new->getfield('popnum'); +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "svc_acct_pop.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "browse/svc_acct_pop.cgi"); +} + +%> diff --git a/httemplate/edit/process/svc_acct_sm.cgi b/httemplate/edit/process/svc_acct_sm.cgi new file mode 100755 index 000000000..a68478898 --- /dev/null +++ b/httemplate/edit/process/svc_acct_sm.cgi @@ -0,0 +1,87 @@ +<% +# +# $Id: svc_acct_sm.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# Usage: post form to: +# http://server.name/path/svc_acct_sm.cgi +# +# lots of crufty stuff from svc_acct still in here, and modifications are (unelegantly) disabled. +# +# ivan@voicenet.com 97-jan-6 +# +# enabled modifications +# +# ivan@voicenet.com 97-may-7 +# +# fixed removal of cust_svc record on modifications! +# ivan@voicenet.com 97-jun-5 +# +# rewrite ivan@sisd.com 98-mar-15 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# $Log: svc_acct_sm.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.6 1999/02/28 00:03:46 ivan +# removed misleading comments +# +# Revision 1.5 1999/02/07 09:59:32 ivan +# more mod_perl fixes, and bugfixes Peter Wemm sent via email +# +# Revision 1.4 1999/01/19 05:14:00 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.3 1999/01/18 22:48:01 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.2 1998/12/17 08:40:29 ivan +# s/CGI::Request/CGI.pm/; etc +# + +use strict; +use vars qw( $cgi $svcnum $old $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::Record qw(qsearchs fields); +use FS::svc_acct_sm; +use FS::CGI qw(popurl); + +$cgi = new CGI; +cgisuidsetup($cgi); + +$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; +$svcnum =$1; + +$old = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum; + +#unmunge domsvc and domuid +#$cgi->param('domsvc',(split(/:/, $cgi->param('domsvc') ))[0] ); +#$cgi->param('domuid',(split(/:/, $cgi->param('domuid') ))[0] ); + +$new = new FS::svc_acct_sm ( { + map { + ($_, scalar($cgi->param($_))); + #} qw(svcnum pkgnum svcpart domuser domuid domsvc) + } ( fields('svc_acct_sm'), qw( pkgnum svcpart ) ) +} ); + +if ( $svcnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $svcnum = $new->getfield('svcnum'); +} + +if ($error) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "svc_acct_sm.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/svc_acct_sm.cgi?$svcnum"); +} + +%> diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi new file mode 100755 index 000000000..59a0c078f --- /dev/null +++ b/httemplate/edit/process/svc_domain.cgi @@ -0,0 +1,84 @@ +<% +# +# $Id: svc_domain.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# Usage: post form to: +# http://server.name/path/svc_domain.cgi +# +# lots of yucky stuff in this one... bleachlkjhui! +# +# ivan@voicenet.com 97-jan-6 +# +# kludged for new domain template 3.5 +# ivan@voicenet.com 97-jul-24 +# +# moved internic bits to svc_domain.pm ivan@sisd.com 98-mar-14 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# $Log: svc_domain.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.7 2001/04/23 07:12:44 ivan +# better error message (if kludgy) for no referral +# remove outdated NSI foo from domain ordering. also, fuck NSI. +# +# Revision 1.6 1999/02/28 00:03:47 ivan +# removed misleading comments +# +# Revision 1.5 1999/02/07 09:59:33 ivan +# more mod_perl fixes, and bugfixes Peter Wemm sent via email +# +# Revision 1.4 1999/01/19 05:14:01 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.3 1999/01/18 22:48:02 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.2 1998/12/17 08:40:30 ivan +# s/CGI::Request/CGI.pm/; etc +# + +use strict; +use vars qw( $cgi $svcnum $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::Record qw(qsearchs fields); +use FS::svc_domain; +use FS::CGI qw(popurl); + +#remove this to actually test the domains! +$FS::svc_domain::whois_hack = 1; + +$cgi = new CGI; +&cgisuidsetup($cgi); + +$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; +$svcnum = $1; + +$new = new FS::svc_domain ( { + map { + $_, scalar($cgi->param($_)); + #} qw(svcnum pkgnum svcpart domain action purpose) + } ( fields('svc_domain'), qw( pkgnum svcpart action purpose ) ) +} ); + +if ($cgi->param('svcnum')) { + $error="Can't modify a domain!"; +} else { + $error=$new->insert; + $svcnum=$new->svcnum; +} + +if ($error) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "svc_domain.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum"); +} + +%> -- 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') 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 67e59b7ab85227889ca127b875b4138f018c844d Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 12 Aug 2001 08:56:42 +0000 Subject: don't use Apache::ASP-specific $Redirect object --- httemplate/edit/process/part_svc.cgi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi index 4c972e4d7..093d86a75 100755 --- a/httemplate/edit/process/part_svc.cgi +++ b/httemplate/edit/process/part_svc.cgi @@ -21,10 +21,9 @@ if ( $svcpart ) { if ( $error ) { $cgi->param('error', $error); - $Response->Redirect(popurl(2). "part_svc.cgi?". $cgi->query_string ); + print $cgi->redirect(popurl(2), "part_svc.cgi?". $cgi->query_string ); } else { - warn "redirecting to ". popurl(3)."browse/part_svc.cgi via $Response"; - $Response->Redirect(popurl(3)."browse/part_svc.cgi"); + print $cgi->redirect(popurl(3)."browse/part_svc.cgi"); } %> -- 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') 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 94d7e3f0d3431fc1a16afea163367a79ccc78d95 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 17 Aug 2001 11:05:31 +0000 Subject: clean up tax rate editing: sort by country->state->county, add "collapse state" if the tax rates are the same statewide, redirect "expand state" to the browse, not edit screen --- .../edit/process/cust_main_county-collapse.cgi | 49 ++++++++++++++++++++++ .../edit/process/cust_main_county-expand.cgi | 41 +----------------- 2 files changed, 51 insertions(+), 39 deletions(-) create mode 100755 httemplate/edit/process/cust_main_county-collapse.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_main_county-collapse.cgi b/httemplate/edit/process/cust_main_county-collapse.cgi new file mode 100755 index 000000000..62c2ba753 --- /dev/null +++ b/httemplate/edit/process/cust_main_county-collapse.cgi @@ -0,0 +1,49 @@ +<% +# + +use strict; +use vars qw ( $cgi $taxnum $cust_main_county @expansion $expansion ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup datasrc); +use FS::Record qw(qsearch qsearchs); +use FS::CGI qw(popurl); +use FS::cust_main_county; +use FS::cust_main; + +$cgi = new CGI; +&cgisuidsetup($cgi); + +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/ or die "Illegal taxnum!"; +$taxnum = $1; +$cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) + or die ("Unknown taxnum!"); + +#really should do this in a .pm & start transaction + +foreach my $delete ( qsearch('cust_main_county', { + 'country' => $cust_main_county->country, + 'state' => $cust_main_county->state + } ) ) { +# unless ( qsearch('cust_main',{ +# 'state' => $cust_main_county->getfield('state'), +# 'county' => $cust_main_county->getfield('county'), +# 'country' => $cust_main_county->getfield('country'), +# } ) ) { + my $error = $delete->delete; + die $error if $error; +# } else { + #should really fix the $cust_main record +# } + +} + +$cust_main_county->taxnum(''); +$cust_main_county->county(''); +my $error = $cust_main_county->insert; +die $error if $error; + +print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); + +%> diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi index b7c4547f6..a0231b076 100755 --- a/httemplate/edit/process/cust_main_county-expand.cgi +++ b/httemplate/edit/process/cust_main_county-expand.cgi @@ -1,42 +1,5 @@ <% -# -# $Id: cust_main_county-expand.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# Added import of datasrc from UID.pm for Pg6.3 -# Default tax to 0.0 if using Pg6.3 -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI -# undo default tax to 0.0 if using Pg6.3: comes from pre-expanded record -# for that state -# ivan@sisd.com 98-sep-2 -# -# $Log: cust_main_county-expand.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.7 2000/12/21 05:22:30 ivan -# perldoc -f split -# -# Revision 1.6 1999/01/25 12:19:07 ivan -# yet more mod_perl stuff -# -# Revision 1.5 1999/01/19 05:13:51 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 22:47:52 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.3 1998/12/17 08:40:20 ivan -# s/CGI::Request/CGI.pm/; etc -# -# Revision 1.2 1998/11/18 09:01:40 ivan -# i18n! i18n! -# +# use strict; use vars qw ( $cgi $taxnum $cust_main_county @expansion $expansion ); @@ -99,6 +62,6 @@ unless ( qsearch('cust_main',{ die $error if $error; } -print $cgi->redirect(popurl(3). "edit/cust_main_county.cgi"); +print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); %> -- cgit v1.2.1 From 8a8c9386cbd3383b0134aae8e32b5995f8886fb2 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 19 Aug 2001 15:53:36 +0000 Subject: added user interface for svc_forward and vpopmail support --- httemplate/edit/process/svc_forward.cgi | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 httemplate/edit/process/svc_forward.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/svc_forward.cgi b/httemplate/edit/process/svc_forward.cgi new file mode 100755 index 000000000..bce70a140 --- /dev/null +++ b/httemplate/edit/process/svc_forward.cgi @@ -0,0 +1,51 @@ +<% +# +# $Id: svc_forward.cgi,v 1.1 2001-08-19 15:53:35 jeff Exp $ +# +# Usage: post form to: +# http://server.name/path/svc_forward.cgi +# +# $Log: svc_forward.cgi,v $ +# Revision 1.1 2001-08-19 15:53:35 jeff +# added user interface for svc_forward and vpopmail support +# +# + +use strict; +use vars qw( $cgi $svcnum $old $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::Record qw(qsearchs fields); +use FS::svc_forward; +use FS::CGI qw(popurl); + +$cgi = new CGI; +cgisuidsetup($cgi); + +$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; +$svcnum =$1; + +$old = qsearchs('svc_forward',{'svcnum'=>$svcnum}) if $svcnum; + +$new = new FS::svc_forward ( { + map { + ($_, scalar($cgi->param($_))); + } ( fields('svc_forward'), qw( pkgnum svcpart ) ) +} ); + +if ( $svcnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $svcnum = $new->getfield('svcnum'); +} + +if ($error) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "svc_forward.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/svc_forward.cgi?$svcnum"); +} + +%> -- cgit v1.2.1 From 3d671921441ba8422650b54435a1959ad1d4c71d Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 21 Aug 2001 02:31:57 +0000 Subject: remove $Log$ messages. whew. --- httemplate/edit/process/agent.cgi | 34 +------------------- httemplate/edit/process/agent_type.cgi | 34 +------------------- httemplate/edit/process/cust_credit.cgi | 44 +------------------------- httemplate/edit/process/cust_main_county.cgi | 31 +----------------- httemplate/edit/process/cust_pay.cgi | 37 +--------------------- httemplate/edit/process/cust_pkg.cgi | 40 +---------------------- httemplate/edit/process/part_pkg.cgi | 47 +--------------------------- httemplate/edit/process/part_referral.cgi | 31 +----------------- httemplate/edit/process/svc_acct.cgi | 45 +------------------------- httemplate/edit/process/svc_acct_pop.cgi | 31 +----------------- httemplate/edit/process/svc_acct_sm.cgi | 43 +------------------------ httemplate/edit/process/svc_domain.cgi | 43 +------------------------ httemplate/edit/process/svc_forward.cgi | 12 +------ 13 files changed, 13 insertions(+), 459 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/agent.cgi b/httemplate/edit/process/agent.cgi index 2b4991363..b93df48d1 100755 --- a/httemplate/edit/process/agent.cgi +++ b/httemplate/edit/process/agent.cgi @@ -1,37 +1,5 @@ <% -# -# $Id: agent.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# ivan@sisd.com 97-dec-12 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 -# -# $Log: agent.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.7 1999/01/25 12:09:57 ivan -# yet more mod_perl stuff -# -# Revision 1.6 1999/01/19 05:13:47 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.5 1999/01/18 22:47:49 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.4 1998/12/30 23:03:26 ivan -# bugfixes; fields isn't exported by derived classes -# -# Revision 1.3 1998/12/17 08:40:16 ivan -# s/CGI::Request/CGI.pm/; etc -# -# Revision 1.2 1998/11/23 07:52:29 ivan -# *** empty log message *** -# +# use strict; use vars qw ( $cgi $agentnum $old $new $error ); diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi index 5c6b2b8e0..37a382e62 100755 --- a/httemplate/edit/process/agent_type.cgi +++ b/httemplate/edit/process/agent_type.cgi @@ -1,37 +1,5 @@ <% -# -# $Id: agent_type.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# ivan@sisd.com 97-dec-11 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 -# -# $Log: agent_type.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.7 1999/01/25 12:09:58 ivan -# yet more mod_perl stuff -# -# Revision 1.6 1999/01/19 05:13:48 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.5 1999/01/18 22:47:50 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.4 1998/12/30 23:03:27 ivan -# bugfixes; fields isn't exported by derived classes -# -# Revision 1.3 1998/12/17 08:40:17 ivan -# s/CGI::Request/CGI.pm/; etc -# -# Revision 1.2 1998/11/21 07:49:20 ivan -# s/CGI::Request/CGI.pm/ -# +# use strict; use vars qw ( $cgi $typenum $old $new $error $part_pkg ); diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 3cacab26e..b52d0bd46 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,47 +1,5 @@ <% -# -# $Id: cust_credit.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# Usage: post form to: -# http://server.name/path/cust_credit.cgi -# -# ivan@voicenet.com 96-dec-05 -> 96-dec-08 -# -# post a refund if $new_paybatch -# ivan@voicenet.com 96-dec-08 -# -# refunds are no longer applied against a specific payment (paybatch) -# paybatch field removed -# ivan@voicenet.com 97-apr-22 -# -# rewrite ivan@sisd.com 98-mar-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# $Log: cust_credit.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.7 1999/04/07 15:23:05 ivan -# don't use anchor in redirect -# -# Revision 1.6 1999/02/28 00:03:41 ivan -# removed misleading comments -# -# Revision 1.5 1999/01/25 12:09:59 ivan -# yet more mod_perl stuff -# -# Revision 1.4 1999/01/19 05:13:49 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.3 1999/01/18 22:47:51 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.2 1998/12/17 08:40:18 ivan -# s/CGI::Request/CGI.pm/; etc -# +# use strict; use vars qw( $cgi $custnum $new $error ); diff --git a/httemplate/edit/process/cust_main_county.cgi b/httemplate/edit/process/cust_main_county.cgi index 1ff2047f1..158a0d09e 100755 --- a/httemplate/edit/process/cust_main_county.cgi +++ b/httemplate/edit/process/cust_main_county.cgi @@ -1,34 +1,5 @@ <% -# -# $Id: cust_main_county.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 -# -# $Log: cust_main_county.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.6 1999/01/25 12:19:08 ivan -# yet more mod_perl stuff -# -# Revision 1.5 1999/01/19 05:13:52 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 22:47:53 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.3 1998/12/17 08:40:21 ivan -# s/CGI::Request/CGI.pm/; etc -# -# Revision 1.2 1998/11/18 09:01:41 ivan -# i18n! i18n! -# +# use strict; use vars qw( $cgi ); diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index f21ff490a..fcdc233b9 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -1,40 +1,5 @@ <% -# -# $Id: cust_pay.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# Usage: post form to: -# http://server.name/path/cust_pay.cgi -# -# ivan@voicenet.com 96-dec-11 -# -# rewrite ivan@sisd.com 98-mar-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# $Log: cust_pay.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.7 1999/02/28 00:03:43 ivan -# removed misleading comments -# -# Revision 1.6 1999/01/25 12:19:09 ivan -# yet more mod_perl stuff -# -# Revision 1.5 1999/01/19 05:13:53 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 22:47:54 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.3 1998/12/30 23:03:28 ivan -# bugfixes; fields isn't exported by derived classes -# -# Revision 1.2 1998/12/17 08:40:22 ivan -# s/CGI::Request/CGI.pm/; etc -# +# use strict; use vars qw( $cgi $invnum $new $error ); diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi index 0074466c8..ecaec9bcb 100755 --- a/httemplate/edit/process/cust_pkg.cgi +++ b/httemplate/edit/process/cust_pkg.cgi @@ -1,43 +1,5 @@ <% -# -# $Id: cust_pkg.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# this is for changing packages around, not for editing things within the -# package -# -# Usage: post form to: -# http://server.name/path/cust_pkg.cgi -# -# ivan@voicenet.com 97-mar-21 - 97-mar-24 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-7 - 15 -# -# &cgisuidsetup($cgi) ivan@sisd.com 98-mar-7 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# $Log: cust_pkg.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.7 1999/04/07 15:24:06 ivan -# don't use anchor in redirect -# -# Revision 1.6 1999/02/28 00:03:44 ivan -# removed misleading comments -# -# Revision 1.5 1999/02/07 09:59:26 ivan -# more mod_perl fixes, and bugfixes Peter Wemm sent via email -# -# Revision 1.3 1999/01/19 05:13:54 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.2 1998/12/17 08:40:23 ivan -# s/CGI::Request/CGI.pm/; etc -# +# use strict; use vars qw( $cgi $custnum @remove_pkgnums @pkgparts $pkgpart $error ); diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 3e1c07d1e..5850599c8 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,50 +1,5 @@ <% -# -# $Id: part_pkg.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# process/part_pkg.cgi: Edit package definitions (process form) -# -# ivan@sisd.com 97-dec-10 -# -# don't update non-changing records in part_svc (causing harmless but annoying -# "Records identical" errors). ivan@sisd.com 98-feb-19 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# Added `|| 0 ' when getting quantity off web page ivan@sisd.com 98-jun-4 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 -# -# $Log: part_pkg.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.9 2001/04/09 23:05:16 ivan -# Transactions Part I!!! -# -# Revision 1.8 1999/02/07 09:59:27 ivan -# more mod_perl fixes, and bugfixes Peter Wemm sent via email -# -# Revision 1.7 1999/01/19 05:13:55 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.6 1999/01/18 22:47:56 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.5 1998/12/30 23:03:29 ivan -# bugfixes; fields isn't exported by derived classes -# -# Revision 1.4 1998/12/17 08:40:24 ivan -# s/CGI::Request/CGI.pm/; etc -# -# Revision 1.3 1998/11/21 07:17:58 ivan -# bugfix to work for regular aswell as custom pricing -# -# Revision 1.2 1998/11/15 13:16:15 ivan -# first pass as per-user custom pricing -# +# use strict; use vars qw( $cgi $pkgpart $old $new $part_svc $error $dbh ); diff --git a/httemplate/edit/process/part_referral.cgi b/httemplate/edit/process/part_referral.cgi index c79ebb608..ff94e3955 100755 --- a/httemplate/edit/process/part_referral.cgi +++ b/httemplate/edit/process/part_referral.cgi @@ -1,34 +1,5 @@ <% -# -# $Id: part_referral.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 -# -# $Log: part_referral.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.6 1999/02/07 09:59:28 ivan -# more mod_perl fixes, and bugfixes Peter Wemm sent via email -# -# Revision 1.5 1999/01/19 05:13:56 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 22:47:57 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.3 1998/12/30 23:03:30 ivan -# bugfixes; fields isn't exported by derived classes -# -# Revision 1.2 1998/12/17 08:40:25 ivan -# s/CGI::Request/CGI.pm/; etc -# +# use strict; use vars qw( $cgi $refnum $new $error ); diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi index e895e5ddf..c500016e2 100755 --- a/httemplate/edit/process/svc_acct.cgi +++ b/httemplate/edit/process/svc_acct.cgi @@ -1,48 +1,5 @@ <% -# -# $Id: svc_acct.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# Usage: post form to: -# http://server.name/path/svc_acct.cgi -# -# ivan@voicenet.com 96-dec-18 -# -# Changed /u to /u2 -# ivan@voicenet.com 97-may-6 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-17 - 21 -# -# no FS::Search, FS::svc_acct creates FS::cust_svc record, used for adding -# and editing ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 -# -# $Log: svc_acct.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.7 1999/08/27 00:26:33 ivan -# better error messages -# -# Revision 1.6 1999/02/28 00:03:45 ivan -# removed misleading comments -# -# Revision 1.5 1999/02/07 09:59:30 ivan -# more mod_perl fixes, and bugfixes Peter Wemm sent via email -# -# Revision 1.4 1999/01/19 05:13:58 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.3 1999/01/18 22:47:59 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.2 1998/12/17 08:40:27 ivan -# s/CGI::Request/CGI.pm/; etc -# +# use strict; use vars qw( $cgi $svcnum $old $new $error ); diff --git a/httemplate/edit/process/svc_acct_pop.cgi b/httemplate/edit/process/svc_acct_pop.cgi index 95415f201..2b870dc48 100755 --- a/httemplate/edit/process/svc_acct_pop.cgi +++ b/httemplate/edit/process/svc_acct_pop.cgi @@ -1,34 +1,5 @@ <% -# -# $Id: svc_acct_pop.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 -# -# $Log: svc_acct_pop.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.6 1999/02/07 09:59:31 ivan -# more mod_perl fixes, and bugfixes Peter Wemm sent via email -# -# Revision 1.5 1999/01/19 05:13:59 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 22:48:00 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.3 1998/12/30 23:03:32 ivan -# bugfixes; fields isn't exported by derived classes -# -# Revision 1.2 1998/12/17 08:40:28 ivan -# s/CGI::Request/CGI.pm/; etc -# +# use strict; use vars qw( $cgi $popnum $old $new $error ); diff --git a/httemplate/edit/process/svc_acct_sm.cgi b/httemplate/edit/process/svc_acct_sm.cgi index a68478898..10afcc1f9 100755 --- a/httemplate/edit/process/svc_acct_sm.cgi +++ b/httemplate/edit/process/svc_acct_sm.cgi @@ -1,46 +1,5 @@ <% -# -# $Id: svc_acct_sm.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# Usage: post form to: -# http://server.name/path/svc_acct_sm.cgi -# -# lots of crufty stuff from svc_acct still in here, and modifications are (unelegantly) disabled. -# -# ivan@voicenet.com 97-jan-6 -# -# enabled modifications -# -# ivan@voicenet.com 97-may-7 -# -# fixed removal of cust_svc record on modifications! -# ivan@voicenet.com 97-jun-5 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# $Log: svc_acct_sm.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.6 1999/02/28 00:03:46 ivan -# removed misleading comments -# -# Revision 1.5 1999/02/07 09:59:32 ivan -# more mod_perl fixes, and bugfixes Peter Wemm sent via email -# -# Revision 1.4 1999/01/19 05:14:00 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.3 1999/01/18 22:48:01 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.2 1998/12/17 08:40:29 ivan -# s/CGI::Request/CGI.pm/; etc -# +# use strict; use vars qw( $cgi $svcnum $old $new $error ); diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi index 59a0c078f..e52b68a15 100755 --- a/httemplate/edit/process/svc_domain.cgi +++ b/httemplate/edit/process/svc_domain.cgi @@ -1,46 +1,5 @@ <% -# -# $Id: svc_domain.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# Usage: post form to: -# http://server.name/path/svc_domain.cgi -# -# lots of yucky stuff in this one... bleachlkjhui! -# -# ivan@voicenet.com 97-jan-6 -# -# kludged for new domain template 3.5 -# ivan@voicenet.com 97-jul-24 -# -# moved internic bits to svc_domain.pm ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# $Log: svc_domain.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.7 2001/04/23 07:12:44 ivan -# better error message (if kludgy) for no referral -# remove outdated NSI foo from domain ordering. also, fuck NSI. -# -# Revision 1.6 1999/02/28 00:03:47 ivan -# removed misleading comments -# -# Revision 1.5 1999/02/07 09:59:33 ivan -# more mod_perl fixes, and bugfixes Peter Wemm sent via email -# -# Revision 1.4 1999/01/19 05:14:01 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.3 1999/01/18 22:48:02 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.2 1998/12/17 08:40:30 ivan -# s/CGI::Request/CGI.pm/; etc -# +# use strict; use vars qw( $cgi $svcnum $new $error ); diff --git a/httemplate/edit/process/svc_forward.cgi b/httemplate/edit/process/svc_forward.cgi index bce70a140..b013bd15f 100755 --- a/httemplate/edit/process/svc_forward.cgi +++ b/httemplate/edit/process/svc_forward.cgi @@ -1,15 +1,5 @@ <% -# -# $Id: svc_forward.cgi,v 1.1 2001-08-19 15:53:35 jeff Exp $ -# -# Usage: post form to: -# http://server.name/path/svc_forward.cgi -# -# $Log: svc_forward.cgi,v $ -# Revision 1.1 2001-08-19 15:53:35 jeff -# added user interface for svc_forward and vpopmail support -# -# +# use strict; use vars qw( $cgi $svcnum $old $new $error ); -- cgit v1.2.1 From 237bea175ad19676bda76c3ac756a4c0b5bd899a Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 31 Aug 2001 07:17:33 +0000 Subject: fixes: > US UT expand state > Submit (no data entered) > US UT is gone frome the list. --- httemplate/edit/process/cust_main_county-expand.cgi | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi index a0231b076..5adffc62f 100755 --- a/httemplate/edit/process/cust_main_county-expand.cgi +++ b/httemplate/edit/process/cust_main_county-expand.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw ( $cgi $taxnum $cust_main_county @expansion $expansion ); @@ -53,11 +53,13 @@ foreach ( @expansion) { die $error if $error; } -unless ( qsearch('cust_main',{ - 'state' => $cust_main_county->getfield('state'), - 'county' => $cust_main_county->getfield('county'), - 'country' => $cust_main_county->getfield('country'), -} ) ) { +unless ( qsearch( 'cust_main', { + 'state' => $cust_main_county->state, + 'county' => $cust_main_county->county, + 'country' => $cust_main_county->country, + } ) + || ! @expansion +) { my($error)=($cust_main_county->delete); die $error if $error; } -- cgit v1.2.1 From 6412f71a3557249225abf5eb2096ebad1729c585 Mon Sep 17 00:00:00 2001 From: jeff Date: Sat, 1 Sep 2001 21:52:20 +0000 Subject: add cust_credit_bill relating multiple invoices to credits --- httemplate/edit/process/cust_credit_bill.cgi | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 httemplate/edit/process/cust_credit_bill.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_credit_bill.cgi b/httemplate/edit/process/cust_credit_bill.cgi new file mode 100755 index 000000000..f838dff10 --- /dev/null +++ b/httemplate/edit/process/cust_credit_bill.cgi @@ -0,0 +1,56 @@ +<% +# + +use strict; +use vars qw( $cgi $custnum $crednum $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup getotaker); +use FS::CGI qw(popurl); +use FS::Record qw(qsearchs fields); +use FS::cust_credit; +use FS::cust_credit_bill; + +$cgi = new CGI; +cgisuidsetup($cgi); + +$cgi->param('crednum') =~ /^(\d*)$/ or die "Illegal crednum!"; +$crednum = $1; + +my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ) + or die "No such crednum"; + +my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_credit->custnum } ) + or die "Bogus credit: not attached to customer"; + +my $custnum = $cust_main->custnum; + +if ($cgi->param('invnum') =~ /^Refund$/) { + $new = new FS::cust_refund ( { + 'reason' => $cust_credit->reason, + 'refund' => $cgi->param('amount'), + 'payby' => 'BILL', + '_date' => $cgi->param('_date'), + 'payinfo' => 'Cash', + 'crednum' => $crednum, + } ); +}else{ + $new = new FS::cust_credit_bill ( { + map { + $_, scalar($cgi->param($_)); + #} qw(custnum _date amount invnum) + } fields('cust_credit_bill') + } ); +} + +$error=$new->insert; + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "cust_credit_bill.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); +} + + +%> -- cgit v1.2.1 From fbcb45dfe5a1bce7981fe4527176b9fdf2ec54b7 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 3 Sep 2001 22:07:39 +0000 Subject: fix more bugs --- httemplate/edit/process/cust_pay.cgi | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index fcdc233b9..9be96505d 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -1,8 +1,8 @@ <% -# +# use strict; -use vars qw( $cgi $invnum $new $error ); +use vars qw( $cgi $link $linknum $new $error ); use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); @@ -13,24 +13,32 @@ use FS::cust_pay; $cgi = new CGI; &cgisuidsetup($cgi); -$cgi->param('invnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -$invnum = $1; +$cgi->param('linknum') =~ /^(\d+)$/ + or die "Illegal linknum: ". $cgi->param('linknum'); +$linknum = $1; + +$cgi->param('link') =~ /^(custnum|invnum)$/ + or die "Illegal link: ". $cgi->param('link'); +$link = $1; $new = new FS::cust_pay ( { + $link => $linknum, map { $_, scalar($cgi->param($_)); - #} qw(invnum paid _date payby payinfo paybatch) - } fields('cust_pay') + } qw(paid _date payby payinfo paybatch) + #} fields('cust_pay') } ); -$error=$new->insert; +$error = $new->insert; if ($error) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string ); exit; -} else { - print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$invnum"); +} elsif ( $link eq 'invnum' ) { + print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum"); +} elsif ( $link eq 'custnum' ) { + print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum"); } %> -- cgit v1.2.1 From 1e4aa8069f25e1b4101da20bb9e0d3f60357ea52 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 4 Sep 2001 14:44:07 +0000 Subject: new admin documentation, quick one-pkg order --- httemplate/edit/process/quick-cust_pkg.cgi | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 httemplate/edit/process/quick-cust_pkg.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi new file mode 100644 index 000000000..5ac315d87 --- /dev/null +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -0,0 +1,34 @@ +<% +# + +use strict; +use vars qw( $cgi $custnum $pkgpart $error ); #@remove_pkgnums @pkgparts +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::CGI qw(popurl); +use FS::cust_pkg; + +$cgi = new CGI; # create form object +&cgisuidsetup($cgi); +$error = ''; + +#untaint custnum +$cgi->param('custnum') =~ /^(\d+)$/ + or die 'illegal custnum '. $cgi->param('custnum'); +$custnum = $1; +$cgi->param('pkgpart') =~ /^(\d+)$/ + or die 'illegal pkgpart '. $cgi->param('pkgpart'); +$pkgpart = $1; + +my @cust_pkg = (); +$error ||= FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, ); + +if ($error) { + eidiot($error); +} else { + print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $cust_pkg[0]->pkgnum ); +} + +%> + -- 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') 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 57d69d5c1f98f778a0df82795ce21ee7bd21042a Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 6 Sep 2001 20:42:00 +0000 Subject: finally fix part_svc!!! --- httemplate/edit/process/part_svc.cgi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi index 093d86a75..5652c5805 100755 --- a/httemplate/edit/process/part_svc.cgi +++ b/httemplate/edit/process/part_svc.cgi @@ -8,7 +8,11 @@ my $new = new FS::part_svc ( { map { $_, scalar($cgi->param($_)); # } qw(svcpart svc svcdb) - } fields('part_svc') + } ( fields('part_svc'), + map { my $svcdb = $_; + map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) } + fields($svcdb) + } qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ) ) } ); my $error; -- cgit v1.2.1 From f5266a4d07d116efd732f433d0f4f3a47b143a7d Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 Sep 2001 00:08:18 +0000 Subject: faster (cached) fuzzy searches prelim. job queues! fixed part_svc editing --- httemplate/edit/process/part_svc.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi index 5652c5805..937f7fb4c 100755 --- a/httemplate/edit/process/part_svc.cgi +++ b/httemplate/edit/process/part_svc.cgi @@ -17,7 +17,7 @@ my $new = new FS::part_svc ( { my $error; if ( $svcpart ) { - $error = $new->replace($old); + $error = $new->replace($old, '1.3-COMPAT'); } else { $error = $new->insert; $svcpart=$new->getfield('svcpart'); -- cgit v1.2.1 From 89301379ac6f1e2ebab203e458849001d3f8fb49 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 Sep 2001 09:56:27 +0000 Subject: fix quick order --- httemplate/edit/process/quick-cust_pkg.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 5ac315d87..ff0c5b229 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -1,12 +1,12 @@ <% -# +# use strict; use vars qw( $cgi $custnum $pkgpart $error ); #@remove_pkgnums @pkgparts use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl); +use FS::CGI qw(popurl eidiot); use FS::cust_pkg; $cgi = new CGI; # create form object -- cgit v1.2.1 From 34678d474a3710a38e42fd681607fe98edb56658 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 Sep 2001 10:05:30 +0000 Subject: s/die/ediot/ --- httemplate/edit/process/quick-cust_pkg.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index ff0c5b229..c4f5172ad 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $custnum $pkgpart $error ); #@remove_pkgnums @pkgparts @@ -15,10 +15,10 @@ $error = ''; #untaint custnum $cgi->param('custnum') =~ /^(\d+)$/ - or die 'illegal custnum '. $cgi->param('custnum'); + or eidiot 'illegal custnum '. $cgi->param('custnum'); $custnum = $1; $cgi->param('pkgpart') =~ /^(\d+)$/ - or die 'illegal pkgpart '. $cgi->param('pkgpart'); + or eidiot 'illegal pkgpart '. $cgi->param('pkgpart'); $pkgpart = $1; my @cust_pkg = (); -- cgit v1.2.1 From 17765dcdb928bbe90f7f4166950b5e61c678af36 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 Sep 2001 12:46:17 +0000 Subject: more service edit fix --- httemplate/edit/process/part_svc.cgi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi index 937f7fb4c..97477d645 100755 --- a/httemplate/edit/process/part_svc.cgi +++ b/httemplate/edit/process/part_svc.cgi @@ -12,7 +12,9 @@ my $new = new FS::part_svc ( { map { my $svcdb = $_; map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) } fields($svcdb) - } qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ) ) + } grep defined( $FS::Record::dbdef->table($_) ), + qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ) + ) } ); my $error; -- cgit v1.2.1 From ebd1e74bc715300de23cbd64ac076beee2209f0b Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 9 Oct 2001 07:16:57 +0000 Subject: that was a confusing bug to fix --- httemplate/edit/process/part_svc.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi index 97477d645..423db93b5 100755 --- a/httemplate/edit/process/part_svc.cgi +++ b/httemplate/edit/process/part_svc.cgi @@ -27,7 +27,7 @@ if ( $svcpart ) { if ( $error ) { $cgi->param('error', $error); - print $cgi->redirect(popurl(2), "part_svc.cgi?". $cgi->query_string ); + print $cgi->redirect(popurl(2). "part_svc.cgi?". $cgi->query_string ); } else { print $cgi->redirect(popurl(3)."browse/part_svc.cgi"); } -- cgit v1.2.1 From a6d3e4dc73803cffad96fd4b6270b2fb5f4b0568 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 15 Oct 2001 10:42:29 +0000 Subject: price plans web gui 1st pass, oh my --- httemplate/edit/process/part_pkg.cgi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 5850599c8..6cfaa122e 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $pkgpart $old $new $part_svc $error $dbh ); @@ -19,6 +19,13 @@ $pkgpart = $cgi->param('pkgpart'); $old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; +#fixup plandata +my $plandata = $cgi->param('plandata'); +my @plandata = split(',', $plandata); +$cgi->param('plandata', + join('', map { "$_=". $cgi->param($_). "\n" } @plandata ) +); + $new = new FS::part_pkg ( { map { $_, scalar($cgi->param($_)); -- cgit v1.2.1 From 9410e9f656b950a9d4b383a3992fa50bb7a270db Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 15 Oct 2001 14:58:03 +0000 Subject: date editing --- httemplate/edit/process/REAL_cust_pkg.cgi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 httemplate/edit/process/REAL_cust_pkg.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi new file mode 100755 index 000000000..4f33f6b38 --- /dev/null +++ b/httemplate/edit/process/REAL_cust_pkg.cgi @@ -0,0 +1,20 @@ +<% +# + +my $pkgnum = $cgi->param('pkgnum') or die; +my $old = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); +my %hash = $old->hash; +$hash{'setup'} = $cgi->param('setup') ? str2time($cgi->param('setup')) : ''; +$hash{'bill'} = $cgi->param('bill') ? str2time($cgi->param('bill')) : ''; +my $new = new FS::cust_pkg \%hash; + +my $error = $new->replace($old); + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "REAL_cust_pkg.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $pkgnum); +} + +%> -- 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 ++-- httemplate/edit/process/part_pkg.cgi | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/process') 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] ); diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 6cfaa122e..cd799b5b9 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $pkgpart $old $new $part_svc $error $dbh ); @@ -26,12 +26,18 @@ $cgi->param('plandata', join('', map { "$_=". $cgi->param($_). "\n" } @plandata ) ); +$cgi->param('setuptax','') unless defined $cgi->param('setuptax'); +$cgi->param('recurtax','') unless defined $cgi->param('recurtax'); + $new = new FS::part_pkg ( { map { $_, scalar($cgi->param($_)); } fields('part_pkg') } ); +warn "setuptax: ". $new->setuptax; +warn "recurtax: ". $new->recurtax; + #most of the stuff below should move to part_pkg.pm foreach $part_svc ( qsearch('part_svc', {} ) ) { -- cgit v1.2.1 From 9a0b074f2b3fb4d819a6e10435ca1484929a81e2 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 6 Nov 2001 18:45:46 +0000 Subject: remove gratuitous warnings --- httemplate/edit/process/part_pkg.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index cd799b5b9..c64d49219 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $pkgpart $old $new $part_svc $error $dbh ); @@ -35,8 +35,8 @@ $new = new FS::part_pkg ( { } fields('part_pkg') } ); -warn "setuptax: ". $new->setuptax; -warn "recurtax: ". $new->recurtax; +#warn "setuptax: ". $new->setuptax; +#warn "recurtax: ". $new->recurtax; #most of the stuff below should move to part_pkg.pm -- cgit v1.2.1 From 91135a208282b03644cc766ed917b64fe24f374c Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 18 Dec 2001 19:30:31 +0000 Subject: apply payment webinterface --- httemplate/edit/process/cust_bill_pay.cgi | 46 ++++++++++++++++++++++++++++ httemplate/edit/process/cust_credit_bill.cgi | 6 ++-- 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100755 httemplate/edit/process/cust_bill_pay.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_bill_pay.cgi b/httemplate/edit/process/cust_bill_pay.cgi new file mode 100755 index 000000000..f0d403331 --- /dev/null +++ b/httemplate/edit/process/cust_bill_pay.cgi @@ -0,0 +1,46 @@ +<% +# + +use strict; +use vars qw( $cgi $custnum $paynum $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup getotaker); +use FS::CGI qw(popurl); +use FS::Record qw(qsearchs fields); +use FS::cust_pay; +use FS::cust_bill_pay; +use FS::cust_main; + +$cgi = new CGI; +cgisuidsetup($cgi); + +$cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!"; +$paynum = $1; + +my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ) + or die "No such paynum"; + +my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pay->custnum } ) + or die "Bogus credit: not attached to customer"; + +my $custnum = $cust_main->custnum; + +$new = new FS::cust_bill_pay ( { + map { + $_, scalar($cgi->param($_)); + #} qw(custnum _date amount invnum) + } fields('cust_bill_pay') +} ); + +$error=$new->insert; + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); +} + + +%> diff --git a/httemplate/edit/process/cust_credit_bill.cgi b/httemplate/edit/process/cust_credit_bill.cgi index f838dff10..e84894b04 100755 --- a/httemplate/edit/process/cust_credit_bill.cgi +++ b/httemplate/edit/process/cust_credit_bill.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $custnum $crednum $new $error ); @@ -10,6 +10,8 @@ use FS::CGI qw(popurl); use FS::Record qw(qsearchs fields); use FS::cust_credit; use FS::cust_credit_bill; +use FS::cust_refund; +use FS::cust_main; $cgi = new CGI; cgisuidsetup($cgi); @@ -34,7 +36,7 @@ if ($cgi->param('invnum') =~ /^Refund$/) { 'payinfo' => 'Cash', 'crednum' => $crednum, } ); -}else{ +} else { $new = new FS::cust_credit_bill ( { map { $_, scalar($cgi->param($_)); -- cgit v1.2.1 From d0f483f47168e01eb6c28e8fc99a62050b245132 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 26 Dec 2001 04:25:04 +0000 Subject: auto-apply payments and credits, post credit UI overhaul --- httemplate/edit/process/cust_credit.cgi | 7 ++++++- httemplate/edit/process/cust_pay.cgi | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index b52d0bd46..2eb431bcc 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $custnum $new $error ); @@ -31,6 +31,11 @@ if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "cust_credit.cgi?". $cgi->query_string ); } else { + if ( $cgi->param('apply') eq 'yes' ) { + my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum }) + or die "unknown custnum $linknum"; + $cust_main->apply_payments; + } print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); } diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index 9be96505d..b2b3602db 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $link $linknum $new $error ); @@ -38,6 +38,11 @@ if ($error) { } elsif ( $link eq 'invnum' ) { print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum"); } elsif ( $link 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; + } print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum"); } -- cgit v1.2.1 From f91771606ce8a2bb4f2fa44e7bf54c9b7c945db6 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 26 Dec 2001 05:19:01 +0000 Subject: expedited check entry --- httemplate/edit/process/cust_pay.cgi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index b2b3602db..630e8fc1b 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $link $linknum $new $error ); @@ -43,7 +43,11 @@ if ($error) { or die "unknown custnum $linknum"; $cust_main->apply_payments; } - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum"); + if ( $cgi->param('quickpay') eq 'yes' ) { + print $cgi->redirect(popurl(3). "search/cust_main-quickpay.html"); + } else { + print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum"); + } } %> -- cgit v1.2.1 From 371e7a9c14b0feb83a802f624a8dceda5fecbcbf Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 26 Dec 2001 15:07:06 +0000 Subject: fix posting credit --- httemplate/edit/process/cust_credit.cgi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 2eb431bcc..415000f88 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $custnum $new $error ); @@ -9,6 +9,7 @@ use FS::UID qw(cgisuidsetup getotaker); use FS::CGI qw(popurl); use FS::Record qw(fields); use FS::cust_credit; +use FS::cust_main; $cgi = new CGI; cgisuidsetup($cgi); @@ -33,7 +34,7 @@ if ( $error ) { } else { if ( $cgi->param('apply') eq 'yes' ) { my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum }) - or die "unknown custnum $linknum"; + or die "unknown custnum $custnum"; $cust_main->apply_payments; } print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -- cgit v1.2.1 From 85e18d1c25a16b3d37ff87484b36a9e17d17cbcf Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 26 Dec 2001 15:11:33 +0000 Subject: apply credits!! --- httemplate/edit/process/cust_credit.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 415000f88..3bbd749ce 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $custnum $new $error ); @@ -35,7 +35,7 @@ if ( $error ) { if ( $cgi->param('apply') eq 'yes' ) { my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum }) or die "unknown custnum $custnum"; - $cust_main->apply_payments; + $cust_main->apply_credits; } print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); } -- cgit v1.2.1 From cf16b23820da69e3c8d0156ae27e21c635bf1ec5 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 27 Dec 2001 09:26:14 +0000 Subject: service and package disable! --- httemplate/edit/process/part_pkg.cgi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index c64d49219..08bc9b723 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $pkgpart $old $new $part_svc $error $dbh ); @@ -26,8 +26,9 @@ $cgi->param('plandata', join('', map { "$_=". $cgi->param($_). "\n" } @plandata ) ); -$cgi->param('setuptax','') unless defined $cgi->param('setuptax'); -$cgi->param('recurtax','') unless defined $cgi->param('recurtax'); +foreach (qw( setuptax recurtax disabled )) { + $cgi->param($_, '') unless defined $cgi->param($_); +} $new = new FS::part_pkg ( { map { -- cgit v1.2.1 From 6991d4986df7fb3a6c7c49b5ae1b3713e87a16c4 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 29 Jan 2002 16:33:16 +0000 Subject: - web interface for hourly account charges! (FS::cust_pkg, FS::cust_svc and FS::svc_acct seconds_since methods) - Makefile target to regenerate HTML manpages on install - FS.pm doc update - $FS::Record::Debug now dumps all SQL - new FS::cust_main methods: ->cancel, ->invoicing_list_addpost - start of a billing event web interface - cust_pay::upgrade_replace doesn't error out if history includes overapplied payments --- httemplate/edit/process/part_bill_event.cgi | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 httemplate/edit/process/part_bill_event.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_bill_event.cgi b/httemplate/edit/process/part_bill_event.cgi new file mode 100755 index 000000000..eb7c53e5d --- /dev/null +++ b/httemplate/edit/process/part_bill_event.cgi @@ -0,0 +1,32 @@ +<% + +my $eventpart = $cgi->param('eventpart'); + +my $old = qsearchs('part_bill_event',{'eventpart'=>$eventpart}) if $eventpart; + +#s/days/seconds/ +$cgi->param('seconds', $cgi->param('days') * 3600 ); + +my $new = new FS::part_bill_event ( { + map { + $_, scalar($cgi->param($_)); + } fields('part_bill_event'), +} ); + +my $error; +if ( $eventpart ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $eventpart = $new->getfield('eventpart'); +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "part_bill_event.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3)."browse/part_bill_event.cgi"); +} + +%> + -- 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/agent.cgi | 22 ++++----------- httemplate/edit/process/agent_type.cgi | 25 ++++------------ httemplate/edit/process/cust_bill_pay.cgi | 22 +++------------ httemplate/edit/process/cust_credit.cgi | 21 +++----------- httemplate/edit/process/cust_credit_bill.cgi | 22 +++------------ httemplate/edit/process/cust_main.cgi | 33 ++++++---------------- .../edit/process/cust_main_county-collapse.cgi | 19 ++----------- .../edit/process/cust_main_county-expand.cgi | 20 +++---------- httemplate/edit/process/cust_main_county.cgi | 14 +-------- httemplate/edit/process/cust_pay.cgi | 22 ++++----------- httemplate/edit/process/cust_pkg.cgi | 21 ++++---------- httemplate/edit/process/part_pkg.cgi | 25 +++++----------- httemplate/edit/process/part_referral.cgi | 19 +++---------- httemplate/edit/process/quick-cust_pkg.cgi | 20 +++---------- httemplate/edit/process/svc_acct.cgi | 20 ++++--------- httemplate/edit/process/svc_acct_pop.cgi | 22 ++++----------- httemplate/edit/process/svc_acct_sm.cgi | 21 ++++---------- httemplate/edit/process/svc_domain.cgi | 19 +++---------- httemplate/edit/process/svc_forward.cgi | 21 ++++---------- 19 files changed, 90 insertions(+), 318 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/agent.cgi b/httemplate/edit/process/agent.cgi index b93df48d1..93ce4f9f2 100755 --- a/httemplate/edit/process/agent.cgi +++ b/httemplate/edit/process/agent.cgi @@ -1,29 +1,17 @@ + <% -# -use strict; -use vars qw ( $cgi $agentnum $old $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs fields); -use FS::agent; -use FS::CGI qw(popurl); +my $agentnum = $cgi->param('agentnum'); -$cgi = new CGI; +my $old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; -&cgisuidsetup($cgi); - -$agentnum = $cgi->param('agentnum'); - -$old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; - -$new = new FS::agent ( { +my $new = new FS::agent ( { map { $_, scalar($cgi->param($_)); } fields('agent') } ); +my $error; if ( $agentnum ) { $error=$new->replace($old); } else { diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi index 37a382e62..2d1159708 100755 --- a/httemplate/edit/process/agent_type.cgi +++ b/httemplate/edit/process/agent_type.cgi @@ -1,29 +1,16 @@ + <% -# -use strict; -use vars qw ( $cgi $typenum $old $new $error $part_pkg ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::CGI qw( popurl); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs fields); -use FS::agent_type; -use FS::type_pkgs; -use FS::part_pkg; +my $typenum = $cgi->param('typenum'); +my $old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; -$cgi = new CGI; -&cgisuidsetup($cgi); - -$typenum = $cgi->param('typenum'); -$old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; - -$new = new FS::agent_type ( { +my $new = new FS::agent_type ( { map { $_, scalar($cgi->param($_)); } fields('agent_type') } ); +my $error; if ( $typenum ) { $error=$new->replace($old); } else { @@ -37,7 +24,7 @@ if ( $error ) { exit; } -foreach $part_pkg (qsearch('part_pkg',{})) { +foreach my $part_pkg (qsearch('part_pkg',{})) { my($pkgpart)=$part_pkg->getfield('pkgpart'); my($type_pkgs)=qsearchs('type_pkgs',{ diff --git a/httemplate/edit/process/cust_bill_pay.cgi b/httemplate/edit/process/cust_bill_pay.cgi index f0d403331..16d30bd4c 100755 --- a/httemplate/edit/process/cust_bill_pay.cgi +++ b/httemplate/edit/process/cust_bill_pay.cgi @@ -1,22 +1,8 @@ + <% -# - -use strict; -use vars qw( $cgi $custnum $paynum $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::CGI qw(popurl); -use FS::Record qw(qsearchs fields); -use FS::cust_pay; -use FS::cust_bill_pay; -use FS::cust_main; - -$cgi = new CGI; -cgisuidsetup($cgi); $cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!"; -$paynum = $1; +my $paynum = $1; my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ) or die "No such paynum"; @@ -26,14 +12,14 @@ my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pay->custnum } ) my $custnum = $cust_main->custnum; -$new = new FS::cust_bill_pay ( { +my $new = new FS::cust_bill_pay ( { map { $_, scalar($cgi->param($_)); #} qw(custnum _date amount invnum) } fields('cust_bill_pay') } ); -$error=$new->insert; +my $error = $new->insert; if ( $error ) { $cgi->param('error', $error); diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 3bbd749ce..51fca74e3 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,32 +1,19 @@ + <% -# - -use strict; -use vars qw( $cgi $custnum $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::CGI qw(popurl); -use FS::Record qw(fields); -use FS::cust_credit; -use FS::cust_main; - -$cgi = new CGI; -cgisuidsetup($cgi); $cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; -$custnum = $1; +my $custnum = $1; $cgi->param('otaker',getotaker); -$new = new FS::cust_credit ( { +my $new = new FS::cust_credit ( { map { $_, scalar($cgi->param($_)); #} qw(custnum _date amount otaker reason) } fields('cust_credit') } ); -$error=$new->insert; +my $error = $new->insert; if ( $error ) { $cgi->param('error', $error); diff --git a/httemplate/edit/process/cust_credit_bill.cgi b/httemplate/edit/process/cust_credit_bill.cgi index e84894b04..afe297308 100755 --- a/httemplate/edit/process/cust_credit_bill.cgi +++ b/httemplate/edit/process/cust_credit_bill.cgi @@ -1,23 +1,8 @@ + <% -# - -use strict; -use vars qw( $cgi $custnum $crednum $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::CGI qw(popurl); -use FS::Record qw(qsearchs fields); -use FS::cust_credit; -use FS::cust_credit_bill; -use FS::cust_refund; -use FS::cust_main; - -$cgi = new CGI; -cgisuidsetup($cgi); $cgi->param('crednum') =~ /^(\d*)$/ or die "Illegal crednum!"; -$crednum = $1; +my $crednum = $1; my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ) or die "No such crednum"; @@ -27,6 +12,7 @@ my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_credit->custnum } ) my $custnum = $cust_main->custnum; +my $new; if ($cgi->param('invnum') =~ /^Refund$/) { $new = new FS::cust_refund ( { 'reason' => $cust_credit->reason, @@ -45,7 +31,7 @@ if ($cgi->param('invnum') =~ /^Refund$/) { } ); } -$error=$new->insert; +my $error = $new->insert; if ( $error ) { $cgi->param('error', $error); 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); } %> diff --git a/httemplate/edit/process/cust_main_county-collapse.cgi b/httemplate/edit/process/cust_main_county-collapse.cgi index 62c2ba753..4888b781f 100755 --- a/httemplate/edit/process/cust_main_county-collapse.cgi +++ b/httemplate/edit/process/cust_main_county-collapse.cgi @@ -1,23 +1,10 @@ + <% -# - -use strict; -use vars qw ( $cgi $taxnum $cust_main_county @expansion $expansion ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup datasrc); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(popurl); -use FS::cust_main_county; -use FS::cust_main; - -$cgi = new CGI; -&cgisuidsetup($cgi); my($query) = $cgi->keywords; $query =~ /^(\d+)$/ or die "Illegal taxnum!"; -$taxnum = $1; -$cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) +my $taxnum = $1; +my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) or die ("Unknown taxnum!"); #really should do this in a .pm & start transaction diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi index 5adffc62f..b16fab4fe 100755 --- a/httemplate/edit/process/cust_main_county-expand.cgi +++ b/httemplate/edit/process/cust_main_county-expand.cgi @@ -1,24 +1,12 @@ + <% -# - -use strict; -use vars qw ( $cgi $taxnum $cust_main_county @expansion $expansion ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup datasrc); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(popurl); -use FS::cust_main_county; -use FS::cust_main; - -$cgi = new CGI; -&cgisuidsetup($cgi); $cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; -$taxnum = $1; -$cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) +my $taxnum = $1; +my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) or die ("Unknown taxnum!"); +my @expansion; if ( $cgi->param('delim') eq 'n' ) { @expansion=split(/\n/,$cgi->param('expansion')); } elsif ( $cgi->param('delim') eq 's' ) { diff --git a/httemplate/edit/process/cust_main_county.cgi b/httemplate/edit/process/cust_main_county.cgi index 158a0d09e..0f0246b73 100755 --- a/httemplate/edit/process/cust_main_county.cgi +++ b/httemplate/edit/process/cust_main_county.cgi @@ -1,17 +1,5 @@ + <% -# - -use strict; -use vars qw( $cgi ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl); -use FS::Record qw(qsearch qsearchs); -use FS::cust_main_county; - -$cgi = new CGI; -&cgisuidsetup($cgi); foreach ( $cgi->param ) { /^tax(\d+)$/ or die "Illegal form $_!"; diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index 630e8fc1b..c75e53280 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -1,27 +1,15 @@ + <% -# - -use strict; -use vars qw( $cgi $link $linknum $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl); -use FS::Record qw(fields); -use FS::cust_pay; - -$cgi = new CGI; -&cgisuidsetup($cgi); $cgi->param('linknum') =~ /^(\d+)$/ or die "Illegal linknum: ". $cgi->param('linknum'); -$linknum = $1; +my $linknum = $1; $cgi->param('link') =~ /^(custnum|invnum)$/ or die "Illegal link: ". $cgi->param('link'); -$link = $1; +my $link = $1; -$new = new FS::cust_pay ( { +my $new = new FS::cust_pay ( { $link => $linknum, map { $_, scalar($cgi->param($_)); @@ -29,7 +17,7 @@ $new = new FS::cust_pay ( { #} fields('cust_pay') } ); -$error = $new->insert; +my $error = $new->insert; if ($error) { $cgi->param('error', $error); diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi index ecaec9bcb..25b320150 100755 --- a/httemplate/edit/process/cust_pkg.cgi +++ b/httemplate/edit/process/cust_pkg.cgi @@ -1,28 +1,19 @@ + <% -# -use strict; -use vars qw( $cgi $custnum @remove_pkgnums @pkgparts $pkgpart $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl); -use FS::cust_pkg; - -$cgi = new CGI; # create form object -&cgisuidsetup($cgi); -$error = ''; +my $error = ''; #untaint custnum $cgi->param('custnum') =~ /^(\d+)$/; -$custnum = $1; +my $custnum = $1; -@remove_pkgnums = map { +my @remove_pkgnums = map { /^(\d+)$/ or die "Illegal remove_pkg value!"; $1; } $cgi->param('remove_pkg'); -foreach $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { +my @pkgparts; +foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { my $num_pkgs = $1; while ( $num_pkgs-- ) { diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 08bc9b723..2ba1cbeb0 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,23 +1,11 @@ + <% -# -use strict; -use vars qw( $cgi $pkgpart $old $new $part_svc $error $dbh ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl); -use FS::Record qw(qsearch qsearchs fields); -use FS::part_pkg; -use FS::pkg_svc; -use FS::cust_pkg; +my $dbh = dbh; -$cgi = new CGI; -$dbh = &cgisuidsetup($cgi); +my $pkgpart = $cgi->param('pkgpart'); -$pkgpart = $cgi->param('pkgpart'); - -$old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; +my $old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; #fixup plandata my $plandata = $cgi->param('plandata'); @@ -30,7 +18,7 @@ foreach (qw( setuptax recurtax disabled )) { $cgi->param($_, '') unless defined $cgi->param($_); } -$new = new FS::part_pkg ( { +my $new = new FS::part_pkg ( { map { $_, scalar($cgi->param($_)); } fields('part_pkg') @@ -41,7 +29,7 @@ $new = new FS::part_pkg ( { #most of the stuff below should move to part_pkg.pm -foreach $part_svc ( qsearch('part_svc', {} ) ) { +foreach my $part_svc ( qsearch('part_svc', {} ) ) { my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0; unless ( $quantity =~ /^(\d+)$/ ) { $cgi->param('error', "Illegal quantity" ); @@ -59,6 +47,7 @@ local $SIG{PIPE} = 'IGNORE'; local $FS::UID::AutoCommit = 0; +my $error; if ( $pkgpart ) { $error = $new->replace($old); } else { diff --git a/httemplate/edit/process/part_referral.cgi b/httemplate/edit/process/part_referral.cgi index ff94e3955..7e37db855 100755 --- a/httemplate/edit/process/part_referral.cgi +++ b/httemplate/edit/process/part_referral.cgi @@ -1,26 +1,15 @@ + <% -# -use strict; -use vars qw( $cgi $refnum $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs fields); -use FS::part_referral; -use FS::CGI qw(popurl); +my $refnum = $cgi->param('refnum'); -$cgi = new CGI; -&cgisuidsetup($cgi); - -$refnum = $cgi->param('refnum'); - -$new = new FS::part_referral ( { +my $new = new FS::part_referral ( { map { $_, scalar($cgi->param($_)); } fields('part_referral') } ); +my $error; if ( $refnum ) { my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } ); die "(Old) Record not found!" unless $old; diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index c4f5172ad..29a954cc9 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -1,28 +1,16 @@ + <% -# - -use strict; -use vars qw( $cgi $custnum $pkgpart $error ); #@remove_pkgnums @pkgparts -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl eidiot); -use FS::cust_pkg; - -$cgi = new CGI; # create form object -&cgisuidsetup($cgi); -$error = ''; #untaint custnum $cgi->param('custnum') =~ /^(\d+)$/ or eidiot 'illegal custnum '. $cgi->param('custnum'); -$custnum = $1; +my $custnum = $1; $cgi->param('pkgpart') =~ /^(\d+)$/ or eidiot 'illegal pkgpart '. $cgi->param('pkgpart'); -$pkgpart = $1; +my $pkgpart = $1; my @cust_pkg = (); -$error ||= FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, ); +my $error = FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, ); if ($error) { eidiot($error); diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi index c500016e2..178d7d85a 100755 --- a/httemplate/edit/process/svc_acct.cgi +++ b/httemplate/edit/process/svc_acct.cgi @@ -1,21 +1,10 @@ + <% -# - -use strict; -use vars qw( $cgi $svcnum $old $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl); -use FS::Record qw(qsearchs fields); -use FS::svc_acct; - -$cgi = new CGI; -&cgisuidsetup($cgi); $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -$svcnum = $1; +my $svcnum = $1; +my $old; if ( $svcnum ) { $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } ) or die "fatal: can't find account (svcnum $svcnum)!"; @@ -32,7 +21,7 @@ if ( $cgi->param('_password') eq '*HIDDEN*' ) { $cgi->param('_password',$old->getfield('_password')); } -$new = new FS::svc_acct ( { +my $new = new FS::svc_acct ( { map { $_, scalar($cgi->param($_)); #} qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir @@ -40,6 +29,7 @@ $new = new FS::svc_acct ( { } ( fields('svc_acct'), qw( pkgnum svcpart ) ) } ); +my $error; if ( $svcnum ) { $error = $new->replace($old); } else { diff --git a/httemplate/edit/process/svc_acct_pop.cgi b/httemplate/edit/process/svc_acct_pop.cgi index 2b870dc48..5d699f2f5 100755 --- a/httemplate/edit/process/svc_acct_pop.cgi +++ b/httemplate/edit/process/svc_acct_pop.cgi @@ -1,29 +1,17 @@ + <% -# -use strict; -use vars qw( $cgi $popnum $old $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs fields); -use FS::svc_acct_pop; -use FS::CGI qw(popurl); +my $popnum = $cgi->param('popnum'); -$cgi = new CGI; # create form object +my $old = qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum; -&cgisuidsetup($cgi); - -$popnum = $cgi->param('popnum'); - -$old = qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum; - -$new = new FS::svc_acct_pop ( { +my $new = new FS::svc_acct_pop ( { map { $_, scalar($cgi->param($_)); } fields('svc_acct_pop') } ); +my $error = ''; if ( $popnum ) { $error = $new->replace($old); } else { diff --git a/httemplate/edit/process/svc_acct_sm.cgi b/httemplate/edit/process/svc_acct_sm.cgi index 10afcc1f9..25cd88d5a 100755 --- a/httemplate/edit/process/svc_acct_sm.cgi +++ b/httemplate/edit/process/svc_acct_sm.cgi @@ -1,34 +1,23 @@ + <% -# - -use strict; -use vars qw( $cgi $svcnum $old $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs fields); -use FS::svc_acct_sm; -use FS::CGI qw(popurl); - -$cgi = new CGI; -cgisuidsetup($cgi); $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -$svcnum =$1; +my $svcnum =$1; -$old = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum; +my $old = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum; #unmunge domsvc and domuid #$cgi->param('domsvc',(split(/:/, $cgi->param('domsvc') ))[0] ); #$cgi->param('domuid',(split(/:/, $cgi->param('domuid') ))[0] ); -$new = new FS::svc_acct_sm ( { +my $new = new FS::svc_acct_sm ( { map { ($_, scalar($cgi->param($_))); #} qw(svcnum pkgnum svcpart domuser domuid domsvc) } ( fields('svc_acct_sm'), qw( pkgnum svcpart ) ) } ); +my $error = ''; if ( $svcnum ) { $error = $new->replace($old); } else { diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi index e52b68a15..0b7ec4928 100755 --- a/httemplate/edit/process/svc_domain.cgi +++ b/httemplate/edit/process/svc_domain.cgi @@ -1,31 +1,20 @@ + <% -# - -use strict; -use vars qw( $cgi $svcnum $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs fields); -use FS::svc_domain; -use FS::CGI qw(popurl); #remove this to actually test the domains! $FS::svc_domain::whois_hack = 1; -$cgi = new CGI; -&cgisuidsetup($cgi); - $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -$svcnum = $1; +my $svcnum = $1; -$new = new FS::svc_domain ( { +my $new = new FS::svc_domain ( { map { $_, scalar($cgi->param($_)); #} qw(svcnum pkgnum svcpart domain action purpose) } ( fields('svc_domain'), qw( pkgnum svcpart action purpose ) ) } ); +my $error = ''; if ($cgi->param('svcnum')) { $error="Can't modify a domain!"; } else { diff --git a/httemplate/edit/process/svc_forward.cgi b/httemplate/edit/process/svc_forward.cgi index b013bd15f..5f0247fe5 100755 --- a/httemplate/edit/process/svc_forward.cgi +++ b/httemplate/edit/process/svc_forward.cgi @@ -1,29 +1,18 @@ + <% -# - -use strict; -use vars qw( $cgi $svcnum $old $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs fields); -use FS::svc_forward; -use FS::CGI qw(popurl); - -$cgi = new CGI; -cgisuidsetup($cgi); $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -$svcnum =$1; +my $svcnum =$1; -$old = qsearchs('svc_forward',{'svcnum'=>$svcnum}) if $svcnum; +my $old = qsearchs('svc_forward',{'svcnum'=>$svcnum}) if $svcnum; -$new = new FS::svc_forward ( { +my $new = new FS::svc_forward ( { map { ($_, scalar($cgi->param($_))); } ( fields('svc_forward'), qw( pkgnum svcpart ) ) } ); +my $error = ''; if ( $svcnum ) { $error = $new->replace($old); } else { -- cgit v1.2.1 From c7ff9a58360788ce776022606c4ec3496062013b Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 30 Jan 2002 18:22:54 +0000 Subject: fully working invoice event web interface --- httemplate/edit/process/part_bill_event.cgi | 46 +++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 12 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_bill_event.cgi b/httemplate/edit/process/part_bill_event.cgi index eb7c53e5d..7c0b54d0d 100755 --- a/httemplate/edit/process/part_bill_event.cgi +++ b/httemplate/edit/process/part_bill_event.cgi @@ -5,21 +5,43 @@ my $eventpart = $cgi->param('eventpart'); my $old = qsearchs('part_bill_event',{'eventpart'=>$eventpart}) if $eventpart; #s/days/seconds/ -$cgi->param('seconds', $cgi->param('days') * 3600 ); - -my $new = new FS::part_bill_event ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_bill_event'), -} ); +$cgi->param('seconds', $cgi->param('days') * 86400 ); my $error; -if ( $eventpart ) { - $error = $new->replace($old); +if ( ! $cgi->param('plan_weight_eventcode') ) { + $error = "Must select an action"; } else { - $error = $new->insert; - $eventpart = $new->getfield('eventpart'); -} + + $cgi->param('plan_weight_eventcode') =~ /^(\w+):(\d+):(.*)$/ + or die "illegal plan_weight_eventcode:". + $cgi->param('plan_weight_eventcode'); + $cgi->param('plan', $1); + $cgi->param('weight', $2); + my $eventcode = $3; + my $plandata = ''; + while ( $eventcode =~ /%%%(\w+)%%%/ ) { + my $field = $1; + my $value = $cgi->param($field); + $eventcode =~ s/%%%$field%%%/$value/; + $plandata .= "$field $value\n"; + } + $cgi->param('eventcode', $eventcode); + $cgi->param('plandata', $plandata); + + my $new = new FS::part_bill_event ( { + map { + $_, scalar($cgi->param($_)); + } fields('part_bill_event'), + } ); + + my $error; + if ( $eventpart ) { + $error = $new->replace($old); + } else { + $error = $new->insert; + $eventpart = $new->getfield('eventpart'); + } +} if ( $error ) { $cgi->param('error', $error); -- cgit v1.2.1 From 0bdec843e4a9bb7f947c9ba980a40f7bf37020fb Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 9 Feb 2002 18:24:02 +0000 Subject: no more exit() in templates --- httemplate/edit/process/agent_type.cgi | 52 +++++++++++----------- .../edit/process/cust_main_county-expand.cgi | 4 +- httemplate/edit/process/cust_main_county.cgi | 4 +- httemplate/edit/process/cust_pay.cgi | 3 +- httemplate/edit/process/part_pkg.cgi | 6 +-- 5 files changed, 34 insertions(+), 35 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi index 2d1159708..4e98cf113 100755 --- a/httemplate/edit/process/agent_type.cgi +++ b/httemplate/edit/process/agent_type.cgi @@ -1,4 +1,4 @@ - + <% my $typenum = $cgi->param('typenum'); @@ -21,35 +21,35 @@ if ( $typenum ) { if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string ); - exit; -} +} else { + + foreach my $part_pkg (qsearch('part_pkg',{})) { + my($pkgpart)=$part_pkg->getfield('pkgpart'); -foreach my $part_pkg (qsearch('part_pkg',{})) { - my($pkgpart)=$part_pkg->getfield('pkgpart'); - - my($type_pkgs)=qsearchs('type_pkgs',{ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - if ( $type_pkgs && ! $cgi->param("pkgpart$pkgpart") ) { - my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below. - $error=$d_type_pkgs->delete; - die $error if $error; - - } elsif ( $cgi->param("pkgpart$pkgpart") - && ! $type_pkgs - ) { - #ok to clobber it now (but bad form nonetheless?) - $type_pkgs=new FS::type_pkgs ({ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, + my($type_pkgs)=qsearchs('type_pkgs',{ + 'typenum' => $typenum, + 'pkgpart' => $pkgpart, }); - $error= $type_pkgs->insert; - die $error if $error; + if ( $type_pkgs && ! $cgi->param("pkgpart$pkgpart") ) { + my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below. + $error=$d_type_pkgs->delete; + die $error if $error; + + } elsif ( $cgi->param("pkgpart$pkgpart") + && ! $type_pkgs + ) { + #ok to clobber it now (but bad form nonetheless?) + $type_pkgs=new FS::type_pkgs ({ + 'typenum' => $typenum, + 'pkgpart' => $pkgpart, + }); + $error= $type_pkgs->insert; + die $error if $error; + } + } + print $cgi->redirect(popurl(3). "browse/agent_type.cgi"); } -print $cgi->redirect(popurl(3). "browse/agent_type.cgi"); - %> diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi index b16fab4fe..342779048 100755 --- a/httemplate/edit/process/cust_main_county-expand.cgi +++ b/httemplate/edit/process/cust_main_county-expand.cgi @@ -1,4 +1,4 @@ - + <% $cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; @@ -19,7 +19,7 @@ if ( $cgi->param('delim') eq 'n' ) { unless ( /^\s*([\w\- ]+)\s*$/ ) { $cgi->param('error', "Illegal item in expansion"); print $cgi->redirect(popurl(2). "cust_main_county-expand.cgi?". $cgi->query_string ); - exit; + myexit(); } $1; } @expansion; diff --git a/httemplate/edit/process/cust_main_county.cgi b/httemplate/edit/process/cust_main_county.cgi index 0f0246b73..e9d130897 100755 --- a/httemplate/edit/process/cust_main_county.cgi +++ b/httemplate/edit/process/cust_main_county.cgi @@ -1,4 +1,4 @@ - + <% foreach ( $cgi->param ) { @@ -14,7 +14,7 @@ foreach ( $cgi->param ) { if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string ); - exit; + myexit(); } } diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index c75e53280..953ff3edb 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -1,4 +1,4 @@ - + <% $cgi->param('linknum') =~ /^(\d+)$/ @@ -22,7 +22,6 @@ my $error = $new->insert; if ($error) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string ); - exit; } elsif ( $link eq 'invnum' ) { print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum"); } elsif ( $link eq 'custnum' ) { diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 2ba1cbeb0..5240d8cc2 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,4 +1,4 @@ - + <% my $dbh = dbh; @@ -34,7 +34,7 @@ foreach my $part_svc ( qsearch('part_svc', {} ) ) { unless ( $quantity =~ /^(\d+)$/ ) { $cgi->param('error', "Illegal quantity" ); print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); - exit; + myexit(); } } @@ -58,7 +58,7 @@ if ( $error ) { $dbh->rollback; $cgi->param('error', $error ); print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); - exit; + myexit(); } foreach $part_svc (qsearch('part_svc',{})) { -- cgit v1.2.1 From c828daa905491e65deb30a2ed34af609cdb96b99 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 02:16:47 +0000 Subject: pro-rating w/ web interface, tested (closes: Bug#313). view/cust_bill.cgi invoice view shows invoice events! fix bug where adding events with no name silently failed instead of giving an error add new comission plans --- httemplate/edit/process/part_bill_event.cgi | 1 - httemplate/edit/process/part_pkg.cgi | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_bill_event.cgi b/httemplate/edit/process/part_bill_event.cgi index 7c0b54d0d..1716c71b9 100755 --- a/httemplate/edit/process/part_bill_event.cgi +++ b/httemplate/edit/process/part_bill_event.cgi @@ -34,7 +34,6 @@ if ( ! $cgi->param('plan_weight_eventcode') ) { } fields('part_bill_event'), } ); - my $error; if ( $eventpart ) { $error = $new->replace($old); } else { diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 5240d8cc2..9ad1527a1 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,4 +1,4 @@ - + <% my $dbh = dbh; @@ -11,7 +11,7 @@ my $old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; my $plandata = $cgi->param('plandata'); my @plandata = split(',', $plandata); $cgi->param('plandata', - join('', map { "$_=". $cgi->param($_). "\n" } @plandata ) + join('', map { "$_=". join(', ', $cgi->param($_)). "\n" } @plandata ) ); foreach (qw( setuptax recurtax disabled )) { -- 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/REAL_cust_pkg.cgi | 1 - httemplate/edit/process/agent.cgi | 1 - httemplate/edit/process/agent_type.cgi | 1 - httemplate/edit/process/cust_bill_pay.cgi | 1 - httemplate/edit/process/cust_credit.cgi | 1 - httemplate/edit/process/cust_credit_bill.cgi | 1 - httemplate/edit/process/cust_main.cgi | 1 - httemplate/edit/process/cust_main_county-collapse.cgi | 1 - httemplate/edit/process/cust_main_county-expand.cgi | 1 - httemplate/edit/process/cust_main_county.cgi | 1 - httemplate/edit/process/cust_pay.cgi | 1 - httemplate/edit/process/cust_pkg.cgi | 1 - httemplate/edit/process/part_pkg.cgi | 3 +-- httemplate/edit/process/part_referral.cgi | 1 - httemplate/edit/process/quick-cust_pkg.cgi | 1 - httemplate/edit/process/svc_acct.cgi | 1 - httemplate/edit/process/svc_acct_pop.cgi | 1 - httemplate/edit/process/svc_acct_sm.cgi | 1 - httemplate/edit/process/svc_domain.cgi | 1 - httemplate/edit/process/svc_forward.cgi | 1 - 20 files changed, 1 insertion(+), 21 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi index 4f33f6b38..6bed85c19 100755 --- a/httemplate/edit/process/REAL_cust_pkg.cgi +++ b/httemplate/edit/process/REAL_cust_pkg.cgi @@ -1,5 +1,4 @@ <% -# my $pkgnum = $cgi->param('pkgnum') or die; my $old = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); diff --git a/httemplate/edit/process/agent.cgi b/httemplate/edit/process/agent.cgi index 93ce4f9f2..182eeab41 100755 --- a/httemplate/edit/process/agent.cgi +++ b/httemplate/edit/process/agent.cgi @@ -1,4 +1,3 @@ - <% my $agentnum = $cgi->param('agentnum'); diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi index 4e98cf113..67aacfdd5 100755 --- a/httemplate/edit/process/agent_type.cgi +++ b/httemplate/edit/process/agent_type.cgi @@ -1,4 +1,3 @@ - <% my $typenum = $cgi->param('typenum'); diff --git a/httemplate/edit/process/cust_bill_pay.cgi b/httemplate/edit/process/cust_bill_pay.cgi index 16d30bd4c..0c33506a8 100755 --- a/httemplate/edit/process/cust_bill_pay.cgi +++ b/httemplate/edit/process/cust_bill_pay.cgi @@ -1,4 +1,3 @@ - <% $cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!"; diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 51fca74e3..ac92631f8 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,4 +1,3 @@ - <% $cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; diff --git a/httemplate/edit/process/cust_credit_bill.cgi b/httemplate/edit/process/cust_credit_bill.cgi index afe297308..4879b0eab 100755 --- a/httemplate/edit/process/cust_credit_bill.cgi +++ b/httemplate/edit/process/cust_credit_bill.cgi @@ -1,4 +1,3 @@ - <% $cgi->param('crednum') =~ /^(\d*)$/ or die "Illegal crednum!"; 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 = ''; diff --git a/httemplate/edit/process/cust_main_county-collapse.cgi b/httemplate/edit/process/cust_main_county-collapse.cgi index 4888b781f..8e67140a8 100755 --- a/httemplate/edit/process/cust_main_county-collapse.cgi +++ b/httemplate/edit/process/cust_main_county-collapse.cgi @@ -1,4 +1,3 @@ - <% my($query) = $cgi->keywords; diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi index 342779048..64061deed 100755 --- a/httemplate/edit/process/cust_main_county-expand.cgi +++ b/httemplate/edit/process/cust_main_county-expand.cgi @@ -1,4 +1,3 @@ - <% $cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; diff --git a/httemplate/edit/process/cust_main_county.cgi b/httemplate/edit/process/cust_main_county.cgi index e9d130897..0800789b5 100755 --- a/httemplate/edit/process/cust_main_county.cgi +++ b/httemplate/edit/process/cust_main_county.cgi @@ -1,4 +1,3 @@ - <% foreach ( $cgi->param ) { diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index 953ff3edb..82442ae00 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -1,4 +1,3 @@ - <% $cgi->param('linknum') =~ /^(\d+)$/ diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi index 25b320150..f8c9f5151 100755 --- a/httemplate/edit/process/cust_pkg.cgi +++ b/httemplate/edit/process/cust_pkg.cgi @@ -1,4 +1,3 @@ - <% my $error = ''; diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 9ad1527a1..d489426f9 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,4 +1,3 @@ - <% my $dbh = dbh; @@ -61,7 +60,7 @@ if ( $error ) { myexit(); } -foreach $part_svc (qsearch('part_svc',{})) { +foreach my $part_svc (qsearch('part_svc',{})) { my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0; my $old_pkg_svc = qsearchs('pkg_svc', { 'pkgpart' => $pkgpart, diff --git a/httemplate/edit/process/part_referral.cgi b/httemplate/edit/process/part_referral.cgi index 7e37db855..fd2c01506 100755 --- a/httemplate/edit/process/part_referral.cgi +++ b/httemplate/edit/process/part_referral.cgi @@ -1,4 +1,3 @@ - <% my $refnum = $cgi->param('refnum'); diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 29a954cc9..5a4fb7797 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -1,4 +1,3 @@ - <% #untaint custnum diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi index 178d7d85a..5e8a16f4a 100755 --- a/httemplate/edit/process/svc_acct.cgi +++ b/httemplate/edit/process/svc_acct.cgi @@ -1,4 +1,3 @@ - <% $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; diff --git a/httemplate/edit/process/svc_acct_pop.cgi b/httemplate/edit/process/svc_acct_pop.cgi index 5d699f2f5..46ad74d62 100755 --- a/httemplate/edit/process/svc_acct_pop.cgi +++ b/httemplate/edit/process/svc_acct_pop.cgi @@ -1,4 +1,3 @@ - <% my $popnum = $cgi->param('popnum'); diff --git a/httemplate/edit/process/svc_acct_sm.cgi b/httemplate/edit/process/svc_acct_sm.cgi index 25cd88d5a..41d03fb92 100755 --- a/httemplate/edit/process/svc_acct_sm.cgi +++ b/httemplate/edit/process/svc_acct_sm.cgi @@ -1,4 +1,3 @@ - <% $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi index 0b7ec4928..19f8eb4f8 100755 --- a/httemplate/edit/process/svc_domain.cgi +++ b/httemplate/edit/process/svc_domain.cgi @@ -1,4 +1,3 @@ - <% #remove this to actually test the domains! diff --git a/httemplate/edit/process/svc_forward.cgi b/httemplate/edit/process/svc_forward.cgi index 5f0247fe5..bb066d8a6 100755 --- a/httemplate/edit/process/svc_forward.cgi +++ b/httemplate/edit/process/svc_forward.cgi @@ -1,4 +1,3 @@ - <% $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -- cgit v1.2.1 From a4c96748eb6eab29a70f3a944c6520283a635c78 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 16:05:22 +0000 Subject: *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. --- httemplate/edit/process/quick-cust_pkg.cgi | 3 +++ 1 file changed, 3 insertions(+) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 5a4fb7797..c663dce32 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -12,6 +12,9 @@ my @cust_pkg = (); my $error = FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, ); if ($error) { +%> + +<% eidiot($error); } else { print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $cust_pkg[0]->pkgnum ); -- cgit v1.2.1 From 7e3eb82f87c371785544b706b7347c7edde2b593 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 19:58:43 +0000 Subject: update billing documentation for the new world of invoice events added freeside-daily replacing freeside-bill for the new world of invoice events --- httemplate/edit/process/part_bill_event.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_bill_event.cgi b/httemplate/edit/process/part_bill_event.cgi index 1716c71b9..4049ade80 100755 --- a/httemplate/edit/process/part_bill_event.cgi +++ b/httemplate/edit/process/part_bill_event.cgi @@ -12,7 +12,7 @@ if ( ! $cgi->param('plan_weight_eventcode') ) { $error = "Must select an action"; } else { - $cgi->param('plan_weight_eventcode') =~ /^(\w+):(\d+):(.*)$/ + $cgi->param('plan_weight_eventcode') =~ /^([\w\-]+):(\d+):(.*)$/ or die "illegal plan_weight_eventcode:". $cgi->param('plan_weight_eventcode'); $cgi->param('plan', $1); -- cgit v1.2.1 From f255042296a645e7d90c19ee6740796250cfb9f3 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 11 Feb 2002 19:38:58 +0000 Subject: svc_www is working! also auto-create and add A records if necessary using apacheip config file. and show all domain_records on view/svc_domain.cgi page --- httemplate/edit/process/svc_www.cgi | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 httemplate/edit/process/svc_www.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/svc_www.cgi b/httemplate/edit/process/svc_www.cgi new file mode 100644 index 000000000..38d5e1c79 --- /dev/null +++ b/httemplate/edit/process/svc_www.cgi @@ -0,0 +1,36 @@ +<% + +$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; +my $svcnum = $1; + +my $old; +if ( $svcnum ) { + $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } ) + or die "fatal: can't find account (svcnum $svcnum)!"; +} else { + $old = ''; +} + +my $new = new FS::svc_www ( { + map { + ($_, scalar($cgi->param($_))); + #} qw(svcnum pkgnum svcpart recnum usersvc) + } ( fields('svc_www'), qw( pkgnum svcpart ) ) +} ); + +my $error; +if ( $svcnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $svcnum = $new->svcnum; +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "svc_www.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/svc_www.cgi?" . $svcnum ); +} + +%> -- cgit v1.2.1 From 14d6b3092a296ada5a0252752fd15a0087c63374 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 18 Mar 2002 15:52:12 +0000 Subject: added (incomplete) export foo --- httemplate/edit/process/part_export.cgi | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 httemplate/edit/process/part_export.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi new file mode 100644 index 000000000..9ee1c5974 --- /dev/null +++ b/httemplate/edit/process/part_export.cgi @@ -0,0 +1,43 @@ +<% + +my $dbh = dbh; + +my $exportnum = $cgi->param('exportnum'); + +my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; + +my $new = new FS::part_export ( { + map { + $_, scalar($cgi->param($_)); + } fields('part_export') +} ); + +local $SIG{HUP} = 'IGNORE'; +local $SIG{INT} = 'IGNORE'; +local $SIG{QUIT} = 'IGNORE'; +local $SIG{TERM} = 'IGNORE'; +local $SIG{TSTP} = 'IGNORE'; +local $SIG{PIPE} = 'IGNORE'; + +local $FS::UID::AutoCommit = 0; + +my $error; +if ( $exportnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $exportnum = $new->exportnum; +} +if ( $error ) { + $dbh->rollback; + $cgi->param('error', $error ); + print $cgi->redirect(popurl(2). "part_export.cgi?". $cgi->query_string ); + myexit(); +} + +#options + +$dbh->commit or die $dbh->errstr; +print $cgi->redirect(popurl(3). "browse/part_svc.cgi"); + +%> -- 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') 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 f1038a648b3d53db925b23519e7cd2a30c6837ed Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 20 Mar 2002 21:31:49 +0000 Subject: new export! infostreet and sqlradius provisioning switched over (Bug #299 - doesn't close it, but all the groundwork is done) also removes non-transactional ICRADIUS export from svc_acct.export (closes: Bug#347) --- httemplate/edit/process/part_export.cgi | 3 +++ 1 file changed, 3 insertions(+) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index 9ee1c5974..8160527f6 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -6,6 +6,9 @@ my $exportnum = $cgi->param('exportnum'); my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; +#fixup options +my %options = map { $_=>$cgi->param($_) } $cgi->param('options'); + my $new = new FS::part_export ( { map { $_, scalar($cgi->param($_)); -- cgit v1.2.1 From 415150fe1997eb2688dfd492710f644574e29daf Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 21 Mar 2002 06:57:20 +0000 Subject: more for the new world of export... --- httemplate/edit/process/part_export.cgi | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index 8160527f6..b4ce0b352 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -1,7 +1,5 @@ <% -my $dbh = dbh; - my $exportnum = $cgi->param('exportnum'); my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; @@ -26,21 +24,17 @@ local $FS::UID::AutoCommit = 0; my $error; if ( $exportnum ) { - $error = $new->replace($old); + $error = $new->replace($old,\%options); } else { - $error = $new->insert; - $exportnum = $new->exportnum; + $error = $new->insert,\%options); +# $exportnum = $new->exportnum; } + if ( $error ) { - $dbh->rollback; $cgi->param('error', $error ); print $cgi->redirect(popurl(2). "part_export.cgi?". $cgi->query_string ); - myexit(); +} else { + print $cgi->redirect(popurl(3). "browse/part_svc.cgi"); } -#options - -$dbh->commit or die $dbh->errstr; -print $cgi->redirect(popurl(3). "browse/part_svc.cgi"); - %> -- cgit v1.2.1 From b159f42fa3f48cc2ca3b43773e7661e17d2fb072 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 22 Mar 2002 12:49:43 +0000 Subject: more new export... --- httemplate/edit/process/part_export.cgi | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index b4ce0b352..d0c87a02a 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -5,7 +5,8 @@ my $exportnum = $cgi->param('exportnum'); my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; #fixup options -my %options = map { $_=>$cgi->param($_) } $cgi->param('options'); +warn join('-', split(',',$cgi->param('options'))); +my %options = map { $_=>$cgi->param($_) } split(',',$cgi->param('options')); my $new = new FS::part_export ( { map { @@ -13,20 +14,13 @@ my $new = new FS::part_export ( { } fields('part_export') } ); -local $SIG{HUP} = 'IGNORE'; -local $SIG{INT} = 'IGNORE'; -local $SIG{QUIT} = 'IGNORE'; -local $SIG{TERM} = 'IGNORE'; -local $SIG{TSTP} = 'IGNORE'; -local $SIG{PIPE} = 'IGNORE'; - -local $FS::UID::AutoCommit = 0; - my $error; if ( $exportnum ) { + warn $old; + warn $exportnum; $error = $new->replace($old,\%options); } else { - $error = $new->insert,\%options); + $error = $new->insert(\%options); # $exportnum = $new->exportnum; } -- cgit v1.2.1 From 8fe83dcb8807a86209625a5aab7e574073f0a907 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 23 Mar 2002 16:16:00 +0000 Subject: group editing seems to be working... everything except defaults... oh and export... --- httemplate/edit/process/svc_acct.cgi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi index 5e8a16f4a..950a8602f 100755 --- a/httemplate/edit/process/svc_acct.cgi +++ b/httemplate/edit/process/svc_acct.cgi @@ -20,12 +20,15 @@ if ( $cgi->param('_password') eq '*HIDDEN*' ) { $cgi->param('_password',$old->getfield('_password')); } +#unmunge usergroup +$cgi->param('usergroup', [ $cgi->param('radius_usergroup') ] ); + my $new = new FS::svc_acct ( { map { $_, scalar($cgi->param($_)); #} qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir # shell quota slipip) - } ( fields('svc_acct'), qw( pkgnum svcpart ) ) + } ( fields('svc_acct'), qw( pkgnum svcpart usergroup ) ) } ); my $error; -- cgit v1.2.1 From 74e64d70361848f089aad9a7881c2af9caf6e479 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 23 Mar 2002 17:49:01 +0000 Subject: okay group editing UI as well as part_svc group editing UI seem to be working --- httemplate/edit/process/part_svc.cgi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi index 423db93b5..31ab13438 100755 --- a/httemplate/edit/process/part_svc.cgi +++ b/httemplate/edit/process/part_svc.cgi @@ -4,14 +4,18 @@ my $svcpart = $cgi->param('svcpart'); my $old = qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart; +$cgi->param( 'svc_acct__usergroup', + join(',', $cgi->param('svc_acct__usergroup') ) ); + my $new = new FS::part_svc ( { map { $_, scalar($cgi->param($_)); # } qw(svcpart svc svcdb) } ( fields('part_svc'), map { my $svcdb = $_; - map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) } - fields($svcdb) + my @fields = fields($svcdb); + push @fields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge + map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) } @fields; } grep defined( $FS::Record::dbdef->table($_) ), qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ) ) @@ -19,9 +23,9 @@ my $new = new FS::part_svc ( { my $error; if ( $svcpart ) { - $error = $new->replace($old, '1.3-COMPAT'); + $error = $new->replace($old, '1.3-COMPAT', [ 'usergroup' ] ); } else { - $error = $new->insert; + $error = $new->insert( [ 'usergroup' ] ); $svcpart=$new->getfield('svcpart'); } -- cgit v1.2.1 From 0bd54ce52909122fa729e12709f6f155dd39c09c Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 5 Apr 2002 20:52:59 +0000 Subject: don't specify date (not on submitting form) --- httemplate/edit/process/cust_credit_bill.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_credit_bill.cgi b/httemplate/edit/process/cust_credit_bill.cgi index 4879b0eab..23e2e6ce5 100755 --- a/httemplate/edit/process/cust_credit_bill.cgi +++ b/httemplate/edit/process/cust_credit_bill.cgi @@ -17,7 +17,7 @@ if ($cgi->param('invnum') =~ /^Refund$/) { 'reason' => $cust_credit->reason, 'refund' => $cgi->param('amount'), 'payby' => 'BILL', - '_date' => $cgi->param('_date'), + #'_date' => $cgi->param('_date'), 'payinfo' => 'Cash', 'crednum' => $crednum, } ); -- cgit v1.2.1 From 44e3eff0aa6e7bdb7f4ecd9ee1ddf141e1b68af3 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 7 Apr 2002 05:56:09 +0000 Subject: working message catalogs (not used for enough yet) - almost (but not quite) closes Bug#385 - still have to catalog the backend things triggered by signup server. --- httemplate/edit/process/msgcat.cgi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 httemplate/edit/process/msgcat.cgi (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/msgcat.cgi b/httemplate/edit/process/msgcat.cgi new file mode 100644 index 000000000..ab30f06b5 --- /dev/null +++ b/httemplate/edit/process/msgcat.cgi @@ -0,0 +1,19 @@ +<% + +my $error; +foreach my $param ( grep { /^\d+$/ } $cgi->param ) { + my $old = qsearchs('msgcat', { msgnum=>$param } ); + my $new = new FS::msgcat { $old->hash }; + $new->msg($cgi->param($param)); + $error = $new->replace($old); + last if $error; +} + +if ( $error ) { + $cgi->param('error',$error); + print $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "browse/msgcat.cgi"); +} + +%> -- cgit v1.2.1 From 0b65ce59c7d2ee712389c27954382274ddf718a5 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 10 Apr 2002 13:42:49 +0000 Subject: bulk checkin from working on the road: - use msgcat for more error messages - should be all things that would come3 back from the signup server normally now - signup server: don't display access number