<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>
<LOVS>
<!-- loader xml for Enginatics Blitz Report lov: INV Organization Code (no access org restrictions and avoiding master and disabled orgs) -->
 <LOVS_ROW>
  <GUID>B24CBF5AD89C6343E0530100007FDCC2</GUID>
  <LOV_NAME>INV Organization Code (no access org restrictions and avoiding master and disabled orgs)</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select	mp.organization_code value,
	haou.name description
from	mtl_parameters mp,
	hr_organization_information hoi,
	hr_all_organization_units haou
where	hoi.org_information_context = &apos;Accounting Information&apos;
and	hoi.organization_id = mp.organization_id
and	hoi.organization_id = haou.organization_id
and	sysdate &lt; nvl(haou.date_to, sysdate +1)
and	mp.organization_id &lt;&gt; mp.master_organization_id
order by 1</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
</LOVS>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: GME Material Usage Variance -->
 <REPORTS_ROW>
  <GUID>ACC10939A5B2565FE0530100007F728F</GUID><ENABLED>Y</ENABLED>
  <SQL_TEXT>select
item,
--item_cost,
--formula_id,
--batch_id,
formula_no,
formula_version,
plan_qty,
actual_qty,
std_qty,
actual_qty-std_qty diff_qty,
item_cost *(actual_qty-std_qty) variance_value,
wip_plan_qty,
dtl_um,
material_requirement_date,
subinventory,
locator_id,
contribute_yield_ind,
scale_type,
scrap_factor,
line_type,
contribute_step_qty_ind,
batch_no,
batch_status,
actual_start_date,
actual_completion_date,
batch_close_date,
plan_start_date,
plan_cmplt_date,
transaction_date,
mmt_transaction_type
from (
select distinct (select segment1 from mtl_system_items_b msib where msib.inventory_item_id=gmd.inventory_item_id
and rownum&lt;2) item,
a.item_cost,
ffm.formula_id,
gbh.batch_id,
ffm.formula_no formula_no,
ffm.formula_vers formula_version,
  gmd.plan_qty plan_qty,
  gmd.actual_qty actual_qty,
  round(nvl((select (select gmd.actual_qty/fmd.qty from fm_matl_dtl fmd, gme_material_details gmd where fmd.formulaline_id=gmd.formulaline_id and fmd.formula_id=ffm.formula_id and fmd.line_type=1 and gmd.batch_id=gbh.batch_id) * qty std_qty from fm_matl_dtl where formula_id=ffm.formula_id and formulaline_id=gmd.formulaline_id),0),4) std_qty,
--  gmd.actual_qty-std_qty diff_qty,
--  round(gmd.actual_qty-(select (select gmd.actual_qty/fmd.qty from fm_matl_dtl fmd, gme_material_details gmd where fmd.formulaline_id=gmd.formulaline_id and fmd.formula_id=ffm.formula_id and fmd.line_type=1 and gmd.batch_id=gbh.batch_id) * qty std_qty from fm_matl_dtl where formula_id=ffm.formula_id and formulaline_id=gmd.formulaline_id),4) diff_qty,
--  round(a.item_cost*(gmd.actual_qty-(select (select gmd.actual_qty/fmd.qty from fm_matl_dtl fmd, gme_material_details gmd where fmd.formulaline_id=gmd.formulaline_id and fmd.formula_id=ffm.formula_id and fmd.line_type=1 and gmd.batch_id=gbh.batch_id) * qty std_qty from fm_matl_dtl where formula_id=ffm.formula_id and formulaline_id=gmd.formulaline_id)),4) variance_value,
  gmd.wip_plan_qty wip_plan_qty,
  gmd.dtl_um dtl_um,
  gmd.material_requirement_date material_requirement_date,
  gmd.subinventory subinventory,
  gmd.locator_id locator_id,
  gmd.contribute_yield_ind contribute_yield_ind,
  gmd.scale_type scale_type,
  gmd.scrap_factor scrap_factor,
  gmd.line_type line_type,
  gmd.contribute_step_qty_ind contribute_step_qty_ind,
  gbh.batch_no batch_no,
  gbh.batch_status batch_status,
  gbh.actual_start_date actual_start_date,
  gbh.actual_cmplt_date actual_completion_date,
  gbh.batch_close_date,
  gbh.plan_start_date plan_start_date,
  gbh.plan_cmplt_date plan_cmplt_date,
  mmt.transaction_date transaction_date,
  (select transaction_type_name from mtl_transaction_types
where transaction_type_id=mmt.transaction_type_id) mmt_transaction_type
    --mmt.*
  --a.item_cost
from gme_batch_header gbh,
  gme_material_details gmd,
  fm_form_mst ffm,
  mtl_material_transactions mmt,
(select sum(cmpnt_cost) item_cost,cmpnt.inventory_item_id,cmpnt.organization_id
from  cm_cmpt_dtl cmpnt, gmf_period_statuses gmf
where 1=1
--and mmt.inventory_item_id=cmpnt.inventory_item_id
--and mmt.organization_id=cmpnt.organization_id
and cmpnt.cost_type_id=1001
and gmf.cost_type_id=cmpnt.cost_type_id
and gmf.period_id=cmpnt.period_id
and gmf.calendar_code=&apos;NUF_CAL&apos;
--and gmf.legal_entity_id = (select legal_entity from org_organization_definitions where organization_id=89)
group by cmpnt.inventory_item_id,cmpnt.organization_id ) a
where 2=2
and gbh.batch_id=gmd.batch_id
--and ffm.formula_no=&apos;518-110004043&apos;
and gmd.inventory_item_id=a.inventory_item_id
and gmd.organization_id=a.organization_id
and gbh.organization_id=gmd.organization_id
and gbh.formula_id=ffm.formula_id
and mmt.transaction_source_id (+)= gbh.batch_id
and mmt.trx_source_line_id (+)= gmd.material_detail_id
--and gbh.batch_no=&apos;518010138&apos;
and mmt.inventory_item_id=a.inventory_item_id
union
select distinct (select segment1 from mtl_system_items_b msib where msib.inventory_item_id=gmd.inventory_item_id
and rownum&lt;2) item,
a.item_cost,
ffm.formula_id,
gbh.batch_id,
ffm.formula_no formula_no,
ffm.formula_vers formula_version,
  gmd.plan_qty plan_qty,
  gmd.actual_qty actual_qty,
  round(nvl((select (select gmd.actual_qty/fmd.qty from fm_matl_dtl fmd, gme_material_details gmd where fmd.formulaline_id=gmd.formulaline_id and fmd.formula_id=ffm.formula_id and fmd.line_type=1 and gmd.batch_id=gbh.batch_id) * qty std_qty from fm_matl_dtl where formula_id=ffm.formula_id and formulaline_id=gmd.formulaline_id),0),4) std_qty,
--  gmd.actual_qty-std_qty diff_qty,
--  round(gmd.actual_qty-(select (select gmd.actual_qty/fmd.qty from fm_matl_dtl fmd, gme_material_details gmd where fmd.formulaline_id=gmd.formulaline_id and fmd.formula_id=ffm.formula_id and fmd.line_type=1 and gmd.batch_id=gbh.batch_id) * qty std_qty from fm_matl_dtl where formula_id=ffm.formula_id and formulaline_id=gmd.formulaline_id),4) diff_qty,
--  round(a.item_cost*(gmd.actual_qty-(select (select gmd.actual_qty/fmd.qty from fm_matl_dtl fmd, gme_material_details gmd where fmd.formulaline_id=gmd.formulaline_id and fmd.formula_id=ffm.formula_id and fmd.line_type=1 and gmd.batch_id=gbh.batch_id) * qty std_qty from fm_matl_dtl where formula_id=ffm.formula_id and formulaline_id=gmd.formulaline_id)),4) variance_value,
  gmd.wip_plan_qty wip_plan_qty,
  gmd.dtl_um dtl_um,
  gmd.material_requirement_date material_requirement_date,
  gmd.subinventory subinventory,
  gmd.locator_id locator_id,
  gmd.contribute_yield_ind contribute_yield_ind,
  gmd.scale_type scale_type,
  gmd.scrap_factor scrap_factor,
  gmd.line_type line_type,
  gmd.contribute_step_qty_ind contribute_step_qty_ind,
  gbh.batch_no batch_no,
  gbh.batch_status batch_status,
  gbh.actual_start_date actual_start_date,
  gbh.actual_cmplt_date actual_completion_date,
  gbh.batch_close_date,
  gbh.plan_start_date plan_start_date,
  gbh.plan_cmplt_date plan_cmplt_date,
  null transaction_date,
  null mmt_transaction_type
-- gmd.*--mmt.*
  --a.item_cost
from gme_batch_header gbh,
gme_material_details gmd,
fm_form_mst ffm,
    --  mtl_material_transactions mmt,
(select sum(cmpnt_cost) item_cost,cmpnt.inventory_item_id,cmpnt.organization_id
from  cm_cmpt_dtl cmpnt, gmf_period_statuses gmf
where 1=1
--and mmt.inventory_item_id=cmpnt.inventory_item_id
--and mmt.organization_id=cmpnt.organization_id
and cmpnt.cost_type_id=1001
and gmf.cost_type_id=cmpnt.cost_type_id
and gmf.period_id=cmpnt.period_id
and gmf.calendar_code=&apos;NUF_CAL&apos;
--and gmd.actual_qty=0
--and gmf.legal_entity_id = (select legal_entity from org_organization_definitions where organization_id=89)
group by cmpnt.inventory_item_id,cmpnt.organization_id ) a
where gbh.batch_id     =gmd.batch_id
--and ffm.formula_no=&apos;518-110004043&apos;
and gmd.inventory_item_id=a.inventory_item_id
and gmd.organization_id=a.organization_id
and gbh.organization_id=gmd.organization_id
and gbh.formula_id     =ffm.formula_id
and gbh.batch_id in (select distinct gbh.batch_id
from gme_batch_header gbh,
  gme_material_details gmd,
  fm_form_mst ffm,
  mtl_material_transactions mmt,
(select sum(cmpnt_cost) item_cost,cmpnt.inventory_item_id,cmpnt.organization_id
from  cm_cmpt_dtl cmpnt, gmf_period_statuses gmf
where 1=1
and cmpnt.cost_type_id=1001
and gmf.cost_type_id=cmpnt.cost_type_id
and gmf.period_id=cmpnt.period_id
and gmf.calendar_code=&apos;NUF_CAL&apos;
and gmf.legal_entity_id = (select ood.legal_entity from org_organization_definitions ood where 3=3)
group by cmpnt.inventory_item_id,cmpnt.organization_id ) a
where 2=2
and gbh.batch_id=gmd.batch_id
and gbh.organization_id=gmd.organization_id
and gbh.formula_id=ffm.formula_id
and mmt.transaction_source_id(+)= gbh.batch_id
and mmt.trx_source_line_id(+)= gmd.material_detail_id
and mmt.inventory_item_id=a.inventory_item_id)
--and gbh.batch_no=&apos;518010138&apos;
--and mmt.inventory_item_id=a.inventory_item_id
and not exists(
   select 1 from mtl_material_transactions mmt
   where mmt.inventory_item_id=gmd.inventory_item_id
   and mmt.organization_id=gmd.organization_id
and mmt.transaction_source_id= gbh.batch_id
and mmt.trx_source_line_id= gmd.material_detail_id
  --and ((trunc(nvl(mmt.transaction_date, to_date(&apos;01/01/1951&apos;,&apos;dd/mm/yyyy&apos;))) between to_date(&apos;01/06/2020&apos;,&apos;dd/mm/yyyy&apos;)  and to_date(&apos;30/06/2020&apos;,&apos;dd/mm/yyyy&apos;)))
  )) b
  order by batch_no asc</SQL_TEXT>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>GME Material Usage Variance</REPORT_NAME>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>2=2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>3=3</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>gmf.period_code=:period_code</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
gps.period_code value,
gps.start_date||&apos; - &apos;||trunc(gps.end_date) description,
gps.*
from
gmf_period_statuses gps
where
gps.calendar_code=&apos;NUF_CAL&apos; and
gps.legal_entity_id in (select ood.legal_entity from org_organization_definitions ood where ood.organization_code=:$flex$.organization_code)
order by
gps.start_date desc</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Period</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>mmt.organization_id in (select mp.organization_id from mtl_parameters mp where mp.organization_code=:organization_code)</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Organization Code (no access org restrictions and avoiding master and disabled orgs)</LOV_NAME>
    <LOV_GUID>B24CBF5AD89C6343E0530100007FDCC2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select	mp.organization_code value,
	haou.name description
from	mtl_parameters mp,
	hr_organization_information hoi,
	hr_all_organization_units haou
where	hoi.org_information_context = &apos;Accounting Information&apos;
and	hoi.organization_id = mp.organization_id
and	hoi.organization_id = haou.organization_id
and	sysdate &lt; nvl(haou.date_to, sysdate +1)
and	mp.organization_id &lt;&gt; mp.master_organization_id
order by 1</LOV_QUERY_DSP>
    <REQUIRED>Y</REQUIRED>
    <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>3</SORT_ORDER>
    <ANCHOR>3=3</ANCHOR>
    <SQL_TEXT>ood.organization_code=:organization_code</SQL_TEXT>
    <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>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>mmt.transaction_date&gt;=:trx_date_from</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Transaction Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>mmt.transaction_date&lt;:trx_date_to+1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Transaction Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>batch_close_date&gt;=:batch_close_date_from</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>trunc(:$flex$.transaction_date_to,&apos;month&apos;)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Batch Close Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>batch_close_date&lt;:batch_close_date_to</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>:$flex$.transaction_date_to</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Batch Close Date To</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>
