Compare commits

...

5 Commits

@ -0,0 +1,29 @@
SELECT col.CONTRACT Site,
ip.TYPE_DESIGNATION "Product Group",
col.ORDER_NO "Order No",
TO_CHAR(col.REAL_SHIP_DATE, 'YYYY-MM-DD') "Real Ship Date",
col.CATALOG_NO "Catalog No",
slc.QTY_SHIPPED / NVL(slc.CONV_FACTOR, 1) *
NVL(slc.INVERTED_CONV_FACTOR, 1) "Quantity Shipped",
IPC.ATTR_VALUE_ALPHA "Decoration"
FROM ifsapp.Customer_Order_line col
INNER JOIN ifsapp.Inventory_Part ip
ON ip.PART_NO = col.CATALOG_NO
AND ip.CONTRACT = col.CONTRACT
INNER JOIN ifsapp.Shipment_Line slc
ON slc.SOURCE_REF1 = col.ORDER_NO
AND slc.SOURCE_REF2 = col.LINE_NO
AND slc.SOURCE_REF3 = col.REL_NO
left join (Select contract, Part_No, ATTR_VALUE_ALPHA
from Inventory_Part_Char_All
where CHARACTERISTIC_CODE = '00034') IPC
on IPC.Contract = IP.Contract
and IPC.Part_No = IP.Part_No
WHERE col.STATE <> 'Closed'
AND col.CONTRACT = '&SITE'
AND col.ORDER_NO LIKE NVL(LTRIM(RTRIM('&ORDER_NUMBER')), '%')
AND col.REAL_SHIP_DATE BETWEEN TO_DATE('&DATE_FROM', 'YYYY-MM-DD') AND
TO_DATE('&DATE_TO', 'YYYY-MM-DD')
AND ROWNUM < 10001

@ -0,0 +1,46 @@
select A.contract as "Site",
A.order_no as "Order",
A.line_no as "Line No",
A.Rel_no as "Rel No",
A.line_item_no as "Line Item No",
A.SUPPLY_CODE as "Supply Code",
A.VENDOR_NO as "Supplier",
A.customer_no as "Customer",
A.customer_name as "Customer Name",
A.catalog_no as "Part",
A.catalog_desc as "Part Description",
B.PART_PRODUCT_FAMILY as "Product family code",
Inventory_Product_Family_API.Get_Description(B.PART_PRODUCT_FAMILY) as "Product Family Description",
B.PART_PRODUCT_CODE as "Product code",
Inventory_Product_Code_API.Get_Description(B.PART_PRODUCT_CODE) as "Product Code Description",
B.TYPE_DESIGNATION as "Type Designation",
CUSTOMER_ORDER_API.GET_CUSTOMER_PO_NO(A.ORDER_NO) as "Customer PO No",
A.order_state as "Order Status",
A.state as "Status",
TRUNC(A.WANTED_DELIVERY_DATE) as "Wanted Delivery Date",
TRUNC((A.DELIVERY_LEADTIME + sysdate) - 1) -
TRUNC(A.PROMISED_DELIVERY_DATE) as "Days Late",
A.buy_qty_due as "Sales Qty",
Customer_Order_Line_API.Get_Base_Sale_Price_Total(A.ORDER_NO,
A.LINE_NO,
A.REL_NO,
A.LINE_ITEM_NO) as "Value (curr)",
A.Currency_code as "Currency",
PERSON_INFO_API.Get_Name(CRM_CUST_INFO_API.Get_Main_Representative_Id(A.customer_no)) as "Main Rep",
SALES_DISTRICT_API.get_description(A.DISTRICT_CODE) as "Sales District"
from customer_order_join_cfv A
inner join inventory_part B
on A.catalog_no = B.part_no
and A.contract = B.contract
Where (A.objstate = 'Released' or A.objstate = 'Blocked' or
A.objstate = 'Reserved' or A.objstate = 'Picked' or
A.objstate = 'PartiallyDelivered')
AND A.CONTRACT LIKE '%&CONTRACT%'
AND CF$_COORDINATOR LIKE '%&AUTHORIZE_CODE%'
ORDER BY A.contract, A.promised_delivery_date
-- Lov reference is removed due to limitations in IFS cloud

@ -0,0 +1,7 @@
SELECT *
FROM INVENTORY_TRANSACTION_HIST
Where SOURCE_REF_TYPE = 'Shop Order'
and (TRUNC(DATE_APPLIED) >= to_date('&VALID_FROM', 'MM/DD/YYYY') AND
TRUNC(DATE_APPLIED) <= to_date('&VALID_TO', 'MM/DD/YYYY'))
-- Company is removed due to limitations in IFS cloud

@ -0,0 +1,36 @@
SELECT Year,
Period,
Company,
Coordinator,
Coordinator_Name,
count(distinct Order_No) "No of Orders",
count(distinct Order_No || line_no || REL_NO) "No of Lines",
SUM(NET_CURR_AMOUNT) as Revenue
from (SELECT EXTRACT(YEAR FROM cs.INVOICE_DATE) Year,
EXTRACT(MONTH FROM cs.INVOICE_DATE) Period,
cs.company,
CUSTOMER_ORDER_API.Get_Authorize_Code(cs.ORDER_NO) Coordinator,
ORDER_COORDINATOR_API.Get_Name(CUSTOMER_ORDER_API.Get_Authorize_Code(cs.ORDER_NO)) Coordinator_Name,
cs.ORDER_NO,
cs.NET_CURR_AMOUNT,
ol.line_no,
ol.REL_NO
FROM CUST_ORD_INVO_STAT cs
INNER JOIN CUSTOMER_ORDER_LINE ol
ON cs.order_no = ol.order_no
AND cs.line_no = ol.line_no
AND cs.REL_NO = ol.REL_NO
AND cs.line_item_no = ol.line_item_no
WHERE (TRUNC(cs.INVOICE_DATE) >=
TO_DATE('&Valid_From', 'MM/DD/YYYY') AND
TRUNC(cs.INVOICE_DATE) <= TO_DATE('&Valid_To', 'MM/DD/YYYY'))
AND cs.CONTRACT like
NVL('&COMPANY', '%')
AND CUST_ORD_CUSTOMER_API.Get_Cust_Grp(ol.CUSTOMER_NO) LIKE
NVL('&CUST_GRP', '%')) it
GROUP BY year, Period, Company, Coordinator, Coordinator_Name
ORDER BY year, Period
-- Lov reference is removeed due to limitations in IFS cloud
Loading…
Cancel
Save