2118 lines
77 KiB
Plaintext
2118 lines
77 KiB
Plaintext
create or replace package body efnow050$cont is
|
|
|
|
function L_CUST_NAME_LOV(
|
|
P_VALUE in varchar2 default null,
|
|
P_CTRL in number default 0,
|
|
P_MODE in varchar2 default 'Q',
|
|
p_select_first in boolean default false,
|
|
p_onclick in boolean default false,
|
|
p_onchange in boolean default false,
|
|
p_onblur in boolean default false,
|
|
p_onfocus in boolean default false,
|
|
p_onselect in boolean default false,
|
|
p_row in number default null) return varchar2;
|
|
function BuildSQL(
|
|
P_STATUS in varchar2 default null,
|
|
P_CONTRACT_NUMBER in varchar2 default null,
|
|
P_L_CUST_NAME in varchar2 default null,
|
|
P_VALID_FROM in varchar2 default null,
|
|
U_VALID_FROM in varchar2 default null,
|
|
Z_QUERY_BY_KEY in boolean default false,
|
|
Z_ROW_ID in ROWID default null,
|
|
Z_BIND_ROW_ID in boolean default false) return boolean;
|
|
procedure OpenZoneSql ( I_CURSOR OUT integer );
|
|
procedure AssignZoneRow( I_CURSOR IN integer );
|
|
|
|
function PreQuery(
|
|
P_STATUS in varchar2 default null,
|
|
P_CONTRACT_NUMBER in varchar2 default null,
|
|
P_L_CUST_NAME in varchar2 default null,
|
|
P_VALID_FROM in varchar2 default null,
|
|
U_VALID_FROM in varchar2 default null) return boolean;
|
|
function PostQuery(Z_POST_DML in boolean, Z_UPDATE_ROW in out boolean) return boolean;
|
|
|
|
QF_BODY_ATTRIBUTES constant varchar2(500) := '';
|
|
QF_QUERY_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(3,WSGLM.CAP003_QF_FIND);
|
|
QF_CLEAR_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(4,WSGLM.CAP004_QF_CLEAR);
|
|
QF_QUERY_BUT_ACTION constant varchar2(10) := 'QUERY';
|
|
QF_CLEAR_BUT_ACTION constant varchar2(10) := 'CLEAR';
|
|
QF_NUMBER_OF_COLUMNS constant number(4) := 1;
|
|
VF_BODY_ATTRIBUTES constant varchar2(500) := '';
|
|
IF_BODY_ATTRIBUTES constant varchar2(500) := '';
|
|
RL_BODY_ATTRIBUTES constant varchar2(500) := '';
|
|
RL_NEXT_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(11,WSGLM.CAP011_RL_NEXT);
|
|
RL_PREV_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(12,WSGLM.CAP012_RL_PREVIOUS);
|
|
RL_FIRST_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(13,WSGLM.CAP013_RL_FIRST);
|
|
RL_LAST_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(14,WSGLM.CAP014_RL_LAST);
|
|
RL_COUNT_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(15,WSGLM.CAP015_RL_COUNT);
|
|
RL_REQUERY_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(16,WSGLM.CAP016_RL_REQUERY);
|
|
RL_QUERY_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(24,WSGLM.CAP024_RL_QUERY);
|
|
RL_QUERY_BUT_ACTION constant varchar2(10) := 'QUERY';
|
|
RL_NEXT_BUT_ACTION constant varchar2(10) := 'NEXT';
|
|
RL_PREV_BUT_ACTION constant varchar2(10) := 'PREV';
|
|
RL_FIRST_BUT_ACTION constant varchar2(10) := 'FIRST';
|
|
RL_LAST_BUT_ACTION constant varchar2(10) := 'LAST';
|
|
RL_COUNT_BUT_ACTION constant varchar2(10) := 'COUNT';
|
|
RL_REQUERY_BUT_ACTION constant varchar2(10) := 'REQUERY';
|
|
RL_RECORD_SET_SIZE constant number(4) := 0;
|
|
RL_TOTAL_COUNT_REQD constant boolean := FALSE;
|
|
RL_NUMBER_OF_COLUMNS constant number(4) := 1;
|
|
LOV_BODY_ATTRIBUTES constant varchar2(500) := '';
|
|
LOV_FIND_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(17,WSGLM.CAP017_LOV_FIND);
|
|
LOV_CLOSE_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(18,WSGLM.CAP018_LOV_CLOSE);
|
|
LOV_FIND_BUT_ACTION constant varchar2(10) := 'FIND';
|
|
LOV_CLOSE_BUT_ACTION constant varchar2(10) := 'CLOSE';
|
|
LOV_BUTTON_TEXT constant varchar2(100) := htf.img('/framework/images/lov.gif','TOP','List Values',NULL,'WIDTH=18 HEIGHT=22 BORDER=0');
|
|
LOV_FRAME constant varchar2(20) := null;
|
|
CAL_BUTTON_TEXT constant varchar2(100) := htf.img('/framework/images/lov.gif','TOP','List Values',NULL,'WIDTH=18 HEIGHT=22 BORDER=0');
|
|
CAL_CLOSE_BUT_CAPTION constant varchar2(100) := WSGL.MsgGetText(18,WSGLM.CAP025_CAL_CLOSE);
|
|
CAL_BODY_ATTRIBUTES constant varchar2(500) := '';
|
|
TF_BODY_ATTRIBUTES constant varchar2(500) := '';
|
|
DEF_BODY_ATTRIBUTES constant varchar2(500) := '';
|
|
|
|
type FORM_REC is record
|
|
(UI_CUST varchar2(24000)
|
|
,UI_CONTRACT varchar2(24000)
|
|
,UI_STATUS varchar2(24000)
|
|
,UI_CONT_FROM varchar2(40)
|
|
,UI_CONT_TO varchar2(40)
|
|
,UI_EDIT_URL varchar2(24000)
|
|
,UI_COPY_URL varchar2(24000)
|
|
,VALID_UNTIL varchar2(12)
|
|
,STATUS varchar2(36)
|
|
,CONTRACT_NUMBER varchar2(180)
|
|
,L_CUST_NAME varchar2(600)
|
|
,CONT_ID varchar2(40)
|
|
,CUST_ID varchar2(40)
|
|
,VALID_FROM varchar2(12)
|
|
);
|
|
FORM_VAL FORM_REC;
|
|
|
|
PROCESSING_VIEW boolean := false;
|
|
ZONE_SQL varchar2(32767) := null;
|
|
ZONE_CHECKSUM varchar2(10);
|
|
|
|
REF_COMPONENT WSGOC.COMPONENT_REF;
|
|
R_UI_CUST WSGOC.ITEM_REF;
|
|
R_UI_CONTRACT WSGOC.ITEM_REF;
|
|
R_UI_STATUS WSGOC.ITEM_REF;
|
|
R_UI_CONT_FROM WSGOC.ITEM_REF;
|
|
R_UI_CONT_TO WSGOC.ITEM_REF;
|
|
R_UI_EDIT_URL WSGOC.ITEM_REF;
|
|
R_UI_COPY_URL WSGOC.ITEM_REF;
|
|
R_VALID_UNTIL WSGOC.ITEM_REF;
|
|
R_STATUS WSGOC.ITEM_REF;
|
|
R_CONTRACT_NUMBER WSGOC.ITEM_REF;
|
|
R_L_CUST_NAME WSGOC.ITEM_REF;
|
|
R_CONT_ID WSGOC.ITEM_REF;
|
|
R_CUST_ID WSGOC.ITEM_REF;
|
|
R_VALID_FROM WSGOC.ITEM_REF;
|
|
|
|
|
|
|
|
FUNCTION FormatDate ( p_date IN VARCHAR2 ) RETURN VARCHAR2 IS
|
|
|
|
-- FormatDate
|
|
--
|
|
--
|
|
|
|
|
|
|
|
--
|
|
v_return VARCHAR2(100);
|
|
v_mask VARCHAR2(34) := cout_system_configuration.get_configuration_item('G_DATE_FORMAT');
|
|
--
|
|
BEGIN
|
|
--
|
|
v_return := TO_CHAR(TO_DATE(p_date,v_mask),v_mask);
|
|
--
|
|
RETURN v_return;
|
|
--
|
|
EXCEPTION
|
|
WHEN OTHERS THEN
|
|
RETURN p_date;
|
|
END FormatDate;
|
|
procedure ncalendar
|
|
(
|
|
Z_FIELD_NAME in varchar2,
|
|
Z_CALLER_URL in varchar2,
|
|
Z_FIELD_VALUE in varchar2 default null,
|
|
Z_FIELD_FORMAT in varchar2 default null,
|
|
Z_FIELD_PROMPT in varchar2 default null
|
|
) IS
|
|
|
|
-- ncalendar
|
|
--
|
|
--
|
|
|
|
|
|
|
|
|
|
Field_Caption Varchar2 (2000);
|
|
|
|
procedure Output_Calendar
|
|
(
|
|
Z_FIELD_NAME in Varchar2,
|
|
Z_FIELD_VALUE in Varchar2,
|
|
Z_FIELD_FORMAT in Varchar2,
|
|
Page_Header in Varchar2,
|
|
Body_Attributes in Varchar2,
|
|
PKG_Name in Varchar2,
|
|
Close_But_Caption in Varchar2,
|
|
First_Part in Boolean,
|
|
Z_DEFAULT_FORMAT in varchar2
|
|
) is
|
|
day_of_week Integer := 0;
|
|
first_day_of_week Integer := 0;
|
|
|
|
function CALJavaScript (field_value in varchar2, field_date_format in varchar2, default_format in varchar2) return varchar2 is
|
|
|
|
l_date date;
|
|
in_date varchar2 (10);
|
|
the_date_field varchar2 (16);
|
|
l_valid_date boolean;
|
|
l_offset_unit varchar2(4);
|
|
l_offset number;
|
|
l_sysdate date;
|
|
l_territory_offset pls_integer;
|
|
|
|
begin
|
|
l_valid_date := false;
|
|
begin
|
|
l_date := to_date( field_value, field_date_format );
|
|
l_valid_date := true;
|
|
exception when others then
|
|
null;
|
|
end;
|
|
|
|
if not l_valid_date then
|
|
begin
|
|
l_date := to_date( field_value, default_format );
|
|
l_valid_date := true;
|
|
exception when others then
|
|
null;
|
|
end;
|
|
end if;
|
|
|
|
if not l_valid_date then
|
|
begin
|
|
l_date := to_date( field_value );
|
|
l_valid_date := true;
|
|
exception when others then
|
|
null;
|
|
end;
|
|
end if;
|
|
|
|
if not l_valid_date then
|
|
if substr( field_value, 1, 1 ) in ('+',' ','-') then
|
|
l_offset_unit := upper( substr( field_value, 2, 1 ) );
|
|
begin
|
|
if l_offset_unit not in ('D','M','Y') then
|
|
l_offset := to_number( substr( field_value, 2 ) );
|
|
else
|
|
l_offset := to_number( substr( field_value, 3 ) );
|
|
end if;
|
|
if substr( field_value, 1, 1 ) = '-' then
|
|
l_offset := -1 * l_offset;
|
|
end if;
|
|
if l_offset_unit = 'D' then
|
|
l_date := sysdate + l_offset;
|
|
l_valid_date := true;
|
|
elsif l_offset_unit = 'M' then
|
|
l_date := add_months( sysdate, l_offset );
|
|
l_valid_date := true;
|
|
elsif l_offset_unit = 'Y' then
|
|
l_date := add_months( sysdate, 12 * l_offset );
|
|
l_valid_date := true;
|
|
else
|
|
l_date := sysdate + l_offset;
|
|
l_valid_date := true;
|
|
end if;
|
|
exception when others then
|
|
null;
|
|
end;
|
|
end if;
|
|
end if;
|
|
|
|
if not l_valid_date then
|
|
l_date := sysdate;
|
|
end if;
|
|
|
|
-- Internal date format that MUST NOT be changed - this is the same format that the JS uses to
|
|
-- parse an incoming date from the field.
|
|
in_date := to_char (l_date, 'MM-DD-YYYY');
|
|
|
|
if in_date is null then
|
|
the_date_field := 'dateField.value';
|
|
else
|
|
the_date_field := '''' || in_date || '''';
|
|
end if;
|
|
|
|
-- Calculate the offset necessary due to territorial differences in the first day of the week.
|
|
-- We know that 31st October 1999 is a Sunday, so we can see what day of the week the database thinks this is
|
|
select to_number(to_char(to_date('31-10-1999','DD-MM-YYYY'),'D'))-1 into l_territory_offset from dual;
|
|
|
|
return '
|
|
function setDate() {
|
|
this.dateField = opener.dateField;
|
|
this.inDate = ' || the_date_field || ';
|
|
|
|
// SET DAY MONTH AND YEAR TO TODAYS DATE
|
|
var now = new Date();
|
|
var day = now.getDate();
|
|
var month = now.getMonth();
|
|
var year = now.getFullYear();
|
|
|
|
// IF A DATE WAS PASSED IN THEN PARSE THAT DATE
|
|
if (inDate.indexOf(''-'')) {
|
|
var inMonth = inDate.substring(0,inDate.indexOf("-"));
|
|
if (inMonth.substring(0,1) == "0" && inMonth.length > 1)
|
|
inMonth = inMonth.substring(1,inMonth.length);
|
|
inMonth = parseInt(inMonth);
|
|
var inDay = inDate.substring(inDate.indexOf("-") + 1, inDate.lastIndexOf("-"));
|
|
if (inDay.substring(0,1) == "0" && inDay.length > 1)
|
|
inDay = inDay.substring(1,inDay.length);
|
|
inDay = parseInt(inDay);
|
|
var inYear = parseInt(inDate.substring(inDate.lastIndexOf("-") + 1, inDate.length));
|
|
|
|
if (inDay) {
|
|
day = inDay;
|
|
}
|
|
if (inMonth) {
|
|
month = inMonth-1;
|
|
}
|
|
if (inYear) {
|
|
year = inYear;
|
|
}
|
|
}
|
|
this.focusDay = day;
|
|
document.calControl.month.selectedIndex = month;
|
|
document.calControl.year.value = year;
|
|
displayCalendar(day, month, year);
|
|
}
|
|
|
|
|
|
function setToday() {
|
|
// SET DAY MONTH AND YEAR TO TODAYS DATE
|
|
var now = new Date();
|
|
var day = now.getDate();
|
|
var month = now.getMonth();
|
|
var year = now.getFullYear();
|
|
|
|
this.focusDay = day;
|
|
document.calControl.month.selectedIndex = month;
|
|
document.calControl.year.value = year;
|
|
displayCalendar(day, month, year);
|
|
}
|
|
|
|
|
|
function isFourDigitYear(year) {
|
|
if (year.length != 4 || isNaN(year)) {
|
|
alert ("'||WSGL.MsgGetText(234,WSGLM.MSG234_FOUR_DIGIT_YEAR)||'");
|
|
document.calControl.year.select();
|
|
document.calControl.year.focus();
|
|
}
|
|
else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
function selectDate() {
|
|
var year = document.calControl.year.value;
|
|
if (isFourDigitYear(year)) {
|
|
var day = 0;
|
|
var month = document.calControl.month.selectedIndex;
|
|
displayCalendar(day, month, year);
|
|
}
|
|
}
|
|
|
|
|
|
function setPreviousYear() {
|
|
var year = document.calControl.year.value;
|
|
if (isFourDigitYear(year)) {
|
|
var day = 0;
|
|
var month = document.calControl.month.selectedIndex;
|
|
year--;
|
|
document.calControl.year.value = year;
|
|
displayCalendar(day, month, year);
|
|
}
|
|
}
|
|
|
|
|
|
function setPreviousMonth() {
|
|
var year = document.calControl.year.value;
|
|
if (isFourDigitYear(year)) {
|
|
var day = 0;
|
|
var month = document.calControl.month.selectedIndex;
|
|
if (month == 0) {
|
|
month = 11;
|
|
if (year > 1000) {
|
|
year--;
|
|
document.calControl.year.value = year;
|
|
}
|
|
}
|
|
else {
|
|
month--;
|
|
}
|
|
document.calControl.month.selectedIndex = month;
|
|
displayCalendar(day, month, year);
|
|
}
|
|
}
|
|
|
|
|
|
function setNextMonth() {
|
|
var year = document.calControl.year.value;
|
|
if (isFourDigitYear(year)) {
|
|
var day = 0;
|
|
var month = document.calControl.month.selectedIndex;
|
|
if (month == 11) {
|
|
month = 0;
|
|
year++;
|
|
document.calControl.year.value = year;
|
|
}
|
|
else {
|
|
month++;
|
|
}
|
|
document.calControl.month.selectedIndex = month;
|
|
displayCalendar(day, month, year);
|
|
}
|
|
}
|
|
|
|
|
|
function setNextYear() {
|
|
var year = document.calControl.year.value;
|
|
if (isFourDigitYear(year)) {
|
|
var day = 0;
|
|
var month = document.calControl.month.selectedIndex;
|
|
year++;
|
|
document.calControl.year.value = year;
|
|
displayCalendar(day, month, year);
|
|
}
|
|
}
|
|
|
|
|
|
function displayCalendar(day, month, year) {
|
|
|
|
day = parseInt(day);
|
|
month = parseInt(month);
|
|
year = parseInt(year);
|
|
var i = 0;
|
|
var offset = 11;
|
|
var now = new Date();
|
|
|
|
if (day == 0) {
|
|
var nowDay = now.getDate();
|
|
}
|
|
else {
|
|
var nowDay = day;
|
|
}
|
|
var days = getDaysInMonth(month+1,year);
|
|
var firstOfMonth = new Date (year, month, 1);
|
|
var startingPos = (firstOfMonth.getDay()+'||l_territory_offset||')%7;
|
|
days += startingPos;
|
|
|
|
// MAKE BEGINNING NON-DATE BUTTONS BLANK
|
|
for (i = 0; i < startingPos; i++) {
|
|
document.calControl.elements[i + offset].value = "__";
|
|
}
|
|
|
|
// SET VALUES FOR DAYS OF THE MONTH
|
|
for (i = startingPos; i < days; i++)
|
|
{
|
|
var datestr = (i-startingPos+1) + "";
|
|
if ((i-startingPos+1) < 10)
|
|
{
|
|
datestr = "0" + datestr;
|
|
}
|
|
document.calControl.elements[i + offset].value = datestr;
|
|
document.calControl.elements[i + offset].onClick = "returnDate"
|
|
}
|
|
|
|
// MAKE REMAINING NON-DATE BUTTONS BLANK
|
|
for (i=days; i<42; i++) {
|
|
document.calControl.elements[i + offset].value = "__";
|
|
}
|
|
|
|
// GIVE FOCUS TO CORRECT DAY
|
|
document.calControl.elements[focusDay+startingPos-1 + offset].focus();
|
|
document.calControl.day.value = day;
|
|
|
|
}
|
|
|
|
|
|
// GET NUMBER OF DAYS IN MONTH
|
|
function getDaysInMonth(month,year) {
|
|
var days;
|
|
if (month==1 || month==3 || month==5 || month==7 || month==8 ||
|
|
month==10 || month==12) days=31;
|
|
else if (month==4 || month==6 || month==9 || month==11) days=30;
|
|
else if (month==2) {
|
|
if (isLeapYear(year)) {
|
|
days=29;
|
|
}
|
|
else {
|
|
days=28;
|
|
}
|
|
}
|
|
return (days);
|
|
}
|
|
|
|
|
|
// CHECK TO SEE IF YEAR IS A LEAP YEAR
|
|
function isLeapYear (Year) {
|
|
if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0)) {
|
|
return (true);
|
|
}
|
|
else {
|
|
return (false);
|
|
}
|
|
}
|
|
|
|
|
|
// SET FORM FIELD VALUE TO THE DATE SELECTED
|
|
function returnDate(inDay)
|
|
{
|
|
var day = inDay;
|
|
var month = (document.calControl.month.selectedIndex)+1;
|
|
var year = document.calControl.year.value;
|
|
|
|
if ((""+month).length == 1)
|
|
{
|
|
month="0"+month;
|
|
}
|
|
if ((""+day).length == 1)
|
|
{
|
|
day="0"+day;
|
|
}
|
|
if (day != "__") {
|
|
document.calControl.day.value = day;
|
|
document.calControl.submit();
|
|
}
|
|
}
|
|
';
|
|
|
|
end CALJavaScript;
|
|
|
|
begin
|
|
if First_Part
|
|
then
|
|
-- Output the HTML that needs to go before the user defined template header
|
|
wsgl.OpenPageHead (Page_Header);
|
|
htp.p (WSGJSL.OpenScript);
|
|
htp.p ('function Close_OnClick() { close(); }');
|
|
htp.p (CALJavaScript (Z_FIELD_VALUE, Z_FIELD_FORMAT, Z_DEFAULT_FORMAT));
|
|
htp.p (WSGJSL.CloseScript);
|
|
else
|
|
-- The rest of the calendar comes after the user defined template header
|
|
wsgl.ClosePageHead;
|
|
wsgl.OpenPageBody(FALSE, p_attributes => Body_Attributes || ' ONLOAD="setDate()"');
|
|
htp.header(2, htf.italic(Page_Header));
|
|
htp.formOpen(curl=> PKG_Name || '.nformat_cal_date', cattributes => 'name="calControl"');
|
|
wsgl.HiddenField('Z_FIELD_NAME', Z_FIELD_NAME);
|
|
wsgl.HiddenField('Z_FIELD_FORMAT', Z_FIELD_FORMAT);
|
|
wsgl.HiddenField('day', 1);
|
|
htp.p('<input type="button" value="' || Close_But_Caption ||'" onclick="return Close_OnClick()">');
|
|
-- Create the calendar
|
|
htp.p ('
|
|
<CENTER>
|
|
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>
|
|
<TR><TD COLSPAN=7>
|
|
<CENTER>
|
|
');
|
|
-- Create the month drop down
|
|
htp.formSelectOpen (cname => 'month', cattributes => 'onChange=''selectDate()'''||' ID="month"');
|
|
-- Output the names of the months in the appropriate language for the database - NLS Compliance
|
|
for i in 1..12
|
|
loop
|
|
htp.formSelectOption (initcap (to_char (to_date (i, 'MM'), 'MONTH')));
|
|
end loop;
|
|
htp.formSelectClose;
|
|
-- Now the year field
|
|
htp.p ('<INPUT NAME="year" TYPE=TEXT SIZE=4 MAXLENGTH=4 onChange="selectDate()">');
|
|
-- Finish this part of the table
|
|
htp.p ('</CENTER></TD></TR>');
|
|
-- Now display the movement buttons
|
|
htp.p ('
|
|
<TR>
|
|
<TD COLSPAN=7>
|
|
<CENTER>
|
|
<INPUT TYPE=BUTTON NAME="previousYear" VALUE="<<" onClick="return setPreviousYear()">
|
|
<INPUT TYPE=BUTTON NAME="previousYear" VALUE=" < " onClick="return setPreviousMonth()">
|
|
<INPUT TYPE=BUTTON NAME="previousYear" VALUE="' || WSGLM.DSP129_CAL_TODAY || '" onClick="return setToday()">
|
|
<INPUT TYPE=BUTTON NAME="previousYear" VALUE=" > " onClick="return setNextMonth()">
|
|
<INPUT TYPE=BUTTON NAME="previousYear" VALUE=">>" onClick="return setNextYear()">
|
|
</CENTER>
|
|
</TD>
|
|
</TR>
|
|
');
|
|
-- Display the days of the week along the top of the calendar
|
|
htp.p ('<TR HEIGHT=10><TD></TD></TR><TR>');
|
|
-- Find the first day of the week
|
|
day_of_week := to_number (to_char (to_date ('1', 'DD'), 'D'));
|
|
first_day_of_week := (8 - day_of_week) + 1;
|
|
for i in first_day_of_week..(first_day_of_week + 6)
|
|
loop
|
|
htp.prn ('<TD><CENTER><FONT SIZE=-1 FACE="Arial,Helv,Helvetica"><B>');
|
|
htp.prn (initcap (substr (to_char (to_date (i, 'DD'), 'DAY'), 1, 2)));
|
|
htp.p ('</B></FONT></CENTER></TD>');
|
|
end loop;
|
|
htp.p ('</TR>');
|
|
-- Now display a button for each day on the calendar
|
|
-- The calendar is made up of 6 rows
|
|
for i in 1..6
|
|
loop
|
|
htp.p ('<TR>');
|
|
for j in 1..7
|
|
loop
|
|
-- 7 days in each row
|
|
htp.p ('<TD><INPUT TYPE="button" NAME="but' || ((i*j) - 2) || '" value=" " onClick="return returnDate(this.value)"></TD>');
|
|
end loop; -- j in 1..7
|
|
htp.p ('</TR>');
|
|
end loop; -- i in 1..6
|
|
htp.p ('</TABLE></CENTER>');
|
|
htp.formclose;
|
|
wsgl.ClosePageBody;
|
|
end if; -- First_Part
|
|
end Output_Calendar;
|
|
|
|
|
|
|
|
begin
|
|
|
|
if Z_FIELD_PROMPT is null then
|
|
Field_Caption := initcap (replace (substr (Z_FIELD_NAME, 3, length (Z_FIELD_NAME) - 2), '_', ' '));
|
|
else
|
|
Field_Caption := initcap (replace (Z_FIELD_PROMPT, '_', ' '));
|
|
end if;
|
|
|
|
|
|
WSGL.RegisterURL('efnow050$cont.calendar');
|
|
WSGL.AddURLParam('Z_FIELD_NAME', Z_FIELD_NAME);
|
|
WSGL.AddURLParam('Z_CALLER_URL', Z_CALLER_URL);
|
|
|
|
if WSGL.NotLowerCase then
|
|
return;
|
|
end if;
|
|
|
|
Output_Calendar
|
|
(
|
|
Z_FIELD_NAME,
|
|
Z_FIELD_VALUE,
|
|
Z_FIELD_FORMAT,
|
|
WSGL.MsgGetText(123,WSGLM.DSP128_CAL_CAPTION, Field_Caption),
|
|
CAL_BODY_ATTRIBUTES,
|
|
'efnow050$cont',
|
|
CAL_CLOSE_BUT_CAPTION,
|
|
True,
|
|
'DD-MON-RRRR'
|
|
);
|
|
|
|
efnow050$.TemplateHeader(TRUE,7);
|
|
|
|
Output_Calendar
|
|
(
|
|
Z_FIELD_NAME,
|
|
Z_FIELD_VALUE,
|
|
Z_FIELD_FORMAT,
|
|
WSGL.MsgGetText(123,WSGLM.DSP128_CAL_CAPTION, Field_Caption),
|
|
CAL_BODY_ATTRIBUTES,
|
|
'efnow050$cont',
|
|
CAL_CLOSE_BUT_CAPTION,
|
|
False,
|
|
'DD-MON-RRRR'
|
|
);
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
|
|
CAL_BODY_ATTRIBUTES, 'efnow050$cont.calendar');
|
|
end ncalendar;
|
|
procedure nformat_cal_date
|
|
(
|
|
Z_FIELD_NAME in Varchar2,
|
|
Z_FIELD_FORMAT in varchar2,
|
|
day in varchar2,
|
|
month in varchar2,
|
|
year in varchar2
|
|
) IS
|
|
|
|
-- nformat_cal_date
|
|
--
|
|
--
|
|
|
|
|
|
|
|
|
|
Field_Caption Varchar2 (2000) := initcap (replace (substr (Z_FIELD_NAME, 3, length (Z_FIELD_NAME) - 2), '_', ' '));
|
|
l_day varchar2(15) := day;
|
|
l_date_fmt VARCHAR2(255) := NVL(cout_system_configuration.get_configuration_item('G_DATE_FORMAT'),'DD-MON-YYYY');
|
|
|
|
procedure Output_Format_Cal_JS
|
|
(
|
|
Page_Header in Varchar2,
|
|
Body_Attributes in Varchar2,
|
|
Chosen_Date in Varchar2,
|
|
Field_Format in Varchar2
|
|
) is
|
|
-- This date format mask is internal and *intentional* DO NOT CHANGE
|
|
-- DD for day number
|
|
-- MONTH for actual text supplied by calendar drop down list
|
|
-- YYYY y2k compliant year
|
|
the_date date := to_date(Chosen_Date, 'DD-MONTH-YYYY');
|
|
begin
|
|
WSGL.OpenPageHead(Page_Header);
|
|
WSGL.ClosePageHead;
|
|
WSGL.OpenPageBody(FALSE, p_attributes => Body_Attributes);
|
|
htp.p ('<SCRIPT>');
|
|
-- Convert from internal date above into display format required by field on main form
|
|
htp.p ('opener.dateField.value = "' || to_char (the_date , Field_Format) || '";');
|
|
htp.p ('opener.dateField.focus();');
|
|
htp.p ('if(opener.dateField.onchange != null) { opener.dateField.onchange(); }'); --B1806675
|
|
htp.p ('window.close();');
|
|
htp.p ('</SCRIPT>');
|
|
WSGL.ClosePageBody;
|
|
end Output_Format_Cal_JS;
|
|
|
|
begin
|
|
|
|
if l_day = '0' then
|
|
l_day := '01';
|
|
end if;
|
|
|
|
Output_Format_Cal_JS
|
|
(
|
|
WSGL.MsgGetText(123,WSGLM.DSP128_CAL_CAPTION, Field_Caption),
|
|
CAL_BODY_ATTRIBUTES,
|
|
l_day || '-' || month || '-' || year,
|
|
--Z_FIELD_FORMAT
|
|
l_date_fmt
|
|
);
|
|
|
|
end nformat_cal_date;
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.L_CUST_NAME_LOV
|
|
--
|
|
-- Description: Builds a GUI control to display the values returned by
|
|
-- LOV 'L_CUST_NAME'.
|
|
--
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
function L_CUST_NAME_LOV(
|
|
P_VALUE in varchar2,
|
|
P_CTRL in number,
|
|
P_MODE in varchar2 default 'Q',
|
|
p_select_first in boolean default false,
|
|
p_onclick in boolean,
|
|
p_onchange in boolean,
|
|
p_onblur in boolean,
|
|
p_onfocus in boolean,
|
|
p_onselect in boolean,
|
|
p_row in number) return varchar2 is
|
|
|
|
L_RET_VALUE varchar2(32766) := null;
|
|
l_events varchar2(1000) := null;
|
|
l_valid boolean := false;
|
|
l_first boolean := true;
|
|
|
|
cursor c1( z_mode in varchar2
|
|
, z_filter in varchar2
|
|
, z_uu in varchar2
|
|
, z_ul in varchar2
|
|
, z_lu in varchar2
|
|
, z_ll in varchar2
|
|
)
|
|
is
|
|
SELECT DISTINCT L_CUST.NAME L_CUST_NAME,
|
|
L_CUST.NAME CG$DISPLAY
|
|
FROM CUSTOMERS L_CUST
|
|
WHERE (
|
|
( ( Z_MODE='Q')
|
|
AND ( /* CG$MDTU_QWC_START CONT.L_CUST */
|
|
(( EXISTS ( SELECT cust1.cust_id FROM customer_intermediaries cuin1 , customers cust1 , customer_types cuty WHERE cust1.cust_id = cuin1.cust_id AND cust1.cuty_id = cuty.cuty_id AND l_cust.cust_id = cust1.cust_id AND cuty.cuty_id = caco_utilities.cuty_id_for_user AND cust1.cust_id != caco_utilities.get_system_customer ) OR caco_utilities.user_has_system = 'Y' ))
|
|
/* CG$MDTU_QWC_END CONT.L_CUST */
|
|
)
|
|
)
|
|
OR
|
|
( ( NOT Z_MODE='Q')
|
|
AND ( /* CG$MDTU_VWC_START CONT.L_CUST */
|
|
(( EXISTS ( SELECT cust1.cust_id FROM customer_intermediaries cuin1 , customers cust1 , customer_types cuty WHERE cust1.cust_id = cuin1.cust_id AND cust1.cuty_id = cuty.cuty_id AND l_cust.cust_id = cust1.cust_id AND cuty.cuty_id = caco_utilities.cuty_id_for_user AND cust1.cust_id != caco_utilities.get_system_customer ) OR caco_utilities.user_has_system = 'Y' ))
|
|
/* CG$MDTU_VWC_END CONT.L_CUST */
|
|
)
|
|
)
|
|
)
|
|
ORDER BY L_CUST.NAME
|
|
;
|
|
|
|
l_rownum_txt varchar2(30);
|
|
begin
|
|
if p_row is not null then
|
|
l_rownum_txt := ', ' || to_char(p_row - 1);
|
|
end if;
|
|
if p_onclick then
|
|
l_events := l_events || ' onClick="return L_CUST_NAME_OnClick(this'||l_rownum_txt||')"';
|
|
end if;
|
|
if p_onchange then
|
|
l_events := l_events || ' onChange="return L_CUST_NAME_OnChange(this'||l_rownum_txt||')"';
|
|
end if;
|
|
if p_onblur then
|
|
l_events := l_events || ' onBlur="return L_CUST_NAME_OnBlur(this'||l_rownum_txt||')"';
|
|
end if;
|
|
if p_onfocus then
|
|
l_events := l_events || ' onFocus="return L_CUST_NAME_OnFocus(this'||l_rownum_txt||')"';
|
|
end if;
|
|
if p_onselect then
|
|
l_events := l_events || ' onSelect="return L_CUST_NAME_OnSelect(this'||l_rownum_txt||')"';
|
|
end if;
|
|
|
|
-- IDs Feature:
|
|
if P_CTRL = WSGL.CTL_QUERY and 1 <> 1 then
|
|
L_RET_VALUE := htf.formSelectOpen('P_L_CUST_NAME',
|
|
nsize=>'1',
|
|
cattributes=>'MULTIPLE CLASS = cglovlist'||l_events||' ID="'||'P_L_CUST_NAME'||'"');
|
|
else
|
|
L_RET_VALUE := htf.formSelectOpen('P_L_CUST_NAME',
|
|
nsize=>'1',
|
|
cattributes=>'CLASS = cglovlist'||l_events||' ID="'||'P_L_CUST_NAME'||'"');
|
|
end if;
|
|
|
|
if P_CTRL = WSGL.CTL_QUERY and p_select_first then
|
|
L_RET_VALUE := L_RET_VALUE || htf.formSelectOption(' ', 'SELECTED');
|
|
l_first := false;
|
|
l_valid := true;
|
|
end if;
|
|
|
|
for c1rec in c1( P_MODE, '%',null,null,null,null) loop
|
|
if ((WSGL.EscapeItem(c1rec.L_CUST_NAME) = P_VALUE) or c1rec.L_CUST_NAME = P_VALUE) or (p_select_first and l_first) then
|
|
l_valid := true;
|
|
L_RET_VALUE := L_RET_VALUE || htf.formSelectOption(WSGL.EscapeItem(c1rec.CG$DISPLAY), 'SELECTED',
|
|
cattributes=>'VALUE="'||WSGL.EscapeItem(c1rec.L_CUST_NAME)||'"');
|
|
else
|
|
L_RET_VALUE := L_RET_VALUE || htf.formSelectOption(WSGL.EscapeItem(c1rec.CG$DISPLAY), null,
|
|
cattributes=>'VALUE="'||WSGL.EscapeItem(c1rec.L_CUST_NAME)||'"');
|
|
end if;
|
|
l_first := false;
|
|
end loop;
|
|
|
|
if not l_valid then
|
|
L_RET_VALUE := L_RET_VALUE || htf.formSelectOption(WSGL.MsgGetText(28,WSGLM.CAP028_INVALID_VAL), 'SELECTED',
|
|
'VALUE="'||WSGL.MsgGetText(28,WSGLM.CAP028_INVALID_VAL)||'"');
|
|
end if;
|
|
L_RET_VALUE := L_RET_VALUE || htf.formSelectClose;
|
|
|
|
return L_RET_VALUE;
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
|
|
DEF_BODY_ATTRIBUTES, 'efnow050$cont.L_CUST_NAME_LOV');
|
|
return L_RET_VALUE;
|
|
end;
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.InitialiseDomain
|
|
--
|
|
-- Description: Initialises the Domain Record for the given Column Usage
|
|
--
|
|
-- Parameters: P_ALIAS The alias of the column usage
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
procedure InitialiseDomain(P_ALIAS in varchar2) is
|
|
begin
|
|
if not caco_security.security_check('efnow050$cont') then
|
|
return;
|
|
end if;
|
|
|
|
if P_ALIAS = 'STATUS' and not D_STATUS.Initialised then
|
|
D_STATUS.ColAlias := 'STATUS';
|
|
D_STATUS.ControlType := WSGL.DV_LIST;
|
|
D_STATUS.DispWidth := 6;
|
|
D_STATUS.DispHeight := 1;
|
|
D_STATUS.MaxWidth := 6;
|
|
D_STATUS.UseMeanings := True;
|
|
D_STATUS.ColOptional := False;
|
|
D_STATUS.Vals(1) := 'O';
|
|
D_STATUS.Meanings(1) := 'Open';
|
|
D_STATUS.Abbreviations(1) := 'Open';
|
|
D_STATUS.Vals(2) := 'C';
|
|
D_STATUS.Meanings(2) := 'Closed';
|
|
D_STATUS.Abbreviations(2) := 'Closed';
|
|
D_STATUS.NumOfVV := 2;
|
|
D_STATUS.Initialised := True;
|
|
end if;
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
DEF_BODY_ATTRIBUTES, 'efnow050$cont.InitialseDomain');
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.calendar
|
|
--
|
|
-- Description:
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
|
|
procedure calendar
|
|
(
|
|
Z_FIELD_NAME in varchar2,
|
|
Z_CALLER_URL in varchar2,
|
|
Z_FIELD_VALUE in varchar2 default null,
|
|
Z_FIELD_FORMAT in varchar2 default null,
|
|
Z_FIELD_PROMPT in varchar2 default null
|
|
) is
|
|
|
|
Field_Caption Varchar2 (2000);
|
|
|
|
begin
|
|
|
|
if Z_FIELD_PROMPT is null then
|
|
Field_Caption := initcap (replace (substr (Z_FIELD_NAME, 3, length (Z_FIELD_NAME) - 2), '_', ' '));
|
|
else
|
|
Field_Caption := initcap (replace (Z_FIELD_PROMPT, '_', ' '));
|
|
end if;
|
|
|
|
|
|
WSGL.RegisterURL('efnow050$cont.calendar');
|
|
WSGL.AddURLParam('Z_FIELD_NAME', Z_FIELD_NAME);
|
|
WSGL.AddURLParam('Z_CALLER_URL', Z_CALLER_URL);
|
|
|
|
if WSGL.NotLowerCase then
|
|
return;
|
|
end if;
|
|
|
|
WSGL.Output_Calendar
|
|
(
|
|
Z_FIELD_NAME,
|
|
Z_FIELD_VALUE,
|
|
Z_FIELD_FORMAT,
|
|
WSGL.MsgGetText(123,WSGLM.DSP128_CAL_CAPTION, Field_Caption),
|
|
CAL_BODY_ATTRIBUTES,
|
|
'efnow050$cont',
|
|
CAL_CLOSE_BUT_CAPTION,
|
|
True,
|
|
'DD-MON-RRRR'
|
|
);
|
|
|
|
efnow050$.TemplateHeader(TRUE,7);
|
|
|
|
WSGL.Output_Calendar
|
|
(
|
|
Z_FIELD_NAME,
|
|
Z_FIELD_VALUE,
|
|
Z_FIELD_FORMAT,
|
|
WSGL.MsgGetText(123,WSGLM.DSP128_CAL_CAPTION, Field_Caption),
|
|
CAL_BODY_ATTRIBUTES,
|
|
'efnow050$cont',
|
|
CAL_CLOSE_BUT_CAPTION,
|
|
False,
|
|
'DD-MON-RRRR'
|
|
);
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
|
|
CAL_BODY_ATTRIBUTES, 'efnow050$cont.calendar');
|
|
end calendar;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.format_cal_date
|
|
--
|
|
-- Description: Converts the chosen date into the correct format using the format mask assigned
|
|
-- to the field that the calendar was popped up for
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
|
|
procedure format_cal_date
|
|
(
|
|
Z_FIELD_NAME in Varchar2,
|
|
Z_FIELD_FORMAT in varchar2,
|
|
day in varchar2,
|
|
month in varchar2,
|
|
year in varchar2
|
|
) is
|
|
|
|
Field_Caption Varchar2 (2000) := initcap (replace (substr (Z_FIELD_NAME, 3, length (Z_FIELD_NAME) - 2), '_', ' '));
|
|
l_day varchar2(15) := day;
|
|
|
|
begin
|
|
|
|
if l_day = '0' then
|
|
l_day := '01';
|
|
end if;
|
|
|
|
WSGL.Output_Format_Cal_JS
|
|
(
|
|
WSGL.MsgGetText(123,WSGLM.DSP128_CAL_CAPTION, Field_Caption),
|
|
CAL_BODY_ATTRIBUTES,
|
|
l_day || '-' || month || '-' || year,
|
|
Z_FIELD_FORMAT
|
|
);
|
|
|
|
end format_cal_date;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.Startup
|
|
--
|
|
-- Description: Entry point for the 'CONT' module
|
|
-- component (#Maintain Contracts#2080#).
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
procedure Startup(
|
|
Z_DIRECT_CALL in boolean,
|
|
Z_CHK in varchar2,
|
|
Z_FORM in varchar2) is
|
|
l_Foundform boolean := FALSE;
|
|
l_fs_text varchar2(32767) := '' ;
|
|
begin
|
|
if not caco_security.security_check('efnow050$cont') then
|
|
return;
|
|
end if;
|
|
|
|
WSGL.RegisterURL('efnow050$cont.startup');
|
|
WSGL.AddURLParam('Z_CHK', Z_CHK);
|
|
|
|
|
|
WSGL.StoreURLLink(1, '#Maintain Contracts#2080#');
|
|
|
|
-- Either no frames are being used or the query form is on a
|
|
-- separate page.
|
|
if Z_FORM is not null then
|
|
null;
|
|
-- Work out which form is required, and check if that is possible
|
|
if Z_FORM = 'QUERY' then
|
|
FormQuery(
|
|
Z_DIRECT_CALL=>TRUE);
|
|
l_Foundform := TRUE;
|
|
end if;
|
|
if Z_FORM = 'LIST' then
|
|
QueryList(
|
|
Z_DIRECT_CALL=>TRUE);
|
|
l_Foundform := TRUE;
|
|
end if;
|
|
end if;
|
|
if l_Foundform = FALSE then
|
|
FormQuery(
|
|
Z_DIRECT_CALL=>TRUE);
|
|
end if;
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
DEF_BODY_ATTRIBUTES, 'efnow050$cont.Startup');
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.ActionQuery
|
|
--
|
|
-- Description: Called when a Query form is subitted to action the query request.
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
procedure ActionQuery(
|
|
P_STATUS in varchar2,
|
|
P_CONTRACT_NUMBER in varchar2,
|
|
P_L_CUST_NAME in varchar2,
|
|
P_VALID_FROM in varchar2,
|
|
U_VALID_FROM in varchar2,
|
|
Z_DIRECT_CALL in boolean default false,
|
|
Z_ACTION in varchar2,
|
|
Z_CHK in varchar2 ) is
|
|
|
|
L_CHK varchar2(10) := Z_CHK;
|
|
L_BUTCHK varchar2(100):= null;
|
|
l_dummy_bool boolean := false;
|
|
begin
|
|
if not caco_security.security_check('efnow050$cont') then
|
|
return;
|
|
end if;
|
|
|
|
if not Z_DIRECT_CALL then
|
|
null;
|
|
end if;
|
|
|
|
l_dummy_bool := RestoreState
|
|
( Z_CURR_DEPTH => 0
|
|
, Z_MAX_DEPTH => 99
|
|
, Z_RESTORE_OWN_ROW => false
|
|
);
|
|
|
|
QueryList(
|
|
P_STATUS,
|
|
P_CONTRACT_NUMBER,
|
|
P_L_CUST_NAME,
|
|
P_VALID_FROM,
|
|
U_VALID_FROM,
|
|
Z_START=>null,
|
|
Z_ACTION=>L_BUTCHK,
|
|
Z_DIRECT_CALL=>TRUE);
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
DEF_BODY_ATTRIBUTES, 'efnow050$cont.ActionQuery');
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.QueryHits
|
|
--
|
|
-- Description: Returns the number or rows which matches the given search
|
|
-- criteria (if any).
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
function QueryHits(
|
|
P_STATUS in varchar2,
|
|
P_CONTRACT_NUMBER in varchar2,
|
|
P_L_CUST_NAME in varchar2,
|
|
P_VALID_FROM in varchar2,
|
|
U_VALID_FROM in varchar2) return number is
|
|
I_QUERY varchar2(32767) := '';
|
|
I_CURSOR integer;
|
|
I_VOID integer;
|
|
I_FROM_POS integer := 0;
|
|
I_COUNT number(10);
|
|
begin
|
|
if not caco_security.security_check('efnow050$cont') then
|
|
return -1;
|
|
end if;
|
|
|
|
if not BuildSQL(P_STATUS,
|
|
P_CONTRACT_NUMBER,
|
|
P_L_CUST_NAME,
|
|
P_VALID_FROM,
|
|
U_VALID_FROM) then
|
|
return -1;
|
|
end if;
|
|
|
|
if not PreQuery(P_STATUS,
|
|
P_CONTRACT_NUMBER,
|
|
P_L_CUST_NAME,
|
|
P_VALID_FROM,
|
|
U_VALID_FROM) then
|
|
WSGL.DisplayMessage(WSGL.MESS_ERROR, cg$errors.GetErrors,
|
|
''||' : '||'#Maintain Contracts#2080#', DEF_BODY_ATTRIBUTES);
|
|
return -1;
|
|
end if;
|
|
|
|
I_FROM_POS := instr(upper(ZONE_SQL), ' FROM ');
|
|
|
|
if I_FROM_POS = 0 then
|
|
return -1;
|
|
end if;
|
|
|
|
I_QUERY := 'SELECT count(*)' ||
|
|
substr(ZONE_SQL, I_FROM_POS);
|
|
|
|
I_CURSOR := dbms_sql.open_cursor;
|
|
dbms_sql.parse(I_CURSOR, I_QUERY, dbms_sql.v7);
|
|
dbms_sql.define_column(I_CURSOR, 1, I_COUNT);
|
|
I_VOID := dbms_sql.execute(I_CURSOR);
|
|
I_VOID := dbms_sql.fetch_rows(I_CURSOR);
|
|
dbms_sql.column_value(I_CURSOR, 1, I_COUNT);
|
|
dbms_sql.close_cursor(I_CURSOR);
|
|
|
|
return I_COUNT;
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
DEF_BODY_ATTRIBUTES, 'efnow050$cont.QueryHits');
|
|
return -1;
|
|
end;
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.BuildSQL
|
|
--
|
|
-- Description: Builds the SQL for the 'CONT' module component (#Maintain Contracts#2080#).
|
|
-- This incorporates all query criteria and Foreign key columns.
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
function BuildSQL(
|
|
P_STATUS in varchar2,
|
|
P_CONTRACT_NUMBER in varchar2,
|
|
P_L_CUST_NAME in varchar2,
|
|
P_VALID_FROM in varchar2,
|
|
U_VALID_FROM in varchar2,
|
|
Z_QUERY_BY_KEY in boolean default false,
|
|
Z_ROW_ID in ROWID default null,
|
|
Z_BIND_ROW_ID in boolean default false) return boolean is
|
|
|
|
I_WHERE varchar2(32767);
|
|
row_idx integer;
|
|
begin
|
|
|
|
InitialiseDomain('STATUS');
|
|
|
|
-- Build up the Where clause
|
|
if Z_QUERY_BY_KEY then
|
|
I_WHERE := 'WHERE CONT_ID = ' || to_char(CURR_VAL.CONT_ID) || ' ';
|
|
elsif Z_ROW_ID is not null then
|
|
I_WHERE := 'WHERE CG$ROW_ID = ''' || rowidtochar( Z_ROW_ID ) || '''';
|
|
elsif Z_BIND_ROW_ID then
|
|
I_WHERE := 'WHERE CG$ROW_ID = :b_row_id';
|
|
else
|
|
WSGL.BuildWhere(WSGL.DomainValue(D_STATUS, P_STATUS), 'STATUS', WSGL.TYPE_CHAR, I_WHERE);
|
|
WSGL.BuildWhere(P_CONTRACT_NUMBER, 'CONTRACT_NUMBER', WSGL.TYPE_CHAR, I_WHERE);
|
|
WSGL.BuildWhere(P_L_CUST_NAME, 'L_CUST_NAME', WSGL.TYPE_CHAR, I_WHERE);
|
|
begin
|
|
WSGL.BuildWhere(P_VALID_FROM, U_VALID_FROM, 'VALID_FROM', WSGL.TYPE_DATE, I_WHERE, 'DD.MM.YYYY');
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_ERROR_QRY, SQLERRM,
|
|
''||' : '||'#Maintain Contracts#2080#', DEF_BODY_ATTRIBUTES, NULL,
|
|
WSGL.MsgGetText(210,WSGLM.MSG210_INVALID_QRY,'#Valid From#2441#'),
|
|
WSGL.MsgGetText(211,WSGLM.MSG211_EXAMPLE_TODAY,to_char(sysdate, 'DD.MM.YYYY')));
|
|
return false;
|
|
end;
|
|
|
|
end if;
|
|
|
|
ZONE_SQL := 'SELECT UI_CUST,
|
|
UI_CONTRACT,
|
|
UI_STATUS,
|
|
UI_CONT_FROM,
|
|
UI_CONT_TO,
|
|
UI_EDIT_URL,
|
|
UI_COPY_URL,
|
|
VALID_UNTIL,
|
|
STATUS,
|
|
CONTRACT_NUMBER,
|
|
L_CUST_NAME,
|
|
CONT_ID,
|
|
CUST_ID,
|
|
VALID_FROM
|
|
FROM ( SELECT L_CUST.NAME UI_CUST,
|
|
CONT.CONTRACT_NUMBER UI_CONTRACT,
|
|
DECODE(CONT.STATUS,''O'',''Open'',''Closed'') UI_STATUS,
|
|
CONT.VALID_FROM UI_CONT_FROM,
|
|
CONT.VALID_UNTIL UI_CONT_TO,
|
|
''efnow050$.contract_startup?p_screen_type=CONTRACT&p_contract_id=''||CONT.CONT_ID UI_EDIT_URL,
|
|
''efno_contracts.efnow050$copy?p_contract_id=''||CONT.CONT_ID UI_COPY_URL,
|
|
CONT.VALID_UNTIL VALID_UNTIL,
|
|
CONT.STATUS STATUS,
|
|
CONT.CONTRACT_NUMBER CONTRACT_NUMBER,
|
|
L_CUST.NAME L_CUST_NAME,
|
|
CONT.CONT_ID CONT_ID,
|
|
CONT.CUST_ID CUST_ID,
|
|
CONT.VALID_FROM VALID_FROM
|
|
FROM CONTRACTS CONT,
|
|
CUSTOMERS L_CUST
|
|
WHERE ( /* CG$MDTU_QWC_START CONT.L_CUST */
|
|
(( EXISTS ( SELECT cust1.cust_id FROM customer_intermediaries cuin1 , customers cust1 , customer_types cuty WHERE cust1.cust_id = cuin1.cust_id AND cust1.cuty_id = cuty.cuty_id AND l_cust.cust_id = cust1.cust_id AND cuty.cuty_id = caco_utilities.cuty_id_for_user AND cust1.cust_id != caco_utilities.get_system_customer ) OR caco_utilities.user_has_system = ''Y'' ))
|
|
/* CG$MDTU_QWC_END CONT.L_CUST */
|
|
) AND
|
|
CONT.CUST_ID = L_CUST.CUST_ID
|
|
) ';
|
|
ZONE_SQL := ZONE_SQL || I_WHERE;
|
|
ZONE_SQL := ZONE_SQL || ' ORDER BY L_CUST_NAME,
|
|
VALID_FROM';
|
|
return true;
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
DEF_BODY_ATTRIBUTES, 'efnow050$cont.BuildSQL');
|
|
return false;
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.OpenZoneSql
|
|
--
|
|
-- Description: Open's the cursor for the zone SQL of
|
|
-- 'CONT' module component (#Maintain Contracts#2080#).
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
procedure OpenZoneSql
|
|
( I_CURSOR OUT integer
|
|
)
|
|
is
|
|
begin
|
|
I_CURSOR := dbms_sql.open_cursor;
|
|
dbms_sql.parse(I_CURSOR, ZONE_SQL, dbms_sql.v7);
|
|
dbms_sql.define_column(I_CURSOR, 1, NBT_VAL.UI_CUST, 4000);
|
|
dbms_sql.define_column(I_CURSOR, 2, NBT_VAL.UI_CONTRACT, 4000);
|
|
dbms_sql.define_column(I_CURSOR, 3, NBT_VAL.UI_STATUS, 4000);
|
|
dbms_sql.define_column(I_CURSOR, 4, NBT_VAL.UI_CONT_FROM);
|
|
dbms_sql.define_column(I_CURSOR, 5, NBT_VAL.UI_CONT_TO);
|
|
dbms_sql.define_column(I_CURSOR, 6, NBT_VAL.UI_EDIT_URL, 4000);
|
|
dbms_sql.define_column(I_CURSOR, 7, NBT_VAL.UI_COPY_URL, 4000);
|
|
dbms_sql.define_column(I_CURSOR, 8, CURR_VAL.VALID_UNTIL);
|
|
dbms_sql.define_column(I_CURSOR, 9, CURR_VAL.STATUS, 1);
|
|
dbms_sql.define_column(I_CURSOR, 10, CURR_VAL.CONTRACT_NUMBER, 30);
|
|
dbms_sql.define_column(I_CURSOR, 11, NBT_VAL.L_CUST_NAME, 100);
|
|
dbms_sql.define_column(I_CURSOR, 12, CURR_VAL.CONT_ID);
|
|
dbms_sql.define_column(I_CURSOR, 13, CURR_VAL.CUST_ID);
|
|
dbms_sql.define_column(I_CURSOR, 14, CURR_VAL.VALID_FROM);
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
'', 'efnow050$cont.OpenZoneSql');
|
|
raise;
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.AssignZoneRow
|
|
--
|
|
-- Description: Assign's a row of data and calculates the check sum from the
|
|
-- zone SQL of 'CONT' module component (#Maintain Contracts#2080#).
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
procedure AssignZoneRow
|
|
( I_CURSOR IN integer
|
|
)
|
|
is
|
|
begin
|
|
dbms_sql.column_value(I_CURSOR, 1, NBT_VAL.UI_CUST);
|
|
dbms_sql.column_value(I_CURSOR, 2, NBT_VAL.UI_CONTRACT);
|
|
dbms_sql.column_value(I_CURSOR, 3, NBT_VAL.UI_STATUS);
|
|
dbms_sql.column_value(I_CURSOR, 4, NBT_VAL.UI_CONT_FROM);
|
|
dbms_sql.column_value(I_CURSOR, 5, NBT_VAL.UI_CONT_TO);
|
|
dbms_sql.column_value(I_CURSOR, 6, NBT_VAL.UI_EDIT_URL);
|
|
dbms_sql.column_value(I_CURSOR, 7, NBT_VAL.UI_COPY_URL);
|
|
dbms_sql.column_value(I_CURSOR, 8, CURR_VAL.VALID_UNTIL);
|
|
dbms_sql.column_value(I_CURSOR, 9, CURR_VAL.STATUS);
|
|
dbms_sql.column_value(I_CURSOR, 10, CURR_VAL.CONTRACT_NUMBER);
|
|
dbms_sql.column_value(I_CURSOR, 11, NBT_VAL.L_CUST_NAME);
|
|
dbms_sql.column_value(I_CURSOR, 12, CURR_VAL.CONT_ID);
|
|
dbms_sql.column_value(I_CURSOR, 13, CURR_VAL.CUST_ID);
|
|
dbms_sql.column_value(I_CURSOR, 14, CURR_VAL.VALID_FROM);
|
|
ZONE_CHECKSUM := to_char(WSGL.Checksum
|
|
( ''
|
|
|| CURR_VAL.CONT_ID
|
|
) );
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
'', 'efnow050$cont.AssignZoneRow');
|
|
raise;
|
|
end;
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.FormQuery
|
|
--
|
|
-- Description: This procedure builds an HTML form for entry of query criteria.
|
|
-- The criteria entered are to restrict the query of the 'CONT'
|
|
-- module component (#Maintain Contracts#2080#).
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
procedure FormQuery(
|
|
Z_DIRECT_CALL in boolean,
|
|
Z_CHK in varchar2) is
|
|
L_SUCCESS boolean := TRUE;
|
|
begin
|
|
if not caco_security.security_check('efnow050$cont') then
|
|
return;
|
|
end if;
|
|
|
|
if not Z_DIRECT_CALL then
|
|
|
|
null;
|
|
end if;
|
|
|
|
L_SUCCESS := RestoreState
|
|
( Z_CURR_DEPTH => 0
|
|
, Z_MAX_DEPTH => 99
|
|
, Z_RESTORE_OWN_ROW => false
|
|
);
|
|
WSGL.OpenPageHead(''||' : '||'#Maintain Contracts#2080#');
|
|
WSGL.METATag;
|
|
efnow050$.TemplateHeader(TRUE,1);
|
|
WSGL.ClosePageHead;
|
|
|
|
WSGL.OpenPageBody(FALSE, p_attributes=>QF_BODY_ATTRIBUTES || 'onLoad="return CONT_OnLoad()"');
|
|
efnow050$js$cont.CreateQueryJavaScript(LOV_FRAME,QF_BODY_ATTRIBUTES);
|
|
|
|
LoadCache
|
|
( Z_CURR_DEPTH => 0
|
|
, Z_MAX_DEPTH => 2
|
|
, Z_OWN_ROW_VALUES => false
|
|
, Z_CONTEXT_FOR => REF_COMPONENT
|
|
);
|
|
|
|
htp.p(caco_system.menu);
|
|
efnow050$.FirstPage(Z_DIRECT_CALL => TRUE
|
|
|
|
);
|
|
WSGMC_OUTPUT2.Before(REF_COMPONENT,2);
|
|
|
|
htp.p(WSGL.MsgGetText(116,WSGLM.DSP116_ENTER_QRY_CAPTION,'#Maintain Contracts#2080#'));
|
|
htp.para;
|
|
WSGL.ResetForMultipleForms ;
|
|
htp.formOpen(curl => 'efnow050$cont.actionquery', cattributes => 'NAME="efnow050$cont$QForm"');
|
|
|
|
SaveState;
|
|
WSGL.LayoutOpen(WSGL.LAYOUT_TABLE);
|
|
WSGL.LayoutRowStart;
|
|
for i in 1..QF_NUMBER_OF_COLUMNS loop
|
|
WSGL.LayoutHeader(23, 'LEFT', NULL);
|
|
WSGL.LayoutHeader(40, 'LEFT', NULL);
|
|
end loop;
|
|
WSGL.LayoutRowEnd;
|
|
|
|
WSGL.LayoutRowStart('TOP');
|
|
WSGL.LayoutData(htf.bold('#Status#2114#:'));
|
|
InitialiseDomain('STATUS');
|
|
WSGL.LayoutData(WSGL.BuildDVControl(D_STATUS, WSGL.CTL_QUERY));
|
|
WSGL.LayoutRowEnd;
|
|
WSGL.LayoutRowStart('TOP');
|
|
WSGL.LayoutData(htf.bold('#Contract Number#2013#:'));
|
|
WSGL.LayoutData(WSGL.BuildQueryControl('CONTRACT_NUMBER', '30', FALSE, p_maxlength=>'30'));
|
|
WSGL.LayoutRowEnd;
|
|
WSGL.LayoutRowStart('TOP');
|
|
WSGL.LayoutData(htf.bold('#Name#116#:'));
|
|
WSGL.LayoutData(L_CUST_NAME_LOV(NULL, WSGL.CTL_QUERY, 'Q', true));
|
|
WSGL.LayoutRowEnd;
|
|
WSGL.LayoutRowStart('TOP');
|
|
WSGL.LayoutData(htf.bold('#Valid From#2441#:'));
|
|
WSGL.LayoutData(WSGL.BuildQueryControl('VALID_FROM', '11', TRUE, p_maxlength=>'10'
|
|
, p_cal_but_text => CAL_BUTTON_TEXT
|
|
, p_cal_date_format => 'DD.MM.YYYY'
|
|
, p_cal_prompt => '#Valid From#2441#'
|
|
, p_form=>'efnow050$cont$QForm'));
|
|
WSGL.LayoutRowEnd;
|
|
|
|
WSGL.LayoutClose;
|
|
|
|
WSGL.SubmitButton('Z_ACTION', htf.escape_sc(QF_QUERY_BUT_CAPTION), 'btnQFQ', 'this.form.Z_ACTION.value=\''' || QF_QUERY_BUT_ACTION || '\''');
|
|
htp.formReset(htf.escape_sc(QF_CLEAR_BUT_CAPTION), 'ID="'||htf.escape_sc(QF_CLEAR_BUT_CAPTION)||'"');
|
|
|
|
|
|
WSGL.HiddenField('Z_CHK', to_char(WSGL.Checksum
|
|
('')));
|
|
htp.formClose;
|
|
|
|
WSGL.ResetForMultipleForms ;
|
|
htp.formOpen(curl => 'ActionItem', cattributes => 'NAME="QF$AIFormBottom"');
|
|
htp.formClose;
|
|
WSGMC_OUTPUT2.After(REF_COMPONENT,2);
|
|
|
|
htp.p(caco_system.footer);
|
|
|
|
WSGL.ClosePageBody;
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
QF_BODY_ATTRIBUTES, 'efnow050$cont.FormQuery');
|
|
WSGL.ClosePageBody;
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.QueryList
|
|
--
|
|
-- Description: This procedure builds the Record list for the 'CONT'
|
|
-- module component (#Maintain Contracts#2080#).
|
|
--
|
|
-- The Record List displays context information for records which
|
|
-- match the specified query criteria.
|
|
-- Sets of records are displayed (0 records at a time)
|
|
-- with Next/Previous buttons to get other record sets.
|
|
--
|
|
-- Parameters: P_STATUS - #Status#2114#
|
|
-- P_CONTRACT_NUMBER - #Contract Number#2013#
|
|
-- P_L_CUST_NAME - #Name#116#
|
|
-- P_VALID_FROM - #Valid From#2441#
|
|
-- U_VALID_FROM - #Valid From#2441# (upper bound)
|
|
-- Z_START - First record to display
|
|
-- Z_ACTION - Next or Previous set
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
procedure QueryList(
|
|
P_STATUS in varchar2,
|
|
P_CONTRACT_NUMBER in varchar2,
|
|
P_L_CUST_NAME in varchar2,
|
|
P_VALID_FROM in varchar2,
|
|
U_VALID_FROM in varchar2,
|
|
Z_START in varchar2,
|
|
Z_ACTION in varchar2,
|
|
Z_DIRECT_CALL in boolean,
|
|
Z_CHK in varchar2 ) is
|
|
|
|
I_VF_FRAME varchar2(20) := null;
|
|
I_WHERE varchar2(2000) := '';
|
|
I_CURSOR integer;
|
|
I_VOID integer;
|
|
I_ROWS_FETCHED integer := 0;
|
|
I_TOTAL_ROWS integer := 0;
|
|
I_START number(38) := to_number(Z_START);
|
|
I_COUNT number(10) := 0;
|
|
I_OF_TOTAL_TEXT varchar2(200) := '';
|
|
I_NEXT_BUT boolean;
|
|
I_PREV_BUT boolean;
|
|
I_COL_COUNT integer;
|
|
I_SUCCESS boolean := true;
|
|
l_row integer := 0;
|
|
l_id varchar2(35) := null;
|
|
-- Reset break group?
|
|
RSIG_CUST boolean := true;
|
|
-- Reset break group?
|
|
RSIG_REST boolean := true;
|
|
I_LAST_BASE CURR_VAL%TYPE;
|
|
I_LAST_NBT NBT_REC;
|
|
|
|
|
|
|
|
begin
|
|
|
|
if not caco_security.security_check('efnow050$cont') then
|
|
return;
|
|
end if;
|
|
|
|
|
|
WSGL.RegisterURL('efnow050$cont.querylist');
|
|
WSGL.AddURLParam('P_STATUS', P_STATUS);
|
|
WSGL.AddURLParam('P_CONTRACT_NUMBER', P_CONTRACT_NUMBER);
|
|
WSGL.AddURLParam('P_L_CUST_NAME', P_L_CUST_NAME);
|
|
WSGL.AddURLParam('P_VALID_FROM', P_VALID_FROM);
|
|
WSGL.AddURLParam('U_VALID_FROM', U_VALID_FROM);
|
|
WSGL.AddURLParam('Z_START', Z_START);
|
|
WSGL.AddURLParam('Z_ACTION', Z_ACTION);
|
|
WSGL.AddURLParam('Z_CHK', Z_CHK);
|
|
if (not Z_DIRECT_CALL) then
|
|
|
|
null;
|
|
|
|
|
|
end if;
|
|
if (Z_ACTION = RL_QUERY_BUT_ACTION) or (Z_ACTION = RL_QUERY_BUT_CAPTION) then
|
|
FormQuery(
|
|
Z_DIRECT_CALL=>TRUE);
|
|
return;
|
|
end if;
|
|
|
|
-- Set up any master context values that may be required
|
|
I_SUCCESS := RestoreState
|
|
( Z_CURR_DEPTH => 0
|
|
, Z_MAX_DEPTH => 99
|
|
, Z_RESTORE_OWN_ROW => false
|
|
);
|
|
|
|
|
|
|
|
WSGL.OpenPageHead(''||' : '||'#Maintain Contracts#2080#');
|
|
WSGL.METATag;
|
|
efnow050$.TemplateHeader(TRUE,6);
|
|
WSGL.ClosePageHead;
|
|
|
|
WSGL.OpenPageBody(FALSE, p_attributes=>RL_BODY_ATTRIBUTES);
|
|
efnow050$js$cont.CreateListJavaScript(RL_BODY_ATTRIBUTES);
|
|
|
|
LoadCache
|
|
( Z_CURR_DEPTH => 0
|
|
, Z_MAX_DEPTH => 2
|
|
, Z_OWN_ROW_VALUES => false
|
|
, Z_CONTEXT_FOR => REF_COMPONENT
|
|
);
|
|
|
|
|
|
|
|
htp.p(caco_system.menu);
|
|
|
|
WSGMC_OUTPUT2.Before(REF_COMPONENT,2);
|
|
|
|
if (Z_ACTION = RL_LAST_BUT_ACTION) or (Z_ACTION = RL_LAST_BUT_CAPTION) or
|
|
(Z_ACTION = RL_COUNT_BUT_ACTION) or (Z_ACTION = RL_COUNT_BUT_CAPTION) or
|
|
(RL_TOTAL_COUNT_REQD)
|
|
then
|
|
|
|
I_COUNT := QueryHits(
|
|
P_STATUS,
|
|
P_CONTRACT_NUMBER,
|
|
P_L_CUST_NAME,
|
|
P_VALID_FROM,
|
|
U_VALID_FROM);
|
|
if I_COUNT = -1 then
|
|
WSGL.ClosePageBody;
|
|
return;
|
|
end if;
|
|
end if;
|
|
|
|
if (Z_ACTION = RL_COUNT_BUT_ACTION) or (Z_ACTION = RL_COUNT_BUT_CAPTION) or
|
|
RL_TOTAL_COUNT_REQD then
|
|
I_OF_TOTAL_TEXT := ' '||WSGL.MsgGetText(111,WSGLM.DSP111_OF_TOTAL, to_char(I_COUNT));
|
|
end if;
|
|
I_START := 1;
|
|
|
|
I_PREV_BUT := TRUE;
|
|
I_NEXT_BUT := FALSE;
|
|
if I_START = 1 or Z_ACTION IS NULL then
|
|
I_PREV_BUT := FALSE;
|
|
end if;
|
|
|
|
if nvl(Z_ACTION, 'X') != 'DONTQUERY' then
|
|
|
|
if ZONE_SQL IS NULL then
|
|
if not BuildSQL(
|
|
P_STATUS,
|
|
P_CONTRACT_NUMBER,
|
|
P_L_CUST_NAME,
|
|
P_VALID_FROM,
|
|
U_VALID_FROM) then
|
|
WSGL.ClosePageBody;
|
|
return;
|
|
end if;
|
|
end if;
|
|
|
|
if not PreQuery(
|
|
P_STATUS,
|
|
P_CONTRACT_NUMBER,
|
|
P_L_CUST_NAME,
|
|
P_VALID_FROM,
|
|
U_VALID_FROM) then
|
|
WSGL.DisplayMessage(WSGL.MESS_ERROR, cg$errors.GetErrors,
|
|
''||' : '||'#Maintain Contracts#2080#', RL_BODY_ATTRIBUTES);
|
|
return;
|
|
end if;
|
|
|
|
InitialiseDomain('STATUS');
|
|
|
|
|
|
OpenZoneSql( I_CURSOR );
|
|
I_VOID := dbms_sql.execute(I_CURSOR);
|
|
I_ROWS_FETCHED := dbms_sql.fetch_rows(I_CURSOR);
|
|
else
|
|
I_ROWS_FETCHED := 0;
|
|
end if;
|
|
I_TOTAL_ROWS := I_ROWS_FETCHED;
|
|
|
|
if I_ROWS_FETCHED != 0 then
|
|
WSGL.LayoutOpen(WSGL.LAYOUT_TABLE, P_BORDER=>TRUE);
|
|
|
|
WSGL.LayoutRowStart(p_attrs=>'class = cgrlheaderrow');
|
|
for i in 1..RL_NUMBER_OF_COLUMNS loop
|
|
WSGL.LayoutHeader(30, 'LEFT', '#Customer#1047#','');
|
|
WSGL.LayoutHeader(30, 'LEFT', '#Contract Name#2082#','');
|
|
WSGL.LayoutHeader(10, 'LEFT', '#Status#2114#','');
|
|
WSGL.LayoutHeader(11, 'LEFT', '#Valid From#2441#','');
|
|
WSGL.LayoutHeader(11, 'LEFT', '#Valid To#2442#','');
|
|
WSGL.LayoutHeader(30, 'LEFT', '#Edit#2008#','');
|
|
WSGL.LayoutHeader(30, 'LEFT', '#Copy#3547#','');
|
|
end loop;
|
|
WSGL.LayoutRowEnd;
|
|
|
|
while I_ROWS_FETCHED <> 0 loop
|
|
|
|
if I_TOTAL_ROWS >= I_START then
|
|
AssignZoneRow(I_CURSOR);
|
|
|
|
if (NBT_VAL.UI_CUST != I_LAST_NBT.UI_CUST or (NBT_VAL.UI_CUST is null and I_LAST_NBT.UI_CUST is not null) or (NBT_VAL.UI_CUST is not null and I_LAST_NBT.UI_CUST is null) ) then
|
|
RSIG_CUST := true;
|
|
else
|
|
RSIG_CUST := false;
|
|
end if;
|
|
if (CURR_VAL.VALID_UNTIL != I_LAST_BASE.VALID_UNTIL or (CURR_VAL.VALID_UNTIL is null and I_LAST_BASE.VALID_UNTIL is not null) or (CURR_VAL.VALID_UNTIL is not null and I_LAST_BASE.VALID_UNTIL is null) ) or
|
|
(CURR_VAL.STATUS != I_LAST_BASE.STATUS or (CURR_VAL.STATUS is null and I_LAST_BASE.STATUS is not null) or (CURR_VAL.STATUS is not null and I_LAST_BASE.STATUS is null) ) or
|
|
(CURR_VAL.CONTRACT_NUMBER != I_LAST_BASE.CONTRACT_NUMBER or (CURR_VAL.CONTRACT_NUMBER is null and I_LAST_BASE.CONTRACT_NUMBER is not null) or (CURR_VAL.CONTRACT_NUMBER is not null and I_LAST_BASE.CONTRACT_NUMBER is null) ) or
|
|
(NBT_VAL.L_CUST_NAME != I_LAST_NBT.L_CUST_NAME or (NBT_VAL.L_CUST_NAME is null and I_LAST_NBT.L_CUST_NAME is not null) or (NBT_VAL.L_CUST_NAME is not null and I_LAST_NBT.L_CUST_NAME is null) ) or
|
|
(CURR_VAL.CONT_ID != I_LAST_BASE.CONT_ID or (CURR_VAL.CONT_ID is null and I_LAST_BASE.CONT_ID is not null) or (CURR_VAL.CONT_ID is not null and I_LAST_BASE.CONT_ID is null) ) or
|
|
(CURR_VAL.CUST_ID != I_LAST_BASE.CUST_ID or (CURR_VAL.CUST_ID is null and I_LAST_BASE.CUST_ID is not null) or (CURR_VAL.CUST_ID is not null and I_LAST_BASE.CUST_ID is null) ) or
|
|
(CURR_VAL.VALID_FROM != I_LAST_BASE.VALID_FROM or (CURR_VAL.VALID_FROM is null and I_LAST_BASE.VALID_FROM is not null) or (CURR_VAL.VALID_FROM is not null and I_LAST_BASE.VALID_FROM is null) ) or
|
|
(NBT_VAL.UI_CONTRACT != I_LAST_NBT.UI_CONTRACT or (NBT_VAL.UI_CONTRACT is null and I_LAST_NBT.UI_CONTRACT is not null) or (NBT_VAL.UI_CONTRACT is not null and I_LAST_NBT.UI_CONTRACT is null) ) or
|
|
(NBT_VAL.UI_STATUS != I_LAST_NBT.UI_STATUS or (NBT_VAL.UI_STATUS is null and I_LAST_NBT.UI_STATUS is not null) or (NBT_VAL.UI_STATUS is not null and I_LAST_NBT.UI_STATUS is null) ) or
|
|
(NBT_VAL.UI_CONT_FROM != I_LAST_NBT.UI_CONT_FROM or (NBT_VAL.UI_CONT_FROM is null and I_LAST_NBT.UI_CONT_FROM is not null) or (NBT_VAL.UI_CONT_FROM is not null and I_LAST_NBT.UI_CONT_FROM is null) ) or
|
|
(NBT_VAL.UI_CONT_TO != I_LAST_NBT.UI_CONT_TO or (NBT_VAL.UI_CONT_TO is null and I_LAST_NBT.UI_CONT_TO is not null) or (NBT_VAL.UI_CONT_TO is not null and I_LAST_NBT.UI_CONT_TO is null) ) or
|
|
(NBT_VAL.UI_EDIT_URL != I_LAST_NBT.UI_EDIT_URL or (NBT_VAL.UI_EDIT_URL is null and I_LAST_NBT.UI_EDIT_URL is not null) or (NBT_VAL.UI_EDIT_URL is not null and I_LAST_NBT.UI_EDIT_URL is null) ) or
|
|
(NBT_VAL.UI_COPY_URL != I_LAST_NBT.UI_COPY_URL or (NBT_VAL.UI_COPY_URL is null and I_LAST_NBT.UI_COPY_URL is not null) or (NBT_VAL.UI_COPY_URL is not null and I_LAST_NBT.UI_COPY_URL is null) ) then
|
|
RSIG_REST := true;
|
|
else
|
|
RSIG_REST := false;
|
|
end if;
|
|
if RSIG_CUST then
|
|
RSIG_REST := true;
|
|
end if;
|
|
|
|
|
|
I_LAST_NBT.UI_CUST := NBT_VAL.UI_CUST;
|
|
I_LAST_BASE.VALID_UNTIL := CURR_VAL.VALID_UNTIL;
|
|
I_LAST_BASE.STATUS := CURR_VAL.STATUS;
|
|
I_LAST_BASE.CONTRACT_NUMBER := CURR_VAL.CONTRACT_NUMBER;
|
|
I_LAST_NBT.L_CUST_NAME := NBT_VAL.L_CUST_NAME;
|
|
I_LAST_BASE.CONT_ID := CURR_VAL.CONT_ID;
|
|
I_LAST_BASE.CUST_ID := CURR_VAL.CUST_ID;
|
|
I_LAST_BASE.VALID_FROM := CURR_VAL.VALID_FROM;
|
|
I_LAST_NBT.UI_CONTRACT := NBT_VAL.UI_CONTRACT;
|
|
I_LAST_NBT.UI_STATUS := NBT_VAL.UI_STATUS;
|
|
I_LAST_NBT.UI_CONT_FROM := NBT_VAL.UI_CONT_FROM;
|
|
I_LAST_NBT.UI_CONT_TO := NBT_VAL.UI_CONT_TO;
|
|
I_LAST_NBT.UI_EDIT_URL := NBT_VAL.UI_EDIT_URL;
|
|
I_LAST_NBT.UI_COPY_URL := NBT_VAL.UI_COPY_URL;
|
|
l_row := l_row + 1;
|
|
|
|
|
|
WSGL.LayoutRowStart('TOP', p_attrs=>'class = cgrldatarow');
|
|
l_id := '' || l_row;
|
|
if RSIG_CUST and NBT_VAL.UI_CUST is not null then
|
|
WSGL.LayoutData(p_text=>replace(WSGL.EscapeItem(NBT_VAL.UI_CUST), '
|
|
', '<BR>
|
|
'), p_id=>l_id);
|
|
else
|
|
WSGL.LayoutData(p_text=>' ', p_id=>l_id);
|
|
end if;
|
|
l_id := '' || l_row;
|
|
if RSIG_REST and NBT_VAL.UI_CONTRACT is not null then
|
|
WSGL.LayoutData(p_text=>replace(WSGL.EscapeItem(NBT_VAL.UI_CONTRACT), '
|
|
', '<BR>
|
|
'), p_id=>l_id);
|
|
else
|
|
WSGL.LayoutData(p_text=>' ', p_id=>l_id);
|
|
end if;
|
|
l_id := '' || l_row;
|
|
if RSIG_REST and NBT_VAL.UI_STATUS is not null then
|
|
WSGL.LayoutData(p_text=>replace(WSGL.EscapeItem(NBT_VAL.UI_STATUS), '
|
|
', '<BR>
|
|
'), p_id=>l_id);
|
|
else
|
|
WSGL.LayoutData(p_text=>' ', p_id=>l_id);
|
|
end if;
|
|
l_id := '' || l_row;
|
|
if RSIG_REST and NBT_VAL.UI_CONT_FROM is not null then
|
|
WSGL.LayoutData(p_text=>EFNOW050$CONT.FORMATDATE(WSGL.EscapeItem(ltrim(to_char(NBT_VAL.UI_CONT_FROM, 'DD-MON-RRRR')))), p_id=>l_id);
|
|
else
|
|
WSGL.LayoutData(p_text=>' ', p_id=>l_id);
|
|
end if;
|
|
l_id := '' || l_row;
|
|
if RSIG_REST and NBT_VAL.UI_CONT_TO is not null then
|
|
WSGL.LayoutData(p_text=>EFNOW050$CONT.FORMATDATE(WSGL.EscapeItem(ltrim(to_char(NBT_VAL.UI_CONT_TO, 'DD-MON-RRRR')))), p_id=>l_id);
|
|
else
|
|
WSGL.LayoutData(p_text=>' ', p_id=>l_id);
|
|
end if;
|
|
l_id := '' || l_row;
|
|
if RSIG_REST and NBT_VAL.UI_EDIT_URL is not null then
|
|
WSGL.LayoutData(p_text=>replace(wsgl.anchor2(WSGL.EscapeItem(NBT_VAL.UI_EDIT_URL), '#Edit#2008#'), '
|
|
', '<BR>
|
|
'), p_id=>l_id);
|
|
else
|
|
WSGL.LayoutData(p_text=>' ', p_id=>l_id);
|
|
end if;
|
|
l_id := '' || l_row;
|
|
if RSIG_REST and NBT_VAL.UI_COPY_URL is not null then
|
|
WSGL.LayoutData(p_text=>replace(wsgl.anchor2(WSGL.EscapeItem(NBT_VAL.UI_COPY_URL), '#Copy#3547#'), '
|
|
', '<BR>
|
|
'), p_id=>l_id);
|
|
else
|
|
WSGL.LayoutData(p_text=>' ', p_id=>l_id);
|
|
end if;
|
|
|
|
WSGL.LayoutRowEnd;
|
|
|
|
I_ROWS_FETCHED := dbms_sql.fetch_rows(I_CURSOR);
|
|
else
|
|
I_ROWS_FETCHED := dbms_sql.fetch_rows(I_CURSOR);
|
|
end if;
|
|
|
|
I_TOTAL_ROWS := I_TOTAL_ROWS + I_ROWS_FETCHED;
|
|
|
|
end loop;
|
|
|
|
WSGL.LayoutClose;
|
|
|
|
if I_START = I_TOTAL_ROWS then
|
|
htp.p(WSGL.MsgGetText(109,WSGLM.DSP109_RECORD, to_char(I_TOTAL_ROWS))||I_OF_TOTAL_TEXT);
|
|
else
|
|
htp.p(WSGL.MsgGetText(110,WSGLM.DSP110_RECORDS_N_M,
|
|
to_char(I_START), to_char(I_TOTAL_ROWS))||
|
|
I_OF_TOTAL_TEXT);
|
|
end if;
|
|
htp.para;
|
|
else
|
|
htp.p(WSGL.MsgGetText(112,WSGLM.DSP112_NO_RECORDS));
|
|
end if;
|
|
|
|
if nvl(Z_ACTION, 'X') != 'DONTQUERY' then
|
|
dbms_sql.close_cursor(I_CURSOR);
|
|
end if;
|
|
|
|
WSGL.ResetForMultipleForms ;
|
|
htp.formOpen(curl => 'efnow050$cont.querylist', cattributes => 'NAME="efnow050$cont$LForm"');
|
|
SaveState;
|
|
WSGL.HiddenField('P_STATUS', P_STATUS);
|
|
WSGL.HiddenField('P_CONTRACT_NUMBER', P_CONTRACT_NUMBER);
|
|
WSGL.HiddenField('P_L_CUST_NAME', P_L_CUST_NAME);
|
|
WSGL.HiddenField('P_VALID_FROM', P_VALID_FROM);
|
|
WSGL.HiddenField('U_VALID_FROM', U_VALID_FROM);
|
|
WSGL.HiddenField('Z_START', to_char(I_START));
|
|
htp.p ('<SCRIPT><!--');
|
|
htp.p ('document.write (''<input type=hidden name="Z_ACTION">'')');
|
|
htp.p ('//-->');
|
|
htp.p ('</SCRIPT>');
|
|
|
|
WSGL.RecordListButton(I_PREV_BUT, 'Z_ACTION', htf.escape_sc(RL_FIRST_BUT_CAPTION), WSGL.MsgGetText(213,WSGLM.MSG213_AT_FIRST), FALSE,
|
|
'onClick="this.form.Z_ACTION.value=\''' || RL_FIRST_BUT_ACTION || '\''"');
|
|
WSGL.RecordListButton(I_PREV_BUT, 'Z_ACTION', htf.escape_sc(RL_PREV_BUT_CAPTION), WSGL.MsgGetText(213,WSGLM.MSG213_AT_FIRST), FALSE,
|
|
'onClick="this.form.Z_ACTION.value=\''' || RL_PREV_BUT_ACTION || '\''"');
|
|
WSGL.RecordListButton(I_NEXT_BUT,'Z_ACTION', htf.escape_sc(RL_NEXT_BUT_CAPTION), WSGL.MsgGetText(214,WSGLM.MSG214_AT_LAST), FALSE,
|
|
'onClick="this.form.Z_ACTION.value=\''' || RL_NEXT_BUT_ACTION || '\''"');
|
|
WSGL.RecordListButton(I_NEXT_BUT,'Z_ACTION', htf.escape_sc(RL_LAST_BUT_CAPTION), WSGL.MsgGetText(214,WSGLM.MSG214_AT_LAST), FALSE,
|
|
'onClick="this.form.Z_ACTION.value=\''' || RL_LAST_BUT_ACTION || '\''"');
|
|
|
|
WSGL.RecordListButton(TRUE, 'Z_ACTION', htf.escape_sc(RL_REQUERY_BUT_CAPTION),p_dojs=>FALSE,
|
|
buttonJS => 'onClick="this.form.Z_ACTION.value=\''' || RL_REQUERY_BUT_ACTION || '\''"');
|
|
|
|
WSGL.RecordListButton(TRUE, 'Z_ACTION', htf.escape_sc(RL_COUNT_BUT_CAPTION),p_dojs=>FALSE,
|
|
buttonJS => 'onClick="this.form.Z_ACTION.value=\''' || RL_COUNT_BUT_ACTION || '\''"');
|
|
htp.para;
|
|
|
|
WSGL.RecordListButton(TRUE, 'Z_ACTION', htf.escape_sc(RL_QUERY_BUT_CAPTION),p_dojs=>FALSE,
|
|
buttonJS => 'onClick="this.form.Z_ACTION.value=\''' || RL_QUERY_BUT_ACTION || '\''"');
|
|
WSGL.HiddenField('Z_CHK',
|
|
to_char(WSGL.Checksum('')));
|
|
htp.formClose;
|
|
|
|
WSGL.ResetForMultipleForms ;
|
|
htp.formOpen(curl => 'ActionItem', cattributes => 'NAME="RL$AIFormBottom"');
|
|
htp.para;
|
|
WSGL.SubmitButton('Z_ACTION', '#New Contract#2085#', 'AI_NEW_CONTRACT', p_target=>'_top');
|
|
htp.formClose;
|
|
WSGL.ReturnLinks('0.1', WSGL.MENU_LONG, p_target=>'_top');
|
|
WSGL.NavLinks;
|
|
WSGMC_OUTPUT2.After(REF_COMPONENT,2);
|
|
|
|
htp.p(caco_system.footer);
|
|
|
|
WSGL.ClosePageBody;
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
RL_BODY_ATTRIBUTES, 'efnow050$cont.QueryList');
|
|
WSGL.ClosePageBody;
|
|
end;
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.RestoreState
|
|
--
|
|
-- Description: Restore the data state and optional meta data for the
|
|
-- 'CONT' module component (#Maintain Contracts#2080#).
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
function RestoreState
|
|
( Z_CURR_DEPTH in number
|
|
, Z_MAX_DEPTH in number
|
|
, Z_RESTORE_OWN_ROW in boolean ) return boolean
|
|
is
|
|
I_REMAINING_DEPTH integer;
|
|
I_CURSOR integer;
|
|
I_VOID integer;
|
|
I_ROWS_FETCHED integer;
|
|
I_FETCH_ERROR boolean := FALSE;
|
|
I_SUCCESS boolean := TRUE;
|
|
begin
|
|
if Z_RESTORE_OWN_ROW then
|
|
if ( CURR_VAL.CONT_ID is null
|
|
) then
|
|
return FALSE;
|
|
end if;
|
|
end if;
|
|
|
|
if ( Z_RESTORE_OWN_ROW ) then
|
|
|
|
-- Use the CURR_VAL fields for UID to get the other values
|
|
|
|
if not BuildSQL( Z_QUERY_BY_KEY => true ) then
|
|
return FALSE;
|
|
end if;
|
|
|
|
OpenZoneSql(I_CURSOR);
|
|
I_VOID := dbms_sql.execute(I_CURSOR);
|
|
I_ROWS_FETCHED := dbms_sql.fetch_rows(I_CURSOR);
|
|
|
|
if I_ROWS_FETCHED = 0 then
|
|
I_FETCH_ERROR := TRUE;
|
|
else
|
|
|
|
AssignZoneRow(I_CURSOR);
|
|
I_ROWS_FETCHED := dbms_sql.fetch_rows(I_CURSOR);
|
|
|
|
if I_ROWS_FETCHED != 0 then
|
|
I_FETCH_ERROR := TRUE;
|
|
end if;
|
|
|
|
end if;
|
|
|
|
dbms_sql.close_cursor(I_CURSOR);
|
|
if I_FETCH_ERROR then
|
|
return FALSE;
|
|
end if;
|
|
|
|
end if;
|
|
return TRUE;
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
'', 'efnow050$cont.RestoreState');
|
|
raise;
|
|
return FALSE;
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.SaveState
|
|
--
|
|
-- Description: Saves the data state for the 'CONT' module component (#Maintain Contracts#2080#).
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
procedure SaveState
|
|
is
|
|
begin
|
|
|
|
|
|
null;
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
'', 'efnow050$cont.SaveState');
|
|
raise;
|
|
end;
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.GetRef
|
|
--
|
|
-- Description: Returns a handle to the component object
|
|
--
|
|
-- Parameters:
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
function GetRef return WSGOC.COMPONENT_REF
|
|
is
|
|
begin
|
|
return ref_Component;
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.LoadCache
|
|
--
|
|
-- Description: Populate the object cache with
|
|
-- 'CONT' module component (#Maintain Contracts#2080#).
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
procedure LoadCache
|
|
( Z_CURR_DEPTH in number
|
|
, Z_MAX_DEPTH in number
|
|
, Z_OWN_ROW_VALUES in boolean
|
|
, Z_CONTEXT_FOR in WSGOC.COMPONENT_REF
|
|
, Z_BRANCH in WSGOC.BRANCH_REF
|
|
)
|
|
is
|
|
I_VF_FRAME varchar2(20) := null;
|
|
begin
|
|
|
|
-- Is cache already loaded
|
|
if not WSGOC.Is_Null(ref_Component) then
|
|
return;
|
|
end if;
|
|
|
|
InitialiseDomain('STATUS');
|
|
|
|
ref_Component := WSGOC.Component
|
|
( pModule => efnow050$.GetRef
|
|
, pBranch => Z_BRANCH
|
|
, pContext_For=> Z_CONTEXT_FOR
|
|
, pName => 'CONT'
|
|
, pTitle => '#Maintain Contracts#2080#'
|
|
, pSystemImagePath=> '/images/'
|
|
);
|
|
|
|
r_UI_CUST := WSGOC.Item
|
|
( pName => 'UI_CUST'
|
|
, pPrompt => '#Customer#1047#'
|
|
, pIsContext=> true
|
|
);
|
|
r_UI_CONTRACT := WSGOC.Item
|
|
( pName => 'UI_CONTRACT'
|
|
, pPrompt => '#Contract Name#2082#'
|
|
, pIsContext=> true
|
|
);
|
|
r_UI_STATUS := WSGOC.Item
|
|
( pName => 'UI_STATUS'
|
|
, pPrompt => '#Status#2114#'
|
|
, pIsContext=> true
|
|
);
|
|
r_UI_CONT_FROM := WSGOC.Item
|
|
( pName => 'UI_CONT_FROM'
|
|
, pPrompt => '#Valid From#2441#'
|
|
, pIsContext=> true
|
|
);
|
|
r_UI_CONT_TO := WSGOC.Item
|
|
( pName => 'UI_CONT_TO'
|
|
, pPrompt => '#Valid To#2442#'
|
|
, pIsContext=> true
|
|
);
|
|
r_UI_EDIT_URL := WSGOC.Item
|
|
( pName => 'UI_EDIT_URL'
|
|
, pPrompt => '#Edit#2008#'
|
|
, pIsContext=> true
|
|
);
|
|
r_UI_COPY_URL := WSGOC.Item
|
|
( pName => 'UI_COPY_URL'
|
|
, pPrompt => '#Copy#3547#'
|
|
, pIsContext=> true
|
|
);
|
|
r_VALID_UNTIL := WSGOC.Item
|
|
( pName => 'VALID_UNTIL'
|
|
, pPrompt => '#Valid Until#2440#'
|
|
);
|
|
r_STATUS := WSGOC.Item
|
|
( pName => 'STATUS'
|
|
, pPrompt => '#Status#2114#'
|
|
);
|
|
r_CONTRACT_NUMBER := WSGOC.Item
|
|
( pName => 'CONTRACT_NUMBER'
|
|
, pPrompt => '#Contract Number#2013#'
|
|
);
|
|
r_L_CUST_NAME := WSGOC.Item
|
|
( pName => 'L_CUST_NAME'
|
|
, pPrompt => '#Name#116#'
|
|
);
|
|
r_CONT_ID := WSGOC.Item
|
|
( pName => 'CONT_ID'
|
|
, pPrompt => '#Cont Id#2443#'
|
|
);
|
|
r_CUST_ID := WSGOC.Item
|
|
( pName => 'CUST_ID'
|
|
, pPrompt => 'Cust Id'
|
|
);
|
|
r_VALID_FROM := WSGOC.Item
|
|
( pName => 'VALID_FROM'
|
|
, pPrompt => '#Valid From#2441#'
|
|
);
|
|
|
|
WSGOC.Add_Items(ref_Component, r_UI_CUST);
|
|
WSGOC.Add_Items(ref_Component, r_UI_CONTRACT);
|
|
WSGOC.Add_Items(ref_Component, r_UI_STATUS);
|
|
WSGOC.Add_Items(ref_Component, r_UI_CONT_FROM);
|
|
WSGOC.Add_Items(ref_Component, r_UI_CONT_TO);
|
|
WSGOC.Add_Items(ref_Component, r_UI_EDIT_URL);
|
|
WSGOC.Add_Items(ref_Component, r_UI_COPY_URL);
|
|
WSGOC.Add_Items(ref_Component, r_VALID_UNTIL);
|
|
WSGOC.Add_Items(ref_Component, r_STATUS);
|
|
WSGOC.Add_Items(ref_Component, r_CONTRACT_NUMBER);
|
|
WSGOC.Add_Items(ref_Component, r_L_CUST_NAME);
|
|
WSGOC.Add_Items(ref_Component, r_CONT_ID);
|
|
WSGOC.Add_Items(ref_Component, r_CUST_ID);
|
|
WSGOC.Add_Items(ref_Component, r_VALID_FROM);
|
|
|
|
|
|
if ( Z_OWN_ROW_VALUES ) then
|
|
|
|
-- Set the display value for each item
|
|
-- ( As would be displayed on the Record List )
|
|
WSGOC.Set_Value( r_UI_CUST, replace(WSGL.EscapeItem(NBT_VAL.UI_CUST), '
|
|
', '<BR>
|
|
') );
|
|
WSGOC.Set_Value( r_UI_CONTRACT, replace(WSGL.EscapeItem(NBT_VAL.UI_CONTRACT), '
|
|
', '<BR>
|
|
') );
|
|
WSGOC.Set_Value( r_UI_STATUS, replace(WSGL.EscapeItem(NBT_VAL.UI_STATUS), '
|
|
', '<BR>
|
|
') );
|
|
WSGOC.Set_Value( r_UI_CONT_FROM, EFNOW050$CONT.FORMATDATE(WSGL.EscapeItem(ltrim(to_char(NBT_VAL.UI_CONT_FROM, 'DD-MON-RRRR')))) );
|
|
WSGOC.Set_Value( r_UI_CONT_TO, EFNOW050$CONT.FORMATDATE(WSGL.EscapeItem(ltrim(to_char(NBT_VAL.UI_CONT_TO, 'DD-MON-RRRR')))) );
|
|
WSGOC.Set_Value( r_UI_EDIT_URL, replace(wsgl.anchor2(WSGL.EscapeItem(NBT_VAL.UI_EDIT_URL), '#Edit#2008#'), '
|
|
', '<BR>
|
|
') );
|
|
WSGOC.Set_Value( r_UI_COPY_URL, replace(wsgl.anchor2(WSGL.EscapeItem(NBT_VAL.UI_COPY_URL), '#Copy#3547#'), '
|
|
', '<BR>
|
|
') );
|
|
WSGOC.Set_Value( r_VALID_UNTIL, WSGL.EscapeItem(ltrim(to_char(CURR_VAL.VALID_UNTIL, 'DD.MM.YYYY'))) );
|
|
WSGOC.Set_Value( r_STATUS, replace(WSGL.EscapeItem(WSGL.DomainMeaning(D_STATUS, CURR_VAL.STATUS)), '
|
|
', '<BR>
|
|
') );
|
|
WSGOC.Set_Value( r_CONTRACT_NUMBER, replace(WSGL.EscapeItem(CURR_VAL.CONTRACT_NUMBER), '
|
|
', '<BR>
|
|
') );
|
|
WSGOC.Set_Value( r_L_CUST_NAME, replace(WSGL.EscapeItem(NBT_VAL.L_CUST_NAME), '
|
|
', '<BR>
|
|
') );
|
|
WSGOC.Set_Value( r_CONT_ID, WSGL.EscapeItem(CURR_VAL.CONT_ID) );
|
|
WSGOC.Set_Value( r_CUST_ID, WSGL.EscapeItem(CURR_VAL.CUST_ID) );
|
|
WSGOC.Set_Value( r_VALID_FROM, WSGL.EscapeItem(ltrim(to_char(CURR_VAL.VALID_FROM, 'DD.MM.YYYY'))) );
|
|
|
|
end if;
|
|
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
'', 'efnow050$cont.LoadCache');
|
|
raise;
|
|
end;
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.PreQuery
|
|
--
|
|
-- Description: Provides place holder for code to be run prior to a query
|
|
-- for the 'CONT' module component (#Maintain Contracts#2080#).
|
|
--
|
|
-- Parameters: None
|
|
--
|
|
-- Returns: True If success
|
|
-- False Otherwise
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
function PreQuery(
|
|
P_STATUS in varchar2,
|
|
P_CONTRACT_NUMBER in varchar2,
|
|
P_L_CUST_NAME in varchar2,
|
|
P_VALID_FROM in varchar2,
|
|
U_VALID_FROM in varchar2) return boolean is
|
|
L_RET_VAL boolean := TRUE;
|
|
begin
|
|
return L_RET_VAL;
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
DEF_BODY_ATTRIBUTES, 'efnow050$cont.PreQuery');
|
|
return FALSE;
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
-- Name: efnow050$cont.PostQuery
|
|
--
|
|
-- Description: Provides place holder for code to be run after a query
|
|
-- for the 'CONT' module component (#Maintain Contracts#2080#).
|
|
--
|
|
-- Parameters: Z_POST_DML Flag indicating if Query after insert or update
|
|
-- Z_UPDATE_ROW Can be set to mark that row as modified when a
|
|
-- multirow form is displayed, causing it to be
|
|
-- updated when the form is submitted.
|
|
--
|
|
-- Returns: True If success
|
|
-- False Otherwise
|
|
--
|
|
--------------------------------------------------------------------------------
|
|
function PostQuery(Z_POST_DML in boolean, Z_UPDATE_ROW in out boolean) return boolean is
|
|
L_RET_VAL boolean := TRUE;
|
|
begin
|
|
return L_RET_VAL;
|
|
exception
|
|
when others then
|
|
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
|
|
DEF_BODY_ATTRIBUTES, 'efnow050$cont.PostQuery');
|
|
return FALSE;
|
|
end;
|
|
end;
|
|
/
|