summaryrefslogtreecommitdiff
path: root/htdocs
diff options
context:
space:
mode:
authorivan <ivan>1998-11-18 09:01:44 +0000
committerivan <ivan>1998-11-18 09:01:44 +0000
commitef834d58bfd2ce38c8bea73262c8091a5d88388f (patch)
treea6eb07abbaa8bb18a92643df707ae9b98a679682 /htdocs
parent69eff6e55baea5f6d99f8f797fa2eac6f761838b (diff)
i18n! i18n!
Diffstat (limited to 'htdocs')
-rwxr-xr-xhtdocs/browse/cust_main_county.cgi54
-rw-r--r--htdocs/docs/schema.html8
-rw-r--r--htdocs/docs/upgrade3.html16
-rwxr-xr-xhtdocs/edit/cust_main.cgi12
-rwxr-xr-xhtdocs/edit/cust_main_county-expand.cgi28
-rwxr-xr-xhtdocs/edit/cust_main_county.cgi34
-rwxr-xr-xhtdocs/edit/process/cust_main_county-expand.cgi49
-rwxr-xr-xhtdocs/edit/process/cust_main_county.cgi24
-rwxr-xr-xhtdocs/index.html4
9 files changed, 150 insertions, 79 deletions
diff --git a/htdocs/browse/cust_main_county.cgi b/htdocs/browse/cust_main_county.cgi
index d615198c9..4defa574d 100755
--- a/htdocs/browse/cust_main_county.cgi
+++ b/htdocs/browse/cust_main_county.cgi
@@ -1,6 +1,6 @@
#!/usr/bin/perl -Tw
#
-# cust_main_county.cgi: browse cust_main_county
+# $Id: cust_main_county.cgi,v 1.2 1998-11-18 09:01:34 ivan Exp $
#
# ivan@sisd.com 97-dec-13
#
@@ -8,26 +8,35 @@
# bmccane@maxbaud.net 98-apr-3
#
# lose background, FS::CGI ivan@sisd.com 98-sep-2
+#
+# $Log: cust_main_county.cgi,v $
+# Revision 1.2 1998-11-18 09:01:34 ivan
+# i18n! i18n!
+#
use strict;
-use CGI::Base;
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
use FS::UID qw(cgisuidsetup swapuid);
use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar);
+use FS::CGI qw(header menubar popurl table);
+use FS::cust_main_county;
-my($cgi) = new CGI::Base;
-$cgi->get;
+my($cgi) = new CGI;
&cgisuidsetup($cgi);
-SendHeaders(); # one guess.
-print header("Tax Rate Listing", menubar(
- 'Main Menu' => '../',
- 'Edit tax rates' => "../edit/cust_main_county.cgi",
+print $cgi->header, header("Tax Rate Listing", menubar(
+ 'Main Menu' => popurl(2),
+ 'Edit tax rates' => popurl(2). "/edit/cust_main_county.cgi",
)),<<END;
- <BR>Click on <u>expand</u> to specify tax rates by county.
- <P><TABLE BORDER>
+ Click on <u>expand country</u> to specify a country's tax rates by state.
+ <BR>Click on <u>expand state</u> to specify a state's tax rates by county.
+ <BR><BR>
+END
+print table, <<END;
<TR>
+ <TH><FONT SIZE=-1>Country</FONT></TH>
<TH><FONT SIZE=-1>State</FONT></TH>
<TH>County</TH>
<TH><FONT SIZE=-1>Tax</FONT></TH>
@@ -39,15 +48,26 @@ foreach $cust_main_county ( qsearch('cust_main_county',{}) ) {
my($hashref)=$cust_main_county->hashref;
print <<END;
<TR>
- <TD>$hashref->{state}</TD>
+ <TD>$hashref->{country}</TD>
END
-
- print "<TD>", $hashref->{county}
- ? $hashref->{county}
+ print "<TD>", $hashref->{state}
+ ? $hashref->{state}
: qq!(ALL) <FONT SIZE=-1>!.
- qq!<A HREF="../edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
- qq!">expand</A></FONT>!
+ qq!<A HREF="!. popurl(2). qq!/edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
+ qq!">expand country</A></FONT>!
, "</TD>";
+ print "<TD>";
+ if ( $hashref->{county} ) {
+ print $hashref->{county};
+ } else {
+ print "(ALL)";
+ if ( $hashref->{state} ) {
+ print qq!<FONT SIZE=-1>!.
+ qq!<A HREF="!. popurl(2). qq!/edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
+ qq!">expand state</A></FONT>!;
+ }
+ }
+ print "</TD>";
print <<END;
<TD>$hashref->{tax}%</TD>
diff --git a/htdocs/docs/schema.html b/htdocs/docs/schema.html
index 5a296ec83..f7a9bc101 100644
--- a/htdocs/docs/schema.html
+++ b/htdocs/docs/schema.html
@@ -50,7 +50,9 @@
<li>custnum - primary key
<li>agentnum - <a href="#agent">agent</a>
<li>refnum - <a href="#part_referral">referral</a>
+ <li>titlenum - <a href="#part_title">title</a>
<li>first - name
+ <li>middle - name
<li>last - name
<li>ss - social security number
<li>company
@@ -75,6 +77,7 @@
<li>taxnum - primary key
<li>state
<li>county
+ <li>country
<li>tax - % rate
</ul>
<li><a name="cust_pay">cust_pay</a> - Payments
@@ -155,6 +158,11 @@
<li><i>table</i>__<i>field</i> - Default or fixed value for <i>field</i> in <i>table</i>
<li><i>table</i>__<i>field</i>_flag - null, D or F
</ul>
+ <li><a name="part_title">part_title</a> - Personal titles
+ <ul>
+ <li>titlenum - primary key
+ <li>title - personal title (`Dr.' or `Mr.')
+ </ul>
<li><a name="pkg_svc">pkg_svc</a>
<ul>
<li>pkgpart - <a href="#part_pkg">Package definition</a>
diff --git a/htdocs/docs/upgrade3.html b/htdocs/docs/upgrade3.html
index bfb717cfa..15066423e 100644
--- a/htdocs/docs/upgrade3.html
+++ b/htdocs/docs/upgrade3.html
@@ -12,5 +12,21 @@
<li>Move /var/spool/freeside/dbdef.<i>datasrc</i> to /usr/local/etc/freeside/dbdef.<i>datasrc</i>.
<li>Move /var/spool/freeside/counters to /usr/local/etc/freeside/counters.<i>datasrc</i>.
<li>Move /var/spool/freeside/export to /usr/local/etc/freeside/export.<i>datasrc</i>.
+ <li>Apply the following changes to your database:
+<pre>
+ALTER TABLE cust_main ADD middle varchar(80) NULL;
+ALTER TABLE cust_main ADD titlenum int NULL;
+ALTER TABLE cust_main CHANGE state state varchar(80) NULL;
+ALTER TABLE cust_main_county CHANGE state state varchar(80) NULL;
+ALTER TABLE cust_main_county ADD country char(2);
+UPDATE cust_main_county SET country = "US" where country IS NULL;
+CREATE TABLE part_title (
+ titlenum int NOT NULL,
+ title varchar(80),
+ PRIMARY KEY (titlenum)
+);
+</pre>
+ <li>Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are r
+unning a different database engine you will need to modify it slightly.
<li>Copy or symlink htdocs and site_perl to the new copies.
</body>
diff --git a/htdocs/edit/cust_main.cgi b/htdocs/edit/cust_main.cgi
index 14556010c..fd36ab7d4 100755
--- a/htdocs/edit/cust_main.cgi
+++ b/htdocs/edit/cust_main.cgi
@@ -63,7 +63,6 @@ if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing
$custnum='';
$cust_main = create FS::cust_main ( {} );
$cust_main->setfield('otaker',&getotaker);
- $cust_main->setfield('country','US');
$action='Add';
}
@@ -130,21 +129,23 @@ Name (last)<INPUT TYPE="text" NAME="last" VALUE="$last"> (first)<INPUT TYPE="tex
Company <INPUT TYPE="text" NAME="company" VALUE="$company">
Address <INPUT TYPE="text" NAME="address1" VALUE="$address1" SIZE=40 MAXLENGTH=40>
<INPUT TYPE="text" NAME="address2" VALUE="$address2" SIZE=40 MAXLENGTH=40>
-City <INPUT TYPE="text" NAME="city" VALUE="$city"> State (county) <SELECT NAME="state" SIZE="1">
+City <INPUT TYPE="text" NAME="city" VALUE="$city"> State (county) / Country<SELECT NAME="state" SIZE="1">
END
foreach ( qsearch('cust_main_county',{}) ) {
print "<OPTION";
print " SELECTED" if ( $cust_main->state eq $_->state
- && $cust_main->county eq $_->county );
+ && $cust_main->county eq $_->county
+ && $cust_main->country eq $_->country
+ );
print ">",$_->state;
print " (",$_->county,")" if $_->county;
+ print " / ", $_->country;
}
print "</SELECT>";
-my($zip,$country,$daytime,$night,$fax)=(
+my($zip,$daytime,$night,$fax)=(
$cust_main->zip,
- $cust_main->country,
$cust_main->daytime,
$cust_main->night,
$cust_main->fax,
@@ -152,7 +153,6 @@ my($zip,$country,$daytime,$night,$fax)=(
print <<END;
Zip <INPUT TYPE="text" NAME="zip" VALUE="$zip" SIZE=10 MAXLENGTH=10>
-Country: <FONT SIZE="+1"><B>$country</B></FONT><INPUT TYPE="hidden" NAME="country" VALUE="$country">
Phone (daytime)<INPUT TYPE="text" NAME="daytime" VALUE="$daytime" SIZE=18 MAXLENGTH=20> (night)<INPUT TYPE="text" NAME="night" VALUE="$night" SIZE=18 MAXLENGTH=20> (fax)<INPUT TYPE="text" NAME="fax" VALUE="$fax" SIZE=12 MAXLENGTH=12>
diff --git a/htdocs/edit/cust_main_county-expand.cgi b/htdocs/edit/cust_main_county-expand.cgi
index 59ff7043a..9b687993f 100755
--- a/htdocs/edit/cust_main_county-expand.cgi
+++ b/htdocs/edit/cust_main_county-expand.cgi
@@ -1,6 +1,6 @@
#!/usr/bin/perl -Tw
#
-# cust_main_county-expand.cgi: Expand a state into counties (output form)
+# $Id: cust_main_county-expand.cgi,v 1.2 1998-11-18 09:01:38 ivan Exp $
#
# ivan@sisd.com 97-dec-16
#
@@ -8,39 +8,43 @@
# bmccane@maxbaud.net 98-apr-3
#
# lose background, FS::CGI ivan@sisd.com 98-sep-2
+#
+# $Log: cust_main_county-expand.cgi,v $
+# Revision 1.2 1998-11-18 09:01:38 ivan
+# i18n! i18n!
+#
use strict;
-use CGI::Base;
+use CGI;
use CGI::Carp qw(fatalsToBrowser);
use FS::UID qw(cgisuidsetup);
use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar);
+use FS::CGI qw(header menubar popurl);
+use FS::cust_main_county;
-my($cgi) = new CGI::Base;
-$cgi->get;
+my($cgi) = new CGI;
&cgisuidsetup($cgi);
-SendHeaders(); # one guess.
-
-$cgi->var('QUERY_STRING') =~ /^(\d+)$/
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/
or die "Illegal taxnum!";
my($taxnum)=$1;
my($cust_main_county)=qsearchs('cust_main_county',{'taxnum'=>$taxnum});
die "Can't expand entry!" if $cust_main_county->getfield('county');
-print header("Tax Rate (expand state)", menubar(
- 'Main Menu' => '../',
+print $cgi->header, header("Tax Rate (expand)", menubar(
+ 'Main Menu' => popurl(2),
)), <<END;
<FORM ACTION="process/cust_main_county-expand.cgi" METHOD=POST>
<INPUT TYPE="hidden" NAME="taxnum" VALUE="$taxnum">
- Separate counties by
+ Separate by
<INPUT TYPE="radio" NAME="delim" VALUE="n" CHECKED>line
(rumor has it broken on some browsers) or
<INPUT TYPE="radio" NAME="delim" VALUE="s">whitespace.
<BR><INPUT TYPE="submit" VALUE="Submit">
- <BR><TEXTAREA NAME="counties" ROWS=100></TEXTAREA>
+ <BR><TEXTAREA NAME="expansion" ROWS=100></TEXTAREA>
</FORM>
</CENTER>
</BODY>
diff --git a/htdocs/edit/cust_main_county.cgi b/htdocs/edit/cust_main_county.cgi
index 904d58346..96574f0ef 100755
--- a/htdocs/edit/cust_main_county.cgi
+++ b/htdocs/edit/cust_main_county.cgi
@@ -1,6 +1,6 @@
#!/usr/bin/perl -Tw
#
-# cust_main_county.cgi: Edit tax rates (output form)
+# $Id: cust_main_county.cgi,v 1.2 1998-11-18 09:01:39 ivan Exp $
#
# ivan@sisd.com 97-dec-13-16
#
@@ -9,27 +9,30 @@
# bmccane@maxbaud.net 98-apr-3
#
# lose background, FS::CGI ivan@sisd.com 98-sep-2
+#
+# $Log: cust_main_county.cgi,v $
+# Revision 1.2 1998-11-18 09:01:39 ivan
+# i18n! i18n!
+#
use strict;
-use CGI::Base;
+use CGI;
use CGI::Carp qw(fatalsToBrowser);
use FS::UID qw(cgisuidsetup);
use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar);
+use FS::CGI qw(header menubar popurl table);
+use FS::cust_main_county;
-my($cgi) = new CGI::Base;
-$cgi->get;
+my($cgi) = new CGI;
&cgisuidsetup($cgi);
-SendHeaders(); # one guess.
-
-print header("Edit tax rates", menubar(
- 'Main Menu' => '../',
-)),<<END;
- <FORM ACTION="process/cust_main_county.cgi" METHOD=POST>
- <TABLE BORDER>
+print $cgi->header, header("Edit tax rates", menubar(
+ 'Main Menu' => popurl(2),
+)), qq!<FORM ACTION="!, popurl(1),
+ qq!/process/cust_main_county.cgi" METHOD=POST>!, table, <<END;
<TR>
+ <TH><FONT SIZE=-1>Country</FONT></TH>
<TH><FONT SIZE=-1>State</FONT></TH>
<TH>County</TH>
<TH><FONT SIZE=-1>Tax</FONT></TH>
@@ -41,9 +44,14 @@ foreach $cust_main_county ( qsearch('cust_main_county',{}) ) {
my($hashref)=$cust_main_county->hashref;
print <<END;
<TR>
- <TD>$hashref->{state}</TD>
+ <TD>$hashref->{country}</TD>
END
+ print "<TD>", $hashref->{state}
+ ? $hashref->{state}
+ : '(ALL)'
+ , "</TD>";
+
print "<TD>", $hashref->{county}
? $hashref->{county}
: '(ALL)'
diff --git a/htdocs/edit/process/cust_main_county-expand.cgi b/htdocs/edit/process/cust_main_county-expand.cgi
index a821560c6..c70d5b9d7 100755
--- a/htdocs/edit/process/cust_main_county-expand.cgi
+++ b/htdocs/edit/process/cust_main_county-expand.cgi
@@ -1,6 +1,6 @@
#!/usr/bin/perl -Tw
#
-# process/cust_main_county-expand.cgi: Expand counties (process form)
+# $Id: cust_main_county-expand.cgi,v 1.2 1998-11-18 09:01:40 ivan Exp $
#
# ivan@sisd.com 97-dec-16
#
@@ -12,45 +12,55 @@
# 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
+# ivan@sisd.com 98-sep-2
+#
+# $Log: cust_main_county-expand.cgi,v $
+# Revision 1.2 1998-11-18 09:01:40 ivan
+# i18n! i18n!
+#
use strict;
-use CGI::Request;
+use CGI;
use CGI::Carp qw(fatalsToBrowser);
use FS::UID qw(cgisuidsetup datasrc);
use FS::Record qw(qsearch qsearchs);
+use FS::CGI qw(eidiot popurl);
use FS::cust_main_county;
-use FS::CGI qw(eidiot);
+use FS::cust_main;
-my($req)=new CGI::Request; # create form object
+my($cgi)=new CGI;
-&cgisuidsetup($req->cgi);
+&cgisuidsetup($cgi);
-$req->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!";
+$cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!";
my($taxnum)=$1;
my($cust_main_county)=qsearchs('cust_main_county',{'taxnum'=>$taxnum})
or die ("Unknown taxnum!");
-my(@counties);
-if ( $req->param('delim') eq 'n' ) {
- @counties=split(/\n/,$req->param('counties'));
-} elsif ( $req->param('delim') eq 's' ) {
- @counties=split(/\s+/,$req->param('counties'));
+my(@expansion);
+if ( $cgi->param('delim') eq 'n' ) {
+ @expansion=split(/\n/,$cgi->param('expansion'));
+} elsif ( $cgi->param('delim') eq 's' ) {
+ @expansion=split(/\s+/,$cgi->param('expansion'));
} else {
die "Illegal delim!";
}
-@counties=map {
- /^\s*([\w\- ]+)\s*$/ or eidiot("Illegal county");
+@expansion=map {
+ /^\s*([\w\- ]+)\s*$/ or eidiot("Illegal expansion");
$1;
-} @counties;
+} @expansion;
-my($county);
-foreach ( @counties) {
+my($expansion);
+foreach ( @expansion) {
my(%hash)=$cust_main_county->hash;
my($new)=create FS::cust_main_county \%hash;
$new->setfield('taxnum','');
- $new->setfield('county',$_);
+ if ( ! $cust_main_county->state ) {
+ $new->setfield('state',$_);
+ } else {
+ $new->setfield('county',$_);
+ }
#if (datasrc =~ m/Pg/)
#{
# $new->setfield('tax',0.0);
@@ -62,10 +72,11 @@ foreach ( @counties) {
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;
}
-$req->cgi->redirect("../../edit/cust_main_county.cgi");
+print $cgi->redirect(popurl(3). "/edit/cust_main_county.cgi");
diff --git a/htdocs/edit/process/cust_main_county.cgi b/htdocs/edit/process/cust_main_county.cgi
index 58eaa63ce..ce5a4f671 100755
--- a/htdocs/edit/process/cust_main_county.cgi
+++ b/htdocs/edit/process/cust_main_county.cgi
@@ -1,6 +1,6 @@
#!/usr/bin/perl -Tw
#
-# process/agent.cgi: Edit cust_main_county (process form)
+# $Id: cust_main_county.cgi,v 1.2 1998-11-18 09:01:41 ivan Exp $
#
# ivan@sisd.com 97-dec-16
#
@@ -8,31 +8,35 @@
# bmccane@maxbaud.net 98-apr-3
#
# lose background, FS::CGI ivan@sisd.com 98-sep-2
+#
+# $Log: cust_main_county.cgi,v $
+# Revision 1.2 1998-11-18 09:01:41 ivan
+# i18n! i18n!
+#
use strict;
-use CGI::Request;
+use CGI;
use CGI::Carp qw(fatalsToBrowser);
use FS::UID qw(cgisuidsetup);
+use FS::CGI qw(eidiot);
use FS::Record qw(qsearch qsearchs);
use FS::cust_main_county;
-use FS::CGI qw(eidiot);
-
-my($req)=new CGI::Request; # create form object
-&cgisuidsetup($req->cgi);
+my($req)=new CGI;
+&cgisuidsetup($cgi);
-foreach ( $req->params ) {
+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 $req->param("tax$taxnum");
+ next unless $old->getfield('tax') ne $cgi->param("tax$taxnum");
my(%hash)=$old->hash;
- $hash{tax}=$req->param("tax$taxnum");
+ $hash{tax}=$cgi->param("tax$taxnum");
my($new)=create FS::cust_main_county \%hash;
my($error)=$new->replace($old);
eidiot($error) if $error;
}
-$req->cgi->redirect("../../browse/cust_main_county.cgi");
+$cgi->redirect(popurl(3). "/browse/cust_main_county.cgi");
diff --git a/htdocs/index.html b/htdocs/index.html
index d2b5a1e93..316ac5e7b 100755
--- a/htdocs/index.html
+++ b/htdocs/index.html
@@ -83,8 +83,8 @@
<LI><A HREF="browse/cust_main_county.cgi">
View/Edit locales and tax rates
</A>
- - Change tax rates by state, or break down a state into counties
- and assign different tax rates to each county.
+ - Change tax rates, or break down a country into states, or a state
+ into counties and assign different tax rates to each.
<BR>
<LI><A HREF="browse/svc_acct_pop.cgi">
View/Edit POPs