[freeside-commits] freeside/FS/FS/cust_main Import.pm,1.8,1.9
Jeff Finucane,420,,
jeff at wavetail.420.am
Fri Sep 24 15:08:07 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/cust_main
In directory wavetail.420.am:/tmp/cvs-serv22355/FS/FS/cust_main
Modified Files:
Import.pm
Log Message:
import tax exempt and force postal invoice optiosn
Index: Import.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main/Import.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -d -r1.8 -r1.9
--- Import.pm 13 Aug 2010 17:41:58 -0000 1.8
+++ Import.pm 24 Sep 2010 22:08:05 -0000 1.9
@@ -34,7 +34,8 @@
file => $file, #filename
type => $type, #csv or xls
format => $format, #extended, extended-plus_company, svc_external,
- # or svc_external_svc_phone
+ #extended-plus_company_and_options
+ #extended-plus_options, or svc_external_svc_phone
agentnum => $agentnum,
refnum => $refnum,
pkgpart => $pkgpart,
@@ -144,6 +145,19 @@
svc_acct.username svc_acct._password
);
$payby = 'BILL';
+ } elsif ( $format eq 'extended-plus_options' ) {
+ @fields = qw( agent_custid refnum
+ last first address1 address2 city state zip country
+ daytime night
+ ship_last ship_first ship_company ship_address1 ship_address2
+ ship_city ship_state ship_zip ship_country
+ payinfo paycvv paydate
+ invoicing_list
+ cust_pkg.pkgpart
+ svc_acct.username svc_acct._password
+ customer_options
+ );
+ $payby = 'BILL';
} elsif ( $format eq 'extended-plus_company' ) {
@fields = qw( agent_custid refnum
last first company address1 address2 city state zip country
@@ -156,6 +170,19 @@
svc_acct.username svc_acct._password
);
$payby = 'BILL';
+ } elsif ( $format eq 'extended-plus_company_and_options' ) {
+ @fields = qw( agent_custid refnum
+ last first company address1 address2 city state zip country
+ daytime night
+ ship_last ship_first ship_company ship_address1 ship_address2
+ ship_city ship_state ship_zip ship_country
+ payinfo paycvv paydate
+ invoicing_list
+ cust_pkg.pkgpart
+ svc_acct.username svc_acct._password
+ customer_options
+ );
+ $payby = 'BILL';
} elsif ( $format =~ /^svc_external/ ) {
@fields = qw( agent_custid refnum
last first company address1 address2 city state zip country
@@ -318,14 +345,22 @@
}
}
- $cust_main{'payby'} = 'CARD'
- if defined $cust_main{'payinfo'}
- && length $cust_main{'payinfo'};
+ if ( defined $cust_main{'payinfo'} && length $cust_main{'payinfo'} ) {
+ $cust_main{'payby'} = 'CARD';
+ if ($cust_main{'payinfo'} =~ /\s*([AD]?)(.*)\s*$/) {
+ $cust_main{'payby'} = 'DCRD' if $1 eq 'D';
+ $cust_main{'payinfo'} = $2;
+ }
+ }
my $invoicing_list = $cust_main{'invoicing_list'}
? [ delete $cust_main{'invoicing_list'} ]
: [];
+ my $customer_options = delete $cust_main{customer_options};
+ $cust_main{tax} = 'Y' if $customer_options =~ /taxexempt/i;
+ push @$invoicing_list, 'POST' if $customer_options =~ /postalinvoice/i;
+
my $cust_main = new FS::cust_main ( \%cust_main );
use Tie::RefHash;
More information about the freeside-commits
mailing list