[Thread Prev][Thread Next][Thread Index]
Re: PilotMgr Expenses App.
- To: pilotmgr@xxxxxxxxxxxxxxxxxxxxx
- Subject: Re: PilotMgr Expenses App.
- From: mindless (Alan Harder)
- Date: Thu, 26 Feb 1998 10:33:52 -0800
- Cc: matthew.rainey@xxxxxxxxxxxx
- Sender: owner-pilotmgr
> Is there a way to transfer an expense report from the Pilot to one's
> SparcStation, and print it out in the format that appears on the Pilot?
Hi Matthew,
Here is a conduit which will dump all of your expense records out in a
readable text format. You will probably want to rearrange the output format
a bit to get it how you want it. Even if you don't know perl you can
probably figure out how to customize it to your liking.. look near the
bottom of the code for all the "print" lines..
- Alan
ps- to use, just save the file below as "DumpExpense.pm" and put it in
your pilotmgr directory..
----------------------cut here----------------cut here------------------------
package DumpExpense;
use Tk;
use Data::Dumper;
use strict;
my ($gConfigDlg);
my ($VERSION) = ('0.1');
sub conduitInit
{
}
sub conduitQuit
{
}
sub conduitInfo
{
return { 'database' =>
{
'name' => 'ExpenseDB',
'creator' => 'exps',
'type' => 'DATA',
'flags' => 0,
'version' => 0,
},
'version' => $VERSION,
'author' => 'Alan Harder',
'email' => 'Alan.Harder@xxxxxxx' };
}
sub conduitConfigure
{
my ($this, $wm) = @_;
&createConfigDlg($wm) unless (defined $gConfigDlg);
$gConfigDlg->Popup(-popanchor => 'c', -overanchor => 'c',
-popover => $wm);
}
sub createConfigDlg
{
my ($wm) = @_;
$gConfigDlg = $wm->Toplevel(-title => 'SyncFood');
$gConfigDlg->transient($wm);
$gConfigDlg->Label(-text => "DumpExpense v$VERSION\nAlan Harder\nAlan.Harder\@Sun.COM")->pack(-side => 'top');
$gConfigDlg->Button(-text => 'Dismiss', -command => ['withdraw', $gConfigDlg])->pack;
PilotMgr::setColors($gConfigDlg);
}
sub conduitSync
{
my ($this, $dlp, $info) = @_;
my ($db, $i, $rec, $appinfo) = ($dlp->open('ExpenseDB'), 0);
$appinfo = $db->getAppBlock();
while (1)
{
$rec = $db->getRecord($i++);
last unless defined $rec;
next if $rec->{'deleted'};
# print Dumper($rec),"\n";
print "Date: ", $rec->{'date'}->[4]+1,
"/", $rec->{'date'}->[3], "/", $rec->{'date'}->[5], "\n";
print "Type: ", $rec->{'type'}, "\n";
print "Amnt: ", $rec->{'amount'}, "\n";
print "Pymt: ", $rec->{'payment'}, "\n";
print "Curr: ", $rec->{'currency'}, "\n";
print " Cat: ", $appinfo->{'categoryName'}->[$rec->{'category'}], "\n";
print "Vndr: ", $rec->{'vendor'}, "\n";
print " Who: ", $rec->{'attendees'}, "\n";
print "Note: ", $rec->{'note'}, "\n";
print "\n";
}
$db->close;
}
1;
-------------------cut here------------------cut here-----------------------
------------------------------------------------------------------------
***********************************************************
* This is a public mailing list! *
* Please do not publish Sun proprietary information here! *
* - - - - - - - - - - - - - - *
* http://www.moshpit.org/pilotmgr *
***********************************************************
|
|