1 PACKAGE RCV_DATES_S AUTHID CURRENT_USER AS
2 /* $Header: RCVTXDAS.pls 115.1 2002/11/23 00:56:18 sbull ship $*/
3
4 /*===========================================================================
5
6 FUNCTION NAME: val_trx_date()
7
8 DESCRIPTION:
9
10 Function performs the following validations:
11
12 1) Transaction date must be less than or equal to sysdate.
13
14 2) For transacation types of 'RECEIVE' or 'MATCH' for a vendor, calls
15 val_receipt_date_tolerance to validate that the transaction date
16 falls within the Early/Late receipt date tolerance.
17
18 3) Calls PO_DATES_S.val_open_period to check if transaction date is in
19 an open GL period.
20
21 4) Calls PO_DATES_S.val_open_period to first check if inventory is
22 installed. If so, it checks that the transaction date is in an open
23 inventory period.
24
25 5) Calls PO_DATES_S.val_open_period to first check if purchasing is
26 installed. If so, it checks that the transaction date is in an open
27 purchasing period.
28
29 6) Parent transaction date must be less than or equal to the
30 transaction date unless transaction type is 'RECEIVE'or 'UNORDERED'
31 (which have no parents). If the parent transaction date is null,
32 get the date using the parent transaction id.
33
34 7) For transacation type of 'RECEIVE' internally, the transaction date
35 must be greater than or equal to the shipped date for shipment
36 lines.
37
38 PARAMETERS:
39
40 Parameter IN/OUT Datatype Description
41 --------------- -------- ------------ --------------------------------------
42
43 x_trx_date IN DATE Transaction Date to be validated.
44
45 x_trx_type IN VARCHAR2 Transaction Type:
46 ACCEPT, CORRECT, DELIVER, MATCH,
47 RECEIVE, REJECT, RETURN TO RECEIVING,
48 RETURN TO VENDOR, TRANSFER, UNORDERED
49
50 x_parent_trx_date IN DATE Parent Transaction Date.
51
52 x_line_loc_id IN NUMBER Line location ID. Used for validating
53 receipt date tolerance for transaction
54 types 'RECEIVE' or 'MATCH' that are for
55 a vendor.
56
57 x_ship_line_id IN NUMBER Shipment line ID. Used for validating
58 shipment date for transaction type
59 'RECEIVE' internally. Null otherwise.
60
61 x_parent_trx_id IN NUMBER Parent transaction ID. Line location
62 ID for transaction types 'RECEIVE' or
63 'MATCH' that are for a vendor.
64 Shipment line ID for transaction types
65 'RECEIVE' or 'MATCH' internally.
66 Parent transaction ID otherwise.
67
68 x_sob_id IN NUMBER Set of Books ID.
69
70 x_org_id IN NUMBER Organization ID.
71
72 x_receipt_source_code IN VARCHAR2 Receipt Source Code:
73 Internal Order
74 Inventory
75 Vendor
76
77 RETURN VALUE: TRUE if all of the above date checks are TRUE.
78 FALSE if any of the above date checks are FALSE.
79
80 DESIGN REFERENCES: RCVRCERC.dd
81 RCVTXECO.dd
82 RCVTXERE.dd
83 RCVTXERT.dd
84
85 ALGORITHM:
86
87 NOTES:
88
89 OPEN ISSUES:
90
91 CLOSED ISSUES:
92
93 CHANGE HISTORY:
94 ===========================================================================*/
95
96 FUNCTION val_trx_date(x_trx_date IN DATE,
97 x_trx_type IN VARCHAR2,
98 x_parent_trx_date IN OUT NOCOPY DATE,
99 x_line_loc_id IN NUMBER,
100 x_ship_line_id IN NUMBER,
101 x_parent_trx_id IN NUMBER,
102 x_sob_id IN NUMBER,
103 x_org_id IN NUMBER,
104 x_receipt_source_code IN VARCHAR2) RETURN BOOLEAN;
105
106 /*===========================================================================
107 FUNCTION NAME: val_receipt_date_tolerance()
108
109 DESCRIPTION: Determines if the receipt date falls within the
110 receipt date tolerance window. If it does, the
111 function returns a value of TRUE, otherwise it
112 returns FALSE.
113
114 PARAMETERS:
115
116 Parameter IN/OUT Datatype Description
117 --------------- -------- ------------ --------------------------------------
118 x_line_loc_id IN NUMBER Line location ID for vendor receipts.
119 x_receipt_date IN DATE Receipt date.
120
121 RETURN VALUE: TRUE if transaction date is within receipt date
122 tolerance, FALSE otherwise
123
124 DESIGN REFERENCES: RCVRCERC.dd
125
126 ALGORITHM:
127
128 NOTES:
129
130 OPEN ISSUES:
131
132 CLOSED ISSUES:
133
134 CHANGE HISTORY:
135 ===========================================================================*/
136
137 FUNCTION val_receipt_date_tolerance(x_line_loc_id IN NUMBER,
138 x_receipt_date IN DATE) RETURN BOOLEAN;
139
140
141 END RCV_DATES_S;