TD_PRO_FD_CR_VW

(SQL View)
Index Back

Promo Credits for a customer

The following views should always have the same fields TD_PRO_CU_PD_VW TD_PRO_CU_OI_VW TD_PRO_CU_CR_VW TD_PRO_CU_DE_VW

SELECT DISTINCT C.SETID , A.SOLD_TO_CUST_ID , B.PPRC_PROMO_CD , B.MERCH_TYPE , B.INVOICE , B.INVOICE_LINE , %DecMult(B.GROSS_EXTENDED_AMT, -1) , B.BI_CURRENCY_CD , E.STATUS_TD , F.TD_FUND_CODE FROM PS_BI_HDR A , PS_BI_LINE B , PS_SET_CNTRL_REC C , PS_PPRC_PROMO_TBL D , PS_TD_PROMO_CUST E , PS_TD_PRO_MERFU_CU F WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT AND A.INVOICE = B.INVOICE AND B.GROSS_EXTENDED_AMT < 0 AND B.PPRC_PROMO_CD <> ' ' AND B.PPRC_PROMO_CD = D.PPRC_PROMO_CD AND A.INVOICE_TYPE = 'REG' AND A.BILL_STATUS = 'INV' AND C.RECNAME = 'PPRC_PROMO_TBL' AND C.SETCNTRLVALUE = D.SETID AND D.SETID = E.SETID AND D.PPRC_PROMO_CD = E.PPRC_PROMO_CD AND E.CUST_ID = A.SOLD_TO_CUST_ID AND F.SETID = E.SETID AND F.PPRC_PROMO_CD = E.PPRC_PROMO_CD AND F.MERCH_TYPE = B.MERCH_TYPE AND F.CUST_ID = A.SOLD_TO_CUST_ID

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 SETID Character(5) VARCHAR2(5) NOT NULL SetID

Prompt Table: SP_SETTD_NONVW

2 CUST_ID Character(15) VARCHAR2(15) NOT NULL Uniquely identifies an organizational entity that purchases goods or services from the enterprise. Represents the sold-to customer which is the customer organization that places orders. The CUST_ID may or may not be the same as the identifiers for the bill-to and ship-to locations.

Prompt Table: TD_CUST_OPRVW

3 PPRC_PROMO_CD Character(20) VARCHAR2(20) NOT NULL Price Promotion Code

Prompt Table: PPRC_PROMO_TBL

4 MERCH_TYPE Character(10) VARCHAR2(10) NOT NULL Merchandising Type

Prompt Table: TD_MERCH_TYP_VW
Set Control Field: SETID

5 INVOICE Character(22) VARCHAR2(22) NOT NULL Invoice
6 INVOICE_LINE Number(5,0) INTEGER NOT NULL Invoice Line
7 AMOUNT Signed Number(28,3) DECIMAL(26,3) NOT NULL Amount
8 CURRENCY_CD Character(3) VARCHAR2(3) NOT NULL Currency Code

Prompt Table: CURRENCY_CD_TBL

9 STATUS_TD Character(2) VARCHAR2(2) NOT NULL Promotion Status
CA=Customer Approved
CE=Customer Cancelled
CL=Closed
CR=Customer Rejected
MA=Management Approved
MR=Management Rejected
PA=Pending Approval
PL=Planned
RE=Recalled
RL=Released
10 TD_FUND_CODE Character(10) VARCHAR2(10) NOT NULL Promotions Management Fund Code