2825: BEGIN
2826:
2827: l_progress := '001';
2828: if g_fnd_debug = 'Y' then
2829: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2830: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2831: END IF;
2832: end if;
2833:
2826:
2827: l_progress := '001';
2828: if g_fnd_debug = 'Y' then
2829: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2830: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2831: END IF;
2832: end if;
2833:
2834: -- price change are displayed at line level. Quantity,Need_by_date and amount change are displayed at shipment level. For line level rows ( where p_line_location_id is null ), we don't show amount.
2835:
2836: IF ( p_line_location_id is null ) then
2837: l_progress:= '002';
2838: if g_fnd_debug = 'Y' then
2839: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2840: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2841: END IF;
2842: end if;
2843:
2836: IF ( p_line_location_id is null ) then
2837: l_progress:= '002';
2838: if g_fnd_debug = 'Y' then
2839: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2840: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2841: END IF;
2842: end if;
2843:
2844: return null;
2867:
2868:
2869: l_progress:= '003';
2870: if g_fnd_debug = 'Y' then
2871: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2872: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2873: END IF;
2874: end if;
2875:
2868:
2869: l_progress:= '003';
2870: if g_fnd_debug = 'Y' then
2871: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2872: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2873: END IF;
2874: end if;
2875:
2876: if ( l_tmp_new_amount is not null ) then
2876: if ( l_tmp_new_amount is not null ) then
2877:
2878: l_progress:= '004';
2879: if g_fnd_debug = 'Y' then
2880: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2881: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2882: END IF;
2883: end if;
2884: l_result:= l_tmp_new_amount;
2877:
2878: l_progress:= '004';
2879: if g_fnd_debug = 'Y' then
2880: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2881: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2882: END IF;
2883: end if;
2884: l_result:= l_tmp_new_amount;
2885:
2910: end;
2911:
2912: l_progress := '005';
2913: if g_fnd_debug = 'Y' then
2914: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2915: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2916: END IF;
2917: end if;
2918:
2911:
2912: l_progress := '005';
2913: if g_fnd_debug = 'Y' then
2914: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2915: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2916: END IF;
2917: end if;
2918:
2919: -- Then we get new price
2949:
2950: exception
2951: when NO_DATA_FOUND then
2952: if g_fnd_debug = 'Y' then
2953: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2954: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2955: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, 'this po line does not have source document');
2956: END IF;
2957: end if;
2950: exception
2951: when NO_DATA_FOUND then
2952: if g_fnd_debug = 'Y' then
2953: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2954: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2955: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, 'this po line does not have source document');
2956: END IF;
2957: end if;
2958: l_blanket_header_id := null;
2951: when NO_DATA_FOUND then
2952: if g_fnd_debug = 'Y' then
2953: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2954: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2955: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, 'this po line does not have source document');
2956: END IF;
2957: end if;
2958: l_blanket_header_id := null;
2959: end;
2959: end;
2960:
2961: l_progress := '006';
2962: if g_fnd_debug = 'Y' then
2963: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2964: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2965: END IF;
2966: end if;
2967:
2960:
2961: l_progress := '006';
2962: if g_fnd_debug = 'Y' then
2963: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2964: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2965: END IF;
2966: end if;
2967:
2968: -- for PO without source document, get new price from po_change_requests
2988: END IF;
2989:
2990: l_progress := '007';
2991: if g_fnd_debug = 'Y' then
2992: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2993: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2994: END IF;
2995: end if;
2996:
2989:
2990: l_progress := '007';
2991: if g_fnd_debug = 'Y' then
2992: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
2993: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
2994: END IF;
2995: end if;
2996:
2997: -- when there is only need by date change, we want to return old line total.
3004: end if;
3005:
3006: l_progress := '008';
3007: if g_fnd_debug = 'Y' then
3008: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
3009: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
3010: END IF;
3011: end if;
3012:
3005:
3006: l_progress := '008';
3007: if g_fnd_debug = 'Y' then
3008: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
3009: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
3010: END IF;
3011: end if;
3012:
3013: l_result:= l_new_price * l_new_quantity;
3031:
3032: EXCEPTION
3033: when others then
3034: if g_fnd_debug = 'Y' then
3035: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_UNEXPECTED) THEN
3036: FND_LOG.string(FND_LOG.level_unexpected, g_module_prefix ||
3037: l_api_name, sqlerrm);
3038: END IF;
3039: end if;
3032: EXCEPTION
3033: when others then
3034: if g_fnd_debug = 'Y' then
3035: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_UNEXPECTED) THEN
3036: FND_LOG.string(FND_LOG.level_unexpected, g_module_prefix ||
3037: l_api_name, sqlerrm);
3038: END IF;
3039: end if;
3040: raise;
3979:
3980: -- first we check p_line_location_id. It shouldn't be null.
3981: if ( p_line_location_id is null ) then
3982: if g_fnd_debug = 'Y' then
3983: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
3984: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, 'line location id is null,return');
3985: END IF;
3986: end if;
3987:
3980: -- first we check p_line_location_id. It shouldn't be null.
3981: if ( p_line_location_id is null ) then
3982: if g_fnd_debug = 'Y' then
3983: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
3984: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, 'line location id is null,return');
3985: END IF;
3986: end if;
3987:
3988: return null;
3992: l_retropricing := fnd_profile.value('PO_ALLOW_RETROPRICING_OF_PO');
3993:
3994: l_progress:='001';
3995: if g_fnd_debug = 'Y' then
3996: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
3997: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
3998: END IF;
3999: end if;
4000:
3993:
3994: l_progress:='001';
3995: if g_fnd_debug = 'Y' then
3996: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
3997: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
3998: END IF;
3999: end if;
4000:
4001: -- Since WF notification can't set the org context, we need to set it here.
4006: close l_get_line_qty;
4007:
4008: l_progress:='002';
4009: if g_fnd_debug = 'Y' then
4010: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4011: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4012: END IF;
4013: end if;
4014:
4007:
4008: l_progress:='002';
4009: if g_fnd_debug = 'Y' then
4010: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4011: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4012: END IF;
4013: end if;
4014:
4015: begin
4022:
4023: exception
4024: when others then
4025: if g_fnd_debug = 'Y' then
4026: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_UNEXPECTED) THEN
4027: FND_LOG.string(FND_LOG.level_unexpected, g_module_prefix ||
4028: l_api_name, sqlerrm);
4029: END IF;
4030: end if;
4023: exception
4024: when others then
4025: if g_fnd_debug = 'Y' then
4026: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_UNEXPECTED) THEN
4027: FND_LOG.string(FND_LOG.level_unexpected, g_module_prefix ||
4028: l_api_name, sqlerrm);
4029: END IF;
4030: end if;
4031: raise;
4032: end;
4033:
4034: l_progress:='003';
4035: if g_fnd_debug = 'Y' then
4036: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4037: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4038: END IF;
4039: end if;
4040:
4033:
4034: l_progress:='003';
4035: if g_fnd_debug = 'Y' then
4036: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4037: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4038: END IF;
4039: end if;
4040:
4041: if ( l_document_type = 'PO') then
4069: end loop;
4070:
4071: l_progress:='004';
4072: if g_fnd_debug = 'Y' then
4073: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4074: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4075: END IF;
4076: end if;
4077:
4070:
4071: l_progress:='004';
4072: if g_fnd_debug = 'Y' then
4073: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4074: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4075: END IF;
4076: end if;
4077:
4078:
4103: END IF;
4104:
4105: l_progress:='005';
4106: if g_fnd_debug = 'Y' then
4107: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4108: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4109: END IF;
4110: end if;
4111:
4104:
4105: l_progress:='005';
4106: if g_fnd_debug = 'Y' then
4107: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4108: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4109: END IF;
4110: end if;
4111:
4112: IF (l_call_price_break) THEN
4145: );
4146:
4147: l_progress:='006';
4148: if g_fnd_debug = 'Y' then
4149: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4150: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4151: END IF;
4152: end if;
4153:
4146:
4147: l_progress:='006';
4148: if g_fnd_debug = 'Y' then
4149: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4150: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4151: END IF;
4152: end if;
4153:
4154: ELSE
4190: and pcr.request_level(+)='SHIPMENT' ;
4191:
4192: l_progress:='007';
4193: if g_fnd_debug = 'Y' then
4194: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4195: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4196: END IF;
4197: end if;
4198:
4191:
4192: l_progress:='007';
4193: if g_fnd_debug = 'Y' then
4194: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4195: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4196: END IF;
4197: end if;
4198:
4199: -- True if price break type is CUMULATIVE, false otherwise:
4211: END IF;
4212:
4213: l_progress:='008';
4214: if g_fnd_debug = 'Y' then
4215: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4216: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4217: END IF;
4218: end if;
4219:
4212:
4213: l_progress:='008';
4214: if g_fnd_debug = 'Y' then
4215: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4216: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4217: END IF;
4218: end if;
4219:
4220: IF (l_call_price_break) THEN
4244:
4245: EXCEPTION
4246: WHEN OTHERS THEN
4247: if g_fnd_debug = 'Y' then
4248: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_UNEXPECTED) THEN
4249: FND_LOG.string(FND_LOG.level_unexpected, g_module_prefix ||
4250: l_api_name, sqlerrm);
4251: END IF;
4252: end if;
4245: EXCEPTION
4246: WHEN OTHERS THEN
4247: if g_fnd_debug = 'Y' then
4248: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_UNEXPECTED) THEN
4249: FND_LOG.string(FND_LOG.level_unexpected, g_module_prefix ||
4250: l_api_name, sqlerrm);
4251: END IF;
4252: end if;
4253:
4289: BEGIN
4290:
4291: l_progress:='001';
4292: if g_fnd_debug = 'Y' then
4293: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4294: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4295: END IF;
4296: end if;
4297:
4290:
4291: l_progress:='001';
4292: if g_fnd_debug = 'Y' then
4293: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4294: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4295: END IF;
4296: end if;
4297:
4298:
4324: end if;
4325:
4326: l_progress:='002';
4327: if g_fnd_debug = 'Y' then
4328: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4329: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4330: END IF;
4331: end if;
4332:
4325:
4326: l_progress:='002';
4327: if g_fnd_debug = 'Y' then
4328: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4329: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4330: END IF;
4331: end if;
4332:
4333: if (l_blanket_po_header_id is null) then
4391: in PO_CHANGE_REQUESTs */
4392:
4393: l_progress:='003';
4394: if g_fnd_debug = 'Y' then
4395: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4396: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4397: END IF;
4398: end if;
4399:
4392:
4393: l_progress:='003';
4394: if g_fnd_debug = 'Y' then
4395: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4396: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4397: END IF;
4398: end if;
4399:
4400: else
4403: l_price:= Get_PO_Price_Break_Grp( p_org_id, p_group_id, p_line_id, p_item_id, p_line_uom, p_old_price, p_line_location_id);
4404:
4405: l_progress:='004';
4406: if g_fnd_debug = 'Y' then
4407: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4408: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4409: END IF;
4410: end if;
4411:
4404:
4405: l_progress:='004';
4406: if g_fnd_debug = 'Y' then
4407: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4408: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, l_progress);
4409: END IF;
4410: end if;
4411:
4412: end if;
4415:
4416: EXCEPTION
4417: WHEN OTHERS THEN
4418: if g_fnd_debug = 'Y' then
4419: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_UNEXPECTED) THEN
4420: FND_LOG.string(FND_LOG.level_unexpected, g_module_prefix ||
4421: l_api_name, sqlerrm);
4422: END IF;
4423: end if;
4416: EXCEPTION
4417: WHEN OTHERS THEN
4418: if g_fnd_debug = 'Y' then
4419: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_UNEXPECTED) THEN
4420: FND_LOG.string(FND_LOG.level_unexpected, g_module_prefix ||
4421: l_api_name, sqlerrm);
4422: END IF;
4423: end if;
4424: raise;
4445:
4446: BEGIN
4447:
4448: if g_fnd_debug = 'Y' then
4449: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4450: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, 'Entering Get_Currency_info' );
4451: END IF;
4452: end if;
4453:
4446: BEGIN
4447:
4448: if g_fnd_debug = 'Y' then
4449: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4450: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, 'Entering Get_Currency_info' );
4451: END IF;
4452: end if;
4453:
4454: l_progress := '001';
4479:
4480: x_rate := l_rate;
4481:
4482: if g_fnd_debug = 'Y' then
4483: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4484: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, 'Exit Get_Currency_info' );
4485: END IF;
4486: end if;
4487:
4480: x_rate := l_rate;
4481:
4482: if g_fnd_debug = 'Y' then
4483: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
4484: FND_LOG.string(FND_LOG.level_statement, g_module_prefix || l_api_name, 'Exit Get_Currency_info' );
4485: END IF;
4486: end if;
4487:
4488: EXCEPTION