select oap.acct_period_id,
mta.accounting_line_type,
sum(mta.base_transaction_value)
from mtl_transaction_accounts mta,
org_acct_periods oap
where mta.organization_id = oap.organization_id
and mta.accounting_line_type in (1,14)
and mta.transaction_date between oap.period_start_date
and oap.schedule_close_date
and oap.organization_id = &org_id
and mta.organization_id = &org_id
and exists ( select 'X'
from mtl_cst_actual_cost_details mcacd,
cst_quantity_layers cql
where mcacd.organization_id=&org_id
and mcacd.layer_id=cql.layer_id
and cql.cost_group_id = &cost_group_id
and cql.organization_id=mcacd.organization_id
and mcacd.transaction_id = mta.transaction_id
)
group by oap.acct_period_id,
mta.accounting_line_type
mta.accounting_line_type,
sum(mta.base_transaction_value)
from mtl_transaction_accounts mta,
org_acct_periods oap
where mta.organization_id = oap.organization_id
and mta.accounting_line_type in (1,14)
and mta.transaction_date between oap.period_start_date
and oap.schedule_close_date
and oap.organization_id = &org_id
and mta.organization_id = &org_id
and exists ( select 'X'
from mtl_cst_actual_cost_details mcacd,
cst_quantity_layers cql
where mcacd.organization_id=&org_id
and mcacd.layer_id=cql.layer_id
and cql.cost_group_id = &cost_group_id
and cql.organization_id=mcacd.organization_id
and mcacd.transaction_id = mta.transaction_id
)
group by oap.acct_period_id,
mta.accounting_line_type
No comments:
Post a Comment