<QUICK_REPORT_LIST><QUICK_REPORT state="queried" OBJ_ID="AAASXSAAZAAAAiUAAF" OBJ_VERSION="2024-10-09">
  <QUICK_REPORT_ID datatype="Number">280958</QUICK_REPORT_ID>
  <DESCRIPTION datatype="Text">Units shipped per month by Location (Sales $ MTD) </DESCRIPTION>
  <SQL_EXPRESSION datatype="Text">SELECT contract,
       EXTRACT(YEAR FROM DATE_CREATED) Year,
       EXTRACT(MONTH FROM DATE_CREATED) Period,
       IFSAPP.CUSTOMER_ORDER_API.Get_Customer_No(SOURCE_REF1) &quot;Customer&quot;,
       IFSAPP.Cust_Ord_Customer_API.Get_Name(CUSTOMER_ORDER_API.Get_Customer_No(SOURCE_REF1)) &quot;Customer Name&quot;,
       PART_NO,
       IFSAPP.Inventory_Part_API.Get_Description(CONTRACT, PART_NO) &quot;Part Description&quot;,
       IFSAPP.INVENTORY_PART_API.Get_Part_Product_Family(CONTRACT, PART_NO) &quot;Product Family&quot;,
       SUM(QUANTITY) as Quantity,
ifsapp.inventory_part_api.GET_UNIT_MEAS(CONTRACT ,PART_NO)  AS Units,
      TO_CHAR(SUM((Customer_Order_Line_API.Get_Base_Sale_Price_Total(source_ref1,
                                                 source_ref2,
                                                 source_ref3,
                                                 source_ref4) /
       (Customer_Order_Line_API.Get_Buy_Qty_Due(source_ref1,
                                                 source_ref2,
                                                 source_ref3,
                                                 source_ref4)*Customer_Order_Line_API.Get_Conv_Factor(source_ref1,
                                                 source_ref2,
                                                 source_ref3,
                                                 source_ref4) ))  * Quantity),&apos;999,999,999,999,999.99&apos;,&apos;NLS_NUMERIC_CHARACTERS=&quot;,.&quot;&apos;) as &quot;Sales $ MDT&quot;, 



      /* SUM((Customer_Order_API.Get_Total_Base_Price(source_ref1) /
       Customer_Order_Line_API.Get_Buy_Qty_Due(source_ref1,
                                                 source_ref2,
                                                 source_ref3,
                                                 source_ref4)) *
       (Customer_Order_Line_API.Get_Buy_Qty_Due(source_ref1,
                                                 source_ref2,
                                                 source_ref3,
                                                 source_ref4) - Quantity)) as MTD2,*/
       
       COUNT(HANDLING_UNIT_ID) as Pallets
  FROM INVENTORY_TRANSACTION_HIST2
 WHERE TRANSACTION_CODE = &apos;OESHIP&apos;
AND (TRUNC(DATE_CREATED) &gt;= to_date(&apos;&amp;VALID_FROM&apos;,&apos;MM/DD/YYYY&apos;) AND
       TRUNC(DATE_CREATED) &lt;= to_date(&apos;&amp;VALID_TO&apos;,&apos;MM/DD/YYYY&apos;))
   AND CONTRACT LIKE NVL(&apos;&amp;USER_ALLOWED_COMPANY_LOV.COMPANY&apos;, &apos;%&apos;)
   AND PART_NO LIKE nvl(&apos;&amp;SALES_PART_INVENTORY_LOV.CATALOG_NO&apos;, &apos;%&apos;)
   AND (IFSAPP.CUSTOMER_ORDER_API.Get_Customer_No(SOURCE_REF1) is null or
       IFSAPP.CUSTOMER_ORDER_API.Get_Customer_No(SOURCE_REF1) LIKE
       NVL(&apos;&amp;CUST_ORD_CUST7.CUSTOMER_NO&apos;, &apos;%&apos;))
   AND (IFSAPP.INVENTORY_PART_API.Get_Part_Product_Family(CONTRACT, PART_NO) is null or
       IFSAPP.INVENTORY_PART_API.Get_Part_Product_Family(CONTRACT, PART_NO) LIKE
       NVL(&apos;&amp;INVENTORY_PRODUCT_FAMILY.PART_PRODUCT_FAMILY&apos;, &apos;%&apos;))

 GROUP BY PART_NO,
          contract,
          EXTRACT(YEAR FROM DATE_CREATED),
          EXTRACT(MONTH FROM DATE_CREATED),
          IFSAPP.CUSTOMER_ORDER_API.Get_Customer_No(SOURCE_REF1),
          IFSAPP.Cust_Ord_Customer_API.Get_Name(CUSTOMER_ORDER_API.Get_Customer_No(SOURCE_REF1)),
          IFSAPP.Inventory_Part_API.Get_Description(CONTRACT, PART_NO),
          IFSAPP.INVENTORY_PART_API.Get_Part_Product_Family(CONTRACT,
                                                            PART_NO),
         ifsapp.inventory_part_api.GET_UNIT_MEAS(CONTRACT ,PART_NO)
                                                            /*,
          ((Customer_Order_API.Get_Total_Base_Price(source_ref1) /
          SUM(Customer_Order_Line_API.Get_Buy_Qty_Due(source_ref1,
                                                    source_ref2,
                                                    source_ref3,
                                                    source_ref4))) *
          Quantity)*/
/*          ((Customer_Order_API.Get_Total_Base_Price(source_ref1) /
          Customer_Order_Line_API.Get_Buy_Qty_Due(source_ref1,
                                                    source_ref2,
                                                    source_ref3,
                                                    source_ref4)) *
          (Customer_Order_Line_API.Get_Buy_Qty_Due(source_ref1,
                                                    source_ref2,
                                                    source_ref3,
                                                    source_ref4) -
          Quantity))*/
 ORDER BY EXTRACT(YEAR FROM DATE_CREATED),
          EXTRACT(MONTH FROM DATE_CREATED),
          PART_NO,
          CONTRACT</SQL_EXPRESSION>
  <COMMENTS datatype="Text">Please note that the Date picker is not working in this report due to some technical dificulties. Hence need to add the valid from and valid to  date manully as per the below format

mm/dd/yyyy ex. 09/14/2021

IPNA-74604      Modify : 2024-05-28   Hamid Azzoune
 - Change formula
Old  amount formula :
TO_CHAR(SUM(Customer_Order_Line_API.Get_Base_Sale_Price_Total(source_ref1,
                                                 source_ref2,    source_ref3,    source_ref4) /       (Customer_Order_Line_API.Get_Buy_Qty_Due(source_ref1,
                                                 source_ref2,     source_ref3,  source_ref4))) * Quantity),&apos;999,999,999,999,999.99&apos;,&apos;NLS_NUMERIC_CHARACTERS=&quot;,.&quot;&apos;) as &quot;Sales $ MDT&quot;,

New amount formula
    TO_CHAR(SUM((Customer_Order_Line_API.Get_Base_Sale_Price_Total(source_ref1,
                                                 source_ref2,      source_ref3,   source_ref4) /
       (Customer_Order_Line_API.Get_Buy_Qty_Due(source_ref1,
                                                 source_ref2,      source_ref3,     source_ref4)*Customer_Order_Line_API.Get_Conv_Factor(source_ref1,
                                                 source_ref2,   source_ref3,     source_ref4) ))  * Quantity),&apos;999,999,999,999,999.99&apos;,&apos;NLS_NUMERIC_CHARACTERS=&quot;,.&quot;&apos;) as &quot;Sales $ MDT&quot;,
Added in Group by   IFSAPP.INVENTORY_PART_API.Get_Part_Product_Family(CONTRACT,
                                                            PART_NO),
</COMMENTS>
  <CATEGORY_ID datatype="Number">29</CATEGORY_ID>
  <CATEGORY_DESCRIPTION datatype="Text">Project Reporting</CATEGORY_DESCRIPTION>
  <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" OBJ_ID="AAARH8AAaAAAAFrABA" OBJ_VERSION="2020-10-27">
      <CATEGORY_ID datatype="Number">29</CATEGORY_ID>
      <DESCRIPTION datatype="Text">Project Reporting</DESCRIPTION>
    </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>