From 884d54765a4709bee112d7204b127670648b7a55 Mon Sep 17 00:00:00 2001
From: Ivan Kohler <ivan@freeside.biz>
Date: Tue, 23 May 2017 11:47:03 -0700
Subject: [PATCH] add debug flag, RT#73618

---
 FS/FS/part_export/vitelity.pm | 22 +++++++++++++---------
 debian/control                |  2 +-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/FS/FS/part_export/vitelity.pm b/FS/FS/part_export/vitelity.pm
index 8d802b16d..089e1093d 100644
--- a/FS/FS/part_export/vitelity.pm
+++ b/FS/FS/part_export/vitelity.pm
@@ -4,7 +4,7 @@ use base qw( FS::part_export );
 use vars qw( %info );
 use Tie::IxHash;
 use Geo::StreetAddress::US;
-use Net::Vitelity;
+use Net::Vitelity 0.05;
 use FS::Record qw( qsearch dbh );
 use FS::phone_avail;
 use FS::svc_phone;
@@ -25,6 +25,10 @@ tie my %options, 'Tie::IxHash',
   'disable_e911'       => { label => "Disable E911 provisioning",
                             type  => 'checkbox',
                           },
+  'debug'              => { label  => 'Enable debugging',
+                             type  => 'checkbox',
+                             value => 1,
+                          },
 ;
 
 %info = (
@@ -246,10 +250,10 @@ sub vitelity_command {
   my( $self, $command, @args ) = @_;
 
   my $vitelity = Net::Vitelity->new(
-    'login' => $self->option('login'),
-    'pass'  => $self->option('pass'),
-    'apitype' => $self->option('fax') ? 'fax' : 'api',
-    #'debug'    => $debug,
+    'login'    => $self->option('login'),
+    'pass'     => $self->option('pass'),
+    'apitype'  => $self->option('fax') ? 'fax' : 'api',
+    'debug'    => $self->option('debug'),
   );
 
   $vitelity->$command(@args);
@@ -259,10 +263,10 @@ sub vitelity_lnp_command {
   my( $self, $command, @args ) = @_;
 
   my $vitelity = Net::Vitelity->new(
-    'login'   => $self->option('login'),
-    'pass'    => $self->option('pass'),
-    'apitype' => 'lnp',
-    #'debug'   => $debug,
+    'login'    => $self->option('login'),
+    'pass'     => $self->option('pass'),
+    'apitype'  => 'lnp',
+    'debug'    => $self->option('debug'),
   );
 
   $vitelity->$command(@args);
diff --git a/debian/control b/debian/control
index e52dd8747..a268ffdad 100644
--- a/debian/control
+++ b/debian/control
@@ -99,7 +99,7 @@ Depends: aspell-en,gnupg,ghostscript,gsfonts,gzip,latex-xcolor,
  libxml-writer-perl, libio-socket-ssl-perl,
  libmap-splat-perl, libdatetime-format-ical-perl, librest-client-perl,
  libgeo-streetaddress-us-perl, libbusiness-onlinepayment-perl,
- libnet-vitelity-perl
+ libnet-vitelity-perl (>= 0.05)
 Conflicts: libparams-classify-perl (>= 0.013-6)
 Replaces: freeside (<<4)
 Breaks: freeside (<<4)
-- 
2.20.1