From: Ivan Kohler <ivan@freeside.biz>
Date: Thu, 6 Mar 2014 02:31:51 +0000 (-0800)
Subject: API methods to pull customer information: name, phone numbers, email and postal billi... 
X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=b2e6af304e3671d8dc29931201c6e46d872957d7;hp=83153d0d334defaf1fe909a244baec175986fa40;p=freeside.git

API methods to pull customer information: name, phone numbers, email and postal billing info, and address info in a normalized 2.3/3.x fashion, RT#22830
---

diff --git a/FS/FS/API.pm b/FS/FS/API.pm
index df488023e..9deed3daf 100644
--- a/FS/FS/API.pm
+++ b/FS/FS/API.pm
@@ -101,7 +101,16 @@ sub customer_info {
   );
 
   $return{$_} = $cust_main->get($_)
-    foreach @cust_main_editable_fields;
+    foreach ( @cust_main_editable_fields,
+              @location_editable_fields,
+              map "ship_$_", @location_editable_fields,
+            );
+
+  my @invoicing_list = $cust_main->invoicing_list;
+  $return{'invoicing_list'} =
+    join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list );
+  $return{'postal_invoicing'} =
+    0 < ( grep { $_ eq 'POST' } @invoicing_list );
 
   return \%return;