Commit e129fab3 authored by akhokar's avatar akhokar

Changes done in shift validation to display error message when shift is not valid.

AttendanceDailyIC.java
attd_daily21.xml
A18LSUN010.sql
d_daily_attd_edit.srd


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205145 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 07d789f7
......@@ -636,6 +636,10 @@ public class AttendanceDailyIC extends ValidatorEJB implements AttendanceDailyIC
String childNodeName = "";
int childNodeLength = 0;
int ctr=0;
//Modified by Azhar K. on [13-Aug-2019][To validate shift if not valid or blank][Start]
int cnt = 0;
String dayNo = "",empSiteCode = "";
//Modified by Azhar K. on [13-Aug-2019][To validate shift if not valid or blank][End]
String childNodeValue = "";
String attdDateStr = "";
String userId = "", loginSite = "";
......@@ -909,6 +913,77 @@ public class AttendanceDailyIC extends ValidatorEJB implements AttendanceDailyIC
errCode = itmDBAccessEJB.getErrorString("", "VMSHIFT", userId, "", conn);
break;
}
//Modified by Azhar K. on [13-Aug-2019][To validate shift if not valid or blank][Start]
mVal1 = checkNull(genericUtility.getColumnValue("emp_code", dom));
attdDateStr= checkNull(genericUtility.getColumnValue("attd_date", dom));
if(attdDateStr != null && attdDateStr.trim().length() > 0)
{
mattdDate = Timestamp.valueOf(genericUtility.getValidDateString(attdDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
sql = "select to_char(to_date(?,'dd/MM/yy'),'D') day_no from dual";
System.out.println("The Value of the Query is :-->" + sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, attdDateStr);
rs = pstmt.executeQuery();
while (rs.next())
{
dayNo = rs.getString("day_no");
}
System.out.println("::dayNo>>> " + dayNo);
close(rs, pstmt);
sql = "Select COUNT(*) AS CNT From Workshft Where shift = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,mVal);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("CNT");
}
System.out.println("cnt value for shift valid or not>>"+cnt);
close(rs, pstmt);
if(cnt == 0)
{
errCode = itmDBAccessEJB.getErrorString("", "VTSHIFTINV", userId, "", conn);
break;
}
sql = "select ddf_hr_status(?,?,?) AS WORK_SITE from dual";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,mVal1);
pstmt.setTimestamp(2,mattdDate);
pstmt.setString(3,"S");
System.out.println("strSQlQuery::>>ddf_hr_status(?,?,?)"+sql);
rs = pstmt.executeQuery();
if(rs.next())
{
empSiteCode=checkNull(rs.getString("WORK_SITE"));
}
System.out.println("@vinay::value of empSiteCode>>"+empSiteCode);
close(rs, pstmt);
sql = "Select COUNT(*) AS CNT From Workshft Where shift=? AND Day_No=? AND SITE_CODE=? AND STATUS=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,mVal);
pstmt.setString(2,dayNo);
pstmt.setString(3,empSiteCode);
pstmt.setString(4,"A");
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("CNT");
}
System.out.println("value of CNT >>"+cnt);
close(rs, pstmt);
if(cnt == 0)
{
errCode = itmDBAccessEJB.getErrorString("", "VTSHIFTCOM", userId, "", conn);
break;
}
//Modified by Azhar K. on [13-Aug-2019][To validate shift if not valid or blank][End]
}
if(errCode != null && errCode.trim().length() > 0)
{
......
......@@ -83,6 +83,12 @@ Insert into pophelp (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGH
-------------For messages table--------------------------------------------
update messages set msg_type='E' where msg_no='VMSHIFT';
Insert into messages (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION)
values ('VTSHIFTINV','Invalid Shift','Shift not defined in master please define the shift in Master!','E','Y',null,null,null,to_timestamp('16-MAY-08','DD-MON-RR HH.MI.SSXFF AM'),'VISHAL ','VISHAL ',null,null);
Insert into messages (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION)
values ('VTSHIFTCOM','Invalid workshift','Work shift not defined in master or site code of work shift doesn''t match with employee''s work site!','E','Y',null,null,null,to_timestamp('16-MAY-08','DD-MON-RR HH.MI.SSXFF AM'),'VISHAL ','VISHAL ',null,null);
......
......@@ -516,7 +516,7 @@
<band>Detail</band>
<id>16</id>
<alignment>0</alignment>
<tabsequence>40</tabsequence>
<tabsequence>50</tabsequence>
<border>5</border>
<color>0</color>
<x>360</x>
......@@ -648,7 +648,7 @@
<band>Detail</band>
<id>19</id>
<alignment>0</alignment>
<tabsequence>60</tabsequence>
<tabsequence>70</tabsequence>
<border>5</border>
<color>0</color>
<x>361</x>
......@@ -1037,7 +1037,7 @@
<band>Detail</band>
<id>22</id>
<alignment>0</alignment>
<tabsequence>70</tabsequence>
<tabsequence>80</tabsequence>
<border>0</border>
<color>0</color>
<x>143</x>
......@@ -1176,7 +1176,7 @@
<band>Detail</band>
<id>15</id>
<alignment>0</alignment>
<tabsequence>30</tabsequence>
<tabsequence>40</tabsequence>
<border>5</border>
<color>0</color>
<x>146</x>
......@@ -1242,7 +1242,7 @@
<band>Detail</band>
<id>13</id>
<alignment>0</alignment>
<tabsequence>50</tabsequence>
<tabsequence>60</tabsequence>
<border>5</border>
<color>0</color>
<x>146</x>
......@@ -1564,7 +1564,7 @@
<band>Detail</band>
<id>7</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<tabsequence>30</tabsequence>
<border>5</border>
<color>255</color>
<x>146</x>
......
......@@ -36,11 +36,11 @@ column(band=detail id=11 alignment="0" tabsequence=32766 border="5" color="255"
column(band=detail id=8 alignment="1" tabsequence=32766 border="5" color="255" x="360" y="61" height="17" width="75" format="[general]" html.valueishtml="0" name=day_no visible="1" ddlb.limit=1 ddlb.allowedit=no ddlb.case=any ddlb.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Shift :" border="0" color="0" x="39" y="86" height="17" width="101" html.valueishtml="0" name=shift_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Out Time :" border="0" color="0" x="254" y="111" height="17" width="101" html.valueishtml="0" name=outtime_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=16 alignment="0" tabsequence=40 border="5" color="0" x="360" y="112" height="16" width="75" format="[general]" html.valueishtml="0" name=outtime visible="1" edit.limit=5 edit.case=upper edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=16 alignment="0" tabsequence=50 border="5" color="0" x="360" y="112" height="16" width="75" format="[general]" html.valueishtml="0" name=outtime visible="1" edit.limit=5 edit.case=upper edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
text(band=detail alignment="1" text="Punch String :" border="0" color="0" x="40" y="191" height="17" width="101" html.valueishtml="0" name=punch_str_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=14 alignment="0" tabsequence=32766 border="5" color="0" x="147" y="191" height="46" width="272" format="[general]" html.valueishtml="0" name=punch_str visible="1" edit.limit=3000 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.autovscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Lunch Time :" border="0" color="0" x="255" y="266" height="16" width="101" html.valueishtml="0" name=lunch_time_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=19 alignment="0" tabsequence=60 border="5" color="0" x="361" y="266" height="16" width="75" format="#0" html.valueishtml="0" name=lunch_time visible="1" editmask.mask="#0" editmask.imemode=0 editmask.focusrectangle=no font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=19 alignment="0" tabsequence=70 border="5" color="0" x="361" y="266" height="16" width="75" format="#0" html.valueishtml="0" name=lunch_time visible="1" editmask.mask="#0" editmask.imemode=0 editmask.focusrectangle=no font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
text(band=detail alignment="1" text="(minutes)" border="0" color="0" x="443" y="266" height="16" width="50" html.valueishtml="0" name=t_1 visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="InTime Org :" border="0" color="0" x="40" y="289" height="16" width="101" html.valueishtml="0" name=in_time_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=3 alignment="0" tabsequence=32766 border="5" color="0" x="147" y="289" height="16" width="75" format="" html.valueishtml="0" protect="0~t1" name=in_time tag="In time of the employee for the shift." visible="1" edit.limit=5 edit.case=any edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
......@@ -52,13 +52,13 @@ text(band=detail alignment="1" text="Change User :" border="0" color="0" x="255"
column(band=detail id=17 alignment="0" tabsequence=32766 border="5" color="0" x="361" y="312" height="16" width="75" format="[general]" html.valueishtml="0" name=chg_user visible="1" edit.limit=10 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
text(band=detail alignment="1" text="Change Term :" border="0" color="0" x="40" y="335" height="16" width="101" html.valueishtml="0" name=chg_term_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=18 alignment="0" tabsequence=32766 border="5" color="0" x="147" y="335" height="16" width="75" format="[general]" html.valueishtml="0" name=chg_term visible="1" edit.limit=15 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=22 alignment="0" tabsequence=70 border="0" color="0" x="143" y="361" height="16" width="69" format="[general]" html.valueishtml="0" name=entry_mode visible="0" edit.limit=1 edit.case=upper edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=22 alignment="0" tabsequence=80 border="0" color="0" x="143" y="361" height="16" width="69" format="[general]" html.valueishtml="0" name=entry_mode visible="0" edit.limit=1 edit.case=upper edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=20 alignment="0" tabsequence=32766 border="0" color="0" x="344" y="361" height="16" width="25" format="[general]" html.valueishtml="0" name=prev_in_time visible="0" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=21 alignment="0" tabsequence=32766 border="0" color="0" x="397" y="361" height="16" width="25" format="[general]" html.valueishtml="0" name=prev_out_time visible="0" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
text(band=detail alignment="1" text="In Time :" border="0" color="0" x="39" y="111" height="17" width="101" html.valueishtml="0" name=intime_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=15 alignment="0" tabsequence=30 border="5" color="0" x="146" y="111" height="17" width="60" format="[general]" html.valueishtml="0" name=intime visible="1" edit.limit=5 edit.case=upper edit.format="" edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=15 alignment="0" tabsequence=40 border="5" color="0" x="146" y="111" height="17" width="60" format="[general]" html.valueishtml="0" name=intime visible="1" edit.limit=5 edit.case=upper edit.format="" edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
text(band=detail alignment="1" text="Reason Code :" border="0" color="0" x="39" y="136" height="17" width="101" html.valueishtml="0" name=reason_code_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=13 alignment="0" tabsequence=50 border="5" color="0" x="146" y="136" height="16" width="75" format="[general]" html.valueishtml="0" name=reason_code visible="1" edit.limit=5 edit.case=any edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=13 alignment="0" tabsequence=60 border="5" color="0" x="146" y="136" height="16" width="75" format="[general]" html.valueishtml="0" name=reason_code visible="1" edit.limit=5 edit.case=any edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=9 alignment="0" tabsequence=32766 border="5" color="0" x="361" y="244" height="16" width="75" format="[general]" html.valueishtml="0" name=result visible="1" ddlb.limit=0 ddlb.allowedit=no ddlb.case=any ddlb.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
text(band=detail alignment="1" text="Work Site:" border="0" color="0" x="40" y="266" height="17" width="101" html.valueishtml="0" name=work_site_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=12 alignment="0" tabsequence=32766 border="5" color="0" x="147" y="266" height="16" width="75" format="[general]" html.valueishtml="0" name=work_site visible="1" edit.limit=5 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
......@@ -68,7 +68,7 @@ text(band=detail alignment="1" text="Status :" border="0" color="0" x="40" y="24
text(band=detail alignment="1" text="Date :" border="0" color="0" x="39" y="61" height="17" width="101" html.valueishtml="0" name=attd_date_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Week Day :" border="0" color="0" x="254" y="61" height="17" width="101" html.valueishtml="0" name=day_no_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=2 alignment="0" tabsequence=20 border="5" color="0" x="146" y="61" height="17" width="60" format="dd/mm/yy" html.valueishtml="0" name=attd_date tag="Date of attendance." visible="1" edit.name="datetime" editmask.mask="dd/mm/yy" editmask.imemode=0 editmask.focusrectangle=no font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=7 alignment="0" tabsequence=32766 border="5" color="255" x="146" y="86" height="17" width="60" format="[general]" html.valueishtml="0" name=shift tag="The shift no. to which employee is working." visible="1" edit.limit=15 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=7 alignment="0" tabsequence=30 border="5" color="255" x="146" y="86" height="17" width="60" format="[general]" html.valueishtml="0" name=shift tag="The shift no. to which employee is working." visible="1" edit.limit=15 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" )
export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment