C_AR_StRpVATForm731ItemLogC

DDL: C_AR_STRPVATFORM731ITEMLOGC SQL: CARFORM731LGC Type: view CONSUMPTION

Argentina VAT Form 731 with Rptd item log data

C_AR_StRpVATForm731ItemLogC is a Consumption CDS View (Cube) that provides data about "Argentina VAT Form 731 with Rptd item log data" in SAP S/4HANA. It reads from 5 data sources (I_Withholdingtaxitem, I_AR_TaxClassIdentification, I_Customer, I_GLAccountLineItem, I_Supplier) and exposes 37 fields with key fields CompanyCode, AccountingDocument, FiscalYear, TaxItem, TransactionTypeDetermination.

Data Sources (5)

SourceAliasJoin Type
I_Withholdingtaxitem _Withholdingtaxitem left_outer
I_AR_TaxClassIdentification I_AR_TaxClassIdentification left_outer
I_Customer I_Customer left_outer
I_GLAccountLineItem I_GLAccountLineItem left_outer
I_Supplier I_Supplier left_outer

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName CARFORM731LGC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
EndUserText.label Argentina VAT Form 731 with Rptd item log data view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
Analytics.dataCategory #CUBE view
Metadata.allowExtensions true view

Fields (37)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode TaxItem CompanyCode
KEY AccountingDocument TaxItem AccountingDocument
KEY FiscalYear TaxItem FiscalYear
KEY TaxItem TaxItem TaxItem
KEY TransactionTypeDetermination TaxItem TransactionTypeDetermination
KEY TaxCode TaxItem TaxCode
TaxReportingDate TaxItem TaxReportingDate
GLAccount TaxItem GLAccount
TaxType TaxType
PostingDate TaxItem PostingDate
ReportingDate ReportingDate
AmountInCompanyCodeCurrency I_GLAccountLineItem AmountInCompanyCodeCurrency
TaxBaseAmountInCoCodeCrcy TaxBaseAmountInCoCodeCrcy
TaxAmountInCoCodeCrcy TaxAmountInCoCodeCrcy
TaxBaseAmountInTransCrcy TaxBaseAmountInTransCrcy
TaxReturnCountry TaxReturnCountry
TaxAmountInCountryCrcy TaxAmountInCountryCrcy
TaxBaseAmountInCountryCrcy TaxBaseAmountInCountryCrcy
CompanyCodeCurrency TaxItem CompanyCodeCurrency
CompanyCodeCountry CompanyCodeCountry
DocumentCurrency TaxItem DocumentCurrency
CountryCurrency CountryCurrency
TaxCalculationProcedure TaxItem TaxCalculationProcedure
StRpTaxClassification StRpTaxClassification
AddressRegion AddressRegion
CustomerCounty CustomerCounty
MunicipalJurisdiction MunicipalJurisdiction
ZeroVATRsn ZeroVATRsn
TaxIsProRated TaxIsProRated
ResponsibleType I_Customer ResponsibleType
Customer I_Customer Customer
Supplier I_Supplier Supplier
FinancialAccountType _DebtorCreditorRblsPyblsItem FinancialAccountType
GLBusinessTransactionType I_AR_TaxClassIdentification GLBusinessTransactionType
StatryRptCategory
StatryRptgEntity
StatryRptRunID
@AbapCatalog.sqlViewName: 'CARFORM731LGC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@EndUserText.label: 'Argentina VAT Form 731 with Rptd item log data'
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
@Analytics.dataCategory: #CUBE
@Metadata.allowExtensions:true

define view C_AR_StRpVATForm731ItemLogC
  as select distinct from I_StRpTaxItem as TaxItem
    left outer join       I_AR_TaxClassIdentification on  (I_AR_TaxClassIdentification.TaxCode                      = TaxItem.TaxCode
                                                      and I_AR_TaxClassIdentification.TransactionTypeDetermination = TaxItem.TransactionTypeDetermination ) or
                                                      (I_AR_TaxClassIdentification.TaxCode                      = ''
                                                      and I_AR_TaxClassIdentification.TransactionTypeDetermination = TaxItem.TransactionTypeDetermination)
    left outer join I_Customer                        on TaxItem.BusinessPartner = I_Customer.Customer
    left outer join I_Supplier                        on TaxItem.BusinessPartner = I_Supplier.Supplier
    
    left outer join I_Withholdingtaxitem as _Withholdingtaxitem
                                     on  TaxItem.CompanyCode = _Withholdingtaxitem.CompanyCode
                                     and TaxItem.AccountingDocument  =  _Withholdingtaxitem.AccountingDocument
                                     and TaxItem.FiscalYear = _Withholdingtaxitem.FiscalYear  
                                     
    left outer join I_GLAccountLineItem on TaxItem.CompanyCode = I_GLAccountLineItem.CompanyCode
                                        and TaxItem.GLAccount  = I_GLAccountLineItem.GLAccount
{
  key TaxItem.CompanyCode,
  key TaxItem.AccountingDocument,
  key TaxItem.FiscalYear,
  key TaxItem.TaxItem,
  key TaxItem.TransactionTypeDetermination,
  key TaxItem.TaxCode,
      TaxItem.TaxReportingDate,
      TaxItem.GLAccount,
      TaxType,
      TaxItem.PostingDate,
      ReportingDate,
      
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      I_GLAccountLineItem.AmountInCompanyCodeCurrency,
      
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      /*TBD: TaxBaseAmountInCoCodeCrcy returned as saved in DB. Recalculation necessary in some cases. Correct value in I_TaxDeclReconciliationCube.*/
      TaxBaseAmountInCoCodeCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      TaxAmountInCoCodeCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      TaxBaseAmountInTransCrcy,
      //@DefaultAggregation:#SUM

      //@Semantics.amount.currencyCode: 'DocumentCurrency'

      //TaxAmountInTransCrcy,

      //TaxJurisdiction,

      TaxReturnCountry,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CountryCurrency'
      TaxAmountInCountryCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CountryCurrency'
      TaxBaseAmountInCountryCrcy,
      @Semantics.currencyCode:true
      TaxItem.CompanyCodeCurrency,
      CompanyCodeCountry,
      @Semantics.currencyCode:true
      TaxItem.DocumentCurrency,
      @Semantics.currencyCode:true
      CountryCurrency,
      TaxItem.TaxCalculationProcedure,
      StRpTaxClassification,
      AddressRegion,
      CustomerCounty,
      MunicipalJurisdiction,
      ZeroVATRsn,
      TaxIsProRated,
      I_Customer.ResponsibleType,
    I_Customer.Customer,
      I_Supplier.Supplier,
    @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( I_Customer.ResponsibleType = '01' or I_Supplier.ResponsibleType = '01' )
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxBaseAmountInCoCodeCrcy
        end
      end as RegisteredBPTaxBaseAmount,//AmtznAdjmtLossAllwncInPosCrcy,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( I_Customer.ResponsibleType = '01' or I_Supplier.ResponsibleType = '01' )
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxAmountInCoCodeCrcy
        end
        end as RegisteredBPTaxAmount, //IdxClnAmtznAdjLossAllInPosCrcy,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( I_Customer.ResponsibleType = '02' or I_Supplier.ResponsibleType = '02' )
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxBaseAmountInCoCodeCrcy
        end
      end as NotRegisteredBPTaxBaseAmount,//FXAmtznAdjLossAllwncInValnCrcy,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( I_Customer.ResponsibleType = '02' or I_Supplier.ResponsibleType = '02' )
      then
      case substring(StRpTaxClassification,1,2)
        when  'TX'
        then
        TaxAmountInCoCodeCrcy
        end
      end as TxBaseAmtWithTxRate18InCCCrcy, //PriceVariance,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( I_Customer.ResponsibleType = '02' or I_Supplier.ResponsibleType = '02' )
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxAmountInCoCodeCrcy
        when 'VS'
        then
        TaxAmountInCoCodeCrcy
        end
      end as TxBaseAmtWithTxRate0InCCCrcy,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( I_Customer.ResponsibleType = '02' or I_Supplier.ResponsibleType = '02' )
      then
      case substring(StRpTaxClassification,1,2)
        when  'VS'
        then
        TaxAmountInCoCodeCrcy
        end
      end as TxBaseAmtWithTxRate10InCCCrcy,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( I_Customer.ResponsibleType     = '03' or I_Supplier.ResponsibleType = '03'
             or I_Customer.ResponsibleType = '04'  or I_Supplier.ResponsibleType = '04'
             or I_Customer.ResponsibleType = '05'  or I_Supplier.ResponsibleType = '05')
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxBaseAmountInCoCodeCrcy
        when 'VN'
        then
        TaxBaseAmountInCoCodeCrcy
        when 'VL'
        then
        TaxBaseAmountInCoCodeCrcy
        end
      end as ExemptedConsumerTaxBaseAmount,//FrgnExchContrChgAmtInValnCrcy,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( I_Customer.ResponsibleType     = '03' or I_Supplier.ResponsibleType = '03'
             or I_Customer.ResponsibleType = '04'  or I_Supplier.ResponsibleType = '04'
             or I_Customer.ResponsibleType = '05'  or I_Supplier.ResponsibleType = '05')
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxAmountInCoCodeCrcy
        when 'VN'
        then
        TaxAmountInCoCodeCrcy
        when 'VL'
        then
        TaxAmountInCoCodeCrcy
        end
       end as ExemptedConsumerTaxAmount,//ContractChangeAmtInValnCrcy,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( I_Customer.ResponsibleType = '06' or I_Supplier.ResponsibleType = '06' )
       then
       case substring(StRpTaxClassification,1,2)
       when 'TX'
       then
       TaxBaseAmountInCoCodeCrcy
       end
      end as RegimeTaxBaseAmount,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( I_Customer.ResponsibleType = '06' or I_Supplier.ResponsibleType = '06' )
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxAmountInCoCodeCrcy
        end
      end as RegimeTaxAmount,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when ( (I_Customer.ResponsibleType    <> '01' or I_Supplier.ResponsibleType <> '01')
           and ( I_Customer.ResponsibleType <> '02' or I_Supplier.ResponsibleType <> '02' )
           and ( I_Customer.ResponsibleType <> '03' or I_Supplier.ResponsibleType <> '03')
           and ( I_Customer.ResponsibleType <> '04' or I_Supplier.ResponsibleType <> '04')
           and ( I_Customer.ResponsibleType <> '05' or I_Supplier.ResponsibleType <> '05')
           and ( I_Customer.ResponsibleType <> '06' or I_Supplier.ResponsibleType <> '06')
           and ( I_Customer.ResponsibleType <> '08' or I_Supplier.ResponsibleType <> '08' ) )
        then
        case substring(StRpTaxClassification,1,2)
          when  'TX'
          then
          TaxBaseAmountInCoCodeCrcy
          end
       end  as ExportOperationTaxBaseAmount,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
       case
      when ( (I_Customer.ResponsibleType    <> '01' or I_Supplier.ResponsibleType <> '01')
           and ( I_Customer.ResponsibleType <> '02' or I_Supplier.ResponsibleType <> '02' )
           and ( I_Customer.ResponsibleType <> '03' or I_Supplier.ResponsibleType <> '03')
           and ( I_Customer.ResponsibleType <> '04' or I_Supplier.ResponsibleType <> '04')
           and ( I_Customer.ResponsibleType <> '05' or I_Supplier.ResponsibleType <> '05')
           and ( I_Customer.ResponsibleType <> '06' or I_Supplier.ResponsibleType <> '06')
           and ( I_Customer.ResponsibleType <> '08' or I_Supplier.ResponsibleType <> '08' ) )
           then
           case substring(StRpTaxClassification,1,2)
             when  'TX'
             then
             TaxAmountInCoCodeCrcy
             end
            end as ExportOperationTaxAmount,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
     case
      when (ZeroVATRsn = 'N' or ZeroVATRsn = 'E')
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxBaseAmountInCoCodeCrcy
        when 'VL'
        then
        TaxBaseAmountInCoCodeCrcy
        when 'VN'
        then
        TaxBaseAmountInCoCodeCrcy
        end
      end as ExemptedICMSAmount,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when I_Customer.ResponsibleType = '01'
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then // change

            case I_AR_TaxClassIdentification.GLBusinessTransactionType
                when 'FA'
                then
                    TaxBaseAmountInCoCodeCrcy
            end // end of change

        end
      end as FixedAssetAmount,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
       case
       when I_Customer.ResponsibleType = '01'
       then
       case  substring(StRpTaxClassification,1,2)
         when 'TX'
         then //change

            case I_AR_TaxClassIdentification.GLBusinessTransactionType
                when 'FA'
                then
                    TaxAmountInCoCodeCrcy
            end // end of change

         end
       end as FixedAssetTaxAmount,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
        case
        when I_Customer.ResponsibleType = '02'
        then
        case substring(StRpTaxClassification,1,2)
          when 'TX'
          then //change 

            case I_AR_TaxClassIdentification.GLBusinessTransactionType 
                when 'FA'
                then
                    TaxBaseAmountInCoCodeCrcy
            end // end of change

          end
        end as NotRegisteredFixedAssetBaseAmt,//AmortizedCostInValuationCrcy,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
       case
       when I_Customer.ResponsibleType = '02'
       then
       case  substring(StRpTaxClassification,1,2)
         when 'TX'
         then // change

            case I_AR_TaxClassIdentification.GLBusinessTransactionType
                when 'FA'
                then 
                    TaxAmountInCoCodeCrcy
             end // end of change

         end
       end  as NotRegisteredFixedAssetTaxAmt,//FXOffstLossAllwncAmtInValnCrcy,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when (I_Customer.ResponsibleType   = '03'
           or I_Customer.ResponsibleType = '04'
           or I_Customer.ResponsibleType = '05')
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then //change

            case  I_AR_TaxClassIdentification.GLBusinessTransactionType
                when 'FA'
                then
                    TaxBaseAmountInCoCodeCrcy
            end // end of change

        end
      end as ExemptedSimpfdRegimeTaxBaseAmt,//FXOffstOCILossAllwncInValnCrcy,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when (I_Customer.ResponsibleType   = '03'
           or I_Customer.ResponsibleType = '04'
           or I_Customer.ResponsibleType = '05')
      then
      case  substring(StRpTaxClassification,1,2)
        when 'TX'
        then //change

            case  I_AR_TaxClassIdentification.GLBusinessTransactionType
            when 'FA'
                then
                TaxAmountInCoCodeCrcy
            end // end of change

        end
      end as ExemptedSimpfdRegimeTaxAmount,//OCIOffstLossAllwncAmtInPosCrcy,//



      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when I_Customer.Customer is not null
      then

          case
            when I_Customer.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'PG'
                then
                TaxAmountInCoCodeCrcy
                end
          end
       else
       case
       when I_Supplier.Supplier is not null
       then
            case
            when I_Supplier.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'PG'
                then
                TaxAmountInCoCodeCrcy
                end
            end
        end
        end as PurchaseOfGoodsCreditAmount,


        @DefaultAggregation:#SUM
     @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
     case
     when I_Customer.Customer is not null
    then

         case
           when I_Customer.Country = 'AR'
            then
             case substring(StRpTaxClassification,1,2)
             when 'PG'
                  then
      TaxBaseAmountInCoCodeCrcy
      end
      end
      else
      case
      when I_Supplier.Supplier is not null
       then
        case
          when I_Supplier.Country = 'AR'
        then
          case substring(StRpTaxClassification,1,2)
        when 'PG'
                then
                TaxBaseAmountInCoCodeCrcy
                end
            end
        end
     end as CalculatedTxBaseAmtInTransCrcy,//BPCrdtPurGoodsBaseAmount,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
       when I_Customer.Customer is not null
      then

          case
            when I_Customer.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'SV'
                then
                TaxAmountInCoCodeCrcy
                end
          end
       else
       case
       when I_Supplier.Supplier is not null
       then
            case
            when I_Supplier.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'SV'
                then
                TaxAmountInCoCodeCrcy
                end
            end
        end

      end as ServiceCreditTaxAmount,


       @DefaultAggregation:#SUM
     @Semantics.amount.currencyCode: 'CompanyCodeCurrency'

    case
     when I_Customer.Customer is not null
      then

          case
            when I_Customer.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'SV'
                then
                TaxBaseAmountInCoCodeCrcy
                end
          end
       else
       case
       when I_Supplier.Supplier is not null
       then
            case
            when I_Supplier.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'SV'
                then
                TaxBaseAmountInCoCodeCrcy
                end
            end
        end
     end as OCIOffstLossAllwncInValnCrcy,//BPCrdtServicesBaseAmount,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
     case
      when I_Customer.Customer is not null
      then

          case
            when I_Customer.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'RT'
                then
                TaxAmountInCoCodeCrcy
                end
          end
       else
       case
       when I_Supplier.Supplier is not null
       then
            case
            when I_Supplier.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'RT'
                then
                TaxAmountInCoCodeCrcy
                end
            end
        end
      end as RentsCreditTaxAmount,


      @DefaultAggregation:#SUM
     @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
     case
      when I_Customer.Customer is not null
      then

          case
            when I_Customer.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'RT'
                then
                TaxBaseAmountInCoCodeCrcy
                end
          end
       else
       case
       when I_Supplier.Supplier is not null
       then
            case
            when I_Supplier.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'RT'
                then
                TaxBaseAmountInCoCodeCrcy
                end
            end
        end
     end as WhldgTxIncAmtInRptgCurrency,//BPCrdtRentBaseAmount,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
       case
       when I_Customer.Customer is not null
      then

          case
            when I_Customer.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'TX' //change 

                 then 
                    case  I_AR_TaxClassIdentification.GLBusinessTransactionType
                    when 'FA'
                        then
                        TaxAmountInCoCodeCrcy
                    end
                end // end of change

          end
       else
       case
       when I_Supplier.Supplier is not null
       then
            case
            when I_Supplier.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'TX' //chane 

                then
                    case  I_AR_TaxClassIdentification.GLBusinessTransactionType
                    when 'FA'
                        then
                        TaxAmountInCoCodeCrcy
                    end
                  end // end of change

            end
        end
      end as FixedAssetCreditTaxAmount,


     @DefaultAggregation:#SUM
     @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
     case
     when I_Customer.Customer is not null
      then

          case
            when I_Customer.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'TX' //change

                then
                    case  I_AR_TaxClassIdentification.GLBusinessTransactionType
                     when 'FA'
                        then
                        TaxBaseAmountInCoCodeCrcy
                     end
                end
          end
       else
       case
       when I_Supplier.Supplier is not null
       then
            case
            when I_Supplier.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'TX'
                then //change 

                    case  I_AR_TaxClassIdentification.GLBusinessTransactionType
                        when 'FA'
                        then
                        TaxBaseAmountInCoCodeCrcy
                    end
                end // end of change4

            end
        end

     end as IdxClnAmortizedCostInPosCrcy,//BPCrdtFixedAssetBaseAmount,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when I_Customer.Customer is not null
      then

          case
            when I_Customer.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'OT'
                then
                TaxAmountInCoCodeCrcy
                end
          end
       else
       case
       when I_Supplier.Supplier is not null
       then
            case
            when I_Supplier.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'OT'
                then
                TaxAmountInCoCodeCrcy
                end
            end
        end
      end as CreditAmount,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
       when I_Customer.Customer is not null
      then

          case
            when I_Customer.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'OT'
                then
                TaxBaseAmountInCoCodeCrcy
                end
          end
       else
       case
       when I_Supplier.Supplier is not null
       then
            case
            when I_Supplier.Country = 'AR'
            then
                case substring(StRpTaxClassification,1,2)
                when 'OT'
                then
                TaxBaseAmountInCoCodeCrcy
                end
            end
        end
      end as AmortizedCostInPositionCrcy,//BPCrdtOtherBaseAmount,


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
       when I_Customer.Customer is not null
      then

          case
            when I_Customer.Country = 'AR'
            then
                case when (ZeroVATRsn = 'X' or ZeroVATRsn = 'Z')
                  then
                 case substring(StRpTaxClassification,1,2)
                    when 'TX'
                      then
                      TaxBaseAmountInCoCodeCrcy
                   end
                end
          end
       else
       case
       when I_Supplier.Supplier is not null
       then
            case
            when I_Supplier.Country = 'AR'
            then
                case when (ZeroVATRsn = 'X' or ZeroVATRsn = 'Z')
                  then
                 case substring(StRpTaxClassification,1,2)
                    when 'TX'
                      then
                      TaxBaseAmountInCoCodeCrcy
                   end
                end
            end
       end
      end as ExportAmountInCompanyCodeCrcy,

      //////////////////////////////////////////Purchase//////////////////////////////////////////////


      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when I_Supplier.ResponsibleType = '01'
      then
      case when (ZeroVATRsn = 'N' or ZeroVATRsn = 'E')
        then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxBaseAmountInCoCodeCrcy
        else
        case substring(StRpTaxClassification,1,2)
        when 'VN'
        then
        TaxBaseAmountInCoCodeCrcy
        else
        case substring(StRpTaxClassification,1,2)
        when 'VL'
        then
        TaxBaseAmountInCoCodeCrcy
        end
        end
        end
        end
      end as NotTaxedAmount,

      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when I_Supplier.ResponsibleType = '02'
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxBaseAmountInCoCodeCrcy
        when 'VN'
        then
        TaxBaseAmountInCoCodeCrcy
        when 'VL'
        then
        TaxBaseAmountInCoCodeCrcy
        end
      end as NotRegisteredTaxBaseAmount, //VolumeVariance,//,



      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when I_Supplier.ResponsibleType = '06'
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxBaseAmountInCoCodeCrcy
        when 'VN'
        then
        TaxBaseAmountInCoCodeCrcy
        when 'VL'
        then
        TaxBaseAmountInCoCodeCrcy
        end
      end as SimplifiedRegimeTaxBaseAmount, //LossAllowanceAmountInValnCrcy,//



      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when (I_Supplier.ResponsibleType     <> '01'
             and I_Supplier.ResponsibleType <> '02'
             and I_Supplier.ResponsibleType <> '06')
      then
      case substring(StRpTaxClassification,1,2)
        when 'TX'
        then
        TaxBaseAmountInCoCodeCrcy
        when 'VN'
        then
        TaxBaseAmountInCoCodeCrcy
        when 'VL'
        then
        TaxBaseAmountInCoCodeCrcy
        end
      end as OtherPurchasesTaxBaseAmount,
      _DebtorCreditorRblsPyblsItem.FinancialAccountType,
      
      I_AR_TaxClassIdentification.GLBusinessTransactionType,
      TaxItem._ReportedItemsLog.StatryRptCategory,
      TaxItem._ReportedItemsLog.StatryRptgEntity,
      TaxItem._ReportedItemsLog.StatryRptRunID

          //  I_Customer.ResponsibleType as TestRespType,


}