476: --l_line_rec.item_description := 'Sentinel Standard Desktop';
477: l_line_rec.sourced_from := 'INVENTORY';
478: l_line_rec.ordered_quantity := CSP_RESERVED_LINES_rec.quantity;
479: l_line_rec.unit_of_measure := l_primary_uom_code;
480: l_line_rec.dest_subinventory := FND_PROFILE.value(NAME => 'CSP_REPAIR_SUP_ORG_DEFECT_SUBINV');
481: --l_line_rec.dest_subinventory := 'FldSvc';
482: l_line_rec.source_organization_id := CSP_RESERVED_LINES_rec.defective_organization_id;
483: --l_line_Rec.order_line_id := 50762;
484: --l_line_rec.source_subinventory := 'Stores';
499: 2. Completion Date - Repair_Lead_Time = Start date of the wip job
500: Here Internal order Need_by_date should be equal to Start date of the wip job.
501: **/
502:
503: l_sec_inv_name := FND_PROFILE.value(NAME => 'CSP_REPAIR_SUP_ORG_DEFECT_SUBINV');
504:
505: Begin
506: SELECT LOCATION_ID
507: INTO l_ship_to_location_id
535: End if;
536:
537: --l_header_rec.description := 'Test Req';
538: --l_header_rec.order_type_id := 1430;
539: FND_PROFILE.GET('CSP_ORDER_TYPE', l_header_rec.order_type_id);
540: l_header_rec.dest_organization_id := l_dest_organization_id;
541: l_header_rec.operation := csp_parts_order.G_OPR_CREATE;
542: l_header_rec.ship_to_location_id := l_ship_to_location_id;
543: l_header_rec.requisition_number := NULL;
1190: WHERE CSP_REPAIR_PO_HEADERS_REC.WIP_ID = WIP_ENTITY_ID;
1191:
1192: L_WIP_REMAIN_QTY := NVL(L_WIP_START_QUANTITY,0) - (NVL(CSP_REPAIR_PO_HEADERS_REC.RECEIVED_QTY,0) + NVL(L_WIP_QUANTITY_SCRAPPED,0));
1193:
1194: l_usable_subinv := FND_PROFILE.value(NAME => 'CSP_REPAIR_SUP_ORG_USABLE_SUBINV');
1195:
1196: IF ( L_WIP_REMAIN_QTY - (NVL(PO_REQ_RECEIVED_QTY_REC.QUANTITY_RECEIVED,0) - NVL(CSP_REPAIR_PO_HEADERS_REC.RECEIVED_QTY,0)) <= 0 )
1197: OR
1198: ( CSP_REPAIR_PO_HEADERS_rec.quantity - (NVL(PO_REQ_RECEIVED_QTY_REC.QUANTITY_RECEIVED,0) + NVL(L_WIP_QUANTITY_SCRAPPED,0)) <= 0 )
1736: FND_MESSAGE.SET_TOKEN ('ITEM_NUMBER', X_ITEM_NUMBER,TRUE);
1737: FND_MSG_PUB.ADD;
1738: RAISE EXCP_USER_DEFINED;
1739: Else
1740: l_defective_subinv := FND_PROFILE.value(NAME => 'CSP_REPAIR_SUP_ORG_DEFECT_SUBINV');
1741:
1742: Select sum(nvl(scrap_qty,0) + nvl(adjusted_qty,0))
1743: into l_total_scrap_adjust_qty
1744: from CSP_REPAIR_PO_LINES
1756: i.e WIP_JOB qty is returned from WIP JOB to Repair Supplier Org's Defect subinv
1757: **/
1758:
1759: If p_SCRAP_ADJUST_FLAG = 'SCRAP' then
1760: Prof_val := fnd_profile.value('CSP_ACCOUNT_SCRAP');
1761: l_account_id := Get_CSP_Acccount_ID (CSP_REPAIR_PO_SCRAP_rec.repair_supplier_org_id, p_SCRAP_ADJUST_FLAG,Prof_val );
1762: elsif p_SCRAP_ADJUST_FLAG = 'NEGATIVE ADJUSTMENT' then
1763: Prof_val := fnd_profile.value('CSP_ACCT_ADJUSTMENT');
1764: l_account_id := Get_CSP_Acccount_ID (CSP_REPAIR_PO_SCRAP_rec.repair_supplier_org_id, p_SCRAP_ADJUST_FLAG,Prof_val );
1759: If p_SCRAP_ADJUST_FLAG = 'SCRAP' then
1760: Prof_val := fnd_profile.value('CSP_ACCOUNT_SCRAP');
1761: l_account_id := Get_CSP_Acccount_ID (CSP_REPAIR_PO_SCRAP_rec.repair_supplier_org_id, p_SCRAP_ADJUST_FLAG,Prof_val );
1762: elsif p_SCRAP_ADJUST_FLAG = 'NEGATIVE ADJUSTMENT' then
1763: Prof_val := fnd_profile.value('CSP_ACCT_ADJUSTMENT');
1764: l_account_id := Get_CSP_Acccount_ID (CSP_REPAIR_PO_SCRAP_rec.repair_supplier_org_id, p_SCRAP_ADJUST_FLAG,Prof_val );
1765: End if;
1766: csp_transactions_pub.transact_material
1767: ( p_api_version => 1.0
2205: l_account_id NUMBER;
2206: Cursor l_Get_Account_Id_Csr IS
2207: Select distribution_account
2208: From mtl_generic_dispositions
2209: Where segment1 = Prof_val--need to change this value based on fnd_profile.value('csp_scar_adjust_account')
2210: And organization_id = p_organization_id
2211: And enabled_flag = 'Y'
2212: And trunc(nvl(effective_date, sysdate-1)) <= trunc(sysdate)
2213: And trunc(nvl(disable_date, sysdate+1)) >= trunc(sysdate);