27: transaction_id rcv_transactions.transaction_id%type,
28: subinventory rcv_transactions.subinventory%type,
29: locator_id rcv_transactions.locator_id%type,
30: transaction_type rcv_transactions.transaction_type%type,
31: ro_serial_number csd_repairs.serial_number%type ,
32: repair_number csd_repairs.repair_number%type,
33: ro_uom csd_repairs.unit_of_measure%type,
34: ro_item_id csd_repairs.inventory_item_id%type ,
35: product_transaction_id csd_product_transactions.product_transaction_id%type,
28: subinventory rcv_transactions.subinventory%type,
29: locator_id rcv_transactions.locator_id%type,
30: transaction_type rcv_transactions.transaction_type%type,
31: ro_serial_number csd_repairs.serial_number%type ,
32: repair_number csd_repairs.repair_number%type,
33: ro_uom csd_repairs.unit_of_measure%type,
34: ro_item_id csd_repairs.inventory_item_id%type ,
35: product_transaction_id csd_product_transactions.product_transaction_id%type,
36: repair_line_id csd_product_transactions.repair_line_id%type,
29: locator_id rcv_transactions.locator_id%type,
30: transaction_type rcv_transactions.transaction_type%type,
31: ro_serial_number csd_repairs.serial_number%type ,
32: repair_number csd_repairs.repair_number%type,
33: ro_uom csd_repairs.unit_of_measure%type,
34: ro_item_id csd_repairs.inventory_item_id%type ,
35: product_transaction_id csd_product_transactions.product_transaction_id%type,
36: repair_line_id csd_product_transactions.repair_line_id%type,
37: action_code csd_product_transactions.action_code%type,
30: transaction_type rcv_transactions.transaction_type%type,
31: ro_serial_number csd_repairs.serial_number%type ,
32: repair_number csd_repairs.repair_number%type,
33: ro_uom csd_repairs.unit_of_measure%type,
34: ro_item_id csd_repairs.inventory_item_id%type ,
35: product_transaction_id csd_product_transactions.product_transaction_id%type,
36: repair_line_id csd_product_transactions.repair_line_id%type,
37: action_code csd_product_transactions.action_code%type,
38: source_serial_number csd_product_transactions.source_serial_number%type,
52: order_line_id csd_product_transactions.ORDER_LINE_ID%type,
53: req_header_id csd_product_transactions.REQ_HEADER_ID%type,
54: req_line_id csd_product_transactions.REPAIR_LINE_ID%type,
55: prod_txn_rcvd_qty csd_product_transactions.quantity_received%type,
56: ro_qty csd_repairs.quantity%type,
57: ro_rcvd_qty csd_repairs.quantity_rcvd%type,
58: inventory_item_id csd_repairs.inventory_item_id%type,
59: ro_uom csd_repairs.unit_of_measure%type,
60: requisition_number po_requisition_headers_all.segment1%type,
53: req_header_id csd_product_transactions.REQ_HEADER_ID%type,
54: req_line_id csd_product_transactions.REPAIR_LINE_ID%type,
55: prod_txn_rcvd_qty csd_product_transactions.quantity_received%type,
56: ro_qty csd_repairs.quantity%type,
57: ro_rcvd_qty csd_repairs.quantity_rcvd%type,
58: inventory_item_id csd_repairs.inventory_item_id%type,
59: ro_uom csd_repairs.unit_of_measure%type,
60: requisition_number po_requisition_headers_all.segment1%type,
61: ordered_quantity oe_order_lines_all.ordered_quantity%type,
54: req_line_id csd_product_transactions.REPAIR_LINE_ID%type,
55: prod_txn_rcvd_qty csd_product_transactions.quantity_received%type,
56: ro_qty csd_repairs.quantity%type,
57: ro_rcvd_qty csd_repairs.quantity_rcvd%type,
58: inventory_item_id csd_repairs.inventory_item_id%type,
59: ro_uom csd_repairs.unit_of_measure%type,
60: requisition_number po_requisition_headers_all.segment1%type,
61: ordered_quantity oe_order_lines_all.ordered_quantity%type,
62: order_number oe_order_headers_all.order_number%type
55: prod_txn_rcvd_qty csd_product_transactions.quantity_received%type,
56: ro_qty csd_repairs.quantity%type,
57: ro_rcvd_qty csd_repairs.quantity_rcvd%type,
58: inventory_item_id csd_repairs.inventory_item_id%type,
59: ro_uom csd_repairs.unit_of_measure%type,
60: requisition_number po_requisition_headers_all.segment1%type,
61: ordered_quantity oe_order_lines_all.ordered_quantity%type,
62: order_number oe_order_headers_all.order_number%type
63: );
79: locator_id wsh_delivery_details.locator_id%type,
80: order_line_number oe_order_lines_all.line_number%type ,
81: date_shipped oe_order_lines_all.actual_shipment_date%type ,
82: line_id oe_order_lines_all.line_id%type , --Bug#6779806
83: repair_number csd_repairs.repair_number%type,
84: repair_line_id csd_repairs.repair_line_id%type,
85: ro_uom csd_repairs.unit_of_measure%type ,
86: ro_item_id csd_repairs.inventory_item_id%type ,
87: estimate_quantity cs_estimate_details.quantity_required%type ,
80: order_line_number oe_order_lines_all.line_number%type ,
81: date_shipped oe_order_lines_all.actual_shipment_date%type ,
82: line_id oe_order_lines_all.line_id%type , --Bug#6779806
83: repair_number csd_repairs.repair_number%type,
84: repair_line_id csd_repairs.repair_line_id%type,
85: ro_uom csd_repairs.unit_of_measure%type ,
86: ro_item_id csd_repairs.inventory_item_id%type ,
87: estimate_quantity cs_estimate_details.quantity_required%type ,
88: prod_txn_serial_num csd_product_transactions.source_serial_number%type ,
81: date_shipped oe_order_lines_all.actual_shipment_date%type ,
82: line_id oe_order_lines_all.line_id%type , --Bug#6779806
83: repair_number csd_repairs.repair_number%type,
84: repair_line_id csd_repairs.repair_line_id%type,
85: ro_uom csd_repairs.unit_of_measure%type ,
86: ro_item_id csd_repairs.inventory_item_id%type ,
87: estimate_quantity cs_estimate_details.quantity_required%type ,
88: prod_txn_serial_num csd_product_transactions.source_serial_number%type ,
89: source_instance_id csd_product_transactions.source_instance_id%type,
82: line_id oe_order_lines_all.line_id%type , --Bug#6779806
83: repair_number csd_repairs.repair_number%type,
84: repair_line_id csd_repairs.repair_line_id%type,
85: ro_uom csd_repairs.unit_of_measure%type ,
86: ro_item_id csd_repairs.inventory_item_id%type ,
87: estimate_quantity cs_estimate_details.quantity_required%type ,
88: prod_txn_serial_num csd_product_transactions.source_serial_number%type ,
89: source_instance_id csd_product_transactions.source_instance_id%type,
90: product_transaction_id csd_product_transactions.product_transaction_id%type,
131: repair_line_id CSD_REPAIR_JOB_XREF.repair_line_id%type,
132: allocated_comp_qty CSD_REPAIR_JOB_XREF.quantity_completed%type ,
133: allocated_job_qty CSD_REPAIR_JOB_XREF.quantity%type ,
134: organization_id CSD_REPAIR_JOB_XREF.organization_id%type,
135: repair_number CSD_REPAIRS.repair_number%type,
136: promise_date CSD_REPAIRS.promise_date%type,
137: ro_serial_num CSD_REPAIRS.serial_number%type ,
138: ro_item_id CSD_REPAIRS.inventory_item_id%type ,
139: job_completed_qty WIP_DISCRETE_JOBS.quantity_completed%type ,
132: allocated_comp_qty CSD_REPAIR_JOB_XREF.quantity_completed%type ,
133: allocated_job_qty CSD_REPAIR_JOB_XREF.quantity%type ,
134: organization_id CSD_REPAIR_JOB_XREF.organization_id%type,
135: repair_number CSD_REPAIRS.repair_number%type,
136: promise_date CSD_REPAIRS.promise_date%type,
137: ro_serial_num CSD_REPAIRS.serial_number%type ,
138: ro_item_id CSD_REPAIRS.inventory_item_id%type ,
139: job_completed_qty WIP_DISCRETE_JOBS.quantity_completed%type ,
140: job_qty WIP_DISCRETE_JOBS.start_quantity%type ,
133: allocated_job_qty CSD_REPAIR_JOB_XREF.quantity%type ,
134: organization_id CSD_REPAIR_JOB_XREF.organization_id%type,
135: repair_number CSD_REPAIRS.repair_number%type,
136: promise_date CSD_REPAIRS.promise_date%type,
137: ro_serial_num CSD_REPAIRS.serial_number%type ,
138: ro_item_id CSD_REPAIRS.inventory_item_id%type ,
139: job_completed_qty WIP_DISCRETE_JOBS.quantity_completed%type ,
140: job_qty WIP_DISCRETE_JOBS.start_quantity%type ,
141: date_completed WIP_DISCRETE_JOBS.date_completed%type,
134: organization_id CSD_REPAIR_JOB_XREF.organization_id%type,
135: repair_number CSD_REPAIRS.repair_number%type,
136: promise_date CSD_REPAIRS.promise_date%type,
137: ro_serial_num CSD_REPAIRS.serial_number%type ,
138: ro_item_id CSD_REPAIRS.inventory_item_id%type ,
139: job_completed_qty WIP_DISCRETE_JOBS.quantity_completed%type ,
140: job_qty WIP_DISCRETE_JOBS.start_quantity%type ,
141: date_completed WIP_DISCRETE_JOBS.date_completed%type,
142: job_item_id WIP_DISCRETE_JOBS.primary_item_id%type,
740: wdj.primary_item_id job_item_id,
741: we.wip_entity_name,
742: mtl.serial_number_control_code
743: from CSD_REPAIR_JOB_XREF crj,
744: CSD_REPAIRS cra,
745: WIP_DISCRETE_JOBS wdj,
746: WIP_ENTITIES we,
747: MTL_SYSTEM_ITEMS mtl
748: where wdj.wip_entity_id = crj.wip_entity_id
776: wdj.primary_item_id job_item_id,
777: we.wip_entity_name,
778: mtl.serial_number_control_code
779: from CSD_REPAIR_JOB_XREF crj,
780: CSD_REPAIRS cra,
781: WIP_DISCRETE_JOBS wdj,
782: WIP_ENTITIES we,
783: MTL_SYSTEM_ITEMS mtl
784: where wdj.wip_entity_id = crj.wip_entity_id
1067: where crh.repair_line_id = crj.repair_line_id
1068: and crj.wip_entity_id = JOB.wip_entity_id
1069: and crh.event_code = 'JC')
1070: and mut.serial_number not in (Select cra.serial_number
1071: from csd_repairs cra,
1072: csd_repair_job_xref crj
1073: where cra.repair_line_id = crj.repair_line_id
1074: and crj.wip_entity_id = JOB.wip_entity_id
1075: and cra.serial_number is not null)
1620:
1621: -- When Jobs are created from the UI, a record is inserted in csd_repair_job_xref
1622: -- with the job name. Once the WIP Job is created in wip_discrete_jobs
1623: -- then the update program will find the wip_entity_id and update it.
1624: -- Also it updates the quantity_in_wip in the csd_repairs with Job start quantity
1625: --
1626: -- When the WIP Job is submitted from the UI, the record would look as follows:
1627: -- CSD_REPAIR_JOB_XREF
1628: -- Repair Job Repair Order Allocated Qty Job Name Job Qty Wip_entity_ID
1720: RAISE FND_API.G_EXC_ERROR;
1721: End IF;
1722:
1723: -- Updating repair order with the Job allocated qty
1724: Update csd_repairs
1725: set quantity_in_wip = NVL(quantity_in_wip,0) + K.allocated_job_qty,
1726: last_update_date = sysdate,
1727: last_updated_by = fnd_global.user_id,
1728: object_version_number = object_version_number+1,
1959: End If;
1960: -- bug#7497790, 12.1 FP, subhat.
1961: -- automatically update RO status when item is received.
1962: -- dont show any error messages. Pass p_validation_level = fnd_api.g_valid_level_full to receive messages.
1963: csd_repairs_util.auto_update_ro_status(
1964: p_api_version => 1,
1965: p_commit => p_commit,
1966: p_init_msg_list => p_init_msg_list,
1967: p_repair_line_id => p_repair_line_id,
2142: ced.order_line_id est_order_line_id,
2143: ced.inventory_item_id prod_txn_item_id
2144: FROM csd_product_transactions cpt,
2145: cs_estimate_details ced,
2146: csd_repairs cra,
2147: rcv_transactions rcvt,
2148: oe_order_headers_all oeh,
2149: oe_order_lines_all oel,
2150: hr_all_organization_units haou
2219: ced.order_line_id est_order_line_id,
2220: ced.inventory_item_id prod_txn_item_id
2221: FROM csd_product_transactions cpt,
2222: cs_estimate_details ced,
2223: csd_repairs cra,
2224: rcv_transactions rcvt,
2225: oe_order_headers_all oeh,
2226: oe_order_lines_all oel,
2227: hr_all_organization_units haou
2290: abs(ced.quantity_required) estimate_quantity,
2291: ced.order_line_id est_order_line_id,
2292: ced.inventory_item_id prod_txn_item_id
2293: FROM hr_all_organization_units haou,
2294: csd_repairs cra,
2295: oe_order_headers_all oeh,
2296: oe_order_lines_all oel,
2297: rcv_transactions rcvt,
2298: cs_estimate_details ced,
2338:
2339: --- cursor for Cancelled orders...
2340: CURSOR Cur_Cancelled_repair_lines IS
2341: SELECT cra.REPAIR_LINE_ID
2342: FROM csd_repairs cra,
2343: cs_estimate_details ced,
2344: csd_product_transactions cpt
2345: WHERE cpt.action_type in ('RMA', 'RMA_THIRD_PTY')
2346: AND cpt.prod_txn_status in ( 'BOOKED', 'SUBMITTED')
2796: l_result_quantity := NVL(i.received_quantity,0);
2797: END IF;
2798: Debug('l_result_quantity='||TO_CHAR(l_result_quantity),l_mod_name,1);
2799:
2800: -- Update csd_repairs only if the action code is
2801: -- cust_prod or exchange
2802: IF I.action_code in ( 'CUST_PROD','EXCHANGE') then
2803:
2804: IF I.ro_item_id = I.inventory_item_id THEN
2803:
2804: IF I.ro_item_id = I.inventory_item_id THEN
2805: -- Update the serial num and instance id if the item on ro
2806: -- is same as prod txn
2807: update csd_repairs
2808: set quantity_rcvd = nvl(quantity_rcvd,0)+ l_result_quantity,
2809: object_version_number = object_version_number+1,
2810: customer_product_id = l_instance_id,
2811: serial_number = l_st_serial_num,
2828:
2829: ELSE
2830: -- Update the qty if the item on ro
2831: -- is not same as prod txn
2832: update csd_repairs
2833: set quantity_rcvd = nvl(quantity_rcvd,0)+ l_result_quantity,
2834: object_version_number = object_version_number+1,
2835: last_update_date = sysdate,
2836: last_updated_by = fnd_global.user_id,
3140: prh.segment1 requisition_number,
3141: oel.ordered_quantity,
3142: oeh.order_number
3143: from csd_product_transactions cpt,
3144: csd_repairs cra,
3145: po_requisition_headers_all prh,
3146: oe_order_lines_all oel,
3147: oe_order_headers_all oeh
3148: where cpt.repair_line_id = cra.repair_line_id
3176: prh.segment1 requisition_number,
3177: oel.ordered_quantity,
3178: oeh.order_number
3179: from csd_product_transactions cpt,
3180: csd_repairs cra,
3181: po_requisition_headers_all prh,
3182: oe_order_lines_all oel,
3183: oe_order_headers_all oeh
3184: where cpt.repair_line_id = cra.repair_line_id
3520: from rcv_serial_transactions rcvt
3521: where rcvt.transaction_id = DEL.transaction_id
3522: and rownum = 1
3523: and not exists (Select 'NOT EXIST'
3524: from csd_repairs cra,
3525: csd_product_transactions cpt
3526: where cra.repair_line_id = cpt.repair_line_id
3527: and cpt.action_type = 'MOVE_IN'
3528: and cpt.order_header_id = ro.order_header_id
3629: Debug('l_rcvd_qty : '||l_rcvd_qty,l_mod_name,1);
3630:
3631: -- Update the serial number on repair order
3632: -- with the rcvd serial number
3633: UPDATE CSD_REPAIRS
3634: SET SERIAL_NUMBER = l_serial_num,
3635: quantity_rcvd = nvl(quantity_rcvd,0) + l_rcvd_qty,
3636: customer_product_id = l_instance_id,
3637: object_version_number = object_version_number+1,
3888: from rcv_serial_transactions rcvt
3889: where rcvt.transaction_id = DEL.transaction_id
3890: and rownum = 1
3891: and not exists (Select 'NOT EXIST'
3892: from csd_repairs cra,
3893: csd_product_transactions cpt
3894: where cra.repair_line_id = cpt.repair_line_id
3895: and cpt.action_type = 'MOVE_IN'
3896: and cpt.order_header_id = ro.order_header_id
3997: Debug('l_rcvd_qty : '||l_rcvd_qty,l_mod_name,1);
3998:
3999: -- Update the serial number on repair order
4000: -- with the rcvd serial number
4001: UPDATE CSD_REPAIRS
4002: SET SERIAL_NUMBER = l_serial_num,
4003: quantity_rcvd = nvl(quantity_rcvd,0) + l_rcvd_qty,
4004: customer_product_id = l_instance_id,
4005: object_version_number = object_version_number+1,
4165: from rcv_serial_transactions rcvt
4166: where rcvt.transaction_id = RCV.transaction_id
4167: and rownum = 1
4168: and not exists (Select 'NOT EXIST'
4169: from csd_repairs cra,
4170: csd_product_transactions cpt
4171: where cra.repair_line_id = cpt.repair_line_id
4172: and cpt.order_header_id = ro.order_header_id
4173: and cra.serial_number = rcvt.serial_num);
4272: Debug('l_rcvd_qty'||l_rcvd_qty,l_mod_name,1);
4273:
4274: -- Update repair order with the rcvd serial number
4275: -- and the rcvd qty
4276: UPDATE CSD_REPAIRS
4277: SET SERIAL_NUMBER = l_serial_num,
4278: quantity_rcvd = nvl(quantity_rcvd,0) + l_rcvd_qty,
4279: customer_product_id = l_instance_id,
4280: object_version_number = object_version_number+1,
4554: prh.segment1 requisition_number,
4555: oel.ordered_quantity,
4556: oeh.order_number
4557: from csd_product_transactions cpt,
4558: csd_repairs cra,
4559: po_requisition_headers_all prh,
4560: oe_order_lines_all oel,
4561: oe_order_headers_all oeh
4562: where cpt.repair_line_id = cra.repair_line_id
4590: prh.segment1 requisition_number,
4591: oel.ordered_quantity,
4592: oeh.order_number
4593: from csd_product_transactions cpt,
4594: csd_repairs cra,
4595: po_requisition_headers_all prh,
4596: oe_order_lines_all oel,
4597: oe_order_headers_all oeh
4598: where cpt.repair_line_id = cra.repair_line_id
4936: from rcv_serial_transactions rcvt
4937: where rcvt.transaction_id = DEL.transaction_id
4938: and rownum = 1
4939: and not exists (Select 'NOT EXIST'
4940: from csd_repairs cra,
4941: csd_product_transactions cpt
4942: where cra.repair_line_id = cpt.repair_line_id
4943: and cpt.action_type = 'MOVE_OUT'
4944: and cpt.order_header_id = ro.order_header_id
5050: RO. Move out line should not change the serial and instance number of RO
5051: so commenting the below query
5052: */
5053: /*
5054: UPDATE CSD_REPAIRS
5055: SET SERIAL_NUMBER = l_serial_num,
5056: quantity_rcvd = nvl(quantity_rcvd,0) + l_rcvd_qty,
5057: customer_product_id = l_instance_id,
5058: object_version_number = object_version_number+1,
5309: from rcv_serial_transactions rcvt
5310: where rcvt.transaction_id = DEL.transaction_id
5311: and rownum = 1
5312: and not exists (Select 'NOT EXIST'
5313: from csd_repairs cra,
5314: csd_product_transactions cpt
5315: where cra.repair_line_id = cpt.repair_line_id
5316: and cpt.action_type = 'MOVE_OUT'
5317: and cpt.order_header_id = ro.order_header_id
5423: RO. Move out line should not change the serial and instance number of RO
5424: so commenting the below query
5425: */
5426: /*
5427: UPDATE CSD_REPAIRS
5428: SET SERIAL_NUMBER = l_serial_num,
5429: quantity_rcvd = nvl(quantity_rcvd,0) + l_rcvd_qty,
5430: customer_product_id = l_instance_id,
5431: object_version_number = object_version_number+1,
5599: --This code (condition) should not be here. I am not sure why we are checking
5600: --the serial number in the production transaction table. After commented this
5601: --condition, it worked for the customer.
5602: -- and not exists (Select 'NOT EXIST'
5603: -- from csd_repairs cra,
5604: -- csd_product_transactions cpt
5605: -- where cra.repair_line_id = cpt.repair_line_id
5606: -- and cpt.order_header_id = ro.order_header_id
5607: -- and cra.serial_number = rcvt.serial_num);
5711: RO. Move out line should not change the serial and instance number of RO
5712: so commenting the below query
5713: */
5714: /*
5715: UPDATE CSD_REPAIRS
5716: SET SERIAL_NUMBER = l_serial_num,
5717: quantity_rcvd = nvl(quantity_rcvd,0) + l_rcvd_qty,
5718: customer_product_id = l_instance_id,
5719: object_version_number = object_version_number+1,
6180: hao.name org_name
6181: from
6182: csd_product_transactions cpt,
6183: cs_estimate_details ced,
6184: csd_repairs cra,
6185: wsh_delivery_details dd ,
6186: wsh_serial_numbers dsn,--Added to fix 3801614
6187: --Changed to view from table, bug: 4341784
6188: wsh_delivery_assignments_v wda,
6256: hao.name org_name
6257: from
6258: csd_product_transactions cpt,
6259: cs_estimate_details ced,
6260: csd_repairs cra,
6261: wsh_delivery_details dd ,
6262: wsh_serial_numbers dsn,--Added to fix 3801614
6263: --Changed to view from table, bug: 4341784
6264: wsh_delivery_assignments_v wda,
6340: hao.name org_name
6341: from
6342: csd_product_transactions cpt,
6343: cs_estimate_details ced,
6344: csd_repairs cra,
6345: wsh_delivery_details dd ,
6346: wsh_serial_numbers dsn,--Added to fix 3801614
6347: --Changed to view from table, bug: 4341784
6348: wsh_delivery_assignments_v wda,
6380:
6381: --- cursor for Cancelled orders...
6382: CURSOR Cur_Cancelled_repair_lines IS
6383: SELECT cra.REPAIR_LINE_ID
6384: FROM csd_repairs cra,
6385: cs_estimate_details ced,
6386: csd_product_transactions cpt
6387: WHERE cpt.action_type in ('SHIP', 'SHIP_THIRD_PTY')
6388: AND cpt.prod_txn_status in ( 'BOOKED', 'SUBMITTED')
6674:
6675: -- Update repair orders only for the following action codes
6676: IF I.action_code in ( 'CUST_PROD','EXCHANGE','REPLACEMENT') then
6677: -- Updating the repair order with qty
6678: update csd_repairs
6679: set quantity_shipped = nvl(quantity_shipped,0)+l_result_ship_qty,
6680: object_version_number = object_version_number+1,
6681: last_update_date = sysdate,
6682: last_updated_by = fnd_global.user_id,
7810:
7811: IF DEL.released_status in ('C','I') THEN
7812:
7813: -- Updating the repair order with shipped_qty
7814: Update csd_repairs
7815: set quantity_shipped = nvl(quantity_shipped,0) + DEL.shipped_quantity,
7816: object_version_number = object_version_number+1,
7817: last_update_date = sysdate,
7818: last_updated_by = fnd_global.user_id,
7918: cpt.repair_line_id
7919: into l_prod_txn_id,
7920: l_rep_line_id
7921: from csd_product_transactions cpt,
7922: csd_repairs cra
7923: where cpt.order_header_id = DEL.Header_id
7924: and cpt.action_type = 'MOVE_OUT'
7925: and cpt.action_code = 'USABLES'
7926: and cpt.prod_txn_status in ('BOOKED', 'RELEASED')
7960: RAISE PROCESS_ERROR;
7961: END IF;
7962:
7963: -- Updating the repair order with shipped_qty
7964: Update csd_repairs
7965: set quantity_shipped = 1,
7966: object_version_number = object_version_number+1,
7967: last_update_date = sysdate,
7968: last_updated_by = fnd_global.user_id,
8028: cpt.repair_line_id
8029: into l_prod_txn_id,
8030: l_rep_line_id
8031: from csd_product_transactions cpt,
8032: csd_repairs cra
8033: where cpt.repair_line_id = cra.repair_line_id
8034: and cpt.order_header_id = DEL.header_id
8035: and cpt.source_serial_number is null
8036: and cpt.action_type = 'MOVE_OUT'
8079: RAISE PROCESS_ERROR;
8080: END IF;
8081:
8082: -- Updating the repair order with shipped_qty
8083: Update csd_repairs
8084: set quantity_shipped = 1,
8085: object_version_number = object_version_number+1,
8086: last_update_date = sysdate,
8087: last_updated_by = fnd_global.user_id,
8175: cpt.repair_line_id
8176: into l_prod_txn_id,
8177: l_rep_line_id
8178: from csd_product_transactions cpt,
8179: csd_repairs cra
8180: where cpt.repair_line_id = cra.repair_line_id
8181: and cra.supercession_inv_item_id is null
8182: and cpt.source_serial_number is null
8183: and cra.serial_number = UT.serial_number
8216: RAISE PROCESS_ERROR;
8217: END IF;
8218:
8219: -- Updating the repair order with shipped_qty
8220: Update csd_repairs
8221: set quantity_shipped = 1,
8222: object_version_number = object_version_number+1,
8223: last_update_date = sysdate,
8224: last_updated_by = fnd_global.user_id,
8284: cpt.repair_line_id
8285: into l_prod_txn_id,
8286: l_rep_line_id
8287: from csd_product_transactions cpt,
8288: csd_repairs cra
8289: where cpt.repair_line_id = cra.repair_line_id
8290: and cpt.order_header_id = DEL.header_id
8291: and cpt.source_serial_number is null
8292: and cpt.action_type = 'MOVE_OUT'
8335: RAISE PROCESS_ERROR;
8336: END IF;
8337:
8338: -- Updating the repair order with shipped_qty
8339: Update csd_repairs
8340: set quantity_shipped = 1,
8341: object_version_number = object_version_number+1,
8342: last_update_date = sysdate,
8343: last_updated_by = fnd_global.user_id,
9032: ,rep.repair_line_id
9033: --,max(hist.repair_history_id) repair_history_id
9034: from csd_repair_tasks_v tsk
9035: ,csd_repair_history hist
9036: ,csd_repairs rep
9037: where rep.repair_line_id = tsk.source_object_id
9038: and tsk.source_object_id = hist.repair_line_id
9039: and tsk.task_id = hist.paramn1
9040: and ( tsk.task_status_id <> hist.paramn5 or tsk.owner_id <> hist.paramn3)
9597: -- If the return status is error then raise
9598: -- the Business Event
9599: IF NOT(l_return_status = FND_API.G_RET_STS_SUCCESS) THEN
9600:
9601: CSD_REPAIRS_PVT.LAUNCH_WFEXCEPTION_BEVENT(
9602: p_return_status => l_return_status,
9603: p_msg_count => l_msg_count,
9604: p_msg_data => l_msg_data,
9605: p_repair_line_id => l_orig_source_id,