package FS::cust_main;
use strict;
-use vars qw(@ISA $conf $lpr $processor $xaction $E_NoErr $invoice_from);
+use vars qw( @ISA $conf $lpr $processor $xaction $E_NoErr $invoice_from
+ $smtpmachine );
use Safe;
use Carp;
use Time::Local;
$conf = new FS::Conf;
$lpr = $conf->config('lpr');
$invoice_from = $conf->config('invoice_from');
+ $smtpmachine = $conf->config('smtpmachine');
if ( $conf->exists('cybercash3.2') ) {
require CCMckLib3_2;
} );
}
- $self->zip =~ /^([\w\-]{5,10})$/ or return "Illegal zip";
+ $self->zip =~ /^\s*(\w[\w\-\s]{3,8}\w)\s*$/ or return "Illegal zip";
$self->zip($1);
$self->payby =~ /^(CARD|BILL|COMP)$/ or return "Illegal payby";
#my @print_text = $cust_bill->print_text; #( date )
my @invoicing_list = $self->invoicing_list;
if ( grep { $_ ne 'POST' } @invoicing_list ) { #email invoice
+ $ENV{SMTPHOSTS} = $smtpmachine;
+ $ENV{MAILADDRESS} = $invoice_from;
my $header = new Mail::Header ( [
"From: $invoice_from",
"To: ". join(', ', grep { $_ ne 'POST' } @invoicing_list ),
if ( $processor =~ /^cybercash/ ) {
#fix exp. date for cybercash
- $self->paydate =~ /^(\d+)\/\d*(\d{2})$/;
- my $exp = "$1/$2";
+ #$self->paydate =~ /^(\d+)\/\d*(\d{2})$/;
+ $self->paydate =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/;
+ my $exp = "$2/$1";
my $paybatch = $cust_bill->invnum.
'-' . time2str("%y%m%d%H%M%S", time);
}
}
}
- map { $_->address }
- qsearch( 'cust_main_invoice', { 'custnum' => $self->custnum } );
+ if ( $self->custnum ) {
+ map { $_->address }
+ qsearch( 'cust_main_invoice', { 'custnum' => $self->custnum } );
+ } else {
+ ();
+ }
}
=item check_invoicing_list ARRAYREF
=head1 VERSION
-$Id: cust_main.pm,v 1.11 1999-02-23 08:09:27 ivan Exp $
+$Id: cust_main.pm,v 1.15 1999-04-07 13:41:54 ivan Exp $
=head1 BUGS
FS::UID::{datasrc,checkruid} ivan@sisd.com 98-sep-19-21
$Log: cust_main.pm,v $
-Revision 1.11 1999-02-23 08:09:27 ivan
+Revision 1.15 1999-04-07 13:41:54 ivan
+in &invoicing_list, don't search if there's no custnum yet
+
+Revision 1.14 1999/03/29 12:06:15 ivan
+buglet in email invoices fixed
+
+Revision 1.13 1999/02/28 20:09:03 ivan
+allow spaces in zip codes, for (at least) canada. pointed out by
+Clayton Gray <clgray@bcgroup.net>
+
+Revision 1.12 1999/02/27 21:24:22 ivan
+parse paydate correctly for cybercash
+
+Revision 1.11 1999/02/23 08:09:27 ivan
beginnings of one-screen new customer entry and some other miscellania
Revision 1.10 1999/01/25 12:26:09 ivan