diff options
Diffstat (limited to 'FS/bin')
| -rw-r--r-- | FS/bin/freeside-adduser | 6 | ||||
| -rwxr-xr-x | FS/bin/freeside-cc-receipts-report | 2 | ||||
| -rwxr-xr-x | FS/bin/freeside-credit-report | 2 | ||||
| -rwxr-xr-x | FS/bin/freeside-daily | 2 | ||||
| -rwxr-xr-x | FS/bin/freeside-email | 6 | ||||
| -rwxr-xr-x | FS/bin/freeside-expiration-alerter | 6 | ||||
| -rwxr-xr-x | FS/bin/freeside-overdue | 196 | ||||
| -rwxr-xr-x | FS/bin/freeside-setup | 291 | ||||
| -rwxr-xr-x | FS/bin/freeside-tax-report | 2 | 
9 files changed, 304 insertions, 209 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 index 136851aec..f4225d28a 100755 --- a/FS/bin/freeside-cc-receipts-report +++ b/FS/bin/freeside-cc-receipts-report @@ -245,7 +245,7 @@ user: From the mapsecrets file - see config.html from the base documentation  =head1 VERSION -$Id: freeside-cc-receipts-report,v 1.5 2002-09-09 22:57:34 ivan Exp $ +$Id: freeside-cc-receipts-report,v 1.4.4.1 2002-09-09 22:57:32 ivan Exp $  =head1 BUGS diff --git a/FS/bin/freeside-credit-report b/FS/bin/freeside-credit-report index 410dabe8f..da01d3bd5 100755 --- a/FS/bin/freeside-credit-report +++ b/FS/bin/freeside-credit-report @@ -199,7 +199,7 @@ user: From the mapsecrets file - see config.html from the base documentation  =head1 VERSION -$Id: freeside-credit-report,v 1.5 2002-09-09 22:57:34 ivan Exp $ +$Id: freeside-credit-report,v 1.4.4.1 2002-09-09 22:57:32 ivan Exp $  =head1 BUGS diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index 5fb966665..9ff21d421 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 b7a414ae2..213dcb947 100755 --- a/FS/bin/freeside-setup +++ b/FS/bin/freeside-setup @@ -7,7 +7,7 @@ use strict;  use vars qw($opt_s);  use Getopt::Std;  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; @@ -111,9 +111,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 @@ -139,6 +138,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) @@ -190,23 +216,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); @@ -291,8 +301,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({ @@ -331,23 +339,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', @@ -367,7 +372,7 @@ sub tables_hash_hack {      'cust_bill' => {        'columns' => [ -        'invnum',    'serial',  '', '', +        'invnum',    'int',  '', '',          'custnum',   'int',  '', '',          '_date',     @date_type,          'charged',   @money_type, @@ -381,7 +386,7 @@ sub tables_hash_hack {      'cust_bill_event' => {        'columns' => [ -        'eventnum',    'serial',  '', '', +        'eventnum',    'int',  '', '',          'invnum',   'int',  '', '',          'eventpart',   'int',  '', '',          '_date',     @date_type, @@ -396,7 +401,7 @@ sub tables_hash_hack {      'part_bill_event' => {        'columns' => [ -        'eventpart',    'serial',  '', '', +        'eventpart',    'int',  '', '',          'payby',       'char',  '', 4,          'event',       'varchar',           '',     $char_d,          'eventcode',    @perl_type, @@ -408,7 +413,7 @@ sub tables_hash_hack {        ],        'primary_key' => 'eventpart',        'unique' => [], -      'index' => [ ['payby'], ['disabled'], ], +      'index' => [ ['payby'] ],      },      'cust_bill_pkg' => { @@ -419,32 +424,19 @@ 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, -        'otaker',   'varchar', '', 32, +        'otaker',   'varchar', '', 8,          'reason',   'text', 'NULL', '',          'closed',    'char', 'NULL', 1,        ], @@ -455,7 +447,7 @@ sub tables_hash_hack {      'cust_credit_bill' => {        'columns' => [ -        'creditbillnum', 'serial', '', '', +        'creditbillnum', 'int', '', '',          'crednum',  'int', '', '',          'invnum',  'int', '', '',          '_date',    @date_type, @@ -468,13 +460,13 @@ sub tables_hash_hack {      'cust_main' => {        'columns' => [ -        'custnum',  'serial',  '',     '', +        'custnum',  'int',  '',     '',          'agentnum', 'int',  '',     '',  #        'titlenum', 'int',  'NULL',   '',          'last',     'varchar', '',     $char_d,  #        'middle',   'varchar', 'NULL', $char_d,          'first',    'varchar', '',     $char_d, -        'ss',       'varchar', 'NULL', 11, +        'ss',       'char', 'NULL', 11,          'company',  'varchar', 'NULL', $char_d,          'address1', 'varchar', '',     $char_d,          'address2', 'varchar', 'NULL', $char_d, @@ -502,12 +494,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', '',     8,          'refnum',   'int',  '',     '',          'referral_custnum', 'int',  'NULL', '',          'comments', 'text', 'NULL', '', @@ -515,14 +506,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,        ], @@ -535,16 +524,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' => [], @@ -554,7 +540,7 @@ sub tables_hash_hack {      'cust_pay' => {        'columns' => [ -        'paynum',   'serial',    '',   '', +        'paynum',   'int',    '',   '',          #now cust_bill_pay #'invnum',   'int',    '',   '',          'custnum',  'int',    '',   '',          'paid',     @money_type, @@ -567,12 +553,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, @@ -586,7 +572,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, @@ -611,13 +597,12 @@ sub tables_hash_hack {      'cust_pkg' => {        'columns' => [ -        'pkgnum',    'serial',    '',   '', +        'pkgnum',    'int',    '',   '',          'custnum',   'int',    '',   '',          'pkgpart',   'int',    '',   '', -        'otaker',    'varchar', '', 32, +        'otaker',    'varchar', '', 8,          'setup',     @date_type,          'bill',      @date_type, -        'last_bill', @date_type,          'susp',      @date_type,          'cancel',    @date_type,          'expire',    @date_type, @@ -630,12 +615,12 @@ sub tables_hash_hack {      'cust_refund' => {        'columns' => [ -        'refundnum',    'serial',    '',   '', +        'refundnum',    'int',    '',   '',          #now cust_credit_refund #'crednum',      'int',    '',   '',          'custnum',  'int',    '',   '',          '_date',        @date_type,          'refund',       @money_type, -        'otaker',       'varchar',   '',   32, +        'otaker',       'varchar',   '',   8,          'reason',       'varchar',   '',   $char_d,          'payby',        'char',   '',     4, # CARD/BILL/COMP, should be index                                               # into payment type table. @@ -650,7 +635,7 @@ sub tables_hash_hack {      'cust_credit_refund' => {        'columns' => [ -        'creditrefundnum', 'serial',     '',   '', +        'creditrefundnum', 'int',     '',   '',          'crednum',  'int',     '',   '',          'refundnum',  'int',     '',   '',          'amount',  @money_type, @@ -664,7 +649,7 @@ sub tables_hash_hack {      'cust_svc' => {        'columns' => [ -        'svcnum',    'serial',    '',   '', +        'svcnum',    'int',    '',   '',          'pkgnum',    'int',    'NULL',   '',          'svcpart',   'int',    '',   '',        ], @@ -675,11 +660,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, @@ -716,18 +701,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, @@ -739,7 +723,7 @@ sub tables_hash_hack {      'part_svc_column' => {        'columns' => [ -        'columnnum',   'serial',         '', '', +        'columnnum',   'int',         '', '',          'svcpart',     'int',         '', '',          'columnname',  'varchar',     '', 64,          'columnvalue', 'varchar', 'NULL', $char_d, @@ -753,7 +737,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, @@ -767,7 +751,7 @@ sub tables_hash_hack {      'part_pop_local' => {        'columns' => [ -        'localnum',  'serial',     '',     '', +        'localnum',  'int',     '',     '',          'popnum',    'int',     '',     '',          'city',      'varchar', 'NULL', $char_d,          'state',     'char',    'NULL', 2, @@ -802,6 +786,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',    '',   '', @@ -825,14 +821,12 @@ sub tables_hash_hack {      'domain_record' => {        'columns' => [ -        'recnum',    'serial',     '',  '', +        'recnum',    'int',     '',  '',          'svcnum',    'int',     '',  '', -        #'reczone',   'varchar', '',  $char_d, -        'reczone',   'varchar', '',  255, +        'reczone',   'varchar', '',  $char_d,          'recaf',     'char',    '',  2, -        'rectype',   'varchar',    '',  5, -        #'recdata',   'varchar', '',  $char_d, -        'recdata',   'varchar', '',  255, +        'rectype',   'char',    '',  5, +        'recdata',   'varchar', '',  $char_d,        ],        'primary_key' => 'recnum',        'unique'      => [], @@ -877,7 +871,7 @@ sub tables_hash_hack {      'prepay_credit' => {        'columns' => [ -        'prepaynum',   'serial',     '',   '', +        'prepaynum',   'int',     '',   '',          'identifier',  'varchar', '', $char_d,          'amount',      @money_type,          'seconds',     'int',     'NULL', '', @@ -889,7 +883,7 @@ sub tables_hash_hack {      'port' => {        'columns' => [ -        'portnum',  'serial',     '',   '', +        'portnum',  'int',     '',   '',          'ip',       'varchar', 'NULL', 15,          'nasport',  'int',     'NULL', '',          'nasnum',   'int',     '',   '', @@ -901,7 +895,7 @@ sub tables_hash_hack {      'nas' => {        'columns' => [ -        'nasnum',   'serial',     '',    '', +        'nasnum',   'int',     '',    '',          'nas',      'varchar', '',    $char_d,          'nasip',    'varchar', '',    15,          'nasfqdn',  'varchar', '',    $char_d, @@ -914,7 +908,7 @@ sub tables_hash_hack {      'session' => {        'columns' => [ -        'sessionnum', 'serial',       '',   '', +        'sessionnum', 'int',       '',   '',          'portnum',    'int',       '',   '',          'svcnum',     'int',       '',   '',          'login',      @date_type, @@ -927,7 +921,7 @@ sub tables_hash_hack {      'queue' => {        'columns' => [ -        'jobnum', 'serial', '', '', +        'jobnum', 'int', '', '',          'job', 'text', '', '',          '_date', 'int', '', '',          'status', 'varchar', '', $char_d, @@ -941,7 +935,7 @@ sub tables_hash_hack {      'queue_arg' => {        'columns' => [ -        'argnum', 'serial', '', '', +        'argnum', 'int', '', '',          'jobnum', 'int', '', '',          'arg', 'text', 'NULL', '',        ], @@ -952,7 +946,7 @@ sub tables_hash_hack {      'queue_depend' => {        'columns' => [ -        'dependnum', 'serial', '', '', +        'dependnum', 'int', '', '',          'jobnum', 'int', '', '',          'depend_jobnum', 'int', '', '',        ], @@ -963,7 +957,7 @@ sub tables_hash_hack {      'export_svc' => {        'columns' => [ -        'exportsvcnum' => 'serial', '', '', +        'exportsvcnum' => 'int', '', '',          'exportnum'    => 'int', '', '',          'svcpart'      => 'int', '', '',        ], @@ -974,7 +968,7 @@ sub tables_hash_hack {      'part_export' => {        'columns' => [ -        'exportnum', 'serial', '', '', +        'exportnum', 'int', '', '',          #'svcpart',   'int', '', '',          'machine', 'varchar', '', $char_d,          'exporttype', 'varchar', '', $char_d, @@ -987,7 +981,7 @@ sub tables_hash_hack {      'part_export_option' => {        'columns' => [ -        'optionnum', 'serial', '', '', +        'optionnum', 'int', '', '',          'exportnum', 'int', '', '',          'optionname', 'varchar', '', $char_d,          'optionvalue', 'text', 'NULL', '', @@ -999,7 +993,7 @@ sub tables_hash_hack {      'radius_usergroup' => {        'columns' => [ -        'usergroupnum', 'serial', '', '', +        'usergroupnum', 'int', '', '',          'svcnum',       'int', '', '',          'groupname',    'varchar', '', $char_d,        ], @@ -1010,7 +1004,7 @@ sub tables_hash_hack {      'msgcat' => {        'columns' => [ -        'msgnum', 'serial', '', '', +        'msgnum', 'int', '', '',          'msgcode', 'varchar', '', $char_d,          'locale', 'varchar', '', 16,          'msg', 'text', '', '', @@ -1022,7 +1016,7 @@ sub tables_hash_hack {      'cust_tax_exempt' => {        'columns' => [ -        'exemptnum', 'serial', '', '', +        'exemptnum', 'int', '', '',          'custnum',   'int', '', '',          'taxnum',    'int', '', '',          'year',      'int', '', '', @@ -1034,102 +1028,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 | 
