From f52e5491164eb407549716ebfd36fae6f692b1c1 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 5 Jul 2010 21:10:07 +0000 Subject: [PATCH] customer exports, RT#8952 --- FS/FS/part_export/cust_http.pm | 2 ++ FS/FS/part_export/http.pm | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) 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') ) -- 2.11.0