Files
mip/Data/BulkLoad/EFT/Nominations/Changes/Aug_2010/efnow101$.bdy

461 lines
14 KiB
Plaintext

create or replace package body efnow101$ is
private_ModuleRef WSGOC.MODULE_REF;
procedure CreateStartupJavaScript;
PROCEDURE get_nomi ( p_nomi_id IN nominations.nomi_id%TYPE ) IS
-- get_nomi
--
--
BEGIN
--
IF NOT caco_security.security_check('efnow101$') THEN
--
RETURN;
--
END IF;
--
FOR nomi_rec IN ( SELECT NULL
FROM nominations nomi
,contracts cont
WHERE nomi.nomi_id = p_nomi_id
AND nomi.cont_id = cont.cont_id
AND cont.cust_id = caco_utilities.get_cust_id
) LOOP
--
amfr_excel.download(p_nomi_id => p_nomi_id);
--
EXIT;
--
END LOOP;
--
END;
PROCEDURE nomi_css IS
-- nomi_css
--
--
BEGIN
--
IF NOT caco_security.security_check('efnow101$') THEN
--
RETURN;
--
END IF;
--
htp.p('
h2 {
color : #FF3030;
}
.nomiTR {
height : 20px;
}
#nomiTextDiv {
width : 95%;
white-space : pre;
overflow-x : scroll;
border : 1px solid;
margin-left : 5px;
margin-right : 5px;
padding : 5px;
}
');
--
END;
PROCEDURE view_details(p_nomi_id IN nominations.nomi_id%TYPE) IS
-- view_details
--
--
--
CURSOR c_nomi IS
SELECT cust.name customer_name
,cont.contract_number contract_number
,nomi.identifier nomi_identifier
,conf.CONFIRMATION_SENT AS tsa_timestamp
,nomi.nomi_id
FROM nominations nomi,
contracts cont,
customers cust,
confirmations conf
WHERE cust.cust_id = cont.cust_id
AND cont.cont_id = nomi.cont_id
AND nomi.nomi_id = p_nomi_id
AND nomi.nomi_id = conf.nomi_id
AND conf.confirmation_type = 'NO';
--
l_nomi_rec c_nomi%ROWTYPE;
--
l_nomi_text_clob CLOB;
l_nomi_text_temp VARCHAR2(4000);
l_text_pos NUMBER := 1;
l_text_length NUMBER := 0;
--
l_success BOOLEAN := TRUE;
--
BEGIN
--
IF NOT caco_security.security_check('efnow101$') THEN
--
RETURN;
--
END IF;
--
htp.p(' <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">');
--
wsgl.openpagehead(caco_utilities.get_module_text(2405));
--wsgl.metatag;
--htp.p('<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><LINK REL=stylesheet HREF="caco_system.css?p_type=content" >');
caco_system.content_type;
htp.p('<LINK REL=stylesheet HREF="caco_system.css?p_type=content" >');
htp.p(' <link rel="stylesheet" media="all" type="text/css" href="efnow101$.nomi_css" />');
--
wsgl.closepagehead;
wsgl.openpagebody(FALSE);
htp.p(caco_system.menu);
--
htp.p('
<div style="margin:15px;">
<div>
<h2>' || caco_utilities.get_module_text(2405) || '</h2>'); -- View Nominations
--
OPEN c_nomi;
FETCH c_nomi
INTO l_nomi_rec;
CLOSE c_nomi;
--
htp.p('
<table>
<tr class="nomiTR">
<td><b>' || caco_utilities.get_module_text(1145) ||
':&nbsp;&nbsp;</b></td>'); -- Customer Name
htp.p(' <td>' || l_nomi_rec.customer_name ||
'</td>
</tr>
<tr class="nomiTR">
<td><b>' || caco_utilities.get_module_text(2013) ||
':&nbsp;&nbsp;</b></td>'); -- Contract Number
htp.p(' <td>' || l_nomi_rec.contract_number ||
'</td>
</tr>
<tr class="nomiTR">
<td><b>' || caco_utilities.get_module_text(2060) ||
':&nbsp;&nbsp;</b></td>'); -- Nomination Identifier
htp.p(' <td>' || l_nomi_rec.nomi_identifier ||
'</td>
</tr>
<tr class="nomiTR">
<td><b>' || caco_utilities.get_module_text(118) ||
':&nbsp;&nbsp;</b></td>'); -- Created On
htp.p(' <td>' ||
EFNOW101$NOMI.FORMATDATETIME(TO_CHAR(l_nomi_rec.tsa_timestamp,'DD/MM/YYYY HH24:MI')) ||
'</td>
</tr>
</table>');
--
-- We want a button to call the spreadsheet download routine
--
htp.p('<br /><input type="button" value="' ||
caco_utilities.get_module_text(2064) -- Nomination Detail
||
'" onclick="window.location = ''efnow101$.get_nomi?p_nomi_id=' ||
l_nomi_rec.nomi_id || '''" />');
--
htp.p('<p><b>' || caco_utilities.get_module_text(2065) || '</b></p>'); -- Confirmation Text
--
-- Loop through all of the clob and display it in chunks......
-- Create a width limmited dive for putting it in
htp.p('<div id="nomiTextDiv"><pre>');
--
-- Get the CLOB
BEGIN
SELECT conf.confirmation_text
INTO l_nomi_text_clob
FROM confirmations conf
WHERE conf.nomi_id = p_nomi_id
AND conf.confirmation_type = 'NO';
EXCEPTION
WHEN OTHERS THEN
l_success := FALSE;
END;
--
IF l_success THEN
-- Get the length of the Confirmation text CLOB
l_text_length := DBMS_LOB.GETLENGTH(l_nomi_text_clob);
--
-- Loop through the clob in chunks of 4000
WHILE l_text_pos <= l_text_length LOOP
--
l_nomi_text_temp := DBMS_LOB.SUBSTR(l_nomi_text_clob,
4000,
l_text_pos);
--
htp.p(l_nomi_text_temp);
--
l_text_pos := l_text_pos + 4000;
--
END LOOP;
--
ELSE
--
-- Error
wsgl.displaymessage(p_type => WSGL.MESS_ERROR
,p_mess => caco_utilities.get_module_text(2330)
);
--
END IF;
-- Close nomiText
htp.p('</pre></div>');
--
-- Close the margin div
htp.p('</div>');
--
-- Close centrecontent div
htp.p('</div>');
--
-- Close outer div
htp.p('</div>');
--
wsgl.closepagebody;
--
END;
--------------------------------------------------------------------------------
-- Name: efnow101$.Startup
--
-- Description: This procedure is the entry point for the 'efnow101$'
-- module.
--
-- Parameters: None
--
--------------------------------------------------------------------------------
procedure Startup
is
begin
if not caco_security.security_check('efnow101$') then
return;
end if;
WSGL.RegisterURL('efnow101$.startup');
if WSGL.NotLowerCase then
return;
end if;
WSGL.StoreURLLink(0, WSGL.MsgGetText(21,WSGLM.CAP021_TOP_LEVEL));
efnow101$nomi.startup(
Z_DIRECT_CALL => TRUE
);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow101$.Startup');
end;
--------------------------------------------------------------------------------
-- Name: efnow101$.firstpage
--
-- Description: This procedure creates the first page for the 'efnow101$'
-- module.
--
-- Parameters: Z_DIRECT_CALL
--
--------------------------------------------------------------------------------
procedure FirstPage(Z_DIRECT_CALL in boolean
) is
begin
if not caco_security.security_check('efnow101$') then
return;
end if;
WSGL.OpenPageHead('');
WSGL.METATag;
WSGL.ClosePageHead;
WSGL.OpenPageBody(FALSE, p_attributes=>'');
CreateStartupJavaScript;
WSGL.DefaultPageCaption('', 1);
htp.formOpen(curl => 'ActionItem', cattributes => 'NAME="SP$AIForm"');
WSGL.NavLinks(WSGL.MENU_LONG, WSGL.MsgGetText(107,WSGLM.DSP107_ABOUT), 0, 'efnow101$.showabout', '_top', p_output_line=>FALSE);
WSGL.NavLinks;
htp.formClose;
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow101$.FirstPage');
end;
--------------------------------------------------------------------------------
-- Name: efnow101$.showabout
--
-- Description: This procedure is used to display an 'About' page for the
-- 'efnow101$' module.
--
--------------------------------------------------------------------------------
procedure showabout is
l_usr varchar2(255) := null;
begin
if not caco_security.security_check('efnow101$') then
return;
end if;
l_usr := caco_security.get_user;
WSGL.RegisterURL('efnow101$.showabout');
if WSGL.NotLowerCase then
return;
end if;
WSGL.OpenPageHead(WSGL.MsgGetText(107,WSGLM.DSP107_ABOUT)||' ');
WSGL.METATag;
TemplateHeader(TRUE,2);
WSGL.ClosePageHead;
WSGL.OpenPageBody(FALSE, p_attributes=>'');
htp.p(caco_system.menu);
WSGL.DefaultPageCaption(WSGL.MsgGetText(107,WSGLM.DSP107_ABOUT)||' ');
htp.para;
htp.p('
$Revision: 1.5 $');
htp.para;
htp.para;
htp.p(WSGL.MsgGetText(108,WSGLM.DSP108_GENERATED_BY, 'PL/SQL Web Generator', '10.1.2.6.18'));
htp.para;
WSGL.Info(FALSE, 'Nominations', 'EFNOW101', l_usr);
htp.p(caco_system.footer);
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow101$.ShowAbout');
end;
--------------------------------------------------------------------------------
-- Name: efnow101$.TemplateHeader
--
-- Description:
--
--------------------------------------------------------------------------------
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number) is
begin
if not caco_security.security_check('efnow101$') then
return;
end if;
if Z_TEMPLATE_ID = 1 then
-- Template defined in \\loordv01\framework\css2\css_content.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=content" >
');
elsif Z_TEMPLATE_ID = 2 then
-- Template defined in \\loordv01\framework\css2\css_about.htm
htp.p('<title></title> <link rel="stylesheet" href="wwv_flow_file_mgr.get_file?p_security_group_id=11019802792885519&p_fname=common.css" type="text/css" /> <script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_builder.js" type="text/javascript"></script> <script type="text/javascript"> <!-- /*Global JS Variables*/ var htmldb_Img_Dir = "/i/"; //--> </script> <link rel="stylesheet" href="/i/css/apex_3_1.css" type="text/css" /> <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_3_1.css" type="text/css" /><![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />');
elsif Z_TEMPLATE_ID = 3 then
-- Template defined in \\loordv01\framework\css2\css_query.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=query" >
');
elsif Z_TEMPLATE_ID = 4 then
-- Template defined in \\loordv01\framework\css2\css_view.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=view" >
');
elsif Z_TEMPLATE_ID = 5 then
-- Template defined in \\loordv01\framework\css2\css_insert.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=insert" >
');
elsif Z_TEMPLATE_ID = 6 then
-- Template defined in \\loordv01\framework\css2\css_recordlist.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=recordlist" >
');
elsif Z_TEMPLATE_ID = 7 then
-- Template defined in \\loordv01\framework\css2\css_lov.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=lov" >
');
elsif Z_TEMPLATE_ID = 8 then
-- Template defined in \\loordv01\framework\css2\css_text.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=text" >
');
end if;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow101$.TemplateHeader');
end;
--------------------------------------------------------------------------------
-- Name: efnow101$.GetRef
--
-- Description: Returns a handle to the display data for the
-- 'efnow101$' module.
-- If the display object does not exist then it creates it first.
--
-- Parameters:
--
--------------------------------------------------------------------------------
function GetRef return WSGOC.MODULE_REF
is
begin
if ( WSGOC.Is_Null(private_ModuleRef)) then
private_ModuleRef := WSGOC.Module
( pShortName => 'efnow101$'
, pFirstTitle => ''
);
end if;
return private_ModuleRef;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow101$.GetRef');
raise;
end;
--------------------------------------------------------------------------------
-- Name: efnow101$.CreateStartupJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateStartupJavaScript is
begin
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Startup";');
htp.p(WSGJSL.CloseScript);
end;
end;
/