PROCEDURE XXXXXXXXXX (p_username IN VARCHAR2)
IS
v_title VARCHAR2 (50) := 'XXX PAGL REJECTIONS ('||sys_context('USERENV','DB_NAME')||')';
v_cnt VARCHAR2 (200) := 0;
parameter LONG;
CURSOR reject_rec
IS
SELECT JPGRT.*
FROM XXX_PA_GL_REJECTION_TAB JPGRT,
PA_COST_DISTRIBUTION_LINES_ALL PCDLA
WHERE JPGRT.V_EXPENDITURE_ITEM_ID = PCDLA.EXPENDITURE_ITEM_ID
AND JPGRT.Approver LIKE '%' || p_username || '%'
AND JPGRT.resolved_flag = 'N'
ORDER BY JPGRT.org_id;
BEGIN
-- HTP.P ('<!DOCTYPE html>');
HTP.p ('<TITLE>' || v_title || '</TITLE>');
HTP.p ('<head>');
HTP.p ('<STYLE TYPE="text/css">');
HTP.P (
'TH{font-family: Arial; font-size: 9pt; background-color:lightblue;}');
HTP.p ('TD{font-family: Arial; font-size: 9pt; font-weight: normal;}');
---------------->
HTP.p('
a {text-decoration:none;}');
HTP.p ('</STYLE>');
HTP.p ('</head>');
HTP.p ('<BODY bgcolor="#FFFFFF">');
HTP.p ('<CENTER>');
HTP.p (' <H1 align="center" bgcolor="#E6E6FA">' || v_title || '</H1>');
HTP.p ('<hr>');
HTP.p (
'<table width = 100%><tr><td align = left><font color="#ff0000"><sup>*</SUP><i>Choose only when you want to approve for any one of the proposed fix.</i></td><td align = right><font color="#ff0000"><sup>*</SUP><i>Enter key words related to your search (Example: ORG_ID, EMPLOYEE NUMBER etc.,)</i></td></tr></table>');
HTP.p (
'<form id="testForm" enctype="multipart/form-data" method = "post">');
--- HTP.p ('<CENTER>');
-- Title bar
-- Parameter block
HTP.p (
'<table width = 100% ><tr><td align= left><INPUT TYPE="checkbox" class="checkbox1" autocomplete="off" name="checked"> UPDATE ATTRIBUTE4
<INPUT TYPE="checkbox" class="checkbox2" autocomplete="off" name="checked"> UPDATE EXPENDITURE DATE
</td><td align= right>Filter:
<input type=text style="width: 200px;" placeholder="Enter text to search. . . " id="searchTerm" class="search_box" onkeyup="doSearch()" />
</td></tr></table>');
------------------------------------------
HTP.p (
'<TABLE id="Table001" width=100% border=1 cellpadding="0" cellspacing="0">');
HTP.p ('<thead><TR><Th align="center"></Th>');
-------- HTP.p ('<Th align="center"><b>ORG_ID</b></Th>');
HTP.p ('<Th align="center">EMPLOYEE<br>NUMBER</Th>');
HTP.p ('<Th align="center">EMPLOYEE<br>FULLNAME</Th>');
HTP.P ('<Th align="center">EXPENDITURE_ITEM_ID</Th>');
HTP.P ('<Th align="center">CURRENT ATTRIBUTE4</Th>');
HTP.P ('<Th align="center">PROPOSED ATTRIBUTE4</Th>');
HTP.P ('<Th align="center">OLD_EXPENDITURE_DATE</Th>');
HTP.P ('<Th align="center">NEW_EXPENDITURE_DATE</Th>');
----- HTP.P ('<Th align="center">COMMENTS</Th>');
HTP.p ('</TR></thead>');
HTP.p ('<tbody>');
FOR i IN reject_rec
LOOP
---- p_context
HTP.p ('<TR>');
HTP.p (
' <TD align="center"><INPUT TYPE="checkbox" class="checkbox" autocomplete="off" name='
|| i.v_expenditure_item_id
|| '></TD>');
------------- HTP.p ('<TD align="center"><b>' || i.ORG_ID || '</b></TD>');
HTP.p ('<TD align="center"><b>' || i.V_EMP_ID || '</b></TD>');
HTP.p ('<TD align="center"><b>' || i.EMPLOYEE_NAME || '</b></TD>');
HTP.P (
' <Td align="center"><b><a class=text href="XXX_FND_WEB_PKG.Transaction_details?p_expenditure_item_id='
|| i.V_EXPENDITURE_ITEM_ID||'&p_org_id='||i.org_id
|| '" target="_blank;" style="text-decoration:none;">'
|| i.V_EXPENDITURE_ITEM_ID
|| '</a></b> </TD>');
HTP.P (
' <Td align="center"><b>'
|| NVL (TO_CHAR (i.OLD_ATTRIBUTE_VALUE), ' ')
|| '</b></TD>');
HTP.P (
' <Td align="center"><b>'
|| NVL (TO_CHAR (i.NEW_ATTRIBUTE_VALUE), ' ')
|| '</b></TD>');
HTP.P (
' <Td align="center"><b>'
|| NVL (TO_CHAR (i.OLD_EXPENDITURE_DATE,'DD-MON-YYYY'), ' ')
|| '</b></TD>');
HTP.P (
' <Td align="center"><b>'
|| NVL (TO_CHAR (i.NEW_EXPENDITURE_DATE,'DD-MON-YYYY'), ' ')
|| '</b></TD>');
------ HTP.p ('<TD align="center"><b>' || i.COMMENTS || '</b></TD>');
HTP.p ('</TR>');
v_cnt := 1;
END LOOP;
HTP.p ('</tbody></TABLE>');
-- HTP.p (
--- ' <TD align="left"><INPUT TYPE="INTEGER" NAME="parameter" style="height:20px;width: 170px;" value=" " autocomplete="off" ></TD>');
IF v_cnt = 0
THEN
HTP.p ('<br>');
HTP.PRINT ('<font size=5>There are no rejections to display');
ELSE
HTP.p ('<br>');
HTP.p (
'<input type="button" onclick= "submitfn()" width="50px" value=Approve></button>');
HTP.p (
'<input type="button" onclick= "submitnn()" width="50px" value=Reject></button>');
HTP.p ('<input type="hidden" id="refreshed" value="no">'); ------formaction="XXX_FND_WEB_PKG.pa_gl_Reject_Rejections" Value = "Reject"
END IF;
HTP.formClose;
HTP.P ('<form id="testForm1" method = "post">');
HTP.p (
'<INPUT TYPE="hidden" NAME="p_username" required autocomplete="off" value='
|| p_username
|| '>');
HTP.p ('<INPUT TYPE="hidden" name="P1" id="P1_id">');
HTP.p ('<INPUT TYPE="hidden" name="P2" id="P2_id">');
HTP.p ('<INPUT type="hidden" name="parameter" id="parameter_id">');
HTP.p ('</form>');
HTP.script (
'
function doSearch() {
var searchText = document.getElementById("searchTerm").value;
var targetTable = document.getElementById("Table001");
var targetTableColCount;
for (var rowIndex = 0; rowIndex < targetTable.rows.length; rowIndex++) {
var rowData =" ";
if (rowIndex == 0) {
targetTableColCount = targetTable.rows.item(rowIndex).cells.length;
continue;
}
for (var colIndex = 0; colIndex < targetTableColCount; colIndex++) {
rowData += targetTable.rows.item(rowIndex).cells.item(colIndex).textContent;
}
if (rowData.indexOf(searchText) == -1)
targetTable.rows.item(rowIndex).style.display = "none";
else
targetTable.rows.item(rowIndex).style.display = "table-row";
}
}
if (!document.getElementsByClassName) {
document.getElementsByClassName = function (cn) {
var rx = new RegExp("(?:^|\\s)" + cn+ "(?:$|\\s)");
var allT = document.getElementsByTagName("*"), allCN = [],ac="", i = 0, a;
while (a = allT[i=i+1]) {
ac=a.className;
if ( ac && ac.indexOf(cn) !==-1) {
if(ac===cn){ allCN[allCN.length] = a; continue; }
rx.test(ac) ? (allCN[allCN.length] = a) : 0;
}
}
return allCN;
}
}
function submitfn() {
var boxes = document.getElementsByClassName("checkbox");
var box1 = document.getElementsByClassName("checkbox1");
var box2 = document.getElementsByClassName("checkbox2");
var checked = [];
var checked1 = [];
var checked2 = [];
for(var i=0; boxes[i]; ++i){
if(boxes[i].checked){
checked.push(boxes[i].name);
}
}
for(var i=0; box1[i]; ++i){
if(box1[i].checked){
checked1.push(box1[i].name);
}
}
for(var i=0; box2[i]; ++i){
if(box2[i].checked){
checked2.push(box2[i].name);
}
}
var parameter = checked.join();
var P1 = checked1.join();
var P2 = checked2.join();
form=document.getElementById("testForm1");
document.getElementById("parameter_id").value = parameter;
document.getElementById("P1_id").value = P1;
document.getElementById("P2_id").value = P2;
form.action ="XXX_FND_WEB_PKG.pa_gl_update_Rejections";
if (confirm("Do you want to submit")) {
form.submit();
}
else
{
return false;
}
}
function submitnn() {
var boxes = document.getElementsByClassName("checkbox");
var box1 = document.getElementsByClassName("checkbox1");
var box2 = document.getElementsByClassName("checkbox2");
var checked = [];
var checked1 = [];
var checked2 = [];
for(var i=0; boxes[i]; ++i){
if(boxes[i].checked){
checked.push(boxes[i].name);
}
}
for(var i=0; box1[i]; ++i){
if(box1[i].checked){
checked1.push(box1[i].name);
}
}
for(var i=0; box2[i]; ++i){
if(box2[i].checked){
checked2.push(box2[i].name);
}
}
var parameter = checked.join();
var P1 = checked1.join();
var P2 = checked2.join();
form=document.getElementById("testForm1");
document.getElementById("parameter_id").value = parameter;
document.getElementById("P1_id").value = P1;
document.getElementById("P2_id").value = P2;
form.action ="XXX_FND_WEB_PKG.pa_gl_Reject_Rejections";
<!-- var parameter = checked.join();document.getElementById("parameter_id").value = parameter;-->
<!--form.action ="XXX_FND_WEB_PKG.pa_gl_Reject_Rejections?parameter=" +checked;-->
if (confirm("Do you want to submit")) {
form.submit();
}
else
{
return false;
}
}',
'javascript');
HTP.p ('</BODY>');
EXCEPTION
WHEN OTHERS
THEN
HTP.PRINT (
'Error occured while processing the program. Please contact technical team.'
|| SQLERRM);
END XXXXXXXXXX ;
IS
v_title VARCHAR2 (50) := 'XXX PAGL REJECTIONS ('||sys_context('USERENV','DB_NAME')||')';
v_cnt VARCHAR2 (200) := 0;
parameter LONG;
CURSOR reject_rec
IS
SELECT JPGRT.*
FROM XXX_PA_GL_REJECTION_TAB JPGRT,
PA_COST_DISTRIBUTION_LINES_ALL PCDLA
WHERE JPGRT.V_EXPENDITURE_ITEM_ID = PCDLA.EXPENDITURE_ITEM_ID
AND JPGRT.Approver LIKE '%' || p_username || '%'
AND JPGRT.resolved_flag = 'N'
ORDER BY JPGRT.org_id;
BEGIN
-- HTP.P ('<!DOCTYPE html>');
HTP.p ('<TITLE>' || v_title || '</TITLE>');
HTP.p ('<head>');
HTP.p ('<STYLE TYPE="text/css">');
HTP.P (
'TH{font-family: Arial; font-size: 9pt; background-color:lightblue;}');
HTP.p ('TD{font-family: Arial; font-size: 9pt; font-weight: normal;}');
---------------->
HTP.p('
a {text-decoration:none;}');
HTP.p ('</STYLE>');
HTP.p ('</head>');
HTP.p ('<BODY bgcolor="#FFFFFF">');
HTP.p ('<CENTER>');
HTP.p (' <H1 align="center" bgcolor="#E6E6FA">' || v_title || '</H1>');
HTP.p ('<hr>');
HTP.p (
'<table width = 100%><tr><td align = left><font color="#ff0000"><sup>*</SUP><i>Choose only when you want to approve for any one of the proposed fix.</i></td><td align = right><font color="#ff0000"><sup>*</SUP><i>Enter key words related to your search (Example: ORG_ID, EMPLOYEE NUMBER etc.,)</i></td></tr></table>');
HTP.p (
'<form id="testForm" enctype="multipart/form-data" method = "post">');
--- HTP.p ('<CENTER>');
-- Title bar
-- Parameter block
HTP.p (
'<table width = 100% ><tr><td align= left><INPUT TYPE="checkbox" class="checkbox1" autocomplete="off" name="checked"> UPDATE ATTRIBUTE4
<INPUT TYPE="checkbox" class="checkbox2" autocomplete="off" name="checked"> UPDATE EXPENDITURE DATE
</td><td align= right>Filter:
<input type=text style="width: 200px;" placeholder="Enter text to search. . . " id="searchTerm" class="search_box" onkeyup="doSearch()" />
</td></tr></table>');
------------------------------------------
HTP.p (
'<TABLE id="Table001" width=100% border=1 cellpadding="0" cellspacing="0">');
HTP.p ('<thead><TR><Th align="center"></Th>');
-------- HTP.p ('<Th align="center"><b>ORG_ID</b></Th>');
HTP.p ('<Th align="center">EMPLOYEE<br>NUMBER</Th>');
HTP.p ('<Th align="center">EMPLOYEE<br>FULLNAME</Th>');
HTP.P ('<Th align="center">EXPENDITURE_ITEM_ID</Th>');
HTP.P ('<Th align="center">CURRENT ATTRIBUTE4</Th>');
HTP.P ('<Th align="center">PROPOSED ATTRIBUTE4</Th>');
HTP.P ('<Th align="center">OLD_EXPENDITURE_DATE</Th>');
HTP.P ('<Th align="center">NEW_EXPENDITURE_DATE</Th>');
----- HTP.P ('<Th align="center">COMMENTS</Th>');
HTP.p ('</TR></thead>');
HTP.p ('<tbody>');
FOR i IN reject_rec
LOOP
---- p_context
HTP.p ('<TR>');
HTP.p (
' <TD align="center"><INPUT TYPE="checkbox" class="checkbox" autocomplete="off" name='
|| i.v_expenditure_item_id
|| '></TD>');
------------- HTP.p ('<TD align="center"><b>' || i.ORG_ID || '</b></TD>');
HTP.p ('<TD align="center"><b>' || i.V_EMP_ID || '</b></TD>');
HTP.p ('<TD align="center"><b>' || i.EMPLOYEE_NAME || '</b></TD>');
HTP.P (
' <Td align="center"><b><a class=text href="XXX_FND_WEB_PKG.Transaction_details?p_expenditure_item_id='
|| i.V_EXPENDITURE_ITEM_ID||'&p_org_id='||i.org_id
|| '" target="_blank;" style="text-decoration:none;">'
|| i.V_EXPENDITURE_ITEM_ID
|| '</a></b> </TD>');
HTP.P (
' <Td align="center"><b>'
|| NVL (TO_CHAR (i.OLD_ATTRIBUTE_VALUE), ' ')
|| '</b></TD>');
HTP.P (
' <Td align="center"><b>'
|| NVL (TO_CHAR (i.NEW_ATTRIBUTE_VALUE), ' ')
|| '</b></TD>');
HTP.P (
' <Td align="center"><b>'
|| NVL (TO_CHAR (i.OLD_EXPENDITURE_DATE,'DD-MON-YYYY'), ' ')
|| '</b></TD>');
HTP.P (
' <Td align="center"><b>'
|| NVL (TO_CHAR (i.NEW_EXPENDITURE_DATE,'DD-MON-YYYY'), ' ')
|| '</b></TD>');
------ HTP.p ('<TD align="center"><b>' || i.COMMENTS || '</b></TD>');
HTP.p ('</TR>');
v_cnt := 1;
END LOOP;
HTP.p ('</tbody></TABLE>');
-- HTP.p (
--- ' <TD align="left"><INPUT TYPE="INTEGER" NAME="parameter" style="height:20px;width: 170px;" value=" " autocomplete="off" ></TD>');
IF v_cnt = 0
THEN
HTP.p ('<br>');
HTP.PRINT ('<font size=5>There are no rejections to display');
ELSE
HTP.p ('<br>');
HTP.p (
'<input type="button" onclick= "submitfn()" width="50px" value=Approve></button>');
HTP.p (
'<input type="button" onclick= "submitnn()" width="50px" value=Reject></button>');
HTP.p ('<input type="hidden" id="refreshed" value="no">'); ------formaction="XXX_FND_WEB_PKG.pa_gl_Reject_Rejections" Value = "Reject"
END IF;
HTP.formClose;
HTP.P ('<form id="testForm1" method = "post">');
HTP.p (
'<INPUT TYPE="hidden" NAME="p_username" required autocomplete="off" value='
|| p_username
|| '>');
HTP.p ('<INPUT TYPE="hidden" name="P1" id="P1_id">');
HTP.p ('<INPUT TYPE="hidden" name="P2" id="P2_id">');
HTP.p ('<INPUT type="hidden" name="parameter" id="parameter_id">');
HTP.p ('</form>');
HTP.script (
'
function doSearch() {
var searchText = document.getElementById("searchTerm").value;
var targetTable = document.getElementById("Table001");
var targetTableColCount;
for (var rowIndex = 0; rowIndex < targetTable.rows.length; rowIndex++) {
var rowData =" ";
if (rowIndex == 0) {
targetTableColCount = targetTable.rows.item(rowIndex).cells.length;
continue;
}
for (var colIndex = 0; colIndex < targetTableColCount; colIndex++) {
rowData += targetTable.rows.item(rowIndex).cells.item(colIndex).textContent;
}
if (rowData.indexOf(searchText) == -1)
targetTable.rows.item(rowIndex).style.display = "none";
else
targetTable.rows.item(rowIndex).style.display = "table-row";
}
}
if (!document.getElementsByClassName) {
document.getElementsByClassName = function (cn) {
var rx = new RegExp("(?:^|\\s)" + cn+ "(?:$|\\s)");
var allT = document.getElementsByTagName("*"), allCN = [],ac="", i = 0, a;
while (a = allT[i=i+1]) {
ac=a.className;
if ( ac && ac.indexOf(cn) !==-1) {
if(ac===cn){ allCN[allCN.length] = a; continue; }
rx.test(ac) ? (allCN[allCN.length] = a) : 0;
}
}
return allCN;
}
}
function submitfn() {
var boxes = document.getElementsByClassName("checkbox");
var box1 = document.getElementsByClassName("checkbox1");
var box2 = document.getElementsByClassName("checkbox2");
var checked = [];
var checked1 = [];
var checked2 = [];
for(var i=0; boxes[i]; ++i){
if(boxes[i].checked){
checked.push(boxes[i].name);
}
}
for(var i=0; box1[i]; ++i){
if(box1[i].checked){
checked1.push(box1[i].name);
}
}
for(var i=0; box2[i]; ++i){
if(box2[i].checked){
checked2.push(box2[i].name);
}
}
var parameter = checked.join();
var P1 = checked1.join();
var P2 = checked2.join();
form=document.getElementById("testForm1");
document.getElementById("parameter_id").value = parameter;
document.getElementById("P1_id").value = P1;
document.getElementById("P2_id").value = P2;
form.action ="XXX_FND_WEB_PKG.pa_gl_update_Rejections";
if (confirm("Do you want to submit")) {
form.submit();
}
else
{
return false;
}
}
function submitnn() {
var boxes = document.getElementsByClassName("checkbox");
var box1 = document.getElementsByClassName("checkbox1");
var box2 = document.getElementsByClassName("checkbox2");
var checked = [];
var checked1 = [];
var checked2 = [];
for(var i=0; boxes[i]; ++i){
if(boxes[i].checked){
checked.push(boxes[i].name);
}
}
for(var i=0; box1[i]; ++i){
if(box1[i].checked){
checked1.push(box1[i].name);
}
}
for(var i=0; box2[i]; ++i){
if(box2[i].checked){
checked2.push(box2[i].name);
}
}
var parameter = checked.join();
var P1 = checked1.join();
var P2 = checked2.join();
form=document.getElementById("testForm1");
document.getElementById("parameter_id").value = parameter;
document.getElementById("P1_id").value = P1;
document.getElementById("P2_id").value = P2;
form.action ="XXX_FND_WEB_PKG.pa_gl_Reject_Rejections";
<!-- var parameter = checked.join();document.getElementById("parameter_id").value = parameter;-->
<!--form.action ="XXX_FND_WEB_PKG.pa_gl_Reject_Rejections?parameter=" +checked;-->
if (confirm("Do you want to submit")) {
form.submit();
}
else
{
return false;
}
}',
'javascript');
HTP.p ('</BODY>');
EXCEPTION
WHEN OTHERS
THEN
HTP.PRINT (
'Error occured while processing the program. Please contact technical team.'
|| SQLERRM);
END XXXXXXXXXX ;
No comments:
Post a Comment