Warning, /office/kmymoney/doc/details-impexp.docbook is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <chapter id="details.impexp">
0003 <chapterinfo>
0004   <authorgroup>
0005     <author> &Ace.Jones; &Ace.Jones.mail; </author>
0006     <author> &Jack.H.Ostroff; &Jack.H.Ostroff.mail; </author>
0007   </authorgroup>
0008   <date>2022-06-05</date>
0009   <releaseinfo>5.1.2</releaseinfo>
0010 </chapterinfo>
0011 
0012 <title>Importing and Exporting</title>
0013 
0014 <sect1 id="details.impexp.gnucash">
0015 <sect1info>
0016   <author>&Tony.Bloomfield; &Tony.Bloomfield.mail;</author>
0017 </sect1info>
0018 
0019 <title>&gnucash; Importer</title>
0020 
0021 <sect2>
0022 <title>&gnucash; Files</title>
0023 
0024 <para>
0025   The &kmymoney; &gnucash; importer handles direct
0026   reading of standard (&XML;) files as produced by &gnucash;
0027   versions 1.8 and 2.0. The following are not supported:
0028 </para>
0029 
0030 <itemizedlist>
0031   <listitem><para>import of database (Postgres) data</para></listitem>
0032   <listitem><para>import of 'multi-book' files</para></listitem>
0033   <listitem><para>import into an existing &kmymoney; file</para></listitem>
0034   <listitem><para>import of small-business specific features (Employees,
0035     Invoices, &etc;)</para></listitem>
0036   <listitem><para>export to &gnucash; files.</para></listitem>
0037 </itemizedlist>
0038 
0039 <para>
0040   The import will probably only work correctly if presented with a valid file.
0041   It is recommended that the <menuchoice><guimenu>Actions</guimenu><guimenuitem>Check
0042   &amp; Repair All</guimenuitem></menuchoice> menu item of &gnucash; be run
0043   before attempting to import.
0044 </para>
0045 
0046 <para>
0047   Files can be opened by specifying the filename on the command line
0048   (<command>kmymoney &lt;path to file&gt;</command>), or by means of the &kmymoney;
0049   <menuchoice>
0050     <shortcut><keycombo>&Ctrl;<keycap>O</keycap></keycombo></shortcut>
0051     <guimenu>File</guimenu><guimenuitem>Open</guimenuitem>
0052   </menuchoice> or
0053   <menuchoice>
0054     <guimenu>File</guimenu><guisubmenu>Import</guisubmenu>
0055   </menuchoice> menu items.
0056 </para>
0057 
0058 <para>
0059   The similarity between the two products means that much day-to-day data can be
0060   imported in a straightforward fashion. However, there are some areas where
0061   differences arise, and various options are provided to deal with these. The
0062   following sections will describe some of these differences; understanding them
0063   should lead to a smoother importation.
0064 </para>
0065 </sect2>
0066 
0067 <sect2>
0068 <title>Similarities, Differences, and Terminology</title>
0069 
0070 <sect3>
0071 <title>Small Business Usage</title>
0072 
0073 <para>
0074   It should be noted that &kmymoney; is a <emphasis>personal</emphasis> finance
0075   manager, and as such, does not directly support any of the business features
0076   of &gnucash;, such as tax tables, payroll, and tracking of lots. Any Accounts
0077   Payable or Receivable accounts found in a file will be imported as Liability
0078   or Asset accounts respectively.
0079 </para>
0080 </sect3>
0081 
0082 <sect3>
0083 <title>Accounts</title>
0084 
0085 <sect4>
0086 <title>Account types</title>
0087 
0088 <para>
0089   For both products, the highest level of structure in the file is the
0090   account. &kmymoney; supports 5 main types of accounts: Asset, Liability,
0091   Income, Expense, and Equity; each of which may have various subtypes, &eg;,
0092   Checking, Credit Card, &etc;  &kmymoney; includes a 'standard' account for
0093   each of these five types, and all other accounts are held subordinate to one
0094   of these. &kmymoney; enforces more consistency (or less flexibility, depending
0095   on your point of view) between account types than does &gnucash;, and the
0096   importer will correct any inconsistencies it detects. This may result in a
0097   slightly different account structure, though this can, within reason, be
0098   amended after the import is complete.
0099 </para>
0100 </sect4>
0101 
0102 <sect4>
0103 <title>Categories</title>
0104 
0105 <para>
0106   &kmymoney; uses the term Category to denote an account of an Income or Expense
0107   type. Unlike &gnucash;, these are not considered as 'ledger' accounts, and direct
0108   entry of transactions into categories is not supported; allocations are made
0109   during transaction entry into other account types.
0110 </para>
0111 </sect4>
0112 
0113 <sect4>
0114 <title>Structure and Placeholders</title>
0115 
0116 <para>
0117   &gnucash; supports the use of Placeholder accounts. In effect, these are
0118   read-only accounts into which no transactions can be entered, but which function
0119   in an analogous fashion to folders in a folder structure, as a holder for other
0120   accounts. Though &kmymoney; does not support this feature as such, it does
0121   provide a parent/child account relationship, so the importer simulates
0122   placeholders by creating empty accounts.
0123 </para>
0124 </sect4>
0125 
0126 <sect4>
0127 <title>Account Type map</title>
0128 
0129 <informaltable frame='all'>
0130 <tgroup cols='2' align='left' colsep='1' rowsep='1'>
0131 <thead>
0132   <row>
0133     <entry>&gnucash; type</entry><entry>&kmymoney; type</entry>
0134   </row>
0135 </thead>
0136 <tbody>
0137   <row>
0138     <entry><literal>BANK</literal></entry><entry><literal>Checking</literal></entry>
0139   </row>
0140   <row>
0141     <entry><literal>CHECKING</literal></entry><entry><literal>Checking</literal></entry>
0142   </row>
0143   <row>
0144     <entry><literal>SAVINGS</literal></entry><entry><literal>Savings</literal></entry>
0145   </row>
0146   <row>
0147     <entry><literal>ASSET</literal></entry><entry><literal>Asset</literal></entry>
0148   </row>
0149   <row>
0150     <entry><literal>CASH</literal></entry><entry><literal>Cash</literal></entry>
0151   </row>
0152   <row>
0153     <entry><literal>CURRENCY</literal></entry><entry><literal>Cash</literal></entry>
0154   </row>
0155   <row>
0156     <entry><literal>MONEYMRKT</literal></entry><entry><literal>MoneyMarket</literal></entry>
0157   </row>
0158   <row>
0159     <entry><literal>STOCK</literal></entry><entry><literal>Stock</literal></entry>
0160   </row>
0161   <row>
0162     <entry><literal>MUTUAL</literal></entry><entry><literal>Stock</literal></entry>
0163   </row>
0164   <row>
0165     <entry><literal>EQUITY</literal></entry><entry><literal>Equity</literal></entry>
0166   </row>
0167   <row>
0168     <entry><literal>LIABILITY</literal></entry><entry><literal>Liability</literal></entry>
0169   </row>
0170   <row>
0171     <entry><literal>CREDIT</literal></entry><entry><literal>CreditCard</literal></entry>
0172   </row>
0173   <row>
0174     <entry><literal>INCOME</literal></entry><entry><literal>Income</literal></entry>
0175   </row>
0176   <row>
0177     <entry><literal>EXPENSE</literal></entry><entry><literal>Expense</literal></entry>
0178   </row>
0179   <row>
0180     <entry><literal>RECEIVABLE</literal></entry><entry><literal>Asset</literal></entry>
0181   </row>
0182   <row>
0183     <entry><literal>PAYABLE</literal></entry><entry><literal>Liability</literal></entry>
0184   </row>
0185 </tbody>
0186 </tgroup>
0187 </informaltable>
0188 </sect4>
0189 </sect3>
0190 
0191 <sect3>
0192 <title>Transactions and Splits</title>
0193 
0194 <sect4>
0195 <title>Balanced transactions</title>
0196 
0197 <para>
0198   As with &gnucash;, data is entered in the form of transactions, each generally
0199   consisting of 2 or more split entries. In fact, valid &gnucash; transactions
0200   will always contain at least 2 splits, and to conform to &gnucash;'s
0201   double-entry bookkeeping standard, these must be in monetary balance (&ie;,
0202   they must balance out to zero). &kmymoney; encourages, but does not enforce,
0203   this standard, but any imported transaction which is not balanced will be
0204   marked in the ledger view as having a problem.
0205 </para>
0206 </sect4>
0207 
0208 <sect4>
0209 <title>Payees</title>
0210 
0211 <para>
0212   &kmymoney; prefers that all transactions have a Payee (a generic term that
0213   encompasses both payees and payers), and unlike &gnucash;, a list of these
0214   Payees is maintained. Payee names are generated by the importer from the
0215   &gnucash; transaction's Description field.
0216 </para>
0217 </sect4>
0218 
0219 <sect4>
0220 <title>Transfers</title>
0221 
0222 <para>
0223   &kmymoney; uses the term Transfer to describe a transaction which does not
0224   involve a Category, but only transfers money between Asset and/or Liability
0225   accounts.
0226 </para>
0227 </sect4>
0228 
0229 <sect4>
0230 <title>Reconcile</title>
0231 
0232 <para>
0233   &kmymoney; provides an account reconciliation function similar to that of
0234   &gnucash;, and the corresponding transaction status will be imported.
0235 </para>
0236 </sect4>
0237 </sect3>
0238 
0239 <sect3>
0240 <title>Commodities</title>
0241 
0242 <para>
0243   &gnucash; uses the term Commodity to cover both currencies and non-currency
0244   assets. These are treated separately in &kmymoney;.
0245 </para>
0246 
0247 <sect4>
0248 <title>Currencies</title>
0249 
0250 <para>
0251   &kmymoney; has built-in support for all foreign 
0252   <link linkend="details.currencies">currency</link> types.  &kmymoney; also
0253   requires that the user specify a base currency, this being the default
0254   currency for new accounts. The importer will attempt to determine the most
0255   likely base currency, though this choice may be rejected in favor of an
0256   alternative.
0257 </para>
0258 
0259 <note><para>
0260   &kmymoney; does not currently support accounts denominated in 'defunct'
0261   currencies (except those replaced by the Euro). At present, it will be
0262   necessary to remove any such accounts from your &gnucash; file before
0263   importing. We hope to improve on this situation in a future release.
0264 </para></note>
0265 </sect4>
0266 
0267 <sect4 id="gncsecurities">
0268 <title>Securities and Investments</title>
0269 
0270 <para>
0271   Non-currency assets (normally stocks and bonds) are called Securities by
0272   &kmymoney;, and represent the main difference between the two products, in
0273   that &kmymoney; requires any account denominated in a security to be
0274   subordinate to an Investment Account. This is described in more detail in the
0275   chapter on <link linkend="details.investments">Investments</link>. Though
0276   users may have implemented such a relationship, &gnucash; imposes no defined
0277   structure on it, so the importer is unable to detect it and perform an
0278   automatic conversion. Three options are therefore made available:
0279 </para>
0280 
0281 <itemizedlist>
0282   <listitem>
0283     <para>Create a separate Investment account for each security, with the same
0284     name as the security</para>
0285   </listitem>
0286 
0287   <listitem>
0288     <para>Create a single Investment account which will act as 'parent' for all
0289     security accounts</para>
0290   </listitem>
0291 
0292   <listitem>
0293     <para>Create several Investment accounts, and assign securities to them as
0294     directed by the user.</para>
0295   </listitem>
0296 </itemizedlist>
0297 
0298 <para>
0299   User requirements and preferences determine which of these options is relevant
0300   in each situation, and in some cases, manual restructuring of accounts after
0301   import may be necessary.
0302 </para>
0303 </sect4>
0304 
0305 <sect4>
0306 <title>Prices and currency rates</title>
0307 
0308 <para>
0309   Security prices and currency exchange rates as displayed in the &gnucash; Price
0310   Editor will be imported. In addition, price and rate entries will be generated
0311   from all transactions involving securities and multiple currencies.
0312 </para>
0313 </sect4>
0314 
0315 <sect4 id="details.impexp.gncquotes">
0316 <title>Online Quotes</title>
0317 
0318 <para>
0319   For obtaining online price and currency rate quotations, &gnucash; uses a perl
0320   package called <literal>Finance::Quote</literal>. &kmymoney;
0321   contain support for this package for obtaining stock quotes, and this will be
0322   used by default when importing data. You may however select to convert to the
0323   native method used by &kmymoney; which is covered in more detail in
0324   <link linkend="details.investments.onlinequotes">online quotes</link>.
0325 </para>
0326 
0327 <para>
0328   If you choose to do so, the following dialog will allow selection of a
0329   'native' &kmymoney; price source, or a user-defined source, for each account
0330   for which online quotes are required. However, the stock (ticker) symbol will
0331   be imported unchanged. Since this symbol may be different in
0332   the two packages, it will need to be manually edited after completion of the
0333   import process. Future currency rate updates will not use <literal>Finance::Quote</literal>,
0334   and will always use the native retrieval method.
0335 </para>
0336 
0337 <para>
0338         <screenshot>
0339         <mediaobject>
0340         <imageobject>
0341         <imagedata fileref="gnucash-select_price_source.png" format="PNG" />
0342         </imageobject>
0343         </mediaobject>
0344         </screenshot>
0345 </para>
0346 </sect4>
0347 </sect3>
0348 
0349 <sect3 id="gncschedules">
0350 <title>Scheduled Transactions</title>
0351 
0352 <para>
0353   &kmymoney; does not retain the separation made in &gnucash; between template
0354   transactions and their frequency of occurrence. Transaction data will be
0355   duplicated if the same template is used in different schedules, but this is
0356   not likely to be of great significance.
0357 </para>
0358 
0359 <sect4>
0360 <title>Schedule types</title>
0361 
0362 <para>
0363   &kmymoney; classifies all schedules as one of three types: Bills, Deposits, or
0364   Transfers. Since &gnucash; does not make such a distinction, the importer
0365   attempts to determine the classification from the accounts and direction of
0366   money movements. It may be that in some cases incorrect assumptions are made,
0367   and these will need manual correction.
0368 </para>
0369 </sect4>
0370 
0371 <sect4>
0372 <title>Suspect Schedules</title>
0373 
0374 <para>
0375   Some features of &gnucash; scheduled transactions are not available in
0376   &kmymoney;, so the importer tries in each case to reach a reasonable
0377   compromise in converting the data. These transactions will be flagged as
0378   suspect, and the user will be given the option of editing them directly during
0379   the import process. Examples of situations which may cause this are:
0380 </para>
0381 
0382 <itemizedlist>
0383   <listitem>
0384     <para>some frequency intervals supported in &gnucash; are not currently
0385     available in &kmymoney;</para>
0386   </listitem>
0387 
0388   <listitem>
0389     <para>&kmymoney; does not support the use of formulae and variables in
0390     amount fields</para>
0391   </listitem>
0392 
0393   <listitem>
0394     <para>complex cases which have not yet been identified for import.</para>
0395   </listitem>
0396 </itemizedlist>
0397 
0398 <para>
0399   Despite best efforts, it is possible that, due to the many options involved, a
0400   scheduled transaction may cause a fatal error within &kmymoney;.  If this sort
0401   of problem seems to be occurring, the importer offers the option to drop all
0402   suspect schedules.
0403 </para>
0404 </sect4>
0405 </sect3>
0406 
0407 <sect3>
0408 <title>Reports</title>
0409 
0410 <para>
0411   &kmymoney; provides a comprehensive selection of configurable reports,
0412   described in more detail in <link linkend="details.reports">Reports.</link>
0413   These will not necessarily, however, match precisely those reports available
0414   in &gnucash;.
0415 </para>
0416 </sect3>
0417 </sect2>
0418 
0419 <sect2>
0420 <title>Selecting Importer Options</title>
0421 
0422 <para id="details.impexp.gncoptions">
0423         <screenshot>
0424         <mediaobject>
0425         <imageobject>
0426         <imagedata fileref="gnucash-import_options.png" format="PNG" />
0427         </imageobject>
0428         </mediaobject>
0429         </screenshot>
0430 </para>
0431 
0432 <sect3>
0433 <title>Investment Handling</title>
0434 
0435 <para>
0436   See <link linkend="gncsecurities">"Securities and Investments"</link> above.
0437 </para>
0438 </sect3>
0439 
0440 <sect3>
0441 <title>Online Quotes</title>
0442 
0443 <para>
0444   Turn this off if you wish to use the native method for future online price
0445   quotes.
0446 </para>
0447 
0448 <para>
0449   See <link linkend="details.impexp.gncquotes">"Online Quotes"</link> above.
0450 </para>
0451 </sect3>
0452 
0453 <sect3>
0454 <title>Scheduled Transactions</title>
0455 
0456 <para>
0457   See <link linkend="gncschedules">"Scheduled Transactions"</link> above.
0458 </para>
0459 </sect3>
0460 
0461 <sect3>
0462 <title>Decoding Options</title>
0463 
0464 <para>
0465   If your native language is written in letters or symbols which are different
0466   from those used in the 'Latin' languages (&ie;, generally Western European),
0467   these are represented in a special fashion ('encoded') in your &gnucash; file.
0468   If these letters are not displayed correctly on your screen, then they must be
0469   decoded.  Currently, it is often not possible to detect accurately which form
0470   of decoding must be used, so you may need to set this option and select an
0471   entry from the list.  In general, the first item in the list will be that
0472   which is considered appropriate for your locale (&ie;, the country and
0473   language which was selected as native when your operating system was
0474   installed), so this should be tried first.  Since the import process does not
0475   overwrite your &gnucash; file, you are free to experiment with any of these
0476   selections.
0477 </para>
0478 </sect3>
0479 
0480 <sect3>
0481 <title>Transaction Notes option</title>
0482 
0483 <para>
0484   Under some usage conditions, non-split &gnucash; transactions may contain
0485   residual, often incorrect, memo data which is not normally visible to the
0486   user. When imported into &kmymoney; however, due to display differences, this
0487   data can become visible. Often, these transactions will have a Notes field
0488   describing the real purpose of the transaction. If this option is selected,
0489   these notes, if present, will be used to override the extraneous memo data.
0490 </para>
0491 </sect3>
0492 
0493 <sect3>
0494 <title>Debug Options</title>
0495 
0496 <para>
0497   These need only be used in the event of import problems.  If you have such
0498   problems, you should also report them to the &kmymoney; developer list
0499   &devlist;.  Note that the traces produced by these options may contain data of
0500   a confidential nature, and the <guilabel>Anonymize data</guilabel> option
0501   should be used if they are to be made publicly available.
0502 </para>
0503 </sect3>
0504 </sect2>
0505 
0506 <sect2>
0507 <title>Import Report</title>
0508 
0509 <para>
0510   At the end of processing, the importer produces a report showing the number of
0511   different entities processed, and any errors or anomalies encountered. This
0512   report will be displayed on screen, and may be saved to a file for later
0513   review. A full report may contain the following sections:
0514 </para>
0515 
0516 <itemizedlist>
0517   <listitem>
0518     <para>Record counts</para>
0519   </listitem>
0520 
0521   <listitem>
0522     <para>Inconsistencies in account types and actions taken</para>
0523   </listitem>
0524 
0525   <listitem>
0526     <para>Details of suspect schedules</para>
0527   </listitem>
0528 </itemizedlist>
0529 
0530 <para>
0531         <screenshot>
0532         <mediaobject>
0533         <imageobject>
0534         <imagedata fileref="gnucash-report.png" format="PNG" />
0535         </imageobject>
0536         </mediaobject>
0537         </screenshot>
0538 </para>
0539 </sect2>
0540 </sect1>
0541 
0542 <sect1 id="details.impexp.qifimp">
0543 <sect1info>
0544   <author>&Thomas.Baumgart; &Thomas.Baumgart.mail;</author>
0545 </sect1info>
0546 
0547 <title>QIF Importer</title>
0548 
0549 <sect2>
0550 <title>QIF format considered harmful</title>
0551 
0552 <para>
0553   Generally speaking, the QIF format should be avoided wherever possible.  It is
0554   a poor choice for transporting financial data.  Among other things, QIF suffers
0555   from these problems:
0556 </para>
0557 
0558 <itemizedlist>
0559   <listitem>
0560     <para>Lack of standardized format: Different versions of the same program
0561     will impart different meanings to the same element.</para>
0562   </listitem>
0563 
0564   <listitem>
0565     <para>Lack of transaction identifier: Because there is no ID number
0566     associated with each transaction, matching duplicate transactions is
0567     haphazard at best.</para>
0568   </listitem>
0569 
0570   <listitem>
0571     <para>Lack of expressiveness: The grammar is really simple, and cannot
0572     portray the depth of financial information found in today's financial
0573     environment.</para>
0574   </listitem>
0575 </itemizedlist>
0576 
0577 <para>
0578   This is generally why Intuit stopped supporting QIF input at all with
0579   <application>Quicken</application> 2005. If you have the option of getting
0580   data some other way, like OFX, always choose that option.
0581 </para>
0582 </sect2>
0583 
0584 <sect2>
0585 <title>How to import a QIF file</title>
0586 
0587 <para>
0588   To import a QIF file, first ensure you have a valid &kmymoney; file open.
0589   Then select <menuchoice><guimenu>File</guimenu><guisubmenu>Import</guisubmenu>
0590   <guimenuitem>QIF...</guimenuitem> </menuchoice> menu item.
0591 </para>
0592         
0593 <para>
0594         <screenshot>
0595         <mediaobject>
0596         <imageobject>
0597         <imagedata fileref="qifopen.png" format="PNG" />
0598         </imageobject>
0599         </mediaobject>
0600         </screenshot>
0601 </para>
0602 
0603 <para>
0604   The resulting dialog prompts for the QIF filename, allowing you to locate the
0605   file by clicking on the <guibutton>Browse</guibutton> button.
0606 </para>
0607 
0608 <para>
0609   &kmymoney; differentiates between the import of a bank statement file
0610   and historic data exported from another application. The default is to import
0611   a bank statement file. In case you are importing data from your previous personal
0612   finance manager application select the appropriate option.
0613 </para>
0614 
0615 <para>
0616   In general the default QIF profile should work with your QIF data. In some
0617   cases it might become necessary to use a modified QIF profile. See
0618   the <link linkend="details.impexp.qifimp.profile">next section</link> for more
0619   details on that subject.
0620 </para>
0621 
0622 <para>
0623   Click on <guibutton>Import</guibutton> to import the QIF file.
0624 </para>
0625 
0626 <para>
0627   &kmymoney; will start scanning the file to determine the formats used to
0628   represent dates and numbers. In case it cannot determine a date format
0629   unambiguously, &kmymoney; will ask the user to select one from the list of
0630   possible date formats.
0631 </para>
0632 
0633 <para>
0634   Next, &kmymoney; imports the data and creates all necessary objects, such as
0635   Payees, Accounts, Categories, and stock price information.
0636   Wherever possible, existing transactions will be matched against the imported
0637   information. A progress bar is shown and updated during the import process.
0638 </para>
0639 
0640 <para>
0641   In case &kmymoney; cannot detect the name of the account to be imported,
0642   the user will be asked to select the account into which the data should be
0643   imported. If the account does not already exist in your file, a new account
0644   can be created by clicking the <guibutton>Create</guibutton> button.
0645 </para>
0646 
0647 <para>
0648   At the end of the import, &kmymoney; shows a statement import statistics
0649   window.
0650 </para>
0651 
0652 <para>
0653 <screenshot>
0654         <screeninfo>Statement statistics</screeninfo>
0655         <mediaobject>
0656         <imageobject>
0657         <imagedata fileref="qif_report.png" format="PNG" />
0658         </imageobject>
0659         <textobject>
0660         <phrase>Statement statistics</phrase>
0661         </textobject>
0662         </mediaobject>
0663 </screenshot>
0664 </para>
0665 
0666 <para>
0667   After importing, all of the imported transactions will be shown in the ledger 
0668   view with a yellow background.  In case &kmymoney; was able to match an
0669   imported transaction with an already existing transaction, the background is
0670   shown in light green.
0671 </para>
0672 
0673 <para>
0674   The next step is to verify the imported data and accept it. This is a general
0675   process and also applies to imports from other sources. It is outlined in a
0676   separate section of this document.
0677 </para>
0678 
0679 <note>
0680 <para>
0681   The colors used to mark imported and matched transactions are customizable and
0682   may be different in your environment.
0683 </para>
0684 </note>
0685 </sect2>
0686 
0687 <!--
0688 <sect2>
0689 <title>Accepting the imported transactions</title>
0690 <para>
0691   
0692         When &kmymoney; has finished importing the QIF transactions the account will be shown with the imported transactions listed in Yellow.
0693 </para>
0694 
0695 <para>
0696 <screenshot>
0697         <screeninfo>Imported transactions</screeninfo>
0698         <mediaobject>
0699         <imageobject>
0700         <imagedata fileref="qifimportverify.png" format="PNG" />
0701         </imageobject>
0702         <textobject>
0703         <phrase>Imported transactions</phrase>
0704         </textobject>
0705         </mediaobject>
0706 </screenshot>
0707 </para>
0708 
0709 <para>
0710         Some of your transactions may be flashing red in the ledger.  
0711         This is because they need to be assigned a category.  
0712         The importer was not able to automatically assign a category based on your past transaction history.
0713 </para>
0714 
0715 <para>  
0716         Transaction data can be edited or even deleted if needed.  To edit a transaction simply double click on the entry or hit enter when the entry is highlighted.  Once finished click on <guibutton>OK</guibutton> to accept the imported transactions or <guibutton>Cancel</guibutton> to remove the imported transactions.
0717 </para>
0718 
0719 </sect2>
0720 
0721 <sect2><title>Importing Investments</title>
0722 
0723 <para>
0724         Please note that if you are importing a file with investment transactions, those investments must first exist in your &kmymoney; file.
0725         The trading symbol is used to match, so please ensure that the symbol in &kmymoney; is exactly the same as the one in the file you're importing.
0726 </para>
0727 </sect2>
0728 -->
0729 
0730 <sect2 id="details.impexp.qifimp.profile">
0731 <title>Setting up a QIF profile</title>
0732 
0733 <para>
0734   Because there is no universally standard format for a QIF file, different
0735   vendors have taken liberties with the format, and introduced their own
0736   nuances.  The QIF Profile allows &kmymoney; to know about the peculiarities of
0737   your file.  To edit an existing QIF Profile, use the various fields on the
0738   QIF Import dialog.  To create a new one, press the <guibutton>New</guibutton>
0739   button near the profile selector.
0740 </para>
0741 
0742 <para>
0743         <screenshot>
0744         <mediaobject>
0745         <imageobject>
0746         <imagedata fileref="qifimport-qifprofileeditor.png" format="PNG" />
0747         </imageobject>
0748         <textobject>
0749         <phrase>QIF Profile Editor</phrase>
0750         </textobject>
0751         </mediaobject>
0752         </screenshot>
0753 </para>
0754 
0755 <note>
0756 <para>
0757   Recent versions of &kmymoney; no longer have tabs for date and amount
0758   specifications. &kmymoney; now determines those settings by scanning the
0759   file.  If it cannot figure out all settings, it will interrogate the user
0760   during import.
0761 </para>
0762 </note>
0763 <!--
0764 <para>
0765         The most commonly changed thing between QIF implementations is the date format.  
0766         So if this is the first time you're importing a QIF file, spend a few moments to figure out what format the dates are in, and set the QIF Profile accordingly.  
0767         See the discussion below on apostrophe format for more details.
0768 </para>
0769 
0770 <para>
0771         <screenshot>
0772         <mediaobject>
0773         <imageobject>
0774         <imagedata fileref="qifimport-qifprofiledate.png" format="PNG" />
0775         </imageobject>
0776         <textobject>
0777         <phrase>QIF Profile Date</phrase>
0778         </textobject>
0779         </mediaobject>
0780         </screenshot>
0781 </para>
0782 
0783 </sect2>
0784 
0785 <sect2><title>Apostrophe format</title>
0786 
0787 <para>
0788         Many common QIF writers use a 2-digit representation for the year. 
0789         This is ambiguous, because the importer cannot know which century the date belongs in.
0790         To make things even more complicated, QIF files will often used an apostrophe as a year separator to indicate that the date belongs in the OTHER century from the default.
0791 </para>
0792 <para>
0793         For example, if the default century is 1900-1999, the date 12/31/95 would mean 1995.  The date 12/31'05 would mean 2005.
0794 </para>
0795 <para>
0796         Because the QIF format is not standardized, it's impossible to know which century is desired.
0797         This is why you have to explicitly state it in the QIF profile.
0798         You do this by specifying which century is intended when an apostrophe is found.
0799         In the example above, you would set the Apostrophe Format to &quot;2000-2099&quot;, so dates with an apostrophe will be interpreted as being &gt; year 2000.
0800         In this case, dates without an apostrophe will be treated as being in the 1900's.
0801 </para>
0802 -->
0803 </sect2>
0804 
0805 <sect2><title>Transaction matching</title>
0806 
0807 <para>
0808   As noted previously, one of the major drawbacks of the QIF format is the lack
0809   of a unique identifier for each transaction.  Thus, if you import a QIF file
0810   and some of the transactions are already in your ledger, you may get
0811   duplicates.  &kmymoney; attempts to get around this by looking for existing
0812   transactions that look similar to the one being imported.  If it finds
0813   something that looks like the same transaction, it will match the apparent
0814   duplicate.
0815 </para>
0816 
0817 <para>
0818   This can be a problem if you have transactions that look too similar but are
0819   actually different.  In this case, you can unmatch those transactions later in
0820   the ledger view.
0821 </para>
0822 </sect2>
0823 
0824 <sect2>
0825 <title>Writing an import filter</title>
0826 
0827 <para>
0828   Sometimes you may have data in a custom format, like comma-separated-values
0829   (CSV) or something else unique to your situation.  As of version 4.6,
0830   &kmymoney; includes a CSV Importer Plugin, but you can still import other
0831   types of files into &kmymoney; using a QIF Import Filter.  A filter is a
0832   custom program you write which takes your special file as input, and produces
0833   a QIF file as output.  This can be a shell script, a perl script, a compiled
0834   program written in C/C++, or anything else you can dream of, as long as the
0835   system can run it.
0836 </para>
0837 
0838 <para>
0839   To use it, edit your favorite QIF Profile, and select the Filter tab.  Enter
0840   the location of your filter program where prompted.  Then, whenever you do a
0841   QIF import using this profile, the file you select for importing will be run
0842   through your filter first.
0843 </para>
0844 
0845 <para>
0846   A common problem is to convert a list of comma-separated-values into a QIF
0847   file. This is a textbook case for the <command>awk</command> tool. Create
0848   a script called <filename>csv2qif.awk</filename>, with the following two
0849   lines as contents:
0850 </para>
0851 
0852 <programlisting>
0853         BEGIN { FS=&quot;,&quot;; print &quot;!Type:Bank&quot; }
0854 
0855         { print &quot;D&quot;$1; print &quot;T&quot;$2; print &quot;N&quot;$3; print &quot;P&quot;$4; print &quot;M&quot;$5; print &quot;^&quot; }
0856 </programlisting>
0857 
0858 <para>
0859   Then, change the QIF keys (D,T,N,P,M) to match the order of your CSV data.
0860   Set the input filter to <userinput>awk -f csv2qif.awk</userinput>.
0861 </para>
0862 
0863 <para>
0864   Another problem sometimes arises in the encoding of QIF files.  &kmymoney;
0865   expects files to be UTF8 encoded.  If your file is encoded in something else,
0866   it can be useful to convert it to UTF8.  For example to convert it from
0867   iso-8859-1, you would set the input filter to <userinput>recode
0868   iso-8859-1..utf-8</userinput>.
0869 </para>
0870 
0871 </sect2>
0872 <sect2>
0873 <title>Special &kmymoney; QIF extensions</title>
0874 
0875 <para>
0876   As already mentioned, one of the major drawbacks of the QIF format is the lack
0877   of a unique identifier for each transaction.  If you are writing your own QIF
0878   file creator (or filter, as described above), you can overcome this problem.
0879   &kmymoney; supports the '#' field.  The importer will interpret this as a
0880   unique transaction ID, and disregard the record if the transaction is already
0881   in the system.
0882 </para>
0883 </sect2>
0884 </sect1>
0885 
0886 <sect1 id="details.impexp.qifexp">
0887 <title>QIF Exporter</title>
0888 <para>
0889   To export one of your accounts to a QIF file, choose
0890   the <menuchoice><guimenu>File</guimenu><guisubmenu>Export</guisubmenu>
0891   <guimenuitem>QIF...</guimenuitem></menuchoice> menu item. You will be prompted for
0892   which single account to export, what file to export it to, and which QIF Profile
0893   to use.
0894 </para>
0895 
0896 <note><para>
0897   At the moment, QIF Exporter does not handle export of investments.
0898 </para></note>
0899 
0900 <para>
0901         <screenshot>
0902         <mediaobject>
0903         <imageobject>
0904         <imagedata fileref="qifimport-export.png" format="PNG" />
0905         </imageobject>
0906         <textobject>
0907         <phrase>QIF Export</phrase>
0908         </textobject>
0909         </mediaobject>
0910         </screenshot>
0911 </para>
0912 </sect1>
0913 
0914 <sect1 id="details.impexp.ofx">
0915 <sect1info>
0916   <author>&Ace.Jones; &Ace.Jones.mail;</author>
0917   <author>&Thomas.Baumgart; &Thomas.Baumgart.mail;</author>
0918   <author>&Jack.H.Ostroff; &Jack.H.Ostroff.mail;</author>
0919 </sect1info>
0920 <title>OFX Importer Plugin</title>
0921 
0922 <sect2>
0923 <title>Getting the plugin</title>
0924 
0925 <para>
0926   &kmymoney; will import OFX files painlessly.  However, this functionality is
0927   not built into the core program - it is provided as a Plugin.  You must obtain
0928   and install the OFX Importer Plugin for this functionality to be available,
0929   Once that is done, the command to import OFX files will automatically show up
0930   under the <menuchoice><guimenu>File</guimenu>
0931   <guisubmenu>Import</guisubmenu></menuchoice> submenu.
0932 </para>
0933 
0934 <para>
0935   Note that the source of the Plugin is provided as part of the &kmymoney;
0936   source, and most prepackaged versions of &kmymoney; are built with the OFX
0937   importer already included or available as a separate package.  If the OFX
0938   importer does not seem to be installed in your version, the first place to
0939   check is in the same place you got your base &kmymoney; package.  You can
0940   check whether it is installed either by trying to invoke the above submenu, or
0941   by invoking the <menuchoice><guimenu>Settings</guimenu>
0942   <guisubmenu>Configure KMyMoney...</guisubmenu></menuchoice> menu, selecting
0943   <guilabel>Plugins</guilabel> in the left pane, and looking for the OFX
0944   Importer in the list of installed Plugins.
0945 </para>
0946 
0947 <para>
0948   If you have installed from RPM, the OFX Importer Plugin is contained within
0949   the kmymoney-ofx package. It should be available from whatever source you got
0950   the base &kmymoney; package. If you have built from sources, all you need to
0951   do is have a recent version of the libOFX development headers and libraries
0952   installed on your system.  The &kmymoney; build process will detect these and
0953   compile the plugin.  As of September, 2021, version 0.10.3 was avialable,
0954   although the minimum required version for &kmymoney; is still 0.9.4.
0955 </para>
0956 
0957 <para>
0958   Should you run into trouble trying to compile &kmymoney;, and you are certain
0959   you have the correct version of libOFX installed, please contact the
0960   developers list &devlist; for assistance. Include a copy of your
0961   <filename>config.log</filename> file, compressed first via <command>gzip</command>.
0962 </para>
0963 </sect2>
0964 
0965 <sect2>
0966 <title>What is OFX</title>
0967 
0968 <para>
0969   OFX stands for <quote>Open Financial Exchange,</quote> although in 2019, the
0970   OFX Consortium joined the <quote>Financial Data Exchange (FDX).</quote>
0971   According to the <ulink url="https://finincialdataexchange.org/">FDX web
0972   site</ulink> <quote>Open Financial Exchange is an open standard for
0973   client-server systems and cloud based APIs for exchanging financial data, and
0974   performing financial transactions between financial institutions, and
0975   financial applications.</quote> The specification defines formats for transfer
0976   of financial data both by file and by direct interchange.
0977 </para>
0978 
0979 <para>
0980   Although the standard is much more complete and robust than QIF, there are
0981   still variations, depending on the specific implementation used by any
0982   institution.  OFX files may have an extension of <quote>OFX</quote> or
0983   <quote>QFX</quote> (upper or lower case); this does not imply any particular
0984   difference in the content.  The specification is based on &XML;, so the files
0985   can be read in any text editor, but as whitespace is not relevant to the
0986   content itself, some implementations do not use any, making it very hard for a
0987   human to read.
0988 </para>
0989 
0990 <para>
0991   Another site with good information is <ulink url="https:/ofxhome.com/">OFX
0992   Home</ulink>.  They maintain a directory of financial institutions that
0993   support OFX.  This can be useful if you have problems setting up <link
0994   linkend="details.impexp.ofxdirectconnect">OFX direct connect.</link> They also
0995   have a forum for discussions about OFX issues.  However, there is a post on
0996   the site that it is expected to be closed down in February, 2022, if the
0997   current maintainer does not find someone to replace him and take over running
0998   the site.
0999 </para>
1000 </sect2>
1001 
1002 <sect2>
1003 <title>Importing an OFX file</title>
1004 
1005 <para>
1006   The most basic way to import an OFX file is to choose the importer from the
1007   menu bar. From the <menuchoice><guimenu>File</guimenu><guisubmenu>Import</guisubmenu>
1008   <guimenuitem>OFX...</guimenuitem></menuchoice> menu item. If OFX does not show
1009   up under Import, the OFX Importer Plugin is either not installed or not
1010   installed correctly.  Please see the previous section.
1011 </para>
1012 
1013 <para>
1014   The first thing the importer will do is ask you into which account to import
1015   the transactions.  If there are transactions from multiple accounts in your
1016   file, you will be asked this question multiple times.  Note that when
1017   importing data for an investment account, purely cash transactions will be
1018   imported to the associated brokerage account, if one is configured.  If a
1019   brokerage account has not been configured (or does not have the default name)
1020   you may be asked to identify the account to use.
1021 </para>
1022 
1023 <para>
1024   After importing, some of your transactions may be shown with an exclamation
1025   mark on a yellow triangle in the ledger.  This is because they need to be
1026   assigned a category.  The importer was not able to automatically assign a
1027   category based on your past transaction history.  You can edit each
1028   transaction in the ledger to assign a category, and the mark will be removed.
1029 </para>
1030 
1031 <para>
1032   Please note that this section describes the <quote>native</quote> OFX Importer
1033   Plugin.  OFX files may also be imported using the AqBanking Importer Plugin if
1034   you have installed that.  The two importers do behave slightly differently,
1035   and they are written and supported by different developers.
1036 </para>
1037 </sect2>
1038 
1039 <sect2>
1040 <title>Importing Investments</title>
1041 
1042 <para>
1043   Please note that if you are importing a file with investment transactions,
1044   those investments must first exist in your &kmymoney; file.  The trading
1045   symbol is used to match, so please ensure that the symbol in &kmymoney; is
1046   exactly the same as the one in the file you're importing.
1047 </para>
1048 </sect2>
1049 
1050 <sect2 id="details.impexp.webconnect">
1051 <title>Web Connect</title>
1052 
1053 <para>
1054   The easiest way to import an OFX file is to set up Web Connect.  Visit your
1055   bank's web site, and click on a link to download an OFX file.  Your browser
1056   should ask you what program you would like to use to open the file.  Point
1057   your browser to &kmymoney;.  It will then import the downloaded OFX file into
1058   the &kmymoney; file currently open, or the one you most recently had open.
1059   You can also change the file associations of your desktop environment, and
1060   have &kmymoney; open the OFX file automatically for you.
1061 </para>
1062 
1063 <para>
1064   If you need to import the OFX file into some other &kmymoney; file, load up
1065   that file in &kmymoney; first, and then visit your bank's web site.
1066 </para>
1067 </sect2>
1068 
1069 <sect2 id="details.impexp.ofxdirectconnect">
1070 <title>Direct Connect</title>
1071 
1072 <para>
1073   OFX Direct Connect is now supported in &kmymoney;.  This gives &kmymoney; the
1074   ability to contact your bank directly to obtain transaction.  To enable this
1075   feature, you must compile &kmymoney; with the
1076   <userinput><option>--enable-ofxbanking</option></userinput> switch.  This is
1077   now the default, and this feature is enabled in the version provided by most
1078   if not all Linux distributions, and the versions provided at the &kmymoney;
1079   website.
1080 </para>
1081 
1082 <para>
1083   Please be warned: some banks require a different signup from the main web
1084   banking access, will give you a separate password or PIN, and may even charge
1085   you a separate fee for this service.  No bank directly supports &kmymoney;.
1086   You will have to tell them you want to bank directly from <application>MS
1087   Money</application> or <application>Quicken</application>.
1088 </para>
1089 
1090 <para>
1091   The first step is to configure each account for which you wish to download
1092   statements.  Go to the Accounts View, right click on the account you wish to
1093   configure, and choose <guimenuitem>Map to online account...</guimenuitem>.  In
1094   case more than one online banking plugin is installed on your system you will
1095   be asked which one to use. For the internal OFX method select
1096   <guimenuitem>&kmymoney; OFX</guimenuitem>. A list of banks will be downloaded
1097   from the Internet and a wizard will guide you through choosing a bank,
1098   entering your username and password, and selecting an account.  Should you
1099   find that your bank is not listed, it may still be possible to use the manual
1100   option. Your bank may be able to provide the required parameters, or you may
1101   have to do some research to find them.
1102 </para>
1103 
1104 <note>
1105   <para>
1106     Setting up OFX Direct Connect can sometimes be a challenge, especially as
1107     the implementations at most institutions do not provide sufficient details
1108     in error messages.  One particular issue to note is that many institutions
1109     require you to change your password the first time you access it online
1110     using this method.  Unfortunately, at this time, the library that &kmymoney;
1111     uses (libofx) does not have a way to interactively change a password.  In
1112     some cases, it is possible to get a techincal support person at the
1113     institution to change the password for you.  Until we are able to expand
1114     this section with more detailed troubleshooting information, if you have
1115     trouble getting this to work for you, you can ask for help on the &kmymoney;
1116     developer mailing list &devlist;.
1117   </para>
1118 </note>
1119 
1120 <para>
1121   Once you have an account set up with online banking, go to the ledger for that
1122   account, and then choose the
1123   <menuchoice><guimenu>Account</guimenu><guimenuitem>Update
1124   account...</guimenuitem></menuchoice> menu item.  This will connect to your
1125   bank, and download available transactions.  You can use the <link
1126   linkend="details.accounts.edit">Edit account</link> dialog (under the
1127   <guilabel>Online settings</guilabel> tab, <guilabel>Import
1128   Details</guilabel> subtab) to indicate whether to download transactions since
1129   the last update, since a specified number of days ago, or since a specified
1130   date.
1131 </para>
1132 
1133 <note>
1134   <para>
1135     In versions of &kmymoney; prior to 4.6, the payee name was always taken from
1136     the <literal>PAYEEID</literal> field.  As of version 4.6, the payee name can
1137     be based on either the <literal>PAYEEID</literal>, <literal>NAME</literal>,
1138     or <literal>MEMO</literal> field in the OFX transaction.  You can configure
1139     this feature and some other OFX direct connect settings in the
1140     <guilabel>Edit account</guilabel> dialog mentioned just above.
1141   </para>
1142 </note>
1143 </sect2>
1144 
1145 <sect2>
1146 <title>Exporting an OFX file</title>
1147 
1148 <para>
1149   It is not currently possible to export your data as an OFX file.  If you are
1150   interested to contribute in this area, please contact the libofx development
1151   team for details.
1152 </para>
1153 </sect2>
1154 </sect1>
1155 
1156 <!-- These entities facilitate keeping the csv import/export information in
1157      separate files, but within this chapter. -->
1158 <!-- entity defined in index.docbook -->
1159 &details-impexp-csv;
1160 &details-impexp-csvexp;
1161 
1162 <!-- This entity facilitates keeping the woob (formerly weboob) import/export
1163      information in a separate file, but within this chapter. -->
1164 <!-- entity defined in index.docbook -->
1165 &details-impexp-woob;
1166 
1167 <sect1 id="details.impexp.plugins">
1168 <title>Writing Importer Plugins</title>
1169 
1170 <para>
1171   &kmymoney; contains explicit support for additional importer and/or exporter
1172   plugins.  If you would like to write a plugin to handle a custom format, we
1173   would value your contribution.  To do so, you'll need to compile the program
1174   from source.  Then use the OFX Importer Plugin as an example.
1175 </para>
1176 </sect1>
1177 </chapter>