<QUICK_REPORT_LIST><QUICK_REPORT state="queried" OBJ_ID="AAASXSAASAAAeftAAB" OBJ_VERSION="2025-07-24">
  <QUICK_REPORT_ID datatype="Number">515502</QUICK_REPORT_ID>
  <DESCRIPTION datatype="Text">Sales Report</DESCRIPTION>
  <SQL_EXPRESSION datatype="Text">Select
	INV.Company
	,Company.Name
	,SS.Acct_Currency_Code as &quot;Curr Company&quot;
	,INV.Contract &quot;Site&quot;
	,INV.Catalog_No as &quot;Part No&quot;
	,INV.Description
	,TO_CHAR(INV.Invoice_Date, &apos;YYYY-MM-DD&apos;) &quot;Date Trans&quot;
	,TO_CHAR(INV.Invoice_Date, &apos;YYYY-MM&apos;) &quot;YYYY-MM&quot;
	,Case when Inv.Price_Adjustment=&apos;TRUE&apos; then 0
	else Inv.Invoiced_Qty End &quot;Invoiced Qty&quot;
	,INV.Sale_Um UoM
	,STOCK.Part_Product_Family &quot;Product Family&quot;
	,STOCK.Part_Product_Code &quot;Product Code&quot;
	,STOCK.Type_Designation &quot;Type Designation&quot;
	,INV.Identity &quot;Customer No&quot;
	,CUST.Name &quot;Customer Name&quot;
	,CUST.Category &quot;Customer Type&quot;
	,IPP.CF$_QTY_ON_HAND &quot;Qty on Hand&quot;
	,IPP.Safety_Stock &quot;Safety Stock&quot;
	,IPP.MIN_ORDER_QTY &quot;Min Lot Size&quot;
	,IPP.CF$_MIN_SALES_QTY &quot;Min Sales Qty&quot;
	,STOCK.CF$_HU_QTY &quot;HU Qty&quot;
	,SS.Price_Source &quot;Price Source&quot;
	,SS.Price_Source_Id &quot;Price Source ID&quot;
	,customer_order.order_id &quot;Order Type&quot;
	,INV.Order_No &quot;Order No&quot;
	,INV.Line_No &quot;Line No&quot;
	,INV.Release_No &quot;Rel No&quot;
	,INV.Invoice_No &quot;Invoice No&quot;
	,cust_order_inv_head_uiv_all.DELIVERY_ADDRESS_ID  &quot;Address ID&quot;
	,SHIP.Name &quot;Ship Name&quot;
	,SHIP.Country &quot;Ship Ctry&quot;
	,SHIP.State &quot;Ship State&quot;
	,SHIP.City &quot;Ship City&quot;
	,SS.Cf$_Main_Rep &quot;Main Rep&quot;
	,SS.Market_Desc &quot;Market Desc&quot;
	,SS.Region_Code &quot;Region Code&quot;
	,SS.Country_Code &quot;Ctry Code&quot;
	,Case when customer_order.District_Code is null then SS.District_Code
	 else customer_order.District_Code end as &quot;District Code&quot;
	,Case when customer_order.District_Code is null then SS.District_Desc
	 else SALES_DISTRICT.Description end as &quot;District Description&quot;
	,customer_order.Delivery_Terms &quot;Delivery Terms&quot;
	,INV.Customer_Po_No &quot;Customer PO NO&quot;
	,cust_order_inv_head_uiv_all.Shipment_Id &quot;Shipment ID&quot;
	,shipment_cfv.Cf$_Freight_Charge &quot;Ttl Freight Cost&quot;
	,STOCK.C_Resin_Type &quot;Resin Type&quot;
	,STOCK.C_Resin_Weight &quot;Resin Weight&quot;
	,Case when Inv.Price_Adjustment=&apos;TRUE&apos; then 0
	else (INV.Invoiced_Qty*STOCK.C_Resin_Weight*Sales_Part.CONV_FACTOR) End &quot;Ttl Resin Weight&quot;
	,INV.Sale_Unit_Price &quot;Sales Unit Price&quot;
	,INV.Currency_Code &quot;Currency Code&quot;
	,INV.Net_Curr_Amount &quot;Net Amount Curr&quot;
	,INV.Net_Dom_Amount &quot;Net Amount Co&quot;
	,SS.Cost
	,Sales_Part.CONV_FACTOR &quot;Factor UoM&quot;
	,COJ.Supply_Code &quot;Supply Code&quot;
	,COJ.Supply_Site &quot;Supply Site&quot;
	,X.CUSTOMER_PART_NO &quot;Customer Part No&quot;
	,Color.ATTR_VALUE_ALPHA &quot;Color&quot;
	,Pant.ATTR_VALUE_ALPHA &quot;Pantone&quot;
	,IML.Component_Part &quot;IML&quot;

from 
	CUSTOMER_ORDER_INV_ITEM_JOIN INV
	inner join company on INV.Company = Company.Company
	inner join inventory_part_cfv STOCK on INV.Catalog_No = STOCK.Part_No and INV.Contract = STOCK.Contract
	left join cust_ord_cust1 CUST on INV.Identity = CUST.Customer_No
	left join cust_ord_invo_stat_cfv SS on INV.Invoice_id = SS.Invoice_id and INV.Item_id = SS.Item_id
	left join customer_order on INV.Order_No = customer_order.Order_No
	left join cust_order_inv_head_uiv_all on INV.Invoice_No = cust_order_inv_head_uiv_all.Invoice_No and INV.Series_ID = cust_order_inv_head_uiv_all.Series_Id
	left join shipment_cfv on cust_order_inv_head_uiv_all.shipment_Id = shipment_cfv.shipment_Id
	left join SALES_DISTRICT on customer_order.District_Code = SALES_DISTRICT.District_Code
	inner join SALES_PART on INV.Contract = SALES_PART.Contract and INV.Catalog_No = SALES_PART.Part_no
	inner join CUSTOMER_INFO_ADDRESS SHIP on INV.Identity = SHIP.Customer_Id and cust_order_inv_head_uiv_all.DELIVERY_ADDRESS_ID = SHIP.Address_Id
	left join CUSTOMER_ORDER_JOIN COJ on INV.Order_No = COJ.Order_No and INV.Line_No = COJ.Line_No and INV.Release_No = COJ.Rel_No
	left join (Select contract, part_no, CASE WHEN substr(ATTR_VALUE_ALPHA,1,3)=&apos;DRY&apos; THEN &apos;OFFFSET&apos; else ATTR_VALUE_ALPHA end Decoration  from INVENTORY_PART_CHAR_ALL where CHARACTERISTIC_CODE=&apos;00034&apos;) C34 on INV.Contract=C34.Contract and INV.Catalog_No=C34.Part_No
	inner join INVENTORY_PART_PLANNING_cfv IPP on IPP.Contract=INV.Contract and IPP.Part_No=INV.Catalog_No
	left join SALES_PART_CROSS_REFERENCE X on X.Contract=INV.Contract and X.Catalog_No=INV.Catalog_No and X.CUSTOMER_NO=INV.Identity
	left join (Select contract,part_no,ATTR_VALUE_ALPHA from INVENTORY_PART_CHAR_ALL where CHARACTERISTIC_CODE in (&apos;00025&apos;,&apos;00028&apos;)) Color on Color.Contract=INV.Contract and Color.PArt_No=INV.Catalog_No 
	left join (Select contract,part_no,ATTR_VALUE_ALPHA from INVENTORY_PART_CHAR_ALL where CHARACTERISTIC_CODE in (&apos;00079&apos;)) Pant on Pant.Contract=INV.Contract and Pant.PArt_No=INV.Catalog_No 
	left join (
				Select 
					MS.Contract
					,MS.Part_No
					,LISTAGG(MS.COMPONENT_PART ,&apos; + &apos;) WITHIN GROUP (Order By MS.Component_Part) Component_Part
				From 
					MANUF_STRUCTURE MS 
					inner join Purchase_Part_Cfv PP on MS.Contract=PP.Contract and MS.Component_Part=PP.Part_No 

				Where 
					PP.CF$_PURCHASE_PART_CAT_2=&apos;RM07A&apos; 
					and MS.Alternative_No=&apos;*&apos; 
					and MS.BOM_TYPE_DB=&apos;M&apos; 
					and MANUF_STRUCT_ALTERNATE_API.Get_State(MS.contract,MS.part_no,MS.eng_chg_level,MS.bom_type,MS.alternative_no)=&apos;Buildable&apos; 
					and MS.EFF_PHASE_OUT_DATE is null 

				Group By MS.Contract, MS.Part_No
			) IML on IML.Contract=INV.Contract and IML.Part_No=INV.Catalog_No
	
where 
	INV.Series_ID&lt;&gt;&apos;PR&apos;
	and INV.COMPANY LIKE NVL( &apos;&amp;COMPANY&apos;, &apos;%&apos;) 
	and INV.CONTRACT LIKE NVL(&apos;%&amp;CONTRACT%&apos;, &apos;%&apos;)
	and TO_DATE(TO_CHAR(INV.Invoice_Date, &apos;YYYY-MM-DD&apos;), &apos;YYYY-MM-DD&apos;) between to_date(&apos;&amp;BeginDate&apos;, &apos;YYYY-MM-DD&apos;) and to_date(&apos;&amp;EndDate&apos;, &apos;YYYY-MM-DD&apos;)
	and INV.Identity like NVL(&apos;&amp;Customer_No&apos;,&apos;%&apos;)
	and STOCK.Type_Designation like NVL(&apos;&amp;Type_Designation&apos;,&apos;%&apos;)</SQL_EXPRESSION>
  <COMMENTS datatype="Text">Prameters:
  Company (optional) -&gt; In IFS Cloud LOVs are not supported due to limitations. Hence, a field is being used
  Site (Optional)  -&gt; In IFS Cloud LOVs are not supported due to limitations. Hence, a field is being used
  Date format (mandatory) : YYYY-MM-DD   ex: 2022-10-01
  Customer No (Optional)
  Type designation (Optional)


#SR-1659
Requested by: Kelly Michaud (Edmundston)
Created: 2025-02-27
Created by David Montminy
Adapted version of quick report &quot;Sales Report (Pro-Format)&quot; created by Nicolas Perreault

#SR-4140
Requested by: Kelly Michaud (Edmundston)
Updated: 2025-03-26
Updated by David Montminy
Update: Adding the Sales Part cross ref  + Colour + IML related to the finished goods</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>