projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cust_main exports! cust_main-exports config option and part_export/cust_http.pm...
[freeside.git]
/
FS
/
FS
/
part_export
/
http.pm
diff --git
a/FS/FS/part_export/http.pm
b/FS/FS/part_export/http.pm
index
55d8329
..
9a216c1
100644
(file)
--- a/
FS/FS/part_export/http.pm
+++ b/
FS/FS/part_export/http.pm
@@
-1,12
+1,10
@@
package FS::part_export::http;
package FS::part_export::http;
-use vars qw(@ISA %info);
+use base qw( FS::part_export );
+use vars qw( %options %info );
use Tie::IxHash;
use Tie::IxHash;
-use FS::part_export;
-@ISA = qw(FS::part_export);
-
-tie my %options, 'Tie::IxHash',
+tie %options, 'Tie::IxHash',
'method' => { label =>'Method',
type =>'select',
#options =>[qw(POST GET)],
'method' => { label =>'Method',
type =>'select',
#options =>[qw(POST GET)],
@@
-66,6
+64,10
@@
sub _export_command {
return unless $self->option("${action}_data");
return unless $self->option("${action}_data");
+ my $cust_main = $svc_x->table eq 'cust_main'
+ ? $svc_x
+ : $svc_x->cust_svc->cust_pkg->cust_main;
+
$self->http_queue( $svc_x->svcnum,
$self->option('method'),
$self->option('url'),
$self->http_queue( $svc_x->svcnum,
$self->option('method'),
$self->option('url'),
@@
-85,6
+87,10
@@
sub _export_replace {
return unless $self->option('replace_data');
return unless $self->option('replace_data');
+ my $new_cust_main = $new->table eq 'cust_main'
+ ? $new
+ : $new->cust_svc->cust_pkg->cust_main;
+
$self->http_queue( $svc_x->svcnum,
$self->option('method'),
$self->option('url'),
$self->http_queue( $svc_x->svcnum,
$self->option('method'),
$self->option('url'),
@@
-100,10
+106,8
@@
sub _export_replace {
sub http_queue {
my($self, $svcnum) = (shift, shift);
sub http_queue {
my($self, $svcnum) = (shift, shift);
- my $queue = new FS::queue {
- 'svcnum' => $svcnum,
- 'job' => "FS::part_export::http::http",
- };
+ my $queue = new FS::queue { 'job' => "FS::part_export::http::http" };
+ $queue->svcnum($svcnum) if $svcnum;
$queue->insert( @_ );
}
$queue->insert( @_ );
}