DBA Data[Home] [Help]

PACKAGE BODY: APPS.WIP_OPERATIONS_PKG

Source


1 PACKAGE BODY WIP_OPERATIONS_PKG AS
2 /* $Header: wipoperb.pls 120.0.12010000.5 2008/11/19 09:41:14 sisankar ship $ */
3 
4   procedure add(
5     p_org_id            in number,
6     p_wip_entity_id     in number,
7     p_operation_seq_num in number,
8     p_operation_id      in number,
9     p_department_id     in number) is
10     x_prev_op_seq_num   number  := NULL;
11     x_next_op_seq_num   number  := NULL;
12     x_user_id           number  := FND_GLOBAL.USER_ID;
13     x_login_id          number  := FND_GLOBAL.LOGIN_ID;
14     x_request_id 	number  := FND_GLOBAL.CONC_REQUEST_ID;
15     x_appl_id    	number  := FND_GLOBAL.PROG_APPL_ID;
16     x_program_id 	number  := FND_GLOBAL.CONC_PROGRAM_ID;
17     adding_standard_op  boolean := (p_operation_id is NOT NULL
18                                     or
19                                     p_operation_id = -1);
20     l_scrap_qty         number  := 0;
21     /* Added : -- bug 7371859     */
22     -- for validating sub resource exiting or not for std operation
23     sub_res_count number;
24     l_wsor_max_res_seq_num number :=0;
25    /* End : -- bug 7371859 */
26   begin
27     --  get previous and next operation
28     select max(wo1.operation_seq_num),
29            min(wo2.operation_seq_num)
30     into   x_prev_op_seq_num,
31            x_next_op_seq_num
32     from   dual sd,
33            wip_operations wo1,
34            wip_operations wo2
35     where  wo1.organization_id(+) = p_org_id
36     and    wo1.wip_entity_id(+) = decode(1, 1, p_wip_entity_id, sd.dummy)
37     and    wo1.operation_seq_num(+) < p_operation_seq_num
38     and    wo2.organization_id(+) = p_org_id
39     and    wo2.wip_entity_id(+) = decode(1, 1, p_wip_entity_id, sd.dummy)
40     and    wo2.operation_seq_num(+) > p_operation_seq_num;
41 
42      /* For Enhancement#2864382. Calculate cumulative_scrap_quantity for this operation */
43 
44                 SELECT SUM(quantity_scrapped)
45                   INTO l_scrap_qty
46                   FROM wip_operations
47                  WHERE organization_id         =  p_org_id
48                    AND wip_entity_id           =  p_wip_entity_id
49                    AND operation_seq_num       <  p_operation_seq_num;
50 
51                 IF (l_scrap_qty IS NULL) THEN
52                     l_scrap_qty :=0;
53                 END IF;
54 
55     -- if prev operation exists in routing
56     if (x_prev_op_seq_num is NOT NULL) then
57       update wip_operations
58       set    next_operation_seq_num = p_operation_seq_num
59       where  organization_id = p_org_id
60       and    wip_entity_id = p_wip_entity_id
61       and    operation_seq_num = x_prev_op_seq_num;
62     end if;
63 
64     -- if next operation exists in routing
65     if (x_next_op_seq_num is NOT NULL) then
66       update wip_operations
67       set    previous_operation_seq_num = p_operation_seq_num
68       where  organization_id = p_org_id
69       and    wip_entity_id = p_wip_entity_id
70       and    operation_seq_num = x_next_op_seq_num;
71     end if;
72 
73     -- add operation
74     begin
75       insert into wip_operations(
76              wip_entity_id,
77              operation_seq_num,
78              organization_id,
79              last_update_date,
80              last_updated_by,
81              creation_date,
82              created_by,
83              last_update_login,
84              standard_operation_id,
85              department_id,
86              scheduled_quantity,
87              quantity_in_queue,
88              quantity_running,
89              quantity_waiting_to_move,
90              quantity_rejected,
91              quantity_scrapped,
92              quantity_completed,
93              cumulative_scrap_quantity,  /* for enh#2864382*/
94              minimum_transfer_quantity,
95              first_unit_start_date,
96              first_unit_completion_date,
97              last_unit_start_date,
98              last_unit_completion_date,
99              previous_operation_seq_num,
100              next_operation_seq_num,
101              count_point_type,
102              backflush_flag,
103              description,
104              attribute_category,
105              attribute1,
106              attribute2,
107              attribute3,
108              attribute4,
109              attribute5,
110              attribute6,
111              attribute7,
112              attribute8,
113              attribute9,
114              attribute10,
115              attribute11,
116              attribute12,
117              attribute13,
118              attribute14,
119              attribute15,
120 													check_skill)
121       select p_wip_entity_id,
122              p_operation_seq_num,
123              p_org_id,
124              SYSDATE,
125              x_user_id,
126              SYSDATE,
127              x_user_id,
128              x_login_id,
129              decode(p_operation_id, -1, NULL, p_operation_id),
130              p_department_id,
131              WDJ.START_QUANTITY,
132              0, -- quantity_in_queue
133              0, -- quantity_running
134              0, -- quantity_waiting_to_move
135              0, -- quantity_rejected
136              0, -- quantity_in_scrap
137              0, -- quantity_completed
138              l_scrap_qty,
139              nvl(bso.minimum_transfer_quantity, 0),
140              nvl(wo1.first_unit_completion_date, -- first_unit_start_date
141                  wdj.scheduled_start_date),
142              nvl(wo1.first_unit_completion_date, -- first_unit_completion_date
143                  wdj.scheduled_start_date),
144              nvl(wo1.last_unit_completion_date,  -- last_unit_start_date
145                  wdj.scheduled_start_date),
146              nvl(wo1.last_unit_completion_date,  -- last_unit_completion_date
147                  wdj.scheduled_start_date),
148              x_prev_op_seq_num,
149              x_next_op_seq_num,
150              WIP_CONSTANTS.YES_AUTO,
151              decode(x_next_op_seq_num,
152                     NULL, WIP_CONSTANTS.YES, WIP_CONSTANTS.NO),
153              bso.operation_description,
154              bso.attribute_category,
155              bso.attribute1,
156              bso.attribute2,
157              bso.attribute3,
158              bso.attribute4,
159              bso.attribute5,
160              bso.attribute6,
161              bso.attribute7,
162              bso.attribute8,
163              bso.attribute9,
164              bso.attribute10,
165              bso.attribute11,
166              bso.attribute12,
167              bso.attribute13,
168              bso.attribute14,
169              bso.attribute15,
170 													bso.check_skill
171       from   wip_operations wo1,
172              wip_discrete_jobs wdj,
173              bom_standard_operations bso
174       where  bso.standard_operation_id(+) = p_operation_id
175 /* %cfm  Ignore cfm ops. */
176       and    nvl(bso.operation_type, 1) = 1
177       and    bso.line_id is null
178 /* %/cfm */
179       and    bso.organization_id(+) =
180                decode(1, 1, p_org_id,wdj.organization_id)
181       and    wdj.wip_entity_id = p_wip_entity_id
182       and    wdj.organization_id = p_org_id
183       and    wo1.wip_entity_id(+) =
184                decode(1, 1, p_wip_entity_id, wdj.wip_entity_id)
185       and    wo1.organization_id(+) = p_org_id
186       and    wo1.operation_seq_num(+) = x_prev_op_seq_num;
187 
188     exception
189       when DUP_VAL_ON_INDEX then
190         fnd_message.set_name(
191           application => 'WIP',
192           name        => 'WIP_SAME_OP_EXISTS');
193         fnd_message.raise_error;
194     end;
195 
196     -- if standard operation, add resources and instructions
197     if (adding_standard_op) then
198       insert into wip_operation_resources
199             (wip_entity_id,
200              operation_seq_num,
201              resource_seq_num,
202              organization_id,
203              last_update_date,
204              last_updated_by,
205              creation_date,
206              created_by,
207              last_update_login,
208              resource_id,
209              uom_code,
210              basis_type,
211              usage_rate_or_amount,
212              activity_id,
213              scheduled_flag,
214              assigned_units,
215              autocharge_type,
216              standard_rate_flag,
217              applied_resource_units,
218              applied_resource_value,
219              start_date,
220              completion_date,
221              attribute_category,
222              attribute1,
223              attribute2,
224              attribute3,
225              attribute4,
226              attribute5,
227              attribute6,
228              attribute7,
229              attribute8,
230              attribute9,
231              attribute10,
232              attribute11,
233              attribute12,
234              attribute13,
235              attribute14,
236              attribute15,
237 	     substitute_group_num, -- Added  : ---- bug 7371859
238              schedule_seq_num,     -- Added  : ---- bug 7371859
239              replacement_group_num) -- Added : ---- bug 7371859
240       select p_wip_entity_id,
241              p_operation_seq_num,
242              bsor.resource_seq_num,
243              p_org_id,
244              SYSDATE,
245              x_user_id,
246              SYSDATE,
247              x_user_id,
248              x_login_id,
249              bsor.resource_id,
250              br.unit_of_measure,
251              bsor.basis_type,
252              bsor.usage_rate_or_amount,
253              bsor.activity_id,
254              bsor.schedule_flag,
255              bsor.assigned_units,
256              bsor.autocharge_type,
257              bsor.standard_rate_flag,
258              0, -- applied_resource_units
259              0, -- applied_resource_value
260              wo.first_unit_start_date,
261              wo.last_unit_completion_date,
262              bsor.attribute_category,
263              bsor.attribute1,
264              bsor.attribute2,
265              bsor.attribute3,
266              bsor.attribute4,
267              bsor.attribute5,
268              bsor.attribute6,
269              bsor.attribute7,
270              bsor.attribute8,
271              bsor.attribute9,
272              bsor.attribute10,
273              bsor.attribute11,
274              bsor.attribute12,
275              bsor.attribute13,
276              bsor.attribute14,
277              bsor.attribute15,
278 	     bsor.substitute_group_num,     -- Added :  -- bug 7371859
279              bsor.resource_seq_num,         -- Added :  -- bug 7371859(Schedule Seq Num= Resource Seq Num)
280              0                              -- Added :  -- bug 7371859
281       from   wip_operations wo,
282              bom_resources br,
283              bom_std_op_resources bsor
284       where  bsor.standard_operation_id = p_operation_id
285       and    br.resource_id = bsor.resource_id
286       and    nvl(br.disable_date, SYSDATE + 1) > SYSDATE
287       and    wo.organization_id = p_org_id
288       and    wo.wip_entity_id = p_wip_entity_id
289       and    wo.operation_seq_num = p_operation_seq_num;
290 
291      FND_ATTACHED_DOCUMENTS2_PKG.copy_attachments(
292         X_FROM_ENTITY_NAME => 'BOM_STANDARD_OPERATIONS',
293         X_FROM_PK1_VALUE   => to_char(p_operation_id),
294         X_TO_ENTITY_NAME   => 'WIP_DISCRETE_OPERATIONS',
295         X_TO_PK1_VALUE   => to_char(p_wip_entity_id),
296         X_TO_PK2_VALUE   => to_char(p_operation_seq_num),
297         X_TO_PK3_VALUE   => to_char(p_org_id),
298         X_CREATED_BY     => x_user_id,
299         X_LAST_UPDATE_LOGIN => x_login_id,
300         X_PROGRAM_APPLICATION_ID  => x_appl_id,
301         X_PROGRAM_ID    => x_program_id,
302         X_REQUEST_ID    => x_request_id);
303  /* Added : -- bug 7371859   */
304 
305      /* Added for 12.1.1 Skills Validation project.*/
306      INSERT INTO WIP_OPERATION_COMPETENCIES
307             ( LEVEL_ID,          ORGANIZATION_ID,
308              WIP_ENTITY_ID,           OPERATION_SEQ_NUM, OPERATION_SEQUENCE_ID,
309              STANDARD_OPERATION_ID,   COMPETENCE_ID,     RATING_LEVEL_ID,
310              QUALIFICATION_TYPE_ID,   LAST_UPDATE_DATE,  LAST_UPDATED_BY,
311              LAST_UPDATE_LOGIN,       CREATED_BY,        CREATION_DATE)
312         SELECT
313              3,                    WO.ORGANIZATION_ID,
314              WO.WIP_ENTITY_ID,               WO.OPERATION_SEQ_NUM, BOS.OPERATION_SEQUENCE_ID,
315              BOS.STANDARD_OPERATION_ID,      BOS.COMPETENCE_ID,    BOS.RATING_LEVEL_ID,
316              BOS.QUALIFICATION_TYPE_ID,      WO.LAST_UPDATE_DATE,  WO.LAST_UPDATED_BY,
317              WO.LAST_UPDATE_LOGIN,           WO.CREATED_BY,        WO.CREATION_DATE
318         FROM BOM_OPERATION_SKILLS BOS,
319              WIP_OPERATIONS WO,
320              WIP_ENTITIES WE
321         WHERE
322              WE.WIP_ENTITY_ID = WO.WIP_ENTITY_ID
323              AND WO.ORGANIZATION_ID = WO.ORGANIZATION_ID
324              AND WE.ENTITY_TYPE = 1
325              AND WO.ORGANIZATION_ID = p_org_id
326              AND WO.WIP_ENTITY_ID = p_wip_entity_id
327              AND WO.OPERATION_SEQ_NUM = p_operation_seq_num
328              AND WO.ORGANIZATION_ID = BOS.ORGANIZATION_ID
329              AND BOS.STANDARD_OPERATION_ID = p_operation_id
330              AND BOS.LEVEL_ID = 1;
331 
332      BEGIN
333        SELECT count(*)
334         INTO  sub_res_count
335         FROM  BOM_STD_SUB_OP_RESOURCES BSSOR
336         WHERE BSSOR.STANDARD_OPERATION_ID=p_operation_id;
337      EXCEPTION
338          WHEN no_data_found THEN
339              null;
340      END ;
341 
342      IF   sub_res_count >0 then
343 
344         BEGIN
345             SELECT nvl(max(resource_seq_num), 10)
346             INTO   l_wsor_max_res_seq_num
347             FROM   WIP_SUB_OPERATION_RESOURCES WSOR
348             WHERE  wip_entity_id = p_wip_entity_id
349             AND    OPERATION_SEQ_NUM = p_operation_seq_num;
350         EXCEPTION
351             WHEN no_data_found THEN
352                 null;
353         END;
354 
355            INSERT INTO WIP_SUB_OPERATION_RESOURCES
356                     (wip_entity_id,
357                     operation_seq_num,
358                     resource_seq_num,
359                     organization_id,
360                     --repetitive_schedule_id,
361                     last_update_date,
362                     last_updated_by,
363                     creation_date,
364                     created_by,
365                     last_update_login,
366                     resource_id,
367                     uom_code,
368                     basis_type,
369                     usage_rate_or_amount,
370                     activity_id,
371                     scheduled_flag,
372                     assigned_units,
373                     maximum_assigned_units,
374                     autocharge_type,
375                     standard_rate_flag,
376                     applied_resource_units,
377                     applied_resource_value,
378                     attribute_category,
379                     attribute1,
380                     attribute2,
381                     attribute3,
382                     attribute4,
383                     attribute5,
384                     attribute6,
385                     attribute7,
386                     attribute8,
387                     attribute9,
388                     attribute10,
389                     attribute11,
390                     attribute12,
391                     attribute13,
392                     attribute14,
393                     attribute15,
394                     completion_date,
395                     start_date,
396                     schedule_seq_num,
397                     substitute_group_num,
398                     replacement_group_num,
399                     setup_id)
400             SELECT  p_wip_entity_id,
404                 --    X_Repetitive_Schedule_Id,
401                     p_operation_seq_num,
402                    (rownum + l_wsor_max_res_seq_num),
403                     p_org_id,
405                     SYSDATE ,
406                     x_user_id,
407                     SYSDATE,
408                     x_user_id,
409                     x_login_id,
410                     BSSOR.resource_id,
411                     BR.unit_of_measure,
412                     BSSOR.basis_type,
413                     BSSOR.usage_rate_or_amount,
414                     BSSOR.activity_id,
415                     BSSOR.schedule_flag,
416                     BSSOR.assigned_units,
417                     BSSOR.assigned_units,
418                     BSSOR.autocharge_type,
419                     BSSOR.standard_rate_flag,
420                     0, --WCOR.applied_resource_units,
421                     0, -- WCOR.applied_resource_value,
422                     BSSOR.attribute_category,
423                     BSSOR.attribute1,
424                     BSSOR.attribute2,
425                     BSSOR.attribute3,
426                     BSSOR.attribute4,
427                     BSSOR.attribute5,
428                     BSSOR.attribute6,
429                     BSSOR.attribute7,
430                     BSSOR.attribute8,
431                     BSSOR.attribute9,
432                     BSSOR.attribute10,
433                     BSSOR.attribute11,
434                     BSSOR.attribute12,
435                     BSSOR.attribute13,
436                     BSSOR.attribute14,
437                     BSSOR.attribute15,
438                     sysdate, -- DECODE(X_Start_Date, NULL, SYSDATE, X_Start_Date),
439                     sysdate, --DECODE(X_Completion_Date, NULL, SYSDATE, X_Completion_Date),
440                     BSSOR.schedule_seq_num  ,
441                     BSSOR.substitute_group_num,
442                     BSSOR.replacement_group_num,
443                     NULL --setup_id
444             FROM    BOM_RESOURCES BR,
445                     BOM_STD_SUB_OP_RESOURCES BSSOR
446             WHERE   bssor.standard_operation_id=p_operation_id
447               AND   BSSOR.RESOURCE_ID = BR.RESOURCE_ID;
448 
449     End IF;
450     /* End : -- bug 7371859   */
451 
452 
453 
454     end if;
455 
456     return;
457 
458   exception
459     when others then
460       wip_constants.get_ora_error(
461         application => 'WIP',
462         proc_name   => 'WIP_OPERATIONS_PKG.ADD');
463       fnd_message.raise_error;
464 
465   end add;
466 
467 
468   PROCEDURE Insert_Row(X_Rowid                   IN OUT NOCOPY VARCHAR2,
469                        X_Wip_Entity_Id                  NUMBER,
470                        X_Operation_Seq_Num              NUMBER,
471                        X_Organization_Id                NUMBER,
472                        X_Repetitive_Schedule_Id         NUMBER,
473                        X_Last_Update_Date               DATE,
474                        X_Last_Updated_By                NUMBER,
475                        X_Creation_Date                  DATE,
476                        X_Created_By                     NUMBER,
477                        X_Last_Update_Login              NUMBER,
478                        X_Operation_Sequence_Id          NUMBER,
479                        X_Standard_Operation_Id          NUMBER,
480                        X_Department_Id                  NUMBER,
481                        X_Description                    VARCHAR2,
482                        X_Scheduled_Quantity             NUMBER,
483                        X_Quantity_In_Queue              NUMBER,
484                        X_Quantity_Running               NUMBER,
485                        X_Quantity_Waiting_To_Move       NUMBER,
486                        X_Quantity_Rejected              NUMBER,
487                        X_Quantity_Scrapped              NUMBER,
488                        X_Quantity_Completed             NUMBER,
489                        X_First_Unit_Start_Date          DATE,
490                        X_First_Unit_Completion_Date     DATE,
491                        X_Last_Unit_Start_Date           DATE,
492                        X_Last_Unit_Completion_Date      DATE,
493                        X_Previous_Operation_Seq_Num     NUMBER,
494                        X_Next_Operation_Seq_Num         NUMBER,
495                        X_Count_Point_Type               NUMBER,
496                        X_Backflush_Flag                 NUMBER,
497                        X_Minimum_Transfer_Quantity      NUMBER,
498                        X_Date_Last_Moved                DATE,
499 /*3118918*/            X_Progress_percentage            NUMBER,
500                        X_Attribute_Category             VARCHAR2,
501                        X_Attribute1                     VARCHAR2,
502                        X_Attribute2                     VARCHAR2,
503                        X_Attribute3                     VARCHAR2,
504                        X_Attribute4                     VARCHAR2,
505                        X_Attribute5                     VARCHAR2,
506                        X_Attribute6                     VARCHAR2,
507                        X_Attribute7                     VARCHAR2,
508                        X_Attribute8                     VARCHAR2,
509                        X_Attribute9                     VARCHAR2,
510                        X_Attribute10                    VARCHAR2,
511                        X_Attribute11                    VARCHAR2,
515                        X_Attribute15                    VARCHAR2,
512                        X_Attribute12                    VARCHAR2,
513                        X_Attribute13                    VARCHAR2,
514                        X_Attribute14                    VARCHAR2,
516 		                     X_CHECK_SKILL                    NUMBER DEFAULT NULL) IS
517      CURSOR C IS SELECT rowid FROM WIP_OPERATIONS
518                  WHERE wip_entity_id = X_Wip_Entity_Id
519                  AND   operation_seq_num = X_Operation_Seq_Num
520                  AND   organization_id = X_Organization_Id
521 		 AND   (repetitive_Schedule_id = X_Repetitive_Schedule_Id
522 			OR (repetitive_schedule_id IS NULL
523 			     AND X_Repetitive_Schedule_Id IS NULL));
524      x_user_id		number	:= FND_GLOBAL.USER_ID;
525      x_login_id		number	:= FND_GLOBAL.LOGIN_ID;
526      x_request_id       number  := FND_GLOBAL.CONC_REQUEST_ID;
527      x_appl_id          number  := FND_GLOBAL.PROG_APPL_ID;
528      x_program_id       number  := FND_GLOBAL.CONC_PROGRAM_ID;
529      x_standard_op	boolean	:= (X_Standard_Operation_Id is NOT NULL);
530      l_scrap_qty        number :=0;
531 
532     BEGIN
533 
534 /* For Enhancement#2864382. Calculate cumulative_scrap_quantity for this op
535 eration */
536 
537                 SELECT SUM(quantity_scrapped)
538                   INTO l_scrap_qty
539                   FROM wip_operations
540                  WHERE organization_id         =  X_Organization_Id
541                    AND wip_entity_id           =  X_Wip_Entity_Id
542                    AND (repetitive_schedule_id =  X_Repetitive_Schedule_Id   OR
543                          (repetitive_schedule_id IS NULL AND X_Repetitive_Schedule_Id IS NULL))
544                    AND operation_seq_num       <  X_Operation_Seq_Num;
545 
546                 IF (l_scrap_qty IS NULL) THEN
547                     l_scrap_qty :=0;
548                 END IF;
549 
550        INSERT INTO WIP_OPERATIONS(
551                wip_entity_id,
552                operation_seq_num,
553                organization_id,
554                repetitive_schedule_id,
555                last_update_date,
556                last_updated_by,
557                creation_date,
558                created_by,
559                last_update_login,
560                operation_sequence_id,
561                standard_operation_id,
562                department_id,
563                description,
564                scheduled_quantity,
565                quantity_in_queue,
566                quantity_running,
567                quantity_waiting_to_move,
568                quantity_rejected,
569                quantity_scrapped,
570                quantity_completed,
571                first_unit_start_date,
572                first_unit_completion_date,
573                last_unit_start_date,
574                last_unit_completion_date,
575                previous_operation_seq_num,
576                next_operation_seq_num,
577                count_point_type,
578                backflush_flag,
579                minimum_transfer_quantity,
580                date_last_moved,
581                cumulative_scrap_quantity, /*For Enhancement#2864382*/
582                progress_percentage, /*Enhancement 3118918*/
583                attribute_category,
584                attribute1,
585                attribute2,
586                attribute3,
587                attribute4,
588                attribute5,
589                attribute6,
590                attribute7,
591                attribute8,
592                attribute9,
593                attribute10,
594                attribute11,
595                attribute12,
596                attribute13,
597                attribute14,
598                attribute15,
599 															CHECK_SKILL
600              ) VALUES (
601                X_Wip_Entity_Id,
602                X_Operation_Seq_Num,
603                X_Organization_Id,
604                X_Repetitive_Schedule_Id,
605                X_Last_Update_Date,
606                X_Last_Updated_By,
607                X_Creation_Date,
608                X_Created_By,
609                X_Last_Update_Login,
610                X_Operation_Sequence_Id,
611                X_Standard_Operation_Id,
612                X_Department_Id,
613                X_Description,
614                X_Scheduled_Quantity,
615                X_Quantity_In_Queue,
616                X_Quantity_Running,
617                X_Quantity_Waiting_To_Move,
618                X_Quantity_Rejected,
619                X_Quantity_Scrapped,
620                X_Quantity_Completed,
621                X_First_Unit_Start_Date,
622                X_First_Unit_Completion_Date,
623                X_Last_Unit_Start_Date,
624                X_Last_Unit_Completion_Date,
625                X_Previous_Operation_Seq_Num,
626                X_Next_Operation_Seq_Num,
627                X_Count_Point_Type,
628                X_Backflush_Flag,
629                X_Minimum_Transfer_Quantity,
630                X_Date_Last_Moved,
631                l_scrap_qty,
632                X_progress_percentage,
633                X_Attribute_Category,
634                X_Attribute1,
635                X_Attribute2,
636                X_Attribute3,
637                X_Attribute4,
638                X_Attribute5,
639                X_Attribute6,
640                X_Attribute7,
644                X_Attribute11,
641                X_Attribute8,
642                X_Attribute9,
643                X_Attribute10,
645                X_Attribute12,
646                X_Attribute13,
647                X_Attribute14,
648                X_Attribute15,
649 															X_CHECK_SKILL
650              );
651 
652 
653     IF (X_Repetitive_Schedule_Id IS NULL) THEN
654       FND_ATTACHED_DOCUMENTS2_PKG.copy_attachments(
655         X_FROM_ENTITY_NAME => 'BOM_STANDARD_OPERATIONS',
656         X_FROM_PK1_VALUE   => to_char(X_Standard_Operation_Id),
657         X_TO_ENTITY_NAME   => 'WIP_DISCRETE_OPERATIONS',
658         X_TO_PK1_VALUE   => to_char(X_Wip_Entity_Id),
659         X_TO_PK2_VALUE   => to_char(X_Operation_Seq_Num),
660         X_TO_PK3_VALUE   => to_char(X_Organization_Id),
661         X_CREATED_BY     => x_user_id,
662         X_LAST_UPDATE_LOGIN => x_login_id,
663         X_PROGRAM_APPLICATION_ID  => x_appl_id,
664         X_PROGRAM_ID    => x_program_id,
665         X_REQUEST_ID    => x_request_id);
666     ELSE
667       FND_ATTACHED_DOCUMENTS2_PKG.copy_attachments(
668         X_FROM_ENTITY_NAME => 'BOM_STANDARD_OPERATIONS',
669         X_FROM_PK1_VALUE   => to_char(X_Standard_Operation_Id),
670         X_TO_ENTITY_NAME   => 'WIP_REPETITIVE_OPERATIONS',
671         X_TO_PK1_VALUE   => to_char(X_Wip_Entity_Id),
672         X_TO_PK2_VALUE   => to_char(X_Operation_Seq_Num),
673         X_TO_PK3_VALUE   => to_char(X_Organization_Id),
674 	X_TO_PK4_VALUE   => to_char(X_Repetitive_Schedule_Id),
675         X_CREATED_BY     => x_user_id,
676         X_LAST_UPDATE_LOGIN => x_login_id,
677         X_PROGRAM_APPLICATION_ID  => x_appl_id,
678         X_PROGRAM_ID    => x_program_id,
679         X_REQUEST_ID    => x_request_id);
680     END IF;
681 
682 				/* Added for 12.1.1 Skills Validation project.*/
683      /*INSERT INTO WIP_OPERATION_COMPETENCIES
684             ( LEVEL_ID,          ORGANIZATION_ID,
685              WIP_ENTITY_ID,           OPERATION_SEQ_NUM, OPERATION_SEQUENCE_ID,
686              STANDARD_OPERATION_ID,   COMPETENCE_ID,     RATING_LEVEL_ID,
687              QUALIFICATION_TYPE_ID,   LAST_UPDATE_DATE,  LAST_UPDATED_BY,
688              LAST_UPDATE_LOGIN,       CREATED_BY,        CREATION_DATE)
689         SELECT
690               3,                    WO.ORGANIZATION_ID,
691              WO.WIP_ENTITY_ID,               WO.OPERATION_SEQ_NUM, BOS.OPERATION_SEQUENCE_ID,
692              BOS.STANDARD_OPERATION_ID,      BOS.COMPETENCE_ID,    BOS.RATING_LEVEL_ID,
693              BOS.QUALIFICATION_TYPE_ID,      WO.LAST_UPDATE_DATE,  WO.LAST_UPDATED_BY,
694              WO.LAST_UPDATE_LOGIN,           WO.CREATED_BY,        WO.CREATION_DATE
695         FROM BOM_OPERATION_SKILLS BOS,
696              WIP_OPERATIONS WO,
697              WIP_ENTITIES WE
698         WHERE
699              WE.WIP_ENTITY_ID = WO.WIP_ENTITY_ID
700              AND WO.ORGANIZATION_ID = WO.ORGANIZATION_ID
701              AND WE.ENTITY_TYPE = 1
702              AND WO.ORGANIZATION_ID = X_Organization_Id
703              AND WO.WIP_ENTITY_ID = X_Wip_Entity_Id
704              AND WO.OPERATION_SEQ_NUM = X_Operation_Seq_Num
705              AND NVL(WO.CHECK_SKILL,2) =1
706              AND WO.ORGANIZATION_ID = BOS.ORGANIZATION_ID
707              AND BOS.STANDARD_OPERATION_ID = X_Standard_Operation_Id
708              AND BOS.LEVEL_ID = 1;*/
709 
710 	     /* Commented out as the same piece of login is implemented directly in the form*/
711 
712     OPEN C;
713     FETCH C INTO X_Rowid;
714     if (C%NOTFOUND) then
715       CLOSE C;
716       Raise NO_DATA_FOUND;
717     end if;
718     CLOSE C;
719   END Insert_Row;
720 
721   PROCEDURE Lock_Row(X_Rowid                            VARCHAR2,
722                      X_Wip_Entity_Id                    NUMBER,
723                      X_Operation_Seq_Num                NUMBER,
724                      X_Organization_Id                  NUMBER,
725                      X_Repetitive_Schedule_Id           NUMBER,
726                      X_Operation_Sequence_Id            NUMBER,
727                      X_Standard_Operation_Id            NUMBER,
728                      X_Department_Id                    NUMBER,
729                      X_Description                      VARCHAR2,
730                      X_Scheduled_Quantity               NUMBER,
731                      X_Quantity_In_Queue                NUMBER,
732                      X_Quantity_Running                 NUMBER,
733                      X_Quantity_Waiting_To_Move         NUMBER,
734                      X_Quantity_Rejected                NUMBER,
735                      X_Quantity_Scrapped                NUMBER,
736                      X_Quantity_Completed               NUMBER,
737                      X_First_Unit_Start_Date            DATE,
738                      X_First_Unit_Completion_Date       DATE,
739                      X_Last_Unit_Start_Date             DATE,
740                      X_Last_Unit_Completion_Date        DATE,
741                      X_Count_Point_Type                 NUMBER,
742                      X_Backflush_Flag                   NUMBER,
743                      X_Minimum_Transfer_Quantity        NUMBER,
744                      X_Date_Last_Moved                  DATE,
745                      X_progress_percentage              NUMBER,
746                      X_Attribute_Category               VARCHAR2,
747                      X_Attribute1                       VARCHAR2,
751                      X_Attribute5                       VARCHAR2,
748                      X_Attribute2                       VARCHAR2,
749                      X_Attribute3                       VARCHAR2,
750                      X_Attribute4                       VARCHAR2,
752                      X_Attribute6                       VARCHAR2,
753                      X_Attribute7                       VARCHAR2,
754                      X_Attribute8                       VARCHAR2,
755                      X_Attribute9                       VARCHAR2,
756                      X_Attribute10                      VARCHAR2,
757                      X_Attribute11                      VARCHAR2,
758                      X_Attribute12                      VARCHAR2,
759                      X_Attribute13                      VARCHAR2,
760                      X_Attribute14                      VARCHAR2,
761                      X_Attribute15                      VARCHAR2,
762 																					X_CHECK_SKILL                      NUMBER DEFAULT NULL
763 
764   ) IS
765     CURSOR C IS
766         SELECT *
767         FROM   WIP_OPERATIONS
768         WHERE  rowid = X_Rowid
769         FOR UPDATE of Wip_Entity_Id NOWAIT;
770     Recinfo C%ROWTYPE;
771   BEGIN
772     OPEN C;
773     FETCH C INTO Recinfo;
774     if (C%NOTFOUND) then
775       CLOSE C;
776       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
777       fnd_message.raise_error;
778       app_exception.raise_exception;
779     end if;
780     CLOSE C;
781 
782     if (       (Recinfo.wip_entity_id = X_Wip_Entity_Id)
783            AND (Recinfo.operation_seq_num = X_Operation_Seq_Num)
784            AND (Recinfo.organization_id = X_Organization_Id)
785            AND (   (Recinfo.repetitive_schedule_id = X_Repetitive_Schedule_Id)
786                 OR (    (Recinfo.repetitive_schedule_id IS NULL)
787                     AND (X_Repetitive_Schedule_Id IS NULL)))
788            AND (   (Recinfo.operation_sequence_id = X_Operation_Sequence_Id)
789                 OR (    (Recinfo.operation_sequence_id IS NULL)
790                     AND (X_Operation_Sequence_Id IS NULL)))
791            AND (   (Recinfo.standard_operation_id = X_Standard_Operation_Id)
792                 OR (    (Recinfo.standard_operation_id IS NULL)
793                     AND (X_Standard_Operation_Id IS NULL)))
794            AND (Recinfo.department_id = X_Department_Id)
795            AND (   (Recinfo.description = X_Description)
796                 OR (    (Recinfo.description IS NULL)
797                     AND (X_Description IS NULL)))
798            AND (Recinfo.scheduled_quantity = X_Scheduled_Quantity)
799            AND (Recinfo.quantity_in_queue = X_Quantity_In_Queue)
800            AND (Recinfo.quantity_running = X_Quantity_Running)
801            AND (Recinfo.quantity_waiting_to_move = X_Quantity_Waiting_To_Move)
802            AND (Recinfo.quantity_rejected = X_Quantity_Rejected)
803            AND (Recinfo.quantity_scrapped = X_Quantity_Scrapped)
804            AND (Recinfo.quantity_completed = X_Quantity_Completed)
805            AND (Recinfo.first_unit_start_date = X_First_Unit_Start_Date)
806            AND (Recinfo.first_unit_completion_date = X_First_Unit_Completion_Date)
807            AND (Recinfo.last_unit_start_date = X_Last_Unit_Start_Date)
808            AND (Recinfo.last_unit_completion_date = X_Last_Unit_Completion_Date)
809 /*3118918*/AND (  (Recinfo.progress_percentage = X_Progress_percentage)
810                   OR (    (Recinfo.progress_percentage IS NULL)
811                     AND (X_Progress_percentage IS NULL)))
812            AND (Recinfo.count_point_type = X_Count_Point_Type))
813         then
814              if (
815                (Recinfo.backflush_flag = X_Backflush_Flag)
816            AND (Recinfo.minimum_transfer_quantity = X_Minimum_Transfer_Quantity)
817            AND (   (Recinfo.date_last_moved = X_Date_Last_Moved)
818                 OR (    (Recinfo.date_last_moved IS NULL)
819                     AND (X_Date_Last_Moved IS NULL)))
820            AND (   (Recinfo.attribute_category = X_Attribute_Category)
821                 OR (    (Recinfo.attribute_category IS NULL)
822                     AND (X_Attribute_Category IS NULL)))
823            AND (   (Recinfo.attribute1 = X_Attribute1)
824                 OR (    (Recinfo.attribute1 IS NULL)
825                     AND (X_Attribute1 IS NULL)))
826            AND (   (Recinfo.attribute2 = X_Attribute2)
827                 OR (    (Recinfo.attribute2 IS NULL)
828                     AND (X_Attribute2 IS NULL)))
829            AND (   (Recinfo.attribute3 = X_Attribute3)
830                 OR (    (Recinfo.attribute3 IS NULL)
831                     AND (X_Attribute3 IS NULL)))
832            AND (   (Recinfo.attribute4 = X_Attribute4)
833                 OR (    (Recinfo.attribute4 IS NULL)
834                     AND (X_Attribute4 IS NULL)))
835            AND (   (Recinfo.attribute5 = X_Attribute5)
836                 OR (    (Recinfo.attribute5 IS NULL)
837                     AND (X_Attribute5 IS NULL)))
838            AND (   (Recinfo.attribute6 = X_Attribute6)
839                 OR (    (Recinfo.attribute6 IS NULL)
840                     AND (X_Attribute6 IS NULL)))
841            AND (   (Recinfo.attribute7 = X_Attribute7)
842                 OR (    (Recinfo.attribute7 IS NULL)
843                     AND (X_Attribute7 IS NULL)))
844            AND (   (Recinfo.attribute8 = X_Attribute8)
845                 OR (    (Recinfo.attribute8 IS NULL)
846                     AND (X_Attribute8 IS NULL)))
847            AND (   (Recinfo.attribute9 = X_Attribute9)
848                 OR (    (Recinfo.attribute9 IS NULL)
852                     AND (X_Attribute10 IS NULL)))
849                     AND (X_Attribute9 IS NULL)))
850            AND (   (Recinfo.attribute10 = X_Attribute10)
851                 OR (    (Recinfo.attribute10 IS NULL)
853            AND (   (Recinfo.attribute11 = X_Attribute11)
854                 OR (    (Recinfo.attribute11 IS NULL)
855                     AND (X_Attribute11 IS NULL)))
856            AND (   (Recinfo.attribute12 = X_Attribute12)
857                 OR (    (Recinfo.attribute12 IS NULL)
858                     AND (X_Attribute12 IS NULL)))
859            AND (   (Recinfo.attribute13 = X_Attribute13)
860                 OR (    (Recinfo.attribute13 IS NULL)
861                     AND (X_Attribute13 IS NULL)))
862            AND (   (Recinfo.attribute14 = X_Attribute14)
863                 OR (    (Recinfo.attribute14 IS NULL)
864                     AND (X_Attribute14 IS NULL)))
865            AND (   (Recinfo.attribute15 = X_Attribute15)
866                 OR (    (Recinfo.attribute15 IS NULL)
867                     AND (X_Attribute15 IS NULL)))
868            AND (   (Recinfo.CHECK_SKILL = X_CHECK_SKILL)
869                 OR (    (Recinfo.CHECK_SKILL IS NULL)
870                     AND (X_CHECK_SKILL IS NULL)))
871            )
872 then
873       return;
874     else
875         FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
876         fnd_message.raise_error;
877 
878         app_exception.raise_exception;
879     end if;
880     else
881         FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
882         fnd_message.raise_error;
883         app_exception.raise_exception;
884     end if;
885 
886   END Lock_Row;
887 
888 
889   PROCEDURE Update_Row(X_Rowid                          VARCHAR2,
890                        X_Wip_Entity_Id                  NUMBER,
891                        X_Operation_Seq_Num              NUMBER,
892                        X_Organization_Id                NUMBER,
893                        X_Repetitive_Schedule_Id         NUMBER,
894                        X_Last_Update_Date               DATE,
895                        X_Last_Updated_By                NUMBER,
896                        X_Last_Update_Login              NUMBER,
897                        X_Operation_Sequence_Id          NUMBER,
898                        X_Standard_Operation_Id          NUMBER,
899                        X_Department_Id                  NUMBER,
900                        X_Description                    VARCHAR2,
901                        X_Scheduled_Quantity             NUMBER,
902                        X_Quantity_In_Queue              NUMBER,
903                        X_Quantity_Running               NUMBER,
904                        X_Quantity_Waiting_To_Move       NUMBER,
905                        X_Quantity_Rejected              NUMBER,
906                        X_Quantity_Scrapped              NUMBER,
907                        X_Quantity_Completed             NUMBER,
908                        X_First_Unit_Start_Date          DATE,
909                        X_First_Unit_Completion_Date     DATE,
910                        X_Last_Unit_Start_Date           DATE,
911                        X_Last_Unit_Completion_Date      DATE,
912                        X_Count_Point_Type               NUMBER,
913                        X_Backflush_Flag                 NUMBER,
914                        X_Minimum_Transfer_Quantity      NUMBER,
915                        X_Date_Last_Moved                DATE,
916 /*3118918*/            X_Progress_percentage            NUMBER,
917                        X_Attribute_Category             VARCHAR2,
918                        X_Attribute1                     VARCHAR2,
919                        X_Attribute2                     VARCHAR2,
920                        X_Attribute3                     VARCHAR2,
921                        X_Attribute4                     VARCHAR2,
922                        X_Attribute5                     VARCHAR2,
923                        X_Attribute6                     VARCHAR2,
924                        X_Attribute7                     VARCHAR2,
925                        X_Attribute8                     VARCHAR2,
926                        X_Attribute9                     VARCHAR2,
927                        X_Attribute10                    VARCHAR2,
928                        X_Attribute11                    VARCHAR2,
929                        X_Attribute12                    VARCHAR2,
930                        X_Attribute13                    VARCHAR2,
931                        X_Attribute14                    VARCHAR2,
932                        X_Attribute15                    VARCHAR2,
933 																							X_CHECK_SKILL                    NUMBER DEFAULT NULL
934 
935  ) IS
936  BEGIN
937    UPDATE WIP_OPERATIONS
938    SET
939      wip_entity_id                     =     X_Wip_Entity_Id,
940      operation_seq_num                 =     X_Operation_Seq_Num,
941      organization_id                   =     X_Organization_Id,
942      repetitive_schedule_id            =     X_Repetitive_Schedule_Id,
943      last_update_date                  =     X_Last_Update_Date,
944      last_updated_by                   =     X_Last_Updated_By,
945      last_update_login                 =     X_Last_Update_Login,
946      operation_sequence_id             =     X_Operation_Sequence_Id,
947      standard_operation_id             =     X_Standard_Operation_Id,
948      department_id                     =     X_Department_Id,
952      quantity_running                  =     X_Quantity_Running,
949      description                       =     X_Description,
950      scheduled_quantity                =     X_Scheduled_Quantity,
951      quantity_in_queue                 =     X_Quantity_In_Queue,
953      quantity_waiting_to_move          =     X_Quantity_Waiting_To_Move,
954      quantity_rejected                 =     X_Quantity_Rejected,
955      quantity_scrapped                 =     X_Quantity_Scrapped,
956      quantity_completed                =     X_Quantity_Completed,
957      first_unit_start_date             =     X_First_Unit_Start_Date,
958      first_unit_completion_date        =     X_First_Unit_Completion_Date,
959      last_unit_start_date              =     X_Last_Unit_Start_Date,
960      last_unit_completion_date         =     X_Last_Unit_Completion_Date,
961      count_point_type                  =     X_Count_Point_Type,
962      backflush_flag                    =     X_Backflush_Flag,
963      minimum_transfer_quantity         =     X_Minimum_Transfer_Quantity,
964      date_last_moved                   =     X_Date_Last_Moved,
965      progress_percentage               =     X_Progress_percentage,/*3118918*/
966      attribute_category                =     X_Attribute_Category,
967      attribute1                        =     X_Attribute1,
968      attribute2                        =     X_Attribute2,
969      attribute3                        =     X_Attribute3,
970      attribute4                        =     X_Attribute4,
971      attribute5                        =     X_Attribute5,
972      attribute6                        =     X_Attribute6,
973      attribute7                        =     X_Attribute7,
974      attribute8                        =     X_Attribute8,
975      attribute9                        =     X_Attribute9,
976      attribute10                       =     X_Attribute10,
977      attribute11                       =     X_Attribute11,
978      attribute12                       =     X_Attribute12,
979      attribute13                       =     X_Attribute13,
980      attribute14                       =     X_Attribute14,
981      attribute15                       =     X_Attribute15,
982 					CHECK_SKILL                       =     X_CHECK_SKILL
983    WHERE rowid = X_rowid;
984 
985     if (SQL%NOTFOUND) then
986       Raise NO_DATA_FOUND;
987     end if;
988 
989   END Update_Row;
990 
991   PROCEDURE Delete_Row(X_Rowid VARCHAR2) IS
992   BEGIN
993     DELETE FROM WIP_OPERATIONS
994     WHERE  rowid = X_Rowid;
995 
996     if (SQL%NOTFOUND) then
997       Raise NO_DATA_FOUND;
998     end if;
999   END Delete_Row;
1000 
1001 
1002   PROCEDURE Insert_Row(X_Rowid                   IN OUT NOCOPY VARCHAR2,
1003                        X_Wip_Entity_Id                  NUMBER,
1004                        X_Operation_Seq_Num              NUMBER,
1005                        X_Organization_Id                NUMBER,
1006                        X_Repetitive_Schedule_Id         NUMBER,
1007                        X_Last_Update_Date               DATE,
1008                        X_Last_Updated_By                NUMBER,
1009                        X_Creation_Date                  DATE,
1010                        X_Created_By                     NUMBER,
1011                        X_Last_Update_Login              NUMBER,
1012                        X_Operation_Sequence_Id          NUMBER,
1013                        X_Standard_Operation_Id          NUMBER,
1014                        X_Department_Id                  NUMBER,
1015                        X_Description                    VARCHAR2,
1016                        X_Scheduled_Quantity             NUMBER,
1017                        X_Quantity_In_Queue              NUMBER,
1018                        X_Quantity_Running               NUMBER,
1019                        X_Quantity_Waiting_To_Move       NUMBER,
1020                        X_Quantity_Rejected              NUMBER,
1021                        X_Quantity_Scrapped              NUMBER,
1022                        X_Quantity_Completed             NUMBER,
1023                        X_First_Unit_Start_Date          DATE,
1024                        X_First_Unit_Completion_Date     DATE,
1025                        X_Last_Unit_Start_Date           DATE,
1026                        X_Last_Unit_Completion_Date      DATE,
1027                        X_Previous_Operation_Seq_Num     NUMBER,
1028                        X_Next_Operation_Seq_Num         NUMBER,
1029                        X_Count_Point_Type               NUMBER,
1030                        X_Backflush_Flag                 NUMBER,
1031                        X_Minimum_Transfer_Quantity      NUMBER,
1032                        X_Date_Last_Moved                DATE,
1033                        X_Attribute_Category             VARCHAR2,
1034                        X_Attribute1                     VARCHAR2,
1035                        X_Attribute2                     VARCHAR2,
1036                        X_Attribute3                     VARCHAR2,
1037                        X_Attribute4                     VARCHAR2,
1038                        X_Attribute5                     VARCHAR2,
1039                        X_Attribute6                     VARCHAR2,
1040                        X_Attribute7                     VARCHAR2,
1041                        X_Attribute8                     VARCHAR2,
1042                        X_Attribute9                     VARCHAR2,
1043                        X_Attribute10                    VARCHAR2,
1044                        X_Attribute11                    VARCHAR2,
1045                        X_Attribute12                    VARCHAR2,
1046                        X_Attribute13                    VARCHAR2,
1047                        X_Attribute14                    VARCHAR2,
1048                        X_Attribute15                    VARCHAR2
1049                       ) is
1050     l_progressPercentage number;
1051   begin
1052     Insert_Row(X_Rowid => X_Rowid,
1053                X_Wip_Entity_Id => X_Wip_Entity_Id,
1054                X_Operation_Seq_Num => X_Operation_Seq_Num,
1055                X_Organization_Id => X_Organization_Id,
1056                X_Repetitive_Schedule_Id => X_Repetitive_Schedule_Id,
1057                X_Last_Update_Date => X_Last_Update_Date,
1058                X_Last_Updated_By => X_Last_Updated_By,
1059                X_Creation_Date => X_Creation_Date,
1060                X_Created_By => X_Created_By,
1061                X_Last_Update_Login => X_Last_Update_Login,
1062                X_Operation_Sequence_Id => X_Operation_Sequence_Id,
1063                X_Standard_Operation_Id => X_Standard_Operation_Id,
1064                X_Department_Id => X_Department_Id,
1065                X_Description => X_Description,
1066                X_Scheduled_Quantity => X_Scheduled_Quantity,
1067                X_Quantity_In_Queue => X_Quantity_In_Queue,
1068                X_Quantity_Running => X_Quantity_Running,
1069                X_Quantity_Waiting_To_Move => X_Quantity_Waiting_To_Move,
1070                X_Quantity_Rejected => X_Quantity_Rejected,
1071                X_Quantity_Scrapped => X_Quantity_Scrapped,
1072                X_Quantity_Completed => X_Quantity_Completed,
1073                X_First_Unit_Start_Date => X_First_Unit_Start_Date,
1074                X_First_Unit_Completion_Date => X_First_Unit_Completion_Date,
1075                X_Last_Unit_Start_Date => X_Last_Unit_Start_Date,
1076                X_Last_Unit_Completion_Date => X_Last_Unit_Completion_Date,
1077                X_Previous_Operation_Seq_Num => X_Previous_Operation_Seq_Num,
1078                X_Next_Operation_Seq_Num => X_Next_Operation_Seq_Num,
1079                X_Count_Point_Type => X_Count_Point_Type,
1080                X_Backflush_Flag => X_Backflush_Flag,
1081                X_Minimum_Transfer_Quantity => X_Minimum_Transfer_Quantity,
1082                X_Date_Last_Moved => X_Date_Last_Moved,
1083                X_Progress_percentage => l_progressPercentage,
1084                X_Attribute_Category => X_Attribute_Category,
1085                X_Attribute1 => X_Attribute1,
1086                X_Attribute2 => X_Attribute2,
1087                X_Attribute3 => X_Attribute3,
1088                X_Attribute4 => X_Attribute4,
1089                X_Attribute5 => X_Attribute5,
1090                X_Attribute6 => X_Attribute6,
1091                X_Attribute7 => X_Attribute7,
1092                X_Attribute8 => X_Attribute8,
1093                X_Attribute9 => X_Attribute9,
1094                X_Attribute10 => X_Attribute10,
1095                X_Attribute11 => X_Attribute11,
1096                X_Attribute12 => X_Attribute12,
1097                X_Attribute13 => X_Attribute13,
1098                X_Attribute14 => X_Attribute14,
1099                X_Attribute15 => X_Attribute15,
1100 															X_CHECK_SKILL => null);
1101   end Insert_Row;
1102 
1103 
1104   PROCEDURE Lock_Row(X_Rowid                            VARCHAR2,
1105                      X_Wip_Entity_Id                    NUMBER,
1106                      X_Operation_Seq_Num                NUMBER,
1107                      X_Organization_Id                  NUMBER,
1108                      X_Repetitive_Schedule_Id           NUMBER,
1109                      X_Operation_Sequence_Id            NUMBER,
1110                      X_Standard_Operation_Id            NUMBER,
1111                      X_Department_Id                    NUMBER,
1112                      X_Description                      VARCHAR2,
1113                      X_Scheduled_Quantity               NUMBER,
1114                      X_Quantity_In_Queue                NUMBER,
1115                      X_Quantity_Running                 NUMBER,
1116                      X_Quantity_Waiting_To_Move         NUMBER,
1117                      X_Quantity_Rejected                NUMBER,
1118                      X_Quantity_Scrapped                NUMBER,
1119                      X_Quantity_Completed               NUMBER,
1120                      X_First_Unit_Start_Date            DATE,
1121                      X_First_Unit_Completion_Date       DATE,
1122                      X_Last_Unit_Start_Date             DATE,
1123                      X_Last_Unit_Completion_Date        DATE,
1124                      X_Count_Point_Type                 NUMBER,
1125                      X_Backflush_Flag                   NUMBER,
1126                      X_Minimum_Transfer_Quantity        NUMBER,
1127                      X_Date_Last_Moved                  DATE,
1128                      X_Attribute_Category               VARCHAR2,
1129                      X_Attribute1                       VARCHAR2,
1130                      X_Attribute2                       VARCHAR2,
1131                      X_Attribute3                       VARCHAR2,
1132                      X_Attribute4                       VARCHAR2,
1136                      X_Attribute8                       VARCHAR2,
1133                      X_Attribute5                       VARCHAR2,
1134                      X_Attribute6                       VARCHAR2,
1135                      X_Attribute7                       VARCHAR2,
1137                      X_Attribute9                       VARCHAR2,
1138                      X_Attribute10                      VARCHAR2,
1139                      X_Attribute11                      VARCHAR2,
1140                      X_Attribute12                      VARCHAR2,
1141                      X_Attribute13                      VARCHAR2,
1142                      X_Attribute14                      VARCHAR2,
1143                      X_Attribute15                      VARCHAR2
1144                     ) is
1145     l_progressPercentage number;
1146   begin
1147      Lock_Row(X_Rowid => X_Rowid,
1148                X_Wip_Entity_Id => X_Wip_Entity_Id,
1149                X_Operation_Seq_Num => X_Operation_Seq_Num,
1150                X_Organization_Id => X_Organization_Id,
1151                X_Repetitive_Schedule_Id => X_Repetitive_Schedule_Id,
1152                X_Operation_Sequence_Id => X_Operation_Sequence_Id,
1153                X_Standard_Operation_Id => X_Standard_Operation_Id,
1154                X_Department_Id => X_Department_Id,
1155                X_Description => X_Description,
1156                X_Scheduled_Quantity => X_Scheduled_Quantity,
1157                X_Quantity_In_Queue => X_Quantity_In_Queue,
1158                X_Quantity_Running => X_Quantity_Running,
1159                X_Quantity_Waiting_To_Move => X_Quantity_Waiting_To_Move,
1160                X_Quantity_Rejected => X_Quantity_Rejected,
1161                X_Quantity_Scrapped => X_Quantity_Scrapped,
1162                X_Quantity_Completed => X_Quantity_Completed,
1163                X_First_Unit_Start_Date => X_First_Unit_Start_Date,
1164                X_First_Unit_Completion_Date => X_First_Unit_Completion_Date,
1165                X_Last_Unit_Start_Date => X_Last_Unit_Start_Date,
1166                X_Last_Unit_Completion_Date => X_Last_Unit_Completion_Date,
1167                X_Count_Point_Type => X_Count_Point_Type,
1168                X_Backflush_Flag => X_Backflush_Flag,
1169                X_Minimum_Transfer_Quantity => X_Minimum_Transfer_Quantity,
1170                X_Date_Last_Moved => X_Date_Last_Moved,
1171                X_Progress_percentage => l_progressPercentage,
1172                X_Attribute_Category => X_Attribute_Category,
1173                X_Attribute1 => X_Attribute1,
1174                X_Attribute2 => X_Attribute2,
1175                X_Attribute3 => X_Attribute3,
1176                X_Attribute4 => X_Attribute4,
1177                X_Attribute5 => X_Attribute5,
1178                X_Attribute6 => X_Attribute6,
1179                X_Attribute7 => X_Attribute7,
1180                X_Attribute8 => X_Attribute8,
1181                X_Attribute9 => X_Attribute9,
1182                X_Attribute10 => X_Attribute10,
1183                X_Attribute11 => X_Attribute11,
1184                X_Attribute12 => X_Attribute12,
1185                X_Attribute13 => X_Attribute13,
1186                X_Attribute14 => X_Attribute14,
1187                X_Attribute15 => X_Attribute15,
1188 															X_CHECK_SKILL => null);
1189   end Lock_Row;
1190 
1191 
1192   PROCEDURE Update_Row(X_Rowid                          VARCHAR2,
1193                        X_Wip_Entity_Id                  NUMBER,
1194                        X_Operation_Seq_Num              NUMBER,
1195                        X_Organization_Id                NUMBER,
1196                        X_Repetitive_Schedule_Id         NUMBER,
1197                        X_Last_Update_Date               DATE,
1198                        X_Last_Updated_By                NUMBER,
1199                        X_Last_Update_Login              NUMBER,
1200                        X_Operation_Sequence_Id          NUMBER,
1201                        X_Standard_Operation_Id          NUMBER,
1202                        X_Department_Id                  NUMBER,
1203                        X_Description                    VARCHAR2,
1204                        X_Scheduled_Quantity             NUMBER,
1205                        X_Quantity_In_Queue              NUMBER,
1206                        X_Quantity_Running               NUMBER,
1207                        X_Quantity_Waiting_To_Move       NUMBER,
1208                        X_Quantity_Rejected              NUMBER,
1209                        X_Quantity_Scrapped              NUMBER,
1210                        X_Quantity_Completed             NUMBER,
1211                        X_First_Unit_Start_Date          DATE,
1212                        X_First_Unit_Completion_Date     DATE,
1213                        X_Last_Unit_Start_Date           DATE,
1214                        X_Last_Unit_Completion_Date      DATE,
1215                        X_Count_Point_Type               NUMBER,
1216                        X_Backflush_Flag                 NUMBER,
1217                        X_Minimum_Transfer_Quantity      NUMBER,
1218                        X_Date_Last_Moved                DATE,
1219                        X_Attribute_Category             VARCHAR2,
1220                        X_Attribute1                     VARCHAR2,
1221                        X_Attribute2                     VARCHAR2,
1222                        X_Attribute3                     VARCHAR2,
1223                        X_Attribute4                     VARCHAR2,
1224                        X_Attribute5                     VARCHAR2,
1225                        X_Attribute6                     VARCHAR2,
1226                        X_Attribute7                     VARCHAR2,
1227                        X_Attribute8                     VARCHAR2,
1228                        X_Attribute9                     VARCHAR2,
1229                        X_Attribute10                    VARCHAR2,
1230                        X_Attribute11                    VARCHAR2,
1231                        X_Attribute12                    VARCHAR2,
1232                        X_Attribute13                    VARCHAR2,
1233                        X_Attribute14                    VARCHAR2,
1234                        X_Attribute15                    VARCHAR2
1235                       ) is
1236     l_progressPercentage number;
1237   begin
1238     Update_Row(X_Rowid => X_Rowid,
1239                X_Wip_Entity_Id => X_Wip_Entity_Id,
1240                X_Operation_Seq_Num => X_Operation_Seq_Num,
1241                X_Organization_Id => X_Organization_Id,
1242                X_Repetitive_Schedule_Id => X_Repetitive_Schedule_Id,
1243                X_Last_Update_Date => X_Last_Update_Date,
1244                X_Last_Updated_By => X_Last_Updated_By,
1245                X_Last_Update_Login => X_Last_Update_Login,
1246                X_Operation_Sequence_Id => X_Operation_Sequence_Id,
1247                X_Standard_Operation_Id => X_Standard_Operation_Id,
1248                X_Department_Id => X_Department_Id,
1249                X_Description => X_Description,
1250                X_Scheduled_Quantity => X_Scheduled_Quantity,
1251                X_Quantity_In_Queue => X_Quantity_In_Queue,
1252                X_Quantity_Running => X_Quantity_Running,
1253                X_Quantity_Waiting_To_Move => X_Quantity_Waiting_To_Move,
1254                X_Quantity_Rejected => X_Quantity_Rejected,
1255                X_Quantity_Scrapped => X_Quantity_Scrapped,
1256                X_Quantity_Completed => X_Quantity_Completed,
1257                X_First_Unit_Start_Date => X_First_Unit_Start_Date,
1258                X_First_Unit_Completion_Date => X_First_Unit_Completion_Date,
1259                X_Last_Unit_Start_Date => X_Last_Unit_Start_Date,
1260                X_Last_Unit_Completion_Date => X_Last_Unit_Completion_Date,
1261                X_Count_Point_Type => X_Count_Point_Type,
1262                X_Backflush_Flag => X_Backflush_Flag,
1263                X_Minimum_Transfer_Quantity => X_Minimum_Transfer_Quantity,
1264                X_Date_Last_Moved => X_Date_Last_Moved,
1265                X_Progress_percentage => l_progressPercentage,
1266                X_Attribute_Category => X_Attribute_Category,
1267                X_Attribute1 => X_Attribute1,
1268                X_Attribute2 => X_Attribute2,
1269                X_Attribute3 => X_Attribute3,
1270                X_Attribute4 => X_Attribute4,
1271                X_Attribute5 => X_Attribute5,
1272                X_Attribute6 => X_Attribute6,
1273                X_Attribute7 => X_Attribute7,
1274                X_Attribute8 => X_Attribute8,
1275                X_Attribute9 => X_Attribute9,
1276                X_Attribute10 => X_Attribute10,
1277                X_Attribute11 => X_Attribute11,
1278                X_Attribute12 => X_Attribute12,
1279                X_Attribute13 => X_Attribute13,
1280                X_Attribute14 => X_Attribute14,
1281                X_Attribute15 => X_Attribute15,
1282 															X_CHECK_SKILL => null);
1283   end Update_Row;
1284 
1285 END WIP_OPERATIONS_PKG;