ORD_TOTSHIP_VW2

(SQL View)
Index Back

Order Total Shipments View

Date Init. Issue # Description 110403 JJM 64530000 Changed SQL to only select shipped and invoiced items.

SELECT OH.BUSINESS_UNIT , OH.ORDER_NO , OS.ORDER_INT_LINE_NO , OS.SCHED_LINE_NBR , OS.SCHED_SHIP_DTTM , BIH.BILL_TO_CUST_ID , %Round(%DecMult(SII.QTY_SHIPPED, (OS.NET_UNIT_PRICE + (%DecDiv((OS.VAT_AMT + OS.TAX_AMT), OS.QTY_SCHEDULED)))), 4) , OH.CURRENCY_CD , %Round(%DecMult(SII.QTY_SHIPPED, (OS.NET_UNIT_PRICE_BSE + (%DecDiv((OS.VAT_AMT_BASE + OS.TAX_AMT_BSE), OS.QTY_SCHEDULED)))), 4) , OH.CURRENCY_CD_BASE FROM PS_ORD_HEADER OH , PS_ORD_SCHEDULE OS , PS_IN_DEMAND SII , PS_IN_DEMAND_BI BI , PS_BI_HDR BIH , PS_ORD_GROUP OGRP WHERE %Join(COMMON_KEYS, ORD_HEADER OH, ORD_SCHEDULE OS) AND OH.ORDER_TYPE_CD = 'SO' AND OH.ORDER_STATUS = 'O' AND OH.PAYMENT_METHOD <> 'CC' AND SII.BUSINESS_UNIT = OS.SHIP_FROM_BU AND SII.SOURCE_BUS_UNIT = OS.BUSINESS_UNIT AND SII.DEMAND_SOURCE = 'OM' AND SII.ORDER_NO = OS.ORDER_NO AND SII.IN_FULFILL_STATE IN ('60', '70') AND SII.ORDER_INT_LINE_NO = OS.ORDER_INT_LINE_NO AND SII.SCHED_LINE_NBR = OS.SCHED_LINE_NBR AND %Join(COMMON_KEYS, IN_DEMAND SII, IN_DEMAND_BI BI) AND BI.BILLING_STATUS IN ('B','I') AND OS.ORD_SCH_STATUS = 'O' AND OS.BCKORDR_CNCL_FLAG IN ('N', ' ') AND OS.BILL_COMPLETE = 'N' AND BIH.BUSINESS_UNIT = BI.BUSINESS_UNIT_BI AND BIH.INVOICE = BI.INVOICE AND BIH.AR_ENTRY_CREATED = 'Y' AND OGRP.SETID = ( SELECT SCR.SETID FROM PS_SET_CNTRL_REC SCR WHERE SCR.SETCNTRLVALUE = OH.BUSINESS_UNIT AND SCR.RECNAME = 'ORD_GROUP') AND OGRP.ORDER_GRP = OH.ORDER_GRP AND OGRP.EFF_STATUS = 'A' AND OGRP.CREDIT_CHECK = 'Y' AND %EffdtCheck(ORD_GROUP OGR2, OGRP, %CurrentDateIn)

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 BUSINESS_UNIT Character(5) VARCHAR2(5) NOT NULL Business Unit
2 ORDER_NO Character(10) VARCHAR2(10) NOT NULL Identifies a customer order number that appears as a reference on a receivables pending item. Date Initials Issue Description 022701 mv SP2 (F-CJORGENS-3) CSR Desktop
3 ORDER_INT_LINE_NO Number(5,0) INTEGER NOT NULL Order Line
4 SCHED_LINE_NBR Number(6,0) INTEGER NOT NULL Schedule Line Number
5 SCHED_SHIP_DTTM DateTime(26) TIMESTAMP Schedule Ship Datetime
6 BILL_TO_CUST_ID Character(15) VARCHAR2(15) NOT NULL Customer
7 EXTENDED_NET_PRICE Signed Number(29,4) DECIMAL(27,4) NOT NULL Ext Net Amount
8 CURRENCY_CD Character(3) VARCHAR2(3) NOT NULL Currency Code
9 EXT_NET_PRC_BASE Signed Number(29,4) DECIMAL(27,4) NOT NULL Extended Net Price (base)
10 CURRENCY_CD_BASE Character(3) VARCHAR2(3) NOT NULL Business Unit Base Currency