diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-03-05 18:31:41 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-03-05 18:31:41 -0800 |
commit | 0437a5b5d60bdae7c4c8b5ede1827715650faf40 (patch) | |
tree | 7e5aa4af85c921fcff76d5ad058359419102092e /FS | |
parent | f3853d3ed85d993f6bc058747d338fcbf344cb61 (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')
-rw-r--r-- | FS/FS/API.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/FS/FS/API.pm b/FS/FS/API.pm index 98c1a938d..ab9281bbb 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; } |