Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorIvan Kohler <ivan@freeside.biz>
Tue, 23 Dec 2014 20:19:30 +0000 (12:19 -0800)
committerIvan Kohler <ivan@freeside.biz>
Tue, 23 Dec 2014 20:19:30 +0000 (12:19 -0800)
FS/FS/Conf.pm
FS/FS/cdr/cx3.pm
FS/FS/pay_batch/eft_canada.pm
debian/control
debian/rules

index c88d3e7..90b11a0 100644 (file)
@@ -3855,7 +3855,7 @@ and customer address. Include units.',
   {
     'key'         => 'batchconfig-eft_canada',
     'section'     => 'billing',
-    'description' => 'Configuration for EFT Canada batching, four lines: 1. SFTP username, 2. SFTP password, 3. Transaction code, 4. Number of days to delay process date.  If you are using separate per-agent batches (batch-spoolagent), you must set this option separately for each agent, as the global setting will be ignored.',
+    'description' => 'Configuration for EFT Canada batching, five lines: 1. SFTP username, 2. SFTP password, 3. Business transaction code, 4. Personal transaction code, 5. Number of days to delay process date.  If you are using separate per-agent batches (batch-spoolagent), you must set this option separately for each agent, as the global setting will be ignored.',
     'type'        => 'textarea',
     'per_agent'   => 1,
   },
index 8c84807..a1e2e93 100644 (file)
@@ -10,40 +10,33 @@ use Date::Parse;
 %info = (
   'name'          => '3CX',
   'weight'        => 120,
-  'header'        => 1,
   'import_fields' => [
 
 
-sub {                 
-       my ($cdr, $data, $conf, $param) = @_;
-               $param->{skiprow} = 1 unless $data =~ 'CallDetail'; # skip non-detail records
+       sub {                 
+               my ($cdr, $data, $conf, $param) = @_;
+               $param->{skiprow} = 1 unless $data =~ /Call\s/ ; # skip non-detail records
        },              # record type
-       skip(2),        # unknown, callid ( not unique )
-       'src',          # source
-       'dst',          # destination
-sub { my ($cdr, $calldate, $param) = @_;
-
-       if ($calldate =~ /^(\d{2})\/(\d{2})\/(\d{4})\s*(\d{2}):(\d{2}):(\d{2})$/){
+       skip(1),        # unknown, callid ( not unique )
+       sub { my ($cdr, $duration) = @_;
+       
+               my ($hour,$min,$sec) = split(/:/,$duration);
+               $sec = sprintf ("%.0f", $sec);
+               $sec += $min * 60;
+               $sec += $hour * 60 * 60;
+               $cdr->set('billsec', $sec);
+
+       },              # duration
+       skip(1),                
+       sub { my ($cdr, $calldate, $param) = @_;
 
                $cdr->set('calldate', $calldate);
-                my $tmp_date = "$2/$1/$3 $4:$5:$6";
-
-                $tmp_date = str2time($tmp_date);
-                $cdr->set('startdate', $tmp_date);
-                }          
        },              #date
-sub { my ($cdr, $duration) = @_;
-               
-       my ($hour,$min,$sec) = split(/:/,$duration);
-       $sec += $min * 60;
-       $sec += $hour * 60 * 60;
-       $sec = sprintf ("%.0f", $sec);
-       $cdr->set('billsec', $sec);
-
-},                     #duration
-       skip(1),        # unknown
-       'disposition',  # call status
+       skip(4),          
        'accountcode',  # AccountCode
+       skip(6),                
+       'src',          # source
+       'dst',          # destination
 
   ],
 );
index 0c09321..ab9e6a3 100644 (file)
@@ -15,7 +15,7 @@ $name = 'eft_canada';
 
 %import_info = ( filetype  => 'NONE' ); # see FS/bin/freeside-eftca-download
 
-my ($trans_code, $process_date);
+my ($business_trans_code, $personal_trans_code, $trans_code, $process_date);
 
 #ref http://gocanada.about.com/od/canadatravelplanner/a/canada_holidays.htm
 my %holiday_yearly = (
@@ -66,7 +66,8 @@ my %holiday = (
       @config = $conf->config('batchconfig-eft_canada');
     }
     # SFTP login, password, trans code, delay time
-    ($trans_code) = $config[2];
+    ($business_trans_code) = $config[2];
+    ($personal_trans_code) = $config[3];
 
     $process_date = time2str('%D', process_date($conf, $agentnum));
   },
@@ -82,12 +83,14 @@ my %holiday = (
     my $company = sprintf('%.64s', $cust_pay_batch->cust_main->company);
     if ( $company ) {
       push @fields, 'Business';
-      push @fields, $company, ''
+      push @fields, $company, '';
+      $trans_code = $business_trans_code;
     }
     else {
       push @fields, 'Personal';
       push @fields, map { sprintf('%.64s', $_) } 
         $cust_pay_batch->first, $cust_pay_batch->last;
+        $trans_code = $personal_trans_code;
     }
     my ($account, $aba) = split('@', $cust_pay_batch->payinfo);
     my($bankno, $branch);
index 1b25732..7917bad 100644 (file)
@@ -39,3 +39,30 @@ Description: Web interface for Freeside billing and trouble ticketing
  Freeside is a web-based billing and trouble ticketing application.
  .
  This package provides the web interface for employees.
+
+Package: freeside-selfservice-lib
+Architecture: all
+Depends: libtext-template-perl,libbusiness-creditcard-perl,libhttp-browserdetect-perl,libhtml-parser-perl,libtie-ixhash-perl,libhtml-widgets-selectlayers-perl,libtimedate-perl,libnumber-format-perl,libsoap-lite-perl,libtext-csv-xs-perl,apache2-suexec-custom,apache2-mpm-worker
+Recommends:
+Description: Self-service portal for Freeside billing and trouble ticketing
+ Freeside is a web-based billing and trouble ticketing application.
+ .
+ This package provides the libraries needed for the self-service portal.
+
+Package: freeside-selfservice-ui
+Architecture: all
+Depends: 
+Recommends: freeside-selfservice-lib
+Description: Self-service portal html/cgi filesfor Freeside billing and trouble ticketing
+ Freeside is a web-based billing and trouble ticketing application.
+ .
+ This package provides the html and cgi files needed for the self-service portal.
+
+Package: freeside-ng-selfservice
+Architecture: all
+Depends:
+Recommends:
+Description: Next Generation Self-service portal written in PHP using the XML-RPC API for Freeside billing and trouble ticketing
+ Freeside is a web-based billing and trouble ticketing application.
+ .
+ This package provides a self-service portal written in PHP using the XML-RPC API.
index e640398..3754f83 100755 (executable)
@@ -39,7 +39,7 @@ export FREESIDE_LOG = $(TMP)/usr/local/etc/freeside
 export FREESIDE_LOCK = $(TMP)/usr/local/etc/freeside
 export FREESIDE_CACHE = $(TMP)/usr/local/etc/freeside
 export FREESIDE_EXPORT = $(TMP)/usr/local/etc/freeside
-export FREESIDE_SS = $(TMP)/usr/share/docs/freeside
+
 export DIST_CONF = ${FREESIDE_CONF}/default_conf
 
 #XXX own subdir?
@@ -94,7 +94,10 @@ build-stamp:
        # Add commands to compile the package here
        
        ( cd FS/ && $(PERL) Makefile.PL INSTALLDIRS=vendor && $(MAKE) )
-       $(MAKE) perl-modules    
+       $(MAKE) perl-modules
+       
+       ( cd fs_selfservice/FS-SelfService/ && $(PERL) Makefile.PL && $(MAKE) )
+       
        #install this for freeside-setup
        install -d $(DIST_CONF)
        install `ls -d conf/[a-z]* | grep -v CVS | grep -v '^conf/registries'` $(DIST_CONF)
@@ -202,6 +205,24 @@ install-stamp: build-stamp
         " ${TMP}-lib/usr/bin/* \
          ${TMP}-webui/usr/local/etc/freeside/handler.pl
 
+       # Self-service
+       
+       ( cd fs_selfservice/FS-SelfService/; $(MAKE) -e DESTDIR=${TMP}-selfservice-lib install ) 
+       install -d -o freeside -g freeside ${TMP}-selfservice-lib/usr/local/freeside
+       touch ${TMP}-selfservice-lib/usr/local/freeside/selfservice_socket 
+       chown -R freeside ${TMP}-selfservice-lib/usr/local/freeside
+       chmod 600 ${TMP}-selfservice-lib/usr/local/freeside/selfservice_socket
+       
+       install -d -o freeside -g freeside ${TMP}-selfservice-ui/var/www/
+       cp -R fs_selfservice/FS-SelfService/cgi ${TMP}-selfservice-ui/var/www/selfservice-DIST
+       chown freeside.freeside ${TMP}-selfservice-ui/var/www/selfservice-DIST/*.cgi ${TMP}-selfservice-ui/var/www/selfservice-DIST/*/*.cgi;
+       chmod 755 ${TMP}-selfservice-ui/var/www/selfservice-DIST/*.cgi ${TMP}-selfservice-ui/var/www/selfservice-DIST/*/*.cgi
+
+       # NG-selfservice
+
+       install -d ${TMP}-ng-selfservice/var/www/
+       cp -R ng_selfservice ${TMP}-ng-selfservice/var/www/ng_selfservice-DIST/
+
        #RT Config
 
        ( cd rt; \
@@ -271,7 +292,7 @@ binary-indep: build install
        dh_perl
        dh_link
        dh_compress 
-       dh_fixperms
+       dh_fixperms -X/var/www/selfservice-DIST -X/usr/local/freeside
        dh_gencontrol
        dh_md5sums
        dh_builddeb