<%= render "layouts/portlet-config" %> <%= render "layouts/theme-panel" %> <%= render "layouts/breadcrumbs" %>
<% if flash[:error] %>
× <%= flash[:error] %>
<% end %>
<%= form_tag({:action=>'create'} ,:multipart=>true,:id=>'myForms' ) do %>
<% if @listAttend && @listAttend.length >0 || @SummListed && @SummListed.length >0 %> <% end %>

<% if @listAttend && @listAttend.length >0 %> <% @myEditAld = true @myDeletAld = true presents = 0 absent = 0 workhrct = 0 latect = 0 earlyct = 0 othrsct = 0 fwkhrs = 0 fwkmns = 0 fovthrs = 0 fovtmns = 0 lateplhrs = 0 lateplmns = 0 ltspenty = 0 pagestart = params[:page] ? params[:page] : 1 if pagestart.to_i <=1 i = 1 else i = ((pagestart.to_i-1)*25)+1 i = i.to_i end if @listAttend && @listAttend.length >0 @listAttend.each do |gps| %> <% departname = "" desnation = "" empname = "" empobj = get_mysewdar_list_details(gps.al_empcode) if empobj empname = empobj.sw_sewadar_name dpobj = get_all_department_detail(empobj.sw_depcode) if dpobj departname = dpobj.departDescription end desobj = get_sewdar_designation_detail(empobj.sw_desigcode) if desobj desnation = desobj.ds_description end end presents += gps.al_present.to_f absent += gps.al_absent.to_f if gps.al_workhrs !=nil && gps.al_workhrs != '' newkhrs = get_calculated_hours_minute(gps.al_workhrs,'H') newmnts = get_calculated_hours_minute(gps.al_workhrs,'M') fwkhrs += newkhrs.to_i fwkmns += newmnts.to_i end if gps.al_latehrs != nil && gps.al_latehrs !='' nlates = gps.al_latehrs.to_s.gsub(":",".") if nlates.to_f >0 latect +=1 end end if gps.al_earlhrs != nil && gps.al_earlhrs !='' erlys = gps.al_earlhrs.to_s.gsub(":",".") if erlys.to_f >0 earlyct +=1 end end if gps.al_overtime !=nil && gps.al_overtime != '' ovthrs = get_calculated_hours_minute(gps.al_overtime,'H') ovtmns = get_calculated_hours_minute(gps.al_overtime,'M') fovthrs += ovthrs.to_i fovtmns += ovtmns.to_i end if gps.al_latepelanty != nil && gps.al_latepelanty != '' lateplhrsf = gps.al_latepelanty.to_s.gsub(":",".") ltspenty += lateplhrsf.to_f end %> <% i +=1 end %> <% else %> <% end %>
SL No. Date Sewadar Code
Name
Department
Shift Arrival Time Departure Time Working Hrs Late Hrs Early Hrs Miss punch Late Penalty Remark Leave Type
<%=i%> <%=formatted_date(gps.al_trandate)%> <%=gps.al_empcode%>
<%=empname%>
<%=departname%>
<%=gps.al_shift%> <%=gps.al_arrtime%> <%=gps.all_deptime%> <%=(gps.al_workhrs.gsub(":",".").to_s == '0' ? '' : gps.al_workhrs )%> <%=(gps.al_latehrs.gsub(":",".").to_s =='0' ? '' : gps.al_latehrs)%> <%=(gps.al_earlhrs.gsub(":",".").to_s == '0' ? '' : gps.al_earlhrs)%> <%=(gps.al_misspunch.gsub(":",".").to_s =='0' ? '' : gps.al_misspunch)%> <%=gps.al_latepelanty.to_s.gsub(":",".")%> <% if gps.al_present.to_f >0 %> Present <% elsif gps.al_absent.to_f >0 %> Absent <% elsif gps.al_presabsent == 'HD' %> Half Day <% elsif gps.al_presabsent == 'HL' %> Holiday <% elsif gps.al_presabsent == 'WO' %> Week Off <% end %> <%=gps.al_leavecode%>
Total Present
<%=presents%>
Absent
<%=absent%>
<% wrkshrs = 0 if fwkmns.to_i >=60 nwhs = fwkmns.to_f/60 nwhs = currency_formatted(nwhs) wrkshrs = fwkhrs.to_f+nwhs.to_f nwrks = wrkshrs.to_s.split(".") if nwrks[1].to_i<10 mns = ":0"+nwrks[1].to_s wrkshrs = nwrks[0].to_s+mns.to_s else wrkshrs = wrkshrs.to_s.gsub(".",":") end else if fwkmns.to_i <10 wrkshrs = fwkhrs.to_s+":"+"0"+fwkmns.to_s else wrkshrs = fwkhrs.to_s+":"+fwkmns.to_s end end %> WHrs
<%=wrkshrs%>
Late
<%=latect%>
Early
<%=earlyct%>
LPT
<%=currency_formatted(ltspenty)%>
No Records Found
<% end %> <% if @SummListed && @SummListed.length >0 %> <% @myEditAld = true @myDeletAld = true myxpresents = 0 myxabsent = 0 myxlatect = 0 myxearlyct = 0 mytotalwkhrs = 0 mytotalwkmns = 0 mytotalovthrs = 0 mytotalovtmns = 0 mytotalplhrs = 0 mytotalplmns = 0 myfinalpmetys = 0 pagestart = params[:page] ? params[:page] : 1 if pagestart.to_i <=1 i = 1 else i = ((pagestart.to_i-1)*25)+1 i = i.to_i end if @SummListed && @SummListed.length >0 @SummListed.each do |gps| %> <% departname = "" desnation = "" empname = "" # empobj = get_employee_detail(gps.al_compcode,gps.al_empcode) empobj = get_mysewdar_list_details(gps.al_empcode) if empobj empname = empobj.sw_sewadar_name dpobj = get_all_department_detail(empobj.sw_depcode) if dpobj departname = dpobj.departDescription end desobj = get_sewdar_designation_detail(empobj.sw_desigcode) if desobj desnation = desobj.ds_description end end sumpresents = get_all_counts(gps.al_empcode,'P') sumabsent = get_all_counts(gps.al_empcode,'A') sumlatect = get_all_counts(gps.al_empcode,'L') sumearlyct = get_all_counts(gps.al_empcode,'E') myxpresents += sumpresents.to_i myxabsent += sumabsent.to_i myxlatect += sumlatect.to_i myxearlyct += sumearlyct.to_i myxwkhrs = 0 if gps.workinghrs !=nil && gps.workinghrs != '' newwrktimes = gps.workinghrs.to_s.split(",") myfwkhrs = 0 myfwkmns = 0 newwrktimes.each do |newmtimes| newkhrsx = get_calculated_hours_minute(newmtimes,'H') newmntsx = get_calculated_hours_minute(newmtimes,'M') myfwkhrs += newkhrsx.to_i myfwkmns += newmntsx.to_i mytotalwkhrs += newkhrsx.to_i mytotalwkmns += newmntsx.to_i end if myfwkmns.to_i >=60 newmywkmns = myfwkmns.to_f/60 myxwkhrs = myfwkhrs.to_f+newmywkmns.to_f myxwkhrs = myxwkhrs.to_s.gsub(".",":") else if myfwkmns.to_i <10 myxwkhrs = myfwkhrs.to_s+":0"+myfwkmns.to_s else myxwkhrs = myfwkhrs.to_s+":"+myfwkmns.to_s end end end myfinalovtime = 0 if gps.ovrtimes != nil && gps.ovrtimes != '' newovtimes = gps.ovrtimes.to_s.split(",") myfovthrs = 0 myfovtmns = 0 newovtimes.each do |mynewovertm| ovthrsx = get_calculated_hours_minute(mynewovertm,'H') ovtmnsx = get_calculated_hours_minute(mynewovertm,'M') myfovthrs += ovthrsx.to_i myfovtmns += ovtmnsx.to_i mytotalovthrs += ovthrsx.to_i mytotalovtmns += ovtmnsx.to_i end if myfovtmns.to_i >=60 myovnstm = myfovtmns.to_f/60 myfinalovtime = myfovthrs.to_f+myovnstm.to_f myfinalovtime = myfinalovtime.to_s.gsub(".",":") else if myfovtmns.to_i <10 myfinalovtime = myfovthrs.to_s+":0"+myfovtmns.to_s else myfinalovtime = myfovthrs.to_s+":"+myfovtmns.to_s end end end myfinalpenty = 0 if gps.al_latepelanty != nil && gps.al_latepelanty != '' lateplhrsm = gps.al_latepelanty.to_s.gsub(":",".") myfinalpenty += lateplhrsm.to_f myfinalpmetys += lateplhrsm.to_f end %> <% i +=1 end %> <% else %> <% end %>
SL No. Sewadar Code
Name
Department
Shift Total
Present
Total
Absent
Total
Working Hrs
Total
Late Count
Total
Early Count
Total
Late Penalty
<%=i%> <%=gps.al_empcode%>
<%=empname%>
<%=departname%>
<%=gps.al_shift%> <%=sumpresents%> <%=sumabsent%> <%=(myxwkhrs.to_s.gsub(":",".").to_s == '0' ? '' : myxwkhrs) %> <%=(sumlatect.to_s.gsub(":",".").to_s == '0' ? '' : sumlatect)%> <%=(sumearlyct.to_s.gsub(":",".").to_s == '0' ? '' : sumearlyct)%> <%=currency_formatted(myfinalpenty)%>
Total Present :<%=myxpresents%> Absent : <%=myxabsent%> <% mytotalwrkshrs = 0 if mytotalwkmns.to_i >=60 nwhs = mytotalwkmns.to_f/60 nwhs = currency_formatted(nwhs) wrkshrs = mytotalwkhrs.to_f+nwhs.to_f nwrkshrs = wrkshrs.to_s.split(".") if nwrkshrs[1].to_i<10 mytotalwrkshrs = nwrkshrs[0].to_s+":0"+nwrkshrs[1].to_s else mytotalwrkshrs = wrkshrs.to_s.gsub(".",":") end else if mytotalwkmns.to_i <10 mytotalwrkshrs = mytotalwkhrs.to_s+":0"+mytotalwkmns.to_s else mytotalwrkshrs = mytotalwkhrs.to_s+":"+mytotalwkmns.to_s end end %> Working Hrs :  <%=mytotalwrkshrs%> Late :  <%=myxlatect%> Early :  <%=myxearlyct%> LPT : <%=currency_formatted(myfinalpmetys)%>
No Records Found
<% end %>
<% end %>
<% #render "layouts/popupforms"%>