73: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
74:
75: --Price Request Code corresponding to the consuming order line is mandatory.
76: IF p_cons_price_request_code IS NULL THEN
77: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
78: Fnd_Message.SET_TOKEN('PARAMETER',p_cons_price_request_code);
79: x_return_message := Fnd_Message.GET;
80: RAISE Fnd_Api.G_EXC_ERROR;
81:
74:
75: --Price Request Code corresponding to the consuming order line is mandatory.
76: IF p_cons_price_request_code IS NULL THEN
77: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
78: Fnd_Message.SET_TOKEN('PARAMETER',p_cons_price_request_code);
79: x_return_message := Fnd_Message.GET;
80: RAISE Fnd_Api.G_EXC_ERROR;
81:
82: END IF;
75: --Price Request Code corresponding to the consuming order line is mandatory.
76: IF p_cons_price_request_code IS NULL THEN
77: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
78: Fnd_Message.SET_TOKEN('PARAMETER',p_cons_price_request_code);
79: x_return_message := Fnd_Message.GET;
80: RAISE Fnd_Api.G_EXC_ERROR;
81:
82: END IF;
83:
83:
84: --Action Code is mandatory.
85: IF p_action_code IS NULL THEN
86:
87: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
88: Fnd_Message.SET_TOKEN('PARAMETER',p_action_code);
89: x_return_message := Fnd_Message.GET;
90: RAISE Fnd_Api.G_EXC_ERROR;
91:
84: --Action Code is mandatory.
85: IF p_action_code IS NULL THEN
86:
87: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
88: Fnd_Message.SET_TOKEN('PARAMETER',p_action_code);
89: x_return_message := Fnd_Message.GET;
90: RAISE Fnd_Api.G_EXC_ERROR;
91:
92: END IF;
85: IF p_action_code IS NULL THEN
86:
87: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
88: Fnd_Message.SET_TOKEN('PARAMETER',p_action_code);
89: x_return_message := Fnd_Message.GET;
90: RAISE Fnd_Api.G_EXC_ERROR;
91:
92: END IF;
93:
94: --Originally ordered qty must be not-null and non-zero.
95: IF p_action_code <> 'CANCEL' AND
96: (p_orig_ordered_qty IS NULL OR p_orig_ordered_qty = 0) THEN
97:
98: Fnd_Message.SET_NAME('QP','QP_NONZERO_PARAMETER_REQD');
99: Fnd_Message.SET_TOKEN('PARAMETER',p_orig_ordered_qty);
100: x_return_message := Fnd_Message.GET;
101: RAISE Fnd_Api.G_EXC_ERROR;
102:
95: IF p_action_code <> 'CANCEL' AND
96: (p_orig_ordered_qty IS NULL OR p_orig_ordered_qty = 0) THEN
97:
98: Fnd_Message.SET_NAME('QP','QP_NONZERO_PARAMETER_REQD');
99: Fnd_Message.SET_TOKEN('PARAMETER',p_orig_ordered_qty);
100: x_return_message := Fnd_Message.GET;
101: RAISE Fnd_Api.G_EXC_ERROR;
102:
103: END IF;
96: (p_orig_ordered_qty IS NULL OR p_orig_ordered_qty = 0) THEN
97:
98: Fnd_Message.SET_NAME('QP','QP_NONZERO_PARAMETER_REQD');
99: Fnd_Message.SET_TOKEN('PARAMETER',p_orig_ordered_qty);
100: x_return_message := Fnd_Message.GET;
101: RAISE Fnd_Api.G_EXC_ERROR;
102:
103: END IF;
104:
104:
105: --If Action Code is 'RETURN' then the returned qty must be not null.
106: IF p_action_code = 'RETURN' AND p_returned_qty IS NULL THEN
107:
108: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
109: Fnd_Message.SET_TOKEN('PARAMETER',p_returned_qty);
110: x_return_message := Fnd_Message.GET;
111: RAISE Fnd_Api.G_EXC_ERROR;
112:
105: --If Action Code is 'RETURN' then the returned qty must be not null.
106: IF p_action_code = 'RETURN' AND p_returned_qty IS NULL THEN
107:
108: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
109: Fnd_Message.SET_TOKEN('PARAMETER',p_returned_qty);
110: x_return_message := Fnd_Message.GET;
111: RAISE Fnd_Api.G_EXC_ERROR;
112:
113: END IF;
106: IF p_action_code = 'RETURN' AND p_returned_qty IS NULL THEN
107:
108: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
109: Fnd_Message.SET_TOKEN('PARAMETER',p_returned_qty);
110: x_return_message := Fnd_Message.GET;
111: RAISE Fnd_Api.G_EXC_ERROR;
112:
113: END IF;
114:
115: --If Action Code is 'RETURN' then the price_request_code of the return
116: --line must be not null.
117: IF p_action_code = 'RETURN' AND p_ret_price_request_code IS NULL THEN
118:
119: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
120: Fnd_Message.SET_TOKEN('PARAMETER',p_ret_price_request_code);
121: x_return_message := Fnd_Message.GET;
122: RAISE Fnd_Api.G_EXC_ERROR;
123:
116: --line must be not null.
117: IF p_action_code = 'RETURN' AND p_ret_price_request_code IS NULL THEN
118:
119: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
120: Fnd_Message.SET_TOKEN('PARAMETER',p_ret_price_request_code);
121: x_return_message := Fnd_Message.GET;
122: RAISE Fnd_Api.G_EXC_ERROR;
123:
124: END IF;
117: IF p_action_code = 'RETURN' AND p_ret_price_request_code IS NULL THEN
118:
119: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
120: Fnd_Message.SET_TOKEN('PARAMETER',p_ret_price_request_code);
121: x_return_message := Fnd_Message.GET;
122: RAISE Fnd_Api.G_EXC_ERROR;
123:
124: END IF;
125:
125:
126: --If Action Code is 'AMEND' then the amended qty must be not null.
127: IF p_action_code = 'AMEND' AND p_amended_qty IS NULL THEN
128:
129: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
130: Fnd_Message.SET_TOKEN('PARAMETER',p_amended_qty);
131: x_return_message := Fnd_Message.GET;
132: RAISE Fnd_Api.G_EXC_ERROR;
133:
126: --If Action Code is 'AMEND' then the amended qty must be not null.
127: IF p_action_code = 'AMEND' AND p_amended_qty IS NULL THEN
128:
129: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
130: Fnd_Message.SET_TOKEN('PARAMETER',p_amended_qty);
131: x_return_message := Fnd_Message.GET;
132: RAISE Fnd_Api.G_EXC_ERROR;
133:
134: END IF;
127: IF p_action_code = 'AMEND' AND p_amended_qty IS NULL THEN
128:
129: Fnd_Message.SET_NAME('QP','QP_PARAMETER_REQUIRED');
130: Fnd_Message.SET_TOKEN('PARAMETER',p_amended_qty);
131: x_return_message := Fnd_Message.GET;
132: RAISE Fnd_Api.G_EXC_ERROR;
133:
134: END IF;
135:
136: --If Action Code is 'AMEND' then the amended qty must not be greater
137: --than the orignally ordered qty.
138: IF p_action_code = 'AMEND' AND p_amended_qty > p_orig_ordered_qty THEN
139:
140: Fnd_Message.SET_NAME('QP','QP_PARAMETER_MUST_BE_LESSER');
141: Fnd_Message.SET_TOKEN('PARAMETER1',p_amended_qty);
142: Fnd_Message.SET_TOKEN('PARAMETER2',p_orig_ordered_qty);
143: x_return_message := Fnd_Message.GET;
144: RAISE Fnd_Api.G_EXC_ERROR;
137: --than the orignally ordered qty.
138: IF p_action_code = 'AMEND' AND p_amended_qty > p_orig_ordered_qty THEN
139:
140: Fnd_Message.SET_NAME('QP','QP_PARAMETER_MUST_BE_LESSER');
141: Fnd_Message.SET_TOKEN('PARAMETER1',p_amended_qty);
142: Fnd_Message.SET_TOKEN('PARAMETER2',p_orig_ordered_qty);
143: x_return_message := Fnd_Message.GET;
144: RAISE Fnd_Api.G_EXC_ERROR;
145:
138: IF p_action_code = 'AMEND' AND p_amended_qty > p_orig_ordered_qty THEN
139:
140: Fnd_Message.SET_NAME('QP','QP_PARAMETER_MUST_BE_LESSER');
141: Fnd_Message.SET_TOKEN('PARAMETER1',p_amended_qty);
142: Fnd_Message.SET_TOKEN('PARAMETER2',p_orig_ordered_qty);
143: x_return_message := Fnd_Message.GET;
144: RAISE Fnd_Api.G_EXC_ERROR;
145:
146: END IF;
139:
140: Fnd_Message.SET_NAME('QP','QP_PARAMETER_MUST_BE_LESSER');
141: Fnd_Message.SET_TOKEN('PARAMETER1',p_amended_qty);
142: Fnd_Message.SET_TOKEN('PARAMETER2',p_orig_ordered_qty);
143: x_return_message := Fnd_Message.GET;
144: RAISE Fnd_Api.G_EXC_ERROR;
145:
146: END IF;
147:
158: ELSIF p_action_code = 'SPLIT_NEW' THEN
159: l_proration := p_returned_qty/p_orig_ordered_qty;
160: --bug#7540503
161: ELSE
162: Fnd_Message.SET_NAME('QP','QP_INVALID_ACTION_CODE');
163: x_return_message := Fnd_Message.GET;
164: RAISE Fnd_Api.G_EXC_ERROR;
165: END IF;
166:
159: l_proration := p_returned_qty/p_orig_ordered_qty;
160: --bug#7540503
161: ELSE
162: Fnd_Message.SET_NAME('QP','QP_INVALID_ACTION_CODE');
163: x_return_message := Fnd_Message.GET;
164: RAISE Fnd_Api.G_EXC_ERROR;
165: END IF;
166:
167:
257: AND limit_balance_id = l_cons_trans_rec.limit_balance_id;
258:
259: EXCEPTION
260: WHEN NO_DATA_FOUND THEN
261: Fnd_Message.SET_NAME('QP','QP_LIMIT_TXN_NOT_FOUND');
262: x_return_message := Fnd_Message.GET;
263: RAISE Fnd_Api.G_EXC_ERROR;
264: END;
265: --Transaction Record to be cancelled/amended exists. Update trxn amount.
258:
259: EXCEPTION
260: WHEN NO_DATA_FOUND THEN
261: Fnd_Message.SET_NAME('QP','QP_LIMIT_TXN_NOT_FOUND');
262: x_return_message := Fnd_Message.GET;
263: RAISE Fnd_Api.G_EXC_ERROR;
264: END;
265: --Transaction Record to be cancelled/amended exists. Update trxn amount.
266: --bug 13521835
388: AND limit_balance_id = l_cons_trans_rec.limit_balance_id;
389:
390: EXCEPTION
391: WHEN NO_DATA_FOUND THEN
392: FND_MESSAGE.SET_NAME('QP','QP_LIMIT_TXN_NOT_FOUND');
393: x_return_message := FND_MESSAGE.GET;
394: RAISE FND_API.G_EXC_ERROR;
395: END;
396: qp_Preq_Grp.engine_debug('l_consumed_amount :'||l_consumed_amount);
389:
390: EXCEPTION
391: WHEN NO_DATA_FOUND THEN
392: FND_MESSAGE.SET_NAME('QP','QP_LIMIT_TXN_NOT_FOUND');
393: x_return_message := FND_MESSAGE.GET;
394: RAISE FND_API.G_EXC_ERROR;
395: END;
396: qp_Preq_Grp.engine_debug('l_consumed_amount :'||l_consumed_amount);
397: --bug13521835
1108: WHEN OTHERS THEN
1109: l_validate_result := 'N';
1110:
1111: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
1112: Fnd_Message.SET_NAME('QP', 'QP_ERR_VALID_PRICELIST_N_CURR');
1113: END IF;
1114:
1115: IF c_validate_plist_curr_multi%ISOPEN THEN
1116: CLOSE c_validate_plist_curr_multi;
1239:
1240: WHEN OTHERS THEN
1241:
1242: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
1243: Fnd_Message.SET_NAME('QP', 'QP_ERROR_GET_CURR_F_PRICELIST');
1244: END IF;
1245:
1246: IF c_currency_multi%ISOPEN THEN
1247: CLOSE c_currency_multi;
1691: EXCEPTION
1692: WHEN OTHERS THEN
1693:
1694: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
1695: Fnd_Message.SET_NAME('QP', 'QP_ERROR_GET_PRICELIST_F_CURR');
1696: END IF;
1697:
1698: IF c_price_list_multi%ISOPEN THEN
1699: CLOSE c_price_list_multi;
1826: EXCEPTION
1827: WHEN OTHERS THEN
1828:
1829: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
1830: Fnd_Message.SET_NAME('QP', 'QP_ERROR_GET_PRICING_OBJECT');
1831: Fnd_Message.SET_TOKEN('PRICING_OBJECT','Price Lists');
1832: END IF;
1833:
1834: IF c_price_list_blkt%ISOPEN THEN
1827: WHEN OTHERS THEN
1828:
1829: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
1830: Fnd_Message.SET_NAME('QP', 'QP_ERROR_GET_PRICING_OBJECT');
1831: Fnd_Message.SET_TOKEN('PRICING_OBJECT','Price Lists');
1832: END IF;
1833:
1834: IF c_price_list_blkt%ISOPEN THEN
1835: CLOSE c_price_list_blkt;
2093: EXCEPTION
2094: WHEN OTHERS THEN
2095:
2096: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
2097: Fnd_Message.SET_NAME('QP', 'QP_ERROR_GET_PRICING_OBJECT');
2098: Fnd_Message.SET_TOKEN('PRICING_OBJECT','Agreements');
2099: END IF;
2100:
2101: IF c_agreement%ISOPEN THEN
2094: WHEN OTHERS THEN
2095:
2096: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
2097: Fnd_Message.SET_NAME('QP', 'QP_ERROR_GET_PRICING_OBJECT');
2098: Fnd_Message.SET_TOKEN('PRICING_OBJECT','Agreements');
2099: END IF;
2100:
2101: IF c_agreement%ISOPEN THEN
2102: CLOSE c_agreement;
2203:
2204: END IF;
2205: IF p_operand_type <> 'R' AND p_operand IS NULL THEN
2206: IF Oe_Msg_Pub.Check_Msg_Level(Oe_Msg_Pub.G_MSG_LVL_ERROR) THEN
2207: Fnd_Message.SET_NAME('QP','QP_ATTRIBUTE_REQUIRED');
2208: Fnd_Message.SET_TOKEN('ATTRIBUTE','Operand');
2209: Oe_Msg_Pub.ADD;
2210: END IF;
2211: RAISE Fnd_Api.G_EXC_ERROR;
2204: END IF;
2205: IF p_operand_type <> 'R' AND p_operand IS NULL THEN
2206: IF Oe_Msg_Pub.Check_Msg_Level(Oe_Msg_Pub.G_MSG_LVL_ERROR) THEN
2207: Fnd_Message.SET_NAME('QP','QP_ATTRIBUTE_REQUIRED');
2208: Fnd_Message.SET_TOKEN('ATTRIBUTE','Operand');
2209: Oe_Msg_Pub.ADD;
2210: END IF;
2211: RAISE Fnd_Api.G_EXC_ERROR;
2212: END IF;
2402: Oe_Debug_Pub.ADD('round_price - NO_DATA_FOUND exception');
2403: END IF;
2404: x_status_code := Fnd_Api.G_RET_STS_ERROR;
2405: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
2406: Fnd_Message.SET_NAME('QP','QP_NO_RECORD_FOR_ROUNDING');
2407: Fnd_Message.SET_TOKEN('PRICE_LIST', p_price_list_id);
2408: Fnd_Message.SET_TOKEN('CURRENCY', p_currency_code);
2409: END IF;
2410:
2403: END IF;
2404: x_status_code := Fnd_Api.G_RET_STS_ERROR;
2405: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
2406: Fnd_Message.SET_NAME('QP','QP_NO_RECORD_FOR_ROUNDING');
2407: Fnd_Message.SET_TOKEN('PRICE_LIST', p_price_list_id);
2408: Fnd_Message.SET_TOKEN('CURRENCY', p_currency_code);
2409: END IF;
2410:
2411: WHEN Fnd_Api.G_EXC_ERROR THEN
2404: x_status_code := Fnd_Api.G_RET_STS_ERROR;
2405: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
2406: Fnd_Message.SET_NAME('QP','QP_NO_RECORD_FOR_ROUNDING');
2407: Fnd_Message.SET_TOKEN('PRICE_LIST', p_price_list_id);
2408: Fnd_Message.SET_TOKEN('CURRENCY', p_currency_code);
2409: END IF;
2410:
2411: WHEN Fnd_Api.G_EXC_ERROR THEN
2412:
2831:
2832: EXCEPTION
2833: WHEN OTHERS THEN
2834: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_ERROR) THEN
2835: Fnd_Message.SET_NAME('QP', 'QP_ERROR_GET_CURR_F_PRICELIST');
2836: END IF;
2837:
2838: END Get_Price_List_Currency;
2839: