102: Initialization of variable l_max_line_num is made conditional.
103: This is done to ensure that line number is incremented properly.
104: The process to increment line number is this:
105: When called by FORM
106: Form will increate the line number (global variable -INV_Globals.g_max_line_num)
107: by calling the inv_trnasfer_order_pvt.increment_max_line_number.
108: This ensure that when user goes from one line to another it does not
109: increase line number unnecessarily.
110:
118: --
119: G_CALLED_BY_FORM := 'N';
120:
121: else
122: l_max_line_num := NVL(INV_Globals.g_max_line_num, 0);
123: end if;
124:
125:
126: /* inv_debug.message('In Get Line Num for header id:'||to_char(g_trolin_rec.header_id)); */
133: INV_default_Trohdr.Load_Request_header(g_trolin_rec.header_id );
134: */
135:
136:
137: If INV_Globals.g_max_line_num is null
138: or g_max_line_num_header_id <> g_trolin_rec.header_id
139: Then
140:
141: SELECT nvl(max(line_number), 0)
144: WHERE header_id = g_trolin_rec.header_id;
145:
146:
147: g_max_line_num_header_id := g_trolin_rec.header_id;
148: INV_Globals.g_max_line_num := l_max_line_num + 1;
149:
150: End If;
151:
152: IF (l_max_line_num >= nvl(INV_Globals.g_max_line_num,0)) THEN
148: INV_Globals.g_max_line_num := l_max_line_num + 1;
149:
150: End If;
151:
152: IF (l_max_line_num >= nvl(INV_Globals.g_max_line_num,0)) THEN
153:
154: INV_Globals.g_max_line_num := 1 + l_max_line_num;
155:
156: END IF;
150: End If;
151:
152: IF (l_max_line_num >= nvl(INV_Globals.g_max_line_num,0)) THEN
153:
154: INV_Globals.g_max_line_num := 1 + l_max_line_num;
155:
156: END IF;
157:
158: /* inv_debug.message('D:'||to_char(INV_GLOBALS.g_max_line_num)); */
154: INV_Globals.g_max_line_num := 1 + l_max_line_num;
155:
156: END IF;
157:
158: /* inv_debug.message('D:'||to_char(INV_GLOBALS.g_max_line_num)); */
159: return INV_Globals.g_max_line_num;
160: end if;
161: /* inv_debug.message('Returning null'); */
162: return null;
155:
156: END IF;
157:
158: /* inv_debug.message('D:'||to_char(INV_GLOBALS.g_max_line_num)); */
159: return INV_Globals.g_max_line_num;
160: end if;
161: /* inv_debug.message('Returning null'); */
162: return null;
163: END Get_Line_Number;
165: FUNCTION Get_Line_Status
166: RETURN NUMBER
167: IS
168: BEGIN
169: IF INV_globals.G_CALL_MODE = 'FORM'
170: THEN
171: RETURN 1; /* Incomplete Status */
172: ELSE
173: RETURN 7; /* PRE-APPROVED */
187: RETURN NUMBER
188: IS
189: BEGIN
190:
191: RETURN Inv_globals.g_org_id;
192:
193: END Get_Organization;
194:
195: FUNCTION Get_Project
398: FUNCTION Get_To_Organization_Id
399: RETURN NUMBER
400: IS
401: BEGIN
402: Return Inv_globals.g_org_id;
403: END Get_To_Organization_Id;
404:
405:
406: FUNCTION Get_Primary_Quantity
689:
690: BEGIN
691: -- Check number of iterations.
692:
693: IF p_iteration > INV_GLOBALS.G_MAX_DEF_ITERATIONS THEN
694:
695: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
696: THEN
697:
710:
711: -- Default missing attributes.
712:
713: -- Changes for bug 6441724
714: IF (g_trolin_rec.operation = inv_globals.g_opr_create)
715: AND (g_trolin_rec.project_id = FND_API.G_MISS_NUM )
716: AND (g_trolin_rec.to_locator_id IS NOT NULL)
717: AND (g_trolin_rec.to_locator_id <> FND_API.G_MISS_NUM)
718: THEN
970: SELECT move_order_type INTO l_mov_order_type
971: FROM mtl_txn_request_headers
972: WHERE header_id=g_trolin_rec.header_id;
973:
974: IF l_mov_order_type=INV_GLOBALS.g_move_order_put_away
975: THEN
976:
977: IF INV_Validate.Lot_Number(l_lot, l_org, l_item) = inv_validate.T THEN
978: INV_Trolin_Util.Clear_Dependent_Attr