@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