Advertisement
jamboljack

Overtime Modif

Nov 24th, 2014
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SET DATE DMY
  2. SET MARK TO "-"
  3. SET HOURS TO 24
  4. SET CENTURY ON
  5.  
  6. vtanggal = CTOD('25-10-2014')
  7. vjam_masuk = '08:00'
  8. nkiri_masuk  = val(left(vjam_masuk,2))
  9. nkanan_masuk = val(right(vjam_masuk,2))
  10. vjam_keluar = '17:30'
  11. nkiri_keluar  = val(left(vjam_keluar,2))
  12. nkanan_keluar = val(right(vjam_keluar,2))
  13. vatur_masuk = '08:00'
  14. nkiri_atur_masuk  = val(left(vatur_masuk,2))
  15. nkanan_atur_masuk = val(right(vatur_masuk,2))
  16. vatur_keluar = '16:30'
  17. nkiri_atur_keluar  = val(left(vatur_keluar,2))
  18. nkanan_atur_keluar = val(right(vatur_keluar,2))
  19. ** Tgl chkin: 2014-11-25 07:00
  20. today_chkin=DATETIME(YEAR(vtanggal), MONTH(vtanggal), DAY(vtanggal), nkiri_masuk, nkanan_masuk, 0)
  21. ** Tgl chkout: 2014-11-26 17:00
  22. today_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_keluar, nkanan_keluar, 0)
  23.  
  24. ** aturan jam masuk: 2014-11-25 08:00
  25. rule_chkin=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
  26. ** aturan jam pulang: 2014-11-25 16:30
  27. rule_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
  28.  
  29. **testing menampilkan tgl dan waktu
  30. _testing = ;
  31. "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
  32. " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
  33. CHR(10)+CHR(13)+ ;
  34. "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
  35. " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
  36. CHR(10)+CHR(10)+;
  37. CHR(13)+ ;
  38. "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
  39. " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
  40. CHR(10)+CHR(13)+ ;
  41. "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
  42. " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
  43. CHR(10)+CHR(10)
  44.  
  45. _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
  46. _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  47. _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  48.  
  49. **testing menghitung overtime
  50. _testing = _testing + ;
  51. IIF(today_chkout-rule_chkout <= 0, ;
  52. "no overtime counts.", ;
  53. "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
  54. CHR(10)+CHR(10)+CHR(13)
  55.  
  56. **testing menampilkan format waktu
  57. _testing = _testing + " format in time : " + ;
  58. STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
  59. TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
  60. TRANSFORM(MOD(VAL(_sec),60),"99"), ;
  61. " ", "0")
  62.  
  63. =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
  64. ** Tgl chkin: 2014-11-25 07:00
  65. today_chkin=DATETIME(YEAR(vtanggal), MONTH(vtanggal), DAY(vtanggal), nkiri_masuk, nkanan_masuk, 0)
  66. ** Tgl chkout: 2014-11-26 17:00
  67. today_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_keluar, nkanan_keluar, 0)
  68.  
  69. ** aturan jam masuk: 2014-11-25 08:00
  70. rule_chkin=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
  71. ** aturan jam pulang: 2014-11-25 16:30
  72. rule_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
  73.  
  74. **testing menampilkan tgl dan waktu
  75. _testing = ;
  76. "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
  77. " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
  78. CHR(10)+CHR(13)+ ;
  79. "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
  80. " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
  81. CHR(10)+CHR(10)+;
  82. CHR(13)+ ;
  83. "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
  84. " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
  85. CHR(10)+CHR(13)+ ;
  86. "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
  87. " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
  88. CHR(10)+CHR(10)
  89.  
  90. _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
  91. _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  92. _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  93.  
  94. **testing menghitung overtime
  95. _testing = _testing + ;
  96. IIF(today_chkout-rule_chkout <= 0, ;
  97. "no overtime counts.", ;
  98. "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
  99. CHR(10)+CHR(10)+CHR(13)
  100.  
  101. **testing menampilkan format waktu
  102. _testing = _testing + " format in time : " + ;
  103. STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
  104. TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
  105. TRANSFORM(MOD(VAL(_sec),60),"99"), ;
  106. " ", "0")
  107.  
  108. =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
  109. ** Tgl chkout: 2014-11-26 17:00
  110. today_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_keluar, nkanan_keluar, 0)
  111. ** aturan jam masuk: 2014-11-25 08:00
  112. rule_chkin=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
  113. ** aturan jam pulang: 2014-11-25 16:30
  114. rule_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
  115.  
  116. **testing menampilkan tgl dan waktu
  117. _testing = ;
  118. "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
  119. " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
  120. CHR(10)+CHR(13)+ ;
  121. "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
  122. " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
  123. CHR(10)+CHR(10)+;
  124. CHR(13)+ ;
  125. "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
  126. " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
  127. CHR(10)+CHR(13)+ ;
  128. "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
  129. " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
  130. CHR(10)+CHR(10)
  131.  
  132. _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
  133. _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  134. _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  135.  
  136. **testing menghitung overtime
  137. _testing = _testing + ;
  138. IIF(today_chkout-rule_chkout <= 0, ;
  139. "no overtime counts.", ;
  140. "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
  141. CHR(10)+CHR(10)+CHR(13)
  142.  
  143. **testing menampilkan format waktu
  144. _testing = _testing + " format in time : " + ;
  145. STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
  146. TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
  147. TRANSFORM(MOD(VAL(_sec),60),"99"), ;
  148. " ", "0")
  149.  
  150. =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
  151. ** aturan jam masuk: 2014-11-25 08:00
  152. rule_chkin=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
  153. ** aturan jam pulang: 2014-11-25 16:30
  154. rule_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
  155.  
  156. **testing menampilkan tgl dan waktu
  157. _testing = ;
  158. "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
  159. " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
  160. CHR(10)+CHR(13)+ ;
  161. "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
  162. " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
  163. CHR(10)+CHR(10)+;
  164. CHR(13)+ ;
  165. "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
  166. " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
  167. CHR(10)+CHR(13)+ ;
  168. "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
  169. " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
  170. CHR(10)+CHR(10)
  171.  
  172. _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
  173. _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  174. _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  175.  
  176. **testing menghitung overtime
  177. _testing = _testing + ;
  178. IIF(today_chkout-rule_chkout <= 0, ;
  179. "no overtime counts.", ;
  180. "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
  181. CHR(10)+CHR(10)+CHR(13)
  182.  
  183. **testing menampilkan format waktu
  184. _testing = _testing + " format in time : " + ;
  185. STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
  186. TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
  187. TRANSFORM(MOD(VAL(_sec),60),"99"), ;
  188. " ", "0")
  189.  
  190. =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
  191. ** aturan jam pulang: 2014-11-25 16:30
  192. rule_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
  193. **testing menampilkan tgl dan waktu
  194. _testing = ;
  195. "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
  196. " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
  197. CHR(10)+CHR(13)+ ;
  198. "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
  199. " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
  200. CHR(10)+CHR(10)+;
  201. CHR(13)+ ;
  202. "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
  203. " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
  204. CHR(10)+CHR(13)+ ;
  205. "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
  206. " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
  207. CHR(10)+CHR(10)
  208.  
  209. _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
  210. _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  211. _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  212.  
  213. **testing menghitung overtime
  214. _testing = _testing + ;
  215. IIF(today_chkout-rule_chkout <= 0, ;
  216. "no overtime counts.", ;
  217. "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
  218. CHR(10)+CHR(10)+CHR(13)
  219.  
  220. **testing menampilkan format waktu
  221. _testing = _testing + " format in time : " + ;
  222. STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
  223. TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
  224. TRANSFORM(MOD(VAL(_sec),60),"99"), ;
  225. " ", "0")
  226.  
  227. =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
  228. **testing menampilkan tgl dan waktu
  229. _testing = ;
  230. "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
  231. " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
  232. CHR(10)+CHR(13)+ ;
  233. "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
  234. " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
  235. CHR(10)+CHR(10)+;
  236. CHR(13)+ ;
  237. "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
  238. " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
  239. CHR(10)+CHR(13)+ ;
  240. "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
  241. " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
  242. CHR(10)+CHR(10)
  243.  
  244. _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
  245. _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  246. _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
  247. **testing menghitung overtime
  248. _testing = _testing + ;
  249. IIF(today_chkout-rule_chkout <= 0, ;
  250. "no overtime counts.", ;
  251. "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
  252. CHR(10)+CHR(10)+CHR(13)
  253.  
  254. **testing menampilkan format waktu
  255. _testing = _testing + " format in time : " + ;
  256. STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
  257. TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
  258. TRANSFORM(MOD(VAL(_sec),60),"99"), ;
  259. " ", "0")
  260.  
  261. =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
  262. **testing menghitung overtime
  263. _testing = _testing + ;
  264. IIF(today_chkout-rule_chkout <= 0, ;
  265. "no overtime counts.", ;
  266. "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
  267. CHR(10)+CHR(10)+CHR(13)
  268. **testing menampilkan format waktu
  269. _testing = _testing + " format in time : " + ;
  270. STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
  271. TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
  272. TRANSFORM(MOD(VAL(_sec),60),"99"), ;
  273. " ", "0")
  274.  
  275. =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
  276. **testing menampilkan format waktu
  277. _testing = _testing + " format in time : " + ;
  278. STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
  279. TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
  280. TRANSFORM(MOD(VAL(_sec),60),"99"), ;
  281. " ", "0")
  282.  
  283. =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement