From: Ivan Kohler Date: Tue, 14 Apr 2015 19:47:38 +0000 (-0700) Subject: add "All dates" format to package import with contract_end, RT#34397 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=adfd64d5eae738371deecb332ea1bbf7e6163754 add "All dates" format to package import with contract_end, RT#34397 --- diff --git a/FS/FS/cust_pkg/Import.pm b/FS/FS/cust_pkg/Import.pm index 694d8147f..f9cf1cb5c 100644 --- a/FS/FS/cust_pkg/Import.pm +++ b/FS/FS/cust_pkg/Import.pm @@ -128,7 +128,6 @@ my %import_options = ( $cust_location->set($1, $param->{$p}); } -warn Dumper $cust_location; # XXX my $error = $cust_location->find_or_insert; # this avoids duplicates return "error creating location: $error" if $error; $record->set('locationnum', $cust_location->locationnum); @@ -211,9 +210,23 @@ sub batch_import { push @fields, ( 'pkgpart', 'discountnum' ); - foreach my $field ( - qw( start_date setup bill last_bill susp adjourn cancel expire ) - ) { + my @date_fields = (); + if ( $format =~ /all_dates/ ) { + @date_fields = qw( + order_date + start_date setup bill last_bill susp adjourn + resume + cancel expire + contract_end dundate + ); + } else { + @date_fields = qw( + start_date setup bill last_bill susp adjourn + cancel expire + ); + } + + foreach my $field (@date_fields) { push @fields, sub { my( $self, $value ) = @_; # $conf, $param #->$field has undesirable effects diff --git a/httemplate/misc/cust_pkg-import.html b/httemplate/misc/cust_pkg-import.html index e0c0c7ff4..e97e28310 100644 --- a/httemplate/misc/cust_pkg-import.html +++ b/httemplate/misc/cust_pkg-import.html @@ -29,6 +29,7 @@ Import a file containing customer packages.