From e4a02dc995c0db1994ff26504c28557d1cb617b4 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 2 Feb 2016 09:10:43 -0800 Subject: [PATCH] wireless broadband service import, RT#38986 --- FS/FS/cust_main/Import.pm | 19 +++++++++++++++++++ httemplate/misc/cust_main-import.cgi | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/FS/FS/cust_main/Import.pm b/FS/FS/cust_main/Import.pm index b5fb2746c..1b2602749 100644 --- a/FS/FS/cust_main/Import.pm +++ b/FS/FS/cust_main/Import.pm @@ -9,6 +9,7 @@ use FS::UID qw( dbh ); use FS::Record qw( qsearchs ); use FS::cust_main; use FS::svc_acct; +use FS::svc_broadband; use FS::svc_external; use FS::svc_phone; use FS::svc_hardware; @@ -183,6 +184,18 @@ sub batch_import { customer_options ); $payby = 'BILL'; + } elsif ( $format =~ /^svc_broadband/ ) { + @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 cust_pkg.bill + ); + push @fields, map "svc_broadband.$_", qw( ip_addr mac_addr sectornum ); + $payby = 'BILL'; } elsif ( $format =~ /^svc_external/ ) { @fields = qw( agent_custid refnum last first company address1 address2 city state zip country @@ -340,6 +353,10 @@ sub batch_import { $svc_x{$1} = shift @columns; + } elsif ( $field =~ /^svc_broadband\.(ip_addr|mac_addr|sectornum)$/ ) { + + $svc_x{$1} = shift @columns; + } elsif ( $field =~ /^svc_external\.(id|title)$/ ) { $svc_x{$1} = shift @columns; @@ -451,6 +468,8 @@ sub batch_import { $svcdb = 'svc_acct'; } elsif ( $svc_x{'id'} || $svc_x{'title'} ) { $svcdb = 'svc_external'; + } elsif ( $svc_x{ip_addr} || $svc_x{mac_addr} ) { + $svcdb = 'svc_broadband'; } my $svc_phone = ''; diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi index d56feaccf..46d15363d 100644 --- a/httemplate/misc/cust_main-import.cgi +++ b/httemplate/misc/cust_main-import.cgi @@ -33,6 +33,7 @@ Import a file containing customer records.