I_GrossPartNetByCostCtrC

DDL: I_GROSSPARTNETBYCOSTCTRC SQL: IGRSSNETCOC Type: view COMPOSITE Package: GJVA

Gross Partner Net By Cost Center

I_GrossPartNetByCostCtrC is a Composite CDS View (Cube) that provides data about "Gross Partner Net By Cost Center" in SAP S/4HANA. It reads from 6 data sources and exposes 114 fields with key fields CompanyCode, Ledger, FiscalYear, AccountingDocument, LedgerGLLineItem. It has 1 association to related views. Part of development package GJVA.

Data Sources (6)

SourceAliasJoin Type
I_JntVntrEquityGrp EqGroup left_outer
I_JntVntrPartOwnrEquityShr I_JntVntrPartOwnrEquityShr inner
I_JVALineItemCube JVItem from
I_JntVntrCoCodeParam JVPars inner
I_JntVntrPartOwnrEquityShr PShare left_outer
I_JointVentureMasterFld Venture inner

Parameters (3)

NameTypeDefault
P_LedgerFiscalYear gjahr
P_FiscalPeriod poper
P_JointVenturePartner jv_part

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_JntVntrBusinessPartner _JntVntrBusinessPartner $projection.CompanyCode = _JntVntrBusinessPartner.CompanyCode and $projection.JointVenturePartner = _JntVntrBusinessPartner.JointVenturePartner

Annotations (14)

NameValueLevelField
AbapCatalog.sqlViewName IGRSSNETCOC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Gross Partner Net By Cost Center view
VDM.viewType #COMPOSITE view
Analytics.dataCategory #CUBE view
Metadata.ignorePropagatedAnnotations true view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
Metadata.allowExtensions true view
Analytics.internalName #LOCAL view

Fields (114)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_JVALineItemCube CompanyCode
KEY Ledger I_JVALineItemCube Ledger
KEY FiscalYear I_JVALineItemCube FiscalYear
KEY AccountingDocument I_JVALineItemCube AccountingDocument
KEY LedgerGLLineItem I_JVALineItemCube LedgerGLLineItem
FiscalYearVariant I_JVALineItemCube FiscalYearVariant
FiscalPeriod I_JVALineItemCube FiscalPeriod
PostingDate I_JVALineItemCube PostingDate
LedgerFiscalYear I_JVALineItemCube LedgerFiscalYear
GLRecordType I_JVALineItemCube GLRecordType
ChartOfAccounts I_JVALineItemCube ChartOfAccounts
GLAccount I_JVALineItemCube GLAccount
DebitCreditCode I_JVALineItemCube DebitCreditCode
ControllingArea I_JVALineItemCube ControllingArea
CostCenter I_JVALineItemCube CostCenter
ProfitCenter I_JVALineItemCube ProfitCenter
BusinessArea I_JVALineItemCube BusinessArea
MasterFixedAsset I_JVALineItemCube MasterFixedAsset
FixedAsset I_JVALineItemCube FixedAsset
AssetTransactionType I_JVALineItemCube AssetTransactionType
OrderID I_JVALineItemCube OrderID
ProjectNetwork I_JVALineItemCube ProjectNetwork
WBSElementInternalID I_JVALineItemCube WBSElementInternalID
WBSElementExternalID I_JVALineItemCube WBSElementExternalID
JointVenture I_JVALineItemCube JointVenture
JointVentureType I_JointVentureMasterFld JointVentureType
JointVentureEquityGroup I_JVALineItemCube JointVentureEquityGroup
JointVentureEquityType I_JVALineItemCube JointVentureEquityType
JntVntrOperatedShare I_JntVntrEquityGrp JntVntrOperatedShare
JntVntrEquityShare I_JntVntrPartOwnrEquityShr JntVntrEquityShare
JointVentureCostRecoveryCode I_JVALineItemCube JointVentureCostRecoveryCode
JointVenturePartner
Operator I_JntVntrCoCodeParam Operator
JointVentureBillingType I_JVALineItemCube JointVentureBillingType
BaseUnit I_JVALineItemCube BaseUnit
Quantity I_JVALineItemCube Quantity
Supplier I_JVALineItemCube Supplier
AccountingDocumentType I_JVALineItemCube AccountingDocumentType
FinancialAccountType I_JVALineItemCube FinancialAccountType
Segment I_JVALineItemCube Segment
Customer I_JVALineItemCube Customer
SalesOrganization I_JVALineItemCube SalesOrganization
ValuationArea I_JVALineItemCube ValuationArea
Plant I_JVALineItemCube Plant
DistributionChannel I_JVALineItemCube DistributionChannel
OrganizationDivision I_JVALineItemCube OrganizationDivision
ServiceDocument I_JVALineItemCube ServiceDocument
SalesDocument I_JVALineItemCube SalesDocument
AssetClass I_JVALineItemCube AssetClass
JntVntrInterestType I_JntVntrPartOwnrEquityShr JntVntrInterestType
TransactionCurrency I_JVALineItemCube TransactionCurrency
CompanyCodeCurrency I_JVALineItemCube CompanyCodeCurrency
GlobalCurrency I_JVALineItemCube GlobalCurrency
BalanceTransactionCurrency I_JVALineItemCube BalanceTransactionCurrency
FreeDefinedCurrency1 I_JVALineItemCube FreeDefinedCurrency1
FreeDefinedCurrency2 I_JVALineItemCube FreeDefinedCurrency2
FreeDefinedCurrency3 I_JVALineItemCube FreeDefinedCurrency3
FreeDefinedCurrency4 I_JVALineItemCube FreeDefinedCurrency4
FreeDefinedCurrency5 I_JVALineItemCube FreeDefinedCurrency5
FreeDefinedCurrency6 I_JVALineItemCube FreeDefinedCurrency6
FreeDefinedCurrency7 I_JVALineItemCube FreeDefinedCurrency7
FreeDefinedCurrency8 I_JVALineItemCube FreeDefinedCurrency8
JVAFundingCurrency1
_Ledger I_JVALineItemCube _Ledger
_CompanyCode I_JVALineItemCube _CompanyCode
_FiscalYear I_JVALineItemCube _FiscalYear
_JournalEntry I_JVALineItemCube _JournalEntry
FunctionalArea I_JVALineItemCube FunctionalArea
_GLAccountInChartOfAccounts I_JVALineItemCube _GLAccountInChartOfAccounts
_ChartOfAccounts I_JVALineItemCube _ChartOfAccounts
_DebitCreditCode I_JVALineItemCube _DebitCreditCode
_ControllingArea I_JVALineItemCube _ControllingArea
_BusinessArea I_JVALineItemCube _BusinessArea
_CostCenter I_JVALineItemCube _CostCenter
_ProfitCenter I_JVALineItemCube _ProfitCenter
_Order I_JVALineItemCube _Order
_ProjectNetwork I_JVALineItemCube _ProjectNetwork
_TransactionCurrency I_JVALineItemCube _TransactionCurrency
_CompanyCodeCurrency I_JVALineItemCube _CompanyCodeCurrency
_GlobalCurrency I_JVALineItemCube _GlobalCurrency
_BalanceTransactionCurrency I_JVALineItemCube _BalanceTransactionCurrency
_FreeDefinedCurrency1 I_JVALineItemCube _FreeDefinedCurrency1
_FreeDefinedCurrency2 I_JVALineItemCube _FreeDefinedCurrency2
_FreeDefinedCurrency3 I_JVALineItemCube _FreeDefinedCurrency3
_FreeDefinedCurrency4 I_JVALineItemCube _FreeDefinedCurrency4
_FreeDefinedCurrency5 I_JVALineItemCube _FreeDefinedCurrency5
_FreeDefinedCurrency6 I_JVALineItemCube _FreeDefinedCurrency6
_FreeDefinedCurrency7 I_JVALineItemCube _FreeDefinedCurrency7
_FreeDefinedCurrency8 I_JVALineItemCube _FreeDefinedCurrency8
_BaseUnit I_JVALineItemCube _BaseUnit
_JointVentureMasterFld I_JVALineItemCube _JointVentureMasterFld
_JntVntrRecoveryInd I_JVALineItemCube _JntVntrRecoveryInd
_JntVntrEquityGrp I_JVALineItemCube _JntVntrEquityGrp
_JntVntrEquityTypeMaster I_JVALineItemCube _JntVntrEquityTypeMaster
_FiscalYearVariant I_JVALineItemCube _FiscalYearVariant
_LedgerFiscalYearForVariant I_JVALineItemCube _LedgerFiscalYearForVariant
_FiscalPeriodForVariant I_JVALineItemCube _FiscalPeriodForVariant
_MasterFixedAsset I_JVALineItemCube _MasterFixedAsset
_JointVenturePayrollType I_JVALineItemCube _JointVenturePayrollType
_AssetTransactionType I_JVALineItemCube _AssetTransactionType
_WBSElementBasicData I_JVALineItemCube _WBSElementBasicData
_WBSElementExternalID I_JVALineItemCube _WBSElementExternalID
_JntVntrBusinessPartner _JntVntrBusinessPartner
_Supplier I_JVALineItemCube _Supplier
_GLAccountInCompanyCode I_JVALineItemCube _GLAccountInCompanyCode
_AccountingDocumentType I_JVALineItemCube _AccountingDocumentType
_Customer I_JVALineItemCube _Customer
_CurrentCostCenter I_JVALineItemCube _CurrentCostCenter
_CurrentProfitCenter I_JVALineItemCube _CurrentProfitCenter
_SalesDocument I_JVALineItemCube _SalesDocument
_FixedAsset I_JVALineItemCube _FixedAsset
ServiceDocumentType I_JVALineItemCube ServiceDocumentType
_DistributionChannel I_JVALineItemCube _DistributionChannel
_ServiceDocument I_JVALineItemCube _ServiceDocument
@AbapCatalog.sqlViewName: 'IGRSSNETCOC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Gross Partner Net By Cost Center'
@VDM.viewType: #COMPOSITE
@Analytics: { dataCategory: #CUBE }
@Metadata.ignorePropagatedAnnotations: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@Metadata.allowExtensions:true
@Analytics.internalName:#LOCAL

define view I_GrossPartNetByCostCtrC
  with parameters
    P_LedgerFiscalYear    : gjahr,
    P_FiscalPeriod        : poper,
    P_JointVenturePartner : jv_part

  as select from    I_JVALineItemCube          as JVItem

    inner join      I_JntVntrCoCodeParam       as JVPars  on JVPars.CompanyCode = JVItem.CompanyCode

    inner join      I_JointVentureMasterFld    as Venture on  Venture.CompanyCode  = JVItem.CompanyCode
                                                          and Venture.JointVenture = JVItem.JointVenture

  //Select only data with a venture and an equity group with the given partner

    inner join      I_JntVntrPartOwnrEquityShr            on  I_JntVntrPartOwnrEquityShr.CompanyCode          = JVItem.CompanyCode
                                                          and I_JntVntrPartOwnrEquityShr.JointVenture         = JVItem.JointVenture
                                                          and I_JntVntrPartOwnrEquityShr.JntOpgAgrmtEquityGrp = JVItem.JointVentureEquityGroup
                                                          and I_JntVntrPartOwnrEquityShr.JointVenturePartner  = $parameters.P_JointVenturePartner

    left outer join I_JntVntrEquityGrp         as EqGroup on  EqGroup.CompanyCode          = JVItem.CompanyCode
                                                          and EqGroup.JointVenture         = JVItem.JointVenture
                                                          and EqGroup.JntOpgAgrmtEquityGrp = JVItem.JointVentureEquityGroup

    left outer join I_JntVntrPartOwnrEquityShr as PShare  on  PShare.CompanyCode           = JVItem.CompanyCode
                                                          and PShare.JointVenture          = JVItem.JointVenture
                                                          and PShare.JntOpgAgrmtEquityGrp  = JVItem.JointVentureEquityGroup
                                                          and (
                                                             PShare.JointVenturePartner    = $parameters.P_JointVenturePartner
                                                             or PShare.JointVenturePartner = '2'
                                                           )

  association [0..1] to I_JntVntrBusinessPartner as _JntVntrBusinessPartner on  $projection.CompanyCode         = _JntVntrBusinessPartner.CompanyCode
                                                                            and $projection.JointVenturePartner = _JntVntrBusinessPartner.JointVenturePartner

{
      @ObjectModel.foreignKey.association: '_CompanyCode'
  key JVItem.CompanyCode,
      @ObjectModel.foreignKey.association: '_Ledger'
  key JVItem.Ledger,
      @ObjectModel.foreignKey.association: '_FiscalYear'
  key JVItem.FiscalYear,
      @ObjectModel.foreignKey.association: '_JournalEntry'
  key JVItem.AccountingDocument,
  key JVItem.LedgerGLLineItem,

      @ObjectModel.foreignKey.association: '_FiscalYearVariant'
      @Semantics.fiscal.yearVariant: true
      JVItem.FiscalYearVariant,

      JVItem.FiscalPeriod,

      JVItem.PostingDate,

      @Semantics.fiscal.year: true
      JVItem.LedgerFiscalYear,

      JVItem.GLRecordType,

      @ObjectModel.foreignKey.association: '_ChartOfAccounts'
      JVItem.ChartOfAccounts,

      @ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
      JVItem.GLAccount,

      @ObjectModel.foreignKey.association: '_DebitCreditCode'
      JVItem.DebitCreditCode,

      @ObjectModel.foreignKey.association: '_ControllingArea'
      JVItem.ControllingArea,

      @ObjectModel.foreignKey.association: '_CostCenter'
      JVItem.CostCenter,

      @ObjectModel.foreignKey.association: '_ProfitCenter'
      JVItem.ProfitCenter,

      @ObjectModel.foreignKey.association: '_BusinessArea'
      JVItem.BusinessArea,

      @ObjectModel.foreignKey.association: '_MasterFixedAsset'
      JVItem.MasterFixedAsset,

      JVItem.FixedAsset,
      @ObjectModel.foreignKey.association: '_AssetTransactionType'
      JVItem.AssetTransactionType,

      @ObjectModel.foreignKey.association: '_Order'
      JVItem.OrderID,

      @ObjectModel.foreignKey.association: '_ProjectNetwork'
      JVItem.ProjectNetwork,

      @ObjectModel.foreignKey.association: '_WBSElementBasicData'
      JVItem.WBSElementInternalID,

      @ObjectModel.foreignKey.association: '_WBSElementExternalID'
      JVItem.WBSElementExternalID,

      @ObjectModel.foreignKey.association: '_JointVentureMasterFld'
      JVItem.JointVenture,

      Venture.JointVentureType,

      @ObjectModel.foreignKey.association: '_JntVntrEquityGrp'
      JVItem.JointVentureEquityGroup,

      @ObjectModel.foreignKey.association: '_JntVntrEquityTypeMaster'
      JVItem.JointVentureEquityType,

      EqGroup.JntVntrOperatedShare,

      PShare.JntVntrEquityShare,

      @ObjectModel.foreignKey.association: '_JntVntrRecoveryInd'
      JVItem.JointVentureCostRecoveryCode,

      @ObjectModel.foreignKey.association: '_JntVntrBusinessPartner'
      cast( $parameters.P_JointVenturePartner as jv_part_cds preserving type ) as JointVenturePartner,

      JVPars.Operator,

      @ObjectModel.foreignKey.association: '_JointVenturePayrollType'
      JVItem.JointVentureBillingType,

      @Semantics.unitOfMeasure:true
      @ObjectModel.foreignKey.association: '_BaseUnit'
      JVItem.BaseUnit,

      @Aggregation.default: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'BaseUnit'} }
      JVItem.Quantity,



      //fields added to fulfill DCL check from I_GLAccountLineItemCube

      JVItem.Supplier,
      JVItem.AccountingDocumentType,
      JVItem.FinancialAccountType,
      JVItem.Segment,
      JVItem.Customer,
      JVItem.SalesOrganization,
      JVItem.ValuationArea,
      JVItem.Plant,
      JVItem.DistributionChannel,
      JVItem.OrganizationDivision,
      JVItem.ServiceDocument,
      JVItem.SalesDocument,
      JVItem.AssetClass,

      PShare.JntVntrInterestType,



      //--------------------Transaction Currency-----------------------

      @Semantics.currencyCode: true
      @ObjectModel.foreignKey.association: '_TransactionCurrency'
      JVItem.TransactionCurrency,

      //Gross amounts in transaction currency


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'TransactionCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInTransactionCurrency as jv_cpamt_tc preserving type )
        else
          cast( 0 as jv_cpamt_tc )
      end                                                                      as CurPerdAmtInTC,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'TransactionCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInTransactionCurrency as jv_ytdamt_tc preserving type )
        else
          cast( 0 as jv_ytdamt_tc )
      end                                                                      as YrToDteAmtInTransacCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInTransactionCurrency as jv_itdamt_tc preserving type )
        else
          cast( 0 as jv_itdamt_tc )
      end                                                                      as ITDAmtInTC,

      //Net amounts in transaction currency


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'TransactionCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInTransactionCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_tc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInTransactionCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInTransactionCurrency end
          else cast( 0 as jv_cp_netamt_tc ) end
        else cast( 0 as jv_cp_netamt_tc )
      end                                                                      as CurPerdNetAmtInTC,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'TransactionCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInTransactionCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_tc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInTransactionCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInTransactionCurrency end
          else cast( 0 as jv_ytd_netamt_tc ) end
        else cast( 0 as jv_ytd_netamt_tc )
      end                                                                      as YTDNetAmtInTC,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'TransactionCurrency'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInTransactionCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_tc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInTransactionCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInTransactionCurrency end
          else cast( 0 as jv_itd_netamt_tc ) end
        else cast( 0 as jv_itd_netamt_tc )
      end                                                                      as ITDNetAmtInTC,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'TransactionCurrency'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInTransactionCurrency * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInTransactionCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_tc )
      end                                                                      as SuspShrAmtInTC,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'TransactionCurrency'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInTransactionCurrency * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_tc )
      end                                                                      as NetProfitIntrstShrAmtInTC,



      //-------------------Company Code Currency-------------------

      @Semantics.currencyCode: true
      @ObjectModel.foreignKey.association: '_CompanyCodeCurrency'
      JVItem.CompanyCodeCurrency,

      //Gross amounts in company code currency


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'CompanyCodeCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInCompanyCodeCurrency as jv_cpamt_cc preserving type )
        else
          cast( 0 as jv_cpamt_cc )
      end                                                                      as CurPerdAmtInCCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'CompanyCodeCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInCompanyCodeCurrency as jv_ytdamt_cc preserving type )
        else
          cast( 0 as jv_ytdamt_cc )
      end                                                                      as YearToDateAmountInCoCodeCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInCompanyCodeCurrency as jv_itdamt_cc preserving type )
        else
          cast( 0 as jv_itdamt_cc )
      end                                                                      as ITDAmtInCCrcy,

      //Net amounts in company code currency


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'CompanyCodeCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInCompanyCodeCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_cc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInCompanyCodeCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInCompanyCodeCurrency end
          else cast( 0 as jv_cp_netamt_cc ) end
        else cast( 0 as jv_cp_netamt_cc )
      end                                                                      as CurPerdNetAmtInCCrcy,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'CompanyCodeCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInCompanyCodeCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_cc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInCompanyCodeCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInCompanyCodeCurrency end
          else cast( 0 as jv_ytd_netamt_cc ) end
        else cast( 0 as jv_ytd_netamt_cc )
      end                                                                      as YTDNetAmtInCCrcy,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'CompanyCodeCurrency'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInCompanyCodeCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_cc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInCompanyCodeCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInCompanyCodeCurrency end
          else cast( 0 as jv_itd_netamt_cc ) end
        else cast( 0 as jv_itd_netamt_cc )
      end                                                                      as ITDNetAmtInCCrcy,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'CompanyCodeCurrency'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInCompanyCodeCurrency * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInCompanyCodeCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_cc )
      end                                                                      as SuspShrAmtInCCrcy,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'CompanyCodeCurrency'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInCompanyCodeCurrency * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_cc )
      end                                                                      as NetProfitIntrstShrAmtInCCrcy,



      //------------------------Global Currency-----------------------

      @ObjectModel.foreignKey.association: '_GlobalCurrency'
      @Semantics.currencyCode: true
      JVItem.GlobalCurrency,

      //Gross amounts in global currency


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'GlobalCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInGlobalCurrency as jv_cpamt_gc preserving type )
        else
          cast( 0 as jv_cpamt_gc )
      end                                                                      as CurPerdAmtInGCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'GlobalCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInGlobalCurrency as jv_ytdamt_gc preserving type )
        else
          cast( 0 as jv_ytdamt_gc )
      end                                                                      as YearToDateAmountInGlobalCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInGlobalCurrency as jv_itdamt_gc preserving type )
        else
          cast( 0 as jv_itdamt_gc )
      end                                                                      as ITDAmtInGCrcy,

      //Net amounts in global currency


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'GlobalCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInGlobalCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_gc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInGlobalCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInGlobalCurrency end
          else cast( 0 as jv_cp_netamt_gc ) end
        else cast( 0 as jv_cp_netamt_gc )
      end                                                                      as CurPerdNetAmtInGCrcy,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'GlobalCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInGlobalCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_gc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInGlobalCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInGlobalCurrency end
          else cast( 0 as jv_ytd_netamt_gc ) end
        else cast( 0 as jv_ytd_netamt_gc )
      end                                                                      as YTDNetAmtInGCrcy,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'GlobalCurrency'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInGlobalCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_gc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInGlobalCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInGlobalCurrency end
          else cast( 0 as jv_itd_netamt_gc ) end
        else cast( 0 as jv_itd_netamt_gc )
      end                                                                      as ITDNetAmtInGCrcy,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'GlobalCurrency'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInGlobalCurrency * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInGlobalCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_gc )
      end                                                                      as SuspShrAmtInGCrcy,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'GlobalCurrency'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInGlobalCurrency * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_gc )
      end                                                                      as NetProfitIntrstShrAmtInGCrcy,



      //-------------Balance Transaction Currency---------------

      @ObjectModel.foreignKey.association: '_BalanceTransactionCurrency'
      @Semantics.currencyCode:true
      JVItem.BalanceTransactionCurrency,

      //Gross amounts in balance transaction currency


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'BalanceTransactionCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInBalanceTransacCrcy as jv_cpamt_btc preserving type )
        else
          cast( 0 as jv_cpamt_btc )
      end                                                                      as CurPerdAmtInBlTCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'BalanceTransactionCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInBalanceTransacCrcy as jv_ytdamt_btc preserving type )
        else
          cast( 0 as jv_ytdamt_btc )
      end                                                                      as YearToDateAmountInBalTransCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'BalanceTransactionCurrency'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInBalanceTransacCrcy as jv_itdamt_btc preserving type )
        else
          cast( 0 as jv_itdamt_btc )
      end                                                                      as ITDAmtInBlTCrcy,

      //Net amounts in balance transaction currency


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'BalanceTransactionCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInBalanceTransacCrcy * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_btc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInBalanceTransacCrcy * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInBalanceTransacCrcy end
          else cast( 0 as jv_cp_netamt_btc ) end
        else cast( 0 as jv_cp_netamt_btc )
      end                                                                      as CurPerdNetAmtInBlTCrcy,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'BalanceTransactionCurrency'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInBalanceTransacCrcy * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_btc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInBalanceTransacCrcy * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInBalanceTransacCrcy end
          else cast( 0 as jv_ytd_netamt_btc ) end
        else cast( 0 as jv_ytd_netamt_btc )
      end                                                                      as YTDNetAmtInBlTCrcy,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'BalanceTransactionCurrency'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInBalanceTransacCrcy * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_btc ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInBalanceTransacCrcy * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInBalanceTransacCrcy end
          else cast( 0 as jv_itd_netamt_btc ) end
        else cast( 0 as jv_itd_netamt_btc )
      end                                                                      as ITDNetAmtInBlTCrcy,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'BalanceTransactionCurrency'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInBalanceTransacCrcy * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInBalanceTransacCrcy * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_btc )
      end                                                                      as SuspShrAmtInBlTCrcy,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'BalanceTransactionCurrency'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInBalanceTransacCrcy * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_btc )
      end                                                                      as NetProfitIntrstShrAmtInBlTCrcy,



      //---------------Freely Defined Currency 1------------------

      @ObjectModel.foreignKey.association: '_FreeDefinedCurrency1'
      @Semantics.currencyCode:true
      JVItem.FreeDefinedCurrency1,

      //Gross amounts in freely defined currency 1


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency1'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency1 as jv_cpamt_fdc1 preserving type )
        else
          cast( 0 as jv_cpamt_fdc1 )
      end                                                                      as CurPerdAmtInFDCrcy1,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency1'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency1 as jv_ytdamt_fdc1 preserving type )
        else
          cast( 0 as jv_ytdamt_fdc1 )
      end                                                                      as YearToDateAmountInFDCrcy1,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency1 as jv_itdamt_fdc1 preserving type )
        else
          cast( 0 as jv_itdamt_fdc1 )
      end                                                                      as ITDAmtInFDCrcy1,

      //Net amounts in freely defined currency 1


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency1'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency1 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc1 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency1 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency1 end
          else cast( 0 as jv_cp_netamt_fdc1 ) end
        else cast( 0 as jv_cp_netamt_fdc1 )
      end                                                                      as CurPerdNetAmtInFDCrcy1,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency1'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency1 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc1 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency1 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency1 end
          else cast( 0 as jv_ytd_netamt_fdc1 ) end
        else cast( 0 as jv_ytd_netamt_fdc1 )
      end                                                                      as YTDNetAmtInFDCrcy1,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency1'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency1 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc1 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency1 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency1 end
          else cast( 0 as jv_itd_netamt_fdc1 ) end
        else cast( 0 as jv_itd_netamt_fdc1 )
      end                                                                      as ITDNetAmtInFDCrcy1,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency1'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInFreeDefinedCurrency1 * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInFreeDefinedCurrency1 * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_fdc1 )
      end                                                                      as SuspShrAmtInFDCrcy1,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency1'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInFreeDefinedCurrency1 * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_fdc1 )
      end                                                                      as NetProfitIntrstShrAmtInFDCrcy1,



      //---------------Freely Defined Currency 2------------------

      @ObjectModel.foreignKey.association: '_FreeDefinedCurrency2'
      @Semantics.currencyCode:true
      JVItem.FreeDefinedCurrency2,

      //Gross amounts in freely defined currency 2


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency2'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency2 as jv_cpamt_fdc2 preserving type )
        else
          cast( 0 as jv_cpamt_fdc2 )
      end                                                                      as CurPerdAmtInFDCrcy2,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency2'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency2 as jv_ytdamt_fdc2 preserving type )
        else
          cast( 0 as jv_ytdamt_fdc2 )
      end                                                                      as YearToDateAmountInFDCrcy2,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency2 as jv_itdamt_fdc2 preserving type )
        else
          cast( 0 as jv_itdamt_fdc2 )
      end                                                                      as ITDAmtInFDCrcy2,

      //Net amounts in freely defined currency 2


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency2'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency2 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc2 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency2 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency2 end
          else cast( 0 as jv_cp_netamt_fdc2 ) end
        else cast( 0 as jv_cp_netamt_fdc2 )
      end                                                                      as CurPerdNetAmtInFDCrcy2,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency2'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency2 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc2 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency2 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency2 end
          else cast( 0 as jv_ytd_netamt_fdc2 ) end
        else cast( 0 as jv_ytd_netamt_fdc2 )
      end                                                                      as YTDNetAmtInFDCrcy2,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency2'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency2 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc2 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency2 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency2 end
          else cast( 0 as jv_itd_netamt_fdc2 ) end
        else cast( 0 as jv_itd_netamt_fdc2 )
      end                                                                      as ITDNetAmtInFDCrcy2,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency2'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInFreeDefinedCurrency2 * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInFreeDefinedCurrency2 * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_fdc2 )
      end                                                                      as SuspShrAmtInFDCrcy2,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency2'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInFreeDefinedCurrency2 * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_fdc2 )
      end                                                                      as NetProfitIntrstShrAmtInFDCrcy2,



      //---------------Freely Defined Currency 3------------------

      @ObjectModel.foreignKey.association: '_FreeDefinedCurrency3'
      @Semantics.currencyCode:true
      JVItem.FreeDefinedCurrency3,

      //Gross amounts in freely defined currency 3


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency3'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency3 as jv_cpamt_fdc3 preserving type )
        else
          cast( 0 as jv_cpamt_fdc3 )
      end                                                                      as CurPerdAmtInFDCrcy3,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency3'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency3 as jv_ytdamt_fdc3 preserving type )
        else
          cast( 0 as jv_ytdamt_fdc3 )
      end                                                                      as YearToDateAmountInFDCrcy3,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency3 as jv_itdamt_fdc3 preserving type )
        else
          cast( 0 as jv_itdamt_fdc3 )
      end                                                                      as ITDAmtInFDCrcy3,

      //Net amounts in freely defined currency 3


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency3'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency3 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc3 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency3 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency3 end
          else cast( 0 as jv_cp_netamt_fdc3 ) end
        else cast( 0 as jv_cp_netamt_fdc3 )
      end                                                                      as CurPerdNetAmtInFDCrcy3,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency3'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency3 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc3 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency3 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency3 end
          else cast( 0 as jv_ytd_netamt_fdc3 ) end
        else cast( 0 as jv_ytd_netamt_fdc3 )
      end                                                                      as YTDNetAmtInFDCrcy3,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency3'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency3 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc3 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency3 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency3 end
          else cast( 0 as jv_itd_netamt_fdc3 ) end
        else cast( 0 as jv_itd_netamt_fdc3 )
      end                                                                      as ITDNetAmtInFDCrcy3,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency3'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInFreeDefinedCurrency3 * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInFreeDefinedCurrency3 * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_fdc3 )
      end                                                                      as SuspShrAmtInFDCrcy3,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency3'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInFreeDefinedCurrency3 * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_fdc3 )
      end                                                                      as NetProfitIntrstShrAmtInFDCrcy3,



      //---------------Freely Defined Currency 4------------------

      @ObjectModel.foreignKey.association: '_FreeDefinedCurrency4'
      @Semantics.currencyCode:true
      JVItem.FreeDefinedCurrency4,

      //Gross amounts in freely defined currency 4


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency4'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency4 as jv_cpamt_fdc4 preserving type )
        else
          cast( 0 as jv_cpamt_fdc4 )
      end                                                                      as CurPerdAmtInFDCrcy4,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency4'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency4 as jv_ytdamt_fdc4 preserving type )
        else
          cast( 0 as jv_ytdamt_fdc4 )
      end                                                                      as YearToDateAmountInFDCrcy4,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency4 as jv_itdamt_fdc4 preserving type )
        else
          cast( 0 as jv_itdamt_fdc4 )
      end                                                                      as ITDAmtInFDCrcy4,

      //Net amounts in freely defined currency 4


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency4'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency4 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc4 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency4 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency4 end
          else cast( 0 as jv_cp_netamt_fdc4 ) end
        else cast( 0 as jv_cp_netamt_fdc4 )
      end                                                                      as CurPerdNetAmtInFDCrcy4,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency4'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency4 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc4 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency4 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency4 end
          else cast( 0 as jv_ytd_netamt_fdc4 ) end
        else cast( 0 as jv_ytd_netamt_fdc4 )
      end                                                                      as YTDNetAmtInFDCrcy4,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency4'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency4 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc4 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency4 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency4 end
          else cast( 0 as jv_itd_netamt_fdc4 ) end
        else cast( 0 as jv_itd_netamt_fdc4 )
      end                                                                      as ITDNetAmtInFDCrcy4,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency4'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInFreeDefinedCurrency4 * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInFreeDefinedCurrency4 * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_fdc4 )
      end                                                                      as SuspShrAmtInFDCrcy4,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency4'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInFreeDefinedCurrency4 * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_fdc4 )
      end                                                                      as NetProfitIntrstShrAmtInFDCrcy4,



      //---------------Freely Defined Currency 5------------------

      @ObjectModel.foreignKey.association: '_FreeDefinedCurrency5'
      @Semantics.currencyCode:true
      JVItem.FreeDefinedCurrency5,

      //Gross amounts in freely defined currency 5


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency5'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency5 as jv_cpamt_fdc5 preserving type )
        else
          cast( 0 as jv_cpamt_fdc5 )
      end                                                                      as CurPerdAmtInFDCrcy5,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency5'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency5 as jv_ytdamt_fdc5 preserving type )
        else
          cast( 0 as jv_ytdamt_fdc5 )
      end                                                                      as YearToDateAmountInFDCrcy5,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency5 as jv_itdamt_fdc5 preserving type )
        else
          cast( 0 as jv_itdamt_fdc5 )
      end                                                                      as ITDAmtInFDCrcy5,

      //Net amounts in freely defined currency 5


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency5'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency5 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc5 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency5 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency5 end
          else cast( 0 as jv_cp_netamt_fdc5 ) end
        else cast( 0 as jv_cp_netamt_fdc5 )
      end                                                                      as CurPerdNetAmtInFDCrcy5,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency5'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency5 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc5 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency5 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency5 end
          else cast( 0 as jv_ytd_netamt_fdc5 ) end
        else cast( 0 as jv_ytd_netamt_fdc5 )
      end                                                                      as YTDNetAmtInFDCrcy5,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency5'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency5 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc5 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency5 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency5 end
          else cast( 0 as jv_itd_netamt_fdc5 ) end
        else cast( 0 as jv_itd_netamt_fdc5 )
      end                                                                      as ITDNetAmtInFDCrcy5,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency5'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInFreeDefinedCurrency5 * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInFreeDefinedCurrency5 * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_fdc5 )
      end                                                                      as SuspShrAmtInFDCrcy5,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency5'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInFreeDefinedCurrency5 * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_fdc5 )
      end                                                                      as NetProfitIntrstShrAmtInFDCrcy5,



      //---------------Freely Defined Currency 6------------------

      @ObjectModel.foreignKey.association: '_FreeDefinedCurrency6'
      @Semantics.currencyCode:true
      JVItem.FreeDefinedCurrency6,

      //Gross amounts in freely defined currency 6


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency6'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency6 as jv_cpamt_fdc6 preserving type )
        else
          cast( 0 as jv_cpamt_fdc6 )
      end                                                                      as CurPerdAmtInFDCrcy6,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency6'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency6 as jv_ytdamt_fdc6 preserving type )
        else
          cast( 0 as jv_ytdamt_fdc6 )
      end                                                                      as YearToDateAmountInFDCrcy6,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency6 as jv_itdamt_fdc6 preserving type )
        else
          cast( 0 as jv_itdamt_fdc6 )
      end                                                                      as ITDAmtInFDCrcy6,

      //Net amounts in freely defined currency 6


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency6'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency6 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc6 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency6 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency6 end
          else cast( 0 as jv_cp_netamt_fdc6 ) end
        else cast( 0 as jv_cp_netamt_fdc6 )
      end                                                                      as CurPerdNetAmtInFDCrcy6,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency6'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency6 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc6 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency6 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency6 end
          else cast( 0 as jv_ytd_netamt_fdc6 ) end
        else cast( 0 as jv_ytd_netamt_fdc6 )
      end                                                                      as YTDNetAmtInFDCrcy6,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency6'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency6 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc6 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency6 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency6 end
          else cast( 0 as jv_itd_netamt_fdc6 ) end
        else cast( 0 as jv_itd_netamt_fdc6 )
      end                                                                      as ITDNetAmtInFDCrcy6,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency6'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInFreeDefinedCurrency6 * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInFreeDefinedCurrency6 * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_fdc6 )
      end                                                                      as SuspShrAmtInFDCrcy6,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency6'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInFreeDefinedCurrency6 * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_fdc6 )
      end                                                                      as NetProfitIntrstShrAmtInFDCrcy6,



      //---------------Freely Defined Currency 7------------------

      @ObjectModel.foreignKey.association: '_FreeDefinedCurrency7'
      @Semantics.currencyCode:true
      JVItem.FreeDefinedCurrency7,

      //Gross amounts in freely defined currency 7


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency7'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency7 as jv_cpamt_fdc7 preserving type )
        else
          cast( 0 as jv_cpamt_fdc7 )
      end                                                                      as CurPerdAmtInFDCrcy7,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency7'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency7 as jv_ytdamt_fdc7 preserving type )
        else
          cast( 0 as jv_ytdamt_fdc7 )
      end                                                                      as YearToDateAmountInFDCrcy7,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency7 as jv_itdamt_fdc7 preserving type )
        else
          cast( 0 as jv_itdamt_fdc7 )
      end                                                                      as ITDAmtInFDCrcy7,

      //Net amounts in freely defined currency 7


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency7'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency7 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc7 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency7 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency7 end
          else cast( 0 as jv_cp_netamt_fdc7 ) end
        else cast( 0 as jv_cp_netamt_fdc7 )
      end                                                                      as CurPerdNetAmtInFDCrcy7,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency7'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency7 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc7 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency7 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency7 end
          else cast( 0 as jv_ytd_netamt_fdc7 ) end
        else cast( 0 as jv_ytd_netamt_fdc7 )
      end                                                                      as YTDNetAmtInFDCrcy7,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency7'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency7 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc7 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency7 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency7 end
          else cast( 0 as jv_itd_netamt_fdc7 ) end
        else cast( 0 as jv_itd_netamt_fdc7 )
      end                                                                      as ITDNetAmtInFDCrcy7,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency7'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInFreeDefinedCurrency7 * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInFreeDefinedCurrency7 * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_fdc7 )
      end                                                                      as SuspShrAmtInFDCrcy7,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency7'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInFreeDefinedCurrency7 * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_fdc7 )
      end                                                                      as NetProfitIntrstShrAmtInFDCrcy7,



      //---------------Freely Defined Currency 8------------------

      @ObjectModel.foreignKey.association: '_FreeDefinedCurrency8'
      @Semantics.currencyCode:true
      JVItem.FreeDefinedCurrency8,

      //Gross amounts in freely defined currency 8


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency8'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency8 as jv_cpamt_fdc8 preserving type )
        else
          cast( 0 as jv_cpamt_fdc8 )
      end                                                                      as CurPerdAmtInFDCrcy8,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency8'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency8 as jv_ytdamt_fdc8 preserving type )
        else
          cast( 0 as jv_ytdamt_fdc8 )
      end                                                                      as YearToDateAmountInFDCrcy8,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInFreeDefinedCurrency8 as jv_itdamt_fdc8 preserving type )
        else
          cast( 0 as jv_itdamt_fdc8 )
      end                                                                      as ITDAmtInFDCrcy8,

      //Net amounts in freely defined currency 8


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency8'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency8 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc8 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency8 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency8 end
          else cast( 0 as jv_cp_netamt_fdc8 ) end
        else cast( 0 as jv_cp_netamt_fdc8 )
      end                                                                      as CurPerdNetAmtInFDCrcy8,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency8'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency8 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc8 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency8 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency8 end
          else cast( 0 as jv_ytd_netamt_fdc8 ) end
        else cast( 0 as jv_ytd_netamt_fdc8 )
      end                                                                      as YTDNetAmtInFDCrcy8,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency8'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInFreeDefinedCurrency8 * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fdc8 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInFreeDefinedCurrency8 * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInFreeDefinedCurrency8 end
          else cast( 0 as jv_itd_netamt_fdc8 ) end
        else cast( 0 as jv_itd_netamt_fdc8 )
      end                                                                      as ITDNetAmtInFDCrcy8,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency8'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInFreeDefinedCurrency8 * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInFreeDefinedCurrency8 * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_fdc8 )
      end                                                                      as SuspShrAmtInFDCrcy8,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency8'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInFreeDefinedCurrency8 * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_fdc8 )
      end                                                                      as NetProfitIntrstShrAmtInFDCrcy8,



      //------------Funding Currency---------------

      @Semantics.currencyCode: true
      cast( JVItem.JVAFundingCurrency as jv_fundcur preserving type )          as JVAFundingCurrency1,


      //Gross amounts in funding currency


      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'JVAFundingCurrency1'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInJVAFundingCurrency as jv_cpamt_fundc1 preserving type )
        else
          cast( 0 as jv_cpamt_fundc1 )
      end                                                                      as CurPerdAmtInFundCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'JVAFundingCurrency1'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInJVAFundingCurrency as jv_ytdamt_fundc1 preserving type )
        else
          cast( 0 as jv_ytdamt_fundc1 )
      end                                                                      as YearToDateAmountInFundCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'JVAFundingCurrency1'} }
      case when PShare.JntVntrInterestType <> '2' then
          cast( JVItem.AmountInJVAFundingCurrency as jv_itdamt_fundc1 preserving type )
        else
          cast( 0 as jv_itdamt_fundc1 )
      end                                                                      as ITDAmtInFundCrcy,

      //Net amounts in funding currency


      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'JVAFundingCurrency1'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                JVItem.FiscalPeriod     = $parameters.P_FiscalPeriod     and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInJVAFundingCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fundc1 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInJVAFundingCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInJVAFundingCurrency end
          else cast( 0 as jv_cp_netamt_fundc1 ) end
        else cast( 0 as jv_cp_netamt_fundc1 )
      end                                                                      as CurPerdNetAmtInFundCrcy,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'JVAFundingCurrency1'} }
      case when JVItem.LedgerFiscalYear = $parameters.P_LedgerFiscalYear and
                PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInJVAFundingCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fundc1 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInJVAFundingCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInJVAFundingCurrency end
          else cast( 0 as jv_ytd_netamt_fundc1 ) end
        else cast( 0 as jv_ytd_netamt_fundc1 )
      end                                                                      as YTDNetAmtInFundCrcy,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'JVAFundingCurrency1'} }
      case when PShare.JntVntrInterestType <> '2' then
        case $parameters.P_JointVenturePartner
          when PShare.JointVenturePartner then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
               division( ( JVItem.AmountInJVAFundingCurrency * PShare.JntVntrEquityShare ), 100, 2 )
            else cast( 0 as jv_cp_netamt_fundc1 ) end
          when JVPars.Operator then
            case when JVItem.JntVntrRcvryCodeIsBillable = 'X' then
                   division( ( JVItem.AmountInJVAFundingCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
                 else
                   JVItem.AmountInJVAFundingCurrency end
          else cast( 0 as jv_itd_netamt_fundc1 ) end
        else cast( 0 as jv_itd_netamt_fundc1 )
      end                                                                      as ITDNetAmtInFundCrcy,


      //Suspension Share Amount

      @Semantics: { amount : { currencyCode: 'JVAFundingCurrency1'} }
      @DefaultAggregation: #SUM
      case $parameters.P_JointVenturePartner
        when PShare.JointVenturePartner then
           division( ( JVItem.AmountInJVAFundingCurrency * PShare.JntVntrEquityShare ), 100, 2 )
        when JVPars.Operator then
          division( ( JVItem.AmountInJVAFundingCurrency * EqGroup.JntVntrOperatedShare ), 100, 2 )
        else cast( 0 as jv_sus_shramt_fundc1 )
      end                                                                      as SuspShrAmtInFundCrcy,

      //Net Profit Share Amount

      @Semantics: { amount : { currencyCode: 'JVAFundingCurrency1'} }
      @DefaultAggregation: #SUM
      case when PShare.JntVntrInterestType = '2'
        then division( ( JVItem.AmountInJVAFundingCurrency * PShare.JntVntrEquityShare ), 100, 2 )
        else cast( 0 as jv_npi_shramt_fundc1 )
      end                                                                      as NetPrftIntrstShrAmtInFundCrcy,



      //--------------------Transaction Currency-------->

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'TransactionCurrency'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInTransactionCurrency
        else 0
      end                                                                      as NetProfitIntrstAmtInTC,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'TransactionCurrency'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInTransactionCurrency
        else 0
      end                                                                      as AmountInTransactionCurrency,


      //--------------------Company Code Currency-------->

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'CompanyCodeCurrency'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInCompanyCodeCurrency
        else 0
      end                                                                      as NetProfitIntrstAmtInCCrcy,

      @Aggregation.default:#SUM
      @Semantics: { amount : { currencyCode: 'CompanyCodeCurrency'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInCompanyCodeCurrency
        else 0
      end                                                                      as AmountInCompanyCodeCurrency,


      //--------------------Global Currency-------->

      @Aggregation.default: #SUM
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInGlobalCurrency
        else 0
      end                                                                      as NetProfitIntrstAmtInGCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'GlobalCurrency'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInGlobalCurrency
        else 0
      end                                                                      as AmountInGlobalCurrency,


      //--------------------Balance Transaction Currency-------->

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'BalanceTransactionCurrency'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInBalanceTransacCrcy
        else 0
      end                                                                      as NetProfitIntrstAmtInBlTCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'BalanceTransactionCurrency'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInBalanceTransacCrcy
        else 0
      end                                                                      as AmountInBalanceTransacCrcy,


      //--------------------Freely Defined Currency 1-------->

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency1'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInFreeDefinedCurrency1
        else 0
      end                                                                      as NetProfitIntrstAmtInFDCrcy1,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency1'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInFreeDefinedCurrency1
        else 0
       end                                                                     as AmountInFreeDefinedCurrency1,



      //--------------------Freely Defined Currency 2-------->

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency2'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInFreeDefinedCurrency2
        else 0
      end                                                                      as NetProfitIntrstAmtInFDCrcy2,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency2'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInFreeDefinedCurrency2
        else 0
      end                                                                      as AmountInFreeDefinedCurrency2,


      //--------------------Freely Defined Currency 3-------->

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency3'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInFreeDefinedCurrency3
        else 0
      end                                                                      as NetProfitIntrstAmtInFDCrcy3,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency3'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInFreeDefinedCurrency3
        else 0
      end                                                                      as AmountInFreeDefinedCurrency3,


      //--------------------Freely Defined Currency 4-------->

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency4'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInFreeDefinedCurrency4
        else 0
      end                                                                      as NetProfitIntrstAmtInFDCrcy4,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency4'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInFreeDefinedCurrency4
        else 0
      end                                                                      as AmountInFreeDefinedCurrency4,


      //--------------------Freely Defined Currency 5-------->

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency5'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInFreeDefinedCurrency5
        else 0
      end                                                                      as NetProfitIntrstAmtInFDCrcy5,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency5'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInFreeDefinedCurrency5
        else 0
      end                                                                      as AmountInFreeDefinedCurrency5,


      //--------------------Freely Defined Currency 6-------->

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency6'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInFreeDefinedCurrency6
        else 0
      end                                                                      as NetProfitIntrstAmtInFDCrcy6,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency6'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInFreeDefinedCurrency6
        else 0
      end                                                                      as AmountInFreeDefinedCurrency6,


      //--------------------Freely Defined Currency 7-------->

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency7'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInFreeDefinedCurrency7
        else 0
      end                                                                      as NetProfitIntrstAmtInFDCrcy7,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency7'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInFreeDefinedCurrency7
        else 0
      end                                                                      as AmountInFreeDefinedCurrency7,


      //--------------------Freely Defined Currency 8-------->

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency8'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInFreeDefinedCurrency8
        else 0
      end                                                                      as NetProfitIntrstAmtInFDCrcy8,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'FreeDefinedCurrency8'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInFreeDefinedCurrency8
        else 0
      end                                                                      as AmountInFreeDefinedCurrency8,


      //--------------------Funding Currency -------->

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'JVAFundingCurrency1'} }
      case when PShare.JntVntrInterestType = '2'
        then JVItem.AmountInJVAFundingCurrency
        else 0
      end                                                                      as NetProfitIntrstAmtInFundCrcy,

      @Aggregation.default: #SUM
      @Semantics: { amount : { currencyCode: 'JVAFundingCurrency1'} }
      case when PShare.JntVntrInterestType <> '2'
        then JVItem.AmountInJVAFundingCurrency
        else 0
      end                                                                      as AmountInJVAFundingCurrency,



      //--------------------Percentages-----------------------

      @Aggregation.default: #MAX
      case $parameters.P_JointVenturePartner
         when PShare.JointVenturePartner then
           case when JVItem.JntVntrRcvryCodeIsBillable = 'X'
             then division( PShare.JntVntrEquityShare, 100, 8 )
             else 0 end
         when JVPars.Operator then
           case when JVItem.JntVntrRcvryCodeIsBillable = 'X'
             then division( EqGroup.JntVntrOperatedShare, 100, 8 )
             else 1 end
         else 0
      end                                                                      as JVACurPeriodNetSharePercent,

      @Aggregation.default: #MAX
      case $parameters.P_JointVenturePartner
         when PShare.JointVenturePartner then
           case when JVItem.JntVntrRcvryCodeIsBillable = 'X'
             then division( PShare.JntVntrEquityShare, 100, 8 )
             else 0 end
         when JVPars.Operator then
           case when JVItem.JntVntrRcvryCodeIsBillable = 'X'
             then division( EqGroup.JntVntrOperatedShare, 100, 8 )
             else 1 end
         else 0
      end                                                                      as JVAYearToDateNetSharePercent,

      @Aggregation.default: #MAX
      case $parameters.P_JointVenturePartner
         when PShare.JointVenturePartner then
           case when JVItem.JntVntrRcvryCodeIsBillable = 'X'
             then division( PShare.JntVntrEquityShare, 100, 8 )
             else 0 end
         when JVPars.Operator then
           case when JVItem.JntVntrRcvryCodeIsBillable = 'X'
             then division( EqGroup.JntVntrOperatedShare, 100, 8 )
             else 1 end
         else 0
      end                                                                      as ITDNetSharePercent,

      @Aggregation.default: #MAX
      case $parameters.P_JointVenturePartner
         when PShare.JointVenturePartner then
           division( PShare.JntVntrEquityShare, 100, 8 )
         when JVPars.Operator then
           division( EqGroup.JntVntrOperatedShare, 100, 8 )
         else 0
      end                                                                      as JVASuspendSharePercent,

      @Aggregation.default: #MAX
      case when PShare.JntVntrInterestType = '2'
        then division( PShare.JntVntrEquityShare, 100, 8 )
        else 0
      end                                                                      as NetProfitIntrstShrPercent,


      JVItem._Ledger,
      JVItem._CompanyCode,
      JVItem._FiscalYear,
      JVItem._JournalEntry,
      JVItem.FunctionalArea,
      JVItem._GLAccountInChartOfAccounts,
      JVItem._ChartOfAccounts,
      JVItem._DebitCreditCode,
      JVItem._ControllingArea,
      JVItem._BusinessArea,
      JVItem._CostCenter,
      JVItem._ProfitCenter,
      JVItem._Order,
      JVItem._ProjectNetwork,
      JVItem._TransactionCurrency,
      JVItem._CompanyCodeCurrency,
      JVItem._GlobalCurrency,
      JVItem._BalanceTransactionCurrency,
      JVItem._FreeDefinedCurrency1,
      JVItem._FreeDefinedCurrency2,
      JVItem._FreeDefinedCurrency3,
      JVItem._FreeDefinedCurrency4,
      JVItem._FreeDefinedCurrency5,
      JVItem._FreeDefinedCurrency6,
      JVItem._FreeDefinedCurrency7,
      JVItem._FreeDefinedCurrency8,
      JVItem._BaseUnit,
      JVItem._JointVentureMasterFld,
      JVItem._JntVntrRecoveryInd,
      JVItem._JntVntrEquityGrp,
      JVItem._JntVntrEquityTypeMaster,
      JVItem._FiscalYearVariant,
      JVItem._LedgerFiscalYearForVariant,
      JVItem._FiscalPeriodForVariant,
      JVItem._MasterFixedAsset,
      JVItem._JointVenturePayrollType,
      JVItem._AssetTransactionType,
      JVItem._WBSElementBasicData,
      JVItem._WBSElementExternalID,
      _JntVntrBusinessPartner,

      JVItem._Supplier,
      JVItem._GLAccountInCompanyCode,
      JVItem._AccountingDocumentType,
      JVItem._Customer,
      JVItem._CurrentCostCenter,
      JVItem._CurrentProfitCenter,
      JVItem._SalesDocument,
      JVItem._FixedAsset,
      JVItem.ServiceDocumentType,
      JVItem._DistributionChannel,
      JVItem._ServiceDocument

}

where
  (
          Venture.JointVentureType =  '1'
    or    Venture.JointVentureType =  '3'
    or    Venture.JointVentureType =  '4'
  )
  and(
    (
          JVItem.LedgerFiscalYear  = $parameters.P_LedgerFiscalYear
      and JVItem.FiscalPeriod      <= $parameters.P_FiscalPeriod
      and JVItem.FiscalPeriod      >= '001'
    )
    or(
          JVItem.LedgerFiscalYear  < $parameters.P_LedgerFiscalYear
      and JVItem.FiscalPeriod      >= '001'
      and JVItem.FiscalPeriod      <= '012'
    )
  )