[freeside-commits] branch FREESIDE_3_BRANCH updated. adfd64d5eae738371deecb332ea1bbf7e6163754

Ivan ivan at 420.am
Tue Apr 14 12:47:40 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  adfd64d5eae738371deecb332ea1bbf7e6163754 (commit)
      from  600e1ad4ae42a8800527660038b74eaedc13a958 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit adfd64d5eae738371deecb332ea1bbf7e6163754
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Apr 14 12:47:38 2015 -0700

    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 694d814..f9cf1cb 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 e0c0c7f..e97e283 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.
       <SELECT NAME="format">
         <OPTION VALUE="default" SELECTED>Default
         <OPTION VALUE="default-agent_custid">Default with agent_custid
+        <OPTION VALUE="all_dates" SELECTED>All dates
         <OPTION VALUE="svc_acct">Account service
         <OPTION VALUE="svc_acct-agent_custid">Account service with agent_custid
         <OPTION VALUE="svc_phone">Phone service
@@ -71,6 +72,9 @@ Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets.
 <b>Default with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire</i>
 <BR><BR>
 
+<b>All dates</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, order_date, start_date, setup, bill, last_bill, susp, adjourn, resume, cancel, expire, contract_end, dundate</i>
+<BR><BR>
+
 <b>Account service</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, username, _password, domsvc</i>
 <BR><BR>
 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_pkg/Import.pm             |   21 +++++++++++++++++----
 httemplate/misc/cust_pkg-import.html |    4 ++++
 2 files changed, 21 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list