X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fsaisei.pm;h=eb1ba90e4d4ae82b2675a00b3a5eb5b724c22f86;hp=008710e6778aef948a7e4ee722ce1314d5cb9ca8;hb=31400e6a48702b09cd30112d2f865f2f0d115bee;hpb=3222ca52c49918bd0c2feabf710e6d417c407ae7 diff --git a/FS/FS/part_export/saisei.pm b/FS/FS/part_export/saisei.pm index 008710e67..eb1ba90e4 100644 --- a/FS/FS/part_export/saisei.pm +++ b/FS/FS/part_export/saisei.pm @@ -165,12 +165,12 @@ sub _export_insert { die ("Please double check your credentials as ".$existing_rateplan->{message}."\n") if $existing_rateplan->{message}; # if no existing rate plan create one and modify it. - $self->api_create_rateplan($svc_broadband, $rateplan_name) unless $existing_rateplan; - $self->api_modify_rateplan($svc_broadband, $rateplan_name) unless ($self->{'__saisei_error'} || $existing_rateplan); + $self->api_create_rateplan($svc_broadband, $rateplan_name) unless $existing_rateplan->{collection}; + $self->api_modify_rateplan($svc_broadband, $rateplan_name) unless ($self->{'__saisei_error'} || $existing_rateplan->{collection}); return $self->api_error if $self->{'__saisei_error'}; # set rateplan to existing one or newly created one. - my $rateplan = $existing_rateplan ? $existing_rateplan : $self->api_get_rateplan($rateplan_name); + my $rateplan = $existing_rateplan->{collection} ? $existing_rateplan : $self->api_get_rateplan($rateplan_name); my $username = $svc_broadband->{Hash}->{svcnum}; my $description = $svc_broadband->{Hash}->{description}; @@ -1001,7 +1001,7 @@ sub get_svc_location { 'addl_from' => 'LEFT JOIN cust_location USING (locationnum)', 'hashref' => { 'pkgnum' => $svc->{Hash}->{pkgnum} }, }); - $svc_location = $pkg_location->{Hash}->{latitude}.','.$pkg_location->{Hash}->{longitude} if ($pkg_location); + $svc_location = $pkg_location->{Hash}->{latitude}.','.$pkg_location->{Hash}->{longitude} if ($pkg_location->{Hash}->{latitude} && $pkg_location->{Hash}->{longitude}); } return $svc_location;