1 PACKAGE PON_BID_DEFAULTING_PKG AS
2 --$Header: PONBDDFS.pls 120.6 2007/02/01 00:41:01 mxfang ship $
3
4 -- ======================================================================
5 -- PROCEDURE: IS_BIDDING_ALLOWED PUBLIC
6 -- PARAMETERS:
7 -- p_auc_header_id IN auction header id of negotiation
8 -- p_tpid IN trading partner id of supplier
9 -- p_tpcid IN trading partner contact id of supplier
10 -- p_vensid IN vendor site to place a bid for
11 -- p_venscode IN corresponding vendor site code
12 -- p_buyer_user IN determines if surrogate bid
13 -- p_action_code IN determines if certain validation should be suppressed
14 -- x_return_status OUT 0 for success, 1 for error
15 -- x_return_code OUT returned error code, or SUCCESS
16 --
17 -- COMMENT: Determine if the bidding action specified by action code can
18 -- be completed at this time.
19 -- ======================================================================
20 PROCEDURE is_bidding_allowed
21 (
22 p_auc_header_id IN pon_auction_headers_all.auction_header_id%TYPE,
23 p_tpid IN pon_bid_headers.trading_partner_id%TYPE,
24 p_tpcid IN pon_bid_headers.trading_partner_contact_id%TYPE,
25 p_vensid IN pon_bid_headers.vendor_site_id%TYPE,
26 p_venscode IN pon_bid_headers.vendor_site_code%TYPE,
27 p_buyer_user IN VARCHAR2,
28 p_action_code IN VARCHAR2,
29 x_return_status OUT NOCOPY NUMBER,
30 x_return_code OUT NOCOPY VARCHAR2
31 );
32
33 -- ======================================================================
34 -- PROCEDURE: CREATE_DEFAULTED_BID PUBLIC
35 -- PARAMETERS:
36 -- p_auc_header_id IN auction header id of negotiation
37 -- p_source_bid IN the bid to default from
38 -- x_bid_number OUT bid number of draft loaded or created
39 -- x_return_status OUT 0 for success, 1 for error
40 -- x_return_code OUT returned error code, or SUCCESS
41 --
42 -- COMMENT: create a new draft on p_auc_header_id, defaulting from
43 -- p_source_bid
44 -- ======================================================================
45 PROCEDURE create_defaulted_draft
46 (
47 p_new_header_id IN pon_auction_headers_all.auction_header_id%TYPE,
48 p_source_bid IN pon_bid_headers.bid_number%TYPE,
49 x_bid_number OUT NOCOPY pon_bid_headers.bid_number%TYPE
50 );
51
52 -- ======================================================================
53 -- PROCEDURE: CHECK_AND_LOAD_BID PUBLIC
54 -- PARAMETERS:
55 -- p_auc_header_id IN auction header id of negotiation
56 -- p_draft_number IN non-null if a specific draft is to be loaded
57 -- p_tpid IN trading partner id of supplier
58 -- p_tpcid IN trading partner contact id of supplier
59 -- p_tpname IN trading partner name of supplier
60 -- p_tpcname IN trading partner contact name of supplier
61 -- p_userid IN userid of bid creator
62 -- p_venid IN vendor id
63 -- p_vensid IN vendor site to place a bid for
64 -- p_venscode IN corresponding vendor site code
65 -- p_buyer_user IN determines if surrogate bid
66 -- p_auctpid IN trading partner id of buyer if surrogate bid
67 -- p_auctpcid IN trading partner contact id of buyer if surrogate bid
68
69 -- x_bid_number OUT bid number of draft loaded or created
70 -- x_rebid_flag OUT flag determining if rebid or not
71 -- x_prev_bid_number OUT source bid number
72 -- x_amend_bid_def OUT Y if source bid is on a previous amendment
73 -- x_round_bid_def OUT Y if source bid is on a previous round
74 -- x_prev_bid_disq OUT Y is source bid was disqualified
75
76 -- p_action_code IN determine if a special action needs to be taken
77 -- x_return_status OUT 0 for success, 1 for error
78 -- x_return_code OUT returned error code, or SUCCESS
79 --
80 -- COMMENT: Determine if the bidding action specified by action code can
81 -- be completed at this time.
82 -- ======================================================================
83 PROCEDURE check_and_load_bid
84 (
85 p_auc_header_id IN pon_auction_headers_all.auction_header_id%TYPE,
86 p_draft_number IN pon_bid_headers.bid_number%TYPE,
87 p_tpid IN pon_bid_headers.trading_partner_id%TYPE,
88 p_tpcid IN pon_bid_headers.trading_partner_contact_id%TYPE,
89 p_tpname IN pon_bid_headers.trading_partner_name%TYPE,
90 p_tpcname IN pon_bid_headers.trading_partner_contact_name%TYPE,
91 p_userid IN pon_bid_headers.created_by%TYPE,
92 p_venid IN pon_bid_headers.vendor_id%TYPE,
93 p_vensid IN pon_bid_headers.vendor_site_id%TYPE,
94 p_venscode IN pon_bid_headers.vendor_site_code%TYPE,
95 p_buyer_user IN VARCHAR2,
96 p_auctpid IN pon_bid_headers.surrog_bid_created_tp_id%TYPE,
97 p_auctpcid IN pon_bid_headers.surrog_bid_created_contact_id%TYPE,
98
99 x_bid_number OUT NOCOPY pon_bid_headers.bid_number%TYPE,
100 x_rebid_flag OUT NOCOPY VARCHAR2,
101 x_prev_bid_number OUT NOCOPY pon_bid_headers.bid_number%TYPE,
102 x_amend_bid_def OUT NOCOPY VARCHAR2,
103 x_round_bid_def OUT NOCOPY VARCHAR2,
104 x_prev_bid_disq OUT NOCOPY VARCHAR2,
105 x_edit_draft OUT NOCOPY VARCHAR2,
106
107 p_action_code IN VARCHAR2,
108 x_return_status OUT NOCOPY NUMBER,
109 x_return_code OUT NOCOPY VARCHAR2
110 );
111
112 -- ======================================================================
113 -- FUNCTION: GET_SOURCE_BID_FOR_SPREADSHEET
114 -- PARAMETERS:
115 -- p_auc_header_id IN auction header id of negotiation
116 -- p_prev_round_auc_header_id IN auction header id of prev round negotiation
117 -- p_tpid IN trading partner id of supplier
118 -- p_tpcid IN trading partner contact id of supplier
119 -- p_auc_header_id_orig_amend IN auction header id of original amendment
120 -- p_amendment_number IN amendment number
121 -- p_vensid IN vendor site to place a bid for
122 --
123 -- COMMENT: This function is only used in spreadsheet export case.
124 -- Determine whether there are any bids existing for the current amendment.
125 -- If not, determines whether there are any bids in previous amendment
126 -- of current round; If still not, check whether there is an active bid
127 -- from previous round
128 -- ======================================================================
129 FUNCTION get_source_bid_for_spreadsheet
130 (
131 p_auc_header_id IN pon_auction_headers_all.auction_header_id%TYPE,
132 p_prev_round_auc_header_id IN pon_auction_headers_all.auction_header_id_prev_round%TYPE,
133 p_tpid IN pon_bid_headers.trading_partner_id%TYPE,
134 p_tpcid IN pon_bid_headers.trading_partner_contact_id%TYPE,
135 p_auc_header_id_orig_amend IN pon_auction_headers_all.auction_header_id_orig_amend%TYPE,
136 p_amendment_number IN pon_auction_headers_all.amendment_number%TYPE,
137 p_vensid IN pon_bid_headers.vendor_site_id%TYPE
138
139 ) RETURN NUMBER;
140
141
142 --------------------------------------------------------------------------------
143 -- can_supplier_create_payments --
144 --------------------------------------------------------------------------------
145 -- Start of Comments
146 --
147 -- API Name: can_supplier_create_payments
148 --
149 -- Type : Private
150 --
151 -- Pre-reqs: None
152 --
153 -- Function: This API is called by the Response Import Spreadsheet page.
154 -- It determines if there are any lines in the RFQ that can have payments.
155 -- If yes, then the "Pay Items" will be one of the option in the Import
156 -- and Export poplists
157 --
158 --
159 -- Parameters:
160 --
161 -- p_auction_header_id IN NUMBER
162 -- Auction header id - required
163 -- p_bid_number IN NUMBER
164 -- Bid Number - required
165 -- p_po_style_id IN NUMBER
166 -- PO Style Id - required
167 --
168 --
169 -- x_can_create_payments OUT VARCHAR2
170 -- Returns Y if payments can be created for atleast one of the
171 -- line to which supplier has access. Otherwise Returns N
172 --
173 --
174 -- End of Comments
175 --------------------------------------------------------------------------------
176 PROCEDURE can_supplier_create_payments(
177 p_auction_header_id IN NUMBER,
178 p_bid_number IN NUMBER,
179 x_can_create_payments OUT NOCOPY VARCHAR2) ;
180
181
182 /**
183 * This function calculates the total price on a line including the
184 * buyer and the supplier price factors in auction currency.
185 *
186 * This function will be used in view objects to display supplier's
187 * previous round price as the start price for this line instead of the
188 * auction line start price.
189 *
190 * This is as per Cendant requirement to enforce upon suppliers to
191 * bid lower than their bid on the previous round of the negotiation
192 *
193 * Currently anticipated usage of this function are on View Bid Page
194 * (ViewBidItemsVO), Negotiation Summary page (AuctionItemPricesAllVO)
195 * and bid creation page (ResponseAMImpl)
196 *
197 * p_auction_header_id - current round auction header id
198 * p_prev_auc_active_bid_number - bid number on the previous round
199 * p_line_number - current line number
200 * p_unit_price - bid line price in auction currency
201 * p_quantity - bid quantity for the current line
202 */
203
204 FUNCTION apply_price_factors(p_auction_header_id IN NUMBER,
205 p_prev_auc_active_bid_number IN NUMBER,
206 p_line_number IN NUMBER,
207 p_unit_price IN NUMBER,
208 p_quantity IN NUMBER
209 )
210 RETURN NUMBER;
211
212 END PON_BID_DEFAULTING_PKG;