<ROOT>
 <APPS_INITIALIZE_DATA>
  <USER_NAME>ENGINATICS</USER_NAME>
  <RESPONSIBILITY_KEY>SYSTEM_ADMINISTRATOR</RESPONSIBILITY_KEY>
  <APPLICATION_SHORT_NAME>SYSADMIN</APPLICATION_SHORT_NAME>
 </APPS_INITIALIZE_DATA>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: CAC WIP Pending Cost Adjustment -->
 <REPORTS_ROW>
  <GUID>B5B9D73A3AE6F2E4E053BB6B6358E913</GUID><ENABLED>Y</ENABLED>
  <SQL_TEXT>with j as
(
select
nvl(gl.short_name,gl.name) ledger,
haouv_ou.name operating_unit,
mp.organization_code org_code,
haou.name organization_name,
gl.currency_code,
wdj.organization_id,
wdj.wip_entity_id,
we.wip_entity_name,
wdj.primary_item_id,
wdj.class_code,
wac.class_type,
wdj.status_type,
wdj.date_released,
wdj.date_completed,
wdj.last_update_date
from
mtl_parameters mp,
hr_organization_information hoi,
hr_all_organization_units haou,
hr_all_organization_units_vl haouv_ou,
gl_ledgers gl,
wip_discrete_jobs wdj,
wip_entities we,
wip_accounting_classes wac
where
1=1 and
9=9 and
mp.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&apos;) and
mp.organization_id&lt;&gt;mp.master_organization_id and
mp.organization_id=hoi.organization_id and
hoi.org_information_context=&apos;Accounting Information&apos; and
hoi.organization_id=haou.organization_id and
sysdate&lt;nvl(haou.date_to,sysdate+1) and
to_number(hoi.org_information3)=haouv_ou.organization_id and
to_number(hoi.org_information1)=gl.ledger_id and
mp.organization_id=wdj.organization_id and
wdj.date_closed is null and
nvl(wdj.issue_zero_cost_flag,&apos;N&apos;)=&apos;N&apos; and
wdj.wip_entity_id=we.wip_entity_id and
wdj.class_code=wac.class_code and
wdj.organization_id=wac.organization_id and
wac.class_type not in (4,6,7)
)
select
z.ledger,
z.operating_unit,
z.org_code,
z.organization_name,
z.class_code wip_class,
xxen_util.meaning(z.class_type,&apos;WIP_CLASS_TYPE&apos;,700) class_type,
z.wip_entity_name wip_job,
xxen_util.meaning(z.status_type,&apos;WIP_JOB_STATUS&apos;,700) job_status,
z.date_released,
z.date_completed,
z.last_update_date,
z.item_number,
z.item_description,
&amp;category_columns
xxen_util.meaning(z.item_type,&apos;ITEM_TYPE&apos;,3) item_type,
z.item_status,
xxen_util.meaning(z.planning_make_buy_code,&apos;MTL_PLANNING_MAKE_BUY&apos;,700) make_buy_code,
xxen_util.meaning(z.wip_supply_type,&apos;WIP_SUPPLY&apos;,700) supply_type,
z.transaction_type,
z.resource_code,
z.overhead_code,
z.op_seq_num operation_seq_number,
z.res_seq_num resource_seq_number,
xxen_util.meaning(z.basis_type,&apos;CST_BASIS&apos;,700) matl_or_resource_basis_type,
xxen_util.meaning(z.ovhd_basis_type,&apos;CST_BASIS&apos;,700) overhead_basis_type,
z.currency_code,
z.uom_code,
round(z.material1,5) new_material_cost,
round(z.material2,5) old_material_cost,
round(z.moh1,5) new_material_overhead_cost,
round(z.moh2,5) old_material_overhead_cost,
round(z.resource1,5) new_resource_cost,
round(z.resource2,5) old_resource_cost,
round(z.osp1,5) new_outside_processing_cost,
round(z.osp2,5) old_outside_processing_cost,
round(z.overhead1,5) new_overhead_cost,
round(z.overhead2,5) old_overhead_cost,
round(z.item_cost1,5) new_item_cost,
round(z.item_cost2,5) old_item_cost,
round(z.item_cost1,5)-round(z.item_cost2,5) item_cost_difference,
case
when round(z.item_cost1,5)=round(z.item_cost2,5) then 0
when round(z.item_cost2,5)=0 then 100
else round((z.item_cost1-z.item_cost2)/z.item_cost2*100,2)
end percent_difference,
z.wip_quantity,
z.value_sign*round(z.item_cost1*z.quantity1,2) new_onhand_value,
z.value_sign*round(z.item_cost2*z.quantity2,2) old_onhand_value,
z.value_sign*(round(z.item_cost1*z.quantity1,2)-round(z.item_cost2*z.quantity2,2)) onhand_value_difference,
abs(round(z.item_cost1*z.quantity1,2)-round(z.item_cost2*z.quantity2,2)) abs_onhand_value_difference,
z.rate1 new_fx_rate,
z.rate2 old_fx_rate,
z.rate1-z.rate2 exchange_rate_difference,
z.value_sign*round(z.material1*z.rate1*z.quantity1,2) &quot;&amp;p_to_currency_code New Material Value&quot;,
z.value_sign*round(z.material2*z.rate2*z.quantity2,2) &quot;&amp;p_to_currency_code Old Material Value&quot;,
z.value_sign*round(z.moh1*z.rate1*z.quantity1,2) &quot;&amp;p_to_currency_code New Material Ovhd Value&quot;,
z.value_sign*round(z.moh2*z.rate2*z.quantity2,2) &quot;&amp;p_to_currency_code Old Material Ovhd Value&quot;,
z.value_sign*round(z.resource1*z.rate1*z.quantity1,2) &quot;&amp;p_to_currency_code New Resource Value&quot;,
z.value_sign*round(z.resource2*z.rate2*z.quantity2,2) &quot;&amp;p_to_currency_code Old Resource Value&quot;,
z.value_sign*round(z.osp1*z.rate1*z.quantity1,2) &quot;&amp;p_to_currency_code New OSP Value&quot;,
z.value_sign*round(z.osp2*z.rate2*z.quantity2,2) &quot;&amp;p_to_currency_code Old OSP Value&quot;,
z.value_sign*round(z.overhead1*z.rate1*z.quantity1,2) &quot;&amp;p_to_currency_code New Overhead Value&quot;,
z.value_sign*round(z.overhead2*z.rate2*z.quantity2,2) &quot;&amp;p_to_currency_code Old Overhead Value&quot;,
z.value_sign*round(z.item_cost1*z.quantity1*z.rate1,2) &quot;&amp;p_to_currency_code New Onhand Value&quot;,
z.value_sign*round(z.item_cost2*z.quantity2*z.rate2,2) &quot;&amp;p_to_currency_code Old Onhand Value&quot;,
z.value_sign*(round(z.item_cost1*z.quantity1*z.rate1,2)-round(z.item_cost2*z.quantity2*z.rate2,2)) &quot;&amp;p_to_currency_code Onhand Value Difference&quot;,
abs(round(z.item_cost1*z.quantity1*z.rate1,2)-round(z.item_cost2*z.quantity2*z.rate2,2)) &quot;&amp;p_to_currency_code Abs Onhand Value Diff&quot;,
z.value_sign*round((z.item_cost1*z.quantity1-z.item_cost2*z.quantity2)*z.rate1,2) &quot;&amp;p_to_currency_code Value Difference-New Rate&quot;,
z.value_sign*round((z.item_cost1*z.quantity1-z.item_cost2*z.quantity2)*z.rate2,2) &quot;&amp;p_to_currency_code Value Difference-Old Rate&quot;,
z.value_sign*(round((z.item_cost1*z.quantity1-z.item_cost2*z.quantity2)*z.rate1,2)-round((z.item_cost1*z.quantity1-z.item_cost2*z.quantity2)*z.rate2,2)) &quot;&amp;p_to_currency_code Value FX Difference&quot;
from
(
select
y.ledger,
y.operating_unit,
y.org_code,
y.organization_name,
y.currency_code,
y.organization_id,
y.inventory_item_id,
y.wip_entity_name,
y.class_code,
y.class_type,
y.status_type,
y.date_released,
y.date_completed,
y.last_update_date,
y.transaction_type,
y.resource_code,
y.overhead_code,
y.op_seq_num,
y.res_seq_num,
y.basis_type,
y.ovhd_basis_type,
y.wip_supply_type,
y.value_sign,
msiv.concatenated_segments item_number,
msiv.description item_description,
msiv.item_type,
misv.inventory_item_status_code_tl item_status,
msiv.planning_make_buy_code,
msiv.primary_uom_code uom_code,
decode(y.row_type,&apos;O&apos;,round(decode(y.overhead_rate1,0,y.quantity2,y.quantity1),3),y.quantity) wip_quantity,
decode(y.row_type,&apos;O&apos;,y.quantity1,y.quantity) quantity1,
decode(y.row_type,&apos;O&apos;,y.quantity2,y.quantity) quantity2,
decode(y.cost_source,&apos;M&apos;,nvl(cic1.material_cost,0),0) material1,
decode(y.cost_source,&apos;M&apos;,nvl(cic2.material_cost,0),0) material2,
decode(y.cost_source,&apos;M&apos;,round(nvl(cic1.material_overhead_cost,0)-decode(y.this_level,&apos;Y&apos;,nvl(cic1.tl_material_overhead,0),0),5),0) moh1,
decode(y.cost_source,&apos;M&apos;,round(nvl(cic2.material_overhead_cost,0)-decode(y.this_level,&apos;Y&apos;,nvl(cic2.tl_material_overhead,0),0),5),0) moh2,
decode(y.cost_source,&apos;M&apos;,nvl(cic1.resource_cost,0),&apos;R&apos;,decode(y.cost_element_id,3,nvl(crc1.resource_rate,0),0),0) resource1,
decode(y.cost_source,&apos;M&apos;,nvl(cic2.resource_cost,0),&apos;R&apos;,decode(y.cost_element_id,3,nvl(crc2.resource_rate,0),0),0) resource2,
decode(y.cost_source,&apos;M&apos;,nvl(cic1.outside_processing_cost,0),&apos;R&apos;,decode(y.cost_element_id,4,nvl(crc1.resource_rate,0),0),0) osp1,
decode(y.cost_source,&apos;M&apos;,nvl(cic2.outside_processing_cost,0),&apos;R&apos;,decode(y.cost_element_id,4,nvl(crc2.resource_rate,0),0),0) osp2,
decode(y.cost_source,&apos;M&apos;,nvl(cic1.overhead_cost,0),&apos;O&apos;,y.overhead_rate1,0) overhead1,
decode(y.cost_source,&apos;M&apos;,nvl(cic2.overhead_cost,0),&apos;O&apos;,y.overhead_rate2,0) overhead2,
decode(y.cost_source,&apos;M&apos;,round(nvl(cic1.item_cost,0)-decode(y.this_level,&apos;Y&apos;,nvl(cic1.tl_material_overhead,0),0),5),&apos;R&apos;,nvl(crc1.resource_rate,0),y.overhead_rate1) item_cost1,
decode(y.cost_source,&apos;M&apos;,round(nvl(cic2.item_cost,0)-decode(y.this_level,&apos;Y&apos;,nvl(cic2.tl_material_overhead,0),0),5),&apos;R&apos;,nvl(crc2.resource_rate,0),y.overhead_rate2) item_cost2,
decode(y.cost_source,&apos;M&apos;,nvl(cic1.item_cost,0),&apos;R&apos;,nvl(crc1.resource_rate,0),y.overhead_rate1*y.quantity1) filter1,
decode(y.cost_source,&apos;M&apos;,nvl(cic2.item_cost,0),&apos;R&apos;,nvl(crc2.resource_rate,0),y.overhead_rate2*y.quantity2) filter2,
decode(y.currency_code,:p_to_currency_code,1,(select gdr1.conversion_rate from gl_daily_conversion_types gdct1, gl_daily_rates gdr1 where 4=4 and 5=5 and 11=11 and gdct1.conversion_type=gdr1.conversion_type and y.currency_code=gdr1.from_currency)) rate1,
decode(y.currency_code,:p_to_currency_code,1,(select gdr2.conversion_rate from gl_daily_conversion_types gdct2, gl_daily_rates gdr2 where 6=6 and 7=7 and gdct2.conversion_type=gdr2.conversion_type and y.currency_code=gdr2.from_currency and gdr2.to_currency=:p_to_currency_code)) rate2
from
(
select
j.ledger,
j.operating_unit,
j.org_code,
j.organization_name,
j.currency_code,
j.organization_id,
j.wip_entity_name,
j.class_code,
j.class_type,
j.status_type,
j.date_released,
j.date_completed,
j.last_update_date,
nvl(d.inventory_item_id,j.primary_item_id) inventory_item_id,
d.row_type,
decode(d.row_type,&apos;C&apos;,&apos;M&apos;,d.row_type) cost_source,
d.transaction_type,
d.resource_code,
d.overhead_code,
d.op_seq_num,
d.res_seq_num,
d.basis_type,
d.ovhd_basis_type,
d.wip_supply_type,
decode(d.row_type,&apos;C&apos;,-1,1) value_sign,
case when d.row_type=&apos;C&apos; and j.class_type in (1,5) then &apos;Y&apos; end this_level,
d.quantity,
d.resource_id,
d.cost_element_id,
d.overhead_rate1,
d.overhead_rate2,
d.quantity1,
d.quantity2,
case
when d.row_type in (&apos;C&apos;,&apos;M&apos;) then nvl((select cic.cost_type_id from cst_cost_types cct, cst_item_costs cic where cct.cost_type=:p_cost_type1 and cct.cost_type_id=cic.cost_type_id and j.organization_id=cic.organization_id and nvl(d.inventory_item_id,j.primary_item_id)=cic.inventory_item_id),1)
when d.row_type=&apos;R&apos; then nvl((select crc.cost_type_id from cst_cost_types cct, cst_resource_costs crc where cct.cost_type=:p_cost_type1 and cct.cost_type_id=crc.cost_type_id and j.organization_id=crc.organization_id and d.resource_id=crc.resource_id),1)
end cost_type_id1,
case
when d.row_type in (&apos;C&apos;,&apos;M&apos;) then nvl((select cic.cost_type_id from cst_cost_types cct, cst_item_costs cic where cct.cost_type=:p_cost_type2 and cct.cost_type_id=cic.cost_type_id and j.organization_id=cic.organization_id and nvl(d.inventory_item_id,j.primary_item_id)=cic.inventory_item_id),1)
when d.row_type=&apos;R&apos; then nvl((select crc.cost_type_id from cst_cost_types cct, cst_resource_costs crc where cct.cost_type=:p_cost_type2 and cct.cost_type_id=crc.cost_type_id and j.organization_id=crc.organization_id and d.resource_id=crc.resource_id),1)
end cost_type_id2
from
j,
(
select
&apos;C&apos; row_type,
wdj.wip_entity_id,
to_number(null) inventory_item_id,
(select mtt.transaction_type_name from mtl_transaction_types mtt where mtt.transaction_type_id=44) transaction_type,
null resource_code,
null overhead_code,
to_number(null) op_seq_num,
to_number(null) res_seq_num,
1 basis_type,
to_number(null) ovhd_basis_type,
to_number(null) wip_supply_type,
wdj.quantity_completed quantity,
to_number(null) resource_id,
to_number(null) cost_element_id,
to_number(null) overhead_rate1,
to_number(null) overhead_rate2,
to_number(null) quantity1,
to_number(null) quantity2
from
j,
wip_discrete_jobs wdj
where
j.wip_entity_id=wdj.wip_entity_id and
wdj.quantity_completed+wdj.quantity_scrapped&lt;&gt;0
union all
select
&apos;M&apos; row_type,
wro.wip_entity_id,
wro.inventory_item_id,
(select mtt.transaction_type_name from mtl_transaction_types mtt where mtt.transaction_type_id=decode(sign(wro.quantity_issued),1,35,43)) transaction_type,
null resource_code,
null overhead_code,
wro.operation_seq_num op_seq_num,
null res_seq_num,
nvl(wro.basis_type,1) basis_type,
null ovhd_basis_type,
wro.wip_supply_type,
wro.quantity_issued quantity,
null resource_id,
null cost_element_id,
null overhead_rate1,
null overhead_rate2,
null quantity1,
null quantity2
from
j,
wip_requirement_operations wro
where
j.wip_entity_id=wro.wip_entity_id and
j.organization_id=wro.organization_id and
wro.quantity_issued&lt;&gt;0
union all
select
&apos;R&apos; row_type,
wor.wip_entity_id,
null inventory_item_id,
xxen_util.meaning(decode(br.cost_element_id,3,1,4,3),&apos;WIP_TRANSACTION_TYPE&apos;,700) transaction_type,
br.resource_code,
null overhead_code,
wor.operation_seq_num op_seq_num,
wor.resource_seq_num res_seq_num,
wor.basis_type,
null ovhd_basis_type,
(select max(wro.wip_supply_type) from wip_requirement_operations wro where wor.wip_entity_id=wro.wip_entity_id and wor.operation_seq_num=wro.operation_seq_num) wip_supply_type,
round(wor.applied_resource_units,3) quantity,
wor.resource_id,
br.cost_element_id,
null overhead_rate1,
null overhead_rate2,
null quantity1,
null quantity2
from
j,
wip_operation_resources wor,
bom_resources br
where
j.wip_entity_id=wor.wip_entity_id and
j.organization_id=wor.organization_id and
wor.applied_resource_units&lt;&gt;0 and
wor.resource_id=br.resource_id and
br.cost_element_id in (3,4)
union all
select
&apos;O&apos; row_type,
o.wip_entity_id,
null inventory_item_id,
xxen_util.meaning(2,&apos;WIP_TRANSACTION_TYPE&apos;,700) transaction_type,
o.resource_code,
o.overhead_code,
o.op_seq_num,
o.res_seq_num,
o.res_basis_type basis_type,
o.ovhd_basis_type,
(select max(wro.wip_supply_type) from wip_requirement_operations wro where o.wip_entity_id=wro.wip_entity_id and o.op_seq_num=wro.operation_seq_num) wip_supply_type,
null quantity,
null resource_id,
null cost_element_id,
nvl(sum(decode(o.side,1,o.overhead_rate)),0) overhead_rate1,
nvl(sum(decode(o.side,2,o.overhead_rate)),0) overhead_rate2,
nvl(sum(decode(o.side,1,o.quantity)),0) quantity1,
nvl(sum(decode(o.side,2,o.quantity)),0) quantity2
from
(
select
wo.wip_entity_id,
null resource_code,
br_ovhd.resource_code overhead_code,
wo.operation_seq_num op_seq_num,
to_number(null) res_seq_num,
to_number(null) res_basis_type,
cdo.basis_type ovhd_basis_type,
cdo.side,
cdo.overhead_rate,
decode(cdo.basis_type,1,wo.quantity_completed,2,1) quantity
from
j,
wip_operations wo,
(
select
rowgen.column_value side,
cdo.organization_id,
cdo.department_id,
cdo.overhead_id,
cdo.cost_type_id,
cdo.basis_type,
nvl(cdo.rate_or_amount,0) overhead_rate
from
table(xxen_util.rowgen(2)) rowgen,
cst_cost_types cct,
cst_department_overheads cdo
where
cct.cost_type=decode(rowgen.column_value,1,:p_cost_type1,:p_cost_type2) and
(cdo.cost_type_id=cct.cost_type_id or cdo.cost_type_id=1 and cct.cost_type_id&lt;&gt;1 and (cdo.organization_id,cdo.department_id,cdo.overhead_id) not in (select cdo2.organization_id, cdo2.department_id, cdo2.overhead_id from cst_department_overheads cdo2 where cct.cost_type_id=cdo2.cost_type_id))
) cdo,
bom_resources br_ovhd
where
j.wip_entity_id=wo.wip_entity_id and
j.organization_id=wo.organization_id and
wo.quantity_completed&lt;&gt;0 and
wo.organization_id=cdo.organization_id and
wo.department_id=cdo.department_id and
cdo.basis_type in (1,2) and
cdo.overhead_id=br_ovhd.resource_id
union all
select
wor.wip_entity_id,
br.resource_code,
br_ovhd.resource_code overhead_code,
wor.operation_seq_num op_seq_num,
wor.resource_seq_num res_seq_num,
wor.basis_type res_basis_type,
cdo.basis_type ovhd_basis_type,
cdo.side,
cdo.overhead_rate,
decode(cdo.basis_type,3,wor.applied_resource_units,4,wor.applied_resource_units*nvl((select max(crc.resource_rate) keep (dense_rank first order by decode(crc.cost_type_id,1,2,1)) from cst_resource_costs crc where wor.organization_id=crc.organization_id and wor.resource_id=crc.resource_id and crc.cost_type_id in (cdo.requested_cost_type_id,1)),0)) quantity
from
j,
wip_operations wo,
wip_operation_resources wor,
bom_resources br,
cst_resource_overheads cro,
(
select
rowgen.column_value side,
cct.cost_type_id requested_cost_type_id,
cdo.organization_id,
cdo.department_id,
cdo.overhead_id,
cdo.cost_type_id,
cdo.basis_type,
nvl(cdo.rate_or_amount,0) overhead_rate
from
table(xxen_util.rowgen(2)) rowgen,
cst_cost_types cct,
cst_department_overheads cdo
where
cct.cost_type=decode(rowgen.column_value,1,:p_cost_type1,:p_cost_type2) and
(cdo.cost_type_id=cct.cost_type_id or cdo.cost_type_id=1 and cct.cost_type_id&lt;&gt;1 and (cdo.organization_id,cdo.department_id,cdo.overhead_id) not in (select cdo2.organization_id, cdo2.department_id, cdo2.overhead_id from cst_department_overheads cdo2 where cct.cost_type_id=cdo2.cost_type_id))
) cdo,
bom_resources br_ovhd
where
j.wip_entity_id=wo.wip_entity_id and
j.organization_id=wo.organization_id and
wo.wip_entity_id=wor.wip_entity_id and
wo.operation_seq_num=wor.operation_seq_num and
wo.organization_id=wor.organization_id and
wor.applied_resource_units&lt;&gt;0 and
wor.resource_id=br.resource_id and
wo.organization_id=cdo.organization_id and
wo.department_id=cdo.department_id and
cdo.basis_type in (3,4) and
cdo.cost_type_id=cro.cost_type_id and
cdo.organization_id=cro.organization_id and
cdo.overhead_id=cro.overhead_id and
wor.resource_id=cro.resource_id and
cdo.overhead_id=br_ovhd.resource_id
) o
group by
o.wip_entity_id,
o.resource_code,
o.overhead_code,
o.op_seq_num,
o.res_seq_num,
o.res_basis_type,
o.ovhd_basis_type
) d
where
j.wip_entity_id=d.wip_entity_id and
(d.row_type&lt;&gt;&apos;O&apos; or j.date_released is not null)
) y,
mtl_system_items_vl msiv,
mtl_item_status_vl misv,
cst_item_costs cic1,
cst_item_costs cic2,
cst_resource_costs crc1,
cst_resource_costs crc2
where
15=15 and
y.organization_id=msiv.organization_id and
y.inventory_item_id=msiv.inventory_item_id and
msiv.inventory_item_status_code=misv.inventory_item_status_code and
decode(y.row_type,&apos;C&apos;,y.inventory_item_id,&apos;M&apos;,y.inventory_item_id)=cic1.inventory_item_id(+) and
y.organization_id=cic1.organization_id(+) and
y.cost_type_id1=cic1.cost_type_id(+) and
decode(y.row_type,&apos;C&apos;,y.inventory_item_id,&apos;M&apos;,y.inventory_item_id)=cic2.inventory_item_id(+) and
y.organization_id=cic2.organization_id(+) and
y.cost_type_id2=cic2.cost_type_id(+) and
y.resource_id=crc1.resource_id(+) and
y.organization_id=crc1.organization_id(+) and
y.cost_type_id1=crc1.cost_type_id(+) and
y.resource_id=crc2.resource_id(+) and
y.organization_id=crc2.organization_id(+) and
y.cost_type_id2=crc2.cost_type_id(+) and
(y.row_type not in (&apos;C&apos;,&apos;M&apos;) or cic1.cost_type_id=1 or cic1.based_on_rollup_flag=1 and cic1.item_cost is not null or cic1.based_on_rollup_flag=2) and
(y.row_type&lt;&gt;&apos;R&apos; or crc1.resource_id is not null)
) z
where
(:p_all_wip_jobs=&apos;Y&apos; or nvl(round(z.filter1*z.rate1,5)-round(z.filter2*z.rate2,5),round(z.filter1,5)-round(z.filter2,5))&lt;&gt;0)
order by
z.ledger,
z.operating_unit,
z.org_code,
z.organization_name,
z.class_code,
z.wip_entity_name,
z.transaction_type,
z.item_number,
z.op_seq_num,
z.res_seq_num</SQL_TEXT>
  <VERSION_COMMENTS>Completions, component issues, resources and overheads are read for the WIP jobs of the selected organization only. They were read for the jobs of all organizations and restricted afterwards, which made the report slow and used much temporary space on installations with many WIP jobs. The output is unchanged.</VERSION_COMMENTS>
  <NUMBER_FORMAT>#,##0.00000;[Red](#,##0.00000)</NUMBER_FORMAT>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>CAC WIP Pending Cost Adjustment</REPORT_NAME>
    <DESCRIPTION>Report showing the potential standard cost changes for WIP discrete jobs, for the WIP completions, WIP component issues, WIP resource (labor) and WIP overhead transactions.  However, WIP cost adjustments for Assembly Scrap is not included.  The Cost Type (Old) defaults to your Costing Method Cost Type (Average, Standard, etc.); the Currency Conversion Dates default to the latest open or closed accounting period; and the To Currency Code and the Organization Code default from the organization code set for this session.   And if you choose Yes for &quot;Include All WIP Jobs&quot; all WIP jobs will be reported even if there are no valuation changes.

/* +=============================================================================+
-- |  Copyright 2020 - 2025 Douglas Volz Consulting, Inc.
-- |  Permission to use this code is granted provided the original author is
-- |  acknowledged.  No warranties, express or otherwise is included in this
-- |  permission. All rights reserved.
-- +=============================================================================+

-- |  Version Modified on  Modified  by   Description
-- |  ======= =========== ============== =========================================
-- |      1.0 04 Dec 2020 Douglas Volz   Created initial Report based on the Pending
-- |                                     Cost Adjustment Report for Inventory and Intransit.
-- |      1.1 11 Dec 2020 Douglas Volz   Corrected cost adjustments for assemblies
-- |      1.2 16 Dec 2020 Douglas Volz   Change SIGN of completion quantities to match
-- |                                     the Oracle WIP Standard Cost Adjustment Report.
-- |      1.3 10 Feb 2021 Douglas Volz   Fixes for WIP completion quantities, needed to
-- |                                     change the SIGN of completion quantities.
-- |      1.4 17 Feb 2021 Douglas Volz   Add absolute difference column.
-- |      1.5 13 Dec 2021 Douglas Volz   Add parameter to report all WIP jobs, even
-- |                                     if there is no valuation change.
-- |      1.6 12 Feb 2024 Douglas Volz   Remove tabs, simplify G/L conversion rates,
-- |                                     added inventory org access security.
-- |      1.7 20 Jul 2026 Douglas Volz   Added in overhead cost and valuation differences.
-- |      1.8 26 Sep 2026 Enginatics     Currency rate and overhead corrections.
-- |  1.10    23 Oct 2026 Andy Haack    Rebuilt to the Blitz Report SQL standards.
-- +=============================================================================+*/</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>Enginatics</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>&amp;category_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>&amp;p_to_currency_code</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>11=11</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>15=15</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>4=4</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>5=5</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>6=6</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>7=7</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>9=9</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_all_wip_jobs</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_cost_type1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_cost_type2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_to_currency_code</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>:p_cost_type1</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>CST Cost Type (No AvgRates No PII)</LOV_NAME>
    <LOV_GUID>A486BD05719A2A82E053BB6B6358FC8E</LOV_GUID>
    <LOV_QUERY_DSP>select
cct.cost_type value,
cct.description
from
cst_cost_types cct
where
nvl(cct.disable_date,sysdate)&gt;=sysdate and
cct.organization_id is null and
(cct.cost_type not like &apos;%PII%&apos; or cct.cost_type like &apos;%ICP%&apos;) and
cct.cost_type_id not in (select mp.avg_rates_cost_type_id from mtl_parameters mp where mp.avg_rates_cost_type_id is not null)
order by
cct.cost_type</LOV_QUERY_DSP>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Cost Type (New)</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>:p_cost_type2</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>CST Cost Type (No AvgRates No PII)</LOV_NAME>
    <LOV_GUID>A486BD05719A2A82E053BB6B6358FC8E</LOV_GUID>
    <LOV_QUERY_DSP>select
cct.cost_type value,
cct.description
from
cst_cost_types cct
where
nvl(cct.disable_date,sysdate)&gt;=sysdate and
cct.organization_id is null and
(cct.cost_type not like &apos;%PII%&apos; or cct.cost_type like &apos;%ICP%&apos;) and
cct.cost_type_id not in (select mp.avg_rates_cost_type_id from mtl_parameters mp where mp.avg_rates_cost_type_id is not null)
order by
cct.cost_type</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select cct.cost_type
from cst_cost_types cct,
 mtl_parameters mp
where cct.cost_type_id = mp.primary_cost_method
and mp.organization_id=fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;)</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Cost Type (Old)</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>4=4</ANCHOR>
    <SQL_TEXT>gdr1.conversion_date = :p_curr_conv_date1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select oap.schedule_close_date value,
 oap.period_name description
from apps.org_acct_periods oap
where oap.acct_period_id =
 (select max(oap2.acct_period_id)
  from org_acct_periods oap2
  where oap2.schedule_close_date =
  (select max(oap3.schedule_close_date)
   from org_acct_periods oap3,
   org_organization_definitions ood
   where ood.organization_id = oap3.organization_id
   and nvl(ood.disable_date,sysdate + 1) &gt; sysdate
  ) 
 )</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Currency Conversion Date (New)</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>5=5</ANCHOR>
    <SQL_TEXT>gdct1.user_conversion_type = :p_curr_conv_type1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Currency Conversion Type</LOV_NAME>
    <LOV_GUID>91D3167A335F1204E053BB6B63585EE3</LOV_GUID>
    <LOV_QUERY_DSP>select
gdct.conversion_type id,
gdct.user_conversion_type value,
gdct.description
from
gl_daily_conversion_types gdct
order by
gdct.user_conversion_type</LOV_QUERY_DSP>
    <ID_OR_VALUE>value</ID_OR_VALUE>
    <DEFAULT_VALUE>Corporate</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Currency Conversion Type (New)</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>6=6</ANCHOR>
    <SQL_TEXT>gdr2.conversion_date = :p_curr_conv_date2</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>select oap.schedule_close_date value,
 oap.period_name description
from apps.org_acct_periods oap
where oap.acct_period_id =
 (select max(oap2.acct_period_id)
  from org_acct_periods oap2
  where oap2.schedule_close_date =
  (select max(oap3.schedule_close_date)
   from org_acct_periods oap3,
   org_organization_definitions ood
   where ood.organization_id = oap3.organization_id
   and nvl(ood.disable_date,sysdate + 1) &gt; sysdate
  ) 
 )</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Currency Conversion Date (Old)</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>7=7</ANCHOR>
    <SQL_TEXT>gdct2.user_conversion_type = :p_curr_conv_type2</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Currency Conversion Type</LOV_NAME>
    <LOV_GUID>91D3167A335F1204E053BB6B63585EE3</LOV_GUID>
    <LOV_QUERY_DSP>select
gdct.conversion_type id,
gdct.user_conversion_type value,
gdct.description
from
gl_daily_conversion_types gdct
order by
gdct.user_conversion_type</LOV_QUERY_DSP>
    <ID_OR_VALUE>value</ID_OR_VALUE>
    <DEFAULT_VALUE>Corporate</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Currency Conversion Type (Old)</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>70</DISPLAY_SEQUENCE>
    <ANCHOR>11=11</ANCHOR>
    <SQL_TEXT>gdr1.to_currency = :p_to_currency_code</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>FND Currency</LOV_NAME>
    <LOV_GUID>8E2FF36EDE9079D2E0530100007F1FF2</LOV_GUID>
    <LOV_QUERY_DSP>select
fcv.currency_code id,
fcv.currency_code value,
fcv.description
from
fnd_currencies_vl fcv
where
fcv.enabled_flag=&apos;Y&apos;
order by
fcv.currency_code</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select gl.currency_code
from mtl_parameters mp,
 hr_organization_information hoi,
 gl_ledgers gl
where hoi.org_information_context = &apos;Accounting Information&apos;
and hoi.organization_id         = mp.organization_id
and gl.ledger_id                = to_number(hoi.org_information1) -- get the ledger_id
and mp.organization_id          = fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;)</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>To Currency Code</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <ANCHOR>&amp;p_to_currency_code</ANCHOR>
    <SQL_TEXT>&lt;parameter_value&gt;</SQL_TEXT>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>To Currency Code</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;category_columns</ANCHOR>
    <SQL_TEXT>select xxen_util.item_category_columns(p_category_set_name=&gt;&apos;&lt;parameter_value&gt;&apos;, p_table_alias=&gt;&apos;z&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Category Set</LOV_NAME>
    <LOV_GUID>8E2FF36EDECA79D2E0530100007F1FF2</LOV_GUID>
    <LOV_QUERY_DSP>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>coalesce(xxen_util.previous_parameter_value(:parameter_id),(select mdsv.category_set_name from mtl_default_sets_view mdsv where mdsv.functional_area_id=11))</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Category Set 1</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>10</SORT_ORDER>
    <DISPLAY_SEQUENCE>90</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;category_columns</ANCHOR>
    <SQL_TEXT>select xxen_util.item_category_columns(p_category_set_name=&gt;&apos;&lt;parameter_value&gt;&apos;, p_table_alias=&gt;&apos;z&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Category Set</LOV_NAME>
    <LOV_GUID>8E2FF36EDECA79D2E0530100007F1FF2</LOV_GUID>
    <LOV_QUERY_DSP>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>coalesce(xxen_util.previous_parameter_value(:parameter_id),(select mdsv.category_set_name from mtl_default_sets_view mdsv where mdsv.functional_area_id=5))</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Category Set 2</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>11</SORT_ORDER>
    <DISPLAY_SEQUENCE>100</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;category_columns</ANCHOR>
    <SQL_TEXT>select xxen_util.item_category_columns(p_category_set_name=&gt;&apos;&lt;parameter_value&gt;&apos;, p_table_alias=&gt;&apos;z&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Category Set</LOV_NAME>
    <LOV_GUID>8E2FF36EDECA79D2E0530100007F1FF2</LOV_GUID>
    <LOV_QUERY_DSP>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>xxen_util.previous_parameter_value(:parameter_id)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Category Set 3</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>12</SORT_ORDER>
    <DISPLAY_SEQUENCE>110</DISPLAY_SEQUENCE>
    <ANCHOR>:p_all_wip_jobs</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <DEFAULT_VALUE>N</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Include All WIP Jobs</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>13</SORT_ORDER>
    <DISPLAY_SEQUENCE>120</DISPLAY_SEQUENCE>
    <ANCHOR>15=15</ANCHOR>
    <SQL_TEXT>msiv.concatenated_segments=:p_item_number</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Item (master, costing enabled only)</LOV_NAME>
    <LOV_GUID>91D022B15B12FFB9E053BB6B63587F0B</LOV_GUID>
    <LOV_QUERY_DSP>select
msiv.concatenated_segments value,
msiv.description
from
mtl_system_items_vl msiv
where
msiv.organization_id=(
select
max(mp.master_organization_id) master_organization_id
from
mtl_parameters mp
where
mp.organization_id=fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;) or
fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;) is null and
mp.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&apos;)
) and
msiv.costing_enabled_flag=&apos;Y&apos;
order by
msiv.concatenated_segments</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Item Number</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>14</SORT_ORDER>
    <DISPLAY_SEQUENCE>130</DISPLAY_SEQUENCE>
    <ANCHOR>9=9</ANCHOR>
    <SQL_TEXT>mp.organization_code=:p_org_code</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Organization Code (excluding master)</LOV_NAME>
    <LOV_GUID>91D3167A33531204E053BB6B63585EE3</LOV_GUID>
    <LOV_QUERY_DSP>select
ood.organization_code value,
ood.organization_name description
from
org_organization_definitions ood
where
ood.organization_id not in (select mp.organization_id from mtl_parameters mp where mp.organization_id=mp.master_organization_id) and
(:$flex$.operating_unit is null or ood.operating_unit in (select haouv.organization_id from hr_all_organization_units_vl haouv where xxen_util.contains(:$flex$.operating_unit,haouv.name)=&apos;Y&apos;)) and
(:$flex$.ledger is null or ood.set_of_books_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
ood.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&apos;) and
nvl(ood.disable_date,sysdate)&gt;=sysdate
order by
ood.organization_code</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select mp.organization_code from mtl_parameters mp where mp.organization_id=fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>15</SORT_ORDER>
    <DISPLAY_SEQUENCE>140</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>haouv_ou.name=:p_operating_unit</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Operating Unit</LOV_NAME>
    <LOV_GUID>9B9627743E84607DE053BB6B635805FB</LOV_GUID>
    <LOV_QUERY_DSP>select
haouv.name value,
&apos;Operating Unit&apos; description
from
hr_all_organization_units_vl haouv
where
haouv.organization_id in
(
select
to_number(hoi.org_information3)
from
mtl_parameters mp,
hr_organization_information hoi,
hr_all_organization_units haou
where
mp.organization_id&lt;&gt;mp.master_organization_id and
mp.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&apos;) and
mp.organization_id=hoi.organization_id and
hoi.org_information_context=&apos;Accounting Information&apos; and
(:$flex$.ledger is null or to_number(hoi.org_information1) in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
hoi.organization_id=haou.organization_id and
nvl(haou.date_to,sysdate)&gt;=sysdate
)
order by 1</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>16</SORT_ORDER>
    <DISPLAY_SEQUENCE>150</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>gl.name=:p_ledger</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Ledger (inv org related)</LOV_NAME>
    <LOV_GUID>8E2FF36EDF3A79D2E0530100007F1FF2</LOV_GUID>
    <LOV_QUERY_DSP>select
gl.name value,
fifsv.id_flex_structure_name||&apos;: &apos;||gl.description description
from
gl_ledgers gl,
fnd_id_flex_structures_vl fifsv
where
gl.ledger_id in (select ood.set_of_books_id from org_organization_definitions ood where nvl(ood.disable_date,sysdate)&gt;=sysdate and ood.organization_id in (select xroa.id from xxen_report_org_access xroa where xroa.access_type=&apos;INV&apos;)) and
(:$flex$.chart_of_accounts is null or xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos;) and
gl.chart_of_accounts_id=fifsv.id_flex_num and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101
order by
fifsv.id_flex_structure_name,
gl.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
