On Tue, Sep 26, 2006 at 09:09:41AM +0200, Peter Houppermans wrote:
> I was wondering if anyone out here has ever done a weekly
> timesheet entry page for SL. Daily doesn't work for me, but,
> obviously, before I ask this to be coded it's always smart to
> see if it already exists :-).
Before we switched to Request Tracker for time recording, I wrote
a shell script that processes a text file and creates timecards
as a batch.
It didn't work that well for us, mainly because of difficulting
in:
- matching the text file entry to a Sql Ledger project, and
- parsing time data into start and end datetimes.
Maybe you have a simpler case.
I did this work before the recent security changes and I haven't
tested it against a more recent build, but I expect it will still
work.
Here's the heart of the shell script (nb: the transdate year is
hardcoded!):
# sql ledger needs qty set or else it puts time in
# unallocated and closes the time card.
# Decimal hours, to four digits.
t=$(( minutes *= 10000 ))
t=$(( minutes /= 6 ))
qty="$hours.$minutes"
# build URL to add timecard
url="$SL_URL/jc.pl?login=$SL_USER&path=bin/text&password=$SL_PASS"
url="$url&db=gaia"
url="$url&project=project"
url="$url&action=save&type=timecard"
url="$url&employee=$SL_EMP"
url="$url&projectnumber=$projectid"
url="$url&transdate=$month-$day-2006"
url="$url&partnumber=$partid"
url="$url&description=$description"
url="$url&inhour=$starthr"
url="$url&inmin=$startmin"
url="$url&outhour=$endhr"
url="$url&outmin=$endmin"
url="$url&qty=$qty"
# submit timecard, output result to stdout
echo $url
wget -a error.log -O - "$url"
HTH,
m
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sql-ledger-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sql-ledger-users