Advertisement
jamboljack

Overtime Final

Nov 24th, 2014
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set Date Italian
  2. Set Hours To 24
  3. vtanggal = tmp_absen.tgl
  4. vjam_masuk = Alltrim(tmp_absen.msk)
  5. nkiri_masuk  = Val(Left(vjam_masuk,2))
  6. nkanan_masuk = Val(Right(vjam_masuk,2))
  7. vjam_keluar = Alltrim(This.Value)
  8. nkiri_keluar  = Val(Left(vjam_keluar,2))
  9. nkanan_keluar = Val(Right(vjam_keluar,2))
  10. vatur_masuk = Alltrim(tmp_absen.j_msk)
  11. nkiri_atur_masuk  = Val(Left(vatur_masuk,2))
  12. nkanan_atur_masuk = Val(Right(vatur_masuk,2))
  13. vatur_keluar = Alltrim(tmp_absen.j_klr)
  14. nkiri_atur_keluar  = Val(Left(vatur_keluar,2))
  15. nkanan_atur_keluar = Val(Right(vatur_keluar,2))
  16. ** Tgl chkin: 2014-11-25 07:00
  17. today_chkin=Datetime(Year(vtanggal), Month(vtanggal), Day(vtanggal), nkiri_masuk, nkanan_masuk, 0)
  18. ** Tgl chkout: 2014-11-26 17:00
  19. today_chkout=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_keluar, nkanan_keluar, 0)
  20.  
  21. ** aturan jam masuk: 2014-11-25 08:00
  22. rule_chkin=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
  23. ** aturan jam pulang: 2014-11-25 16:30
  24. rule_chkout=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
  25.  
  26. _hour = ((rule_chkout-today_chkout)/3600) * Iif(rule_chkout-today_chkout<0, -1, 1)
  27. _min = Str(((rule_chkout-today_chkout)/3600*60) * Iif(rule_chkout-today_chkout<0,-1,1),99)
  28. _sec = Str(((rule_chkout-today_chkout)/3600*60*60) * Iif(rule_chkout-today_chkout<0,-1,1),99)
  29.  
  30. mlbh = Iif(today_chkout-rule_chkout <= 0, 1, 2)
  31.  
  32. If mlbh = 2
  33.     vovertime = Transform(_hour,"99999.9999")
  34. Else
  35.     vovertime = ''
  36. Endif
  37.  
  38. If mlbh = 2
  39.     xovertime = Strtran(Transform(Int(_hour),"99") + ":" + ;
  40.     TRANSFORM(Mod(Val(_min),60),"99") + ":" + ;
  41.     TRANSFORM(Mod(Val(_sec),60),"99"), ;
  42.     " ", "0")
  43. Else
  44.     xovertime = '' 
  45. Endif
  46.        
  47. && Isi OverTime
  48. Replace lbh_jam With xoverti
  49. ** Tgl chkin: 2014-11-25 07:00
  50. today_chkin=Datetime(Year(vtanggal), Month(vtanggal), Day(vtanggal), nkiri_masuk, nkanan_masuk, 0)
  51. ** Tgl chkout: 2014-11-26 17:00
  52. today_chkout=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_keluar, nkanan_keluar, 0)
  53.  
  54. ** aturan jam masuk: 2014-11-25 08:00
  55. rule_chkin=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
  56. ** aturan jam pulang: 2014-11-25 16:30
  57. rule_chkout=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
  58.  
  59. _hour = ((rule_chkout-today_chkout)/3600) * Iif(rule_chkout-today_chkout<0, -1, 1)
  60. _min = Str(((rule_chkout-today_chkout)/3600*60) * Iif(rule_chkout-today_chkout<0,-1,1),99)
  61. _sec = Str(((rule_chkout-today_chkout)/3600*60*60) * Iif(rule_chkout-today_chkout<0,-1,1),99)
  62.  
  63. mlbh = Iif(today_chkout-rule_chkout <= 0, 1, 2)
  64.  
  65. If mlbh = 2
  66.     vovertime = Transform(_hour,"99999.9999")
  67. Else
  68.     vovertime = ''
  69. Endif
  70.  
  71. If mlbh = 2
  72.     xovertime = Strtran(Transform(Int(_hour),"99") + ":" + ;
  73.     TRANSFORM(Mod(Val(_min),60),"99") + ":" + ;
  74.     TRANSFORM(Mod(Val(_sec),60),"99"), ;
  75.     " ", "0")
  76. Else
  77.     xovertime = '' 
  78. Endif
  79.        
  80. && Isi OverTime
  81. Replace lbh_jam With xoverti
  82. ** Tgl chkout: 2014-11-26 17:00
  83. today_chkout=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_keluar, nkanan_keluar, 0)
  84. ** aturan jam masuk: 2014-11-25 08:00
  85. rule_chkin=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
  86. ** aturan jam pulang: 2014-11-25 16:30
  87. rule_chkout=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
  88.  
  89. _hour = ((rule_chkout-today_chkout)/3600) * Iif(rule_chkout-today_chkout<0, -1, 1)
  90. _min = Str(((rule_chkout-today_chkout)/3600*60) * Iif(rule_chkout-today_chkout<0,-1,1),99)
  91. _sec = Str(((rule_chkout-today_chkout)/3600*60*60) * Iif(rule_chkout-today_chkout<0,-1,1),99)
  92.  
  93. mlbh = Iif(today_chkout-rule_chkout <= 0, 1, 2)
  94.  
  95. If mlbh = 2
  96.     vovertime = Transform(_hour,"99999.9999")
  97. Else
  98.     vovertime = ''
  99. Endif
  100.  
  101. If mlbh = 2
  102.     xovertime = Strtran(Transform(Int(_hour),"99") + ":" + ;
  103.     TRANSFORM(Mod(Val(_min),60),"99") + ":" + ;
  104.     TRANSFORM(Mod(Val(_sec),60),"99"), ;
  105.     " ", "0")
  106. Else
  107.     xovertime = '' 
  108. Endif
  109.        
  110. && Isi OverTime
  111. Replace lbh_jam With xoverti
  112. ** aturan jam masuk: 2014-11-25 08:00
  113. rule_chkin=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
  114. ** aturan jam pulang: 2014-11-25 16:30
  115. rule_chkout=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
  116.  
  117. _hour = ((rule_chkout-today_chkout)/3600) * Iif(rule_chkout-today_chkout<0, -1, 1)
  118. _min = Str(((rule_chkout-today_chkout)/3600*60) * Iif(rule_chkout-today_chkout<0,-1,1),99)
  119. _sec = Str(((rule_chkout-today_chkout)/3600*60*60) * Iif(rule_chkout-today_chkout<0,-1,1),99)
  120.  
  121. mlbh = Iif(today_chkout-rule_chkout <= 0, 1, 2)
  122.  
  123. If mlbh = 2
  124.     vovertime = Transform(_hour,"99999.9999")
  125. Else
  126.     vovertime = ''
  127. Endif
  128.  
  129. If mlbh = 2
  130.     xovertime = Strtran(Transform(Int(_hour),"99") + ":" + ;
  131.     TRANSFORM(Mod(Val(_min),60),"99") + ":" + ;
  132.     TRANSFORM(Mod(Val(_sec),60),"99"), ;
  133.     " ", "0")
  134. Else
  135.     xovertime = '' 
  136. Endif
  137.        
  138. && Isi OverTime
  139. Replace lbh_jam With xoverti
  140. ** aturan jam pulang: 2014-11-25 16:30
  141. rule_chkout=Datetime(Year(today_chkin), Month(today_chkin), Day(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
  142.  
  143. _hour = ((rule_chkout-today_chkout)/3600) * Iif(rule_chkout-today_chkout<0, -1, 1)
  144. _min = Str(((rule_chkout-today_chkout)/3600*60) * Iif(rule_chkout-today_chkout<0,-1,1),99)
  145. _sec = Str(((rule_chkout-today_chkout)/3600*60*60) * Iif(rule_chkout-today_chkout<0,-1,1),99)
  146.  
  147. mlbh = Iif(today_chkout-rule_chkout <= 0, 1, 2)
  148.  
  149. If mlbh = 2
  150.     vovertime = Transform(_hour,"99999.9999")
  151. Else
  152.     vovertime = ''
  153. Endif
  154.  
  155. If mlbh = 2
  156.     xovertime = Strtran(Transform(Int(_hour),"99") + ":" + ;
  157.     TRANSFORM(Mod(Val(_min),60),"99") + ":" + ;
  158.     TRANSFORM(Mod(Val(_sec),60),"99"), ;
  159.     " ", "0")
  160. Else
  161.     xovertime = '' 
  162. Endif
  163.        
  164. && Isi OverTime
  165. Replace lbh_jam With xovertime
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement