[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 284d823cb3413061bdf966c72430c98d128e5aca

Ivan ivan at 420.am
Wed Mar 5 18:44:31 PST 2014


The branch, FREESIDE_2_3_BRANCH has been updated
       via  284d823cb3413061bdf966c72430c98d128e5aca (commit)
      from  651ef8f1af4aaa773adb3f0ba0f4e2c4b692a115 (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 284d823cb3413061bdf966c72430c98d128e5aca
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Mar 5 18:44:30 2014 -0800

    backoffice API: add status to customer info, add location_info, RT#22830

diff --git a/FS/FS/API.pm b/FS/FS/API.pm
index bf2579f..417f889 100644
--- a/FS/FS/API.pm
+++ b/FS/FS/API.pm
@@ -40,28 +40,8 @@ Enter cash refund.
 
 #---
 
-#Customer data
-# pull customer info 
-# The fields needed are:
-#
-# cust_main.custnum
-# cust_main.first
-# cust_main.last
-# cust_main.company
-# cust_main.address1
-# cust_main.address2
-# cust_main.city
-# cust_main.state
-# cust_main.zip
-# cust_main.daytime
-# cust_main.night
-# cust_main_invoice.dest
-#
-# at minimum
-
-#Customer balances
+#generally, the more useful data from the cust_main record the better.
 
-#Advertising sources?
 
 # "2 way syncing" ?  start with non-sync pulling info here, then if necessary
 # figure out how to trigger something when those things change
@@ -99,6 +79,8 @@ sub customer_info {
     'display_custnum' => $cust_main->display_custnum,
     'name'            => $cust_main->first. ' '. $cust_main->get('last'),
     'balance'         => $cust_main->balance,
+    'status'          => $cust_main->status,
+    'statuscolor'     => $cust_main->statuscolor,
   );
 
   $return{$_} = $cust_main->get($_)
@@ -117,6 +99,27 @@ sub customer_info {
 
 }
 
+#I also monitor for changes to the additional locations that are applied to
+# packages, and would like for those to be exportable as well.  basically the
+# location data passed with the custnum.
+sub location_info {
+  my( $class, %opt ) = @_;
+  my $conf = new FS::Conf;
+  return { 'error' => 'Incorrect shared secret' }
+    unless $opt{secret} eq $conf->config('api_shared_secret');
+
+  my @cust_location = qsearch('cust_location', { 'custnum' => $opt{custnum} });
+
+  my %return = (
+    'error'           => '',
+    'locations'       => [ @cust_location ],
+  );
+
+  return \%return;
+}
+
+#Advertising sources?
+
 =back
 
 1;

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

Summary of changes:
 FS/FS/API.pm |   45 ++++++++++++++++++++++++---------------------
 1 files changed, 24 insertions(+), 21 deletions(-)




More information about the freeside-commits mailing list