summaryrefslogtreecommitdiff
path: root/FS/FS/API.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-03-05 18:31:41 -0800
committerIvan Kohler <ivan@freeside.biz>2014-03-05 18:31:41 -0800
commit0437a5b5d60bdae7c4c8b5ede1827715650faf40 (patch)
tree7e5aa4af85c921fcff76d5ad058359419102092e /FS/FS/API.pm
parentf3853d3ed85d993f6bc058747d338fcbf344cb61 (diff)
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
Diffstat (limited to 'FS/FS/API.pm')
-rw-r--r--FS/FS/API.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/FS/FS/API.pm b/FS/FS/API.pm
index 98c1a93..ab9281b 100644
--- a/FS/FS/API.pm
+++ b/FS/FS/API.pm
@@ -275,6 +275,19 @@ sub customer_info {
$return{$_} = $cust_main->get($_)
foreach @cust_main_editable_fields;
+ for (@location_editable_fields) {
+ $return{$_} = $cust_main->bill_location->get($_)
+ if $cust_main->bill_locationnum;
+ $return{'ship_'.$_} = $cust_main->ship_location->get($_)
+ if $cust_main->ship_locationnum;
+ }
+
+ 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;
}