14951: END IF;
14952:
14953: ELSE
14954:
14955: p_x_line_rec.accounting_rule_id := OE_Value_To_Id.accounting_rule
14956: ( p_accounting_rule => p_line_val_rec.accounting_rule
14957: );
14958:
14959: IF p_x_line_rec.accounting_rule_id = FND_API.G_MISS_NUM THEN
14979: END IF;
14980:
14981: ELSE
14982:
14983: p_x_line_rec.agreement_id := OE_Value_To_Id.agreement
14984: ( p_agreement => p_line_val_rec.agreement
14985: );
14986:
14987: IF p_x_line_rec.agreement_id = FND_API.G_MISS_NUM THEN
15007: END IF;
15008:
15009: ELSE
15010:
15011: p_x_line_rec.demand_bucket_type_code := OE_Value_To_Id.demand_bucket_type
15012: ( p_demand_bucket_type => p_line_val_rec.demand_bucket_type
15013: );
15014:
15015: IF p_x_line_rec.demand_bucket_type_code = FND_API.G_MISS_CHAR THEN
15035: END IF;
15036:
15037: ELSE
15038:
15039: p_x_line_rec.fob_point_code := OE_Value_To_Id.fob_point
15040: ( p_fob_point => p_line_val_rec.fob_point
15041: );
15042:
15043: IF p_x_line_rec.fob_point_code = FND_API.G_MISS_CHAR THEN
15063: END IF;
15064:
15065: ELSE
15066:
15067: p_x_line_rec.freight_terms_code := OE_Value_To_Id.freight_terms
15068: ( p_freight_terms => p_line_val_rec.freight_terms
15069: );
15070:
15071: IF p_x_line_rec.freight_terms_code = FND_API.G_MISS_CHAR THEN
15091: END IF;
15092:
15093: ELSE
15094:
15095: p_x_line_rec.shipping_method_code := OE_Value_To_Id.ship_method
15096: ( p_ship_method => p_line_val_rec.shipping_method
15097: );
15098:
15099: IF p_x_line_rec.shipping_method_code = FND_API.G_MISS_CHAR THEN
15121: END IF;
15122:
15123: ELSE
15124:
15125: p_x_line_rec.freight_carrier_code := OE_Value_To_Id.freight_carrier
15126: ( p_freight_carrier => p_line_val_rec.freight_carrier
15127: , p_ship_from_org_id => p_x_line_rec.ship_from_org_id
15128: );
15129:
15150: END IF;
15151:
15152: ELSE
15153:
15154: p_x_line_rec.intermed_ship_to_contact_id := OE_Value_To_Id.intermed_ship_to_contact
15155: ( p_intermed_ship_to_contact => p_line_val_rec.intermed_ship_to_contact
15156: , p_intermed_ship_to_org_id => p_x_line_rec.intermed_ship_to_org_id
15157: );
15158:
15185:
15186: ELSE
15187:
15188: /*1621182*/
15189: p_x_line_rec.intermed_ship_to_org_id := OE_Value_To_Id.intermed_ship_to_org
15190: ( p_intermed_ship_to_address1 => p_line_val_rec.intermed_ship_to_address1
15191: , p_intermed_ship_to_address2 => p_line_val_rec.intermed_ship_to_address2
15192: , p_intermed_ship_to_address3 => p_line_val_rec.intermed_ship_to_address3
15193: , p_intermed_ship_to_address4 => p_line_val_rec.intermed_ship_to_address4
15224: END IF;
15225:
15226: ELSE
15227:
15228: p_x_line_rec.inventory_item_id := OE_Value_To_Id.inventory_item
15229: ( p_inventory_item => p_line_val_rec.inventory_item
15230: );
15231:
15232: IF p_x_line_rec.inventory_item_id = FND_API.G_MISS_NUM THEN
15252: END IF;
15253:
15254: ELSE
15255:
15256: p_x_line_rec.invoicing_rule_id := OE_Value_To_Id.invoicing_rule
15257: ( p_invoicing_rule => p_line_val_rec.invoicing_rule
15258: );
15259:
15260: IF p_x_line_rec.invoicing_rule_id = FND_API.G_MISS_NUM THEN
15280: END IF;
15281:
15282: ELSE
15283:
15284: p_x_line_rec.item_type_code := OE_Value_To_Id.item_type
15285: ( p_item_type => p_line_val_rec.item_type
15286: );
15287:
15288: IF p_x_line_rec.item_type_code = FND_API.G_MISS_CHAR THEN
15308: END IF;
15309:
15310: ELSE
15311:
15312: p_x_line_rec.line_type_id := OE_Value_To_Id.line_type
15313: ( p_line_type => p_line_val_rec.line_type
15314: );
15315:
15316: IF p_x_line_rec.line_type_id = FND_API.G_MISS_NUM THEN
15336: END IF;
15337:
15338: ELSE
15339:
15340: p_x_line_rec.over_ship_reason_code := OE_Value_To_Id.over_ship_reason
15341: ( p_over_ship_reason => p_line_val_rec.over_ship_reason
15342: );
15343:
15344: IF p_x_line_rec.over_ship_reason_code = FND_API.G_MISS_CHAR THEN
15364: END IF;
15365:
15366: ELSE
15367:
15368: p_x_line_rec.payment_term_id := OE_Value_To_Id.payment_term
15369: ( p_payment_term => p_line_val_rec.payment_term
15370: );
15371:
15372: IF p_x_line_rec.payment_term_id = FND_API.G_MISS_NUM THEN
15392: END IF;
15393:
15394: ELSE
15395:
15396: p_x_line_rec.price_list_id := OE_Value_To_Id.price_list
15397: ( p_price_list => p_line_val_rec.price_list
15398: );
15399:
15400: IF p_x_line_rec.price_list_id = FND_API.G_MISS_NUM THEN
15420: END IF;
15421:
15422: ELSE
15423:
15424: p_x_line_rec.project_id := OE_Value_To_Id.project
15425: ( p_project => p_line_val_rec.project
15426: );
15427:
15428: IF p_x_line_rec.project_id = FND_API.G_MISS_NUM THEN
15448: END IF;
15449:
15450: ELSE
15451:
15452: p_x_line_rec.return_reason_code := OE_Value_To_Id.return_reason
15453: ( p_return_reason => p_line_val_rec.return_reason
15454: );
15455:
15456: IF p_x_line_rec.return_reason_code = FND_API.G_MISS_CHAR THEN
15478: END IF;
15479:
15480: ELSE
15481:
15482: p_x_line_rec.rla_schedule_type_code := OE_Value_To_Id.rla_schedule_type
15483: ( p_rla_schedule_type => p_line_val_rec.rla_schedule_type
15484: );
15485:
15486: IF p_x_line_rec.rla_schedule_type_code = FND_API.G_MISS_CHAR THEN
15506: END IF;
15507:
15508: ELSE
15509:
15510: p_x_line_rec.salesrep_id := OE_Value_To_Id.salesrep
15511: ( p_salesrep => p_line_val_rec.salesrep
15512: );
15513:
15514: IF p_x_line_rec.salesrep_id = FND_API.G_MISS_NUM THEN
15534: END IF;
15535:
15536: ELSE
15537:
15538: p_x_line_rec.shipment_priority_code := OE_Value_To_Id.shipment_priority
15539: ( p_shipment_priority => p_line_val_rec.shipment_priority
15540: );
15541:
15542: IF p_x_line_rec.shipment_priority_code = FND_API.G_MISS_CHAR THEN
15567: END IF;
15568:
15569: ELSE
15570:
15571: p_x_line_rec.ship_from_org_id := OE_Value_To_Id.ship_from_org
15572: ( p_ship_from_address1 => p_line_val_rec.ship_from_address1
15573: , p_ship_from_address2 => p_line_val_rec.ship_from_address2
15574: , p_ship_from_address3 => p_line_val_rec.ship_from_address3
15575: , p_ship_from_address4 => p_line_val_rec.ship_from_address4
15600: END IF;
15601:
15602: ELSE
15603:
15604: p_x_line_rec.task_id := OE_Value_To_Id.task
15605: ( p_task => p_line_val_rec.task
15606: );
15607:
15608: IF p_x_line_rec.task_id = FND_API.G_MISS_NUM THEN
15628: END IF;
15629:
15630: ELSE
15631:
15632: p_x_line_rec.tax_exempt_flag := OE_Value_To_Id.tax_exempt
15633: ( p_tax_exempt => p_line_val_rec.tax_exempt
15634: );
15635:
15636: IF p_x_line_rec.tax_exempt_flag = FND_API.G_MISS_CHAR THEN
15656: END IF;
15657:
15658: ELSE
15659:
15660: p_x_line_rec.tax_exempt_reason_code := OE_Value_To_Id.tax_exempt_reason
15661: ( p_tax_exempt_reason => p_line_val_rec.tax_exempt_reason
15662: );
15663:
15664: IF p_x_line_rec.tax_exempt_reason_code = FND_API.G_MISS_CHAR THEN
15684: END IF;
15685:
15686: ELSE
15687:
15688: p_x_line_rec.tax_point_code := OE_Value_To_Id.tax_point
15689: ( p_tax_point => p_line_val_rec.tax_point
15690: );
15691:
15692: IF p_x_line_rec.tax_point_code = FND_API.G_MISS_CHAR THEN
15713: END IF;
15714:
15715: ELSE
15716:
15717: p_x_line_rec.veh_cus_item_cum_key_id := OE_Value_To_Id.veh_cus_item_cum_key
15718: ( p_veh_cus_item_cum_key => p_line_val_rec.veh_cus_item_cum_key
15719: );
15720:
15721: IF p_x_line_rec.veh_cus_item_cum_key_id = FND_API.G_MISS_NUM THEN
15748: END IF;
15749:
15750: ELSE
15751: IF p_x_line_rec.invoice_to_org_id = FND_API.G_MISS_NUM THEN -- bug 4231603
15752: p_x_line_rec.invoice_to_customer_id:=OE_Value_To_Id.site_customer
15753: ( p_site_customer => p_line_val_rec.invoice_to_customer_name_oi
15754: ,p_site_customer_number=> p_line_val_rec.invoice_to_customer_number_oi
15755: ,p_type =>'INVOICE_TO'
15756: );
15784: END IF;
15785:
15786: ELSE
15787: IF p_x_line_rec.ship_to_org_id = FND_API.G_MISS_NUM THEN --4231603
15788: p_x_line_rec.ship_to_customer_id:=OE_Value_To_Id.site_customer
15789: ( p_site_customer => p_line_val_rec.ship_to_customer_name_oi
15790: ,p_site_customer_number=> p_line_val_rec.ship_to_customer_number_oi
15791: ,p_type =>'SHIP_TO'
15792: );
15821: END IF;
15822:
15823: ELSE
15824: IF p_x_line_rec.deliver_to_org_id = FND_API.G_MISS_NUM THEN -- 4231603
15825: p_x_line_rec.deliver_to_customer_id:=OE_Value_To_Id.site_customer
15826: ( p_site_customer => p_line_val_rec.ship_to_customer_name_oi
15827: ,p_site_customer_number=> p_line_val_rec.ship_to_customer_number_oi
15828: ,p_type =>'DELIVER_TO'
15829: );
15843: -------------------------------------------------------------------
15844:
15845: -- Retrieve the sold_to_org_id if not passed on the line record. This
15846: -- will be needed by the value_to_id functions for related fields.
15847: -- For e.g. oe_value_to_id.ship_to_org_id requires sold_to_org_id
15848:
15849: IF p_x_line_rec.sold_to_org_id = FND_API.G_MISS_NUM
15850: THEN
15851:
15895:
15896: ELSE
15897:
15898: /*1621182*/
15899: p_x_line_rec.deliver_to_org_id := OE_Value_To_Id.deliver_to_org
15900: ( p_deliver_to_address1 => p_line_val_rec.deliver_to_address1
15901: , p_deliver_to_address2 => p_line_val_rec.deliver_to_address2
15902: , p_deliver_to_address3 => p_line_val_rec.deliver_to_address3
15903: , p_deliver_to_address4 => p_line_val_rec.deliver_to_address4
15941:
15942: ELSE
15943:
15944: /*1621182*/
15945: p_x_line_rec.invoice_to_org_id := OE_Value_To_Id.invoice_to_org
15946: ( p_invoice_to_address1 => p_line_val_rec.invoice_to_address1
15947: , p_invoice_to_address2 => p_line_val_rec.invoice_to_address2
15948: , p_invoice_to_address3 => p_line_val_rec.invoice_to_address3
15949: , p_invoice_to_address4 => p_line_val_rec.invoice_to_address4
15987:
15988: ELSE
15989:
15990: /*1621182*/
15991: p_x_line_rec.ship_to_org_id := OE_Value_To_Id.ship_to_org
15992: ( p_ship_to_address1 => p_line_val_rec.ship_to_address1
15993: , p_ship_to_address2 => p_line_val_rec.ship_to_address2
15994: , p_ship_to_address3 => p_line_val_rec.ship_to_address3
15995: , p_ship_to_address4 => p_line_val_rec.ship_to_address4
16013: END IF;
16014:
16015: -- Retrieve the org_ids if not passed on the line record. These
16016: -- IDs will be needed by the value_to_id functions for CONTACT fields.
16017: -- For e.g. oe_value_to_id.ship_to_contact_id requires ship_to_org_id
16018:
16019: -- bug 3487597, added clause for line_id
16020:
16021: IF p_x_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE
16066: END IF;
16067:
16068: ELSE
16069:
16070: p_x_line_rec.deliver_to_contact_id := OE_Value_To_Id.deliver_to_contact
16071: ( p_deliver_to_contact => p_line_val_rec.deliver_to_contact
16072: , p_deliver_to_org_id => l_deliver_to_org_id
16073: );
16074:
16096: END IF;
16097:
16098: ELSE
16099:
16100: p_x_line_rec.invoice_to_contact_id := OE_Value_To_Id.invoice_to_contact
16101: ( p_invoice_to_contact => p_line_val_rec.invoice_to_contact
16102: , p_invoice_to_org_id => l_invoice_to_org_id
16103: );
16104:
16126: END IF;
16127:
16128: ELSE
16129:
16130: p_x_line_rec.ship_to_contact_id := OE_Value_To_Id.ship_to_contact
16131: ( p_ship_to_contact => p_line_val_rec.ship_to_contact
16132: , p_ship_to_org_id => l_ship_to_org_id
16133: );
16134:
16156: END IF;
16157:
16158: ELSE
16159:
16160: p_x_line_rec.commitment_id := OE_Value_To_Id.commitment
16161: ( p_commitment => p_line_val_rec.commitment
16162: );
16163:
16164: IF p_x_line_rec.commitment_id = FND_API.G_MISS_NUM THEN
16186: END IF;
16187:
16188: ELSE
16189: IF p_x_line_rec.end_customer_site_use_id = FND_API.G_MISS_NUM THEN -- 4231603
16190: p_x_line_rec.end_customer_id:=OE_Value_To_Id.end_customer
16191: ( p_end_customer => p_line_val_rec.end_customer_name
16192: ,p_end_customer_number=> p_line_val_rec.end_customer_number
16193: );
16194:
16217: END IF;
16218:
16219: ELSE
16220: oe_debug_pub.add('before calling aend customer contact value to id');
16221: p_x_line_rec.end_customer_contact_id := OE_Value_To_Id.end_customer_contact
16222: ( p_end_customer_contact => p_line_val_rec.end_customer_contact
16223: ,p_end_customer_id =>p_x_line_rec.end_customer_id
16224: );
16225: oe_debug_pub.add('End customer contact id is '||p_x_line_rec.end_customer_contact_id);
16257: END IF;
16258:
16259: ELSE
16260: oe_debug_pub.add('Before calling End custoemr site use value to id');
16261: p_x_line_rec.end_customer_site_use_id := OE_Value_To_Id.end_customer_site
16262: ( p_end_customer_site_address1 => p_line_val_rec.end_customer_site_address1
16263: , p_end_customer_site_address2 => p_line_val_rec.end_customer_site_address2
16264: , p_end_customer_site_address3 => p_line_val_rec.end_customer_site_address3
16265: , p_end_customer_site_address4 => p_line_val_rec.end_customer_site_address4
16299: END IF;
16300:
16301: ELSE
16302:
16303: p_x_line_rec.ib_owner:=OE_Value_To_Id.ib_owner
16304: ( p_ib_owner => p_line_val_rec.ib_owner_dsp
16305: );
16306:
16307: IF p_x_line_rec.ib_owner = FND_API.G_MISS_CHAR THEN
16326: END IF;
16327:
16328: ELSE
16329:
16330: p_x_line_rec.ib_installed_at_location:=OE_Value_To_Id.ib_installed_at_location
16331: ( p_ib_installed_at_location => p_line_val_rec.ib_installed_at_location_dsp
16332: );
16333:
16334: IF p_x_line_rec.ib_installed_at_location = FND_API.G_MISS_CHAR THEN
16353: END IF;
16354:
16355: ELSE
16356:
16357: p_x_line_rec.ib_current_location:=OE_Value_To_Id.ib_current_location
16358: ( p_ib_current_location => p_line_val_rec.ib_current_location_dsp
16359: );
16360:
16361: IF p_x_line_rec.ib_current_location = FND_API.G_MISS_CHAR THEN
16376: FND_MESSAGE.SET_TOKEN('ATTRIBUTE','SERVICE_BILLING_PROFILE');
16377: OE_MSG_PUB.Add;
16378: END IF;
16379: ELSE
16380: p_x_line_rec.service_bill_profile_id := OE_Value_To_Id.Billing_Profile
16381: ( p_service_bill_profile => p_line_val_rec.service_bill_profile
16382: );
16383: IF p_x_line_rec.service_bill_profile_id = FND_API.G_MISS_NUM THEN
16384: p_x_line_rec.return_status := FND_API.G_RET_STS_ERROR;
16395: FND_MESSAGE.SET_TOKEN('ATTRIBUTE','SERVICE_BILLING_OPTION');
16396: OE_MSG_PUB.Add;
16397: END IF;
16398: ELSE
16399: p_x_line_rec.service_bill_option_code := OE_Value_To_Id.Billing_Option
16400: ( p_service_bill_option => p_line_val_rec.service_bill_option
16401: );
16402: IF p_x_line_rec.service_bill_option_code = FND_API.G_MISS_CHAR THEN
16403: p_x_line_rec.return_status := FND_API.G_RET_STS_ERROR;
16414: FND_MESSAGE.SET_TOKEN('ATTRIBUTE','SERVICE_SUBSCRIPTION_TEMPLATE');
16415: OE_MSG_PUB.Add;
16416: END IF;
16417: ELSE
16418: p_x_line_rec.service_subs_template_id := OE_Value_To_Id.Subscription_Template
16419: ( p_service_subs_template => p_line_val_rec.service_subs_template
16420: );
16421: IF p_x_line_rec.service_subs_template_id = FND_API.G_MISS_NUM THEN
16422: p_x_line_rec.return_status := FND_API.G_RET_STS_ERROR;
16433: FND_MESSAGE.SET_TOKEN('ATTRIBUTE','SERVICE_COVERAGE_TEMPLATE');
16434: OE_MSG_PUB.Add;
16435: END IF;
16436: ELSE
16437: p_x_line_rec.service_cov_template_id := OE_Value_To_Id.Coverage_Template
16438: ( p_service_cov_template => p_line_val_rec.service_cov_template
16439: );
16440: IF p_x_line_rec.service_cov_template_id = FND_API.G_MISS_NUM THEN
16441: p_x_line_rec.return_status := FND_API.G_RET_STS_ERROR;