summaryrefslogtreecommitdiff
path: root/FS/bin
diff options
context:
space:
mode:
Diffstat (limited to 'FS/bin')
-rw-r--r--FS/bin/freeside-adduser6
-rwxr-xr-xFS/bin/freeside-cc-receipts-report270
-rwxr-xr-xFS/bin/freeside-credit-report224
-rwxr-xr-xFS/bin/freeside-daily2
-rwxr-xr-xFS/bin/freeside-email6
-rwxr-xr-xFS/bin/freeside-expiration-alerter6
-rwxr-xr-xFS/bin/freeside-overdue196
-rwxr-xr-xFS/bin/freeside-setup289
-rwxr-xr-xFS/bin/freeside-tax-report2
9 files changed, 794 insertions, 207 deletions
diff --git a/FS/bin/freeside-adduser b/FS/bin/freeside-adduser
index c3ee05b9b..424123226 100644
--- a/FS/bin/freeside-adduser
+++ b/FS/bin/freeside-adduser
@@ -1,10 +1,9 @@
#!/usr/bin/perl -w
#
-# $Id: freeside-adduser,v 1.8 2002-09-27 05:36:29 ivan Exp $
+# $Id: freeside-adduser,v 1.7 2002-08-25 01:16:30 ivan Exp $
use strict;
use vars qw($opt_h $opt_b $opt_c $opt_s);
-use Fcntl qw(:flock);
use Getopt::Std;
my $FREESIDE_CONF = "/usr/local/etc/freeside";
@@ -25,8 +24,7 @@ if ( $opt_h ) {
my $secretfile = $opt_s || 'secrets';
open(MAPSECRETS,">>$FREESIDE_CONF/mapsecrets")
- and flock(MAPSECRETS,LOCK_EX)
- or die "can't open $FREESIDE_CONF/mapsecrets: $!";
+ or die "can't open $FREESIDE_CONF/mapsecrets: $!";
print MAPSECRETS "$user $secretfile\n";
close MAPSECRETS or die "can't close $FREESIDE_CONF/mapsecrets: $!";
diff --git a/FS/bin/freeside-cc-receipts-report b/FS/bin/freeside-cc-receipts-report
new file mode 100755
index 000000000..f4225d28a
--- /dev/null
+++ b/FS/bin/freeside-cc-receipts-report
@@ -0,0 +1,270 @@
+#!/usr/bin/perl -Tw
+
+
+use strict;
+use Date::Parse;
+use Time::Local;
+use Getopt::Std;
+use Text::Template;
+use Net::SMTP;
+use Mail::Header;
+use Mail::Internet;
+use FS::Conf;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch qsearchs);
+use FS::cust_pay;
+use FS::cust_pay_batch;
+
+
+&untaint_argv; #what it sounds like (eww)
+use vars qw($opt_v $opt_p $opt_m $opt_e $opt_t $opt_s $opt_f $report_lines $report_template @buf $header);
+getopts("vpmef:s:"); #switches
+
+#we're at now now (and later).
+my($_finishdate)= $opt_f ? str2time($main::opt_f) : $^T;
+my($_startdate)= $opt_s ? str2time($main::opt_s) : $^T;
+
+# Get the current month
+my ($ssec,$smin,$shour,$smday,$smon,$syear) =
+ (localtime($_startdate) )[0,1,2,3,4,5];
+$smon++;
+$syear += 1900;
+
+# Get the current month
+my ($fsec,$fmin,$fhour,$fmday,$fmon,$fyear) =
+ (localtime($_finishdate) )[0,1,2,3,4,5];
+$fmon++;
+$fyear += 1900;
+
+# Login to the database
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+# Get the needed configuration files
+my $conf = new FS::Conf;
+my $lpr = $conf->config('lpr');
+my $email = $conf->config('email');
+my $smtpmachine = $conf->config('smtpmachine');
+my $mail_sender = $conf->exists('invoice_from') ? $conf->config('invoice_from') :
+ 'postmaster';
+my @report_template = $conf->config('report_template')
+ or die "cannot load config file report_template";
+$report_lines = 0;
+foreach ( grep /report_lines\(\d+\)/, @report_template ) { #kludgy :/
+ /report_lines\((\d+)\)/;
+ $report_lines += $1;
+}
+die "no report_lines() functions in template?" unless $report_lines;
+$report_template = new Text::Template (
+ TYPE => 'ARRAY',
+ SOURCE => [ map "$_\n", @report_template ],
+) or die "can't create new Text::Template object: $Text::Template::ERROR";
+
+
+my(@cust_pays)=qsearch('cust_pay',{});
+if (scalar(@cust_pays) == 0)
+{
+ exit 1;
+}
+
+# Open print and email pipes
+# $lpr and opt_p for printing
+# $email and opt_m for email
+
+if ($lpr && $main::opt_p)
+{
+ open(LPR, "|$lpr");
+}
+
+if ($email && $main::opt_m)
+{
+ $ENV{MAILADDRESS} = $mail_sender;
+ $header = new Mail::Header ( [
+ "From: Account Processor",
+ "To: $email",
+ "Sender: $mail_sender",
+ "Reply-To: $mail_sender",
+ "Subject: Credit Card Receipts",
+ ] );
+}
+
+my $uninvoiced = 0;
+my $total = 0;
+my $taxed = 0;
+my $untaxed = 0;
+my $total_tax = 0;
+
+# Now I can start looping
+foreach my $cust_pay (@cust_pays)
+{
+ my $_date = $cust_pay->getfield('_date');
+ my $invnum = $cust_pay->getfield('invnum');
+ my $paid = $cust_pay->getfield('paid');
+ my $payby = $cust_pay->getfield('payby');
+
+
+ if ($_date >= $_startdate && $_date <= $_finishdate && $payby =~ 'CARD') {
+ $total += $paid;
+
+ $uninvoiced += $cust_pay->unapplied;
+ my @cust_bill_pays = $cust_pay->cust_bill_pay;
+ foreach my $cust_bill_pay (@cust_bill_pays) {
+ my $invoice_amt =0;
+ my $invoice_tax =0;
+ my(@cust_bill_pkgs)= $cust_bill_pay->cust_bill->cust_bill_pkg;
+ foreach my $cust_bill_pkg (@cust_bill_pkgs) {
+
+ my $recur = $cust_bill_pkg->getfield('recur');
+ my $setup = $cust_bill_pkg->getfield('setup');
+ my $pkgnum = $cust_bill_pkg->getfield('pkgnum');
+
+ if ($pkgnum == 0) {
+ $invoice_tax += $recur;
+ $invoice_tax += $setup;
+ } else {
+ $invoice_amt += $recur;
+ $invoice_amt += $setup;
+ }
+
+ }
+
+ if ($invoice_tax > 0) {
+ if ($invoice_amt != $paid) {
+ # attempt to prorate partially paid invoices
+ $total_tax += $paid / ($invoice_amt + $invoice_tax) * $invoice_tax;
+ $taxed += $paid / ($invoice_amt + $invoice_tax) * $invoice_amt;
+ } else {
+ $total_tax += $invoice_tax;
+ $taxed += $invoice_amt;
+ }
+ } else {
+ $untaxed += $paid;
+ }
+
+ }
+
+ }
+
+}
+
+push @buf, sprintf(qq{\n%25s%14.2f\n}, "Uninvoiced", $uninvoiced);
+push @buf, sprintf(qq{%25s%14.2f\n}, "Untaxed", $untaxed);
+push @buf, sprintf(qq{%25s%14.2f\n}, "Taxed", $taxed);
+push @buf, sprintf(qq{%25s%14.2f\n}, "Tax", $total_tax);
+push @buf, sprintf(qq{\n%39s\n%39.2f\n}, "=========", $total);
+
+sub FS::cc_receipts_report::_template::report_lines {
+ my $lines = shift;
+ map {
+ scalar(@buf) ? shift @buf : '' ;
+ }
+ ( 1 .. $lines );
+}
+
+$FS::cc_receipts_report::_template::title = qq~CREDIT CARD RECEIPTS for period $smon/$smday/$syear through $fmon/$fmday/$fyear~;
+$FS::cc_receipts_report::_template::title = $opt_t if $opt_t;
+$FS::cc_receipts_report::_template::page = 1;
+$FS::cc_receipts_report::_template::date = $^T;
+$FS::cc_receipts_report::_template::date = $^T;
+$FS::cc_receipts_report::_template::fdate = $_finishdate;
+$FS::cc_receipts_report::_template::fdate = $_finishdate;
+$FS::cc_receipts_report::_template::sdate = $_startdate;
+$FS::cc_receipts_report::_template::sdate = $_startdate;
+$FS::cc_receipts_report::_template::total_pages =
+ int( scalar(@buf) / $report_lines);
+$FS::cc_receipts_report::_template::total_pages++ if scalar(@buf) % $report_lines;
+
+my @report;
+while (@buf) {
+ push @report, split("\n",
+ $report_template->fill_in( PACKAGE => 'FS::cc_receipts_report::_template' )
+ );
+ $FS::cc_receipts_report::_template::page++;
+}
+
+if ($opt_v) {
+ print map "$_\n", @report;
+}
+if($lpr && $opt_p)
+{
+ print LPR map "$_\n", @report;
+ print LPR "\f" if $opt_e;
+ close LPR || die "Could not close printer: $lpr\n";
+}
+if($email && $opt_m)
+{
+ my $message = new Mail::Internet (
+ 'Header' => $header,
+ 'Body' => [ (@report) ],
+ );
+ $!=0;
+ $message->smtpsend( Host => "$smtpmachine" )
+ or die "can't send report to $email via $smtpmachine: $!";
+}
+
+
+# subroutines
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ $ARGV[$_] =~ /^([\w\-\/ :\.]*)$/ || die "Illegal argument \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-cc-receipts-report [-v] [-p] [-e] user\n";
+}
+
+=head1 NAME
+
+freeside-cc-receipts-report - Prints or emails total credit card receipts in a given period.
+
+=head1 SYNOPSIS
+
+ freeside-cc-receipts-report [-v] [-p] [-m] [-e] [-t "title"] [-s date] [-f date] user
+
+=head1 DESCRIPTION
+
+Prints or emails sales taxes invoiced in a given period.
+
+-v: Verbose - Prints records to STDOUT.
+
+-p: Print to printer lpr as found in the conf directory.
+
+-m: Email output to user found in the Conf email file.
+
+-e: Print a final form feed to the printer.
+
+-t: supply a title for the top of each page.
+
+-s: starting date for inclusion
+
+-f: final date for inclusion
+
+user: From the mapsecrets file - see config.html from the base documentation
+
+=head1 VERSION
+
+$Id: freeside-cc-receipts-report,v 1.4.4.1 2002-09-09 22:57:32 ivan Exp $
+
+=head1 BUGS
+
+Yes..... Use at your own risk. No guarantees or warrantees of any
+kind apply to this program. Parts of this program are hacked from
+other GNU licensed software created mainly by Ivan Kohler.
+
+This is released under the GNU Public License. See www.gnu.org
+for more information regarding this license.
+
+=head1 SEE ALSO
+
+L<FS::cust_main>, config.html from the base documentation
+
+=head1 AUTHOR
+
+Jeff Finucane <jeff@cmh.net>
+
+based on print-batch by Joel Griffiths <griff@aver-computer.com>
+
+=cut
+
diff --git a/FS/bin/freeside-credit-report b/FS/bin/freeside-credit-report
new file mode 100755
index 000000000..da01d3bd5
--- /dev/null
+++ b/FS/bin/freeside-credit-report
@@ -0,0 +1,224 @@
+#!/usr/bin/perl -Tw
+
+
+use strict;
+use Date::Parse;
+use Time::Local;
+use Getopt::Std;
+use Text::Template;
+use Net::SMTP;
+use Mail::Header;
+use Mail::Internet;
+use FS::Conf;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::cust_credit;
+
+
+&untaint_argv; #what it sounds like (eww)
+use vars qw($opt_v $opt_p $opt_m $opt_e $opt_t $opt_s $opt_f $report_lines $report_template @buf $header);
+getopts("vpmef:s:"); #switches
+
+#we're at now now (and later).
+my($_finishdate)= $opt_f ? str2time($main::opt_f) : $^T;
+my($_startdate)= $opt_s ? str2time($main::opt_s) : $^T;
+
+# Get the current month
+my ($ssec,$smin,$shour,$smday,$smon,$syear) =
+ (localtime($_startdate) )[0,1,2,3,4,5];
+$smon++;
+$syear += 1900;
+
+# Get the current month
+my ($fsec,$fmin,$fhour,$fmday,$fmon,$fyear) =
+ (localtime($_finishdate) )[0,1,2,3,4,5];
+$fmon++;
+$fyear += 1900;
+
+# Login to the database
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+# Get the needed configuration files
+my $conf = new FS::Conf;
+my $lpr = $conf->config('lpr');
+my $email = $conf->config('email');
+my $smtpmachine = $conf->config('smtpmachine');
+my $mail_sender = $conf->exists('invoice_from') ? $conf->config('invoice_from') :
+ 'postmaster';
+my @report_template = $conf->config('report_template')
+ or die "cannot load config file report_template";
+$report_lines = 0;
+foreach ( grep /report_lines\(\d+\)/, @report_template ) { #kludgy :/
+ /report_lines\((\d+)\)/;
+ $report_lines += $1;
+}
+die "no report_lines() functions in template?" unless $report_lines;
+$report_template = new Text::Template (
+ TYPE => 'ARRAY',
+ SOURCE => [ map "$_\n", @report_template ],
+) or die "can't create new Text::Template object: $Text::Template::ERROR";
+
+
+my(@cust_credits)=qsearch('cust_credit',{});
+if (scalar(@cust_credits) == 0)
+{
+ exit 1;
+}
+
+# Open print and email pipes
+# $lpr and opt_p for printing
+# $email and opt_m for email
+
+if ($lpr && $main::opt_p)
+{
+ open(LPR, "|$lpr");
+}
+
+if ($email && $main::opt_m)
+{
+ $ENV{MAILADDRESS} = $mail_sender;
+ $header = new Mail::Header ( [
+ "From: Account Processor",
+ "To: $email",
+ "Sender: $mail_sender",
+ "Reply-To: $mail_sender",
+ "Subject: In House Credits",
+ ] );
+}
+
+my $uninvoiced = 0;
+my $total = 0;
+my $taxed = 0;
+my $untaxed = 0;
+my $total_tax = 0;
+
+# Now I can start looping
+foreach my $cust_credit (@cust_credits)
+{
+ my $_date = $cust_credit->getfield('_date');
+ my $amount = $cust_credit->getfield('amount');
+
+ if ($_date >= $_startdate && $_date <= $_finishdate) {
+ $total += $amount;
+ }
+}
+
+push @buf, sprintf(qq{\n%25s%14.2f\n}, "Credits Offered", $total);
+push @buf, sprintf(qq{\n%39s\n%39.2f\n}, "=========", $total);
+
+sub FS::credit_report::_template::report_lines {
+ my $lines = shift;
+ map {
+ scalar(@buf) ? shift @buf : '' ;
+ }
+ ( 1 .. $lines );
+}
+
+$FS::credit_report::_template::title = qq~IN HOUSE CREDITS for $smon/$smday/$syear through $fmon/$fmday/$fyear~;
+$FS::credit_report::_template::title = $opt_t if $opt_t;
+$FS::credit_report::_template::page = 1;
+$FS::credit_report::_template::date = $^T;
+$FS::credit_report::_template::date = $^T;
+$FS::credit_report::_template::fdate = $_finishdate;
+$FS::credit_report::_template::fdate = $_finishdate;
+$FS::credit_report::_template::sdate = $_startdate;
+$FS::credit_report::_template::sdate = $_startdate;
+$FS::credit_report::_template::total_pages =
+ int( scalar(@buf) / $report_lines);
+$FS::credit_report::_template::total_pages++ if scalar(@buf) % $report_lines;
+
+my @report;
+while (@buf) {
+ push @report, split("\n",
+ $report_template->fill_in( PACKAGE => 'FS::credit_report::_template' )
+ );
+ $FS::credit_report::_template::page++;
+}
+
+if ($opt_v) {
+ print map "$_\n", @report;
+}
+if($lpr && $opt_p)
+{
+ print LPR map "$_\n", @report;
+ print LPR "\f" if $opt_e;
+ close LPR || die "Could not close printer: $lpr\n";
+}
+if($email && $opt_m)
+{
+ my $message = new Mail::Internet (
+ 'Header' => $header,
+ 'Body' => [ (@report) ],
+ );
+ $!=0;
+ $message->smtpsend( Host => "$smtpmachine" )
+ or die "can't send report to $email via $smtpmachine: $!";
+}
+
+
+# subroutines
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ $ARGV[$_] =~ /^([\w\-\/ :\.]*)$/ || die "Illegal argument \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-credit-report [-v] [-p] [-e] user\n";
+}
+
+=head1 NAME
+
+freeside-credit-report - Prints or emails total credit memos in a given period.
+
+=head1 SYNOPSIS
+
+ freeside-credit-report [-v] [-p] [-m] [-e] [-t "title"] [-s date] [-f date] user
+
+=head1 DESCRIPTION
+
+Prints or emails total credit memos in a given period.
+
+-v: Verbose - Prints records to STDOUT.
+
+-p: Print to printer lpr as found in the conf directory.
+
+-m: Email output to user found in the Conf email file.
+
+-e: Print a final form feed to the printer.
+
+-t: supply a title for the top of each page.
+
+-s: starting date for inclusion
+
+-f: final date for inclusion
+
+user: From the mapsecrets file - see config.html from the base documentation
+
+=head1 VERSION
+
+$Id: freeside-credit-report,v 1.4.4.1 2002-09-09 22:57:32 ivan Exp $
+
+=head1 BUGS
+
+Yes..... Use at your own risk. No guarantees or warrantees of any
+kind apply to this program. Parts of this program are hacked from
+other GNU licensed software created mainly by Ivan Kohler.
+
+This is released under the GNU Public License. See www.gnu.org
+for more information regarding this license.
+
+=head1 SEE ALSO
+
+L<FS::cust_main>, config.html from the base documentation
+
+=head1 AUTHOR
+
+Jeff Finucane <jeff@cmh.net>
+
+based on print-batch by Joel Griffiths <griff@aver-computer.com>
+
+=cut
+
diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily
index 00de2987a..bbb074ffd 100755
--- a/FS/bin/freeside-daily
+++ b/FS/bin/freeside-daily
@@ -120,7 +120,7 @@ the bill and collect methods of a cust_main object. See L<FS::cust_main>.
"pretend date" 15 days from whatever was specified by the -d switch
(or now, if no -d switch was given).
- -p: Only process customers with the specified payby (I<CARD>, I<DCRD>, I<CHEK>, I<DCHK>, I<BILL>, I<COMP>, I<LECB>)
+ -p: Only process customers with the specified payby (I<CARD>, I<CHEK>, I<BILL>, I<COMP>, I<LECB>)
-s: re-charge setup fees
diff --git a/FS/bin/freeside-email b/FS/bin/freeside-email
index 400dc2ac7..c7ff41114 100755
--- a/FS/bin/freeside-email
+++ b/FS/bin/freeside-email
@@ -12,9 +12,11 @@ my $user = shift or die &usage;
adminsuidsetup $user;
my $conf = new FS::Conf;
+my $domain = $conf->config('domain');
my @svc_acct = qsearch('svc_acct', {});
-my @emails = map $_->email, @svc_acct;
+my @usernames = map $_->username, @svc_acct;
+my @emails = map "$_\@$domain", @usernames;
print join("\n", @emails), "\n";
@@ -49,7 +51,7 @@ user: From the mapsecrets file - see config.html from the base documentation
=head1 VERSION
-$Id: freeside-email,v 1.2 2002-09-18 22:50:44 ivan Exp $
+$Id: freeside-email,v 1.1 2001-05-15 07:52:34 ivan Exp $
=head1 BUGS
diff --git a/FS/bin/freeside-expiration-alerter b/FS/bin/freeside-expiration-alerter
index 691fd3aa5..2c89bef20 100755
--- a/FS/bin/freeside-expiration-alerter
+++ b/FS/bin/freeside-expiration-alerter
@@ -97,7 +97,7 @@ foreach my $customer (@customers)
my $expire_time = timelocal(0,0,0,$payday,--$paymonth,$payyear);
#credit cards expire at the end of the month/year of their exp date
- if ($payby eq 'CARD' || $payby eq 'DCRD') {
+ if ($payby eq 'CARD') {
($paymonth < 11) ? $paymonth++ : ($paymonth=0, $payyear++);
$expire_time = timelocal(0,0,0,$payday,$paymonth,$payyear);
$expire_time--;
@@ -127,7 +127,7 @@ foreach my $customer (@customers)
$FS::alerter::_template::first = $first;
$FS::alerter::_template::last = $last;
$FS::alerter::_template::company = $company;
- if ($payby eq 'CARD' || $payby eq 'DCRD') {
+ if ($payby eq 'CARD') {
$FS::alerter::_template::payby = "credit card (" .
substr($payinfo, 0, 2) . "xxxxxxxxxx" .
substr($payinfo, -4) . ")";
@@ -202,7 +202,7 @@ user: From the mapsecrets file - see config.html from the base documentation
=head1 VERSION
-$Id: freeside-expiration-alerter,v 1.5 2003-04-21 20:53:57 ivan Exp $
+$Id: freeside-expiration-alerter,v 1.3.4.1 2002-09-16 09:27:12 ivan Exp $
=head1 BUGS
diff --git a/FS/bin/freeside-overdue b/FS/bin/freeside-overdue
new file mode 100755
index 000000000..116245f9c
--- /dev/null
+++ b/FS/bin/freeside-overdue
@@ -0,0 +1,196 @@
+#!/usr/bin/perl -w
+
+use strict;
+use vars qw( $days_to_pay $cust_main $cust_pkg
+ $cust_svc $svc_acct );
+use Getopt::Std;
+use FS::cust_main;
+use FS::cust_pkg;
+use FS::cust_svc;
+use FS::svc_acct;
+use FS::Record qw(qsearch qsearchs);
+use FS::UID qw(adminsuidsetup);
+
+&untaint_argv;
+my %opt;
+getopts('ed:qpl:scbyoi', \%opt);
+my $user = shift or die &usage;
+
+adminsuidsetup $user;
+
+my $now = time; #eventually take a time option like freeside-bill
+my ($sec,$min,$hour,$mday,$mon,$year) =
+ (localtime($now) )[0,1,2,3,4,5];
+$mon++;
+$year += 1900;
+
+foreach $cust_main ( qsearch('cust_main',{} ) ) {
+
+ my ( $eyear, $emon, $eday ) = ( 2037, 12, 31 );
+ if ( $cust_main->paydate =~ /^(\d{4})\-(\d{1,2})\-(\d{1,2})$/
+ && $cust_main->payby eq 'BILL') {
+ ( $eyear, $emon, $eday ) = ( $1, $2, $3 );
+ }
+
+ if ( ( $opt{d}
+ && $cust_main->balance_date(time - $opt{d} * 86400) > 0
+ && qsearchs( 'cust_pkg', { 'custnum' => $cust_main->custnum,
+ 'susp' => "" } ) )
+ || ( $opt{e}
+ && $cust_main->payby eq 'BILL'
+ && ( $eyear < $year
+ || ( $eyear == $year && $emon < $mon ) ) )
+ ) {
+
+ unless ( $opt{q} ) {
+ print $cust_main->custnum, "\t",
+ $cust_main->last, "\t", $cust_main->first, "\t",
+ $cust_main->balance_date(time-$opt{d} * 86400);
+ }
+
+ if ( $opt{p} && ! grep { $_ eq 'POST' } $cust_main->invoicing_list ) {
+ print "\n\tAdding postal invoicing" unless $opt{q};
+ my @invoicing_list = $cust_main->invoicing_list;
+ push @invoicing_list, 'POST';
+ $cust_main->invoicing_list(\@invoicing_list);
+ }
+
+ if ( $opt{l} ) {
+ print "\n\tCharging late fee of \$$opt{l}" unless $opt{q};
+ my $error = $cust_main->charge($opt{l}, 'Late fee');
+ # comment or plandata with info so we don't redo the same late fee every
+ # day
+ }
+
+ foreach $cust_pkg ( qsearch( 'cust_pkg',
+ { 'custnum' => $cust_main->custnum } ) ) {
+
+ if ($opt{s}) {
+ print "\n\tSuspending pkgnum " . $cust_pkg->pkgnum unless $opt{q};
+ $cust_pkg->suspend;
+ }
+
+ if ($opt{c}) {
+ print "\n\tCancelling pkgnum " . $cust_pkg->pkgnum unless $opt{q};
+ $cust_pkg->cancel;
+ }
+
+ }
+
+ if ( $opt{b} ) {
+ print "\n\tBilling" unless $opt{q};
+ my $error = $cust_main->bill('time'=>$now);
+ warn "Error billing, customer #" . $cust_main->custnum .
+ ":" . $error if $error;
+ }
+
+ if ( $opt{y} ) {
+ print "\n\tApplying outstanding payments and credits" unless $opt{q};
+ $cust_main->apply_payments;
+ $cust_main->apply_credits;
+ }
+
+ if ( $opt{o} ) {
+ print "\n\tCollecting" unless $opt{q};
+ my $error = $cust_main->collect(
+ 'invoice_time' => $now,
+ 'batch_card' => $opt{i} ? 'no' : 'yes',
+ 'force_print' => 'yes',
+ );
+ warn "Error collecting from customer #" . $cust_main->custnum. ":$error"
+ if $error;
+ }
+
+ print "\n" unless $opt{q};
+
+ }
+
+}
+
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) {
+ $ARGV[$_] =~ /^([\w\-\/\.]*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-overdue [ -e ] [ -d days ] [ -q ] [ -p ] [ -l amount ] [ -s ] [ -c ] [ -b ] [ -y ] [ -o [ -i ] ] user\n";
+}
+
+
+=head1 NAME
+
+freeside-overdue - Perform actions on overdue and/or expired accounts.
+
+=head1 SYNOPSIS
+
+ freeside-overdue [ -e ] [ -d days ] [ -q ] [ -p ] [ -l amount ] [ -s ] [ -c ] [ -b ] [ -y ] [ -o [ -i ] ] user
+
+=head1 DESCRIPTION
+
+This script is deprecated in 1.4.0. You should use freeside-daily and invoice
+events instead.
+
+Performs actions on overdue and/or expired accounts.
+
+Selection options (at least one selection option is required):
+
+ -d: Customers with a balance due on invoices older than the supplied number
+ of days. Requires an integer argument.
+
+ -e: Customers with a billing expiration date in the past.
+
+Action options:
+
+ -q: Be quiet (by default, selected accounts are printed).
+
+ -p: Add postal invoicing to the relevant customers.
+
+ -l: Add a charge of the given amount to the relevant customers.
+
+ -s: Suspend accounts.
+
+ -c: Cancel accounts.
+
+ -b: Bill customers (create invoices)
+
+ -y: Apply unapplied payments and credits
+
+ -o: Collect from customers (charge cards, print invoices)
+
+ -i: real-time billing (as opposed to batch billing). only relevant
+ for credit cards.
+
+ user: From the mapsecrets file - see config.html from the base documentation
+
+=head1 CRONTAB
+
+Example crontab entries:
+
+# suspend expired accounts
+20 4 * * * freeside-overdue -e -s user
+
+# quietly add postal invoicing to customers over 30 days past due
+20 4 * * * freeside-overdue -d 30 -p -q user
+
+# suspend accounts and charge a $10.23 fee for customers over 60 days past due
+20 4 * * * freeside-overdue -d 60 -s -l 10.23 user
+
+# cancel accounts over 90 days past due
+20 4 * * * freeside-overdue -d 90 -c user
+
+=head1 ORIGINAL AUTHORS
+
+Original disable-overdue version by mw/kwh: Mark W.? and Kristian Hoffmann ?
+
+Ivan seems to be turning it into the "do-everything" CLI.
+
+=head1 BUGS
+
+Hell now that this is the do-everything CLI it should have --longoptions
+
+=cut
+
+1;
+
diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup
index 522c0a1a2..65e67b5a7 100755
--- a/FS/bin/freeside-setup
+++ b/FS/bin/freeside-setup
@@ -9,7 +9,7 @@ use Getopt::Std;
use Locale::Country;
use Locale::SubCountry;
use DBI;
-use DBIx::DBSchema 0.21;
+use DBIx::DBSchema 0.20;
use DBIx::DBSchema::Table;
use DBIx::DBSchema::Column;
use DBIx::DBSchema::ColGroup::Unique;
@@ -113,9 +113,8 @@ my($dbdef) = new DBIx::DBSchema ( map {
my $cust_main = $dbdef->table('cust_main');
unless ($ship) { #remove ship_ from cust_main
$cust_main->delcolumn($_) foreach ( grep /^ship_/, $cust_main->columns );
-} else { #add indices
- push @{$cust_main->index->lol_ref},
- map { [ "ship_$_" ] } qw( last company daytime night fax );
+} else { #add indices on ship_last and ship_company
+ push @{$cust_main->index->lol_ref}, ( ['ship_last'], ['ship_company'] )
}
#add radius attributes to svc_acct
@@ -141,6 +140,33 @@ foreach $attribute (@check_attributes) {
));
}
+##make part_svc table (but now as object)
+#
+#my($part_svc)=$dbdef->table('part_svc');
+#
+##because of svc_acct_pop
+##foreach (grep /^svc_/, $dbdef->tables) {
+##foreach (qw(svc_acct svc_acct_sm svc_charge svc_domain svc_wo)) {
+#foreach (qw(svc_acct svc_domain svc_forward svc_www)) {
+# my($table)=$dbdef->table($_);
+# my($col);
+# foreach $col ( $table->columns ) {
+# next if $col =~ /^svcnum$/;
+# $part_svc->addcolumn( new DBIx::DBSchema::Column (
+# $table->name. '__' . $table->column($col)->name,
+# 'varchar', #$table->column($col)->type,
+# 'NULL',
+# $char_d, #$table->column($col)->length,
+# ));
+# $part_svc->addcolumn ( new DBIx::DBSchema::Column (
+# $table->name. '__'. $table->column($col)->name . "_flag",
+# 'char',
+# 'NULL',
+# 1,
+# ));
+# }
+#}
+
#create history tables (false laziness w/create-history-tables)
foreach my $table ( grep { ! /^h_/ } $dbdef->tables ) {
my $tableobj = $dbdef->table($table)
@@ -192,23 +218,7 @@ foreach my $table ( grep { ! /^h_/ } $dbdef->tables ) {
'default' => '',
'local' => '',
} ),
- map {
- my $column = $tableobj->column($_);
-
- #clone so as to not disturb the original
- $column = DBIx::DBSchema::Column->new( {
- map { $_ => $column->$_() }
- qw( name type null length default local )
- } );
-
- $column->type('int')
- if $column->type eq 'serial';
- #$column->default('')
- # if $column->default =~ /^nextval\(/i;
- #( my $local = $column->local ) =~ s/AUTO_INCREMENT//i;
- #$column->local($local);
- $column;
- } $tableobj->columns
+ map { $tableobj->column($_) } $tableobj->columns
],
} );
$dbdef->addtable($h_tableobj);
@@ -273,8 +283,6 @@ foreach my $aref (
[ 'COMP', 'Comp invoice', '$cust_bill->comp();', 30, 'comp' ],
[ 'CARD', 'Batch card', '$cust_bill->batch_card();', 40, 'batch-card' ],
[ 'BILL', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
- [ 'DCRD', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
- [ 'DCHK', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
) {
my $part_bill_event = new FS::part_bill_event({
@@ -313,23 +321,20 @@ sub tables_hash_hack {
'agent' => {
'columns' => [
- 'agentnum', 'serial', '', '',
+ 'agentnum', 'int', '', '',
'agent', 'varchar', '', $char_d,
'typenum', 'int', '', '',
'freq', 'int', 'NULL', '',
'prog', @perl_type,
- 'disabled', 'char', 'NULL', 1,
- 'username', 'varchar', 'NULL', $char_d,
- '_password','varchar', 'NULL', $char_d,
],
'primary_key' => 'agentnum',
'unique' => [],
- 'index' => [ ['typenum'], ['disabled'] ],
+ 'index' => [ ['typenum'] ],
},
'agent_type' => {
'columns' => [
- 'typenum', 'serial', '', '',
+ 'typenum', 'int', '', '',
'atype', 'varchar', '', $char_d,
],
'primary_key' => 'typenum',
@@ -349,7 +354,7 @@ sub tables_hash_hack {
'cust_bill' => {
'columns' => [
- 'invnum', 'serial', '', '',
+ 'invnum', 'int', '', '',
'custnum', 'int', '', '',
'_date', @date_type,
'charged', @money_type,
@@ -363,7 +368,7 @@ sub tables_hash_hack {
'cust_bill_event' => {
'columns' => [
- 'eventnum', 'serial', '', '',
+ 'eventnum', 'int', '', '',
'invnum', 'int', '', '',
'eventpart', 'int', '', '',
'_date', @date_type,
@@ -378,7 +383,7 @@ sub tables_hash_hack {
'part_bill_event' => {
'columns' => [
- 'eventpart', 'serial', '', '',
+ 'eventpart', 'int', '', '',
'payby', 'char', '', 4,
'event', 'varchar', '', $char_d,
'eventcode', @perl_type,
@@ -390,7 +395,7 @@ sub tables_hash_hack {
],
'primary_key' => 'eventpart',
'unique' => [],
- 'index' => [ ['payby'], ['disabled'], ],
+ 'index' => [ ['payby'] ],
},
'cust_bill_pkg' => {
@@ -401,28 +406,15 @@ sub tables_hash_hack {
'recur', @money_type,
'sdate', @date_type,
'edate', @date_type,
- 'itemdesc', 'varchar', 'NULL', $char_d,
],
'primary_key' => '',
- 'unique' => [],
+ 'unique' => [ ['pkgnum', 'invnum'] ],
'index' => [ ['invnum'] ],
},
- 'cust_bill_pkg_detail' => {
- 'columns' => [
- 'detailnum', 'serial', '', '',
- 'pkgnum', 'int', '', '',
- 'invnum', 'int', '', '',
- 'detail', 'varchar', '', $char_d,
- ],
- 'primary_key' => 'detailnum',
- 'unique' => [],
- 'index' => [ [ 'pkgnum', 'invnum' ] ],
- },
-
'cust_credit' => {
'columns' => [
- 'crednum', 'serial', '', '',
+ 'crednum', 'int', '', '',
'custnum', 'int', '', '',
'_date', @date_type,
'amount', @money_type,
@@ -437,7 +429,7 @@ sub tables_hash_hack {
'cust_credit_bill' => {
'columns' => [
- 'creditbillnum', 'serial', '', '',
+ 'creditbillnum', 'int', '', '',
'crednum', 'int', '', '',
'invnum', 'int', '', '',
'_date', @date_type,
@@ -450,7 +442,7 @@ sub tables_hash_hack {
'cust_main' => {
'columns' => [
- 'custnum', 'serial', '', '',
+ 'custnum', 'int', '', '',
'agentnum', 'int', '', '',
# 'titlenum', 'int', 'NULL', '',
'last', 'varchar', '', $char_d,
@@ -484,12 +476,11 @@ sub tables_hash_hack {
'ship_fax', 'varchar', 'NULL', 12,
'payby', 'char', '', 4,
'payinfo', 'varchar', 'NULL', $char_d,
- 'paycvv', 'varchar', 'NULL', 4,
#'paydate', @date_type,
'paydate', 'varchar', 'NULL', 10,
'payname', 'varchar', 'NULL', $char_d,
'tax', 'char', 'NULL', 1,
- 'otaker', 'varchar', '', 32,
+ 'otaker', 'varchar', '', 32,
'refnum', 'int', '', '',
'referral_custnum', 'int', 'NULL', '',
'comments', 'text', 'NULL', '',
@@ -497,14 +488,12 @@ sub tables_hash_hack {
'primary_key' => 'custnum',
'unique' => [],
#'index' => [ ['last'], ['company'] ],
- 'index' => [ ['last'], [ 'company' ], [ 'referral_custnum' ],
- [ 'daytime' ], [ 'night' ], [ 'fax' ],
- ],
+ 'index' => [ ['last'], [ 'company' ], [ 'referral_custnum' ] ],
},
'cust_main_invoice' => {
'columns' => [
- 'destnum', 'serial', '', '',
+ 'destnum', 'int', '', '',
'custnum', 'int', '', '',
'dest', 'varchar', '', $char_d,
],
@@ -517,16 +506,13 @@ sub tables_hash_hack {
#cust_main_county for validation and to provide
# a tax rate.
'columns' => [
- 'taxnum', 'serial', '', '',
+ 'taxnum', 'int', '', '',
'state', 'varchar', 'NULL', $char_d,
'county', 'varchar', 'NULL', $char_d,
'country', 'char', '', 2,
'taxclass', 'varchar', 'NULL', $char_d,
'exempt_amount', @money_type,
'tax', 'real', '', '', #tax %
- 'taxname', 'varchar', 'NULL', $char_d,
- 'setuptax', 'char', 'NULL', 1, # Y = setup tax exempt
- 'recurtax', 'char', 'NULL', 1, # Y = recur tax exempt
],
'primary_key' => 'taxnum',
'unique' => [],
@@ -536,7 +522,7 @@ sub tables_hash_hack {
'cust_pay' => {
'columns' => [
- 'paynum', 'serial', '', '',
+ 'paynum', 'int', '', '',
#now cust_bill_pay #'invnum', 'int', '', '',
'custnum', 'int', '', '',
'paid', @money_type,
@@ -549,12 +535,12 @@ sub tables_hash_hack {
],
'primary_key' => 'paynum',
'unique' => [],
- 'index' => [ [ 'custnum' ], [ 'paybatch' ], [ 'payby' ], [ '_date' ] ],
+ 'index' => [ [ 'custnum' ], [ 'paybatch' ] ],
},
'cust_bill_pay' => {
'columns' => [
- 'billpaynum', 'serial', '', '',
+ 'billpaynum', 'int', '', '',
'invnum', 'int', '', '',
'paynum', 'int', '', '',
'amount', @money_type,
@@ -568,7 +554,7 @@ sub tables_hash_hack {
'cust_pay_batch' => { #what's this used for again? list of customers
#in current CARD batch? (necessarily CARD?)
'columns' => [
- 'paybatchnum', 'serial', '', '',
+ 'paybatchnum', 'int', '', '',
'invnum', 'int', '', '',
'custnum', 'int', '', '',
'last', 'varchar', '', $char_d,
@@ -593,13 +579,12 @@ sub tables_hash_hack {
'cust_pkg' => {
'columns' => [
- 'pkgnum', 'serial', '', '',
+ 'pkgnum', 'int', '', '',
'custnum', 'int', '', '',
'pkgpart', 'int', '', '',
'otaker', 'varchar', '', 32,
'setup', @date_type,
'bill', @date_type,
- 'last_bill', @date_type,
'susp', @date_type,
'cancel', @date_type,
'expire', @date_type,
@@ -612,7 +597,7 @@ sub tables_hash_hack {
'cust_refund' => {
'columns' => [
- 'refundnum', 'serial', '', '',
+ 'refundnum', 'int', '', '',
#now cust_credit_refund #'crednum', 'int', '', '',
'custnum', 'int', '', '',
'_date', @date_type,
@@ -632,7 +617,7 @@ sub tables_hash_hack {
'cust_credit_refund' => {
'columns' => [
- 'creditrefundnum', 'serial', '', '',
+ 'creditrefundnum', 'int', '', '',
'crednum', 'int', '', '',
'refundnum', 'int', '', '',
'amount', @money_type,
@@ -646,7 +631,7 @@ sub tables_hash_hack {
'cust_svc' => {
'columns' => [
- 'svcnum', 'serial', '', '',
+ 'svcnum', 'int', '', '',
'pkgnum', 'int', 'NULL', '',
'svcpart', 'int', '', '',
],
@@ -657,11 +642,11 @@ sub tables_hash_hack {
'part_pkg' => {
'columns' => [
- 'pkgpart', 'serial', '', '',
+ 'pkgpart', 'int', '', '',
'pkg', 'varchar', '', $char_d,
'comment', 'varchar', '', $char_d,
'setup', @perl_type,
- 'freq', 'varchar', '', $char_d, #billing frequency
+ 'freq', 'int', '', '', #billing frequency (months)
'recur', @perl_type,
'setuptax', 'char', 'NULL', 1,
'recurtax', 'char', 'NULL', 1,
@@ -690,7 +675,6 @@ sub tables_hash_hack {
'pkgpart', 'int', '', '',
'svcpart', 'int', '', '',
'quantity', 'int', '', '',
- 'primary_svc','char', 'NULL', 1,
],
'primary_key' => '',
'unique' => [ ['pkgpart', 'svcpart'] ],
@@ -699,18 +683,17 @@ sub tables_hash_hack {
'part_referral' => {
'columns' => [
- 'refnum', 'serial', '', '',
+ 'refnum', 'int', '', '',
'referral', 'varchar', '', $char_d,
- 'disabled', 'char', 'NULL', 1,
],
'primary_key' => 'refnum',
'unique' => [],
- 'index' => [ ['disabled'] ],
+ 'index' => [],
},
'part_svc' => {
'columns' => [
- 'svcpart', 'serial', '', '',
+ 'svcpart', 'int', '', '',
'svc', 'varchar', '', $char_d,
'svcdb', 'varchar', '', $char_d,
'disabled', 'char', 'NULL', 1,
@@ -722,7 +705,7 @@ sub tables_hash_hack {
'part_svc_column' => {
'columns' => [
- 'columnnum', 'serial', '', '',
+ 'columnnum', 'int', '', '',
'svcpart', 'int', '', '',
'columnname', 'varchar', '', 64,
'columnvalue', 'varchar', 'NULL', $char_d,
@@ -736,7 +719,7 @@ sub tables_hash_hack {
#(this should be renamed to part_pop)
'svc_acct_pop' => {
'columns' => [
- 'popnum', 'serial', '', '',
+ 'popnum', 'int', '', '',
'city', 'varchar', '', $char_d,
'state', 'varchar', '', $char_d,
'ac', 'char', '', 3,
@@ -750,7 +733,7 @@ sub tables_hash_hack {
'part_pop_local' => {
'columns' => [
- 'localnum', 'serial', '', '',
+ 'localnum', 'int', '', '',
'popnum', 'int', '', '',
'city', 'varchar', 'NULL', $char_d,
'state', 'char', 'NULL', 2,
@@ -785,6 +768,18 @@ sub tables_hash_hack {
'index' => [ ['username'], ['domsvc'] ],
},
+# 'svc_acct_sm' => {
+# 'columns' => [
+# 'svcnum', 'int', '', '',
+# 'domsvc', 'int', '', '',
+# 'domuid', 'int', '', '',
+# 'domuser', 'varchar', '', $char_d,
+# ],
+# 'primary_key' => 'svcnum',
+# 'unique' => [ [] ],
+# 'index' => [ ['domsvc'], ['domuid'] ],
+# },
+
#'svc_charge' => {
# 'columns' => [
# 'svcnum', 'int', '', '',
@@ -808,13 +803,11 @@ sub tables_hash_hack {
'domain_record' => {
'columns' => [
- 'recnum', 'serial', '', '',
+ 'recnum', 'int', '', '',
'svcnum', 'int', '', '',
- #'reczone', 'varchar', '', $char_d,
'reczone', 'varchar', '', 255,
'recaf', 'char', '', 2,
- 'rectype', 'varchar', '', 5,
- #'recdata', 'varchar', '', $char_d,
+ 'rectype', 'varchar', '', 5,
'recdata', 'varchar', '', 255,
],
'primary_key' => 'recnum',
@@ -824,11 +817,10 @@ sub tables_hash_hack {
'svc_forward' => {
'columns' => [
- 'svcnum', 'int', '', '',
- 'srcsvc', 'int', 'NULL', '',
- 'src', 'varchar', 'NULL', 255,
- 'dstsvc', 'int', 'NULL', '',
- 'dst', 'varchar', 'NULL', 255,
+ 'svcnum', 'int', '', '',
+ 'srcsvc', 'int', '', '',
+ 'dstsvc', 'int', '', '',
+ 'dst', 'varchar', 'NULL', $char_d,
],
'primary_key' => 'svcnum',
'unique' => [],
@@ -861,7 +853,7 @@ sub tables_hash_hack {
'prepay_credit' => {
'columns' => [
- 'prepaynum', 'serial', '', '',
+ 'prepaynum', 'int', '', '',
'identifier', 'varchar', '', $char_d,
'amount', @money_type,
'seconds', 'int', 'NULL', '',
@@ -873,7 +865,7 @@ sub tables_hash_hack {
'port' => {
'columns' => [
- 'portnum', 'serial', '', '',
+ 'portnum', 'int', '', '',
'ip', 'varchar', 'NULL', 15,
'nasport', 'int', 'NULL', '',
'nasnum', 'int', '', '',
@@ -885,7 +877,7 @@ sub tables_hash_hack {
'nas' => {
'columns' => [
- 'nasnum', 'serial', '', '',
+ 'nasnum', 'int', '', '',
'nas', 'varchar', '', $char_d,
'nasip', 'varchar', '', 15,
'nasfqdn', 'varchar', '', $char_d,
@@ -898,7 +890,7 @@ sub tables_hash_hack {
'session' => {
'columns' => [
- 'sessionnum', 'serial', '', '',
+ 'sessionnum', 'int', '', '',
'portnum', 'int', '', '',
'svcnum', 'int', '', '',
'login', @date_type,
@@ -911,7 +903,7 @@ sub tables_hash_hack {
'queue' => {
'columns' => [
- 'jobnum', 'serial', '', '',
+ 'jobnum', 'int', '', '',
'job', 'text', '', '',
'_date', 'int', '', '',
'status', 'varchar', '', $char_d,
@@ -925,7 +917,7 @@ sub tables_hash_hack {
'queue_arg' => {
'columns' => [
- 'argnum', 'serial', '', '',
+ 'argnum', 'int', '', '',
'jobnum', 'int', '', '',
'arg', 'text', 'NULL', '',
],
@@ -936,7 +928,7 @@ sub tables_hash_hack {
'queue_depend' => {
'columns' => [
- 'dependnum', 'serial', '', '',
+ 'dependnum', 'int', '', '',
'jobnum', 'int', '', '',
'depend_jobnum', 'int', '', '',
],
@@ -947,7 +939,7 @@ sub tables_hash_hack {
'export_svc' => {
'columns' => [
- 'exportsvcnum' => 'serial', '', '',
+ 'exportsvcnum' => 'int', '', '',
'exportnum' => 'int', '', '',
'svcpart' => 'int', '', '',
],
@@ -958,7 +950,7 @@ sub tables_hash_hack {
'part_export' => {
'columns' => [
- 'exportnum', 'serial', '', '',
+ 'exportnum', 'int', '', '',
#'svcpart', 'int', '', '',
'machine', 'varchar', '', $char_d,
'exporttype', 'varchar', '', $char_d,
@@ -971,7 +963,7 @@ sub tables_hash_hack {
'part_export_option' => {
'columns' => [
- 'optionnum', 'serial', '', '',
+ 'optionnum', 'int', '', '',
'exportnum', 'int', '', '',
'optionname', 'varchar', '', $char_d,
'optionvalue', 'text', 'NULL', '',
@@ -983,7 +975,7 @@ sub tables_hash_hack {
'radius_usergroup' => {
'columns' => [
- 'usergroupnum', 'serial', '', '',
+ 'usergroupnum', 'int', '', '',
'svcnum', 'int', '', '',
'groupname', 'varchar', '', $char_d,
],
@@ -994,7 +986,7 @@ sub tables_hash_hack {
'msgcat' => {
'columns' => [
- 'msgnum', 'serial', '', '',
+ 'msgnum', 'int', '', '',
'msgcode', 'varchar', '', $char_d,
'locale', 'varchar', '', 16,
'msg', 'text', '', '',
@@ -1006,7 +998,7 @@ sub tables_hash_hack {
'cust_tax_exempt' => {
'columns' => [
- 'exemptnum', 'serial', '', '',
+ 'exemptnum', 'int', '', '',
'custnum', 'int', '', '',
'taxnum', 'int', '', '',
'year', 'int', '', '',
@@ -1018,102 +1010,7 @@ sub tables_hash_hack {
'index' => [],
},
- 'router' => {
- 'columns' => [
- 'routernum', 'serial', '', '',
- 'routername', 'varchar', '', $char_d,
- 'svcnum', 'int', 'NULL', '',
- ],
- 'primary_key' => 'routernum',
- 'unique' => [],
- 'index' => [],
- },
-
- 'part_svc_router' => {
- 'columns' => [
- 'svcpart', 'int', '', '',
- 'routernum', 'int', '', '',
- ],
- 'primary_key' => '',
- 'unique' => [],
- 'index' => [],
- },
-
- 'addr_block' => {
- 'columns' => [
- 'blocknum', 'serial', '', '',
- 'routernum', 'int', '', '',
- 'ip_gateway', 'varchar', '', 15,
- 'ip_netmask', 'int', '', '',
- ],
- 'primary_key' => 'blocknum',
- 'unique' => [ [ 'blocknum', 'routernum' ] ],
- 'index' => [],
- },
-
- 'svc_broadband' => {
- 'columns' => [
- 'svcnum', 'int', '', '',
- 'blocknum', 'int', '', '',
- 'speed_up', 'int', '', '',
- 'speed_down', 'int', '', '',
- 'ip_addr', 'varchar', '', 15,
- ],
- 'primary_key' => 'svcnum',
- 'unique' => [],
- 'index' => [],
- },
- 'part_virtual_field' => {
- 'columns' => [
- 'vfieldpart', 'int', '', '',
- 'dbtable', 'varchar', '', 32,
- 'name', 'varchar', '', 32,
- 'check_block', 'text', 'NULL', '',
- 'length', 'int', 'NULL', '',
- 'list_source', 'text', 'NULL', '',
- 'label', 'varchar', 'NULL', 80,
- ],
- 'primary_key' => 'vfieldpart',
- 'unique' => [],
- 'index' => [],
- },
-
- 'virtual_field' => {
- 'columns' => [
- 'recnum', 'int', '', '',
- 'vfieldpart', 'int', '', '',
- 'value', 'varchar', '', 128,
- ],
- 'primary_key' => '',
- 'unique' => [ [ 'vfieldpart', 'recnum' ] ],
- 'index' => [],
- },
-
- 'acct_snarf' => {
- 'columns' => [
- 'snarfnum', 'int', '', '',
- 'svcnum', 'int', '', '',
- 'machine', 'varchar', '', 255,
- 'protocol', 'varchar', '', $char_d,
- 'username', 'varchar', '', $char_d,
- '_password', 'varchar', '', $char_d,
- ],
- 'primary_key' => 'snarfnum',
- 'unique' => [],
- 'index' => [ [ 'svcnum' ] ],
- },
-
- 'svc_external' => {
- 'columns' => [
- 'svcnum', 'int', '', '',
- 'id', 'int', '', '',
- 'title', 'varchar', 'NULL', $char_d,
- ],
- 'primary_key' => 'svcnum',
- 'unique' => [],
- 'index' => [],
- },
);
diff --git a/FS/bin/freeside-tax-report b/FS/bin/freeside-tax-report
index 240f3ad37..d48da87a6 100755
--- a/FS/bin/freeside-tax-report
+++ b/FS/bin/freeside-tax-report
@@ -267,7 +267,7 @@ user: From the mapsecrets file - see config.html from the base documentation
=head1 VERSION
-$Id: freeside-tax-report,v 1.5 2002-09-09 22:57:34 ivan Exp $
+$Id: freeside-tax-report,v 1.4.4.1 2002-09-09 22:57:32 ivan Exp $
=head1 BUGS