package BookPub::Import::Importer::Perusall::Version5;

use strict;
use warnings;

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

use base 'BookPub::Import::Importer::Perusall::Version2';

sub _fieldMap {
    {
        dateBegin                => 'B',
        rPurchaseType            => 'L',
        purchaseType             => 'L',
        rAuthor                  => 'J',
        rTitle                   => 'I',
        rIsbn13                  => 'H',
        rInstitution             => 'D',
        rState                   => 'F',
        countryCode              => 'G',
        rUnits                   => 'C',
        rListPrice               => 'P',
        rNativeListPrice         => 'AE',
        rNativeListPriceCurrency => 'AF',
        rPurchasePrice           => 'N',
        rCOGS                    => 'X',
        rRevenue                 => 'W',
        rTaxAmount               => 'O',
        rDuration                => 'M',
        rComments                => 'Y',
    };
}

sub rNativeListPrice {
    my $self = shift;

    my $rNativeListPrice = $self->_getByFieldName('rNativeListPrice') || 0;
    $rNativeListPrice =~ s/,//g;
    $rNativeListPrice =~ s/\$//g;

    return $rNativeListPrice;
}

sub rTaxAmount {
    my $self = shift;

    my $rTaxAmount = $self->_getByFieldName('rTaxAmount') || 0;
    $rTaxAmount =~ s/,//g;
    $rTaxAmount =~ s/\$//g;

    return $rTaxAmount;
}


1;