diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-04-14 12:47:36 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-04-14 12:47:36 -0700 |
commit | df844e1ff7b7b93657d7ca2978426e146a75192c (patch) | |
tree | baab0c6a8162b532db8b7615777cde632a2ff049 /FS | |
parent | ac19a70d9484310aa4f5f107914425668a3fa78e (diff) |
add "All dates" format to package import with contract_end, RT#34397
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/cust_pkg/Import.pm | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/FS/FS/cust_pkg/Import.pm b/FS/FS/cust_pkg/Import.pm index cac31f84e..082def057 100644 --- a/FS/FS/cust_pkg/Import.pm +++ b/FS/FS/cust_pkg/Import.pm @@ -125,7 +125,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); @@ -208,9 +207,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 |