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 as labeled blocks. The first line shows transaction ID, date, and account; indented lines show amount, payee, memo, and category without truncation. 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 is used as-is as a shell command line (optionally with arguments, e.g. code --wait); the table is written to a read-only temporary file with a .t2qpv suffix, and the command is run with that file's path (shell-quoted) appended, then the path is printed. Because the whole line goes to the shell, ordinary shell quoting works — a program path containing spaces can be double- or single-quoted within $viewer itself. The temporary file is left in place for the viewer to read. An undefined or blank viewer is fatal, and so is anything other than a normal, successful run of the command — there is no silent fallback to the console, and no attempt to report why it failed beyond that.
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.
On Windows, the command runs through cmd.exe with Windows quoting for the file arguments. Use double quotes around program paths containing spaces. Delayed environment-variable expansion is disabled so file names containing ! remain literal.
AUTHOR
John Karr <cpan@brainbuz.org>
LICENSE
GPL version 3 or later.