<QUICK_REPORT_LIST><QUICK_REPORT state="queried" OBJ_ID="AAASXSAASAAAeflAAB" OBJ_VERSION="2025-07-25">
  <QUICK_REPORT_ID datatype="Number">338029</QUICK_REPORT_ID>
  <DESCRIPTION datatype="Text">Cust_Specific_vs_Deco_Part</DESCRIPTION>
  <SQL_EXPRESSION datatype="Text">Select distinct CS.Company,IP.Contract, IP.Part_NO,PC.DESCRIPTION,C2.ATTR_VALUE_ALPHA &quot;Characteristic&quot;, X.CUSTOMER_NO &quot;Cross_Ref&quot;,CO.CUSTOMER_NO &quot;Customer Order&quot;

FROM Inventory_Part IP 
inner join
	(
	SELECT distinct R.PART_NO
	FROM ROUTING_OPERATION R inner join WORK_CENTER W on R.WORK_CENTER_NO=W.WORK_CENTER_NO
	WHERE W.DEPARTMENT_NO=&apos;OFFSE&apos; and R.BOM_TYPE_DB=&apos;M&apos; and R.ALTERNATIVE_NO=&apos;*&apos; and R.OPERATION_NO=&apos;10&apos; and Routing_Alternate_API.Get_State(R.CONTRACT,R.PART_NO,R.ROUTING_REVISION,R.BOM_TYPE,R.ALTERNATIVE_NO)=&apos;Buildable&apos;

	UNION

	SELECT distinct R.PART_NO
	FROM 
	ROUTING_OPERATION R 
	inner join WORK_CENTER W on R.WORK_CENTER_NO=W.WORK_CENTER_NO 
	inner join MANUF_STRUCTURE M on M.ALTERNATIVE_NO=R.ALTERNATIVE_NO and M.PART_NO=R.PART_NO and M.CONTRACT=R.CONTRACT and M.OPERATION_NO=R.OPERATION_NO and M.BOM_TYPE_DB=R.BOM_TYPE_DB and M.OPERATION_NO=R.OPERATION_NO
	inner join PURCHASE_PART P on P.PART_NO=M.COMPONENT_PART and P.Contract=M.Contract

	WHERE W.DEPARTMENT_NO in (&apos;INJEC&apos;,&apos;DAIRY&apos;) and R.BOM_TYPE_DB=&apos;M&apos; and R.ALTERNATIVE_NO=&apos;*&apos; and R.OPERATION_NO=&apos;10&apos; and Routing_Alternate_API.Get_State(R.CONTRACT,R.PART_NO,R.ROUTING_REVISION,R.BOM_TYPE,R.ALTERNATIVE_NO)=&apos;Buildable&apos; and MANUF_STRUCT_ALTERNATE_API.Get_State(M.contract,M.part_no,M.eng_chg_level,M.bom_type,M.alternative_no)=&apos;Buildable&apos; and P.STAT_GRP in (&apos;ZRM07A&apos;,&apos;ZRM07B&apos;)
	) Q on IP.PART_NO=Q.PART_NO



left join (Select Contract,Part_No from INVENTORY_PART_CHAR_ALL where CHARACTERISTIC_CODE=&apos;00034&apos;) C1 on IP.Contract=C1.Contract and IP.Part_No=C1.Part_No
left join (Select Contract,Part_no,ATTR_VALUE_ALPHA From INVENTORY_PART_CHAR_ALL where CHARACTERISTIC_CODE=&apos;00032&apos;) C2 on IP.Contract=C2.Contract and IP.Part_No=C2.Part_NO
left join (Select * from (Select Contract,Catalog_No,CUSTOMER_NO, count(CUSTOMER_NO) OVER (PARTITION BY catalog_no,Contract) AS Cust_Count  from SALES_PART_CROSS_REFERENCE) where Cust_Count=1) X on X.Contract=IP.Contract and X.CATALOG_NO=IP.Part_No
left join (Select * from (Select distinct catalog_no,Contract,CUSTOMER_NO,count(CUSTOMER_NO) OVER (PARTITION BY catalog_no,Contract) AS Cust_Count  from CUSTOMER_ORDER_JOIN where DATE_ENTERED&gt;=sysdate-3*365 and LENGTH(CUSTOMER_NO)&gt;5) where Cust_Count=1) CO on IP.Contract=CO.Contract and IP.Part_No=CO.Catalog_No
inner join COMPANY_SITE CS on CS.Contract=IP.Contract
inner join PART_CATALOG PC on PC.Part_No=IP.Part_No

WHERE C2.Part_No is null and IP.PART_STATUS in (&apos;D&apos;,&apos;A&apos;) and IP.ACCOUNTING_GROUP in (&apos;MFG&apos;,&apos;PFR&apos;) and IP.PART_PRODUCT_FAMILY&lt;&gt;&apos;NF7000&apos; and IP.Part_No not in (&apos;1000873&apos;,&apos;1001310&apos;,&apos;1123056&apos;,&apos;1045181&apos;,&apos;1044715&apos;,&apos;1130859&apos;,&apos;1123057&apos;,&apos;1044795&apos;,&apos;1044426&apos;,&apos;1123006&apos;,&apos;1044481&apos;,&apos;1130865&apos;)
or (C1.Part_No is null and IP.PART_STATUS in (&apos;D&apos;,&apos;A&apos;) and IP.ACCOUNTING_GROUP in (&apos;MFG&apos;,&apos;PFR&apos;) and IP.PART_PRODUCT_FAMILY&lt;&gt;&apos;NF7000&apos;  and IP.Part_No not in (&apos;1000873&apos;,&apos;1001310&apos;,&apos;1123056&apos;,&apos;1045181&apos;,&apos;1044715&apos;,&apos;1130859&apos;,&apos;1123057&apos;,&apos;1044795&apos;,&apos;1044426&apos;,&apos;1123006&apos;,&apos;1044481&apos;,&apos;1130865&apos;) )
or (IP.PART_STATUS in (&apos;D&apos;,&apos;A&apos;) and IP.ACCOUNTING_GROUP in (&apos;MFG&apos;,&apos;PFR&apos;) and IP.PART_PRODUCT_FAMILY&lt;&gt;&apos;NF7000&apos; and C2.ATTR_VALUE_ALPHA&lt;&gt;CO.CUSTOMER_NO and IP.Part_No not in (&apos;1000873&apos;,&apos;1001310&apos;,&apos;1123056&apos;,&apos;1045181&apos;,&apos;1044715&apos;,&apos;1130859&apos;,&apos;1123057&apos;,&apos;1044795&apos;,&apos;1044426&apos;,&apos;1123006&apos;,&apos;1044481&apos;,&apos;1130865&apos;)  )
or (IP.PART_STATUS in (&apos;D&apos;,&apos;A&apos;) and IP.ACCOUNTING_GROUP in (&apos;MFG&apos;,&apos;PFR&apos;) and IP.PART_PRODUCT_FAMILY&lt;&gt;&apos;NF7000&apos; and C2.ATTR_VALUE_ALPHA&lt;&gt;X.CUSTOMER_NO  and IP.Part_No not in (&apos;1000873&apos;,&apos;1001310&apos;,&apos;1123056&apos;,&apos;1045181&apos;,&apos;1044715&apos;,&apos;1130859&apos;,&apos;1123057&apos;,&apos;1044795&apos;,&apos;1044426&apos;,&apos;1123006&apos;,&apos;1044481&apos;,&apos;1130865&apos;)  )
or (LENGTH(C2.ATTR_VALUE_ALPHA)&lt;&gt;7  and IP.Part_No not in (&apos;1000873&apos;,&apos;1001310&apos;,&apos;1123056&apos;,&apos;1045181&apos;,&apos;1044715&apos;,&apos;1130859&apos;,&apos;1123057&apos;,&apos;1044795&apos;,&apos;1044426&apos;,&apos;1123006&apos;,&apos;1044481&apos;,&apos;1130865&apos;) )
Order by CS.Company,IP.Part_No,IP.Contract</SQL_EXPRESSION>
  <COMMENTS datatype="Text">Report to validate if the Customer Specific number characteristic is in live with the sales and the X-Reference for decorated parts

Validation #1:  Decorated parts for which characteristic 00032 is missing in that site
Validation #2:  If the decorated part has only 1 X-Ref and the customer for that X-Ref is different than the characteristic value
Validation #3:  If the decorated part has been sold to only 1 customer in the last year and that customer is different than the characteristic value.


Created  by: David Montminy
2024-11-05
IPNA-103365</COMMENTS>
  <CATEGORY_ID datatype="Number"/>
  <CATEGORY_DESCRIPTION datatype="Text"/>
  <DOMAIN_ID datatype="Number"/>
  <DOMAIN_DESCRIPTION datatype="Text"/>
  <FILE_NAME datatype="Text"/>
  <QR_TYPE datatype="Enum">SQL</QR_TYPE>
  <PO_ID datatype="Text"/>
  <QUERY datatype="Text"/>
  <ROW_TYPE datatype="Text"/>
  <APP_CONFIG_PACKAGE datatype="Text"/>
  <QUICK_REPORT_CATEGORY datatype="Aggregate">
    <REPORT_CATEGORY state="queried">
      <CATEGORY_ID datatype="Number"/>
      <DESCRIPTION datatype="Text"/>
    </REPORT_CATEGORY>
  </QUICK_REPORT_CATEGORY>
  <QUICK_REPORT_DOMAIN datatype="Aggregate">
    <REPORT_DOMAIN state="queried">
      <DOMAIN_ID datatype="Number"/>
      <DESCRIPTION datatype="Text"/>
    </REPORT_DOMAIN>
  </QUICK_REPORT_DOMAIN>
</QUICK_REPORT>
</QUICK_REPORT_LIST>