Deprecated
This CDS view is deprecated in S/4HANA. View all deprecated CDS views →

P_BR_ReportingNFTaxCalculation

DDL: P_BR_REPORTINGNFTAXCALCULATION SQL: PBRNFTAXCALC Type: view CONSUMPTION

EFD - NF Calculated Tax Value Cube

P_BR_ReportingNFTaxCalculation is a Consumption CDS View that provides data about "EFD - NF Calculated Tax Value Cube" in SAP S/4HANA. It reads from 1 data source (P_BR_ReportingNFTaxRate) and exposes 206 fields with key fields BR_NotaFiscal, BR_NotaFiscalItem. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
P_BR_ReportingNFTaxRate P_BR_ReportingNFTaxRate from

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_BR_TaxType _Txtype $projection.BR_TaxType = _Txtype.BR_TaxType and $projection.OriginalTaxGroup = _Txtype.BR_TaxGroup

Annotations (14)

NameValueLevelField
AbapCatalog.sqlViewName PBRNFTAXCALC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #NOT_REQUIRED view
Metadata.ignorePropagatedAnnotations true view
EndUserText.label EFD - NF Calculated Tax Value Cube view
VDM.private true view
VDM.viewType #CONSUMPTION view
VDM.lifecycle.status #DEPRECATED view
VDM.lifecycle.successor view

Fields (206)

KeyFieldSource TableSource FieldDescription
KEY BR_NotaFiscal BR_NotaFiscal Nota Fiscal
KEY BR_NotaFiscalItem BR_NotaFiscalItem NF Item Number
BR_TaxType BR_TaxType
OriginalTaxGroup OriginalTaxGroup
CompanyCode CompanyCode Receiver Company Code
BusinessPlace BusinessPlace Business place
BR_PaymentForm BR_PaymentForm
BR_NFIssueDate BR_NFIssueDate
BR_NFSeries BR_NFSeries
BR_NFPartnerType BR_NFPartnerType
PartnerFieldLength
BR_NFPartner BR_NFPartner
LicensePlate LicensePlate
BR_NFeNumber BR_NFeNumber
BR_NFIssuedBy BR_NFIssuedBy
BR_NFSituationCode BR_NFSituationCode
BR_NFType BR_NFType
BR_NFDocumentType BR_NFDocumentType
BR_NFModel BR_NFModel
BR_NFDirection BR_NFDirection
BR_IsNFe BR_IsNFe
BR_NFPartnerRegionCode BR_NFPartnerRegionCode
BR_NFIsCanceled BR_NFIsCanceled
BR_CTeJurisdictionCodeOrigin BR_CTeJurisdictionCodeOrigin
BR_CTeJurisdictionCodeDest BR_CTeJurisdictionCodeDest
FreightPayer FreightPayer Freight Payer
BR_NFPartnerTaxJurisdiction BR_NFPartnerTaxJurisdiction
BR_NFCancellationDate BR_NFCancellationDate
BR_NFShippingUnitBrand BR_NFShippingUnitBrand
BR_NFSVerificationCode BR_NFSVerificationCode
BR_NFSubSeries BR_NFSubSeries
SupplierInvoice SupplierInvoice
BR_NFSNumber BR_NFSNumber
BR_NFPartnerStateTaxNumber BR_NFPartnerStateTaxNumber
BR_NFIsMunicipal BR_NFIsMunicipal
BR_NFHasServiceItem BR_NFHasServiceItem
SalesDocumentCurrency SalesDocumentCurrency Currency
HeaderWeightUnit HeaderWeightUnit
IncotermsClassification IncotermsClassification Incoterms
BR_NFPartnerMunicipalTaxNumber BR_NFPartnerMunicipalTaxNumber
BR_NFReferenceDocument BR_NFReferenceDocument
BR_NFPostingDate BR_NFPostingDate
CreationDate CreationDate Time Stamp
CreatedByUser CreatedByUser User Name
BR_NFIsCreatedManually BR_NFIsCreatedManually Manually Created NF
BR_NFPartnerFunction BR_NFPartnerFunction
AccountingDocument AccountingDocument Journal Entry
BR_NFIsContingency BR_NFIsContingency
BR_CTeDocumentType BR_CTeDocumentType
BR_CTeServiceType BR_CTeServiceType
PaymentTerms PaymentTerms Pyt Terms
BR_NFArrivalOrDepartureDate BR_NFArrivalOrDepartureDate
BR_NFPartnerName1 BR_NFPartnerName1
BR_NFPartnerDistrictName BR_NFPartnerDistrictName
BR_NFPartnerCityName BR_NFPartnerCityName
BR_NFPartnerPostalCode BR_NFPartnerPostalCode
BR_NFPartnerStreetName BR_NFPartnerStreetName
BusinessPartnerHouseNumber BusinessPartnerHouseNumber
BPHsNmbrSuplmntTxt BPHsNmbrSuplmntTxt
PhoneNumber PhoneNumber Telephone no.
MaterialOldID MaterialOldID
Material Material Vehicle Model
MaterialName MaterialName Material Description
BR_NFIsPhysicalMvtOfMaterial BR_NFIsPhysicalMvtOfMaterial
BR_ICMSTaxSituation BR_ICMSTaxSituation
BR_CFOPCode BR_CFOPCode
BR_IPITaxSituation BR_IPITaxSituation
BR_PISTaxSituation BR_PISTaxSituation
BR_COFINSTaxSituation BR_COFINSTaxSituation
GLAccount GLAccount General Ledger
BR_MaterialUsage BR_MaterialUsage Material Usage
ValuationType ValuationType Valuation Type
BR_NFExternalItemNumber BR_NFExternalItemNumber
BR_NFIsServiceItem BR_NFIsServiceItem
BR_ICMSTaxLaw BR_ICMSTaxLaw
BR_IPITaxLaw BR_IPITaxLaw
BR_MaterialOrigin BR_MaterialOrigin Material Origin
BR_COFINSTaxLaw BR_COFINSTaxLaw
BR_PISTaxLaw BR_PISTaxLaw
QuantityInBaseUnit QuantityInBaseUnit Quantity
BR_NFItemType BR_NFItemType
BR_IPIControlSealCode BR_IPIControlSealCode
BR_IPIControlSealQuantityValue BR_IPIControlSealQuantityValue
BR_ICMSBaseDetn BR_ICMSBaseDetn
PurchaseOrder PurchaseOrder Purchasing Document
PurchaseOrderItem PurchaseOrderItem Purchasing Document Item
NFHeaderTotalAmount NFHeaderTotalAmount
NetPriceAmount NetPriceAmount Net Price
BR_NFTotalAmount BR_NFTotalAmount
BR_NFTotalAmountWithTaxes BR_NFTotalAmountWithTaxes
BR_NFValueAmountWithTaxes BR_NFValueAmountWithTaxes
NetValueAmount NetValueAmount
BR_NFDiscountAmountWithTaxes BR_NFDiscountAmountWithTaxes
BR_NFFreightAmountWithTaxes BR_NFFreightAmountWithTaxes
BR_NFInsuranceAmountWithTaxes BR_NFInsuranceAmountWithTaxes
BR_NFNetOtherExpensesAmount BR_NFNetOtherExpensesAmount
BR_ExemptedICMSAmount BR_ExemptedICMSAmount
NCMCode NCMCode
BR_NFSourceDocumentNumber BR_NFSourceDocumentNumber
BR_NFSourceDocumentType BR_NFSourceDocumentType
BR_NFSourceDocumentItem BR_NFSourceDocumentItem
Plant Plant Valuation Area
Batch Batch Lot No.
BR_ISSTaxSituation BR_ISSTaxSituation
BR_ISSTaxLaw BR_ISSTaxLaw
BR_NFItemIsStatistical BR_NFItemIsStatistical
BR_ReferenceNFNumber BR_ReferenceNFNumber
BR_ReferenceNFItem BR_ReferenceNFItem
BR_NFPriceAmountWithTaxes BR_NFPriceAmountWithTaxes
CostCenter CostCenter Cost Center
BR_NBSCode BR_NBSCode
BaseUnit BaseUnit Unit of Measure
TaxGroup TaxGroup Tax Group
BR_NFItemOriginalBaseAmount BR_NFItemOriginalBaseAmount
BR_OriglNFItemExclBaseAmount BR_OriglNFItemExclBaseAmount
BR_OriglNFItemOtherBaseAmount BR_OriglNFItemOtherBaseAmount
BR_OriginalNFItemTaxRate BR_OriginalNFItemTaxRate
BR_NFItemOriginalTaxAmount BR_NFItemOriginalTaxAmount
BR_NFItemTaxBasePct1 BR_NFItemTaxBasePct1
BR_NFItemTaxBasePct2 BR_NFItemTaxBasePct2
BR_NFItemIsStatisticalTax BR_NFItemIsStatisticalTax
BR_NFItemHasFixedMktTariff BR_NFItemHasFixedMktTariff
BR_NFItemFixedMktTariffBaseQty BR_NFItemFixedMktTariffBaseQty
BR_NFItemFixedMarketTariffUnit BR_NFItemFixedMarketTariffUnit
BR_NFItemWhldgCollectionCode BR_NFItemWhldgCollectionCode
BR_NFItemFixedMktTariffTaxRate BR_NFItemFixedMktTariffTaxRate
BR_NFItemFixedMktTariffQty BR_NFItemFixedMktTariffQty
BR_NFItmFxdMktTariffUnit4Dcmls BR_NFItmFxdMktTariffUnit4Dcmls
BR_NFItemHasWithholdingTax BR_NFItemHasWithholdingTax
BR_NFSServiceTypeIncoming BR_NFSServiceTypeIncoming
BR_NFSServiceTypeOutgoing BR_NFSServiceTypeOutgoing
TaxJurisdiction TaxJurisdiction Tax Jurisdiction
BR_UFTaxJurisdiction BR_UFTaxJurisdiction
BR_NFIsTaxInNetAmount BR_NFIsTaxInNetAmount
BR_ICMSIsIncludedInAmount BR_ICMSIsIncludedInAmount
NFItemExcludedBaseAmount NFItemExcludedBaseAmount
NFItemOtherBaseAmount NFItemOtherBaseAmount
NFItemBaseAmount NFItemBaseAmount
BR_IPIReductionTaxAmount BR_IPIReductionTaxAmount
BR_ICMSReductionTaxAmount BR_ICMSReductionTaxAmount
BR_TaxIsISSQN BR_TaxIsISSQN
NFItemTaxRate NFItemTaxRate
NFItemTaxAmount NFItemTaxAmount
BR_ICMSPartilhaSubdivisionCode _Txtype BR_ICMSPartilhaSubdivisionCode
BR_ISSQNTaxRate
BR_ISSQNTaxAmount
BR_ISSQNTaxExcludedBaseAmount
BR_ISSQNTaxOtherBaseAmount
BR_ICMSTaxAmount
BR_ICMSTaxExcludedBaseAmount
BR_ICMSTaxOtherBaseAmount
BR_ICMSSTTaxRate
BR_ICMSSTTaxAmount
BR_ICMSSTTaxExcludedBaseAmount
BR_ICMSSTTaxOtherBaseAmount
BR_IPITaxRate
BR_IPITaxAmount
BR_IPITaxExcludedBaseAmount
BR_IPITaxOtherBaseAmount
BR_AppliedPISTaxAmount
BR_PISTaxAmount
BR_PISTaxExcludedBaseAmount
BR_PISTaxOtherBaseAmount
BR_PISTaxIsFiscalTariff
BR_PISTxFiscalTariffBaseAmount
BR_PISSTTaxRate
BR_PISSTTaxAmount
BR_PISSTTaxExcludedBaseAmount
BR_PISSTTaxOtherBaseAmount
BR_PISSTTaxIsFiscalTariff
BR_PISSTTxFsclTariffBaseAmount
BR_AppliedCOFINSTaxAmount
BR_COFINSTaxAmount
BR_COFINSTaxExcludedBaseAmount
BR_COFINSTaxOtherBaseAmount
BR_COFINSTaxIsFiscalTariff
BR_COFINSTxFsclTrifBaseAmount
BR_COFINSSTTaxRate
BR_COFINSSTTaxAmount
BR_COFINSSTTaxExcldBaseAmount
BR_COFINSSTTaxOtherBaseAmount
BR_COFINSSTTaxIsFiscalTariff
BR_COFINSSTTxFsclTrifBaseAmt
BR_IRRFTaxAmount
BR_DIFALTaxRate
BR_DIFALTaxAmount
BR_DIFALTaxExcludedBaseAmount
BR_DIFALTaxOtherBaseAmount
BR_DIFALTaxIsFiscalTariff
BR_DIFALTxFsclTariffBaseAmount
BR_OriginalIPITaxAmount
BR_OriginalPISTaxAmount
BR_OriginalCOFINSTaxAmount
BR_OriginalFCPOnICMSTaxAmount
BR_OriglFCPOnICMSSTTaxAmount
BR_ICMSOriginTaxRate
BR_ICMSOriginTaxAmount
BR_ICMSDestinationTaxRate
BR_ICMSDestinationTaxAmount
BR_FCPOnICMSTaxAmount
BR_FCPOnICMSSTTaxAmount
BR_ICMSSTStatisticalTaxAmount
BR_IPIStatisticalTaxAmount
BR_ICZGTaxAmount
BR_PISIsIncludedInAmount
BR_COFINSIsIncludedInAmount

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_BR_ReportingNFTaxCalculation.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PBRNFTAXCALC

CREATE VIEW P_BR_ReportingNFTaxCalculation AS
SELECT
  BR_NotaFiscal,
  BR_NotaFiscalItem,
  BR_TaxType,
  OriginalTaxGroup,
  CompanyCode,
  BusinessPlace,
  BR_PaymentForm,
  BR_NFIssueDate,
  BR_NFSeries,
  BR_NFPartnerType,
  length(BR_NFPartner) AS PartnerFieldLength,
  BR_NFPartner,
  LicensePlate,
  BR_NFeNumber,
  BR_NFIssuedBy,
  BR_NFSituationCode,
  BR_NFType,
  BR_NFDocumentType,
  BR_NFModel,
  BR_NFDirection,
  BR_IsNFe,
  BR_NFPartnerRegionCode,
  BR_NFIsCanceled,
  BR_CTeJurisdictionCodeOrigin,
  BR_CTeJurisdictionCodeDest,
  FreightPayer,
  BR_NFPartnerTaxJurisdiction,
  BR_NFCancellationDate,
  BR_NFShippingUnitBrand,
  BR_NFSVerificationCode,
  BR_NFSubSeries,
  SupplierInvoice,
  BR_NFSNumber,
  BR_NFPartnerStateTaxNumber,
  BR_NFIsMunicipal,
  BR_NFHasServiceItem,
  SalesDocumentCurrency,
  HeaderWeightUnit,
  IncotermsClassification,
  BR_NFPartnerMunicipalTaxNumber,
  BR_NFReferenceDocument,
  BR_NFPostingDate,
  CreationDate,
  CreatedByUser,
  BR_NFIsCreatedManually,
  BR_NFPartnerFunction,
  AccountingDocument,
  BR_NFIsContingency,
  BR_CTeDocumentType,
  BR_CTeServiceType,
  PaymentTerms,
  BR_NFArrivalOrDepartureDate,
  BR_NFPartnerName1,
  BR_NFPartnerDistrictName,
  BR_NFPartnerCityName,
  BR_NFPartnerPostalCode,
  BR_NFPartnerStreetName,
  BusinessPartnerHouseNumber,
  BPHsNmbrSuplmntTxt,
  PhoneNumber,
  MaterialOldID,
  Material,
  MaterialName,
  BR_NFIsPhysicalMvtOfMaterial,
  BR_ICMSTaxSituation,
  BR_CFOPCode,
  BR_IPITaxSituation,
  BR_PISTaxSituation,
  BR_COFINSTaxSituation,
  GLAccount,
  BR_MaterialUsage,
  ValuationType,
  BR_NFExternalItemNumber,
  BR_NFIsServiceItem,
  BR_ICMSTaxLaw,
  BR_IPITaxLaw,
  BR_MaterialOrigin,
  BR_COFINSTaxLaw,
  BR_PISTaxLaw,
  QuantityInBaseUnit,
  BR_NFItemType,
  BR_IPIControlSealCode,
  BR_IPIControlSealQuantityValue,
  BR_ICMSBaseDetn,
  PurchaseOrder,
  PurchaseOrderItem,
  NFHeaderTotalAmount,
  NetPriceAmount,
  BR_NFTotalAmount,
  BR_NFTotalAmountWithTaxes,
  BR_NFValueAmountWithTaxes,
  NetValueAmount,
  BR_NFDiscountAmountWithTaxes,
  BR_NFFreightAmountWithTaxes,
  BR_NFInsuranceAmountWithTaxes,
  BR_NFNetOtherExpensesAmount,
  BR_ExemptedICMSAmount,
  NCMCode,
  BR_NFSourceDocumentNumber,
  BR_NFSourceDocumentType,
  BR_NFSourceDocumentItem,
  Plant,
  Batch,
  BR_ISSTaxSituation,
  BR_ISSTaxLaw,
  BR_NFItemIsStatistical,
  BR_ReferenceNFNumber,
  BR_ReferenceNFItem,
  BR_NFPriceAmountWithTaxes,
  CostCenter,
  BR_NBSCode,
  BaseUnit,
  TaxGroup,
  BR_NFItemOriginalBaseAmount,
  BR_OriglNFItemExclBaseAmount,
  BR_OriglNFItemOtherBaseAmount,
  BR_OriginalNFItemTaxRate,
  BR_NFItemOriginalTaxAmount,
  BR_NFItemTaxBasePct1,
  BR_NFItemTaxBasePct2,
  BR_NFItemIsStatisticalTax,
  BR_NFItemHasFixedMktTariff,
  BR_NFItemFixedMktTariffBaseQty,
  BR_NFItemFixedMarketTariffUnit,
  BR_NFItemWhldgCollectionCode,
  BR_NFItemFixedMktTariffTaxRate,
  BR_NFItemFixedMktTariffQty,
  BR_NFItmFxdMktTariffUnit4Dcmls,
  BR_NFItemHasWithholdingTax,
  BR_NFSServiceTypeIncoming,
  BR_NFSServiceTypeOutgoing,
  TaxJurisdiction,
  BR_UFTaxJurisdiction,
  BR_NFIsTaxInNetAmount,
  BR_ICMSIsIncludedInAmount,
  NFItemExcludedBaseAmount,
  NFItemOtherBaseAmount,
  NFItemBaseAmount,
  BR_IPIReductionTaxAmount,
  BR_ICMSReductionTaxAmount,
  BR_TaxIsISSQN,
  NFItemTaxRate,
  NFItemTaxAmount,
  _Txtype.BR_ICMSPartilhaSubdivisionCode AS BR_ICMSPartilhaSubdivisionCode,
  case when BR_TaxIsISSQN = 1 then NFItemTaxRate else 0 end AS BR_ISSQNTaxRate,
  case when BR_TaxIsISSQN = 1 then NFItemTaxAmount else 0 end AS BR_ISSQNTaxAmount,
  case when BR_TaxIsISSQN = 1 then NFItemExcludedBaseAmount else 0 end AS BR_ISSQNTaxExcludedBaseAmount,
  case when BR_TaxIsISSQN = 1 then NFItemOtherBaseAmount else 0 end AS BR_ISSQNTaxOtherBaseAmount,
  case when TaxGroup = 'ICMS' and _Txtype.BR_ICMSPartilhaSubdivisionCode = '' and _Txtype.BR_TaxType <> 'ICSC' and NFItemBaseAmount > 0 then NFItemTaxAmount else 0 end AS BR_ICMSTaxAmount,
  case when TaxGroup = 'ICMS' and _Txtype.BR_ICMSPartilhaSubdivisionCode = '' and _Txtype.BR_TaxType <> 'ICSC' then NFItemExcludedBaseAmount else 0 end AS BR_ICMSTaxExcludedBaseAmount,
  case when TaxGroup = 'ICMS' and _Txtype.BR_ICMSPartilhaSubdivisionCode = '' and _Txtype.BR_TaxType <> 'ICSC' then NFItemOtherBaseAmount else 0 end AS BR_ICMSTaxOtherBaseAmount,
  case when TaxGroup = 'ICST' and BR_NFItemIsStatisticalTax <> 'X' and _Txtype.BR_TaxType <> 'ICFP' then NFItemTaxRate else 0 end AS BR_ICMSSTTaxRate,
  case when TaxGroup = 'ICST' and BR_NFItemIsStatisticalTax <> 'X' and _Txtype.BR_TaxType <> 'ICFP' then NFItemTaxAmount else 0 end AS BR_ICMSSTTaxAmount,
  case when TaxGroup = 'ICST' and BR_NFItemIsStatisticalTax <> 'X' and _Txtype.BR_TaxType <> 'ICFP' then NFItemExcludedBaseAmount else 0 end AS BR_ICMSSTTaxExcludedBaseAmount,
  case when TaxGroup = 'ICST' and BR_NFItemIsStatisticalTax <> 'X' and _Txtype.BR_TaxType <> 'ICFP' then NFItemOtherBaseAmount else 0 end AS BR_ICMSSTTaxOtherBaseAmount,
  case when TaxGroup = 'IPI' and BR_NFItemIsStatisticalTax <> 'X' then NFItemTaxRate else 0 end AS BR_IPITaxRate,
  case when TaxGroup = 'IPI' and BR_NFItemIsStatisticalTax <> 'X' then NFItemTaxAmount else 0 end AS BR_IPITaxAmount,
  case when TaxGroup = 'IPI' and BR_NFItemIsStatisticalTax <> 'X' then NFItemExcludedBaseAmount else 0 end AS BR_IPITaxExcludedBaseAmount,
  case when TaxGroup = 'IPI' and BR_NFItemIsStatisticalTax <> 'X' then NFItemOtherBaseAmount else 0 end AS BR_IPITaxOtherBaseAmount,
  case when TaxGroup = 'PIS' then NFItemTaxRate else 0 end AS BR_AppliedPISTaxAmount,
  case when TaxGroup = 'PIS' then NFItemTaxAmount else 0 end AS BR_PISTaxAmount,
  case when TaxGroup = 'PIS' then NFItemExcludedBaseAmount else 0 end AS BR_PISTaxExcludedBaseAmount,
  case when TaxGroup = 'PIS' then NFItemOtherBaseAmount else 0 end AS BR_PISTaxOtherBaseAmount,
  case when TaxGroup = 'PIS' then BR_NFItemHasFixedMktTariff else '0' end AS BR_PISTaxIsFiscalTariff,
  case when TaxGroup = 'PIS' then BR_NFItemFixedMktTariffTaxRate else 0 end AS BR_PISTxFiscalTariffBaseAmount,
  case when TaxGroup = 'WHPI' then NFItemTaxRate else 0 end AS BR_PISSTTaxRate,
  case when TaxGroup = 'WHPI' then NFItemTaxAmount else 0 end AS BR_PISSTTaxAmount,
  case when TaxGroup = 'WHPI' then NFItemExcludedBaseAmount else 0 end AS BR_PISSTTaxExcludedBaseAmount,
  case when TaxGroup = 'WHPI' then NFItemOtherBaseAmount else 0 end AS BR_PISSTTaxOtherBaseAmount,
  case when TaxGroup = 'WHPI' then BR_NFItemHasFixedMktTariff else '0' end AS BR_PISSTTaxIsFiscalTariff,
  case when TaxGroup = 'WHPI' then BR_NFItemFixedMktTariffTaxRate else 0 end AS BR_PISSTTxFsclTariffBaseAmount,
  case when TaxGroup = 'COFI' then NFItemTaxRate else 0 end AS BR_AppliedCOFINSTaxAmount,
  case when TaxGroup = 'COFI' then NFItemTaxAmount else 0 end AS BR_COFINSTaxAmount,
  case when TaxGroup = 'COFI' then NFItemExcludedBaseAmount else 0 end AS BR_COFINSTaxExcludedBaseAmount,
  case when TaxGroup = 'COFI' then NFItemOtherBaseAmount else 0 end AS BR_COFINSTaxOtherBaseAmount,
  case when TaxGroup = 'COFI' then BR_NFItemHasFixedMktTariff else '0' end AS BR_COFINSTaxIsFiscalTariff,
  case when TaxGroup = 'COFI' then BR_NFItemFixedMktTariffTaxRate else 0 end AS BR_COFINSTxFsclTrifBaseAmount,
  case when TaxGroup = 'WHCO' then NFItemTaxRate else 0 end AS BR_COFINSSTTaxRate,
  case when TaxGroup = 'WHCO' then NFItemTaxAmount else 0 end AS BR_COFINSSTTaxAmount,
  case when TaxGroup = 'WHCO' then NFItemExcludedBaseAmount else 0 end AS BR_COFINSSTTaxExcldBaseAmount,
  case when TaxGroup = 'WHCO' then NFItemOtherBaseAmount else 0 end AS BR_COFINSSTTaxOtherBaseAmount,
  case when TaxGroup = 'WHCO' then BR_NFItemHasFixedMktTariff else '0' end AS BR_COFINSSTTaxIsFiscalTariff,
  case when TaxGroup = 'WHCO' then BR_NFItemFixedMktTariffTaxRate else 0 end AS BR_COFINSSTTxFsclTrifBaseAmt,
  case when TaxGroup = 'IRRW' then NFItemTaxAmount else 0 end AS BR_IRRFTaxAmount,
  case when TaxGroup = 'ICOP' and _Txtype.BR_TaxType <> 'ICCP' then NFItemTaxRate else 0 end AS BR_DIFALTaxRate,
  case when TaxGroup = 'ICOP' and _Txtype.BR_TaxType <> 'ICCP' then NFItemTaxAmount else 0 end AS BR_DIFALTaxAmount,
  case when TaxGroup = 'ICOP' and _Txtype.BR_TaxType <> 'ICCP' then NFItemExcludedBaseAmount else 0 end AS BR_DIFALTaxExcludedBaseAmount,
  case when TaxGroup = 'ICOP' and _Txtype.BR_TaxType <> 'ICCP' then NFItemOtherBaseAmount else 0 end AS BR_DIFALTaxOtherBaseAmount,
  case when TaxGroup = 'ICOP' and _Txtype.BR_TaxType <> 'ICCP' then BR_NFItemHasFixedMktTariff else '0' end AS BR_DIFALTaxIsFiscalTariff,
  case when TaxGroup = 'ICOP' and _Txtype.BR_TaxType <> 'ICCP' then BR_NFItemFixedMktTariffTaxRate else 0 end AS BR_DIFALTxFsclTariffBaseAmount,
  case when TaxGroup = 'IPI' and BR_NFItemIsStatisticalTax <> 'X' then BR_NFItemOriginalTaxAmount else 0 end AS BR_OriginalIPITaxAmount,
  case when TaxGroup = 'PIS' and BR_NFItemIsStatisticalTax <> 'X' then BR_NFItemOriginalTaxAmount else 0 end AS BR_OriginalPISTaxAmount,
  case when TaxGroup = 'COFI' and BR_NFItemIsStatisticalTax <> 'X' then BR_NFItemOriginalTaxAmount else 0 end AS BR_OriginalCOFINSTaxAmount,
  case when TaxGroup = 'ICMS' and BR_NFItemIsStatisticalTax <> 'X' and _Txtype.BR_TaxType = 'ICSC' then BR_NFItemOriginalTaxAmount else 0 end AS BR_OriginalFCPOnICMSTaxAmount,
  case when TaxGroup = 'ICST' and BR_NFItemIsStatisticalTax <> 'X' and _Txtype.BR_TaxType = 'ICFP' then BR_NFItemOriginalTaxAmount else 0 end AS BR_OriglFCPOnICMSSTTaxAmount,
  case when TaxGroup = 'ICMS' and _Txtype.BR_ICMSPartilhaSubdivisionCode = '002' and NFItemBaseAmount > 0 and NFItemTaxAmount > 0 then NFItemTaxRate else 0 end AS BR_ICMSOriginTaxRate,
  case when TaxGroup = 'ICMS' and _Txtype.BR_ICMSPartilhaSubdivisionCode = '002' and NFItemBaseAmount > 0 then NFItemTaxAmount else 0 end AS BR_ICMSOriginTaxAmount,
  case when TaxGroup = 'ICMS' and _Txtype.BR_ICMSPartilhaSubdivisionCode = '001' and NFItemBaseAmount > 0 and NFItemTaxAmount > 0 then NFItemTaxRate else 0 end AS BR_ICMSDestinationTaxRate,
  case when TaxGroup = 'ICMS' and _Txtype.BR_ICMSPartilhaSubdivisionCode = '001' and NFItemBaseAmount > 0 then NFItemTaxAmount else 0 end AS BR_ICMSDestinationTaxAmount,
  case when TaxGroup = 'ICMS' and _Txtype.BR_ICMSPartilhaSubdivisionCode = '003' and _Txtype.BR_TaxType <> 'ICSC' and NFItemBaseAmount > 0 then NFItemTaxAmount else 0 end AS BR_FCPOnICMSTaxAmount,
  case when TaxGroup = 'ICST' and _Txtype.BR_ICMSPartilhaSubdivisionCode = '004' and _Txtype.BR_TaxType = 'ICFP' and NFItemBaseAmount > 0 then NFItemTaxAmount else 0 end AS BR_FCPOnICMSSTTaxAmount,
  case when TaxGroup = 'ICST' and BR_NFItemIsStatisticalTax = 'X' and _Txtype.BR_TaxType <> 'ICFP' then NFItemTaxAmount else 0 end AS BR_ICMSSTStatisticalTaxAmount,
  case when TaxGroup = 'IPI' and BR_NFItemIsStatisticalTax = 'X' then NFItemTaxAmount else 0 end AS BR_IPIStatisticalTaxAmount,
  case when BR_TaxType = 'ICZG' then NFItemTaxAmount else 0 end AS BR_ICZGTaxAmount,
  case when TaxGroup = 'PIS' and BR_NFItemIsStatisticalTax <> 'X' and BR_NFIsTaxInNetAmount = 'X' then 'X' else '' end AS BR_PISIsIncludedInAmount,
  case when TaxGroup = 'COFI' and BR_NFItemIsStatisticalTax <> 'X' and BR_NFIsTaxInNetAmount = 'X' then 'X' else '' end AS BR_COFINSIsIncludedInAmount
FROM P_BR_ReportingNFTaxRate
LEFT OUTER JOIN I_BR_TaxType AS _Txtype ON BR_TaxType = _Txtype.BR_TaxType AND OriginalTaxGroup = _Txtype.BR_TaxGroup  -- association [1..1]
;