package BookPub::Import::Importer::Amigos::Version2;

use strict;

use lib '/app/tools/bookpub/lib';

use base 'BookPub::Import::Importer::Amigos';

sub _fieldMap {
    {
        dateBegin            => 'F',
        rTitle               => 'C',
        rIsbn13              => 'B',
        rInstitution         => 'K',
        rState               => 'O',
        rPostalCode          => 'P',
        serviceProductID     => 'A',
        rUnits               => 'I',
        rUnitPrice           => 'H',
        rListPrice           => 'G',
        rRevenue             => 'J',
        rChannel             => 'R',
        rModel               => 'D',
        rTransactionCategory => 'D',
    };
}

sub _processLine {
    my $self   = shift;
    my $footer = $self->_getByFieldName('serviceProductID');

    if ( $footer =~ /^Total/i ) {
        $self->{_endOfData} = 1;
    }

    return $self->SUPER::_processLine(@_);
}

1;

