[%PROCESS "$tdir/titles.txt"%] [%shopname%]
[%IF pars.command == 'snooze'%] [%result = DBI.query("update notes set alarm = date_add(current_timestamp,interval ? minute) where id = ?", pars.snooze, pars.itemid).get()%] [%ELSIF pars.command == 'delete'%] [%id = pars.itemid%] [%result = DBI.query("delete from notes where id = ?",id).get()%] [%FOREACH file = DBI.query("select * from files where forcase = 2 and forid = ?",id)%] [%result = delfile("$tdir/files/notes/$id/$file.fileurl")%] [%result = DBI.query("delete from files where id = ?", file.id).get()%] [%END%] [%result = deldir("$tdir/files/notes/$id")%] [%ELSIF pars.command == 'dismiss'%] [%IF pars.repeattime == 1%] [%result = DBI.query("update notes set alarm_on = 2 where id = ?",pars.itemid).get()%] [%ELSIF pars.repeattime == 2%] [%result = DBI.query("update notes set alarm = date_add(orgalarm,interval 1 day), orgalarm = date_add(orgalarm,interval 1 day) where id = ?",pars.itemid).get()%] [%ELSIF pars.repeattime == 3%] [%result = DBI.query("update notes set alarm = date_add(orgalarm,interval 1 week), orgalarm = date_add(orgalarm,interval 1 week) where id = ?",pars.itemid).get()%] [%ELSIF pars.repeattime == 4%] [%result = DBI.query("update notes set alarm = date_add(orgalarm,interval 1 month), orgalarm = date_add(orgalarm,interval 1 month) where id = ?",pars.itemid).get()%] [%ELSIF pars.repeattime == 5%] [%result = DBI.query("update notes set alarm = date_add(orgalarm,interval 1 year), orgalarm = date_add(orgalarm,interval 1 year) where id = ?",pars.itemid).get()%] [%END%] [%END%]

[%expiration%]


Current store: [%shopname%] (change) Logout
Current database name: [%profile.database%] Clients profile in use: [%clientsdb%]


[%DATE%] System Operational Time Left: [%remaining_seconds%]
Automatic Software Activation (requires Internet):
PLEASE USE THESE SPACEBIZ LIVE LINKS (requires Internet):
Stay in touch with us! Click here | SpaceBiz manuals directory - Click here

[%lastcashupid = DBI.query("SELECT MAX(id) AS id FROM dcash WHERE f_status < 100").get().id%]

[%newmail = DBI.query(" select count(id) mails from messages where owner = ? and status=1 ",profile.userid).get().mails%] [%lastmail = DBI.query(" select m.subject, date_format(date(created),'%e %M %Y (%W)') datef, u1.fullname from messages m LEFT JOIN spaceusers.users u1 ON u1.id = m.creator where m.vgroup = '*** INBOX ***' and m.owner = ? order by m.id desc limit 1; ",profile.userid).get()%] [%IF newmail%] You have [%newmail%] new message(s). [%ELSE%] You have no new messages. [%END%]
[%IF lastmail%] LAST MESSAGE FROM: [%lastmail.fullname%] , SUBJECT: [%lastmail.subject%] , DATE: [%lastmail.datef%] [%END%]

[%todaycnt = DBI.query("select count(*) cnt from notes where owner = ? and alarm_on = 1 and date(alarm) = current_date", profile.userid).get().cnt%] [%tomorrowcnt = DBI.query("select count(*) cnt from notes where owner = ? and alarm_on = 1 and date(alarm) = date_add(current_date, interval 1 day)", profile.userid).get().cnt%] [%thisweekcnt = DBI.query("select count(*) cnt from notes where owner = ? and alarm_on = 1 and DATE_FORMAT(alarm, '%v') = DATE_FORMAT(CURRENT_DATE, '%v')", profile.userid).get().cnt%] [%monthcnt = DBI.query("select count(*) cnt from notes where owner = ? and alarm_on = 1 and month(alarm) = month(current_date) and year(alarm) = year(current_date)", profile.userid).get().cnt%] [%overdue = []%] [%FOREACH note = DBI.query(" select *, UNIX_TIMESTAMP(current_timestamp) - UNIX_TIMESTAMP(alarm) due, date_format(alarm,'%d/%m/%Y %H:%i (%a)') alarm from notes where alarm_on = 1 and owner = ? and (UNIX_TIMESTAMP(current_timestamp) - UNIX_TIMESTAMP(alarm)) >= 0 order by alarm ",profile.userid)%] [%overdue.push(note)%] [%END%] [%period = []%] [%IF pars.period%] [%condition = ''%] [%SWITCH pars.period%] [%CASE "Today"%] [%condition = "and date(alarm) = current_date"%] [%CASE "Tomorrow"%] [%condition = "and date(alarm) = date_add(current_date, interval 1 day)"%] [%CASE "This Week"%] [%condition = "and DATE_FORMAT(alarm, '%v') = DATE_FORMAT(CURRENT_DATE, '%v')"%] [%CASE "This Month"%] [%condition = "and month(alarm) = month(current_date) and year(alarm) = year(current_date)"%] [%END%] [%FOREACH note = DBI.query(" select *, UNIX_TIMESTAMP(current_timestamp) - UNIX_TIMESTAMP(alarm) due, date_format(alarm,'%d/%m/%Y %H:%i (%a)') alarm from notes where alarm_on = 1 and owner = ? $condition order by alarm ",profile.userid)%] [%period.push(note)%] [%END%] [%END%] [%IF ! pars.period%] [%END%] [%IF pars.period%] [%END%]
Today Tomorrow This Week This Month Next Alarm
[%todaycnt%] [%tomorrowcnt%] [%thisweekcnt%] [%monthcnt%] [%nextnote = DBI.query("select *,date_format(alarm,'%d/%m/%Y %H:%i (%a)') falarm from notes where alarm > current_timestamp and alarm_on = 1 order by alarm limit 1;").get()%] [%IF nextnote%] [%nextnote.subject%] - [%nextnote.falarm%] - [%repeat_drop.${nextnote.repeattime}%] [%ELSE%] N/a [%END%]
Overdue [%IF overdue.size%] [%FOREACH note = overdue%] [%END%]
[%note.subject%] [%priority_drop.${note.priority}%] [%stringtimefull(note.due)%] [%note.alarm%] - [%repeat_drop.${note.repeattime}%] Snooze (mins / hours) | Dismiss & Repeat [%repeat_words.${note.repeattime}%] | Delete
[%ELSE%] No overdue alarms. [%END%]
List of
[%pars.period%] Alarms
[%IF period.size%] [%FOREACH note = period%] [%END%]
[%note.subject%] [%priority_drop.${note.priority}%] [%IF note.due > 0%] Overdue: [%ELSE%] Due in: [%END%] [%stringtimefull(note.due)%] [%note.alarm%] - [%repeat_drop.${note.repeattime}%]
[%ELSE%] No alarms. [%END%]
Close
Calendar View New Alarm / Note Notes


LAST CASHUP
[%cashups%]

PRINT QUES STATUS

[%printers%]

Not attended - Inter Branch Transfer
[%FOREACH ibt = DBI.query(" select bd.*, suppliers.name, count(bds.id) records from branch_documents bd left join suppliers on suppliers.id = bd.branch_id left join purchases bds on bds.document_id = bd.id where document_type in (7) and current_stage in (1,2) group by bd.id having count(bds.id) > 0")%] [%END%] [%FOREACH ibt = DBI.query(" select bd.*, suppliers.name, count(bds.id) records, bd.id from branch_documents bd left join suppliers on suppliers.id = bd.branch_id left join branch_documents_details bds on bds.document_id = bd.id left join branch_documents bd2 on bd2.fromdocid = bd.id where bd.document_type in (9) and bd2.id is null group by bd.id having count(bds.id) > 0")%] [%END%]
DATE: [%ibt.stamp%] OUTGOING IBT TO: [%ibt.name%] DOC: [%documents.${ibt.document_type}.1%][%ibt.id%]/[%ibt.seq_nr%] [%IF ibt.current_stage == 1 and ibt.records%] Not finalized yet. [%ELSIF ibt.current_stage == 2 and ibt.records%] Not retrieved by [%ibt.name%] [%END%]
DATE: [%ibt.stamp%] INCOMING IBT FROM: [%ibt.name%] DOC: [%documents.${ibt.document_type}.1%][%ibt.id%]/[%ibt.seq_nr%] Not finalized yet. No GRV exists


(C) Copyright 2000-2009 Anatoli Radulov, Wessel Oosthuizen | WT Space Investments | All rights reserved
For questions please use the following email: anatoli@wtspace.com

This software is best viewed in Mozilla Firefox