[freeside-commits] branch master updated. ac58d397dab0e70684682775036cd73d23c4213e

Ivan ivan at 420.am
Mon Sep 25 15:17:21 PDT 2017


The branch, master has been updated
       via  ac58d397dab0e70684682775036cd73d23c4213e (commit)
      from  c6d8896d882b684b1f3c7a2538a90358b27aaf89 (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 ac58d397dab0e70684682775036cd73d23c4213e
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Sep 25 15:17:20 2017 -0700

    added invoice details to package import, RT#76992

diff --git a/FS/FS/cust_pkg/Import.pm b/FS/FS/cust_pkg/Import.pm
index 2467e6f..3cf38cd 100644
--- a/FS/FS/cust_pkg/Import.pm
+++ b/FS/FS/cust_pkg/Import.pm
@@ -105,7 +105,7 @@ my %formatfields = (
   'svc_phone'    => [qw( countrycode phonenum sip_password pin )],
   'svc_external' => [qw( id title )],
   'location'     => [qw( address1 address2 city state zip country )],
-  'quan_price'   => [qw( quantity setup_fee recur_fee )],
+  'quan_price'   => [qw( quantity setup_fee recur_fee invoice_details )],
 );
 
 sub _formatfields {
@@ -162,6 +162,25 @@ warn join('-', @location_params);
   'postinsert_callback' => sub {
     my( $record, $param ) = @_;
 
+    if ( $param->{'quan_price.invoice_details'} ) {
+
+      my $weight = 0;
+      foreach my $detail (split(/\|/, $param->{'quan_price.invoice_details'})) {
+
+        my $cust_pkg_detail = new FS::cust_pkg_detail {
+          'pkgnum'     => $record->pkgnum,
+          'detail'     => $detail,
+          'detailtype' => 'I',
+          'weight'     => $weight++,
+        };
+
+        my $error = $cust_pkg_detail->insert;
+        return "error inserting invoice detail: $error" if $error;
+
+      }
+
+    }
+
     my $formatfields = _formatfields;
     foreach my $svc_x ( grep /^svc/, keys %$formatfields ) {
 
diff --git a/httemplate/misc/cust_pkg-import.html b/httemplate/misc/cust_pkg-import.html
index 49201c5..0c3d31d 100644
--- a/httemplate/misc/cust_pkg-import.html
+++ b/httemplate/misc/cust_pkg-import.html
@@ -156,7 +156,7 @@ address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$
 <b>Location, quantity and price customizations with phone service</b> format has the following field order: <i>custnum<%$req%>,
 pkgpart<%$req%>, discountnum,
 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
-quantity, setup_fee, recur_fee,
+quantity, setup_fee, recur_fee, invoice_details,
 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>,
 countrycode, phonenum, sip_password, pin
 </i>
@@ -165,7 +165,7 @@ countrycode, phonenum, sip_password, pin
 <b>Location, quantity and price customizations with phone service and 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,
-quantity, setup_fee, recur_fee,
+quantity, setup_fee, recur_fee, invoice_details,
 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>,
 countrycode, phonenum, sip_password, pin
 </i>
@@ -174,7 +174,7 @@ countrycode, phonenum, sip_password, pin
 <b>Location, quantity and price customizations with phone service and agent_custid and agent_pkgid</b> format has the following field order: <i>agent_custid<%$req%>, agent_pkgid,
 pkgpart<%$req%>, discountnum,
 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
-quantity, setup_fee, recur_fee,
+quantity, setup_fee, recur_fee, invoice_details,
 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>,
 countrycode, phonenum, sip_password, pin
 </i>
@@ -213,6 +213,14 @@ Field information:
 
   <li><i>expire</i>: Indicates a future cancellation on this date.
 
+  <li><i>quantity</i>
+
+  <li><i>setup_fee</i>: Including this fee implements per-customer custom pricing for this package, overriding package definition pricing
+
+  <li><i>recur_fee</i>: Including this fee implements per-customer custom pricing for this package, overriding package definition pricing
+
+  <li><i>invoice_details</i>: Package invoice details (optionally, can include multiple lines of details separated by a newline)
+
 <!--
   <li><i>username</i> and <i>_password</i> are required if <i>pkgpart</i> is specified. (Extended and Extended plus company formats)
 -->

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

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




More information about the freeside-commits mailing list