[freeside-commits] branch master updated. 0f21021fea8f99d28b4507c3cffa55cbdd6f110d

Ivan ivan at 420.am
Fri Jun 7 23:41:56 PDT 2013


The branch, master has been updated
       via  0f21021fea8f99d28b4507c3cffa55cbdd6f110d (commit)
       via  42eaf0aec334e15163848eb2bed33db9fd349efa (commit)
       via  08d132eca6a97c3417dc0f13bb603f080bd0e222 (commit)
       via  3da5fd3eade3050336ff52aa81bfcccfe3b302ca (commit)
      from  d785bd7751b24ca30cf4679413db9dff5d15a80c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0f21021fea8f99d28b4507c3cffa55cbdd6f110d
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jun 7 23:41:52 2013 -0700

    fix XSS

diff --git a/httemplate/elements/search-cust_main.html b/httemplate/elements/search-cust_main.html
index e8c645e..ba6a479 100644
--- a/httemplate/elements/search-cust_main.html
+++ b/httemplate/elements/search-cust_main.html
@@ -19,7 +19,7 @@ Example:
        NAME = "<% $field %>_search"
        ID   = "<% $field %>_search"
        SIZE = "32"
-       VALUE="<% $cust_main ? $cust_main->name : '(cust #, name or company)' %>"
+       VALUE="<% $cust_main ? $cust_main->name : '(cust #, name or company)' |h %>"
        onFocus="clearhint_<% $field %>_search(this);"
        onClick="clearhint_<% $field %>_search(this);"
        onChange="smart_<% $field %>_search(this);"

commit 42eaf0aec334e15163848eb2bed33db9fd349efa
Merge: 08d132e d785bd7
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jun 7 23:41:46 2013 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit 08d132eca6a97c3417dc0f13bb603f080bd0e222
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jun 7 01:37:19 2013 -0700

    add fields to svc_phone: SMS provider, SMS provider acct#, max simultaneous calls

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 21c2669..71d84cc 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -3573,8 +3573,9 @@ sub tables_hashref {
 
     'cdr_carrier' => {
       'columns' => [
-        'carrierid'   => 'serial',  '', '', '', '',
-        'carriername' => 'varchar', '', $char_d, '', '',
+        'carrierid'   =>  'serial',     '',      '', '', '',
+        'carriername' => 'varchar',     '', $char_d, '', '',
+        'disabled'    =>    'char', 'NULL',       1, '', '', 
       ],
       'primary_key' => 'carrierid',
       'unique'      => [],
@@ -3719,31 +3720,34 @@ sub tables_hashref {
 
     'svc_phone' => {
       'columns' => [
-        'svcnum',       'int',         '',      '', '', '', 
-        'countrycode',  'varchar',     '',       3, '', '', 
-        'phonenum',     'varchar',     '',      25, '', '',  #12 ?
-        'sim_imsi',     'varchar', 'NULL',      15, '', '',
-        'pin',          'varchar', 'NULL', $char_d, '', '',
-        'sip_password', 'varchar', 'NULL', $char_d, '', '',
-        'phone_name',   'varchar', 'NULL', $char_d, '', '',
-        'pbxsvc',           'int', 'NULL',      '', '', '',
-        'domsvc',           'int', 'NULL',      '', '', '', 
-        'locationnum',      'int', 'NULL', '', '', '',
-        'forwarddst',     'varchar',     'NULL',      15, '', '', 
-        'email',           'varchar', 'NULL',  255, '', '', 
-        'lnp_status',   'varchar', 'NULL', $char_d, '', '',
-        'portable',   	'char', 'NULL',       1,  '', '', 
-        'lrn',     'char',     'NULL',      10, '', '', 
-	'lnp_desired_due_date',     'int', 'NULL',       '', '', '',
-	'lnp_due_date',     'int', 'NULL',       '', '', '',
-        'lnp_other_provider', 'varchar', 'NULL', $char_d,  '', '',
-        'lnp_other_provider_account', 'varchar', 'NULL', $char_d,  '', '',
-        'lnp_reject_reason', 'varchar', 'NULL', $char_d,  '', '',
+        'svcnum',                         'int',     '',      '', '', '', 
+        'countrycode',                'varchar',     '',       3, '', '', 
+        'phonenum',                   'varchar',     '',      25, '', '', #12 ?
+        'sim_imsi',                   'varchar', 'NULL',      15, '', '',
+        'pin',                        'varchar', 'NULL', $char_d, '', '',
+        'sip_password',               'varchar', 'NULL', $char_d, '', '',
+        'phone_name',                 'varchar', 'NULL', $char_d, '', '',
+        'pbxsvc',                         'int', 'NULL',      '', '', '',
+        'domsvc',                         'int', 'NULL',      '', '', '', 
+        'locationnum',                    'int', 'NULL',      '', '', '',
+        'forwarddst',                 'varchar', 'NULL',      15, '', '', 
+        'email',                      'varchar', 'NULL',     255, '', '', 
+        'lnp_status',                 'varchar', 'NULL', $char_d, '', '',
+        'portable',                      'char', 'NULL',       1, '', '', 
+        'lrn',                           'char', 'NULL',      10, '', '', 
+        'lnp_desired_due_date',           'int', 'NULL',      '', '', '',
+        'lnp_due_date',                   'int', 'NULL',      '', '', '',
+        'lnp_other_provider',         'varchar', 'NULL', $char_d, '', '',
+        'lnp_other_provider_account', 'varchar', 'NULL', $char_d, '', '',
+        'lnp_reject_reason',          'varchar', 'NULL', $char_d, '', '',
+        'sms_carrierid',                  'int', 'NULL',      '', '', '',
+        'sms_account',                'varchar', 'NULL',      '', '', '',
+        'max_simultaneous',               'int', 'NULL',      '', '', '',
       ],
       'primary_key' => 'svcnum',
-      'unique' => [],
+      'unique' => [ [ 'sms_carrierid', 'sms_account'] ],
       'index'  => [ ['countrycode', 'phonenum'], ['pbxsvc'], ['domsvc'],
-                    ['locationnum'],
+                    ['locationnum'], ['sms_carrierid'],
                   ],
     },
 
diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm
index ee25740..65a98d2 100644
--- a/FS/FS/svc_phone.pm
+++ b/FS/FS/svc_phone.pm
@@ -173,6 +173,15 @@ sub table_info {
                          select_label => 'domain',
                          disable_inventory => 1,
                        },
+        'sms_carrierid'    => { label             => 'SMS Carrier',
+                                type              => 'select',
+                                select_table      => 'cdr_carrier',
+                                select_key        => 'carrierid',
+                                select_label      => 'carriername',
+                                disable_inventory => 1,
+                              },
+        'sms_account'      => { label => 'SMS Carrier Account', },
+        'max_simultaneous' => { label=>'Maximum number of simultaneous users' },
         'locationnum' => {
                            label => 'E911 location',
                            disable_inventory => 1,
@@ -475,6 +484,9 @@ sub check {
     || $self->ut_textn('phone_name')
     || $self->ut_foreign_keyn('pbxsvc', 'svc_pbx',    'svcnum' )
     || $self->ut_foreign_keyn('domsvc', 'svc_domain', 'svcnum' )
+    || $self->ut_foreign_keyn('sms_carrierid', 'cdr_carrier', 'carrierid' )
+    || $self->ut_alphan('sms_account')
+    || $self->ut_numbern('max_simultaneous')
     || $self->ut_foreign_keyn('locationnum', 'cust_location', 'locationnum')
     || $self->ut_numbern('forwarddst')
     || $self->ut_textn('email')
@@ -635,6 +647,26 @@ sub radius_groups {
   ();
 }
 
+=item sms_cdr_carrier
+
+=cut
+
+sub sms_cdr_carrier {
+  my $self = shift;
+  return '' unless $self->sms_carrierid;
+  qsearchs('cdr_carrier',  { 'carrierid' => $self->sms_carrierid } );
+}
+
+=item sms_carriername
+
+=cut
+
+sub sms_carriername {
+  my $self = shift;
+  my $cdr_carrier = $self->sms_cdr_carrier or return '';
+  $cdr_carrier->carriername;
+}
+
 =item phone_device
 
 Returns any FS::phone_device records associated with this service.
diff --git a/httemplate/browse/cdr_carrier.html b/httemplate/browse/cdr_carrier.html
new file mode 100644
index 0000000..3ec95f3
--- /dev/null
+++ b/httemplate/browse/cdr_carrier.html
@@ -0,0 +1,22 @@
+<& elements/browse.html,
+     'title'              => 'Carriers',
+     'name_singular'      => 'carrier',
+     'menubar'            => [ 'Add a new carrier' =>
+                                 $p.'edit/cdr_carrier.html',
+                             ],
+     'query'              => { 'table' => 'cdr_carrier', },
+     'count_query'        => 'SELECT COUNT(*) FROM cdr_carrier',
+     'header'             => [ 'Carrier', ],
+     'fields'             => [ 'carriername', ],
+     'links'              => [ $link, ],
+     'disableable'        => 1,
+     'disabled_statuspos' => 1,
+&>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $link = [ "${p}edit/cdr_carrier.html?", 'carrierid' ];
+
+</%init>
diff --git a/httemplate/edit/cdr_carrier.html b/httemplate/edit/cdr_carrier.html
new file mode 100644
index 0000000..47a358a
--- /dev/null
+++ b/httemplate/edit/cdr_carrier.html
@@ -0,0 +1,19 @@
+<& elements/edit.html,
+     'table'         => 'cdr_carrier',
+     'name_singular' => 'carrier',
+     'fields'        => [
+       { field=>'carriername',  type=>'text', size=>20 },
+       { field=>'disabled', type=>'checkbox', value=>'Y' },
+     ],
+     'labels'        => { 'carrierid'   => 'Carrier',
+                          'carriername' => 'Carrier',
+                          'disabled'    => 'Disabled',
+                        },
+     'viewall_dir' => 'browse',
+&>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/process/cdr_carrier.html b/httemplate/edit/process/cdr_carrier.html
new file mode 100644
index 0000000..72f0186
--- /dev/null
+++ b/httemplate/edit/process/cdr_carrier.html
@@ -0,0 +1,10 @@
+<& elements/process.html,
+     'table'       => 'cdr_carrier',
+     'viewall_dir' => 'browse',
+&>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/svc_phone.cgi b/httemplate/edit/svc_phone.cgi
index 13bbe82..d48e635 100644
--- a/httemplate/edit/svc_phone.cgi
+++ b/httemplate/edit/svc_phone.cgi
@@ -121,6 +121,25 @@ my $begin_callback = sub {
     ;
   }
 
+  if ( ! $bulk ) {
+
+    push @$fields,
+           {
+             type    => 'tablebreak-tr-title',
+             value   => 'Carrier Information',
+             colspan => 8,
+           },
+           { field => 'sms_carrierid',
+             label => 'SMS Carrier',
+             type  => 'select-cdr_carrier',
+           },
+           'sms_account',
+           'max_simultaneous',
+    ;
+
+  }
+
 };
 
+
 </%init>
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index aff5548..f784d2f 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -500,6 +500,7 @@ tie my %config_broadband, 'Tie::IxHash',
 tie my %config_phone, 'Tie::IxHash',
   'View/Edit phone device types' => [ $fsurl.'browse/part_device.html', 'Phone device types' ],
   'View/Edit bulk DID vendors' => [ $fsurl.'browse/did_vendor.html', 'Bulk DID vendors' ],
+  'View/Edit Carriers' => [ $fsurl.'browse/cdr_carrier.html', 'Carriers' ],
 ;
 
 tie my %config_radius, 'Tie::IxHash',
diff --git a/httemplate/elements/select-cdr_carrier.html b/httemplate/elements/select-cdr_carrier.html
new file mode 100644
index 0000000..a9dc54f
--- /dev/null
+++ b/httemplate/elements/select-cdr_carrier.html
@@ -0,0 +1,19 @@
+<% include( '/elements/select-table.html',
+              'table'         => 'cdr_carrier',
+              'name_col'      => 'carriername',
+              'empty_label'   => '(none)',
+              %opt,
+          )
+%>
+<%init>
+
+my( %opt ) = @_;
+
+$opt{'records'} = delete $opt{'cdr_carrier'}
+  if $opt{'cdr_carrier'};
+
+my %hash = ( 'disabled' => '', );
+
+$opt{'records'} ||= [ qsearch( 'cdr_carrier', \%hash ) ];
+
+</%init>
diff --git a/httemplate/elements/tr-select-cdr_carrier.html b/httemplate/elements/tr-select-cdr_carrier.html
new file mode 100644
index 0000000..b39a4d4
--- /dev/null
+++ b/httemplate/elements/tr-select-cdr_carrier.html
@@ -0,0 +1,27 @@
+% if ( scalar(@{ $opt{'cdr_carrier'} }) == 0 ) { 
+
+  <INPUT TYPE="hidden" NAME="<% $opt{'field'} || 'carrierid' %>" VALUE="">
+
+% } else { 
+
+  <TR>
+    <TD ALIGN="right"><% $opt{'label'} || 'Carrier' %></TD>
+    <TD>
+      <% include( '/elements/select-cdr_carrier.html',
+                    %opt,
+                )
+      %>
+    </TD>
+  </TR>
+
+% } 
+
+<%init>
+
+my( %opt ) = @_;
+
+my %hash = ( 'disabled' => '', );
+
+$opt{'cdr_carrier'} ||= [ qsearch( 'cdr_carrier', \%hash ) ];
+
+</%init>
diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi
index 408364a..ccd9ae7 100644
--- a/httemplate/view/svc_phone.cgi
+++ b/httemplate/view/svc_phone.cgi
@@ -31,15 +31,26 @@ if ( $conf->exists('showpasswords') ) {
 
 push @fields, qw( pin phone_name forwarddst email );
 
+push @fields, { field => 'sms_carrierid', 
+                #type=>'cdr_carrier',
+                value_callback => sub {
+                  $_[0]->sms_carriername,
+                },
+              },
+              'sms_account',
+              'max_simultaneous',
+;
+
 if ( $conf->exists('svc_phone-lnp') ) {
-push @fields, 'lnp_status',
-	    'lnp_reject_reason',
-	    { field => 'portable', type => 'checkbox', },
-	    'lrn',
-	    { field => 'lnp_desired_due_date', type => 'date', },
-	    { field => 'lnp_due_date', type => 'date', },
-	    'lnp_other_provider',
-	    'lnp_other_provider_account';
+  push @fields, 'lnp_status',
+                'lnp_reject_reason',
+                { field => 'portable', type => 'checkbox', },
+                'lrn',
+                { field => 'lnp_desired_due_date', type => 'date', },
+                { field => 'lnp_due_date', type => 'date', },
+                'lnp_other_provider',
+                'lnp_other_provider_account',
+  ;
 }
 
 my $html_foot = sub {

commit 3da5fd3eade3050336ff52aa81bfcccfe3b302ca
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jun 7 00:07:28 2013 -0700

    multi-currency, RT#21565

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 5f1611c..21c2669 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -554,10 +554,11 @@ sub tables_hashref {
     'cust_bill' => {
       'columns' => [
         #regular fields
-        'invnum',    'serial',     '', '', '', '', 
-        'custnum',      'int',     '', '', '', '', 
-        '_date',        @date_type,        '', '', 
-        'charged',      @money_type,       '', '', 
+        'invnum',         'serial',     '',      '', '', '', 
+        'custnum',           'int',     '',      '', '', '', 
+        '_date',        @date_type,                  '', '', 
+        'charged',     @money_type,                  '', '', 
+        'currency',         'char', 'NULL',       3, '', '',
         'invoice_terms', 'varchar', 'NULL', $char_d, '', '',
 
         #customer balance info at invoice generation time
@@ -581,10 +582,11 @@ sub tables_hashref {
     'cust_bill_void' => {
       'columns' => [
         #regular fields
-        'invnum',       'int',     '', '', '', '', 
-        'custnum',      'int',     '', '', '', '', 
-        '_date',        @date_type,        '', '', 
-        'charged',      @money_type,       '', '', 
+        'invnum',            'int',     '',      '', '', '', 
+        'custnum',           'int',     '',      '', '', '', 
+        '_date',        @date_type,                  '', '', 
+        'charged',     @money_type,                  '', '', 
+        'currency',         'char', 'NULL',       3, '', '',
         'invoice_terms', 'varchar', 'NULL', $char_d, '', '',
 
         #customer balance info at invoice generation time
@@ -616,6 +618,7 @@ sub tables_hashref {
         'custnum',          'int',     '',      '', '', '', 
         '_date',       @date_type,                  '', '', 
         'charged',    @money_type,                  '', '', 
+        'currency',        'char', 'NULL',       3, '', '',
         'content_pdf',     'blob', 'NULL',      '', '', '',
         'content_html',    'text', 'NULL',      '', '', '',
         'locale',       'varchar', 'NULL',      16, '', '', 
@@ -760,6 +763,8 @@ sub tables_hashref {
         'pkgpart_override',     'int', 'NULL',      '', '', '', 
         'setup',               @money_type,             '', '', 
         'recur',               @money_type,             '', '', 
+        #XXX a currency for a line item?  or just one for the entire invoice
+        #'currency',            'char', 'NULL',       3, '', '',
         'sdate',               @date_type,              '', '', 
         'edate',               @date_type,              '', '', 
         'itemdesc',         'varchar', 'NULL', $char_d, '', '', 
@@ -815,14 +820,16 @@ sub tables_hashref {
 
     'cust_bill_pkg_tax_location' => {
       'columns' => [
-        'billpkgtaxlocationnum', 'serial',      '', '', '', '',
-        'billpkgnum',               'int',      '', '', '', '',
-        'taxnum',                   'int',      '', '', '', '',
-        'taxtype',              'varchar',      '', $char_d, '', '',
-        'pkgnum',                   'int',      '', '', '', '', #redundant
-        'locationnum',              'int',      '', '', '', '', #redundant
-        'amount',                   @money_type,        '', '',
-        'taxable_billpkgnum',       'int',  'NULL', '', '', '',
+        'billpkgtaxlocationnum', 'serial',     '',      '', '', '',
+        'billpkgnum',               'int',     '',      '', '', '',
+        'taxnum',                   'int',     '',      '', '', '',
+        'taxtype',              'varchar',     '', $char_d, '', '',
+        'pkgnum',                   'int',     '',      '', '', '', #redundant
+        'locationnum',              'int',     '',      '', '', '', #redundant
+        'amount',             @money_type,                  '', '',
+        'currency',                'char', 'NULL',       3, '', '',
+        'amount',             @money_type,                  '', '',
+        'taxable_billpkgnum',       'int', 'NULL',      '', '', '',
       ],
       'primary_key' => 'billpkgtaxlocationnum',
       'unique' => [],
@@ -836,14 +843,15 @@ sub tables_hashref {
 
     'cust_bill_pkg_tax_rate_location' => {
       'columns' => [
-        'billpkgtaxratelocationnum', 'serial',      '', '', '', '',
-        'billpkgnum',                   'int',      '', '', '', '',
-        'taxnum',                       'int',      '', '', '', '',
+        'billpkgtaxratelocationnum', 'serial',      '',      '', '', '',
+        'billpkgnum',                   'int',      '',      '', '', '',
+        'taxnum',                       'int',      '',      '', '', '',
         'taxtype',                  'varchar',      '', $char_d, '', '',
         'locationtaxid',            'varchar',  'NULL', $char_d, '', '',
-        'taxratelocationnum',           'int',      '', '', '', '',
-        'amount',                       @money_type,        '', '',
-        'taxable_billpkgnum',       'int',  'NULL', '', '', '',
+        'taxratelocationnum',           'int',      '',      '', '', '',
+        'amount',                 @money_type,                   '', '',
+        'currency',                    'char', 'NULL',        3, '', '',
+        'taxable_billpkgnum',           'int', 'NULL',       '', '', '',
       ],
       'primary_key' => 'billpkgtaxratelocationnum',
       'unique' => [],
@@ -859,6 +867,8 @@ sub tables_hashref {
         'pkgpart_override',     'int', 'NULL',      '', '', '', 
         'setup',               @money_type,             '', '', 
         'recur',               @money_type,             '', '', 
+        #XXX a currency for a line item?  or just one for the entire invoice
+        #'currency',            'char', 'NULL',       3, '', '',
         'sdate',               @date_type,              '', '', 
         'edate',               @date_type,              '', '', 
         'itemdesc',         'varchar', 'NULL', $char_d, '', '', 
@@ -918,13 +928,14 @@ sub tables_hashref {
 
     'cust_bill_pkg_tax_location_void' => {
       'columns' => [
-        'billpkgtaxlocationnum',    'int',      '', '', '', '',
-        'billpkgnum',               'int',      '', '', '', '',
-        'taxnum',                   'int',      '', '', '', '',
-        'taxtype',              'varchar',      '', $char_d, '', '',
-        'pkgnum',                   'int',      '', '', '', '',
-        'locationnum',              'int',      '', '', '', '', #redundant?
-        'amount',                   @money_type,        '', '',
+        'billpkgtaxlocationnum',    'int',     '',      '', '', '',
+        'billpkgnum',               'int',     '',      '', '', '',
+        'taxnum',                   'int',     '',      '', '', '',
+        'taxtype',              'varchar',     '', $char_d, '', '',
+        'pkgnum',                   'int',     '',      '', '', '',
+        'locationnum',              'int',     '',      '', '', '', #redundant?
+        'amount',             @money_type,                  '', '',
+        'currency',                'char', 'NULL',       3, '', '',
       ],
       'primary_key' => 'billpkgtaxlocationnum',
       'unique' => [],
@@ -933,13 +944,14 @@ sub tables_hashref {
 
     'cust_bill_pkg_tax_rate_location_void' => {
       'columns' => [
-        'billpkgtaxratelocationnum',    'int',      '', '', '', '',
-        'billpkgnum',                   'int',      '', '', '', '',
-        'taxnum',                       'int',      '', '', '', '',
-        'taxtype',                  'varchar',      '', $char_d, '', '',
-        'locationtaxid',            'varchar',  'NULL', $char_d, '', '',
-        'taxratelocationnum',           'int',      '', '', '', '',
-        'amount',                       @money_type,        '', '',
+        'billpkgtaxratelocationnum',    'int',     '',      '', '', '',
+        'billpkgnum',                   'int',     '',      '', '', '',
+        'taxnum',                       'int',     '',      '', '', '',
+        'taxtype',                  'varchar',     '', $char_d, '', '',
+        'locationtaxid',            'varchar', 'NULL', $char_d, '', '',
+        'taxratelocationnum',           'int',     '',      '', '', '',
+        'amount',                 @money_type,                  '', '',
+        'currency',                    'char', 'NULL',       3, '', '',
       ],
       'primary_key' => 'billpkgtaxratelocationnum',
       'unique' => [],
@@ -948,18 +960,19 @@ sub tables_hashref {
 
     'cust_credit' => {
       'columns' => [
-        'crednum',  'serial', '', '', '', '', 
-        'custnum',  'int', '', '', '', '', 
-        '_date',    @date_type, '', '', 
-        'amount',   @money_type, '', '', 
-        'otaker',   'varchar', 'NULL', 32, '', '', 
-        'usernum',   'int', 'NULL', '', '', '',
-        'reason',   'text', 'NULL', '', '', '', 
-        'reasonnum', 'int', 'NULL', '', '', '', 
-        'addlinfo', 'text', 'NULL', '', '', '',
-        'closed',    'char', 'NULL', 1, '', '', 
-        'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances
-        'eventnum', 'int', 'NULL', '', '', '', #triggering event for commission
+        'crednum',  'serial',     '', '', '', '', 
+        'custnum',     'int',     '', '', '', '', 
+        '_date',  @date_type,             '', '', 
+        'amount', at money_type,             '', '', 
+        'currency',   'char', 'NULL',  3, '', '',
+        'otaker',  'varchar', 'NULL', 32, '', '', 
+        'usernum',     'int', 'NULL', '', '', '',
+        'reason',     'text', 'NULL', '', '', '', 
+        'reasonnum',   'int', 'NULL', '', '', '', 
+        'addlinfo',   'text', 'NULL', '', '', '',
+        'closed',     'char', 'NULL',  1, '', '', 
+        'pkgnum',      'int', 'NULL', '', '','',#desired pkgnum for pkg-balances
+        'eventnum',    'int', 'NULL', '', '','',#triggering event for commission
         #'commission_agentnum', 'int', 'NULL', '', '', '', #
       ],
       'primary_key' => 'crednum',
@@ -1085,6 +1098,7 @@ sub tables_hashref {
         'cdr_termination_percentage', 'decimal', 'NULL', '7,4', '', '',
         'invoice_terms', 'varchar', 'NULL', $char_d, '', '',
         'credit_limit', @money_typen, '', '',
+        'credit_limit_currency', 'char', 'NULL',  3, '', '',
         'archived', 'char', 'NULL', 1, '', '',
         'email_csv_cdr', 'char', 'NULL', 1, '', '',
         'accountcode_cdr', 'char', 'NULL', 1, '', '',
@@ -1404,8 +1418,9 @@ sub tables_hashref {
         'adjustmentnum', 'serial',     '',      '', '', '',
         'custnum',          'int',     '',      '', '', '',
         'taxname',      'varchar',     '', $char_d, '', '',
-        'amount',    @money_type,                   '', '', 
-        'comment',     'varchar',  'NULL', $char_d, '', '', 
+        'amount',     @money_type,                  '', '', 
+        'currency',        'char', 'NULL',       3, '', '',
+        'comment',      'varchar', 'NULL', $char_d, '', '', 
         'billpkgnum',       'int', 'NULL',      '', '', '',
         #more?  no cust_bill_pkg_tax_location?
       ],
@@ -1418,18 +1433,19 @@ sub tables_hashref {
                             #off the cust_main_county for validation and to 
                             #provide a tax rate.
       'columns' => [
-        'taxnum',   'serial',   '',    '', '', '', 
-        'district', 'varchar',  'NULL',    20, '', '',
-        'city',     'varchar',  'NULL',    $char_d, '', '',
-        'county',   'varchar',  'NULL',    $char_d, '', '', 
-        'state',    'varchar',  'NULL',    $char_d, '', '', 
-        'country',  'char',  '', 2, '', '', 
-        'taxclass',   'varchar', 'NULL', $char_d, '', '', 
-        'exempt_amount', @money_type, '', '', 
-        'tax',      'real',  '',    '', '', '', #tax %
-        'taxname',  'varchar',  'NULL',    $char_d, '', '', 
-        'setuptax',  'char', 'NULL', 1, '', '', # Y = setup tax exempt
-        'recurtax',  'char', 'NULL', 1, '', '', # Y = recur tax exempt
+        'taxnum',    'serial',     '',      '', '', '', 
+        'district', 'varchar', 'NULL',      20, '', '',
+        'city',     'varchar', 'NULL', $char_d, '', '',
+        'county',   'varchar', 'NULL', $char_d, '', '', 
+        'state',    'varchar', 'NULL', $char_d, '', '', 
+        'country',     'char',     '',       2, '', '', 
+        'taxclass', 'varchar', 'NULL', $char_d, '', '', 
+        'exempt_amount', @money_type,            '', '', 
+        'exempt_amount_currency', 'char', 'NULL', 3, '', '',
+        'tax',         'real',     '',      '', '', '', #tax %
+        'taxname',  'varchar', 'NULL', $char_d, '', '', 
+        'setuptax',    'char', 'NULL',       1, '', '', # Y = setup tax exempt
+        'recurtax',    'char', 'NULL',       1, '', '', # Y = recur tax exempt
       ],
       'primary_key' => 'taxnum',
       'unique' => [],
@@ -1526,19 +1542,17 @@ sub tables_hashref {
 
     'cust_pay_pending' => {
       'columns' => [
-        'paypendingnum','serial',      '',  '', '', '',
-        'custnum',      'int',         '',  '', '', '', 
-        'paid',         @money_type,            '', '', 
-        '_date',        @date_type,             '', '', 
-        'payby',        'char',        '',   4, '', '', #CARD/BILL/COMP, should
-                                                        # be index into payby
-                                                        # table eventually
-        'payinfo',      'varchar', 'NULL', 512, '', '', #see cust_main above
-	'paymask',      'varchar', 'NULL', $char_d, '', '', 
-        'paydate',      'varchar', 'NULL', 10, '', '', 
+        'paypendingnum',      'serial',     '',      '', '', '',
+        'custnum',               'int',     '',      '', '', '', 
+        'paid',            @money_type,                  '', '', 
+        'currency',             'char', 'NULL',       3, '', '',
+        '_date',            @date_type,                  '', '', 
+        'payby',                'char',     '',       4, '', '',
+        'payinfo',           'varchar', 'NULL',     512, '', '',
+	'paymask',           'varchar', 'NULL', $char_d, '', '', 
+        'paydate',           'varchar', 'NULL',     10, '', '', 
         'recurring_billing', 'varchar', 'NULL', $char_d, '', '',
-        #'paybatch',     'varchar', 'NULL', $char_d, '', '', #for auditing purposes.
-        'payunique',    'varchar', 'NULL', $char_d, '', '', #separate paybatch "unique" functions from current usage
+        'payunique',         'varchar', 'NULL', $char_d, '', '', #separate paybatch "unique" functions from current usage
 
         'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances
         'status',       'varchar',     '', $char_d, '', '', 
@@ -1556,35 +1570,35 @@ sub tables_hashref {
 
     'cust_pay' => {
       'columns' => [
-        'paynum',   'serial',    '',   '', '', '',
-        'custnum',  'int',    '',   '', '', '', 
-        '_date',    @date_type, '', '', 
-        'paid',     @money_type, '', '', 
-        'otaker',   'varchar', 'NULL', 32, '', '',
-        'usernum',   'int', 'NULL', '', '', '',
-        'payby',    'char',   '',     4, '', '', # CARD/BILL/COMP, should be
-                                                 # index into payby table
-                                                 # eventually
-        'payinfo',  'varchar',   'NULL', 512, '', '', #see cust_main above
-        'paymask', 'varchar', 'NULL', $char_d, '', '', 
-        'paydate',  'varchar', 'NULL', 10, '', '', 
-        'paybatch', 'varchar',   'NULL', $char_d, '', '', #for auditing purposes.
-        'payunique', 'varchar', 'NULL', $char_d, '', '', #separate paybatch "unique" functions from current usage
-        'closed',    'char', 'NULL', 1, '', '', 
+        'paynum',       'serial',    '',       '', '', '',
+        'custnum',         'int',    '',       '', '', '', 
+        '_date',     @date_type,                   '', '', 
+        'paid',      @money_type,                  '', '', 
+        'currency',       'char', 'NULL',       3, '', '',
+        'otaker',      'varchar', 'NULL',      32, '', '',
+        'usernum',         'int', 'NULL',      '', '', '',
+        'payby',          'char',     '',       4, '', '',
+        'payinfo',     'varchar', 'NULL',     512, '', '',
+        'paymask',     'varchar', 'NULL', $char_d, '', '', 
+        'paydate',     'varchar', 'NULL',      10, '', '', 
+        'paybatch',    'varchar', 'NULL', $char_d, '', '',#for auditing purposes
+        'payunique',   'varchar', 'NULL', $char_d, '', '',#separate paybatch "unique" functions from current usage
+        'closed',         'char', 'NULL',       1, '', '', 
         'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances
+
         # cash/check deposit info fields
-        'bank',       'varchar', 'NULL', $char_d, '', '',
-        'depositor',  'varchar', 'NULL', $char_d, '', '',
-        'account',    'varchar', 'NULL', 20,      '', '',
-        'teller',     'varchar', 'NULL', 20,      '', '',
+        'bank',        'varchar', 'NULL', $char_d, '', '',
+        'depositor',   'varchar', 'NULL', $char_d, '', '',
+        'account',     'varchar', 'NULL',      20, '', '',
+        'teller',      'varchar', 'NULL',      20, '', '',
 
-        'batchnum',       'int', 'NULL', '', '', '', #pay_batch foreign key
+        'batchnum',        'int', 'NULL',      '', '', '',#pay_batch foreign key
 
         # credit card/EFT fields (formerly in paybatch)
-        'gatewaynum',     'int', 'NULL', '', '', '', # payment_gateway FK
-        'processor',  'varchar', 'NULL', $char_d, '', '', # module name
-        'auth',       'varchar','NULL',16, '', '', # CC auth number
-        'order_number','varchar','NULL',$char_d, '', '', # transaction number
+        'gatewaynum',      'int', 'NULL',      '', '', '', # payment_gateway FK
+        'processor',   'varchar', 'NULL', $char_d, '', '', # module name
+        'auth',        'varchar', 'NULL',      16, '', '', # CC auth number
+        'order_number','varchar', 'NULL', $char_d, '', '', # transaction number
       ],
       'primary_key' => 'paynum',
       #i guess not now, with cust_pay_pending, if we actually make it here, we _do_ want to record it# 'unique' => [ [ 'payunique' ] ],
@@ -1593,38 +1607,38 @@ sub tables_hashref {
 
     'cust_pay_void' => {
       'columns' => [
-        'paynum',    'int',    '',   '', '', '', 
-        'custnum',   'int',    '',   '', '', '', 
-        '_date',     @date_type, '', '', 
-        'paid',      @money_type, '', '', 
-        'otaker',   'varchar', 'NULL', 32, '', '', 
-        'usernum',   'int', 'NULL', '', '', '',
-        'payby',     'char',   '',     4, '', '', # CARD/BILL/COMP, should be
-                                                  # index into payby table
-                                                  # eventually
-        'payinfo',   'varchar',   'NULL', 512, '', '', #see cust_main above
-	'paymask', 'varchar', 'NULL', $char_d, '', '', 
+        'paynum',          'int',    '',       '', '', '', 
+        'custnum',         'int',    '',       '', '', '', 
+        '_date',      @date_type,                  '', '', 
+        'paid',      @money_type,                  '', '', 
+        'currency',       'char', 'NULL',       3, '', '',
+        'otaker',      'varchar', 'NULL',      32, '', '', 
+        'usernum',         'int', 'NULL',      '', '', '',
+        'payby',          'char',     '',       4, '', '',
+        'payinfo',     'varchar', 'NULL',     512, '', '',
+	'paymask',     'varchar', 'NULL', $char_d, '', '', 
         #'paydate' ?
-        'paybatch',  'varchar',   'NULL', $char_d, '', '', #for auditing purposes.
-        'closed',    'char', 'NULL', 1, '', '', 
-        'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances
+        'paybatch',    'varchar', 'NULL', $char_d, '', '', #for auditing purposes.
+        'closed',        'char',  'NULL',       1, '', '', 
+        'pkgnum', 'int',   'NULL', '', '', '', #desired pkgnum for pkg-balances
+
         # cash/check deposit info fields
         'bank',       'varchar', 'NULL', $char_d, '', '',
         'depositor',  'varchar', 'NULL', $char_d, '', '',
-        'account',    'varchar', 'NULL', 20,      '', '',
-        'teller',     'varchar', 'NULL', 20,      '', '',
-        'batchnum',       'int', 'NULL', '', '', '', #pay_batch foreign key
+        'account',    'varchar', 'NULL',      20, '', '',
+        'teller',     'varchar', 'NULL',      20, '', '',
+        'batchnum',       'int', 'NULL',      '', '', '', #pay_batch foreign key
 
         # credit card/EFT fields (formerly in paybatch)
-        'gatewaynum',     'int', 'NULL', '', '', '', # payment_gateway FK
-        'processor',  'varchar', 'NULL', $char_d, '', '', # module name
-        'auth',       'varchar','NULL',16, '', '', # CC auth number
-        'order_number', 'varchar','NULL',$char_d, '', '', # transaction number
+        'gatewaynum',      'int', 'NULL',      '', '', '', # payment_gateway FK
+        'processor',   'varchar', 'NULL', $char_d, '', '', # module name
+        'auth',        'varchar', 'NULL',      16, '', '', # CC auth number
+        'order_number','varchar', 'NULL', $char_d, '', '', # transaction number
 
         #void fields
-        'void_date', @date_type, '', '', 
-        'reason',    'varchar',   'NULL', $char_d, '', '', 
-        'void_usernum',   'int', 'NULL', '', '', '',
+        'void_date',  @date_type,                  '', '', 
+        'reason',      'varchar', 'NULL', $char_d, '', '', 
+        'void_usernum',    'int', 'NULL',      '', '', '',
       ],
       'primary_key' => 'paynum',
       'unique' => [],
@@ -1692,27 +1706,27 @@ sub tables_hashref {
 
     'cust_pay_batch' => { #list of customers in current CARD/CHEK batch
       'columns' => [
-        'paybatchnum',   'serial',    '',   '', '', '', 
-        'batchnum',   'int',    '',   '', '', '', 
-        'invnum',   'int',    '',   '', '', '', 
-        'custnum',   'int',    '',   '', '', '', 
-        'last',     'varchar', '',     $char_d, '', '', 
-        'first',    'varchar', '',     $char_d, '', '', 
-        'address1', 'varchar', '',     $char_d, '', '', 
-        'address2', 'varchar', 'NULL', $char_d, '', '', 
-        'city',     'varchar', '',     $char_d, '', '', 
-        'state',    'varchar', 'NULL', $char_d, '', '', 
-        'zip',      'varchar', 'NULL', 10, '', '', 
-        'country',  'char', '',     2, '', '', 
-        #        'trancode', 'int', '', '', '', ''
-        'payby',    'char',        '',       4, '', '',
-        'payinfo',  'varchar', 'NULL',     512, '', '', 
-        #'exp',      @date_type, '', ''
-        'exp',      'varchar', 'NULL',      11, '', '', 
-        'payname',  'varchar', 'NULL', $char_d, '', '', 
-        'amount',   @money_type, '', '', 
-        'status',   'varchar', 'NULL', $char_d, '', '', 
-        'error_message',   'varchar', 'NULL', $char_d, '', '',
+        'paybatchnum',    'serial',     '',      '', '', '', 
+        'batchnum',          'int',     '',      '', '', '', 
+        'invnum',            'int',     '',      '', '', '', 
+        'custnum',           'int',     '',      '', '', '', 
+        'last',          'varchar',     '', $char_d, '', '', 
+        'first',         'varchar',     '', $char_d, '', '', 
+        'address1',      'varchar',     '', $char_d, '', '', 
+        'address2',      'varchar', 'NULL', $char_d, '', '', 
+        'city',          'varchar',     '', $char_d, '', '', 
+        'state',         'varchar', 'NULL', $char_d, '', '', 
+        'zip',           'varchar', 'NULL',      10, '', '', 
+        'country',          'char',     '',       2, '', '', 
+        'payby',            'char',     '',       4, '', '',
+        'payinfo',       'varchar', 'NULL',     512, '', '', 
+        #'exp',          @date_type,                  '', '',
+        'exp',           'varchar', 'NULL',      11, '', '', 
+        'payname',       'varchar', 'NULL', $char_d, '', '', 
+        'amount',      @money_type,                  '', '', 
+        'currency',         'char', 'NULL',       3, '', '',
+        'status',        'varchar', 'NULL', $char_d, '', '', 
+        'error_message', 'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'paybatchnum',
       'unique' => [],

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Schema.pm                                    |  352 ++++++++++---------
 FS/FS/svc_phone.pm                                 |   32 ++
 httemplate/browse/cdr_carrier.html                 |   22 ++
 httemplate/edit/cdr_carrier.html                   |   19 +
 .../edit/process/{rate.cgi => cdr_carrier.html}    |    7 +-
 httemplate/edit/svc_phone.cgi                      |   19 +
 httemplate/elements/menu.html                      |    1 +
 httemplate/elements/search-cust_main.html          |    2 +-
 httemplate/elements/select-cdr_carrier.html        |   19 +
 httemplate/elements/tr-select-cdr_carrier.html     |   27 ++
 httemplate/view/svc_phone.cgi                      |   27 +-
 11 files changed, 348 insertions(+), 179 deletions(-)
 create mode 100644 httemplate/browse/cdr_carrier.html
 create mode 100644 httemplate/edit/cdr_carrier.html
 copy httemplate/edit/process/{rate.cgi => cdr_carrier.html} (52%)
 mode change 100755 => 100644
 create mode 100644 httemplate/elements/select-cdr_carrier.html
 create mode 100644 httemplate/elements/tr-select-cdr_carrier.html




More information about the freeside-commits mailing list