limit sales reports for employee, RT#25524
[freeside.git] / FS / FS / Schema.pm
index 16546b3..59c2abe 100644 (file)
@@ -1018,6 +1018,37 @@ sub tables_hashref {
                  ],
     },
 
+    'cust_credit_void' => {
+      'columns' => [
+        'crednum',  'serial',     '', '', '', '', 
+        'custnum',     'int',     '', '', '', '', 
+        '_date',  @date_type,             '', '', 
+        'amount',@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', '', '','',
+        'eventnum',    'int', 'NULL', '', '','',
+        'commission_agentnum', 'int', 'NULL', '', '', '',
+        'commission_salesnum', 'int', 'NULL', '', '', '',
+        'commission_pkgnum',   'int', 'NULL', '', '', '',
+        #void fields
+        'void_date',  @date_type,                  '', '', 
+        'void_reason', 'varchar', 'NULL', $char_d, '', '', 
+        'void_usernum',    'int', 'NULL',      '', '', '',
+      ],
+      'primary_key' => 'crednum',
+      'unique' => [],
+      'index' => [ ['custnum'], ['_date'], ['usernum'], ['eventnum'],
+                   [ 'commission_salesnum' ],
+                 ],
+    },
+
+
     'cust_credit_bill' => {
       'columns' => [
         'creditbillnum', 'serial', '', '', '', '', 
@@ -1977,6 +2008,7 @@ sub tables_hashref {
       'columns' => [
         'discountnum', 'serial',     '',      '', '', '',
         #'agentnum',       'int', 'NULL',      '', '', '', 
+        'classnum',       'int', 'NULL',      '', '', '',
         'name',       'varchar', 'NULL', $char_d, '', '',
         'amount',   @money_type,                  '', '', 
         'percent',    'decimal',     '',   '7,4', '', '',
@@ -1990,12 +2022,25 @@ sub tables_hashref {
       'index'  => [], # [ 'agentnum' ], ],
     },
 
+    'discount_class' => {
+      'columns' => [
+        'classnum',    'serial',   '',      '', '', '', 
+        'classname',   'varchar',  '', $char_d, '', '', 
+        #'categorynum', 'int',  'NULL',      '', '', '', 
+        'disabled',    'char', 'NULL',       1, '', '', 
+      ],
+      'primary_key' => 'classnum',
+      'unique' => [],
+      'index' => [ ['disabled'] ],
+    },
+
     'cust_refund' => {
       'columns' => [
         'refundnum',    'serial',    '',   '', '', '', 
         'custnum',  'int',    '',   '', '', '', 
         '_date',        @date_type, '', '', 
         'refund',       @money_type, '', '', 
+        'currency',       'char', 'NULL',       3, '', '',
         'otaker',       'varchar',   'NULL',   32, '', '', 
         'usernum',   'int', 'NULL', '', '', '',
         'reason',       'varchar',   '',   $char_d, '', '', 
@@ -3071,14 +3116,17 @@ sub tables_hashref {
 
     'tower' => {
       'columns' => [
-        'towernum',   'serial',     '',      '', '', '',
-        #'agentnum',      'int', 'NULL',      '', '', '',
-        'towername', 'varchar',     '', $char_d, '', '',
-        'disabled',     'char', 'NULL',       1, '', '',
-        'latitude', 'decimal', 'NULL',   '10,7', '', '', 
-        'longitude','decimal', 'NULL',   '10,7', '', '', 
-        'altitude', 'decimal', 'NULL',       '', '', '', 
-        'coord_auto',  'char', 'NULL',        1, '', '',
+        'towernum',    'serial',     '',      '', '', '',
+        #'agentnum',       'int', 'NULL',      '', '', '',
+        'towername',  'varchar',     '', $char_d, '', '',
+        'disabled',      'char', 'NULL',       1, '', '',
+        'latitude',   'decimal', 'NULL',  '10,7', '', '', 
+        'longitude',  'decimal', 'NULL',  '10,7', '', '', 
+        'coord_auto',    'char', 'NULL',       1, '', '',
+        'altitude',   'decimal', 'NULL',      '', '', '', 
+        'height',     'decimal', 'NULL',      '', '', '', 
+        'veg_height', 'decimal', 'NULL',      '', '', '', 
+        'color',      'varchar', 'NULL',       6, '', '',
       ],
       'primary_key' => 'towernum',
       'unique'      => [ [ 'towername' ] ], # , 'agentnum' ] ],
@@ -3091,6 +3139,12 @@ sub tables_hashref {
         'towernum',       'int',     '',      '', '', '',
         'sectorname', 'varchar',     '', $char_d, '', '',
         'ip_addr',    'varchar', 'NULL',      15, '', '',
+        'height',     'decimal', 'NULL',      '', '', '', 
+        'freq_mhz',       'int', 'NULL',      '', '', '',
+        'direction',      'int', 'NULL',      '', '', '',
+        'width',          'int', 'NULL',      '', '', '',
+        #downtilt etc? rfpath has profile files for devices/antennas you upload?
+        'range',      'decimal', 'NULL',      '', '', '',  #?
       ],
       'primary_key' => 'sectornum',
       'unique'      => [ [ 'towernum', 'sectorname' ], [ 'ip_addr' ], ],
@@ -3501,6 +3555,10 @@ sub tables_hashref {
         'src_ip_addr', 'varchar',  'NULL',  15,    '', '',
         'dst_ip_addr', 'varchar',  'NULL',  15,    '', '',
 
+        #currently only u4:
+        # terminating number (as opposed to dialed destination)
+        'dst_term',    'varchar',  '', $char_d, \"''", '',
+
         #these don't seem to be logged by most of the SQL cdr_* modules
         #except tds under sql-illegal names, so;
         # ... don't rely on them for rating?
@@ -3610,7 +3668,7 @@ sub tables_hashref {
                    [ 'sessionnum' ], [ 'subscriber' ],
                    [ 'freesidestatus' ], [ 'freesiderewritestatus' ],
                    [ 'cdrbatch' ], [ 'cdrbatchnum' ],
-                   [ 'src_ip_addr' ], [ 'dst_ip_addr' ],
+                   [ 'src_ip_addr' ], [ 'dst_ip_addr' ], [ 'dst_term' ],
                  ],
     },
 
@@ -3746,6 +3804,7 @@ sub tables_hashref {
         'last',               'varchar', 'NULL', $char_d, '', '', 
         'first',              'varchar', 'NULL', $char_d, '', '', 
         'user_custnum',           'int', 'NULL',      '', '', '',
+        'report_salesnum',        'int', 'NULL',      '', '', '',
         'disabled',              'char', 'NULL',       1, '', '', 
       ],
       'primary_key' => 'usernum',
@@ -4272,6 +4331,8 @@ sub tables_hashref {
     'svc_cable' => {
       'columns' => [
         'svcnum',        'int',     '',      '', '', '', 
+        'providernum',   'int', 'NULL',      '', '', '',
+        'ordernum',  'varchar', 'NULL', $char_d, '', '',
         'modelnum',      'int', 'NULL',      '', '', '',
         'serialnum', 'varchar', 'NULL', $char_d, '', '',
         'mac_addr',  'varchar', 'NULL',      12, '', '', 
@@ -4292,6 +4353,17 @@ sub tables_hashref {
       'index'  => [],
     },
 
+    'cable_provider' => {
+      'columns' => [
+        'providernum', 'serial',     '',      '', '', '',
+        'provider',   'varchar',     '', $char_d, '', '',
+        'disabled',      'char', 'NULL',       1, '', '', 
+      ],
+      'primary_key' => 'providernum',
+      'unique' => [ [ 'provider' ], ],
+      'index'  => [],
+    },
+
     'vend_main' => {
       'columns' => [
         'vendnum',   'serial',     '',      '', '', '',
@@ -4421,6 +4493,7 @@ sub tables_hashref {
       ],
       'primary_key' => 'confnum',
       'unique' => [ [ 'modenum', 'locale' ] ],
+      'index'  => [ ],
     },
 
     # name type nullability length default local