Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SET DATE DMY
- SET MARK TO "-"
- SET HOURS TO 24
- SET CENTURY ON
- vtanggal = CTOD('25-10-2014')
- vjam_masuk = '08:00'
- nkiri_masuk = val(left(vjam_masuk,2))
- nkanan_masuk = val(right(vjam_masuk,2))
- vjam_keluar = '17:30'
- nkiri_keluar = val(left(vjam_keluar,2))
- nkanan_keluar = val(right(vjam_keluar,2))
- vatur_masuk = '08:00'
- nkiri_atur_masuk = val(left(vatur_masuk,2))
- nkanan_atur_masuk = val(right(vatur_masuk,2))
- vatur_keluar = '16:30'
- nkiri_atur_keluar = val(left(vatur_keluar,2))
- nkanan_atur_keluar = val(right(vatur_keluar,2))
- ** Tgl chkin: 2014-11-25 07:00
- today_chkin=DATETIME(YEAR(vtanggal), MONTH(vtanggal), DAY(vtanggal), nkiri_masuk, nkanan_masuk, 0)
- ** Tgl chkout: 2014-11-26 17:00
- today_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_keluar, nkanan_keluar, 0)
- ** aturan jam masuk: 2014-11-25 08:00
- rule_chkin=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
- ** aturan jam pulang: 2014-11-25 16:30
- rule_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
- **testing menampilkan tgl dan waktu
- _testing = ;
- "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)+;
- CHR(13)+ ;
- "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)
- _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
- _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- **testing menghitung overtime
- _testing = _testing + ;
- IIF(today_chkout-rule_chkout <= 0, ;
- "no overtime counts.", ;
- "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
- CHR(10)+CHR(10)+CHR(13)
- **testing menampilkan format waktu
- _testing = _testing + " format in time : " + ;
- STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_sec),60),"99"), ;
- " ", "0")
- =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
- ** Tgl chkin: 2014-11-25 07:00
- today_chkin=DATETIME(YEAR(vtanggal), MONTH(vtanggal), DAY(vtanggal), nkiri_masuk, nkanan_masuk, 0)
- ** Tgl chkout: 2014-11-26 17:00
- today_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_keluar, nkanan_keluar, 0)
- ** aturan jam masuk: 2014-11-25 08:00
- rule_chkin=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
- ** aturan jam pulang: 2014-11-25 16:30
- rule_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
- **testing menampilkan tgl dan waktu
- _testing = ;
- "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)+;
- CHR(13)+ ;
- "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)
- _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
- _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- **testing menghitung overtime
- _testing = _testing + ;
- IIF(today_chkout-rule_chkout <= 0, ;
- "no overtime counts.", ;
- "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
- CHR(10)+CHR(10)+CHR(13)
- **testing menampilkan format waktu
- _testing = _testing + " format in time : " + ;
- STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_sec),60),"99"), ;
- " ", "0")
- =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
- ** Tgl chkout: 2014-11-26 17:00
- today_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_keluar, nkanan_keluar, 0)
- ** aturan jam masuk: 2014-11-25 08:00
- rule_chkin=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
- ** aturan jam pulang: 2014-11-25 16:30
- rule_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
- **testing menampilkan tgl dan waktu
- _testing = ;
- "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)+;
- CHR(13)+ ;
- "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)
- _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
- _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- **testing menghitung overtime
- _testing = _testing + ;
- IIF(today_chkout-rule_chkout <= 0, ;
- "no overtime counts.", ;
- "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
- CHR(10)+CHR(10)+CHR(13)
- **testing menampilkan format waktu
- _testing = _testing + " format in time : " + ;
- STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_sec),60),"99"), ;
- " ", "0")
- =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
- ** aturan jam masuk: 2014-11-25 08:00
- rule_chkin=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_masuk, nkanan_atur_masuk, 0)
- ** aturan jam pulang: 2014-11-25 16:30
- rule_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
- **testing menampilkan tgl dan waktu
- _testing = ;
- "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)+;
- CHR(13)+ ;
- "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)
- _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
- _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- **testing menghitung overtime
- _testing = _testing + ;
- IIF(today_chkout-rule_chkout <= 0, ;
- "no overtime counts.", ;
- "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
- CHR(10)+CHR(10)+CHR(13)
- **testing menampilkan format waktu
- _testing = _testing + " format in time : " + ;
- STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_sec),60),"99"), ;
- " ", "0")
- =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
- ** aturan jam pulang: 2014-11-25 16:30
- rule_chkout=DATETIME(YEAR(today_chkin), MONTH(today_chkin), DAY(today_chkin), nkiri_atur_keluar, nkanan_atur_keluar, 0)
- **testing menampilkan tgl dan waktu
- _testing = ;
- "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)+;
- CHR(13)+ ;
- "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)
- _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
- _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- **testing menghitung overtime
- _testing = _testing + ;
- IIF(today_chkout-rule_chkout <= 0, ;
- "no overtime counts.", ;
- "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
- CHR(10)+CHR(10)+CHR(13)
- **testing menampilkan format waktu
- _testing = _testing + " format in time : " + ;
- STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_sec),60),"99"), ;
- " ", "0")
- =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
- **testing menampilkan tgl dan waktu
- _testing = ;
- "Rule chkin date : " + LEFT(TRANSFORM(rule_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Rule chkout date : " + LEFT(TRANSFORM(rule_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(rule_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)+;
- CHR(13)+ ;
- "Today chkin date : " + LEFT(TRANSFORM(today_chkin, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkin, "@D"),12,5) + ;
- CHR(10)+CHR(13)+ ;
- "Today chkout date : " + LEFT(TRANSFORM(today_chkout, "@D"),10) + ;
- " time : " + SUBSTR(TRANSFORM(today_chkout, "@D"),12,5) + ;
- CHR(10)+CHR(10)
- _hour = ((rule_chkout-today_chkout)/3600) * IIF(rule_chkout-today_chkout<0, -1, 1)
- _min = STR(((rule_chkout-today_chkout)/3600*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- _sec = STR(((rule_chkout-today_chkout)/3600*60*60) * IIF(rule_chkout-today_chkout<0,-1,1),99)
- **testing menghitung overtime
- _testing = _testing + ;
- IIF(today_chkout-rule_chkout <= 0, ;
- "no overtime counts.", ;
- "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
- CHR(10)+CHR(10)+CHR(13)
- **testing menampilkan format waktu
- _testing = _testing + " format in time : " + ;
- STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_sec),60),"99"), ;
- " ", "0")
- =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
- **testing menghitung overtime
- _testing = _testing + ;
- IIF(today_chkout-rule_chkout <= 0, ;
- "no overtime counts.", ;
- "overtime counts: " + TRANSFORM(_hour,"99999.9999") + " hour") + ;
- CHR(10)+CHR(10)+CHR(13)
- **testing menampilkan format waktu
- _testing = _testing + " format in time : " + ;
- STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_sec),60),"99"), ;
- " ", "0")
- =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter
- **testing menampilkan format waktu
- _testing = _testing + " format in time : " + ;
- STRTRAN(TRANSFORM(INT(_hour),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_min),60),"99") + ":" + ;
- TRANSFORM(MOD(VAL(_sec),60),"99"), ;
- " ", "0")
- =MESSAGEBOX(_testing ,0+64,"Demo - Time Coounter")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement