[Thread Prev][Thread Next][Thread Index]

Re: PilotMgr Expenses App.



>From Kent Madsen:
> I gave this a go, but I did not get any output.  I *did* get a "DumpExpense" 
> directory, but no report.  I was expecting a text file in the 
> ~/.pilotmgr/DumpExpense directory.

actually, it just prints to the window where you started pilotmgr.. check
your console window.
saving to a file is probably a bit more useful.. this code will do that:

    $appinfo = $db->getAppBlock();

    open(FD, ">DumpExpense/expense.txt") || return;

    while (1)
    {
  	$rec = $db->getRecord($i++);
	last unless defined $rec;
	next if $rec->{'deleted'};

	print FD "Date: ", $rec->{'date'}->[4]+1,
	      "/", $rec->{'date'}->[3], "/", $rec->{'date'}->[5], "\n";
	print FD "Type: ", $rec->{'type'}, "\n";
	print FD "Amnt: ", $rec->{'amount'}, "\n";
	print FD "Pymt: ", $rec->{'payment'}, "\n";
	print FD "Curr: ", $rec->{'currency'}, "\n";
	print FD " Cat: ", $appinfo->{'categoryName'}->[$rec->{'category'}],
	         "\n";
	print FD "Vndr: ", $rec->{'vendor'}, "\n";
	print FD " Who: ", $rec->{'attendees'}, "\n";
	print FD "Note: ", $rec->{'note'}, "\n";
	print FD "\n";
    }
    close(FD);
    $db->close;
}

	- Alan
------------------------------------------------------------------------
***********************************************************
*             This is a public mailing list!              *
* Please do not publish Sun proprietary information here! *
*        -  -  -  -  -  -  -  -  -  -  -  -  -  -         *
*             http://www.moshpit.org/pilotmgr             *
***********************************************************


SourceForge.net Logo