76: END IF;
77:
78: -- Debug Message
79: IF OZF_DEBUG_LOW_ON THEN
80: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
81: END IF;
82:
83: -- Initialize API return status to sucess
84: x_return_status := FND_API.G_RET_STS_SUCCESS;
84: x_return_status := FND_API.G_RET_STS_SUCCESS;
85:
86: If p_transaction.source_code = 'OM' THEN
87: IF OZF_DEBUG_LOW_ON THEN
88: ozf_utility_PVT.debug_message('IN OM:' );
89: ozf_utility_PVT.debug_message('sold_to_cust_account_id: '||p_transaction.sold_to_cust_account_id);
90: ozf_utility_PVT.debug_message('sold_to_party_id: '||p_transaction.sold_to_party_id);
91: ozf_utility_PVT.debug_message('bill_to_site_use_id: '||p_transaction.bill_to_site_use_id);
92: ozf_utility_PVT.debug_message('ship_to_site_use_id: '||p_transaction.ship_to_site_use_id);
85:
86: If p_transaction.source_code = 'OM' THEN
87: IF OZF_DEBUG_LOW_ON THEN
88: ozf_utility_PVT.debug_message('IN OM:' );
89: ozf_utility_PVT.debug_message('sold_to_cust_account_id: '||p_transaction.sold_to_cust_account_id);
90: ozf_utility_PVT.debug_message('sold_to_party_id: '||p_transaction.sold_to_party_id);
91: ozf_utility_PVT.debug_message('bill_to_site_use_id: '||p_transaction.bill_to_site_use_id);
92: ozf_utility_PVT.debug_message('ship_to_site_use_id: '||p_transaction.ship_to_site_use_id);
93: ozf_utility_PVT.debug_message('header_id: '||p_transaction.header_id);
86: If p_transaction.source_code = 'OM' THEN
87: IF OZF_DEBUG_LOW_ON THEN
88: ozf_utility_PVT.debug_message('IN OM:' );
89: ozf_utility_PVT.debug_message('sold_to_cust_account_id: '||p_transaction.sold_to_cust_account_id);
90: ozf_utility_PVT.debug_message('sold_to_party_id: '||p_transaction.sold_to_party_id);
91: ozf_utility_PVT.debug_message('bill_to_site_use_id: '||p_transaction.bill_to_site_use_id);
92: ozf_utility_PVT.debug_message('ship_to_site_use_id: '||p_transaction.ship_to_site_use_id);
93: ozf_utility_PVT.debug_message('header_id: '||p_transaction.header_id);
94: ozf_utility_PVT.debug_message('line_id: '||p_transaction.line_id);
87: IF OZF_DEBUG_LOW_ON THEN
88: ozf_utility_PVT.debug_message('IN OM:' );
89: ozf_utility_PVT.debug_message('sold_to_cust_account_id: '||p_transaction.sold_to_cust_account_id);
90: ozf_utility_PVT.debug_message('sold_to_party_id: '||p_transaction.sold_to_party_id);
91: ozf_utility_PVT.debug_message('bill_to_site_use_id: '||p_transaction.bill_to_site_use_id);
92: ozf_utility_PVT.debug_message('ship_to_site_use_id: '||p_transaction.ship_to_site_use_id);
93: ozf_utility_PVT.debug_message('header_id: '||p_transaction.header_id);
94: ozf_utility_PVT.debug_message('line_id: '||p_transaction.line_id);
95: END IF;
88: ozf_utility_PVT.debug_message('IN OM:' );
89: ozf_utility_PVT.debug_message('sold_to_cust_account_id: '||p_transaction.sold_to_cust_account_id);
90: ozf_utility_PVT.debug_message('sold_to_party_id: '||p_transaction.sold_to_party_id);
91: ozf_utility_PVT.debug_message('bill_to_site_use_id: '||p_transaction.bill_to_site_use_id);
92: ozf_utility_PVT.debug_message('ship_to_site_use_id: '||p_transaction.ship_to_site_use_id);
93: ozf_utility_PVT.debug_message('header_id: '||p_transaction.header_id);
94: ozf_utility_PVT.debug_message('line_id: '||p_transaction.line_id);
95: END IF;
96:
89: ozf_utility_PVT.debug_message('sold_to_cust_account_id: '||p_transaction.sold_to_cust_account_id);
90: ozf_utility_PVT.debug_message('sold_to_party_id: '||p_transaction.sold_to_party_id);
91: ozf_utility_PVT.debug_message('bill_to_site_use_id: '||p_transaction.bill_to_site_use_id);
92: ozf_utility_PVT.debug_message('ship_to_site_use_id: '||p_transaction.ship_to_site_use_id);
93: ozf_utility_PVT.debug_message('header_id: '||p_transaction.header_id);
94: ozf_utility_PVT.debug_message('line_id: '||p_transaction.line_id);
95: END IF;
96:
97: -- nepanda : Fix for Bug 10120042 : If ship to org id is coming null from ASO message, then get it from table.
90: ozf_utility_PVT.debug_message('sold_to_party_id: '||p_transaction.sold_to_party_id);
91: ozf_utility_PVT.debug_message('bill_to_site_use_id: '||p_transaction.bill_to_site_use_id);
92: ozf_utility_PVT.debug_message('ship_to_site_use_id: '||p_transaction.ship_to_site_use_id);
93: ozf_utility_PVT.debug_message('header_id: '||p_transaction.header_id);
94: ozf_utility_PVT.debug_message('line_id: '||p_transaction.line_id);
95: END IF;
96:
97: -- nepanda : Fix for Bug 10120042 : If ship to org id is coming null from ASO message, then get it from table.
98: -- This condition will work only if oe_order_lines table has a not null value in ship_to_org id column.
107: p_transaction.sold_to_party_id is NULL OR
108: p_transaction.bill_to_site_use_id is NULL OR
109: l_ship_to_site_use_id is NULL THEN -- nepanda : Fix for bug 10120042
110:
111: ozf_utility_PVT.error_message('OZF_TRANS_BILLTO_NULL');
112: RAISE FND_API.g_exc_unexpected_error;
113: END IF;
114:
115: IF p_transaction.header_id is NULL OR
114:
115: IF p_transaction.header_id is NULL OR
116: p_transaction.line_id is NULL THEN
117:
118: ozf_utility_PVT.error_message('OZF_TRANS_ORDER_REF_NULL');
119: RAISE FND_API.g_exc_unexpected_error;
120: END IF;
121:
122: ELSIF p_transaction.source_code = 'IS' THEN
120: END IF;
121:
122: ELSIF p_transaction.source_code = 'IS' THEN
123: IF OZF_DEBUG_LOW_ON THEN
124: ozf_utility_PVT.debug_message('IN IS:' );
125: ozf_utility_PVT.debug_message('sold_from_party_id: '||p_transaction.sold_from_party_id);
126: ozf_utility_PVT.debug_message('header_id: '||p_transaction.header_id);
127: ozf_utility_PVT.debug_message('line_id: '||p_transaction.line_id);
128: END IF;
121:
122: ELSIF p_transaction.source_code = 'IS' THEN
123: IF OZF_DEBUG_LOW_ON THEN
124: ozf_utility_PVT.debug_message('IN IS:' );
125: ozf_utility_PVT.debug_message('sold_from_party_id: '||p_transaction.sold_from_party_id);
126: ozf_utility_PVT.debug_message('header_id: '||p_transaction.header_id);
127: ozf_utility_PVT.debug_message('line_id: '||p_transaction.line_id);
128: END IF;
129:
122: ELSIF p_transaction.source_code = 'IS' THEN
123: IF OZF_DEBUG_LOW_ON THEN
124: ozf_utility_PVT.debug_message('IN IS:' );
125: ozf_utility_PVT.debug_message('sold_from_party_id: '||p_transaction.sold_from_party_id);
126: ozf_utility_PVT.debug_message('header_id: '||p_transaction.header_id);
127: ozf_utility_PVT.debug_message('line_id: '||p_transaction.line_id);
128: END IF;
129:
130: IF p_transaction.sold_from_party_id is null THEN
123: IF OZF_DEBUG_LOW_ON THEN
124: ozf_utility_PVT.debug_message('IN IS:' );
125: ozf_utility_PVT.debug_message('sold_from_party_id: '||p_transaction.sold_from_party_id);
126: ozf_utility_PVT.debug_message('header_id: '||p_transaction.header_id);
127: ozf_utility_PVT.debug_message('line_id: '||p_transaction.line_id);
128: END IF;
129:
130: IF p_transaction.sold_from_party_id is null THEN
131:
128: END IF;
129:
130: IF p_transaction.sold_from_party_id is null THEN
131:
132: ozf_utility_PVT.error_message('OZF_TRANS_SOLDFROM_NULL');
133: RAISE FND_API.g_exc_unexpected_error;
134: END IF;
135:
136: IF p_transaction.header_id is NULL OR
135:
136: IF p_transaction.header_id is NULL OR
137: p_transaction.line_id is NULL THEN
138:
139: ozf_utility_PVT.error_message('OZF_TRANS_ORDER_REF_NULL');
140: RAISE FND_API.g_exc_unexpected_error;
141: END IF;
142:
143: ELSIF p_transaction.source_code = 'MA' THEN
141: END IF;
142:
143: ELSIF p_transaction.source_code = 'MA' THEN
144: IF OZF_DEBUG_LOW_ON THEN
145: ozf_utility_PVT.debug_message('IN MA:' );
146: ozf_utility_PVT.debug_message('sold_to_party_id: '||p_transaction.sold_to_party_id);
147: END IF;
148:
149: IF p_transaction.sold_to_party_id is null THEN
142:
143: ELSIF p_transaction.source_code = 'MA' THEN
144: IF OZF_DEBUG_LOW_ON THEN
145: ozf_utility_PVT.debug_message('IN MA:' );
146: ozf_utility_PVT.debug_message('sold_to_party_id: '||p_transaction.sold_to_party_id);
147: END IF;
148:
149: IF p_transaction.sold_to_party_id is null THEN
150: OZF_UTILITY_PVT.error_message('OZF_TRANS_SOLD_TO_PTY_NULL');
146: ozf_utility_PVT.debug_message('sold_to_party_id: '||p_transaction.sold_to_party_id);
147: END IF;
148:
149: IF p_transaction.sold_to_party_id is null THEN
150: OZF_UTILITY_PVT.error_message('OZF_TRANS_SOLD_TO_PTY_NULL');
151: RAISE FND_API.g_exc_unexpected_error;
152: END IF;
153: ELSE
154: OZF_UTILITY_PVT.error_message('OZF_TRANS_SOURCE_CD_WRG');
150: OZF_UTILITY_PVT.error_message('OZF_TRANS_SOLD_TO_PTY_NULL');
151: RAISE FND_API.g_exc_unexpected_error;
152: END IF;
153: ELSE
154: OZF_UTILITY_PVT.error_message('OZF_TRANS_SOURCE_CD_WRG');
155: RAISE FND_API.g_exc_unexpected_error;
156: END IF;
157:
158: -- Debug Message
156: END IF;
157:
158: -- Debug Message
159: IF OZF_DEBUG_LOW_ON THEN
160: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
161: END IF;
162: --Standard call to get message count and if count=1, get the message
163: FND_MSG_PUB.Count_And_Get (
164: p_encoded => FND_API.G_FALSE,
282: END IF;
283:
284: -- Debug Message
285: IF OZF_DEBUG_LOW_ON THEN
286: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
287: END IF;
288:
289: -- Initialize API return status to sucess
290: x_return_status := FND_API.G_RET_STS_SUCCESS;
289: -- Initialize API return status to sucess
290: x_return_status := FND_API.G_RET_STS_SUCCESS;
291:
292: IF OZF_DEBUG_LOW_ON THEN
293: OZF_UTILITY_PVT.debug_message('inventory_item_id:' ||l_transaction_rec.inventory_item_id);
294: OZF_UTILITY_PVT.debug_message('transaction_date:' ||l_transaction_rec.transaction_date);
295: OZF_UTILITY_PVT.debug_message('quantity:' ||l_transaction_rec.quantity);
296: OZF_UTILITY_PVT.debug_message('uom_code:' ||l_transaction_rec.uom_code );
297: END IF;
290: x_return_status := FND_API.G_RET_STS_SUCCESS;
291:
292: IF OZF_DEBUG_LOW_ON THEN
293: OZF_UTILITY_PVT.debug_message('inventory_item_id:' ||l_transaction_rec.inventory_item_id);
294: OZF_UTILITY_PVT.debug_message('transaction_date:' ||l_transaction_rec.transaction_date);
295: OZF_UTILITY_PVT.debug_message('quantity:' ||l_transaction_rec.quantity);
296: OZF_UTILITY_PVT.debug_message('uom_code:' ||l_transaction_rec.uom_code );
297: END IF;
298:
291:
292: IF OZF_DEBUG_LOW_ON THEN
293: OZF_UTILITY_PVT.debug_message('inventory_item_id:' ||l_transaction_rec.inventory_item_id);
294: OZF_UTILITY_PVT.debug_message('transaction_date:' ||l_transaction_rec.transaction_date);
295: OZF_UTILITY_PVT.debug_message('quantity:' ||l_transaction_rec.quantity);
296: OZF_UTILITY_PVT.debug_message('uom_code:' ||l_transaction_rec.uom_code );
297: END IF;
298:
299: IF l_transaction_rec.inventory_item_id is null OR
292: IF OZF_DEBUG_LOW_ON THEN
293: OZF_UTILITY_PVT.debug_message('inventory_item_id:' ||l_transaction_rec.inventory_item_id);
294: OZF_UTILITY_PVT.debug_message('transaction_date:' ||l_transaction_rec.transaction_date);
295: OZF_UTILITY_PVT.debug_message('quantity:' ||l_transaction_rec.quantity);
296: OZF_UTILITY_PVT.debug_message('uom_code:' ||l_transaction_rec.uom_code );
297: END IF;
298:
299: IF l_transaction_rec.inventory_item_id is null OR
300: l_transaction_rec.transaction_date is null OR
300: l_transaction_rec.transaction_date is null OR
301: l_transaction_rec.quantity is null OR
302: l_transaction_rec.uom_code is null THEN
303:
304: OZF_UTILITY_PVT.error_message('OZF_SALES_TRANS_MISS');
305: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
306: END IF;
307:
308: -- Validate the record
333: l_transaction_rec.quantity := abs( l_transaction_rec.quantity );
334: END IF;
335:
336: IF OZF_DEBUG_LOW_ON THEN
337: ozf_utility_PVT.debug_message('start conversion');
338: END IF;
339:
340: l_transaction_rec.error_flag := 'N';
341: -- uom_code conversion
369: END IF;
370: END IF;
371: END IF;
372: IF OZF_DEBUG_LOW_ON THEN
373: ozf_utility_PVT.debug_message('primary_uom_code: '||l_transaction_rec.primary_uom_code);
374: ozf_utility_PVT.debug_message('primary_quantity: '||l_transaction_rec.primary_quantity);
375: ozf_utility_PVT.debug_message('error_flag: '||l_transaction_rec.error_flag);
376: END IF;
377: -- Second check whether uom_code = common uom_code
370: END IF;
371: END IF;
372: IF OZF_DEBUG_LOW_ON THEN
373: ozf_utility_PVT.debug_message('primary_uom_code: '||l_transaction_rec.primary_uom_code);
374: ozf_utility_PVT.debug_message('primary_quantity: '||l_transaction_rec.primary_quantity);
375: ozf_utility_PVT.debug_message('error_flag: '||l_transaction_rec.error_flag);
376: END IF;
377: -- Second check whether uom_code = common uom_code
378: -- If not convert quantity
371: END IF;
372: IF OZF_DEBUG_LOW_ON THEN
373: ozf_utility_PVT.debug_message('primary_uom_code: '||l_transaction_rec.primary_uom_code);
374: ozf_utility_PVT.debug_message('primary_quantity: '||l_transaction_rec.primary_quantity);
375: ozf_utility_PVT.debug_message('error_flag: '||l_transaction_rec.error_flag);
376: END IF;
377: -- Second check whether uom_code = common uom_code
378: -- If not convert quantity
379: IF l_transaction_rec.common_uom_code is null or l_transaction_rec.common_quantity is null THEN
401: END IF;
402: END IF;
403: END IF;
404: IF OZF_DEBUG_LOW_ON THEN
405: ozf_utility_PVT.debug_message('common_code: '||l_transaction_rec.common_uom_code);
406: ozf_utility_PVT.debug_message('common_quantity: '||l_transaction_rec.common_quantity);
407: ozf_utility_PVT.debug_message('error_flag: '||l_transaction_rec.error_flag);
408: END IF;
409:
402: END IF;
403: END IF;
404: IF OZF_DEBUG_LOW_ON THEN
405: ozf_utility_PVT.debug_message('common_code: '||l_transaction_rec.common_uom_code);
406: ozf_utility_PVT.debug_message('common_quantity: '||l_transaction_rec.common_quantity);
407: ozf_utility_PVT.debug_message('error_flag: '||l_transaction_rec.error_flag);
408: END IF;
409:
410: -- Third check whether common currency_code =
403: END IF;
404: IF OZF_DEBUG_LOW_ON THEN
405: ozf_utility_PVT.debug_message('common_code: '||l_transaction_rec.common_uom_code);
406: ozf_utility_PVT.debug_message('common_quantity: '||l_transaction_rec.common_quantity);
407: ozf_utility_PVT.debug_message('error_flag: '||l_transaction_rec.error_flag);
408: END IF;
409:
410: -- Third check whether common currency_code =
411: -- If not convert currency code
423: OPEN c_get_conversion_type(l_transaction_rec.org_id);
424: FETCH c_get_conversion_type INTO l_exchange_rate_type;
425: CLOSE c_get_conversion_type;
426: l_transaction_rec.common_currency_code := l_common_currency_code;
427: ozf_utility_pvt.Convert_Currency (
428: x_return_status => l_return_status,
429: p_from_currency => l_transaction_rec.currency_code,
430: p_to_currency => l_common_currency_code,
431: p_conv_type => l_exchange_rate_type,
438: END IF;
439: END IF;
440:
441: IF OZF_DEBUG_LOW_ON THEN
442: ozf_utility_PVT.debug_message('common_currency_code: '||l_transaction_rec.common_currency_code);
443: ozf_utility_PVT.debug_message('common_amount: '||l_transaction_rec.common_amount);
444: ozf_utility_PVT.debug_message('error_flag: '||l_transaction_rec.error_flag);
445: END IF;
446:
439: END IF;
440:
441: IF OZF_DEBUG_LOW_ON THEN
442: ozf_utility_PVT.debug_message('common_currency_code: '||l_transaction_rec.common_currency_code);
443: ozf_utility_PVT.debug_message('common_amount: '||l_transaction_rec.common_amount);
444: ozf_utility_PVT.debug_message('error_flag: '||l_transaction_rec.error_flag);
445: END IF;
446:
447: --fix for bug 6808124
440:
441: IF OZF_DEBUG_LOW_ON THEN
442: ozf_utility_PVT.debug_message('common_currency_code: '||l_transaction_rec.common_currency_code);
443: ozf_utility_PVT.debug_message('common_amount: '||l_transaction_rec.common_amount);
444: ozf_utility_PVT.debug_message('error_flag: '||l_transaction_rec.error_flag);
445: END IF;
446:
447: --fix for bug 6808124
448: OPEN sales_transation_csr(l_transaction_rec.LINE_ID,l_transaction_rec.source_code);
573: );
574:
575: x_sales_transaction_id := l_sales_transaction_id;
576: IF OZF_DEBUG_LOW_ON THEN
577: ozf_utility_PVT.debug_message('insert done' || l_sales_transaction_id);
578: END IF;
579:
580: END IF; --IF NVL(l_sales_trans,0) <> 1 THEN
581:
601:
602:
603: -- Debug Message
604: IF OZF_DEBUG_LOW_ON THEN
605: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
606: END IF;
607: --Standard call to get message count and if count=1, get the message
608: FND_MSG_PUB.Count_And_Get (
609: p_encoded => FND_API.G_FALSE,
702: END IF;
703:
704: -- Debug Message
705: IF OZF_DEBUG_LOW_ON THEN
706: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
707: END IF;
708:
709: -- Initialize API return status to sucess
710: x_return_status := FND_API.G_RET_STS_SUCCESS;
915: IF OZF_DEBUG_LOW_ON THEN
916: SELECT SUM(primary_quantity)
917: INTO l_total_primary_quantity
918: FROM ozf_inventory_tmp_t;
919: OZF_UTILITY_PVT.debug_message(l_full_name||' : total_primary_quantity = '||l_total_primary_quantity);
920:
921: OZF_UTILITY_PVT.debug_message('----------Inventory Detail----------');
922: FOR l_inventory_detl IN c_inventory_detl LOOP
923: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
917: INTO l_total_primary_quantity
918: FROM ozf_inventory_tmp_t;
919: OZF_UTILITY_PVT.debug_message(l_full_name||' : total_primary_quantity = '||l_total_primary_quantity);
920:
921: OZF_UTILITY_PVT.debug_message('----------Inventory Detail----------');
922: FOR l_inventory_detl IN c_inventory_detl LOOP
923: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
924: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
925: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
919: OZF_UTILITY_PVT.debug_message(l_full_name||' : total_primary_quantity = '||l_total_primary_quantity);
920:
921: OZF_UTILITY_PVT.debug_message('----------Inventory Detail----------');
922: FOR l_inventory_detl IN c_inventory_detl LOOP
923: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
924: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
925: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
926: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
927: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
920:
921: OZF_UTILITY_PVT.debug_message('----------Inventory Detail----------');
922: FOR l_inventory_detl IN c_inventory_detl LOOP
923: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
924: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
925: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
926: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
927: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
928: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
921: OZF_UTILITY_PVT.debug_message('----------Inventory Detail----------');
922: FOR l_inventory_detl IN c_inventory_detl LOOP
923: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
924: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
925: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
926: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
927: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
928: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
929: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
922: FOR l_inventory_detl IN c_inventory_detl LOOP
923: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
924: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
925: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
926: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
927: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
928: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
929: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
930: END LOOP;
923: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
924: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
925: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
926: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
927: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
928: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
929: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
930: END LOOP;
931: OZF_UTILITY_PVT.debug_message('------------------------------');
924: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
925: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
926: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
927: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
928: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
929: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
930: END LOOP;
931: OZF_UTILITY_PVT.debug_message('------------------------------');
932: END IF;
925: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
926: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
927: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
928: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
929: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
930: END LOOP;
931: OZF_UTILITY_PVT.debug_message('------------------------------');
932: END IF;
933: -- 6511302 (-)
927: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
928: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
929: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
930: END LOOP;
931: OZF_UTILITY_PVT.debug_message('------------------------------');
932: END IF;
933: -- 6511302 (-)
934:
935: -- Debug Message
933: -- 6511302 (-)
934:
935: -- Debug Message
936: IF OZF_DEBUG_LOW_ON THEN
937: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
938: END IF;
939: --Standard call to get message count and if count=1, get the message
940: FND_MSG_PUB.Count_And_Get (
941: p_encoded => FND_API.G_FALSE,
1032: END IF;
1033:
1034: -- Debug Message
1035: IF OZF_DEBUG_LOW_ON THEN
1036: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
1037: END IF;
1038:
1039: -- Initialize API return status to sucess
1040: x_return_status := FND_API.G_RET_STS_SUCCESS;
1043: FETCH transaction_info_csr into l_primary_quantity, l_inventory_item_id, l_party_id;
1044: CLOSE transaction_info_csr;
1045:
1046: IF OZF_DEBUG_LOW_ON THEN
1047: ozf_utility_PVT.debug_message('primary_quantity:' || l_primary_quantity);
1048: ozf_utility_PVT.debug_message('inventory_item_id:' || l_inventory_item_id);
1049: ozf_utility_PVT.debug_message('party_id:' || l_party_id);
1050: END IF;
1051:
1044: CLOSE transaction_info_csr;
1045:
1046: IF OZF_DEBUG_LOW_ON THEN
1047: ozf_utility_PVT.debug_message('primary_quantity:' || l_primary_quantity);
1048: ozf_utility_PVT.debug_message('inventory_item_id:' || l_inventory_item_id);
1049: ozf_utility_PVT.debug_message('party_id:' || l_party_id);
1050: END IF;
1051:
1052: update ozf_inventory_tmp_t
1045:
1046: IF OZF_DEBUG_LOW_ON THEN
1047: ozf_utility_PVT.debug_message('primary_quantity:' || l_primary_quantity);
1048: ozf_utility_PVT.debug_message('inventory_item_id:' || l_inventory_item_id);
1049: ozf_utility_PVT.debug_message('party_id:' || l_party_id);
1050: END IF;
1051:
1052: update ozf_inventory_tmp_t
1053: set primary_quantity = primary_quantity - l_primary_quantity
1055: and inventory_item_id = l_inventory_item_id;
1056:
1057: -- Debug Message
1058: IF OZF_DEBUG_LOW_ON THEN
1059: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
1060: END IF;
1061: --Standard call to get message count and if count=1, get the message
1062: FND_MSG_PUB.Count_And_Get (
1063: p_encoded => FND_API.G_FALSE,
1196: END IF;
1197:
1198: -- Debug Message
1199: IF OZF_DEBUG_LOW_ON THEN
1200: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
1201: END IF;
1202:
1203: -- Initialize API return status to sucess
1204: x_return_status := FND_API.G_RET_STS_SUCCESS;
1281: END IF;
1282:
1283: -- 6511302 (+)
1284: IF OZF_DEBUG_LOW_ON THEN
1285: OZF_UTILITY_PVT.debug_message(l_full_name || ':order number = '||p_line_int_rec.order_number);
1286: OZF_UTILITY_PVT.debug_message(l_full_name || ':transfer type = '||l_transfer_type);
1287: OZF_UTILITY_PVT.debug_message(l_full_name || ':l_primary_quantity = '||l_primary_quantity);
1288: OZF_UTILITY_PVT.debug_message(l_full_name || ':actual line quantity = '||l_converted_quantity);
1289: OZF_UTILITY_PVT.debug_message(l_full_name || ':abs(line quantity) = '||ABS(l_converted_quantity));
1282:
1283: -- 6511302 (+)
1284: IF OZF_DEBUG_LOW_ON THEN
1285: OZF_UTILITY_PVT.debug_message(l_full_name || ':order number = '||p_line_int_rec.order_number);
1286: OZF_UTILITY_PVT.debug_message(l_full_name || ':transfer type = '||l_transfer_type);
1287: OZF_UTILITY_PVT.debug_message(l_full_name || ':l_primary_quantity = '||l_primary_quantity);
1288: OZF_UTILITY_PVT.debug_message(l_full_name || ':actual line quantity = '||l_converted_quantity);
1289: OZF_UTILITY_PVT.debug_message(l_full_name || ':abs(line quantity) = '||ABS(l_converted_quantity));
1290: OZF_UTILITY_PVT.debug_message(l_full_name || ':item id = ' || p_line_int_rec.inventory_item_id);
1283: -- 6511302 (+)
1284: IF OZF_DEBUG_LOW_ON THEN
1285: OZF_UTILITY_PVT.debug_message(l_full_name || ':order number = '||p_line_int_rec.order_number);
1286: OZF_UTILITY_PVT.debug_message(l_full_name || ':transfer type = '||l_transfer_type);
1287: OZF_UTILITY_PVT.debug_message(l_full_name || ':l_primary_quantity = '||l_primary_quantity);
1288: OZF_UTILITY_PVT.debug_message(l_full_name || ':actual line quantity = '||l_converted_quantity);
1289: OZF_UTILITY_PVT.debug_message(l_full_name || ':abs(line quantity) = '||ABS(l_converted_quantity));
1290: OZF_UTILITY_PVT.debug_message(l_full_name || ':item id = ' || p_line_int_rec.inventory_item_id);
1291: OZF_UTILITY_PVT.debug_message(l_full_name || ':sold_from_party_id = ' || l_sold_from_party_id);
1284: IF OZF_DEBUG_LOW_ON THEN
1285: OZF_UTILITY_PVT.debug_message(l_full_name || ':order number = '||p_line_int_rec.order_number);
1286: OZF_UTILITY_PVT.debug_message(l_full_name || ':transfer type = '||l_transfer_type);
1287: OZF_UTILITY_PVT.debug_message(l_full_name || ':l_primary_quantity = '||l_primary_quantity);
1288: OZF_UTILITY_PVT.debug_message(l_full_name || ':actual line quantity = '||l_converted_quantity);
1289: OZF_UTILITY_PVT.debug_message(l_full_name || ':abs(line quantity) = '||ABS(l_converted_quantity));
1290: OZF_UTILITY_PVT.debug_message(l_full_name || ':item id = ' || p_line_int_rec.inventory_item_id);
1291: OZF_UTILITY_PVT.debug_message(l_full_name || ':sold_from_party_id = ' || l_sold_from_party_id);
1292: END IF;
1285: OZF_UTILITY_PVT.debug_message(l_full_name || ':order number = '||p_line_int_rec.order_number);
1286: OZF_UTILITY_PVT.debug_message(l_full_name || ':transfer type = '||l_transfer_type);
1287: OZF_UTILITY_PVT.debug_message(l_full_name || ':l_primary_quantity = '||l_primary_quantity);
1288: OZF_UTILITY_PVT.debug_message(l_full_name || ':actual line quantity = '||l_converted_quantity);
1289: OZF_UTILITY_PVT.debug_message(l_full_name || ':abs(line quantity) = '||ABS(l_converted_quantity));
1290: OZF_UTILITY_PVT.debug_message(l_full_name || ':item id = ' || p_line_int_rec.inventory_item_id);
1291: OZF_UTILITY_PVT.debug_message(l_full_name || ':sold_from_party_id = ' || l_sold_from_party_id);
1292: END IF;
1293: -- 6511302 (-)
1286: OZF_UTILITY_PVT.debug_message(l_full_name || ':transfer type = '||l_transfer_type);
1287: OZF_UTILITY_PVT.debug_message(l_full_name || ':l_primary_quantity = '||l_primary_quantity);
1288: OZF_UTILITY_PVT.debug_message(l_full_name || ':actual line quantity = '||l_converted_quantity);
1289: OZF_UTILITY_PVT.debug_message(l_full_name || ':abs(line quantity) = '||ABS(l_converted_quantity));
1290: OZF_UTILITY_PVT.debug_message(l_full_name || ':item id = ' || p_line_int_rec.inventory_item_id);
1291: OZF_UTILITY_PVT.debug_message(l_full_name || ':sold_from_party_id = ' || l_sold_from_party_id);
1292: END IF;
1293: -- 6511302 (-)
1294:
1287: OZF_UTILITY_PVT.debug_message(l_full_name || ':l_primary_quantity = '||l_primary_quantity);
1288: OZF_UTILITY_PVT.debug_message(l_full_name || ':actual line quantity = '||l_converted_quantity);
1289: OZF_UTILITY_PVT.debug_message(l_full_name || ':abs(line quantity) = '||ABS(l_converted_quantity));
1290: OZF_UTILITY_PVT.debug_message(l_full_name || ':item id = ' || p_line_int_rec.inventory_item_id);
1291: OZF_UTILITY_PVT.debug_message(l_full_name || ':sold_from_party_id = ' || l_sold_from_party_id);
1292: END IF;
1293: -- 6511302 (-)
1294:
1295: INSERT INTO ozf_inventory_tmp_t(
1324: -- Bug 4380203 (-)
1325:
1326: -- 6511302 (+)
1327: IF OZF_DEBUG_LOW_ON THEN
1328: OZF_UTILITY_PVT.debug_message('----------Inventory Detail----------');
1329: FOR l_inventory_detl IN c_inventory_detl LOOP
1330: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
1331: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
1332: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
1326: -- 6511302 (+)
1327: IF OZF_DEBUG_LOW_ON THEN
1328: OZF_UTILITY_PVT.debug_message('----------Inventory Detail----------');
1329: FOR l_inventory_detl IN c_inventory_detl LOOP
1330: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
1331: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
1332: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
1333: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
1334: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
1327: IF OZF_DEBUG_LOW_ON THEN
1328: OZF_UTILITY_PVT.debug_message('----------Inventory Detail----------');
1329: FOR l_inventory_detl IN c_inventory_detl LOOP
1330: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
1331: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
1332: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
1333: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
1334: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
1335: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
1328: OZF_UTILITY_PVT.debug_message('----------Inventory Detail----------');
1329: FOR l_inventory_detl IN c_inventory_detl LOOP
1330: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
1331: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
1332: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
1333: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
1334: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
1335: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
1336: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
1329: FOR l_inventory_detl IN c_inventory_detl LOOP
1330: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
1331: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
1332: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
1333: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
1334: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
1335: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
1336: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
1337: END LOOP;
1330: OZF_UTILITY_PVT.debug_message('party_id = ' || l_inventory_detl.party_id);
1331: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
1332: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
1333: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
1334: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
1335: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
1336: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
1337: END LOOP;
1338: OZF_UTILITY_PVT.debug_message('------------------------------');
1331: OZF_UTILITY_PVT.debug_message('inventory_item_id = ' || l_inventory_detl.inventory_item_id);
1332: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
1333: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
1334: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
1335: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
1336: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
1337: END LOOP;
1338: OZF_UTILITY_PVT.debug_message('------------------------------');
1339: END IF;
1332: OZF_UTILITY_PVT.debug_message('primary_uom_code = ' || l_inventory_detl.primary_uom_code);
1333: OZF_UTILITY_PVT.debug_message('primary_quantity = ' || l_inventory_detl.primary_quantity);
1334: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
1335: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
1336: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
1337: END LOOP;
1338: OZF_UTILITY_PVT.debug_message('------------------------------');
1339: END IF;
1340: -- 6511302 (-)
1334: OZF_UTILITY_PVT.debug_message('cust_account_id = ' || l_inventory_detl.cust_account_id);
1335: OZF_UTILITY_PVT.debug_message('transfer_type = ' || l_inventory_detl.transfer_type);
1336: OZF_UTILITY_PVT.debug_message('- - - - - - - - - -');
1337: END LOOP;
1338: OZF_UTILITY_PVT.debug_message('------------------------------');
1339: END IF;
1340: -- 6511302 (-)
1341:
1342: -- Debug Message
1340: -- 6511302 (-)
1341:
1342: -- Debug Message
1343: IF OZF_DEBUG_LOW_ON THEN
1344: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
1345: END IF;
1346: --Standard call to get message count and if count=1, get the message
1347: FND_MSG_PUB.Count_And_Get (
1348: p_encoded => FND_API.G_FALSE,
1480: END IF;
1481:
1482: -- Debug Message
1483: IF OZF_DEBUG_LOW_ON THEN
1484: OZF_UTILITY_PVT.debug_message(l_full_name||': Start');
1485: END IF;
1486:
1487: -- Initialize API return status to sucess
1488: x_return_status := FND_API.G_RET_STS_SUCCESS;
1499: CLOSE sales_order_info_csr;
1500:
1501: IF l_transaction_id_tbl.exists(1) THEN
1502: IF OZF_DEBUG_LOW_ON THEN
1503: OZF_UTILITY_PVT.debug_message('Number of OM lines: ' || l_transaction_id_tbl.LAST);
1504: END IF;
1505:
1506: -- First check whether p_uom_code is the same as the primary_uom_code.
1507: -- If not, conver the quentity
1540: l_used_unit_price_tbl(i) := l_unit_price_tbl(i);
1541: ELSE
1542: -- ?? What exchange type to use ?
1543: -- We will convert it to the asking currency code at the date of transfer.
1544: OZF_UTILITY_PVT.Convert_Currency(
1545: p_from_currency => l_currency_code_tbl(i)
1546: ,p_to_currency => p_currency_code
1547: ,p_conv_type => l_default_exchange_type
1548: ,p_conv_rate => l_rate
1583: p_x_purchase_uom_code,
1584: null,
1585: null
1586: );
1587: x_purchase_price := OZF_UTILITY_PVT.CurrRound(
1588: (x_purchase_price * l_uom_ratio)
1589: , p_currency_code
1590: );
1591: END IF;
1599: END IF;
1600:
1601: -- Debug Message
1602: IF OZF_DEBUG_LOW_ON THEN
1603: OZF_UTILITY_PVT.debug_message(l_full_name||': End');
1604: END IF;
1605: --Standard call to get message count and if count=1, get the message
1606: FND_MSG_PUB.Count_And_Get (
1607: p_encoded => FND_API.G_FALSE,