import torrus 1.0.9
[freeside.git] / FS / FS / cdr / wip.pm
1 package FS::cdr::wip;
2
3 use strict;
4 use vars qw( @ISA %info );
5 use FS::cdr qw(_cdr_date_parser_maker);
6
7 @ISA = qw(FS::cdr);
8
9 %info = (
10   'name'          => 'WIP',
11   'weight'        => 100,
12   'header'        => 1,
13   'type'          => 'csv',
14   'sep_char'      => ':',
15   'import_fields' => [
16 # All of these are based on the January 2010 version of the spec,
17 # except that we assume that before all the fields mentioned in the
18 # spec, there's a counter field.
19     skip(4),          # counter, id, APCSJursID, RecordType
20     sub { my($cdr, $data, $conf, $param) = @_;
21           $param->{skiprow} = 1 if $data == 1;
22           $cdr->uniqueid($data);
23     },      # CDRID; is 1 for line charge records
24     skip(1),          # AccountNumber; empty
25     'charged_party',  # ServiceNumber
26     skip(1),          # ServiceNumberType
27     'src',            # PointOrigin
28     'dst',            # PointTarget
29     'calltypenum',    # Jurisdiction: need to remap
30     _cdr_date_parser_maker('startdate'), #TransactionDate
31     skip(3),          # BillClass, TypeIDUsage, ElementID
32     'duration',       # PrimaryUnits
33     skip(6),          # CompletionStatus, Latitude, Longitude, 
34                       # OriginDescription, TargetDescription, RatePeriod
35     'billsec',        # RatedUnits; seems to always be equal to PrimaryUnits
36     skip(6),  #SecondsUnits, ThirdUnits, FileID, OriginalExtractSequenceNumber,
37               #RateClass, #ProviderClass
38     skip(8),  #ProviderID, CurrencyCode, EquipmentTypeCode, ClassOfServiceCode,
39               #RateUnitsType, DistanceBandID, ZoneClass, CDRStatus
40     'upstream_price', # ISPBuy
41     skip(2),          # EUBuy, CDRFromCarrier
42     ],
43
44 );
45
46 sub skip { map {''} (1..$_[0]) }
47
48 1;