custom_pll_code
custom_pll_code
--
-- Customize this package to provide specific responses to events
-- within Oracle Applications forms.
--
-- Do not change the specification of the CUSTOM package in any way.
-- You may, however, add additional packages to this library.
--
--------------------------------------------------------------------
function zoom_available return boolean is
--
-- This function allows you to specify if zooms exist for the current
-- context. If zooms are available for this block, then return TRUE;
-- else return FALSE.
--
-- This routine is called on a per-block basis within every Applications
-- form from the WHEN-NEW-BLOCK-INSTANCE trigger. Therefore, any code
-- that will enable Zoom must test the current form and block from
-- which the call is being made.
--
-- By default this routine must return FALSE.
--
/* Sample code:
form_name varchar2(30) := name_in('system.current_form');
block_name varchar2(30) := name_in('system.cursor_block');
begin
if (form_name = 'DEMXXEOR' and block_name = 'ORDERS') then
return TRUE;
else
return FALSE;
end if;
end zoom_available;
*/
--
-- Real code starts here
--
form_name varchar2(30) := name_in('system.current_form');
block_name varchar2(30) := name_in('system.cursor_block');
v_enabled varchar2(20);
begin
-- Added by Arpit on 31-AUG-2011 to enable zoom trigger for CR 250039
v_enabled := lazoom.zoom_enabled;
IF v_enabled = 'TRUE' THEN
return TRUE;
else
return FALSE;
end if;
end zoom_available;
--------------------------------------------------------------------
--------------------------------------------------------------------
l_num_loc_id number;
l_num_cust_id number;
l_add1 varchar2(240);
l_state varchar2(240);
l_city varchar2(240);
l_zip_code varchar2(240);
l_country varchar2(240);
l_vip_ind varchar2(100);
l_cust_acct_id number;
l_vip_value varchar2(100);
l_cust_num varchar2(30);
/*** End: Added for FACS Decom Phase 1 project***/
l_prompt_text varchar2(2000);
l_opt_out_sd varchar2(2000);
l_party_id number;
l_discount_flag VARCHAR2(1);
l_contract_line_id NUMBER;
-- menu menuitem;
begin
end if;
end if;
end if;
lacustom.event('WNF');
elsif event_name = 'SPECIAL30' then
-- execute_menu(event_name);
if lc_pos = 0 then
raise form_trigger_failure;
end if;
la_enhncmtmgr_pkg.la_zooms(form_name,block_name,function_name,parameters);
if function_name is not NULL
then
if parameters is null then
fnd_function.execute(function_name,'Y','N');
elsif 'ZOOMSPECIAL' = substr(parameters,1,11) then
lacustom.event('ZOOMSPECIAL'); -----new code 081903
else
parameters := lazoom.zoom_event(parameters);
fnd_function.execute(function_name,'Y','N',parameters);
end if;
end if;
-- Added by Arpit on 31-Aug-2011 for CR 250039 - Need the price of part to
autofill pricelist & flat rate code price when complete debriefing
if form_name = 'CSXSRISR'
then
IF block_name = 'CHARGES_DETAIL_BLK'
THEN
IF NVL(NAME_IN('CHARGES_DETAIL_BLK.BILLING_TYPE_DESC'),'XXX') <>
'Material'
THEN
fnd_message.set_string('Please select valid material item to add
expense item');
fnd_message.show;
RAISE form_trigger_failure;
END IF;
DECLARE
l_incident_id NUMBER :=
NAME_IN('CHARGES_DETAIL_BLK.INCIDENT_ID');
l_inventory_item_id NUMBER :=
NAME_IN('CHARGES_DETAIL_BLK.INVENTORY_ITEM_ID');
l_material_item_name mtl_system_items_b.segment1%TYPE
:= NAME_IN('CHARGES_DETAIL_BLK.ITEM_NUMBER');
l_incident_number
cs_incidents_all.incident_number%TYPE :=
NAME_IN('INCIDENT_TRACKING.INCIDENT_NUMBER');
l_estimate_detail_id NUMBER :=
NAME_IN('CHARGES_DETAIL_BLK.ESTIMATE_DETAIL_ID');
l_price_list_header_id NUMBER ;
BEGIN
ncor_flat_rate_code_pkg.add_expense_items(p_incident_id
=> l_incident_id,
IF l_no_expense_items = 0
THEN
fnd_message.set_string('No Flate Rate code defined for
material item ' || l_material_item_name );
fnd_message.show;
RAISE form_trigger_failure;
END IF;
IF NAME_IN('INCIDENT_TRACKING.INCIDENT_TYPE') IN ('COD
CLEAN AND CHECK','COD SERVICE REPAIR')
THEN
l_price_list_header_id := 6008; -- Primary price list
ELSE
l_price_list_header_id := 6014; -- Service Repair
price list
END IF;
IF l_no_expense_items > 1
THEN
lc_param_list := 'INVENTORY_ITEM_ID="'||
l_inventory_item_id
||'"MATERIAL_ITEM_NAME="' ||
l_material_item_name
||'"INCIDENT_ID="' ||
l_incident_id
||'"INCIDENT_NUMBER="' ||
l_incident_number
||'"PRICE_LIST_HEADER_ID="'
|| l_price_list_header_id
||'"ESTIMATE_DETAIL_ID="' ||
l_estimate_detail_id||'"';
END ;
END IF;
END IF;
--- End by Arpit
elsif (event_name = 'WHEN-NEW-BLOCK-INSTANCE') then
if name_in('INCIDENT_TRACKING.INCIDENT_ADDRESS') is null
and name_in('INCIDENT_TRACKING.CUSTOMER_ADDRESS') is not null
and name_in('INCIDENT_TRACKING.CALLER_TYPE') = 'PERSON' then
l_num_cust_id := name_in('INCIDENT_TRACKING.customer_id');
begin
select hps.party_site_id,
hl.address1,
hl.state,
hl.city,
hl.postal_code,
hl.country
into l_num_loc_id,
l_add1,
l_state,
l_city,
l_zip_code,
l_country
from hz_locations hl,
hz_party_sites hps,
hz_parties hp
where hl.location_id = hps.location_id
and hps.party_id = hp.party_id
and hp.party_id = l_num_cust_id
and hl.address1 = hp.address1
and nvl(hl.address2,'x') = nvl(hp.address2,'x')
and hl.state = hp.state
and hl.county = hp.county
and hl.city = hp.city
and hl.postal_code = hp.postal_code;
exception
when others then
null;
end;
copy(l_num_loc_id, 'INCIDENT_TRACKING.INCIDENT_LOCATION_ID');
copy('HZ_PARTY_SITE','INCIDENT_TRACKING.INCIDENT_LOCATION_TYPE');
copy(l_add1, 'INCIDENT_TRACKING.INCIDENT_ADDRESS');
copy(l_state, 'INCIDENT_TRACKING.INCIDENT_STATE');
copy(l_city, 'INCIDENT_TRACKING.INCIDENT_CITY');
copy(l_zip_code, 'INCIDENT_TRACKING.INCIDENT_POSTAL_CODE');
copy(l_country, 'INCIDENT_TRACKING.INCIDENT_COUNTRY');
end if;
end if;
/*** End: Added for FACS Decom Phase 1 project***/
lacustom.event('WNB');
elsif (event_name = 'WHEN-NEW-RECORD-INSTANCE') then
lacustom.event('WNR');
if form_name = 'CSXSRISR' and block_name = 'INCIDENT_TRACKING'
then
l_prompt_text := null;
begin
l_cust_num :=
nvl(name_in('INCIDENT_TRACKING.CUSTOMER_NUMBER'),'0');
begin
select attribute13
into l_opt_out_sd
from hz_parties
where party_number = l_cust_num;
exception
when others then
l_opt_out_sd := null;
end;
if l_vip_ind = 'Y'
then
l_prompt_text:= 'VIP:'||upper(l_vip_value);
end if;
if l_opt_out_sd is not null
and to_date(substr(l_opt_out_sd,1,10), 'YYYY/MM/DD')
<= trunc(sysdate)
then
l_prompt_text := 'OPT-OUT';
else
l_prompt_text := l_prompt_text||'/OPT-OUT';
end if;
end if;
app_item_property.set_property('INCIDENT_TRACKING.PRODUCT_REVISION',displayed,
property_true);
set_item_property('INCIDENT_TRACKING.PRODUCT_REVISION', prompt_text,l_prompt_text);
set_item_property('INCIDENT_TRACKING.PRODUCT_REVISION',
prompt_font_weight,font_bold);
set_item_property('INCIDENT_TRACKING.PRODUCT_REVISION', prompt_foreground_color,
'r255g0b0');
else
app_item_property.set_property('INCIDENT_TRACKING.PRODUCT_REVISION',displayed,
property_false);
end if;
end if;
l_contract_line_id := name_in('OKS_LINES.ID');
begin
select 'Y'
into l_discount_flag
from okc_price_adjustments okp, okc_k_lines_b
okl
where okp.cle_id = okl.id
and okl.cle_id = l_contract_line_id
and okl.price_unit > 0
and rownum = 1;
exception
when others then
l_discount_flag := 'N';
end;
if l_discount_flag = 'Y'
then
set_item_instance_property('OKS_LINES.NAME',CURRENT_RECORD,VISUAL_ATTRIBUTE,'DATA_S
PECIAL');
set_item_instance_property('OKS_LINES.MIRR_LINE_NAME_EFFECT',CURRENT_RECORD,VISUAL_
ATTRIBUTE,'DATA_SPECIAL');
set_item_instance_property('OKS_LINES.MIRR_ITEM_NAME_PRICING',CURRENT_RECORD,VISUAL
_ATTRIBUTE,'DATA_SPECIAL');
set_item_instance_property('OKS_LINES.MIRR_ITEM_NAME_BILLING',CURRENT_RECORD,VISUAL
_ATTRIBUTE,'DATA_SPECIAL');
else
set_item_instance_property('OKS_LINES.NAME',CURRENT_RECORD,VISUAL_ATTRIBUTE,'DATA')
;
set_item_instance_property('OKS_LINES.MIRR_LINE_NAME_EFFECT',CURRENT_RECORD,VISUAL_
ATTRIBUTE,'DATA');
set_item_instance_property('OKS_LINES.MIRR_ITEM_NAME_PRICING',CURRENT_RECORD,VISUAL
_ATTRIBUTE,'DATA');
set_item_instance_property('OKS_LINES.MIRR_ITEM_NAME_BILLING',CURRENT_RECORD,VISUAL
_ATTRIBUTE,'DATA');
end if;
end if;
l_contract_line_id := name_in('OKS_LINES.ID');
begin
select 'Y'
into l_discount_flag
from okc_price_adjustments okp, okc_k_lines_b
okl
where okp.cle_id = okl.id
and okl.cle_id = l_contract_line_id
and okl.price_unit > 0
and rownum = 1;
exception
when others then
l_discount_flag := 'N';
end;
if l_discount_flag = 'Y'
then
set_item_instance_property('OKS_LINES.NAME',CURRENT_RECORD,VISUAL_ATTRIBUTE,'DATA_S
PECIAL');
set_item_instance_property('OKS_LINES.MIRR_LINE_NAME_EFFECT',CURRENT_RECORD,VISUAL_
ATTRIBUTE,'DATA_SPECIAL');
set_item_instance_property('OKS_LINES.MIRR_ITEM_NAME_PRICING',CURRENT_RECORD,VISUAL
_ATTRIBUTE,'DATA_SPECIAL');
set_item_instance_property('OKS_LINES.MIRR_ITEM_NAME_BILLING',CURRENT_RECORD,VISUAL
_ATTRIBUTE,'DATA_SPECIAL');
else
set_item_instance_property('OKS_LINES.NAME',CURRENT_RECORD,VISUAL_ATTRIBUTE,'DATA')
;
set_item_instance_property('OKS_LINES.MIRR_LINE_NAME_EFFECT',CURRENT_RECORD,VISUAL_
ATTRIBUTE,'DATA');
set_item_instance_property('OKS_LINES.MIRR_ITEM_NAME_PRICING',CURRENT_RECORD,VISUAL
_ATTRIBUTE,'DATA');
set_item_instance_property('OKS_LINES.MIRR_ITEM_NAME_BILLING',CURRENT_RECORD,VISUAL
_ATTRIBUTE,'DATA');
end if;
end if;
elsif (substr(event_name,1,7) = 'SPECIAL') then
execute_menu(event_name);
else lacustom.event(event_name);
end if;--Main
end event;
procedure ncorrescode is
lv_list_id PARAMLIST;
lv_status VARCHAR2(240);
lv_res_name varchar2(240);
lv_task_number varchar2(240);
lv_incident_id number;
begin
if name_in('TASKS.RESOLUTION_CODE') is null
and ( name_in('ASSIGNMENTS.ASSIGNMENT_STATUS_ID') <>
name_in('ASSIGNMENTS.ASSIGNMENT_STATUS_ID_OLD'))
and name_in('ASSIGNMENTS.ASSIGNMENT_STATUS') = 'Complete - Pending
Debrief'
and name_in('GLOBAL.G_INIT_VALUE') = 0
then
lv_status := name_in('assignments.assignment_status');
lv_res_name := name_in('assignments.resource_name');
lv_task_number := name_in('tasks.task_number');
lv_incident_id := name_in('tasks.incident_id');
fnd_function.execute(
function_name=>'NCORRESCODE',
open_flag=>'Y',
session_flag=>'N',
OTHER_PARAMS=>'P_TASK_NUMBER=
"'||
lv_task_number||'"
P_INCIDENT_ID=
"'||
lv_incident_id||'"
P_ASSIGNEE_NAME=
"'||
lv_res_name||'"
P_ASSIGN_STATUS=
"'||
lv_status||'"
');
end if;
end;
BEGIN
--
-- You should consider updating the version information listed below as you
-- make any customizations to this library. This information will be
-- displayed in the 'About Oracle Applications' window in the Forms PL/SQL
-- section. Only change the revision, date and time sections of this string.
--
fdrcsid('$Header: CUSTOM.pll 121.1 2025/01/21 16:43:22 appldev ship $');
end custom;