diff options
author | ivan <ivan> | 2010-07-05 21:10:07 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-07-05 21:10:07 +0000 |
commit | f52e5491164eb407549716ebfd36fae6f692b1c1 (patch) | |
tree | f327c08537b1a3bf4340b04a47085e8d3cb8cf1c | |
parent | 19b19c53164670e6e649b0ea3578fff882ce1082 (diff) |
customer exports, RT#8952
-rw-r--r-- | FS/FS/part_export/cust_http.pm | 2 | ||||
-rw-r--r-- | FS/FS/part_export/http.pm | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/FS/FS/part_export/cust_http.pm b/FS/FS/part_export/cust_http.pm index d2781f64b..59503e811 100644 --- a/FS/FS/part_export/cust_http.pm +++ b/FS/FS/part_export/cust_http.pm @@ -6,6 +6,8 @@ use Tie::IxHash; @ISA = qw( FS::part_export::http ); +tie my %options, 'Tie::IxHash', %FS::part_export::http::options; + $options{'insert_data'}->{'default'} = join("\n", "action 'insert'", "custnum \$cust_main->custnum", diff --git a/FS/FS/part_export/http.pm b/FS/FS/part_export/http.pm index 9a216c148..e5e5a5c48 100644 --- a/FS/FS/part_export/http.pm +++ b/FS/FS/part_export/http.pm @@ -90,13 +90,15 @@ sub _export_replace { my $new_cust_main = $new->table eq 'cust_main' ? $new : $new->cust_svc->cust_pkg->cust_main; + my $cust_main = $new_cust_main; #so folks can use $new_cust_main or $cust_main - $self->http_queue( $svc_x->svcnum, + $self->http_queue( $new->svcnum, $self->option('method'), $self->option('url'), map { /^\s*(\S+)\s+(.*)$/ or /()()/; my( $field, $value_expression ) = ( $1, $2 ); + my $value = eval $value_expression; die $@ if $@; ( $field, $value ); } split(/\n/, $self->option('replace_data') ) |