DESCRIPTION

Exports transactions from the SQLite database to QIF (Quicken Interchange Format) for import into financial software. Transactions are grouped by account and sorted by date. Skipped transactions and those without effective categories are handled appropriately.

FUNCTIONS

Emit

Finance::Tiller2QIF::WriteQIF::Emit( $db_path, $outfile );

Write all unexported, non-skipped transactions from the database to a QIF file. Each account is written as a separate QIF account block with transactions sorted by date then payee. Marks written transactions as exported in the database.

Preview

Finance::Tiller2QIF::WriteQIF::Preview( $db_path );
Finance::Tiller2QIF::WriteQIF::Preview( $db_path, $verbose, $viewer );
Finance::Tiller2QIF::WriteQIF::Preview( $db_path, $verbose, $viewer, $mapfile );

Display all unexported, non-skipped transactions in a formatted table showing date, amount, account, payee, and category. Shows original category in brackets if mapped to a different category. Returns the count of transactions displayed.

$viewer selects where the table goes. The default, console, prints to STDOUT. Any other value names an external program (optionally with arguments, e.g. code --wait); the table is written to a read-only temporary file with a .t2qpv suffix, the program is launched with that file as its argument, and the path is printed. The temporary file is left in place for the viewer to read. An undefined or blank viewer, a program that cannot be found, and a program that fails to launch, dies on a signal, or exits non-zero are all fatal — there is no silent fallback to the console.

Any further arguments are additional files to open alongside the preview, in the same viewer invocation; the CLI passes the mapping file here for --multipreview. They require a real viewer (not console) and must be readable, or the call dies.

ResolveViewer

my @command = Finance::Tiller2QIF::WriteQIF::ResolveViewer( $viewer );

Resolve a viewer specification to the command list that would be run, dying with the reason when it cannot be resolved. The specification is split on whitespace: the first word is the program and any remaining words are arguments placed before the file names. A program containing a path separator is used as given and must be executable; a bare program name is looked up along PATH.

Because the specification is split on whitespace, the program's own path cannot contain spaces. Point $viewer at a wrapper script or a symlink when the program you want lives in such a path.

Preview calls this before it writes anything, so an unusable viewer fails before a temporary file is created. checkconfig calls it to report an unusable viewer before any work begins.

AUTHOR

John Karr <brainbuz@cpan.org>

LICENSE

GPL version 3 or later.