105: -- Only if both are zero should it error out
106:
107: if( l_trolin_tbl.count = 0 AND l_mold_tbl.count = 0) then
108:
109: FND_MESSAGE.SET_NAME('INV', 'INV_NO_LINES_TO_PICK_CONFIRM');
110: FND_MSG_PUB.add;
111: l_return_status := FND_API.G_RET_STS_ERROR;
112: raise FND_API.G_EXC_ERROR;
113: end if;
142: TraceLog(to_char(i) || ' ' || l_trolin_rec.line_id || ' l_qty_detailed = ' || l_qty_detailed, 'Pick_Confirm');
143: TraceLog(to_char(i) || ' ' || l_trolin_rec.line_id || ' l_qty_delivered = ' || l_qty_delivered, 'Pick_Confirm');
144: END IF;
145: if( L_qty_detailed = l_qty_delivered OR l_qty_detailed = 0 ) then
146: FND_MESSAGE.SET_NAME('INV', 'INV_PICK_QTY_ERROR');
147: FND_MSG_PUB.ADD;
148: --rollback to TO_TRX_LINE_SAVE;
149: --raise FND_API.G_EXC_ERROR;
150: else
174: IF p_transaction_date IS NOT NULL THEN
175: TraceLog('p_transaction_date: '||p_transaction_date, 'Pick_confirm');
176: IF p_transaction_date > sysdate THEN
177: TraceLog('Error: Transaction date cannot be a future date', 'Pick_confirm');
178: FND_MESSAGE.SET_NAME('INV', 'INV_INT_TDATEEX');
179: FND_MSG_PUB.add;
180: raise FND_API.G_EXC_ERROR;
181: END IF;
182: l_mold_tbl(j).transaction_date := p_transaction_date;
194:
195:
196: TraceLog('l_period_id: '||l_period_id, 'Pick_confirm');
197: IF (l_period_id = -1 or l_period_id = 0) THEN
198: FND_MESSAGE.SET_NAME('INV', 'INV_NO_OPEN_PERIOD');
199: FND_MSG_PUB.add;
200: l_return_status := FND_API.G_RET_STS_ERROR;
201: raise FND_API.G_EXC_ERROR;
202: END IF;
223: IF (l_debug = 1) THEN
224: TraceLog('after update transaction_status = 3', 'Pick_Confirm');
225: END IF;
226: if( l_return_status = FND_API.G_RET_STS_ERROR ) then
227: fnd_message.set_name('INV', 'INV_COULD_NOT_UPATE_RECORD');
228: fnd_msg_pub.add;
229: IF (l_debug = 1) THEN
230: TraceLog('error in update mold', 'Pick_Confirm');
231: END IF;
234: elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
235: IF (l_debug = 1) THEN
236: TraceLog('error in update mold', 'Pick_Confirm');
237: END IF;
238: fnd_message.set_name('INV', 'INV_COULD_NOT_UPATE_RECORD');
239: fnd_msg_pub.add;
240: rollback to TO_TRX_LINE_SAVE;
241: raise FND_API.G_EXC_UNEXPECTED_ERROR;
242: end if;
285:
286: l_qty_detailed := l_trolin_tbl(1).quantity_detailed;
287: l_qtY_delivered := l_trolin_tbl(1).quantity_delivered;
288: if( l_qty_detailed = l_qty_delivered OR l_qty_detailed = 0 ) then
289: FND_MESSAGE.SET_NAME('INV', 'INV_PICK_QTY_ERROR');
290: FND_MSG_PUB.ADD;
291: rollback to TO_TRX_LINE_SAVE;
292: raise FND_API.G_EXC_ERROR;
293: end if;
306: IF p_transaction_date IS NOT NULL THEN
307: TraceLog('p_transaction_date: '||p_transaction_date, 'Pick_confirm');
308: IF p_transaction_date > sysdate THEN
309: TraceLog('Error: Transaction date cannot be a future date', 'Pick_confirm');
310: FND_MESSAGE.SET_NAME('INV', 'INV_INT_TDATEEX');
311: FND_MSG_PUB.add;
312: raise FND_API.G_EXC_ERROR;
313: END IF;
314: l_mold_tbl(j).transaction_date := p_transaction_date;
324: open_past_period => l_open_past_period);
325:
326: TraceLog('l_period_id: '||l_period_id, 'Pick_confirm');
327: IF (l_period_id = -1 or l_period_id = 0) THEN
328: FND_MESSAGE.SET_NAME('INV', 'INV_NO_OPEN_PERIOD');
329: FND_MSG_PUB.add;
330: l_return_status := FND_API.G_RET_STS_ERROR;
331: raise FND_API.G_EXC_ERROR;
332: END IF;
343: if( l_return_status = FND_API.G_RET_STS_ERROR ) then
344: IF (l_debug = 1) THEN
345: TraceLog('error in update mold', 'Pick_Confirm');
346: END IF;
347: fnd_message.set_name('INV', 'INV_COULD_NOT_UPATE_RECORD');
348: fnd_msg_pub.add;
349: rollback to TO_TRX_LINE_SAVE;
350: raise FND_API.G_EXC_ERROR;
351: elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
351: elsif l_return_status = FND_API.G_RET_STS_UNEXP_ERROR then
352: IF (l_debug = 1) THEN
353: TraceLog('error in update mold', 'Pick_Confirm');
354: END IF;
355: fnd_message.set_name('INV', 'INV_COULD_NOT_UPATE_RECORD');
356: fnd_msg_pub.add;
357: rollback to TO_TRX_LINE_SAVE;
358: raise FND_API.G_EXC_UNEXPECTED_ERROR;
359: end if;
403: IF (l_debug = 1) THEN
404: TraceLog('lot success= -1', 'Pick_Confirm');
405: END IF;
406: rollback to TO_TRX_LINE_SAVE;
407: FND_Message.Set_Name('INV','INV_ORPHAN_CLEANUP_ERROR');
408: FND_MSG_PUB.add;
409: raise FND_API.G_EXC_ERROR;
410: ELSIF ( lot_success = '-2' ) THEN
411: IF (l_debug = 1) THEN
411: IF (l_debug = 1) THEN
412: TraceLog('lot success= -2', 'Pick_Confirm');
413: END IF;
414: rollback to TO_TRX_LINE_SAVE;
415: FND_Message.Set_Name('INV', 'INV_LOTNULL_ERROR');
416: FND_MSG_PUB.add;
417: raise FND_API.G_EXC_ERROR;
418: ELSIF ( lot_success = '-3' ) THEN
419: IF (l_debug = 1) THEN
419: IF (l_debug = 1) THEN
420: TraceLog('lot success= -3', 'Pick_Confirm');
421: END IF;
422: rollback to TO_TRX_LINE_SAVE;
423: FND_Message.Set_Name('INV', 'INV_LOTCOPY_ERROR');
424: FND_MSG_PUB.add;
425: raise FND_API.G_EXC_ERROR;
426: ELSIF ( lot_success = '-4' ) THEN
427: IF (l_debug = 1) THEN
427: IF (l_debug = 1) THEN
428: TraceLog('lot success= -4', 'Pick_Confirm');
429: END IF;
430: rollback to TO_TRX_LINE_SAVE;
431: FND_Message.Set_Name('INV', 'INV_DYNAMIC_SERIAL_ERROR');
432: FND_MSG_PUB.Add;
433: raise FND_API.G_EXC_ERROR;
434: END IF;
435:
478: IF (l_debug = 1) THEN
479: TraceLog('l_rc_field = ' || l_rc_field);
480: END IF;
481: END IF;
482: FND_MESSAGE.SET_NAME('INV', 'INV_TM_TIME_OUT');
483: FND_MSG_PUB.ADD;
484: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
485: raise FND_API.G_EXC_UNEXPECTED_ERROR;
486: elsif l_rc_field = 2 then
488: IF (l_debug = 1) THEN
489: TraceLog('l_rc_field = ' || l_rc_field);
490: END IF;
491: END IF;
492: FND_MESSAGE.SET_NAME('INV', 'INV_TM_MGR_NOT_AVAIL');
493: FND_MSG_PUB.ADD;
494: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
495: raise fnd_api.G_EXC_UNEXPECTED_ERROR;
496: elsif l_rc_field <> 0 then
529: TraceLog('Error from INV_TM launch', 'Pick_Confirm');
530: --rollback to TO_TRX_LINE_SAVE;
531: /*if( l_rc_field = 1) then
532: TraceLog('l_rc_field = ' || l_rc_field);
533: FND_MESSAGE.SET_NAME('INV', 'INV_TM_TIME_OUT');
534: FND_MSG_PUB.ADD;
535: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
536: raise FND_API.G_EXC_UNEXPECTED_ERROR;
537: elsif l_rc_field = 2 then
535: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
536: raise FND_API.G_EXC_UNEXPECTED_ERROR;
537: elsif l_rc_field = 2 then
538: TraceLog('l_rc_field = ' || l_rc_field);
539: FND_MESSAGE.SET_NAME('INV', 'INV_TM_MGR_NOT_AVAIL');
540: FND_MSG_PUB.ADD;
541: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
542: raise fnd_api.G_EXC_UNEXPECTED_ERROR;
543: elsif l_rc_field <> 0 then
607: WHEN OTHERS then
608: -- TraceLog('error in cleanup orphan lot serial');
609: x_return_status := FND_API.G_RET_STS_ERROR;
610: rollback to TO_TRX_LINE_SAVE;
611: FND_MESSAGE.SET_NAME('INV', 'INV_ORPHAN_CLEANUP_ERROR');
612: FND_MSG_PUB.ADD;
613: END;
614: if( p_commit = FND_API.G_TRUE ) then
615: commit;
715: IF (l_debug = 1) THEN
716: TraceLog('INV_TM_TIMEOUT', 'INV_TM_LAUNCH');
717: END IF;
718: END IF;
719: fnd_message.set_name('INV', 'INV_TM_TIME_OUT');
720: fnd_msg_pub.add;
721: RETURN (FALSE);
722: ELSIF rtvl = 2 THEN
723: IF (l_debug = 1) THEN
724: IF (l_debug = 1) THEN
725: TraceLog('INV_TM_MGR_NOT_AVAIL', 'INV_TM_LAUNCH');
726: END IF;
727: END IF;
728: fnd_message.set_name('INV', 'INV_TM_MGR_NOT_AVAIL');
729: fnd_msg_pub.add;
730: RETURN (FALSE);
731: ELSIF rtvl = 3 THEN
732: IF (l_debug = 1) THEN
733: IF (l_debug = 1) THEN
734: TraceLog('CONC-DG-Inactive No Manager', 'INV_TM_LAUNCH');
735: END IF;
736: END IF;
737: fnd_message.set_name('FND','CONC-DG-Inactive No Manager');
738: fnd_msg_pub.add;
739: RETURN(FALSE);
740: ELSIF rtvl = 0 THEN
741: -- get info back from server and handle problems