diff --git a/CHANGELOG b/CHANGELOG index 9fca8f873..815071a92 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,1914 +1,1915 @@ skrooge (2.19.0) *Correction: Add missing file categories_previous_period_table.html in monthly report *Correction: Migration failure with sqlite >= 3.25.0 due to ALTER TABLE behavior modification *Correction: Migration failure when some i_number are NULL *Feature: Tracker with running balance in "Operations" page + *Performances: Better performance in payee view to compute recommended categories -- Stephane MANKOWSKI xxx skrooge (2.18.0) *Correction bug 403575: skrooge w/ -DSKG_WEBENGINE=ON: ui_skgtablewithgraph.h:15:10: fatal error: QtWebKitWidgets/QWebView: No such file or directory *Correction bug 403675: App crashes with segfault after second import *Correction bug 402330: error importing QIF File "SKGImportPluginQif::importFile() RC=[ERR-5]: SKGCategoryObject::addCategory failed because linked object is not yet saved in the database. *Correction bug 403725: import Quicken tags from QIF as Skrooge trackers *Correction bug 403985: kgbasegui/skgwebview.h:28:10: fatal error: qwebview.h: No such file or directory *Correction: Import KMYMONEY with non utf8 characters doesn't work (see https://forum.kde.org/viewtopic.php?f=210&t=156506) *Correction: Import KMYMONEY of scheduled operations from the next operation to add instead of the first one (to avoid duplicate) *Correction: Import KMYMONEY of shares with only one split must be done with the unit of the share *Correction: Nb occurrences and last date are not aligned on weekly schedules *Correction: Display all occurrences of a schedule in dashboard not only the first one *Correction: Display the currency symbol at the right place in scheduled operations *Correction: Display correctly the amount in "highlighted operations" in dashboard *Correction: The advice "Advice are very long to compute" can now be rejected *Correction: Add date in "Bank (light)" widget in html mode *Correction: Remove template from "Highlighted operation" widget *Feature: Better help for "Internet code" of sources in unit page *Feature: New MSN source of download for quotes *Feature: File can be made anonymous in a reversible mode *Feature: In "Operations" page, possibility to view all operations of an account + its credit cards associated *Feature: The number of years for forecasts based on scheduled operations can be choosen from settings *Feature: Possibility to choose the max date of schedules in dashboard *Feature: New action to skip scheduled operations *Feature: Possibility to skip scheduled operations from dashboard *Feature: Addition of options (Incomes, Expenditures, Transfers, ...) in contextual menu of graphs in "Account" page *Feature: Addition of options (Days, Weeks, Months, ...) in contextual menu of graphs in "Account" page -- Stephane MANKOWSKI Mon, 11 Feb 2019 21:32:09 +0100 skrooge (2.17.0) *Correction bug 400695: Designer plugins get installed as versioned libraries *Correction bug 400724: Import of Quicken 2012 .QIF file failed due to tags *Correction bug 402031: ERR-4/ERR-5 opening relative path to .skg from command line, then zombie Skrooge *Correction: Transfer created with value at 0. Regression due to 399672. (see https://forum.kde.org/viewtopic.php?f=210&t=155713&p=406978) *Correction: QIF import with transfer on split (see https://forum.kde.org/viewtopic.php?f=210&t=155614) *Correction: Add delay (300 ms) on text filter *Correction: "Search & Process" create a duplicate a duplicated category in some cases *Correction: Compliance with SQLCipher 4 *Correction: Close SQL database in mmb import *Feature: Like on transfer, the ratio is requested when creating a share operation (see https://forum.kde.org/viewtopic.php?f=210&t=155605&p=406979) *Feature: Progress bar in taskbar *Feature: Support only QT >= 5.7.0 -- Stephane MANKOWSKI Sun, 16 Dec 2018 17:50:46 +0100 skrooge (2.16.0) *Correction bug 398683: Periodic crashes on dashboard *Correction bug 397611: [ERR-5]: Format de date non pris en charge importation boobank *Correction bug 399480: Grammar mistake in .po file / - s missing in simple *Correction bug 399482: Wrong plural form in .po-File *Correction bug 399483: Spelling mistake in .po file "Transfert" should be "Transfer" *Correction bug 399672: Modifying multiple selected operations into transfers creates empty category and tracker if not identical *Correction: Ofx import must import FEE as debit *Correction: Document migration fails if format is "d.MM.yy 'г" (see: https://forum.kde.org/viewtopic.php?f=210&t=155575) *Correction: Inconsistency in "Incomes vs Expenditures" on sub operations with trackers *Correction: Build on windows *Correction: Use CPU instead CPU for QML (needed for printing) *Correction: Set background color on print to avoid print preview with black background on dark theme *Feature: Selection above, below or parent when delete an object *Performances: Solve performance issue due to new feature : More tooltips on "Operations" table -- Stephane MANKOWSKI Sun, 04 Nov 2018 14:12:43 +0100 skrooge (2.15.0) *Correction bug 397018: Check sqlcipher installation (issue detected on GENTOO) *Correction: Crash when sort a grouped view *Correction: Avoid to create 2 categories with the same name under the same category by using drag and drop *Correction: Avoid too many computation in SKGAccountObject::getPossibleReconciliations *Feature: Addition of a new option to check if import has been broken *Feature: More tooltips on "Operations" table -- Stephane MANKOWSKI Wed, 15 Aug 2018 22:01:16 +0200 skrooge (2.14.0) *Correction bug 394857: Reports do not graph operations by week correctly *Correction bug 395328: Bad perfo in SKGAccountObject::getPossibleReconciliations when too many operations *Correction: Sort on second column does not work with grouping *Correction: Change bootstrap url in templates *Correction: Better grouping for "Week", "Month", "Semester", ... *Correction: Report with forecast based on budget use the account using the most the category *Correction: Respan of group header must work when auto resize is disabled too *Correction: Import backend of account with "." in name *Correction: Remove error in boobank commands *Correction: Set automatically the bank account only when the icon is changed *Correction: The application is hidden when the dashboard is opened on an empty document *Correction: On operation page, the sort by the balance attribute sorts operations by date+id to have correct balances *Correction: Weboob backend doesn't work with option if account name has "id" *Feature: Addition of "Import date" on account object *Feature: Possibility to merge accounts with or without updating the initial balance *Performances: Improvement of performance of SKGTreeView::selectObjects and SKGTreeView::getState when grouping with many groups -- Stephane MANKOWSKI Sun, 24 Jun 2018 19:00:18 +0200 skrooge (2.13.0) *Correction bug 392828: Choose what to display on selection *Correction: Simple search in "Search & Process" doesn't escape words *Correction: Add notification (sound) on all creations / modifications of objects *Feature: Possibility to open concerned operations when auto reconciliation failed *Feature: Option on report to show decimals or not *Feature: Option "Execute on not checked operations" on "Search & Process" page *Feature: Addition of "Reconciliation balance" attribut on "Account" + icon to check if previous reconciliation has been broken or not *Feature: Addition of a new option to check if reconciliation has been broken -- Stephane MANKOWSKI Mon, 07 May 2018 20:31:26 +0200 skrooge (2.12.0) *Correction bug 389867: Amount Input Changes Value Prematurely *Correction bug 389866: Date Input Field Not Localized *Correction bug 389899: Split dates aren't updated when copying previous entry *Correction bug 390223: Opening d/l QFX file opens new skrooge file instead of importing into existing - opened file *Correction: Remove compilation warning (-Wsign-promo) *Correction: Can't resize the window and its width exceeds the screen (https://forum.kde.org/viewtopic.php?f=210&t=151023) *Correction: Search and process doesn't work in template mode with category used (see: https://forum.kde.org/viewtopic.php?f=210&t=150940) *Correction: No sound notification when an operation is created (see: https://forum.kde.org/viewtopic.php?f=210&t=151296) *Feature: All bookmarked report can be easily added to the dashboard with the + menu *Feature: New "Treemap" graph mode in reports *Feature: Automatic merge of payees, accounts and units when updated with another existing name *Feature: Alpha numerical values are now supported for number of operation (see: https://forum.kde.org/viewtopic.php?f=210&t=150988&p=394706) *Feature: Addition of a new option to displaythe environment variables used by Skrooge -- Stephane MANKOWSKI Thu, 08 Mar 2018 20:06:43 +0100 skrooge (2.11.0) *Correction bug 386942: .py scripts in /usr/bin *Correction bug 388955: Splitting Currency and Amount into separate columns *Correction: Better account number in weboob import *Correction: Weboob import is now importing account with better name (use of "label") *Correction: Weboob import compliant with utf8 *Correction: Failure when launching "skrooge filename.xxx" when filename.xxx is a file to import *Correction: "Switch closed" is available on unit but units are not closable *Correction: When a transfer is created only one of both operation has the tracker set: https://forum.kde.org/viewtopic.php?f=210&t=143127&p=384834#p384834 *Correction: Export of selection when selection size > 1 doesn't work *Correction: Define alternative icons when a "poor" icon set is used (like by default on gnome: Tango) *Feature: Tips of the day are now clickable and in the main page (not more popup panel) *Feature: Skrooge knows now 100 cryptocurrencies and is able to download their quotation *Feature: Enable AA_EnableHighDpiScaling if Qt version >= 5.6 *Performances: Better performances by resizing only visible columns (this is useful on payee table when category is hidden) *Performances: Better performances in the computation of the automatic category for a payee *Performances: Improvement of performance in SKGImportExportManager::findAndGroupTransfers. 11552 ms => 285 ms -- Stephane MANKOWSKI Sat, 03 Feb 2018 11:16:35 +0100 skrooge (2.10.5) *Correction bug 386594: Can not load share prices for French stocks -- Stephane MANKOWSKI Sat, 25 Nov 2017 23:15:27 +0100 skrooge (2.10.0) *Correction bug 383758: Report unreadable because element outlines are to thick *Correction bug 384119: Operation without suboperation after a kmy import *Correction bug 375865: Quick fill: select/enter item does not lock payee *Correction bug 384801: Converting multiple operations with different amounts to "transfer" type changes all amounts to 0 *Correction bug 384802: When creating multiple transfers into a different currency use the correct exchange rate for each date *Correction bug 385002: Display and edit default category for payee *Correction bug 385277: Wrong budget for split-operations with unaligned dates *Correction bug 384803: Creating many transfers to a different currency leads to uninterruptible series of dialog boxes *Correction bug 385990: Altered budgets aren't displayed until you reload the tab *Correction bug 386285: The minimum/maximum limit in account definition is interpreted as Primary Currency *Correction: Bad english in help on rules *Correction: Memory leaks *Correction: The source of unit download is now able to support date in "en_EN" locale event if this is not the system locale. Mandatory for implementing a Google Finance source. *Correction: Don't display the page of operations when the import is canceled *Correction: Better error messages in backend import *Correction: Optimisation in backend import *Correction: Optimise html of monthy reports *Correction: Port from QWebKit to QWebEngine *Correction: Avoid to compute too many combinations (and take hours) when trying to do an automatic reconciliation *Correction: Backend import must match account with id with letter like this 123456A@ldl *Correction: Never merge 2 accounts with same name in backend import *Correction: Crash when selecting many lines in search & process page *Correction: Enable print functions only when at least one page is opened *New feature: New "Google Finance" source of download for units *New feature: The source of unit download can be now an external script *New feature: New import backend "weboob_coming" importing coming operations (can be used for card with deferred debit) *New feature: A payee can be closed. Then it won't be available in combo boxes in operation page *New feature: A category can be closed. Then it won't be available in combo boxes in operation page *New feature: New parameters in boobank backend to be able to import operations only since a specified date *New feature: Export ledger format *New feature: The tooltip of "Search" explains now how the entered value is understood *Performances: Better performances on initial load (avoid to intialise a document before loading one other) -- Stephane MANKOWSKI Thu, 02 Nov 2017 21:17:06 +0100 skrooge (2.9.0) *Correction bug 380235: Reports table view: missing characters *Correction bug 380232: Yahoo api discontinued *Correction bug 380187: Shares always use the current rate/value. On unit page, you can choose if you want to see the history of the unit value or the history of the amount owned *Correction bug 380827: Pie chart alignment *Correction bug 380460: Failure when loading file from skrooge 1.12 *Correction bug 380821: Add keyboard shortcut to rename bookmarks *Correction bug 380820: Custom banks do not use their custom icon/image *Correction bug 380818: Cash account is not associated with a bank *Correction bug 380802: Going back and forth from "fullscreen mode" (Ctrl+Shift+F) loses the focus on "pages" tab on the left sidebar *Correction bug 381056: Dashboard portfolio widget: Wrong percentage values *Correction bug 381562: csv file import: unable to detect matching account *Correction bug 381168: Change tab order of properties editor *Correction bug 381847: Income & Expenditure widget does not match corresponding report *Correction bug 382162: Wrong budget in root categories if subcategories also include subcategories *Correction: Multithreading SQL connections must be compliant with SQLite mode *Correction: Temporary skg file protected by password are not well restore *Correction: Replacement of missing icons *Correction: Auto apply on advice duplicates remaining advice *Correction: The "duplicate" function creates operation with invalid creation date *Correction: Regular expressions for CSV import are now translatable *Correction: Values are not refreshed in amortization table when annual rate or insurance rate are modified *Correction: Zoom on dashboard widget in QML doesn't work *Correction: No refresh of "month" in the title of some dashboard widgets *Correction: In about, the authors of sub plugins are now displayed *New feature: New import backend using aqbanking *New feature: Import backends can now have parameters *New feature: Skrooge is now able to export only the selected accounts or operations *New feature: Bulk mode in import backends *New feature: In "Monthly Report", possibility to get attributes on pointed objects *New feature: Addition of new BitcoinAverage source to be able to download bitcoin rates (due to unavailability of BitcoinCharts) *Performances: Avoid advice computation in dashboard when the dashboard is not the current page *Performances: Better performance in advice "Some payees seem to be identical" *Performances: Better performances on load and save -- Stephane MANKOWSKI Sat, 12 Aug 2017 10:11:37 +0200 skrooge (2.8.1) *Correction: Bad display of information of current account when a second document is opened -- Stephane MANKOWSKI Sat, 15 Apr 2017 20:41:56 +0200 skrooge (2.8.0) *Correction bug 375721: Right-click (context menu) reload view *Correction bug 375875: Changing password does not work *Correction bug 375712: See operation for a payee *Correction bug 376025: Clear fields don't restore currency *Correction bug 375865: Quick fill: select/enter item does not lock payee is not well computed *Correction: The "Other" category in dashboard and report widget name "5 main categories of expenditure" *Correction: Sometimes the sort on date in operation table is not the same than the sort used to compute the balance, this causes troubles *Correction: Create fake operation doesn't work on account not having the primary unit (https://forum.kde.org/viewtopic.php?f=210&t=138803&sid=d0d34f728ef7f41bb6c32764ccf3d8f6) *Correction: "Income vs Expenditure" dashboard widget is not refreshed when data are modified *Correction: Bad display in "5 main categories of expenditure" in QML dashboard widget *Correction: Better performance in "Incomes vs Expenditures" dashboard widget *Correction: Duplication of operation must not duplicate the creation date *New feature 375866: Quick fill find operations in other account *New feature: New columns visible in operation table *New feature: New "budget" dashboard widget in QML *Performances: Better performances by using multithreading and caching *Performances: Better performances in "Apply all recommended corrections" -- Stephane MANKOWSKI Wed, 05 Apr 2017 20:24:45 +0200 skrooge (2.7.0) *Correction: Due to a security hole, sqlcipher is no more an option. If you use password protection, we strongly encourage you to use this version of Skrooge and to change your password *Correction: "Delete" and "Add property" are never activated in "Simulator" page *Correction: Current periods (Quarter, Semester, Year) must be available in some widgets of the dashboard *Correction: Only previous months are relevant in "Personal finance indicator" of the dashboard *Correction: Boobank backend does not import transactions when the date format is YYYY-MM-DD 00:00:00 *Correction: Remove "Stooq monthly history.txt" because it does not work *Correction: Description of SKGPeriodEdit is not correct *New feature: Addition of the "Other" category in dashboard and report widget name "5 main categories of expenditure" *New feature: New grantlee filter to execute the sql order you want on the document. This will improve html reports *New feature: New grantlee filter to convert an integer in file size format (example: 390.2 MB) *New feature: Ability to open a file property by url *New feature: CSV export from report is now able to export raw values (http://forum.kde.org/viewtopic.php?f=210&t=112209&p=290153#p290153) *New feature: Resize of account number in "Accounts" page to be able to entre IBAN number *New feature: "Rename" for all dashboard widget *New feature: "Search & process" is now possible on bank name. This allows to create an alarm based on the deposit guarantee level per bank -- Stephane MANKOWSKI Sun, 22 Jan 2017 17:45:58 +0100 skrooge (2.6.0) *Correction bug 372470: Scheduled transactions on dashboard *Correction bug 372938: merge imported operations wrong warning about different amounts *Correction bug 373147: Dashboard/Scheduled operations typo *Correction: Remove old skrooge icons to use the official breeze icons *Correction: Do not install namelink for private library *Correction: Avoid inconsistency when primary unit is not well defined (https://forum.kde.org/viewtopic.php?f=210&t=136856) *Correction: QIF import fails when non utf8 chars are found *Correction: Display all type of item in "Search & Process" *Correction: Execution of "template" rule after import destroys the template itself (https://forum.kde.org/viewtopic.php?f=210&t=137121&sid=b3336f56f03d79f50ad7d53b9e919076) *Correction: Recovery of the working copy doesn't work in sqlcypher mode *Correction: Better performances and memory use in SKGAccountObject::getPossibleReconciliations *Correction: Better automatic account selection by using bank and agency numbers *Correction: Bad unit symbols in min and max limits in accounts page *Correction: Impossible to duplicate a page not having selection (eg. Dashboard, monthly report) *Correction: The dock "Message" is not reinitialized when a new file is loaded *Correction: In budget module, replacement of "Remove existing budgets" by "Remove existing budgets for xxx" *Correction: BitcoinCharts currency import order must be inverted because CSV file has been inverted *Correction: Better display for "Income vs Expenditure" on QML dashboard *Correction: New limit to history size set to 999 instead of 99 *Correction: To avoid partial import with backend, the import is fully done in case of delta detected *Correction: weboob backend is now searching transactions on date AND rdate to avoid missing transaction *Correction: Skrooge is now able to download addition stuff (monthly report template, quote source) with knewstuff *Correction: Open file property fails when the property name contains the full path (https://forum.kde.org/viewtopic.php?f=210&t=137528) *Correction: Avoid duplicated operation when importing attached accounts with weboob *Correction: Group on suboperations must display min, average and maw amounts (https://forum.kde.org/viewtopic.php?f=210&t=137569) *Correction: The option "Import only operations since the last imported one" must not be applied with backend import *Correction: "Estimated interests" are now in QML in dashboard and are available for monthly reports *Correction: Addition of tooltips on each operator in "Search & Process" *New feature: Addition of "nocolor" to the "money" Grantlee filter *New feature: Remove .skg in backup file name if .skg is added in the prefix (https://forum.kde.org/viewtopic.php?f=210&t=136518&p=366065#p366065) *New feature: "Alarm" dashboard widget is now compliant with QML mode -- Stephane MANKOWSKI Tue, 27 Dec 2016 18:42:32 +0100 skrooge (2.5.0) *Correction bug 364407: Doesn't build with Qt 5.7 *Correction bug 366025: Skrooge perpetually asks me to save updated tab state *Correction bug 368196: Delete sub-operations in edit delete selected operation in list *Correction bug 368356: Show amount sign on lost focus *Correction bug 368195: No lock on target account for a transfer *Correction bug 369090: Transfers sub operation created by template has wrong date *Correction: Migration connect from ui file to cpp file *Correction: Better colors of amounts in tooltips of advices *Correction: The 31 of the month, in budget page, "Previous month" does not work *Correction: When a second instance of Skrooge is launched with a file as argument, the file must be imported in the first instance of Skrooge *Correction: Since QT5.7, no more dependency on KDELibs4Support *correction: Dates wrong on dashboard - date format instead of the date itself *Correction: Keep properties when 2 operations are merged *Correction: Correction in weboob backend to avoid missing transactions and improve performances *New feature: Massive update is now available for amount in "Operation" page *New feature: Massive update is now available for date in "Operation" page *New feature: Capability to set/change order of budget rules *New feature: Tooltip on modified amount of budget to explain the reasons of modifications *New feature: Import of PDF invoice -- Stephane MANKOWSKI Sun, 25 Sep 2016 09:00:24 +0200 skrooge (2.4.0) *Correction bug 359679: Building the v2.3.0 package on Arch Linux dies with an error 'isnan' was not declared in this scope *Correction bug 362231: Lost date in imported split operation *Correction: Corruption of document after removing the password *Correction: In unit page and dashboard widget the annual performance is now computed on a year (not with an extrapolation of the last performance) *Correction: Refresh "Interest" dashboard widget when operations are modified *Correction: Copy needed files in local when a new template (for monthly report) is created *Correction: All advices are not displayed in dashboard *Correction: More setPlaceholderText for better GUI *Correction: Responsive report is now using highchart *New feature: New tutorial grantlee template to learn how to develop a new template *New feature: New option to select if the dashboard must be in html or qml. Qml mode is still experimental -- Stephane MANKOWSKI Fri, 06 May 2016 21:07:29 +0200 skrooge (2.3.0) *Correction bug 357081: No option to disable tray icon *Correction bug 357414: Bad display amount in split editor *Correction bug 358315: Typo in .desktop file leads to KRunner freeze *Correction: Avoid failure in kmy import when sub category already exists *Correction: Better autoreconciliation (the autoreconciliation can be done even when operations are not well sorted) *Correction: Migration to nullptr *Correction: Replace "XXX* yyy = new XXX" by "auto yyy = new XXX" *Correction: Thanks to regular expression, the "word" function is now able to interpret "N:1234" as a 2 words "N" and "1234" *Correction: Better icons (correction of installation for breeze) *Correction: Autoreconciliation doesn't work for accounts in other units than the primary *Correction: Better computation of the preferred currency for QIF import *Correction: After a modification or an creation the focus must be given to the table *Correction: Error when launching Skrooge from krunner *Correction: Bad sums in reports *New feature: New column "Balance import" in account page with an indicator to know if the account is still aligned with import balance *New feature: Check balance of accounts after import with backend *New feature: New "Personal Finance Score" in monthly reports *New feature: New "Personal Finance Score" in dashboard *New feature: Selection sum is now in the status bar *New feature: On tables, when the filter changes, the selection remains visible *New feature: Ctrl+Maj+V allows to validate OR UNVALIDATE the imported operations -- Stephane MANKOWSKI Sun, 21 Feb 2016 21:55:44 +0100 skrooge (2.2.0) *Correction bug 352674: SQLite version of the system not aligned with embedded in Qt when using sqlcipher *Correction bug 349961: Values in "Text" report are clickable to open corresponding operations *Correction bug 349976: Default categories for payees *Correction bug 354139: Pb when opening operations in sub-operation view *Correction bug 341463: Monthly reports include transfers between accounts and shows as income/expenses *Correction bug 354439: Re-open close account with money: wrong warning *Correction bug 354463: Incomes/Expenditures in monthly reports do not account for sub-operations of split operations *Correction bug 354424: Displayed balance is 0,00 and operation is ignored afterwards *Correction bug 354817: Arrows should increment/decrement operation number *Correction bug 355376: Category too small in split editor *Correction bug 355956: Not existent type in dashboard *Correction: Drag and drop file is now able to move a file *Correction: The WORD function of "Search & Replace" is no more sensible of useless space *Correction: Open skrooge document from desktop *Correction: Set open source licence on svg files *Correction: Correction ofx import in ECM_ENABLE_SANITIZERS='address' mode *Correction: Better print of dashboards by printing each widget individually *Correction: Better counting of pages in print function *Correction: Monthly reports with "default" template is now printed in only one page (remove page-break-before: always) *Correction: Monthly reports with "responsive" template must not print url *Correction: Migration from sqlite to sqlcipher mode does not work when the password contains the character " *Correction: In "Search & Process", the between function must work when v1 Sun, 29 Nov 2015 18:48:31 +0100 skrooge (2.1.1) *Correction bug 351977: Missing Comment in desktop file *Correction bug 350722: Sudden date change from 20XX to 19XX *Correction: Upload of knewhotstuff does not work *Correction: Avoid performance issue when an operation is created very far in the future (example: 01/01/8015) *New feature: New source of download "GrandTrunk" better than yahoo finance for currencies -- Stephane MANKOWSKI Fri, 11 Sep 2015 13:10:09 +0200 skrooge (2.1.0) *Correction bug 349349: Allow to enter year with 2 digits only *Correction bug 349328: Bad date on split operation after fast edition *Correction bug 349327: Bad date format for sub-operation display in split tab *Correction bug 349624: Add operator on fast filter *Correction bug 349776: Freeze when splitting and editing a future operation *Correction bug 349329: Tools should display modifications before applying them *Correction bug 349961: Split value of operations in reports/exports *Correction bug 350154: Cannot change rate symbol (%) position in Simulations panel *Correction bug 350722: Sudden date change from 20XX to 19XX *Correction bug 350937: Some words are not translated *Correction bug 340647: Encrypted Skrooge file is decrypted in-place *Correction: Authorize only word characters and space in name of templates of reports *Correction: Authorize only word characters and space in name of source of quotes *Correction: Missing unit symbol in monthly report *Correction: Failure on export *Correction: Bad display in period selector of "Income & Expenditure" dashboard widget *Correction: Bad filters in some open file dialog *Correction: Error when open link with non ASCII characters *Correction: Better detection of unaligne dates between operations and sub operations *Correction: The first update of monthly report must take into account the selected template instead of using the default one *Correction: Add credits page in "About" *Correction: Double click on skrooge document opens skrooge but the document is not loaded *Correction: Code rework for contextual menus *New feature: "Open..." action in contextual menu of reports *New feature: New function to import simple rules (payee=xxx => category=yyy) from csv file *New feature: More period options in dashboard widgets *New feature: "5 main categories of expenditure" in dashboard and report is now clickable *New feature: "Quotes" in dashboard and report is now clickable *New feature: Addition of list of key users in credits *New feature: Messages/errors can have associated action *New feature: "Open operations modified by this transaction" *New feature: Delete items in history -- Stephane MANKOWSKI Thu, 27 Aug 2015 19:20:30 +0200 skrooge (2.0.0) *Correction bug 347762: Invalid error message for SQLite version check after an update of SQLite *Correction bug 324653: Auto-Hide Scrollbars for Report Graphs *Correction bug 348865: Do not show translated tooltip *Correction bug 348490: Split with almost 0 operation *Correction: Porting on KF5 / QT5 *Correction: Use of Q_DECL_OVERRIDE *Correction: Bad account selected in editor when a closed operation is selected *New feature: Close action available in menu and contectual menu -- Stephane MANKOWSKI Sun, 14 Jun 2015 18:16:43 +0200 skrooge (1.12.5) *Correction bug 348619: Freeze amount should freeze unit *Correction bug 348621: Field order with tab key *Correction bug 348620: Display of multiple operations with common fields *Correction bug 348568: Payee with operations in 0 operation group *Correction bug 345994: Bad unit on some operation after search *Correction: Build for QT built with -reduce-relocations -- Stephane MANKOWSKI Wed, 03 Jun 2015 22:07:31 +0200 skrooge (1.12.0) *Correction bug 345974: Skrooge alarms keep firing up regardless of specified alert amount *Correction bug 346151: Fast edition do not fill operation sign *Correction bug 345998: Add tooltip for all history actions *Correction bug 345799: Moved then hiden column displayed *New feature: Automatic point operations created during reconciliation *New feature: "Simple" mode in "Search and process" page *Performances: Better performances on selection change in "operation" page -- Stephane MANKOWSKI Thu, 07 May 2015 20:46:21 +0200 skrooge (1.11.0) *Correction bug 341020: End of text in lineedit hides under the "clear" icon button *Correction bug 341450: Empty skg_bill.csv is created every time I launch Skrooge *Correction bug 341463: Monthly reports include transfers between accounts and shows as income/expenses *Correction bug 342737: Multiple date modifications on scheduled operations *Correction bug 343730: Resize/hide internal filter panel in report *Correction bug 335945: Support making split operations from standard operations by search and process *Correction bug 344250: Bank ING-DIRECT in France has changed its bank number *Correction bug 345580: Share without tax should not be split *Correction bug 345654: Btn Add grayed after entering values information *Correction bug 345661: Selecting multiple operations: amount is not ----- *Correction bug 345719: Enhance fast search/filter on lists *Correction bug 345826: Bas edit fields on list sub-operation after search *Correction bug 345416: Crash when searching on 'type' field *Correction: "Search" and "Report" do not work on properties of suboperations *Correction: Bad tooltips in "Report" for expand and collapse *Correction: Support invalid OFX file having debit with positive amount *Correction: Timeline does not work in some cases *Correction: More flexibility during import of ofx file not having id on transactions *Correction: Anonymized file is renamed to avoid accidental overwrite of the current file *Correction: weboob backend compliant with version 1.0 *Correction: Avoid crash and generate an error when the sqlite version of the system is not aligned with the sqlite version embedded in QT *Correction: Open suboperation from multi selected operations *Correction: Avoid deletion of previous file and backup during save in case of file system full *Correction: When a folder of bookmark a tab doesn't have the right icon *Correction: Stable sort when sorting by date to avoid ununderstandable balance *Correction: In table, when rows are groupes, the row representing the group spans all columns *Correction: Avoid crash in Add properties on suboperations *New feature 343766: Better custom report configuration *New feature: New dock to be able to see all messages displayed *New feature: Alarm messages can be have parameters for the total amount (%1), alarm amount (%2) and difference (%3) *New feature: Show sum of spendings in tables when operations are grouped *New feature: New advice detecting scheduled operations having date not aligned with the last inserted operation *New feature: The target directory of the backuped file can be force *New feature: Now some advices are recommended *New feature: In settings, you can define default comments, payees and categories for fake, commission and tax operations *New feature: New button on advices widget to apply all recommended advices *New feature: Display average, min and max on groups in tables *New feature: WORD function is now able to extract word from the right by using negative parameters *New feature: Addition of "Creation date" on operations -- Stephane MANKOWSKI Sun, 05 Apr 2015 19:18:04 +0200 skrooge (1.10.0) *Correction bug 334626: When doing a transfer, my specification of + or - is ignored *Correction bug 335943: Please add column "number of operations" to categories view *Correction bug 336320: OFX file import duplicates the last 12 transactions *Correction bug 338351: Reconciliation with additional currencies *Correction bug 338993: Change main currency fails to update amounts *Correction bug 338994: Currency rate not saved for transactions *Correction: Open URL does not work in unit page *Correction: Wrong date in message "Operation 'XXX' will be inserted in YYY days" *Correction: Auto repair of qif file not having sum of suboperation amount != operation amount *Correction: Better error message on mny import when java is not installed *Correction: Weboob0g backend is now compliant with weboob version 0h *Correction: Correction in bitcoin quote download *Correction: Remove duplicate in "To Account" field on operations *Correction: Import of mode for mny files *Correction: Better detection of transfers in mny import *Correction: Automatic resize of columns in "Search and Process" edit panel to facilitate the creation/update of rules *Correction: Missing template "categories_month_table" *Correction: For credit card account, the binding of account is optional *Correction: Remove useless "Expand All" and "Collapse All" on history table *Correction: "Add property" and "Delete" is now working on sub operations *Correction: "Highlight" is disabled on sub operations *New feature: The future can be added or not in "Current" or "Last" periods *New feature: Defered credit card management *New feature: Capacity to apply a template on operations *New feature: Capacity to automatically apply a template on operations from "Search and Process" *New feature: Sort of table memorize the previous sort to be able to sort by column 1 and column 2 *New feature: New advice to inform the user when the monetary decimal symbol is not defined in KDE localization settings *New feature: 2 options in graphs, one for limits visibility, one for average visibility *New feature: New advice to detect similar payees *New feature: New advice to detect similar categories *New feature: Add in documentation how to use kdewallet with weboob backend *New feature: Import iif file *Performances: Better performances in "Possible schedule" *Performances: Better performances in dashboard -- Stephane MANKOWSKI Tue, 28 Oct 2014 20:57:41 +0100 skrooge (1.9.0) *Correction bug 327148: Version 1.8.0 doesn't build *Correction bug 328335: Wish for fixed table row header *Correction bug 326764: When printing hard copy of report, only data in view in window is printed, not full report data *Correction bug 329568: Simulator utility problem *Correction bug 329825: When opening crypted file with false password skrooge falsely states the file is corrupted *Correction bug 329876: Weboob import from paypal ignores dates and creates account "0" *Correction bug 330354: Budget forecast duplicates operation creation *Correction bug 330428: Sorting doesn't work on Reconciliation date in Accounts view *Correction bug 331191: Obsolete term „Context“ in docbook *Correction: Remove conflict on CTRL+C shortcut *Correction: Import mny does not work with space in file name *Correction: In case of failure during backup file creation a warning message is displayed instead of an error avoiding to save the file *Correction: Refresh delta during reconciliation *Correction: Better PDF export from Monthly report *Correction: Import CSV unit file with "," as separator *Correction: Better KMyMoney import *Correction: Imported "Wallet" accounts are in bank named '' *Correction: Avoid wrong transfert in Grisbi import *Correction: The option "Import only operations since the last imported one" uses a delay of 4 days to avoid missing operations due to value date *Correction: Avoid error in import of homebank file without parent attribute on categories *Correction: Correction for unit download with Stooq *New feature: More option in "Income & Expenditure" dashboard widget *New feature: New shortcuts for "Expand all" and "Collapse all" *New feature: Operations can be split by date *New feature: Imports (csv, qif) support date format like this: 31Dec2012 *New feature: Import CSV support now "semicolon", "comma" and "tab" as separator *New feature: Monthly report is now able to display reports on months, quarter, semesters and years *New feature: New "responsive" template for monthly reports *New feature: In graph, sums are now all computed *New feature: Pareto curve in graph *New feature: New "quarter" and "semester" period in graph and "Incomes & Expenditures" dashboard widget *New feature: Ability to reorder the suboperations in the split operation *New feature: Better date filtering in operation page *New feature: More operators is "Search" panel *New feature: New statistic plugin -- Stephane MANKOWSKI Sat, 12 Apr 2014 16:11:26 +0200 skrooge (1.8.0) *Correction bug 319706: OFX trntype not imported, rest okay *Correction bug 320114: Wrong bank balance at dashboard *Correction bug 320112: Importing CSV operations with mixed " and ' text field separators *Correction bug 320226: Monthly report does not work due to missing template *Correction bug 320240: Impossible to enter exact amount for given unit in pop-up *Correction bug 320242: Transaction confirmation pop-up doesn't use defined unit value for transaction date for suggested value *Correction bug 320261: Dashboard "Income & expenditure": no values, strange colors *Correction bug 320157: Skrooge not working when .skg file is located on Samba share *Correction bug 320323: Add function ("rest to") In budget *Correction bug 320298: Default automatic format detection while importing a file leads to wrong entries creation *Correction bug 320070: Allow changing operation date through "Search & Process" *Correction bug 320716: Skrooge does not import all operations using weboob *Correction bug 320717: Use rdate instead of date in weboob backend *Correction bug 319993: Please adopt application logo/icon for smaller resolutions ==> skrooge-mini can be choosen for small resolutions *Correction bug 319990: Please fix icon alignment in Pages tab *Correction bug 322306: Skrooge Crash using Forecast Schedule *Correction bug 322069: Designer plugins should be unversioned .so files *Correction bug 323380: Minor date bug when using the stock portfolio widgets *Correction bug 320066: Crash importing KmyMoney exported file from Skrooge *Correction bug 324972: Import fails without an error when account is defined in CSV *Correction bug 325081: Add a « Yesterday » choice in the date picker *Correction bug 325174: Importing from gnucash file doesn't import accounts fo types 'Mutual Fund' nor 'Credit Card' *Correction bug 325223: Crash when exiting skrooge *Correction bug 324008: Erreur when importing .mny file. Error when analysing categories.json *Correction bug 325675: Build error in skgfileplugin.cpp for openSUSE 12.2 KDE 4.9 *Correction: KMyMoney exports does not need a check of integrity anymore *Correction: Addition of all icons in size 256 and 512 *Correction: Block drop of a bookmark under another bookmark *Correction: Bad date format detection when the second value is 9 (example: 3/9/04) *Correction: Remove the "Bank account " string in the name of the account name created by an OFX import *Correction: Icon for "Amount entered" *Correction: Authorize long number for operations like 5490990004 *Correction: Default graph mode = line *Correction: Better detection of duplicate operations after import *Correction: JSON export based on QJson *Correction: The setting "Import only operations since the last imported one" allows importation for the same date (< instead of <=) *Correction: Impossible to change state of operation from suboperation view *Correction: More permissive "Open duplicate" *Correction: Better setting layout for import/export *Correction: Import/Export minimum and maximum balance in KMyMoney importer *Correction: Import minimum balance in Grisbi importer *Correction: Import minimum balance in Homebank importer *Correction: New "weboob0g" backend compliant with the Weboob 0.g *Correction: When a file is selected for the icon of the bank, the file name is displayed in the name of the bank *Correction: In simulation page, the interest are computed with only operations with type=currency, not with shares *Correction: Error when importing skg file by double clicking when skrooge already open *Correction: No more password panel when the user loads an invalid Skrooge file *Correction: In report, the forecast based on budget is displayed even when no operation in account *Correction: Shortcuts in "Show" menus *New feature: Notifications and error messages are now based on KMessageWidget *New feature: The restore file is now base on KMessageWidget *New feature: Option to auto download from backend on opening file (default=false) *New feature: Import Microsoft Money documents (.mny) protected or not *New feature: Tarballs are not uploaded on download.kde.org *New feature: Addition of russian banks *New feature: Reopen last page closed *New feature: Max and min limits on accounts *New feature: Better and new advices based on limits of accounts *New feature: Sound emmission on operation creation *New feature: Import "Budgetary allocation" and "Fiscal year" from Grisbi files as properties *New feature: Information message explaining how to exist full screen mode *New feature: Addition of date of last reconciliation on account *New feature: Amount owned on unit table *New feature: Download date on unit table *New feature: New account type: Pension *New feature: New set of categories for french people *New feature: Addition of "Configure notifications..." in configuration menu *New feature: Download and add bills as property by using boobill (weboob) *New feature: Rename of property *New feature: Export HTML and ODT from tables *New feature: Automatic process to recover a corrupted file *New feature: Possibility to print current page *Performances: Better performances in dashboard *Performances: Better performances in monthly report *Performances: Better performances in import of multi files (or from backend) by applying "search & process" rules only one time *Performances: Better performances in kmy export *Performances: Better performances by avoid to refresh autocompletion on widgets after light transactions -- Stephane MANKOWSKI Sat, 05 Oct 2013 18:54:16 +0200 skrooge (1.7.1) *Correction bug 319565: Bad performances on ubuntu 13.04 *New feature: Open report from dashboard widgets -- Stephane MANKOWSKI Thu, 09 May 2013 22:28:28 +0200 skrooge (1.7.0) *Correction bug 316604: Income and Expense widget on the dashboard does not respect suboperations in split operations *Correction bug 316796: Reports crash when closed normally *Correction bug 318063: New file format (AFB120 CFONB) *Correction bug 279967: When automatically started at login, Skrooge is always displayed on all desktops *Correction bug 319145: Multiple currency support still buggy *Correction: Group operations with more than 2 operations selected *Correction: Group operations with already grouped operations *Correction: Hide internal properties in "Search & process", in operation page and in the function "Add property" *Correction: QIF import does not support mix of date format *Correction: The advice action "Remove groups with only one operation" does not remove the operation but the group *Correction: Better performances in kmymoney import and all other imports *Correction: skroogeconvert does not support files without path (example: skroogeconvert -in t.csv -out t.kmy) *Correction: Better performances of skroogeconvert in case of skg import or export *Correction: Global better performances by using the right index on unit table *Correction: Rename "Undo document" to "Revert document" *Correction: Reduce the number of messages when using backend import *Correction: Possibility to group tables on properties *Correction: Better support of import/export with url *Correction: Better merging of operations in QIF import *New feature: More modification functions in "Search & Process" panel for Payee, Account, Tracker *New feature: New "capitalize" function in "Search & Process" panel *New feature: New attributes "Unit" and "Transfer" in "Search & Process" panel *New feature: All update functions are now available for properties in "Search & Process" panel *New feature: New icon in tab bar to create new page *New feature: 'To account' in operation table and "Search & Process" *New feature: More attributes in line and column in reports (graph) *New feature: Monthly reports and main page use the general font of KDE *New feature: Possibility to force the date format for qif and csv imports *New feature: More functions in tool menu *New feature: More tips of the days *New feature: Dispay option "Hide pointed operations" in operation page *New feature: Possibility to group tables on hidden column *New feature: Facilitate creation of standard currencies with auto completion *New feature: Addition of the new currency "Bitcoin" with automatic download of the rate *New feature: In dashboard and monthly report, banks can be clicked to open corresponding operations *New feature: In report, the graph correction can be done by multiply or divide -- Stephane MANKOWSKI Sat, 04 May 2013 16:49:45 +0200 skrooge (1.6.0) *Correction bug 314389: weboob import does not work *Correction bug 314743: Can not resize window when operations tab is displayed *Correction bug 313926: Version 1.5.1 shows warnings *Correction bug 313948: Skrooge crashed after double clicking on an account after using clean import tool *Correction bug 313928: Warnings during build on OS X > 10.6 *Correction: Splash screen and notifications on windows *Correction: Better error management in weboob import plugin *Correction: Faster and without notification units downloads *Correction: Facilitate toolbar customization *Correction: Bad date format identification in some cases *Correction: Remove traces "Attempt to use QAction 'XXX' with KXMLGUIFactory" *Correction: Activation of link in "Incomes and Expenditures" dashboard widget *Correction: Operations in "Loan" accounts are not more taken into account in budget and "Incomes and Expenditures" dashboard widget *Correction: More point styles in graph and better rendering *Correction: Display of infinity symbol in dashboards and monthly reports *New feature: "Open all" and "Bookmark current page here" in the bookmark button *New feature: Button in bookmark dock to discover the contextual menu *New feature: Buttons on dashboard widgets to discover the contextual menu *New feature: New cursor on dashboard widgets to show that widgets are moveable *New feature: New dashboard (fast remove, fast add, fast move, fast drag & drop) *New feature: ToolButton displaying contextual actions on top right of tables *New feature: "Pages" launchers can be added in the toolbar *New feature: New WORD function in "Search & process" to extract a word of an attribute *New feature: More generic import through backends *New feature: Support values like this "3128/100" in imports -- Stephane MANKOWSKI Mon, 25 Feb 2013 18:06:13 +0100 skrooge (1.5.1) *Correction: Avoid endless "wait cursor" in case of canceled load of protected file *Correction: More robust weboob import for backend not supporting parallel download *Correction: Operations page layout with very long comments -- Stephane MANKOWSKI Tue, 22 Jan 2013 21:09:04 +0100 skrooge (1.5.0) *Correction bug 311252: Creating account with existing name just modify the existing one *Correction bug 312609: Banks widgets at the dashboard show wrong values *Correction bug 312671: Compile warnings *Correction bug 312859: Searching for an empty payee doesn't seem to work *Correction bug 313140: Thousands of compile warnings when using [-pedantic] [PATCH provided by Andi Clemens] *Correction bug 313141: Adjust layout in preferences window [PATCH provided by Andi Clemens] *Correction bug 271292: "Set to upper" process does not work with all characters *Correction bug 263265: Support regexps on imported data *Correction bug 313268: Better layout fot the "comment" field in the operations view *Correction bug 313240: Transfers between accounts with different currencies show as income/expense *Correction: Disable "Pin this page" when no page is opened *Correction: Disable "Print" and "Print preview" when no page is opened *Correction: Correction in the show menu of the operation page when only one account with ";" in the name *Correction: Pb of propagation for budget rule with Period=Current Year *Correction: Avoid duplicate message in notification *Correction: Avoid to set an operation in more than one budget item when "garbage" budgets are used *Correction: Display reconciliation field when the "Reconcile" function is called from the page of accounts *Correction: Transfers ignored by default in" "Incomes & Expenditures" widget and reports *Correction: Adapt the size of the "Account" field to the lenght of the accounts names *Correction: Set focus on "Date:" field after insertion or update of an operation *New feature: New "Process Immediately" method to process immedialetly some scheduled operations *New feature: Multiselection for "Jump to the operation" in scheduled operation page *New feature: New advice to detect non alignment of comments (operation vs suboperation) for simpe operations *New feature: New advice to detect operations without mode *New feature: New option Automatic refresh/Manual refresh in advice dashboard widget *New feature: New advice to switch on "Manual refresh" when advice are very long to compute *New feature: New advice to detect too complex unit definition like this: IBM => $ => £ => € (not supported) *New feature: Possibility to do graphic reports with the bank as column of line *New feature: Automatic import through weboob (http://weboob.org/) *Perfo: Better performances in advices by avoiding to compute dismissed advice *Perfo: Better performances in categories and payees tables *Perfo: Big performances improvement for huge transaction like imports or massive delete of accounts -- Stephane MANKOWSKI Sat, 19 Jan 2013 16:31:49 +0100 skrooge (1.4.0) *Correction bug 306517: "Incomes & expenses" widget displays a wrong sum for expenses *Correction bug 308050: Untranslatable strings in 'Budget' Page *Correction bug 308395: "list of operations" screen : inoperative filters (hide closed operations >1 & 2 weeks) *Correction bug 310372: Word completion in the comment field in standard operation does not work even if it was added via split operation *Correction: Better colors in "Expenditures vs Icomes" dashboard widget *Correction: Support qif file having Type:Class with description *Correction: Remove "All" in operation menu when only one account is created *Correction: Move "Export ..." menu in "File" menu *Correction: Bad display of account having a "&" in operation page *Correction: Move "Processing" actions in the main menu named "Tools" *Correction: Hide title when reset filter in operation page *Correction: Better performances in SKGDocumentBank::computeBalances by using compound query *Correction: Avoid freeze when a very old value (example: 14-11-0012) is entered by error for a unit *Correction: Avoid freeze in reports when a very old operation (example: 14-11-0012) is entered by error *Correction: "Quantity owned" in unit page does not initial amount of accounts *New feature: New button on unit page for opening the web site of the download source *New feature: Warning on closing non null account *New feature: Support for Activities *New feature: "Stock portfolio" in monthly report *New feature: "Stock portfolio" dashboard widget based on monthly report *New feature: Possibility to add hyperlinks in monthly reports *New feature: Export html in monthly reports *New feature: New widgets for dashboard *New feature: 2 new templates for monthly report are delivered by default *New feature: 2 new advices detecting very old values of unit and very old operations *New feature: New advice checking if budgets rules are treated *New feature: New option for import to "Import only operations since the last imported one" -- Stephane MANKOWSKI Sun, 09 Dec 2012 11:51:43 +0100 skrooge (1.3.3) *Correction bug 305880: On the Dashboard, scheduled transactions have wrong number of decimal places *Correction bug 306119: Cannot open document created in 1.3.0 with 1.3.2 *Correction bug 305879: Account panel shows Edition - should be Addition *Correction: Smaller bank icon selector in "Accounts" page *Correction: Set default type as "currency" in "Units" page when primary and secondary units are already defined *New feature: Add "savings" as type of account *New feature: "Tracked" operations in option of "Income vs expenditure" widget of dashboard *New feature: Export JSON -- Stephane MANKOWSKI Mon, 03 Sep 2012 16:25:21 +0200 skrooge (1.3.2) *Correction bug 300228: Failed to import from KMyMoney file *Correction bug 301137: 'To Account' of an existing money transfer is displayed incorrectly in edit area *Correction bug 302388: Gnucash import failes: Better error message in case of negative value for a currency *Correction bug 302502: Message for possible schedule incomplete *Correction bug 303527:Support more time options for ‘show checked operations’ *Correction bug 304003: Crash when removing transaction number of transactions with duplicate account numbers *Correction bug 304313: Importing a KMyMoney file results in error: "[ERR-11]: 'KMYMONEY-KMYMONEY-TEMPORARY-ACCOUNT': You are not authorized to delete this account because it contains some checked operations" *Correction: Rename columns of budget table *Correction: Better CSV and TXT exports of tables grouped by a column *Correction: Better SVG export of tables *Correction: Restore palette in tables after print *Correction: Do not display disabled schedules in dashboard *Correction: Remove text on common icons in toolbar by using QAction::LowPriority *Correction: In "Scheduled operations" page, the button "Jump to the operation" opens the operation page in template mode to authorize updates *Correction: New wording; "To be Checked" instead of "Foreseen" or "In Transit"; "Checked" instead of "cleared" or "validated" *Correction: Better mouse icon when closing pined page *Correction: Remove X confirmation messages when close a document having X pinned pages *Correction: Focus on opened page from bookmarks when the current page is pinned *Correction: Allow massive update in account page *Correction: Avoid bad table display when grouped *New feature: Progress bar in budget table for active budgets *New feature: "Open report" button from search page to open report without saving the query *New feature: Option to ignore operation tracked in reports *New feature: Option to ignore operation grouped in reports -- Stephane MANKOWSKI Mon, 06 Aug 2012 12:24:18 +0200 skrooge (1.3.0) *Correction bug 291512: Show hide checked operations setting are not retained *Correction bug 291550: Advice (dashboard) about operations with empty category : case of transfers *Correction bug 292225: Skrooge 1.2.0 crash on opening report *Correction bug 293398: Display Graph windows during Account Creation *Correction bug 293397: Error on duplicate account name creation *Correction bug 293580: Select/unselect "import state" column will display empty field *Correction bug 293941: Skrooge crashed on deleting split operation *Correction bug 278220: Wrong values in Monthly Report "Amounts in accounts" *Correction bug 296204: add balance entered in Operations *Correction bug 297722: Copy/paste comment in the table of a split operation leads to a wrong behaviour *Correction: creation of subcategories with entered number *Correction: hide templates when open operations from other pages *Correction: Use radio button in "Show" menus when needed *Correction: Support import of gnucash file without "gnc:book" *Correction: Generate an error message when trying to import a missing ofx file *Correction: FastEdition does not work when more than one "operation" page is opened *Correction: Crash on QIF export when the document has 3 operations grouped with op1.value=-op2.value *Correction: Refresh of graphs when unit values are modified *Correction: Install the grantlee filter plugin into the correct location. *Correction: Avoid empty "Account" page when no account exist *Correction: No automatic resize of columns when "auto resize" is not check *Correction: Addition the "rate" in internet code tool tip. *Correction: Amounts are displayed with the right number of digits in "operation" and "account" table. *Correction: Refresh view when a new appearance is selected *Correction: Bad computation of fake operation in case of multi selection *New feature: Better display of "Show" menu in operation table *New feature: Colors in "Incomes and Expenditure" dashboard widget *New feature: "Search & Process" is now working on comments of sub operations *New feature: "Base 100" mode *New feature: Skrooge is now able to import file have amounts with unit symbole (example: -$8.35) *New feature: Possibility to pin/unpin pages -- Stephane MANKOWSKI Mon, 23 Apr 2012 11:45:09 +0200 skrooge (1.2.0) *Correction bug 288683: E: skrooge-common: arch-dependent-file-in-usr-share usr/share/kde4/apps/skrooge/plugins/grantlee/0.2/grantlee_skroogefilters.so *Correction bug 290626: No support of OFX format *Correction: Avoid suboperations pointing on unused category when all categories are deleted *Correction: Hide internal properties in property dock *Correction: A new document is no more considered as modified *Correction: Advice "xxx is an old tracker" modified to use the LASTDATE instead of the FIRSTDATE *Correction: Better display in "Income & Expenditure" dashboard widget + addition of "Saving" *Correction: In "Account" page, "Other ..." in icon list is now working *Correction: Correction for advice "Possible schedule 'xxx'" *Correction: Hide internal properties in graph *Correction: Bug on inline edition on comment & mode *Correction: Optimisation on "anonymize" function for big files *Correction: Highlight switch on category *Correction: In operations tab, provide a "show" menu as for other plugins *Correction: Avoid duplication of some categories when search and process is used *Correction: Avoid modifications in interest table *Correction: Fast edition refreshs the "comment" field *Correction: The autocompletion list for number displays only the numbers of the selected account *Correction: Monthly report create .kde directory event if .kde4 must be used *New feature: Fields of update part of the search & process panel are not editable to facilitate the completion *New feature: Import of non local files (example: http://myserver/document.qif) *New feature: Export of non local files (example: http://myserver/document.qif) *New feature: Dashboard > Shares & Indexes renamed to "Quotes" and provide a possibility to select all available Units (Objects, Currencies etc.) *New feature: Operations > Transfer: do not display a name of a chosen source account in the field of target account *New feature: New mode in reports *New feature: Memorize expanded groups in bookmarks *New feature: "Incomes & Expenditures" widget is clickable *New feature: Highlight on units *New feature: Addition of "Show" menu in scheduled operations *New feature: Hide title in "Scheduled operations" if at least one schedule is existing *New feature: Open "Scheduled operations" when an operation is scheduled *New feature: SKGTreeView scrollbars are sticked on maximum position *New feature: SKGTableWidget scrollbars are sticked on maximum position *New feature: New "Open operations" function in contextual menu (connected with double click - support multi selection) -- Stephane MANKOWSKI Mon, 09 Jan 2012 11:01:12 +0100 skrooge (1.1.1) *Correction: "Highlighted only" is by default disabled in "Account" widget *Correction: Mysterious crash in SKGTreeView::onExpand -- Stephane MANKOWSKI Wed, 23 Nov 2011 21:44:09 +0100 skrooge (1.1.0) *Correction bug 283683: Can not add a new operation after modifying the values on an existing one *Correction bug 284220: Closed account still showing up in accounts combobox of "operations" tab *Correction bug 283840: Skrooge is unable to download units for a past period, but it works for the current day ==> Better warning message *Correction bug 284073: Expressions in splitted operation amount are not calculated *Correction bug 283842: If I add today a past operation in a different unit than the principal, the amount calculated uses the present unit value, and not that of the specific date *Correction bug 284752: Skrooge does not look for Grantlee at build time *Correction bug 284843: OFX import does not work on UTF-8 encoded files *Correction bug 285289: Misspell found: reconciliation instead of reconciliation *Correction bug 285880: Cumulative amount of main categories do not appear *Correction bug 286538: Renaming categories doesn't rename relevant search/process rules (not fixed but better error management) *Correction: Better colors in "5 main variations" widget for dashboard *Correction: Installation of grantlee_skroogefilters.so in only one place and not hardcoded *Correction: No more error when importing skg file with payees *Correction: Addition of an error message on loading of a document generated by a most recent version (example loading on a 1.0.0 document into Skrooge 0.9.1) *Correction: Addition of missing date for x axis on unit graph *Correction: Import homebank set types of accounts *Correction: Possibility to remove an empty account without warning *Correction: Better performances during migration *Correction: Change language of the document on open if the language of KDE has changed *Correction: Better affectation of payees and comments during gnucash import *Correction: Better default size of the "category" panel in the split table to avoid manual resizing *Correction: Better performances during import of multi files by applying "search & process" rules only at the end *New feature: New type of account "Loan", transfer from/to this kind of account are considered as "expenditure" in reports *New feature: New function to remove useless values in unit (the curve is preserved but useless values are removed) *New feature: New tag for grantlee to be able to use standard palette. Colors of the "Default" template are coming from the KDE palette now. *New feature: Possibility to download values of units with regular expressions. *New feature: Possibility to create/modify monthy template directly from skrooge *New feature: More detail in progress bar *New feature: New advice to find and repair operations in groups with only one operation *New feature: New advice to find potential monthly schedule -- Stephane MANKOWSKI Mon, 21 Nov 2011 15:31:03 +0100 skrooge (1.0.0) *Correction bug 280362: Skrooge is not accepting dots or commas *Correction bug 280897: Unit wont set on mt940 import when there are existing operations *Correction bug 280915: The import logic should use an existing account based on bank name read from :20: and the account number read from :25: *Correction bug 282983: Multi-currency transactions not anchored to the exchange rate of the day of the transaction *Correction bug 283246: Some text is hard to read with dark color theme *Correction: Better performances in check box of operation, account, tracker pages *Correction: Grisbi import with split operations does not work *Correction: Capability to open read only file *Correction: Completion on substring available only in "Dropdown list" mode *Correction: To improve performances, the refresh of advices is done when dashboard is activated and only if refresh is needed *Correction: To improve performances, the refresh of models is done for views in current page *Correction: To improve performances, the refresh of graphs is done for graphs in current page *Correction: "Delete unused" of category page tries a delete only on categories really not used *Correction: Various correction in bookmarks (enable/disable in menu, bad management in parent/child relation) *Correction: Cascading delete in categories and bookmarks *New feature: New function to bookmark all opened page in one click *New feature: Addition of "Once a week" for scheduled operations *New feature: Merge of trackers by drag & drop *New feature: "Count" mode in reports *New feature: In table views, when at least one scroll bar is visible, the corner widget allows to display the contextual menu of the header *New feature: Graphs can be corrected by an indice defined in unit page *New feature: Less icon in tool bar by default. New "Fast edit" button in operation editor. *New feature: Add copy menu in contextual menu for cells *New feature: Advice for closed account with amount<>0 *New feature: "Autostart" and "Remove autostart" available in multi selection *New feature: In krunner, A string like "buy 10 ESSO" allows to quickly prepare add a new operation in skrooge. Advices in dashboard allows to finalize the creation *New feature: "Auto start" bookmarks are not opened if the key SHIFT is maintained pressed during the start of Skrooge *New feature: Grouping function in all tables *New feature: New menu to lock/unlock docks *New feature: Allow menu hiding *New feature: "Monthly report" widgets for the dashboard can be set on current month -- Stephane MANKOWSKI Mon, 03 Oct 2011 14:21:04 +0200 skrooge (0.9.1) *Correction bug 271294: Modifying transactions with spaces in their amounts causes them to be reset to 0 *Correction bug 275963: Operations imported in the primary currency unit, not the account unit *Correction bug 278004: Skrooge installs library files with wrong version numbers *Correction bug 278220: Wrong values in Monthly Report "Amounts in accounts" *Correction bug 279421: General reports problems/request *Correction bug 275956: Possibility to display different accounts in different currency units *Correction: Change icons and remove useless icons *Correction: Hide useless "Add" and "Update" buttons in amortization table of "Simulation" page *Correction: No display of initial value (0000) in graph when history mode is not selected *Correction: Now the forecast period is equal to the real period *Correction: Addition of "Add category" in contextual menu of "Category" page *Correction: Differentiation between "Sum" and "Pourcent" mode of PIE graphs *Correction: When "operation" page is an a particular account, the editor is cleaned with this account *Correction: Remove password when anonymize a document *Correction: Better performance by simulating "materialized views" with tables (used for categories and budgets) *Correction: In CSV import, if 2 "amount" columns are found then the first one is considered as a debit and the second one as a credit *Correction: During import, in case of doubt, MM_DD is preferred than DD_MM *Correction: Imports are supporting dates with backslashes like 29\06\2011 *Correction: Better performances *Correction: Saving the state of 'Categories Page' ignores the resized columns with (Auto resize: off) *Correction: CSV import supports multiline file like: date;amount;comment;type "1/1/2010";1000;"transfer 1 from account A to account B";TRANSFER "2/2/2010";2000;"transfer 2 from account A to account C";TRANSFER *Correction: Protection again empty date ==> if the user remove date string then the current date is used *Correction: Toolbar is realy configurable *Correction: Import of encrypted skrooge files *Correction: Better print when many pages are open *Correction: Missing gsb format in import file selection panel *New feature: Graphs in "Bank and Account" page *New feature: Addition of "Jump to the operation" in contextual menu of "Scheduled operations" page *New feature: Properties can be a copy of a file or a link to an existing file *New feature: In all pages, possibility to hide line by using operator - in "Search" field *New feature: Addition of "Highlight" status on catagories and payees *New feature: In reports, the first columns is resizable and has a tooltip for a better display *New feature: "Expand all" and "Collapse all" in category and bookmark trees *New feature: An option to set a frequency of units download (once a day/week/month) *New feature: Properties associated by drag & drop can be copied or linked (ALT+) *New feature: CTRL+C enables copying of selected cells of tables -- Stephane MANKOWSKI Mon, 15 Aug 2011 18:53:00 +0200 skrooge (0.9.0) *Correction bug 273692: Weird overlay in each dashboard widget *Correction bug 268933: Category editing is tedious and confusing *Correction bug 270207: Cannot enter positive value (credit) for operations in my account *Correction bug 270450: Add a wallet as a distinct account *Correction bug 271529: Add a search box to the Categories tab *Correction bug 271708: Wrong account transfer merging when importing QIF files *Correction bug 272863: Allow to choose which wallet store password in *Correction bug 274777: inconsistency between amounts&nb of operations displayed by modules Tiers, Categories and Operations *Correction bug 274993: Generation of forecast in a report depends on the option "auto-write" *Correction: Error during QIF import if unit is already existing *Correction: Open property file with space *Correction: Selected items always on top in graphs *Correction: Symbol in legend when "Point" is the selected mode of graph *Correction: Skrooge crashes on change of icon for folders in bookmark dock *Correction: Show progress bar only when needed *Correction: Bad values when customized dates are changed in reports *Correction: Better draw of pies in graphs *Correction: "Antialiasing" option in settings panel + automatic refresh of graphs after settings modification *Correction: "find and group transfer" does not work if 2 operations with same date and same amount *Correction: Homebank import supports budgets and scheduled operation *Correction: Change "Context" by "Pages" *Correction: Better computation of forecast period for "Scheduled" and "Budget" modes *Correction: Better performance in advice for scheduled operations *Correction: Better proportion in reports in BUBBLE mode *New feature: Formula is autorized in splitted amount (must start by =) *New feature: Ensure visibility of selected items in graph *New feature: New logo with rupee symbol *New feature: New button to reset internal filter in reports *New feature: Settings for "Reports" to select colors *New feature: Information zone in budget to display budgeted amount based on selected budgets *New feature: New contextual action "New category" on categories *New feature: Balance and balance of the day in account widgets (table, dashboard) *New feature: Merge of an imported operation with a manual operation is now possible even if amounts are different *New feature: Button on "Scheduled operations" to jump to the operation template for edition *New feature: New advice to align scheduled operation amount with the last amount inserted *New feature: New kind of graph "stack of columns" *New feature: New kind of graph (values in % of columns) *New feature: New setting to select the color of outline in reports *New feature: New setting to enable/disable balances computation -- Stephane MANKOWSKI Mon, 06 Jun 2011 14:00:49 +0200 skrooge (0.8.1) *Correction bug 259417: Units: graph unreadable when values are missing for some dates ==> "Show origin" allows to show/hide the origin of the graph for a better display *Correction bug 259416: Report: showing limits, average and tendency does not work in mode "Sum" *Correction bug 259414: Feature request: select previously selected tab when closing a tab *Correction bug 259412: Date chooser field: keyboard shortcuts do not work *Correction bug 257324: No icon for Skrooge in the Gnome menu *Correction bug 261001: Better integration on OS X *Correction bug 261318: Amount field calculator gives too many digits *Correction bug 262511: Wrong widget placement in properties subwindow *Correction bug 263263: Separate field for income and expenditure when importing CSV files *Correction bug 263716: Conversion multiple records to "transfer" type cause all have the same ammount *Correction bug 266703: Window exceeds screen size on Netbook *Correction bug 267442: Support for mt940 files *Correction bug 267773: Skrooge always start maximized *Correction bug 267996: Export CSV not unique identifier *Correction: Bad fullname and cumulative amount on categories after a drag and drop *Correction: Import csv with "sign" column before "amount" *Correction: All items are in "Skrooge" category in "Configure shortcuts" *Correction: No symbol for curves of indexes *Correction: "XX is an old tracker" advice does not give the right result when after 31 december *Correction: GNUCash import creates sometimes "wrong" splits with values close to 0 *Correction: Better initial state for the window (docks, maximized) *Correction: Bookmark of report *Correction: Many small correction in "interest" computation (tooltips, items in combo box, computation, ...) *Correction: Bad unit in "unit" page for units having a unit reference *Correction: Better tooltips in report (usefull for huge report where lines title is not visible) *Correction: Better management of codex for exports *Correction: Bad value when update of transfer is done from target account of the transfer *New feature: Import csv with ' as cote (for "Money Manager Ex" exports) *New feature: Import csv is now possible on file without header *New feature: Import csv supports more than one "category" column *New feature: Import "Money Manager EX" file *New feature: Change icon on bookmarks *New feature: "Open potential duplicates" *New feature: Massive update on budgets *New feature: Delete is more secured. *New feature: Force mode on delete. *New feature: Possibility to change the account of operations even when only operations of one account are displayed (useful for credit card) *New feature: New "Search & Process" panel *New feature: Property dock is able to display all properties *New feature: New "About" panel using KDE 4.6 features *New feature: Better mass update on "account", "payee", "tracker" and "unit" pages *New feature: Possibility to merge accounts by using massive update on name of accounts *New feature: Possibility to merge payees by using massive update on name of payees *New feature: Possibility to merge units by using massive update on name of units *New feature: Possibility to merge categories by using massive update on name of categories *New feature: Timeline in reports *New feature: Some fields are directly editable in view *New feature: Completion for all fields with operators (=upper and =lower for the moment) *New feature: New "stacked area" graph type *New feature: New "bubble" graph type *New feature: New button in "operation" page to freeze/unfreeze all fields with text *New feature: Better zoom widget in contextual menu of reports -- Stephane MANKOWSKI Mon, 14 Mar 2011 15:40:34 +0100 skrooge (0.8.0) *Correction bug 250350: Impossible to update an operation of a closed tracker *Correction bug 250403: Dashboard "Shares & Indexes" shows wrong percentaged variation *Correction bug 250677: Bank account choice do not use the country information *Correction bug 246973: Dashboard should be more customizable *Correction bug 251465: Wrong totals with second currency accounts *Correction bug 252869: Skrooge doesn't import KMM bank names correctly *Correction bug 255133: Skrooge crash on ofx import (With wrong data format. Bug in libOFX) *Correction bug 221207: Budget and forecast for accounts *Correction bug 256214: Skrooge after full screen mode I have only StartPage *Correction bug 257322: Installation doesn't depend from "QCA OSSL plugin for libqca2" (libqca2-plugin-ossl is not optional) *Correction bug 258307: comment from main split operation duplicated *Correction bug 258621: Skrooge crashes when KDE session is closed *Correction: Better dashboard display by using a flow layout *Correction: Bookmark of report having "Columns: -- Nothing --" *Correction: Support of "!type:prices" for QIF import and export *Correction: Better export KMyMoney *Correction: Better detection of double during imports *Correction: Protection again sql injection *Correction: Graph redraw even on hidden tabs *Correction: Crash on selection of a cell when graph is hidden in reports *Correction: Refresh of page in case of reset default state *Correction: Boorkmark of "operation" page in template mode *Correction: In report, hide columns or lines without property *New feature: On reports, average and limits are available if "All values in positive" is used too *New feature: Download of all additional information as properties for units (new setting to activate this mode) *New feature: Skrooge is able to store passwords in KDE wallet (new setting to activate this mode) *New feature: Scheduled operations with warning are in bold in dashboard *New feature: Show/hide properties as a column in tables *New feature: Auto point of imported operations to obtain the expected final balance *New feature: Reorder widget in dashboard by drag & drop *New feature: Floating panel in dashboard to remove or zoom widgets *New feature: Accounts can be merged by drag & drop (useful after an import) *New feature: Units can be merged by drag & drop (useful after an import) *New feature: Automatic import of csv columns as properties based on regular expression *New feature: New report capabilities *New feature: Sub total in reports *New feature: New advice for bank without account *New feature: New icons for banks of South Africa (Thank you David) *New feature: OR operator (+) supported in string filters *New feature: New contextual menu in html pages for export as pdf, odt, image and copy *New feature: Possible to show/hide items in context list *New feature: Forecast based on budgets *New feature: Multi selection in report table and graph *New feature: New "show" button *New feature: Better performances on dashboard *New feature: Better performances on tracker page *New feature: New function on operation: "Merge sub operations" *New feature: New advice for budgets *New feature: Possibility to dismiss kind of advices *New feature: Hide tendency line column -- Stephane MANKOWSKI Mon, 06 Dec 2010 15:31:21 +0100 skrooge (0.7.3) *Correction bug 245847: skrooge 0.7.3: 'pow10' was not declared in this scope *Correction bug 213786: Account balance is not displayed *Correction bug 246178: Dashboard "Income & Expenses" widget counting transfers *Correction bug 246408: Skrooge prints hardcopy *Correction bug 246977: In reports from selected data the date selection should be all data *Correction bug 247445: Linker error in skgbasemodelertest/skgtestnodes.cpp *Correction bug 246976: 'Select all' option in menu edit *Correction bug 249955: No password request after hardware crash *Correction: Better management of print option (collate, nb copy, from, to, last page first) *Correction: Do not authorize creation of operation with "-------" *Correction: In report, capability to create history with of property *Correction: In report, do not allow hiding table or graph by resizing *Correction: Import QIF with !Account section containing more than one account and with D attribute (Thank you Dennis) *New feature: Properties with a 'http' or 'file' url as value can be opened from skrooge (useful to set bank site on an account) *New feature: New daskboard component to know money per bank *New feature: Bookmarks in a menu *New feature: Context in a toolbar (useful for small screen) *New feature: Advice widget in dashboard *New feature: Full screen (useful for small screen) *New feature: Addition of file as property by drag and drop *New feature: Tables are scrolled "bottom" or "top" based on sort order -- Stephane MANKOWSKI Sun, 05 Sep 2010 07:36:37 +0200 skrooge (0.7.2) *Correction bug 237498: Skrooge crash on saving preferences (when system tray is not available) *Correction bug 238087: kAmountEdit widget in Operations plugin isn't properly localized *Correction bug 238477: Cannot open base if partition is full *Correction bug 240600: Skrooge must be able to export as a sqlite database *Correction bug 240640: Skrooge crash after password entered - input file DELETED at failure *Correction bug 234597: Gnucash import issues with two accounts with the same name *Correction bug 240601: Skrooge must be able to export an anonymized file *Correction bug 243738: Import of Gnucash file that has CNY currency fails *Correction bug 245254: Category creation failed on first level *Correction: Drag & drop of categories *Correction: Import skg file with tracker or interest simulation *Correction: No XML export of tables sqlite_sequence and sqlite_stat1 *Correction: Layouts compatible with small screen (1024x768) *Correction: Open right page when click on "Estimated interest" in dashboard applet *New feature: Zoom on tables by using CTRL+wheel *New feature: Search button is "Search & process" page to be able to search operations without creating a rule *New feature: Click on a column in "Search & process" editor removes the column *New feature: CTRL+F opens the "Search & process" panel with a condition based on current selection *New feature: Stability of colors in graph *New feature: Selection of colors in graph (saved and restored) *New feature: "Add property" to add easily properties *New feature: skg files saved on a FTP server can be loaded directly from Skrooge. Save is not possible. *New feature: New "Payee" page *New feature: Merge of payees by drag & drop *New feature: Report plugin is able to display graph based on properties *New feature: Possibility to select icon file for a bank *New feature: Any kind of file as property *New feature: Go home -- Stephane MANKOWSKI Sat, 24 Jul 2010 10:00:00 +0200 skrooge (0.7.1) *Correction bug 233895: Switching account from 1 type to another with multi-sel is modifying the initial balance *Correction bug 233930: QIF address field is not imported *Correction bug 234595: Better handling of category deletion ==> Reparent operations on parent category when a category is removed *Correction bug 234608: Some gnucash notes are lost during import phase *Correction bug 234771: Problem importing ofx file *Correction bug 234845: Bad Account after importing ofx *Correction bug 235689: Cannot localize quotation marks *Correction bug 234596: Customisable date format in operations panel *Correction bug 236753: Search but not process on attribute *Correction: Rename "Import CSV unit..." in "Import currency values..." *Correction: Better management of constraints in data model *Correction: Conflict on categories when importing twice a gnc document *Correction: Conflict on categories when importing twice a xhb document *Correction: Conflict on categories when importing twice a gsb document *Correction: Conflict during property update *Correction: Modification of trackers in splitter operations from "Search and process" *Correction: Transfer when signe + is specified before the value *Correction: Various modifications on "Search & Process" *Correction: Replacement of [%1] by '%1' for localization *Correction: No more direct sqlite prerequisit *New feature: Better performances on "File/New" (first Save is longer) *New feature: Usage of KNewPasswordDialog and KPasswordDialog for password protection *New feature: Applet for dashboard to display tip of the day *New feature: CSV import of splits and transfers *New feature: CSV import is able to oncatenate many attributes in "comment" or "payee" *New feature: CSV import is to import unknown attributes as properties *New feature: Export XML *New feature: "Search & Process" is able to search on properties values *New feature: "Search & Process" is able to update, insert and delete properties (prop='' to delete it) *New feature: All currencies are now available in unit page (Thanks to KCurrencyCode) *New feature: Properties are displayed on tooltips *New feature: Open property picture associated to an object -- Stephane MANKOWSKI Mon, 10 May 2010 15:21:33 +0200 skrooge (0.7.0) *Correction bug 225855: Monthly Report: difference in percentage is wrong *Correction bug 225980: Share download not in primary currency : value not correct *Correction bug 226451: .skg file incorrectly identified as password-protected ==> New document icon to identify encrypted files *Correction bug 228808: Gnucash import: scheduled operation at 0 euros *Correction bug 228904: Gnucash import should not take into account recurrent operation containing loan formulas *Correction bug 230175: Sometimes report plugin resizes Skrooge over the screen size *Correction bug 232937: Search & Process : if a category has no operation yet, it doesn't appear in the possible categories for "update" *Correction wis 228901: Manage Liability accounts (loan, etc...) *Correction wis 197409: There's no way to define initial balance of non-OFX account *Correction wis 224933: A legend in the graphics *Correction wis 224042: Possibility to store several CSV import schemes ==> Implemented by regular expression in automatic mapping. *Correction wis 225818: Change skrooge desktop file description *Correction wis 226963: Export CSV of split operations *Correction wis 228170: Skrooge must be able to import skg file *Correction of forecast computation on scheduled operations *Correction of export of "Initial balance" for QIF and CSV *Correction of import of "Initial balance" for QIF and CSV *Correction of import of "Initial balance" for OFX *Correction: Better error message in case of repository of document is RO *Correction on confirmation message *Correction selection on graph (histogram and stack) *New feature: "Weighted moving average" in reports *New feature: Specific font and color for disabled schedule (nbtime = 0) *New feature: Addition of "First date" and "Last date" in trackers *New feature: Amortization table *New feature: import gnucash document *New feature: import kmymoney document *New feature: import skrooge document (can be used to merge documents) *New feature: import grisbi document *New feature: import homebank document *New feature: export kmymoney document *New feature: export skrooge document (without history) *New feature: possible to create a bookmark even when a bookmark is already selected *New feature: button to clean history (reduce the size of the file) *New feature: all settings in only one file. WARNING: check your settings. *New feature: generic modeler is ready to be used by other applications. *New feature: "5 main variations" in monthly report. *New feature: New key accelerator to enable editor of current page -- Stephane MANKOWSKI Mon, 05 Apr 2010 20:00:00 +0200 skrooge (0.6.0) *Correction wis 215668: Dashboard is too big to be a real dashboard *Correction bug 216520: Incorrect import of a transfer when inside a splitted operation (a splitted operation can not be a transfer) *Correction bug 217896: UK Currency and Date formats displayed for Scheduled Transactions in Dashboard *Correction bug 217743: Configuring Banks and Accounts Section (Bank name update issue) *Correction bug 219791: No progress bar during export QIF *Correction bug 219750: Delete key in split table remove the full line *Correction bug 214508: Provide a balance evolution graph *Correction wis 220659: Option to "Apply rules on to imported operations" automatically after an import *Correction cra 220936: Crash on double click on bookmarks *Correction cra 222340: Freezes after some time *Correction bug 222339: CVS import: problem with decimal point and comma *Correction wis 220663: Selected operations must still visible after a sort modification *Correction wis 223848: make libofx an optional dependency *Correction wis 224676: keyboard shortcut for modify and add operation *Correction wis 209314: key scrolling does not work, and click on a line has odd behaviour *Correction bug 224932: Graphic Report SVG export bug + wish on a legend *Possible to define favorite account *Possible to define favorite search *New gui for search and process *Delete icon on each suboperation line *Compatibility with bespin theme *Do not collapse tree after editing one of its items *More options in "Report" page *New function to delete unused categories *Selection in pages list is now synchronized with current page *New option in contextual menu of report to hide bottom tool bar *Edition of splitted operations by single click *Clean button in operation table is renamed "Clear form" *Better export QIF for investment *Better display on reports (average, min and max are displayed if only one curve is drawn) *Better display on reports (linear regression is displayed if only one curve is drawn) *Option to show/hide average and limits in graph *Selection of year for interets computation *Correction in sum of operation computation when suboperations are selected *Graph proportion adapted to view size *"Account position" is replaced by "Ending balance" *Avoid cpu loop when double click on operation fields on KDE 4.4 *Completion based on substrings *Better import of QIF files when both side of the import do not have exactly the same date *Correction on update category and tracker for transfers *Completion on comments -- Stephane MANKOWSKI Sat, 06 Feb 2010 09:00:00 +0100 skrooge (0.5.5) *Disable some functions on sub-operations *Correction on update of a splitted operation by a split returned by Fast Edition *Correction bug 215995: SQL Error when attempting to display a report in history mode *Correction bug 215754: Invest account is incorrectly imported as current account *Correction bug 214809: Incorrect import of a transfer *Correction bug 214851: Incorrect import of 'investment account' QIF file *Correction bug 216348: Account filters synchronisation problem in the operation HMI *Correction bug 216522: Incorrect import of transfer (twice imported) *Correction bug 216551: Click in blank area make 'date' widget to extend its size *Correction bug 216514: Incorrect import of QIF file when account names are similar *Correction bug 216520: Incorrect import of a transfer when inside a splitted operation (transfer of suboperation is not supported) *Correction crash 215992: Skrooge crash when clicking on "rapport" menu *Correction regression on "Open report" (P0) *Invertion of colors in report (more saturation for new operations) -- Stephane MANKOWSKI Sun, 29 Nov 2009 15:00:00 +0100 skrooge (0.5.4) *Correction bug 211579: Irregular percent value in monthly report amounts in accounts *Correction bug 212313: Can not update a lot of operations *Correction bug 211029: Skrooge should have an better account evolution graphic *Correction bug 213783: Account balance computation is inaccurate *Correction bug 214045: Import CSV date format problem *Correction bug 214097: Can not search on multiple criteria. (OR is not supported) *Correction bug 214157: Impossible to import an ofx file from a directory containing special characters *Correction bug 214462: Does not use primary currency unit when importing, and does not warn on import of splitted operation with multiple currencies *Correction bug 214447: Auto save the open document at closing *Correction bug 214794: Incorrect report of warning when importing QIF file *Correction bug 214809: Incorrect import of a transfer *Correction bug 214849: CSV export from grid is not correct *Correction bug 214904: Can not download a stock/share quotation *Correction bug 214851: Incorrect import of 'investment account' QIF file *Correction bug 215114: Button to customize dashboard *Correction bug 215620: Can not import QIF file with skrooge version SVN 1052520 *Correction bug 215656: History reports are wrong if first date is not selected *Correction bug 215658: Some editors are modified when a bookmark is created *Correction on double click of a template of transfer *Update of both side of a transfer is now possible *Only one fast edition. User is be able to lock some fields before. *Interest can be computed with 360 and 365/366 days method *New splashscreen size *New graph gui with "Quarters", "Semesters", "Weeks" and "Days" *Zoom with CTRL+wheel on graph *Dashboard is automatically launched when a new document is created *Use of graph component in unit page *New button to clean editor in operations page *Correction on scheduled transfers *New report widget for dashboard (all reports can be added to dashboard) *Addition of "Del" shortcut to delete suboperations in split panel *New tooltip on operation status *New function "Open sub operations" to display all sub operations. Useful to filter them. *New function to reconciliate an account from bank page *Better QIF import/export of account type -- Stephane MANKOWSKI Mon, 23 Nov 2009 14:00:00 +0100 skrooge (0.5.3) *Correction bug 209451: Display quantity of each unit *Correction bug 209457: Number of decimal for each unit must be different *Correction bug 209453: Impot must avoid double even when operations are not validated *Correction bug 209529: Unable to reconcile. Delta zero but "Validate checked operations" tick still grayed out *Correction bug 208939: "Search and process" does not work anymore *Correction bug 209610: Skrooge doesn not work if "Maximum undo depth" is 0 *Correction bug 209542: Automatic conversion of schedule *Correction bug 209672: Amount of indexes must be displayed without unit symbol *Correction bug 209705: Importing investments from csv doesn't import the dollar amount of shares purchased *Correction bug 209705: Find&Group is now able to detect share purchase/sale *Correction bug 209702: Need the ability to be able to manually group transfers *Correction bug 209914: executable bits set for skgalarmboardwidget.h *Correction bug 209905: currency import is broken *Correction bug 209912: rpmlint warnings after installation: unused-direct-shlib-dependency *Correction bug 209053: Savings account support request *Correction bug 210946: columns are always resized to content when opening operations tab *Save icon in tab bar to overwrite bookmarks or current context *New dashboard plugin for highlighted operations *New dashboard plugin for estimated interests *"Backward" & "Forward" navigation on pages *New unit "Swedish krona" *New command to open operations modified during last user action (useful after an import or a processing) -- Stephane MANKOWSKI Mon, 19 Oct 2009 12:00:00 +0200 skrooge (0.5.2) *Correction bug 207927: skrooge summary field uncomplete bank account name *Correction bug 208130: 'Import CSV Unit' menu puts data into the 'Operations' tab *Correction bug 208210: Multiple clause research/update in french *Correction bug 208194: Skrooge loose all data on file migration *Correction bug 208040: Error when entering shares information *Correction bug 208459: Skrooge crashes when changing tab *Correction bug 209317: key scrolling very long *Better performance in report by using QTimer *Better performance bank page by using QTimer *New SKGDateEdit with more features *Delivery of default categories and bookmarks for pt. Thanks Caio de Campos Ferreira. *Better performance when opening pages *Correction on monthly report for a better display with dark theme *New widget on dashboard for alarms *SKGDateEdit validation on lose focus *Automatic detection of CSV separator during import -- Stephane MANKOWSKI Sun, 04 Oct 2009 16:00:00 +0200 skrooge (0.5.1) *Correction bug 205471: Impossible to know how to check an operation *Correction bug 205466: Date missing in reports *Correction bug 193426: Ability to create from scratch a "recurrent operation" *Correction bug 203787: Balance should be displayed for each operation in the operation context. Correction done: balance is displayed on tooltip because it is better for performances than in column. *Correction bug 206894: Crash second import CSV *Correction bug 206459: "Search & process" must be able to do complex update *Correction bug 199539: Dashboard must be customisable *Correction bug 207249: rpmlint error: debuginfo-without-sources (including a fix) *Correction bug 207246: rpmlint warning shared-lib-calls-exit /usr/lib64/libskgbasemodeler.so.0.5.0 exit@GLIBC_2.2.5 (for fedora packaging) *Correction bug 207232: skrooge must use kfilterproxysearchline *Correction bug 207274: "Fast edit" behavior must be modifiable by settings *Correction bug 191966: Treeviews collapsed when updated *Correction bug 207672: Align amount values on the right for cleaner views *Correction bug 207713: Display some information after applying a process *Correction bug 200790: Search creation doesn't take not validate predicate *New function to create template of operations *New function to schedule templates *New function to create template from existing operations *Double click on template creates the operation *New shortcut for import *Attribute to define the maximum number of occurrence for scheduled operations *Attribute to define the last occurrence date *A setting allows to create automatically a template when an operation is scheduled *Selection is done on duplicated object after a "Duplicate" *Selection is done on created template after a "Create template" *Correction message in history when an object is deleted *Download button always visible on unit plugin *Infinite symbol when number of occurrences is not checked *Addition of "Custom..." on graph dates *New spash screen *New function to overwrite bookmarks after a modification *Filter capability on "search & process" table *Editors are no more clean when the selection is empty. A second click is needed -- Stephane MANKOWSKI Sun, 20 Sep 2009 00:00:00 +0200 skrooge (0.5.0) *Correction bug 201316: import qif extra tag support *Correction bug 201157: Graphs no longer displayed *Correction bug 201289: Compiler error on GCC 4.1.2 (enum with KDE_EXPORT or similar macro) *Correction bug 201451: qif import other liability account type *Correction bug 201697: Pointed operation can be deleted *Correction bug 201800: Filter issue with number formatting *Correction bug 202167: Payee list should be ordered in a case insensitive way *Correction bug 202341: Combobox lists are not sorted in a locale-aware way *Correction bug 202384: Skrooge always wants to update report bookmarks on exit *Correction bug 202636: Hidden columns are sometimes displayed *Correction bug 203894: Skrooge crashes when launched with --nofork *Correction activation of "Values" button in "Units" page *New password is no more displayed when changed *New function to merge an imported operation with an operation manually entered *New refund icon *New widget for dashboard "Shares and indexes" *Modification titles on "operation" pages to differentiate "operations" and "sub operations" *"sub operations" can be identified by a specific font and color (see settings) *Correction bug: Created search is not selected after creation *Correction performance issue on zoom when antialiasing is enable *Addition of 5 main categories of expenditure in monthly reports *Rename "Bookmark" for operation by "Highlight" *Rename "Trait" by "Process" *Set minimum size for amounts fields *Only one "Import..." command for all supported format. *Support of QFX import *New settings for import CSV *Dashboard is now clickable *Dashboard is modifiable (see contextual menu on each widget) and state can be saved *Addition of "Fast edition" without amount modification. It is useful to modify imported operations *Only one instance of skrooge can be launched. *Imports can be done in command line. Example "skrooge myfile.ofx" with skrooge running *If an invalid expression is entered for the amount, the field is written in red, and the expression is kept to allow correction from the user (previously, 0 was displayed). *"New tab" is now managed by Ctrl+Shift+T *Popup to ask if you want to save current state of pages. *Bookmark storage is no more dependant of language translation -- Stephane MANKOWSKI Fri, 28 Aug 2009 21:00:00 +0200 skrooge (0.3.0) *Correction bug 191970: Attach receipts (images) to transactions *Addition of "Trackers" for lines in report *Correction bug 195254: Do not allow to link operations to a closed tracker *Correction bug 195026: A setting must allow to clean history when the application is [saved] *Correction bug 194826: End user must be to validate an import *Correction bug 196444: Can not validate reconciliation (delta = -0.00) *Correction bug 196745: Categories are not added to a split operation *Correction bug 197287: Add backup file management *Correction bug 197288: Manage working document copy *Correction bug 197835: Reconciliation mode : currency problem *Correction bug 198077: Comments do not appear in every Operations windows *Correction bug 198583: foreign currency accounts should display in their native currency in dashboard. *Correction bug 198786: Categories are not easily read *Correction bug 199196: build error in skgbankgui *Correction bug 199543: Splash screen display must be defined by settings *After an import, skrooge is able to execute some rules to clean imported operations *Correction in dashboard *Addition of "Reset state" on tabs to reset default state of plugins *Most important category and refund are displayed for split operations *Display detail of selected operations in information area of "operation" page *Main tab position can be selected in settings -- Stephane MANKOWSKI Sat, 11 Jul 2009 16:00:00 +0200 skrooge (0.2.9) *Correction bug 2787146: Single click on bookmarks *Correction bug 191972: Selection is not well kept *Correction bug 191975: Add Labels for X values in histograms and stack reports *Correction bug 191968: Information string on top of page is too long (no word wrap) *Correction bug 192687: fonts too large on report *Correction bug 192832: Do not take amount sign into account for transfers *Correction bug 191967: Skrooge must be able to display an history global and for each account. *Correction bug 193423: context list scrolls down only after 8 mouse molette rotation *Correction bug 193431: "recurrent operation" trigger can not be set on D day *Correction bug 193421: bugs to be registered via bug database (not email) *Correction bug 194650: Fast edit must work on Tracker attribute *Correction bug 194765: Number of operations by account must be displayed in bank plugin *Addition of bank icon on account combo boxes *Addition of Canadian dollar *Addition of one more view (based on selection) in operation plugin *Better managment of dependency between units *New settings on unit download *Skrooge tries to find the most adapted account during import file without account information inside *Update of nls part of data model when language is changed *"Open report" on an element of a report open a new report with exactly same settings than first one *Addition of "scheduled operations" in dashboard plugin *New operation editor *Better management of messages in status bar *New editor in unit plugin *Middle click is able to open new page from context or bookmarks -- Stephane MANKOWSKI Sun, 31 May 2009 23:00:00 +0200 skrooge (0.2.8) *Correction bug 2782399 :Skrooge must create a backup file *Correction bug 2783111 :Typo *Correction bug 2515571 :New plugin to follow refunds *Correction bug 2785938 :Single click *Correction bug 2786183 :Load standard categories? *Correction bug 2682777 :Label are not well placed *Correction bug 2579926 :Improve category plugin performances *Correction bug 2665265 :Edit names directly in treeview *Correction for amount comparison in validation mode *Correction import ofx when bankid is empty in ofx file *Correction mime type for KDE4 *Better performances on open document with password required -- Stephane MANKOWSKI Mon, 04 May 2009 15:00:00 +0200 skrooge (0.2.7) *Correction bug 2513827 :global print function *Correction bug 2692667 :Automatic icon resize is driven by bookmarks only *Correction bug 2714592 :Skrooge must be able to manage properties on all objects *Correction bug 2733958 :Auto hide *Correction bug 2747379 :Only allow to "pre-check" operations *Correction bug 2750464 :Impossible to update the date of a split operation *Correction bug 2778333 :Enhance hidden panels discoverability *Correction bug 2777697 :bookmark modifications are not kept when closing skrooge *Old method to split an operation is no more available *"Undo document" is no more in toolbar by default *Remove useless icons from tool bar *When "Save" is clicked in a new document, automatically interpret it as "Save as" *New menu with shortcuts to open pages *Better automatic linear scale in reports -- Stephane MANKOWSKI Mon, 27 Apr 2009 15:00:00 +0200 skrooge (0.2.6) *Correction bug 2692651 :antialias on graphs *Correction bug 2692665 :Wrong currency label in stock tab *Correction bug 2692605 :Title of a report for a selection contains only ",,,," *Correction bug 2692648 :New dialog box on exit *Correction bug 2692664 :add support for split & grouped operations in fast edition *Correction bug 2692656 :More details on recurrent operations view *Correction bug 2645610 :Bad performance on "find transfers" *Correction bug 2692681 :Reconciliate mode in operations view *Correction bug 2706987 :no report generated *Correction bug 2716734 :Better category & unit creation during operation creation *Correction bug 2720760 :Popup messages are displayed twice -- Stephane MANKOWSKI Sun, 29 Mar 2009 20:00:00 +0200 skrooge (0.2.5) *Correction bug 2664613 :Not possible to show a column without reseting all *Correction bug 2633375 :2 columns for quantity *Correction bug 2674862 :Bad performances on undo/redo for categories *Correction bug 2675606 :Bookmark reorder doesn't work *Correction bug 2685241 :Add postive sign in amount field for positive operations *Correction bug 2685236 :Option to ask again if modified bookmark should be saved *Correction bug 2685270 :Impossible to modify comment on operation and sub operations *Correction bug 2687115 :filter value is not save whan bookmark a report *Correction bug 2685335 :Pie like in firelight *Debug plugin is able to do a "EXPLAIN QUERY PLAN" *Path for bash is not more hardcoded in script for BSD compatibily -- Stephane MANKOWSKI Mon, 16 Mar 2009 14:00:00 +0100 skrooge (0.2.4) *Correction bug 2608762 :Cannot create a bookmark folder if no bookmark exist yet *Correction bug 2633444 :Add "import std categories" in import menu *Correction bug 2638120 :Unable to import cvs or qif from "la banque postale (fr) *Correction bug 2564982 :Creation of default bookmark *Correction bug 2640959 :Impossible to import OFX file -- Stephane MANKOWSKI Mon, 02 Mar 2009 20:00:00 +0100 skrooge (0.2.3) *Correction bug 2608762 :Creation of category branch in one shoot *Correction bug 2608768 :Crash in category creation *Correction bug 2586878 :skrooge crashes if category too deep *Correction bug 2446175 :better split operations *Correction bug :sum column always displays 0 in category page *Addition of comment on suboperations *Better performances to compute next values for operation numbers *Icon in system tray *"export SKGTRACESQL=xxx" is able to trace all sql order taking more than xxx ms -- Stephane MANKOWSKI Mon, 23 Feb 2009 21:51:12 +0100 skrooge (0.2.2) *Correction bug 2556346 :README should list kdesdk-scripts as buildtime dependency *Correction bug 2556406 :Pound sterling missing in currency list, difficult to add *Correction bug 2556340 :CMakeLists should use correct libraries and check for Sqlite (Thank you lindevel for the patch) *Correction bug 2555861 :"make package_source" contains too many files *Correction bug 2557366 :Wrong password *Correction bug 2556381 :Impossible to change negative quantities into positive ones? *Correction bug 2530932 :Better autostart bookmarks management -- Stephane MANKOWSKI Wed, 11 Feb 2009 21:51:12 +0100 skrooge (0.2.1) *Correction bug 2517386 :Move of category is not done *Correction bug 2519334 :Smooth scolling in category view *Correction bug 2517388 :Selection must be set on created operation *Correction bug 2519847 :Duplicate operation *Correction bug 2520516 :Security of skg file *Correction bug 2545021 :compilation fails because po/listFiles.sh is not executable *Correction bug 2549911 :Import standard categories *Correction bug 2526148 :Double click on graph in report *Correction bug 2520530 :KToolBarPopupAction for undo/redo *Addition of icon for stocks *Bookmark can be deleted from contextual menu *Icons are resized relative to list width -- Stephane MANKOWSKI Sun, 01 Feb 2009 20:00:00 +0100 skrooge (0.2.0) *Correction bug 2489823 :automatically remember changes on columns for bookmarks *Correction bug 2487934 :Specific Column for "scheduled" icon *Correction bug 2487866 :deselect lines in table views *Correction bug 2487981 :add a column for total of operations including subcategories *Monthly report is now base on QWebView and contain google graph *Addition of exports in report tables (TXT, CSV) *Report can be opened from bank, operation or unit page *Report can be opened from report *Better graph *Addition of print *Long transaction can be interrupted *Better warning message with history -- Stephane MANKOWSKI Mon, 19 Jan 2009 20:00:00 +0100 skrooge (0.1.9) *Better contextual menu on tables *New feature in monthly report *Better performances for monthy report generation *Better graphics in report plugin *Addition of exports in all tables *Addition of exports in report graphs (PDF, SVG, picture) -- Stephane MANKOWSKI Sat, 03 Jan 2009 20:00:00 +0100 skrooge (0.1.8) *Correction bug 2299303 :Calcul de balance erroné *Correction bug 2446162 :Distinction for future operations *Correction bug 2446184 :Reduce spacing between rows *Correction bug 2256687 :No more icon in application menu *Correction crach in qtdesigner due to SKGTableView *Addition "open bookmarks" to display all bookmarked operations *Addition of sale of stocks *Addition of "split of stock" -- Stephane MANKOWSKI Tue, 22 Dec 2009 20:00:00 +0100 skrooge (0.1.7) *Correction bug 2385144 :Unexpected display of unit in operations list *Correction bug 2390926 :Problem with Action/$/€ *Correction bug 2390747 :Operations transferred not found *Correction bug 2384834 :Multi-Selection and Ctrl-P does not work *Correction bug 2311993 :Difference between operation and valuation not done *Correction bug 2385059 :Possibility to remove (modify) buggy unit value *Correction bug: Inversion year(s) and day(s) in recurrent operations *Correction wrong mapping on all table when column are reordered *Correction request 2379612: categories edition & creation *Selection is now kept after modifications *New "Monthly report" plugin *Computation of RIB key *Addition contextual menu on all table *Addition contextual menu on tabs *Addition of short date in tooltip on fancy date *Addition of smooth scrolling in table views *Addition of indexes (CAC 40, NASDAQ, ...) in data model -- Stephane MANKOWSKI Tue, 15 Dec 2009 20:00:00 +0100 skrooge (0.1.6) *Support of import unit values in CSV format like: date;value 01/01/2008;50 03/03/2008;60 *Correction bug 2340201 :crash on QIF export *Correction bug in import if 2 operations with same attributes (date, amount, ...) *Correction concerning performance issue in all tables *Correction bug 2299354 :Ability to change and memorize column width *Columns can be switched in "auto resize" mode *Correction bug 2298982 :An account shall have a currency *Preferred table's organisation can be save as default *Better organisation of pies in report plugin -- Stephane MANKOWSKI Tue, 01 Dec 2009 20:00:00 +0100 skrooge (0.1.5) *Correction bug 2307068: Incorrect import of QIF file *Columns order is now saved in bookmark for operation, account, recurrent operations and unit plugins *Sort is now saved in bookmark for operation, account, recurrent operations and unit plugins *Correction bug 2327676: Many import QIF correction *Columns can be show or hidden (see contextual menu) and this state is saved in bookmarks *Better performances (x100) in report. *Correction bug 2316459: skrooge does not support out-of-source build *Correction bug 2298621: Unable to delete a "principal currency". ==> It is now possible to delete a unit except if this unit is already used by at least one operation *Correction bug 2326576: Field empty by default *Correction bug 2306914: "Tip of the day" dialog can not be removed -- Stephane MANKOWSKI Tue, 24 Nov 2009 20:00:00 +0100 skrooge (0.1.4) *New icons *Bookmarks folders are opened sorted and focus is set on the first one *Correction (inversion sign of operations) in transfer creation *Buy stock is now possible *Correction bug 2298773: Unit and amount are not aligned *Correction bug 2298674: Montant en EUR même si unité EUR n'existe pas *Correction bug 2298471: Unable to change type of a unit *Correction bug 2299384: File/Close closes the current page *Correction bug 2299524 *Correction bug 2299519: "Mode" should not be mandatory *Optimisation in open "operation" pages *Correction bug 2299600: Values of a unit are not sorted out *Correction bug 2299947: Unit can not be used if no symbol is defined ==> Symbol is now mandatory *Correction bug 2301337 *Correction bug 2300013:Une ventilation est une catégorie *Correction bug 2278703:Zoom fit when opening report tab *Comment on account *Tab name is now set with the name of the bookmark -- Stephane MANKOWSKI Tue, 17 Nov 2009 20:00:00 +0100 skrooge (0.1.3) *Vertical alignment in all views *Detection of the sign of an operation (during creation) based on category *Average in report *Sum column is now displayed only if more than one column is displayed in report plugin *Correction bug in report when sort is set on last column and the report is refreshed with less columns *Correction abend on delete *Modeler is now able to store messages on transaction. *Display messages by notification *Addition of recurrent operations (creation, update, delete, automatic insertion, warn, ...) *Correction in duplication of recurrent operations: Now, status, bookmark, importation id are not duplicated *Correction on optimisation of undo/redo transaction: optimisation removed :-) *Multi selection is supported by recurrent operations creation icon *Massive update on recurrent operation *Implementation enhancement 2272115 concerning calculator behavior *Correction update of split operations *Set default order in all tables *Sort bookmark by drag and drop -- Stephane MANKOWSKI Sat, 14 Nov 2009 20:00:00 +0100 skrooge (0.1.2) *Support of categories in QIF import *Support of csv file with empty lines *Support of categories in QIF export *Correction bug 2229770: automatic erase of duplicated operations *New design for operation and account plugin *Addition of first draft of recurrent operations -- Stephane MANKOWSKI Tue, 10 Nov 2009 20:00:00 +0100 skrooge (0.1.1) *Optimisation widget refresh after a huge QIF import *Optimisation performance of QIF export *Optimisation performance of CSV export *Optimisation performance of "find and Group transfers" *Addition of "Close", "Close All" and "Close All Other" to manage pages *Correction on download unit *Addition of the name of the file in the title of the man window *Addition of sort in report plugin -- Stephane MANKOWSKI Tue, 03 Nov 2009 20:00:00 +0100 skrooge (0.1.0) * QIF import/export * CSV import/export * Basic graphs * Several tabs to help you organize your work * Infinite undo/redo (even after the file was closed !) * Instant filtering on operations * Infinite levels of categories -- Stephane MANKOWSKI Mon, 02 Nov 2009 20:08:00 +0100 diff --git a/skgbankmodeler/skgdocumentbank.cpp b/skgbankmodeler/skgdocumentbank.cpp index 9d5360434..81a0466d8 100644 --- a/skgbankmodeler/skgdocumentbank.cpp +++ b/skgbankmodeler/skgdocumentbank.cpp @@ -1,3462 +1,3461 @@ /*************************************************************************** * Copyright (C) 2008 by S. MANKOWSKI / G. DE BURE support@mankowski.fr * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see * ***************************************************************************/ /** @file * This file implements classes SKGDocumentBank. * * @author Stephane MANKOWSKI / Guillaume DE BURE */ #include "skgdocumentbank.h" #include #include #include #include #include #include "skgaccountobject.h" #include "skgbankobject.h" #include "skgerror.h" #include "skgreportbank.h" #include "skgservices.h" #include "skgtraces.h" #include "skgtransactionmng.h" #include "skgunitobject.h" #include "skgunitvalueobject.h" SKGDocumentBank::SKGDocumentBank() : SKGDocument() { SKGTRACEINFUNC(10); connect(this, &SKGDocumentBank::tableModified, this, &SKGDocumentBank::refreshCache); QDBusConnection dbus = QDBusConnection::sessionBus(); dbus.registerObject(QStringLiteral("/skrooge/skgdocumentbank"), this, QDBusConnection::ExportAllContents); // Initialisation of not undoable tables SKGListNotUndoable.push_back(QStringLiteral("T.operationbalance")); SKGListNotUndoable.push_back(QStringLiteral("T.budgetsuboperation")); } SKGDocumentBank::~SKGDocumentBank() { SKGTRACEINFUNC(10); } SKGError SKGDocumentBank::computeBudgetSuboperationLinks() const { SKGError err; SKGTRACEINFUNCRC(5, err); // Remove computed values err = this->executeSqliteOrder(QStringLiteral("DELETE FROM budgetsuboperation")); // Compute values IFOKDO(err, executeSqliteOrder( "INSERT INTO budgetsuboperation (id, id_suboperation, i_priority) " // Garbage collector annualy "SELECT b.id, s.id, 6.0 FROM budget b, operation o, suboperation s WHERE +s.rd_operation_id=o.id AND b.rc_category_id=0 AND b.i_month=0 AND b.i_year=STRFTIME('%Y', IFNULL(s.d_date, o.d_date))" // Garbage collectory monthly " UNION SELECT b.id, s.id, 5.0 FROM budget b, operation o, suboperation s WHERE +s.rd_operation_id=o.id AND b.rc_category_id=0 AND b.i_month<>0 AND b.i_year=STRFTIME('%Y', IFNULL(s.d_date, o.d_date)) AND b.i_month=STRFTIME('%m', IFNULL(s.d_date, o.d_date))" // Garbage categories annualy " UNION SELECT b.id, s.id, 4.0 - (LENGTH(c2.t_fullname)-LENGTH(REPLACE(c2.t_fullname, '" % OBJECTSEPARATOR % "', '')))/(100.0*LENGTH('" % OBJECTSEPARATOR % "')) FROM budget b, operation o, v_suboperation_display s, category c2 WHERE +s.rd_operation_id=o.id AND b.rc_category_id<>0 AND b.i_month=0 AND b.i_year=STRFTIME('%Y', IFNULL(s.d_date, o.d_date)) AND b.t_including_subcategories='Y' AND s.t_CATEGORY LIKE c2.t_fullname||'" % OBJECTSEPARATOR % "%' AND c2.id=b.rc_category_id" // Garbage categories monthly " UNION SELECT b.id, s.id, 3.0 - (LENGTH(c2.t_fullname)-LENGTH(REPLACE(c2.t_fullname, '" % OBJECTSEPARATOR % "', '')))/(100.0*LENGTH('" % OBJECTSEPARATOR % "')) FROM budget b, operation o, v_suboperation_display s, category c2 WHERE +s.rd_operation_id=o.id AND b.rc_category_id<>0 AND b.i_month<>0 AND b.i_year=STRFTIME('%Y', IFNULL(s.d_date, o.d_date)) AND b.i_month=STRFTIME('%m', IFNULL(s.d_date, o.d_date)) AND b.t_including_subcategories='Y' AND s.t_CATEGORY LIKE c2.t_fullname||'" % OBJECTSEPARATOR % "%' AND c2.id=b.rc_category_id" // Strict category annualy " UNION SELECT b.id, s.id, 2.0 FROM budget b, operation o, v_suboperation_display s WHERE +s.rd_operation_id=o.id AND b.rc_category_id<>0 AND b.i_month=0 AND b.i_year=STRFTIME('%Y', IFNULL(s.d_date, o.d_date)) AND b.rc_category_id=s.r_category_id" // Strict category monthly " UNION SELECT b.id, s.id, 1.0 FROM budget b, operation o, v_suboperation_display s WHERE +s.rd_operation_id=o.id AND b.rc_category_id<>0 AND b.i_month<>0 AND b.i_year=STRFTIME('%Y', IFNULL(s.d_date, o.d_date)) AND b.i_month=STRFTIME('%m', IFNULL(s.d_date, o.d_date)) AND +b.rc_category_id=s.r_category_id")); // Remove useless values IFOKDO(err, executeSqliteOrder(QStringLiteral("DELETE FROM budgetsuboperation WHERE EXISTS (SELECT 1 FROM budgetsuboperation b2 WHERE b2.id_suboperation=budgetsuboperation.id_suboperation AND b2.i_priorityexecuteSqliteOrder(QStringLiteral("DELETE FROM operationbalance")); if (m_computeBalances) { SKGStringListList result; IFOKDO(err, executeSelectSqliteOrder(QStringLiteral("SELECT id, rd_account_id, f_CURRENTAMOUNT, f_QUANTITY FROM v_operation WHERE t_template='N' ORDER BY rd_account_id, d_date, id"), result)) int nb = result.count(); double sum = 0; double sum2 = 0; int currentAccount = 0; QStringList items; for (int i = 1; !err && i < nb; ++i) { // Ignore header const QStringList& line = result.at(i); const QString& idOp = line.at(0); int account = SKGServices::stringToInt(line.at(1)); double val = SKGServices::stringToDouble(line.at(2)); double val2 = SKGServices::stringToDouble(line.at(3)); if (account != currentAccount) { sum = 0; sum2 = 0; currentAccount = account; } sum += val; sum2 += val2; items.push_back(idOp % "," % SKGServices::doubleToString(sum) % "," % SKGServices::doubleToString(sum2)); if (items.count() == 490) { err = this->executeSqliteOrder("INSERT INTO operationbalance (r_operation_id,f_balance,f_balance_entered) " "SELECT " % items.join(QStringLiteral(" UNION SELECT "))); items.clear(); } } if (!err && !items.isEmpty()) { err = this->executeSqliteOrder("INSERT INTO operationbalance (r_operation_id,f_balance,f_balance_entered) " "SELECT " % items.join(QStringLiteral(" UNION SELECT "))); } } return err; } SKGError SKGDocumentBank::endTransaction(bool succeedded) { SKGError err; if (succeedded && getDepthTransaction() == 1) { if (getCachedValue(QStringLiteral("SKG_REFRESH_VIEW")) == QStringLiteral("Y")) { QStringList listModifiedTables; err = this->getDistinctValues(QStringLiteral("doctransactionitem"), QStringLiteral("t_object_table"), QStringLiteral("rd_doctransaction_id=0"), listModifiedTables); if (!err && (listModifiedTables.contains(QStringLiteral("operation")) || listModifiedTables.contains(QStringLiteral("suboperation")) || listModifiedTables.contains(QStringLiteral("unit")) || listModifiedTables.contains(QStringLiteral("unitvalue"))) ) { // Computation of cache err = computeBalances(); } if (!err && (listModifiedTables.contains(QStringLiteral("operation")) || listModifiedTables.contains(QStringLiteral("suboperation")) || listModifiedTables.contains(QStringLiteral("unit")) || listModifiedTables.contains(QStringLiteral("unitvalue")) || listModifiedTables.contains(QStringLiteral("category")) || listModifiedTables.contains(QStringLiteral("budget"))) ) { // Computation of cache err = computeBudgetSuboperationLinks(); } } // Clean main variations cache m_5mainVariations_cache.clear(); m_5mainVariationsCat_cache.clear(); m_5mainVariations_inputs = QLatin1String(""); } SKGError err2 = SKGDocument::endTransaction(succeedded); if (!err && err2) { err = err2; } return err; } QString SKGDocumentBank::getViewsIndexesAndTriggersVersion() const { return "2019.02.16_2_" % getParameter(QStringLiteral("SKG_LANGUAGE")); } SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers(bool iForce) const { SKGError err; SKGTRACEINFUNCRC(5, err); QString version = getParameter(QStringLiteral("SKG_DB_BANK_VIEWS_VERSION")); if (!iForce && version == getViewsIndexesAndTriggersVersion()) { return err; } err = setParameter(QStringLiteral("SKG_DB_BANK_VIEWS_VERSION"), getViewsIndexesAndTriggersVersion()); QString dateFormatShort = QLocale::system().dateFormat(QLocale::ShortFormat); int firstDayOfWeek = QLocale::system().firstDayOfWeek(); // WARNING: Do not forget to update getViewVersion when this method is modified /** * This constant is used to initialized the data model (trigger creation) * IF YOU MODIFY THIS METHOD, DO NOT FORGET TO MODIFY getViewsIndexesAndTriggersVersion TOO */ QStringList BankInitialDataModelTrigger; BankInitialDataModelTrigger << DELETECASCADEPARAMETER("bank") << DELETECASCADEPARAMETER("account") << DELETECASCADEPARAMETER("unit") << DELETECASCADEPARAMETER("unitvalue") << DELETECASCADEPARAMETER("category") << DELETECASCADEPARAMETER("operation") << DELETECASCADEPARAMETER("interest") << DELETECASCADEPARAMETER("suboperation") << DELETECASCADEPARAMETER("refund") << DELETECASCADEPARAMETER("payee") << DELETECASCADEPARAMETER("recurrentoperation") << DELETECASCADEPARAMETER("rule") << DELETECASCADEPARAMETER("budget") << DELETECASCADEPARAMETER("budgetrule") // Compute fullname << QStringLiteral("DROP TRIGGER IF EXISTS cpt_category_fullname3") /* << "CREATE TRIGGER cpt_category_fullname1 " // This trigger must be the first "AFTER UPDATE OF t_fullname ON category BEGIN " "UPDATE category SET t_name=t_name WHERE rd_category_id=new.id;" "END"*/ << QStringLiteral("DROP TRIGGER IF EXISTS cpt_category_fullname1") << "CREATE TRIGGER cpt_category_fullname1 " "AFTER INSERT ON category BEGIN " "UPDATE category SET t_fullname=" "CASE WHEN rd_category_id IS NULL OR rd_category_id='' OR rd_category_id=0 THEN new.t_name ELSE (SELECT c.t_fullname FROM category c WHERE c.id=new.rd_category_id)||'" % OBJECTSEPARATOR % "'||new.t_name END " "WHERE id=new.id;" "END" << QStringLiteral("DROP TRIGGER IF EXISTS cpt_category_fullname2") << "CREATE TRIGGER cpt_category_fullname2 " "AFTER UPDATE OF t_name, rd_category_id ON category BEGIN " "UPDATE category SET t_fullname=" "CASE WHEN rd_category_id IS NULL OR rd_category_id='' OR rd_category_id=0 THEN new.t_name ELSE (SELECT c.t_fullname FROM category c WHERE c.id=new.rd_category_id)||'" % OBJECTSEPARATOR % "'||new.t_name END " "WHERE id=new.id;" "UPDATE category SET t_name=t_name WHERE rd_category_id=new.id;" "END" // -- Reparent suboperation on parent category when a category is removed << QStringLiteral("DROP TRIGGER IF EXISTS fkdc_category_delete") << "CREATE TRIGGER fkdc_category_delete " "BEFORE DELETE ON category " "FOR EACH ROW BEGIN " " UPDATE suboperation SET r_category_id=OLD.rd_category_id WHERE r_category_id IN (SELECT c.id FROM category c WHERE c.id=OLD.id OR c.t_fullname LIKE OLD.t_fullname||'" % OBJECTSEPARATOR % "%'); " " UPDATE payee SET r_category_id=0 WHERE r_category_id IN (SELECT c.id FROM category c WHERE c.id=OLD.id OR c.t_fullname LIKE OLD.t_fullname||'" % OBJECTSEPARATOR % "%'); " "END " << QStringLiteral("DROP TRIGGER IF EXISTS fkdc_category_parent_id_category_id") // Trigger for update on view << QStringLiteral("DROP TRIGGER IF EXISTS trgu_v_operation_prop_i_tmp") << QStringLiteral("CREATE TRIGGER trgu_v_operation_prop_i_tmp " "INSTEAD OF UPDATE OF i_tmp ON v_operation_prop " "FOR EACH ROW BEGIN " " UPDATE suboperation SET i_tmp=NEW.i_tmp WHERE id=OLD.i_SUBOPID; " " UPDATE operation SET i_tmp=NEW.i_tmp WHERE id=OLD.i_OPID; " " UPDATE parameters SET i_tmp=NEW.i_tmp WHERE id=OLD.i_PROPPID; " "END ") << QStringLiteral("DROP TRIGGER IF EXISTS trgu_v_operation_prop_t_realcomment") << QStringLiteral("CREATE TRIGGER trgu_v_operation_prop_t_realcomment " "INSTEAD OF UPDATE OF t_REALCOMMENT ON v_operation_prop " "FOR EACH ROW BEGIN " " UPDATE suboperation SET t_comment=NEW.t_REALCOMMENT WHERE id=OLD.i_SUBOPID; " "END ") << QStringLiteral("DROP TRIGGER IF EXISTS trgu_v_operation_prop_t_unit") << QStringLiteral("CREATE TRIGGER trgu_v_operation_prop_t_unit " "INSTEAD OF UPDATE OF t_UNIT ON v_operation_prop " "FOR EACH ROW BEGIN " " INSERT OR IGNORE INTO unit (t_name, t_symbol) VALUES (NEW.t_UNIT, NEW.t_UNIT); " " UPDATE operation set rc_unit_id=(SELECT id FROM unit WHERE t_name=NEW.t_UNIT) WHERE id=OLD.i_OPID; " "END ") << QStringLiteral("DROP TRIGGER IF EXISTS trgu_v_operation_prop_t_account") << QStringLiteral("CREATE TRIGGER trgu_v_operation_prop_t_account " "INSTEAD OF UPDATE OF t_ACCOUNT ON v_operation_prop " "FOR EACH ROW BEGIN " " INSERT OR IGNORE INTO account (t_name, rd_bank_id) VALUES (NEW.t_ACCOUNT, (SELECT MIN(id) FROM bank)); " " UPDATE operation set rd_account_id=(SELECT id FROM account WHERE t_name=NEW.t_ACCOUNT) WHERE id=OLD.i_OPID; " "END ") << QStringLiteral("DROP TRIGGER IF EXISTS trgu_v_operation_prop_t_payee") << QStringLiteral("CREATE TRIGGER trgu_v_operation_prop_t_payee " "INSTEAD OF UPDATE OF t_PAYEE ON v_operation_prop " "FOR EACH ROW BEGIN " " INSERT OR IGNORE INTO payee (t_name) VALUES (NEW.t_PAYEE); " " UPDATE operation set r_payee_id=(SELECT id FROM payee WHERE t_name=NEW.t_PAYEE) WHERE id=OLD.i_OPID; " "END ") << QStringLiteral("DROP TRIGGER IF EXISTS trgu_v_operation_prop_t_realrefund") << QStringLiteral("CREATE TRIGGER trgu_v_operation_prop_t_realrefund " "INSTEAD OF UPDATE OF t_REALREFUND ON v_operation_prop " "FOR EACH ROW BEGIN " " INSERT OR IGNORE INTO refund (t_name) VALUES (NEW.t_REALREFUND); " " UPDATE suboperation set r_refund_id=(SELECT id FROM refund WHERE t_name=NEW.t_REALREFUND) WHERE id=OLD.i_SUBOPID; " "END ") << QStringLiteral("DROP TRIGGER IF EXISTS trgu_v_operation_prop_d_dateop") << QStringLiteral("CREATE TRIGGER trgu_v_operation_prop_d_dateop " "INSTEAD OF UPDATE OF d_DATEOP ON v_operation_prop " "FOR EACH ROW BEGIN " " UPDATE suboperation set d_date=date(d_date, '+'||(julianday(NEW.d_DATEOP)-julianday(old.d_DATEOP))||' days') WHERE id=OLD.i_SUBOPID; " " UPDATE operation set d_date=NEW.d_DATEOP WHERE id=OLD.i_OPID; " "END "); // Build triggers for normal attribute SKGServices::SKGAttributesList attributes; getAttributesDescription(QStringLiteral("operation"), attributes); int nb = attributes.count(); for (int i = 0; i < nb; ++i) { QString att = attributes.at(i).name; if (att == att.toLower() && att != QStringLiteral("i_tmp")) { BankInitialDataModelTrigger << QStringLiteral("DROP TRIGGER IF EXISTS trgu_v_operation_prop_") % att << "CREATE TRIGGER trgu_v_operation_prop_" % att % " " "INSTEAD OF UPDATE OF " % att % " ON v_operation_prop " "FOR EACH ROW BEGIN " " UPDATE operation SET " % att % "=NEW." % att % " WHERE id=OLD.i_OPID; " "END "; } } /** * This constant is used to initialized the data model (index creation) */ QStringList BankInitialDataModelIndex; BankInitialDataModelIndex << QStringLiteral("CREATE UNIQUE INDEX uidx_unit_name ON unit(t_name)") << QStringLiteral("CREATE UNIQUE INDEX uidx_unit_symbol ON unit(t_symbol)") << QStringLiteral("CREATE INDEX idx_unit_unit_id ON unitvalue(rd_unit_id)") << QStringLiteral("CREATE UNIQUE INDEX uidx_unitvalue ON unitvalue(d_date,rd_unit_id)") << QStringLiteral("CREATE UNIQUE INDEX uidx_unitvalue2 ON unitvalue(rd_unit_id, d_date)") << QStringLiteral("CREATE UNIQUE INDEX uidx_bank_name ON bank(t_name)") << QStringLiteral("CREATE UNIQUE INDEX uidx_account_name ON account(t_name)") << QStringLiteral("CREATE INDEX idx_account_bank_id ON account(rd_bank_id)") << QStringLiteral("CREATE INDEX idx_account_type ON account(t_type)") << QStringLiteral("CREATE INDEX idx_category_category_id ON category(rd_category_id)") << QStringLiteral("CREATE INDEX idx_category_t_fullname ON category(t_fullname)") << QStringLiteral("CREATE INDEX idx_category_close ON category(t_close)") << QStringLiteral("CREATE UNIQUE INDEX uidx_category_parent_id_name ON category(t_name,rd_category_id)") << QStringLiteral("CREATE INDEX idx_operation_tmp1_found_transfert ON operation (rc_unit_id, d_date)") << QStringLiteral("CREATE INDEX idx_operation_grouped_operation_id ON operation (i_group_id)") // << "CREATE INDEX idx_operation_t_mode ON operation (t_mode)" // << "CREATE INDEX idx_operation_t_payee ON operation (t_payee)" << QStringLiteral("CREATE INDEX idx_operation_t_number ON operation (t_number)") << QStringLiteral("CREATE INDEX idx_operation_i_tmp ON operation (i_tmp)") << QStringLiteral("CREATE INDEX idx_operation_rd_account_id ON operation (rd_account_id)") << QStringLiteral("CREATE INDEX idx_operation_rd_account_id_t_imported ON operation (rd_account_id, t_imported)") << QStringLiteral("CREATE INDEX idx_operation_rd_account_id_t_number ON operation (rd_account_id, t_number)") << QStringLiteral("CREATE INDEX idx_operation_rc_unit_id ON operation (rc_unit_id)") << QStringLiteral("CREATE INDEX idx_operation_t_status ON operation (t_status)") << QStringLiteral("CREATE INDEX idx_operation_t_import_id ON operation (t_import_id)") << QStringLiteral("CREATE INDEX idx_operation_d_date ON operation (d_date)") << QStringLiteral("CREATE INDEX idx_operation_t_template ON operation (t_template)") << QStringLiteral("CREATE INDEX idx_operationbalance_operation_id ON operationbalance (r_operation_id)") << QStringLiteral("CREATE INDEX idx_suboperation_operation_id ON suboperation (rd_operation_id)") << QStringLiteral("CREATE INDEX idx_suboperation_i_tmp ON suboperation (i_tmp)") << QStringLiteral("CREATE INDEX idx_suboperation_category_id ON suboperation (r_category_id)") << QStringLiteral("CREATE INDEX idx_suboperation_refund_id_id ON suboperation (r_refund_id)") << QStringLiteral("CREATE INDEX idx_recurrentoperation_rd_operation_id ON recurrentoperation (rd_operation_id)") << QStringLiteral("CREATE UNIQUE INDEX uidx_refund_name ON refund(t_name)") << QStringLiteral("CREATE INDEX idx_refund_close ON refund(t_close)") << QStringLiteral("CREATE UNIQUE INDEX uidx_payee_name ON payee(t_name)") << QStringLiteral("CREATE INDEX idx_payee_close ON payee(t_close)") << QStringLiteral("CREATE INDEX idx_interest_account_id ON interest (rd_account_id)") << QStringLiteral("CREATE UNIQUE INDEX uidx_interest ON interest(d_date,rd_account_id)") << QStringLiteral("CREATE INDEX idx_rule_action_type ON rule(t_action_type)") << QStringLiteral("CREATE UNIQUE INDEX uidx_budget ON budget(i_year,i_month, rc_category_id)") << QStringLiteral("CREATE INDEX idx_budget_category_id ON budget(rc_category_id)") << QStringLiteral("CREATE INDEX idx_budgetsuboperation_id ON budgetsuboperation (id)") << QStringLiteral("CREATE INDEX idx_budgetsuboperation_id_suboperation ON budgetsuboperation (id_suboperation)"); /** * This constant is used to initialized the data model (view creation) */ QStringList BankInitialDataModelView; BankInitialDataModelView // ================================================================== // These following views contains only attributes used by corresponding class (better for performances) // unit << QStringLiteral("CREATE VIEW v_unit_displayname AS " "SELECT *, t_name||' ('||t_symbol||')' AS t_displayname FROM unit") << "CREATE VIEW v_unit_tmp1 AS " "SELECT *," "(SELECT COUNT(1) FROM unitvalue s WHERE s.rd_unit_id=unit.id) AS i_NBVALUES, " "(CASE WHEN unit.rd_unit_id=0 THEN '' ELSE (SELECT (CASE WHEN s.t_symbol!='' THEN s.t_symbol ELSE s.t_name END) FROM unit s WHERE s.id=unit.rd_unit_id) END) AS t_UNIT," "(CASE unit.t_type " "WHEN '1' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Primary currency")) % "' " "WHEN '2' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Secondary currency")) % "' " "WHEN 'C' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, a country's currency", "Currency")) % "' " "WHEN 'S' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, a financial share, as in a stock market", "Share")) % "' " "WHEN 'I' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, a financial index like the Dow Jones, NASDAQ, CAC40...", "Index")) % "' " "ELSE '" % SKGServices::stringToSqlString(i18nc("Noun, a physical object like a house or a car", "Object")) % "' END) AS t_TYPENLS, " "(SELECT MIN(s.d_date) FROM unitvalue s WHERE s.rd_unit_id=unit.id) AS d_MINDATE, " "(SELECT MAX(s.d_date) FROM unitvalue s WHERE s.rd_unit_id=unit.id) AS d_MAXDATE " "FROM unit" << QStringLiteral("CREATE VIEW v_unit_tmp2 AS " "SELECT *," "CASE WHEN v_unit_tmp1.t_type='1' THEN 1 ELSE IFNULL((SELECT s.f_quantity FROM unitvalue s INDEXED BY uidx_unitvalue2 WHERE s.rd_unit_id=v_unit_tmp1.id AND s.d_date=v_unit_tmp1.d_MAXDATE),1) END AS f_LASTVALUE " "FROM v_unit_tmp1") << QStringLiteral("CREATE VIEW v_unit AS " "SELECT *," "CASE WHEN v_unit_tmp2.t_type='1' THEN 1 ELSE v_unit_tmp2.f_LASTVALUE*IFNULL((SELECT s2.f_LASTVALUE FROM v_unit_tmp2 s2 WHERE s2.id=v_unit_tmp2.rd_unit_id) , 1) END AS f_CURRENTAMOUNT " "FROM v_unit_tmp2") // unitvalue << "CREATE VIEW v_unitvalue_displayname AS " "SELECT *, (SELECT t_displayname FROM v_unit_displayname WHERE unitvalue.rd_unit_id=v_unit_displayname.id)||' '||IFNULL(TOFORMATTEDDATE(d_date,'" % SKGServices::stringToSqlString(dateFormatShort) % "'),STRFTIME('%Y-%m-%d',d_date)) AS t_displayname FROM unitvalue" << QStringLiteral("CREATE VIEW v_unitvalue AS " "SELECT * " "FROM unitvalue") // suboperation << QStringLiteral("CREATE VIEW v_suboperation AS " "SELECT * " "FROM suboperation") // operation << QStringLiteral("CREATE VIEW v_operation_numbers AS " "SELECT DISTINCT t_number, rd_account_id FROM operation") << QStringLiteral("CREATE VIEW v_operation_next_numbers AS " "SELECT NEXT(T1.t_number) AS t_number, T1.rd_account_id FROM v_operation_numbers AS T1 LEFT OUTER JOIN v_operation_numbers T2 " "ON T2.rd_account_id=T1.rd_account_id AND T2.t_number=NEXT(T1.t_number) " "WHERE T1.t_number!='' AND (T2.t_number IS NULL) ORDER BY T1.t_number") << QStringLiteral("CREATE VIEW v_operation_tmp1 AS " "SELECT operation.*," "(CASE WHEN v_unit.t_symbol!='' THEN v_unit.t_symbol ELSE v_unit.t_name END) AS t_UNIT," "IFNULL((SELECT s.t_name FROM payee s WHERE s.id=operation.r_payee_id), '') AS t_PAYEE," "v_unit.i_nbdecimal AS i_NBDEC," "v_unit.t_type AS t_TYPEUNIT," "v_unit.f_CURRENTAMOUNT AS f_CURRENTAMOUNTUNIT," "(SELECT TOTAL(s.f_value) FROM suboperation s WHERE s.rd_operation_id=operation.ID) AS f_QUANTITY," "(SELECT COUNT(1) FROM suboperation s WHERE s.rd_operation_id=operation.ID) AS i_NBSUBOPERATIONS, " "account.t_name AS t_ACCOUNT, " "account.t_type AS t_TYPEACCOUNT, " "(CASE WHEN bank.t_name='' THEN '") % i18nc("Noun", "Wallets") % QStringLiteral("' ELSE bank.t_name END) AS t_BANK " "FROM operation, account, bank, v_unit WHERE +operation.rd_account_id=account.id AND +account.rd_bank_id=bank.id AND +operation.rc_unit_id=v_unit.id") << QStringLiteral("CREATE VIEW v_operation AS " "SELECT *," "(SELECT s.id FROM suboperation s WHERE s.rd_operation_id=v_operation_tmp1.id AND ABS(s.f_value)=(SELECT MAX(ABS(s2.f_value)) FROM suboperation s2 WHERE s2.rd_operation_id=v_operation_tmp1.id)) AS i_MOSTIMPSUBOP," "v_operation_tmp1.f_CURRENTAMOUNTUNIT*v_operation_tmp1.f_QUANTITY AS f_CURRENTAMOUNT, " "(CASE WHEN v_operation_tmp1.i_group_id<>0 AND v_operation_tmp1.t_TYPEACCOUNT<>'L' AND v_operation_tmp1.t_TYPEUNIT IN ('1', '2', 'C') AND " "(SELECT COUNT(1) FROM operation WHERE i_group_id=v_operation_tmp1.i_group_id)=2 AND " "EXISTS (SELECT 1 FROM v_operation_tmp1 op2 WHERE op2.i_group_id=v_operation_tmp1.i_group_id " "AND op2.t_TYPEACCOUNT<>'L' AND op2.t_TYPEUNIT IN ('1', '2', 'C') AND op2.f_QUANTITY*v_operation_tmp1.f_QUANTITY<=0) THEN 'Y' ELSE 'N' END) AS t_TRANSFER " // "ROUND((SELECT s.f_CURRENTAMOUNT FROM v_unit s WHERE s.id=v_operation_tmp1.rc_unit_id)*v_operation_tmp1.f_QUANTITY, 2) AS f_CURRENTAMOUNT " "FROM v_operation_tmp1") << "CREATE VIEW v_operation_displayname AS " "SELECT *, IFNULL(TOFORMATTEDDATE(d_date,'" % SKGServices::stringToSqlString(dateFormatShort) % "'),STRFTIME('%Y-%m-%d',d_date))||' '||IFNULL(t_PAYEE,'')||' '||TOCURRENCY(v_operation.f_quantity, (SELECT (CASE WHEN s.t_symbol!='' THEN s.t_symbol ELSE s.t_name END) FROM unit s WHERE s.id=v_operation.rc_unit_id)) AS t_displayname FROM v_operation" << "CREATE VIEW v_operation_delete AS " "SELECT *, (CASE WHEN t_status='Y' THEN '" % SKGServices::stringToSqlString(i18nc("Error message", "You are not authorized to delete this operation because in \"checked\" status")) % "' END) t_delete_message FROM operation" // account << QStringLiteral("CREATE VIEW v_account AS " "SELECT " "account.*," "(CASE WHEN bank.t_name='' THEN '") % i18nc("Noun", "Wallets") % QStringLiteral("' ELSE bank.t_name END) AS t_BANK," "bank.t_bank_number AS t_BANK_NUMBER," "bank.t_icon AS t_ICON," "IFNULL((SELECT f_CURRENTAMOUNTUNIT FROM v_operation_tmp1 WHERE d_date='0000-00-00' AND rd_account_id=account.id), 1) AS f_CURRENTAMOUNTUNIT," "(SELECT MAX(s.d_date) FROM interest s WHERE s.rd_account_id=account.id) AS d_MAXDATE " "FROM account, bank WHERE +account.rd_bank_id=bank.id") << QStringLiteral("CREATE VIEW v_account_amount AS " "SELECT " "v_account.*," "(SELECT TOTAL(s.f_CURRENTAMOUNT) FROM v_operation s WHERE s.rd_account_id=v_account.id AND s.t_template='N') AS f_CURRENTAMOUNT " "FROM v_account") << "CREATE VIEW v_account_delete AS " "SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM operation WHERE rd_account_id=account.id AND d_date<>'0000-00-00' AND t_template='N' AND t_status='Y') THEN '" % SKGServices::stringToSqlString(i18nc("Error message", "You are not authorized to delete this account because it contains some checked operations")) % "' END) t_delete_message FROM account" // bank << QStringLiteral("CREATE VIEW v_bank_displayname AS " "SELECT *, t_name AS t_displayname FROM bank") << QStringLiteral("CREATE VIEW v_account_displayname AS " "SELECT *, (SELECT t_displayname FROM v_bank_displayname WHERE account.rd_bank_id=v_bank_displayname.id)||'-'||t_name AS t_displayname FROM account") << QStringLiteral("CREATE VIEW v_bank AS " "SELECT * FROM bank") << QStringLiteral("CREATE VIEW v_bank_amount AS " "SELECT *," "(SELECT TOTAL(s.f_CURRENTAMOUNT) FROM v_account_amount s WHERE s.rd_bank_id=v_bank.id) AS f_CURRENTAMOUNT " "FROM v_bank") // category << QStringLiteral("CREATE VIEW v_category_displayname AS " "SELECT *, t_fullname AS t_displayname FROM category") << QStringLiteral("CREATE VIEW v_category AS SELECT * " "FROM category") // recurrentoperation << "CREATE VIEW v_recurrentoperation AS " "SELECT *," "date(d_date, '-'||((CASE t_period_unit WHEN 'W' THEN 7 ELSE 1 END)*i_period_increment)||' '||(CASE t_period_unit WHEN 'M' THEN 'month' WHEN 'Y' THEN 'year' ELSE 'day' END)) as d_PREVIOUS," "i_period_increment||' '||(CASE t_period_unit " "WHEN 'Y' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "year(s)")) % "' " "WHEN 'M' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "month(s)")) % "' " "WHEN 'W' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "week(s)")) % "' " "ELSE '" % SKGServices::stringToSqlString(i18nc("Noun", "day(s)")) % "' END) AS t_PERIODNLS " "FROM recurrentoperation" << "CREATE VIEW v_recurrentoperation_displayname AS " "SELECT *, IFNULL(TOFORMATTEDDATE(d_date,'" % SKGServices::stringToSqlString(dateFormatShort) % "'),STRFTIME('%Y-%m-%d',d_date))||' '||(SELECT SUBSTR(t_displayname, INSTR(t_displayname, ' ')+1) FROM v_operation_displayname WHERE v_operation_displayname.id=v_recurrentoperation.rd_operation_id) AS t_displayname FROM v_recurrentoperation" // ================================================================== // These following views contains all attributes needed for display // unitvalue << QStringLiteral("CREATE VIEW v_unitvalue_display AS " "SELECT *," "unitvalue.f_QUANTITY*(SELECT TOTAL(v_operation.f_QUANTITY) FROM v_operation WHERE v_operation.rc_unit_id=unitvalue.rd_unit_id AND v_operation.d_date<=unitvalue.d_date AND v_operation.t_template='N') AS f_AMOUNTOWNED," "IFNULL((SELECT (CASE WHEN s.t_symbol!='' THEN s.t_symbol ELSE s.t_name END) FROM unit s WHERE s.id=(SELECT s2.rd_unit_id FROM unit s2 WHERE s2.id=unitvalue.rd_unit_id)),'') AS t_UNIT," "STRFTIME('%Y-%m',unitvalue.d_date) AS d_DATEMONTH," "STRFTIME('%Y',unitvalue.d_date) AS d_DATEYEAR " "FROM unitvalue") // suboperation << QStringLiteral("CREATE VIEW v_suboperation_display AS " "SELECT *," "IFNULL((SELECT s.t_fullname FROM category s WHERE s.id=v_suboperation.r_category_id),'') AS t_CATEGORY, " "IFNULL((SELECT s.t_name FROM refund s WHERE s.id=v_suboperation.r_refund_id),'') AS t_REFUND, " "IFNULL((SELECT s.t_name||\" (\"||TOCURRENCY((SELECT TOTAL(s2.f_value) FROM v_suboperation s2 WHERE s2.d_date<=v_suboperation.d_date AND s2.r_refund_id=v_suboperation.r_refund_id), (SELECT t_UNIT FROM v_operation WHERE v_suboperation.rd_operation_id = v_operation.id))||\")\" FROM refund s WHERE s.id=v_suboperation.r_refund_id),'') AS t_REFUNDDISPLAY, " "(CASE WHEN v_suboperation.f_value>=0 THEN v_suboperation.f_value ELSE 0 END) AS f_VALUE_INCOME, " "(CASE WHEN v_suboperation.f_value<=0 THEN v_suboperation.f_value ELSE 0 END) AS f_VALUE_EXPENSE " "FROM v_suboperation") << QStringLiteral("CREATE VIEW v_suboperation_displayname AS " "SELECT *, t_CATEGORY||' : '||f_value AS t_displayname FROM v_suboperation_display") // operation << "CREATE VIEW v_operation_display_all AS " "SELECT *," // "(SELECT s.t_comment FROM v_suboperation_display s WHERE s.id=v_operation.i_MOSTIMPSUBOP) AS t_COMMENT," "IFNULL((CASE WHEN v_operation.i_group_id=0 THEN '' ELSE (SELECT GROUP_CONCAT(DISTINCT(op2.t_ACCOUNT)) FROM v_operation_tmp1 op2 WHERE op2.i_group_id=v_operation.i_group_id AND op2.id<>v_operation.id) END), '') AS t_TOACCOUNT, " "(SELECT s.t_CATEGORY FROM v_suboperation_display s WHERE s.id=v_operation.i_MOSTIMPSUBOP) AS t_CATEGORY," "(SELECT s.t_REFUND FROM v_suboperation_display s WHERE s.id=v_operation.i_MOSTIMPSUBOP) AS t_REFUND," "(SELECT GROUP_CONCAT(s.t_REFUNDDISPLAY) FROM v_suboperation_display s WHERE s.rd_operation_id=v_operation.id AND s.t_REFUNDDISPLAY!='') AS t_REFUNDDISPLAY," "(CASE WHEN v_operation.f_QUANTITY<0 THEN '-' WHEN v_operation.f_QUANTITY=0 THEN '' ELSE '+' END) AS t_TYPEEXPENSE, " "(CASE WHEN v_operation.f_QUANTITY<=0 THEN '" % SKGServices::stringToSqlString(i18nc("Noun, financial operations with a negative amount", "Expenditure")) % "' ELSE '" % SKGServices::stringToSqlString(i18nc("Noun, financial operations with a positive amount", "Income")) % "' END) AS t_TYPEEXPENSENLS, " "STRFTIME('%Y-W%W',v_operation.d_date" + (firstDayOfWeek == Qt::Sunday ? ", '+1 days'" : "") + ") AS d_DATEWEEK," "STRFTIME('%Y-%m',v_operation.d_date) AS d_DATEMONTH," "STRFTIME('%Y',v_operation.d_date)||'-Q'||(CASE WHEN STRFTIME('%m',v_operation.d_date)<='03' THEN '1' WHEN STRFTIME('%m',v_operation.d_date)<='06' THEN '2' WHEN STRFTIME('%m',v_operation.d_date)<='09' THEN '3' ELSE '4' END) AS d_DATEQUARTER, " "STRFTIME('%Y',v_operation.d_date)||'-S'||(CASE WHEN STRFTIME('%m',v_operation.d_date)<='06' THEN '1' ELSE '2' END) AS d_DATESEMESTER, " "STRFTIME('%Y',v_operation.d_date) AS d_DATEYEAR, " "(SELECT COUNT(1) FROM v_recurrentoperation s WHERE s.rd_operation_id=v_operation.id) AS i_NBRECURRENT, " "(CASE WHEN v_operation.f_QUANTITY>=0 THEN v_operation.f_QUANTITY ELSE 0 END) AS f_QUANTITY_INCOME, " "(CASE WHEN v_operation.f_QUANTITY<=0 THEN v_operation.f_QUANTITY ELSE 0 END) AS f_QUANTITY_EXPENSE, " "(SELECT o2.f_balance FROM operationbalance o2 WHERE o2.r_operation_id=v_operation.id ) AS f_BALANCE, " "(SELECT o2.f_balance_entered FROM operationbalance o2 WHERE o2.r_operation_id=v_operation.id ) AS f_BALANCE_ENTERED, " "(CASE WHEN v_operation.f_QUANTITY>=0 THEN v_operation.f_CURRENTAMOUNT ELSE 0 END) AS f_CURRENTAMOUNT_INCOME, " "(CASE WHEN v_operation.f_QUANTITY<=0 THEN v_operation.f_CURRENTAMOUNT ELSE 0 END) AS f_CURRENTAMOUNT_EXPENSE " "FROM v_operation" << QStringLiteral("CREATE VIEW v_operation_display AS " "SELECT * FROM v_operation_display_all WHERE d_date!='0000-00-00' AND t_template='N'") // unit << QStringLiteral("CREATE VIEW v_unit_display AS " "SELECT *," "i_nbdecimal AS i_NBDEC," "(SELECT TOTAL(o.f_QUANTITY) FROM v_operation_display_all o WHERE o.rc_unit_id=v_unit.id AND o.t_template='N') AS f_QUANTITYOWNED, " "(SELECT TOTAL(o.f_QUANTITY) FROM v_operation_display_all o WHERE o.rc_unit_id=v_unit.id AND o.t_template='N')*v_unit.f_CURRENTAMOUNT AS f_AMOUNTOWNED " "FROM v_unit") // account << "CREATE VIEW v_account_display AS " "SELECT " "(CASE t_type " "WHEN 'C' THEN '" % SKGServices::stringToSqlString(i18nc("Adjective, a current account", "Current")) % "' " "WHEN 'D' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Credit card")) % "' " "WHEN 'A' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, the type of an account", "Assets")) % "' " "WHEN 'I' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, a type of account WHERE you invest money", "Investment")) % "' " "WHEN 'W' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, a type of account", "Wallet")) % "' " "WHEN 'L' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, a type of account", "Loan")) % "' " "WHEN 'S' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, a type of account", "Saving")) % "' " "WHEN 'P' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, a type of account", "Pension")) % "' " "WHEN 'O' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, as in other type of item", "Other")) % "' END) AS t_TYPENLS," "v_account_amount.*," "(v_account_amount.f_CURRENTAMOUNT/(SELECT u.f_CURRENTAMOUNT FROM v_unit u, operation s WHERE u.id=s.rc_unit_id AND s.rd_account_id=v_account_amount.id AND s.d_date='0000-00-00')) AS f_QUANTITY, " "(SELECT (CASE WHEN u.t_symbol!='' THEN u.t_symbol ELSE u.t_name END) FROM unit u, operation s WHERE u.id=s.rc_unit_id AND s.rd_account_id=v_account_amount.id AND s.d_date='0000-00-00') AS t_UNIT, " "(SELECT TOTAL(s.f_CURRENTAMOUNT) FROM v_operation s WHERE s.rd_account_id=v_account_amount.id AND s.t_status='Y' AND s.t_template='N') AS f_CHECKED, " "(SELECT TOTAL(s.f_CURRENTAMOUNT) FROM v_operation s WHERE s.rd_account_id=v_account_amount.id AND s.t_status!='N' AND s.t_template='N') AS f_CHECKEDANDPOINTED, " "(SELECT TOTAL(s.f_CURRENTAMOUNT) FROM v_operation s WHERE s.rd_account_id=v_account_amount.id AND s.t_status!='Y' AND s.t_template='N') AS f_COMING_SOON, " "(SELECT TOTAL(s.f_CURRENTAMOUNT) FROM v_operation s WHERE s.rd_account_id IN (SELECT id FROM account WHERE account.r_account_id=v_account_amount.id) AND s.t_status='N' AND s.t_template='N') AS f_COMING_SOON_FROM_LINKED_ACCOUNT, " "(SELECT TOTAL(s.f_CURRENTAMOUNT) FROM v_operation s WHERE s.rd_account_id=v_account_amount.id AND s.d_date<=(SELECT date('now')) AND s.t_template='N') AS f_TODAYAMOUNT, " "(SELECT COUNT(1) FROM v_operation_display s WHERE s.rd_account_id=v_account_amount.id) AS i_NBOPERATIONS, " "IFNULL((SELECT s.f_rate FROM interest s WHERE s.rd_account_id=v_account_amount.id AND s.d_date=v_account_amount.d_MAXDATE),0) AS f_RATE " "FROM v_account_amount" // operations << "CREATE VIEW v_suboperation_consolidated AS " "SELECT " "(SELECT s.t_TYPENLS FROM v_account_display s WHERE s.id=op.rd_account_id) AS t_ACCOUNTTYPE," "(SELECT s.t_BANK FROM v_account_display s WHERE s.id=op.rd_account_id) AS t_BANK," "(SELECT u.t_TYPENLS FROM v_unit u WHERE u.id=op.rc_unit_id) AS t_UNITTYPE," "sop.id AS id, " "sop.id AS i_SUBOPID, " "sop.r_refund_id AS r_refund_id, " "(CASE WHEN sop.t_comment='' THEN op.t_comment ELSE sop.t_comment END) AS t_REALCOMMENT, " "sop.t_CATEGORY AS t_REALCATEGORY, " "sop.t_REFUND AS t_REALREFUND, " "sop.r_category_id AS i_IDCATEGORY, " "(CASE WHEN sop.f_value<0 THEN '-' WHEN sop.f_value=0 THEN '' ELSE '+' END) AS t_TYPEEXPENSE, " "(CASE WHEN sop.f_value<=0 THEN '" % SKGServices::stringToSqlString(i18nc("Noun, financial operations with a negative amount", "Expenditure")) % "' ELSE '" % SKGServices::stringToSqlString(i18nc("Noun, financial operations with a positive amount", "Income")) % "' END) AS t_TYPEEXPENSENLS, " "sop.f_value AS f_REALQUANTITY, " "sop.f_VALUE_INCOME AS f_REALQUANTITY_INCOME, " "sop.f_VALUE_EXPENSE AS f_REALQUANTITY_EXPENSE, " "((SELECT u.f_CURRENTAMOUNT FROM v_unit u WHERE u.id=op.rc_unit_id)*sop.f_value) AS f_REALCURRENTAMOUNT, " "((SELECT u.f_CURRENTAMOUNT FROM v_unit u WHERE u.id=op.rc_unit_id)*sop.f_VALUE_INCOME) AS f_REALCURRENTAMOUNT_INCOME, " "((SELECT u.f_CURRENTAMOUNT FROM v_unit u WHERE u.id=op.rc_unit_id)*sop.f_VALUE_EXPENSE) AS f_REALCURRENTAMOUNT_EXPENSE, " "STRFTIME('%Y-W%W',sop.d_date" + (firstDayOfWeek == Qt::Sunday ? ", '+1 days'" : "") + ") AS d_DATEWEEK," "STRFTIME('%Y-%m',sop.d_date) AS d_DATEMONTH," "STRFTIME('%Y',sop.d_date)||'-Q'||(CASE WHEN STRFTIME('%m',sop.d_date)<='03' THEN '1' WHEN STRFTIME('%m',sop.d_date)<='06' THEN '2' WHEN STRFTIME('%m',sop.d_date)<='09' THEN '3' ELSE '4' END) AS d_DATEQUARTER, " "STRFTIME('%Y',sop.d_date)||'-S'||(CASE WHEN STRFTIME('%m',sop.d_date)<='06' THEN '1' ELSE '2' END) AS d_DATESEMESTER, " "STRFTIME('%Y',sop.d_date) AS d_DATEYEAR, " "sop.d_date AS d_date, " "op.id AS i_OPID, " "op.d_date AS d_DATEOP, " "op.*, " "sop.* " "FROM v_operation_display_all AS op, v_suboperation_display AS sop WHERE +sop.rd_operation_id=op.ID AND op.t_template='N'" << QStringLiteral("CREATE VIEW v_operation_prop AS " "SELECT " "p.id AS i_PROPPID, " "p.t_name AS i_PROPPNAME, " "p.t_value AS i_PROPVALUE, " "op.* " "FROM v_suboperation_consolidated AS op LEFT OUTER JOIN parameters AS p ON (p.t_uuid_parent=op.id||'-suboperation' OR p.t_uuid_parent=op.i_OPID||'-operation')") // refund << "CREATE VIEW v_refund_delete AS " "SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM v_suboperation_consolidated WHERE r_refund_id=refund.id AND t_status='Y') THEN '" % SKGServices::stringToSqlString(i18nc("Error message", "You are not authorized to delete this tracker because used by some checked operations")) % "' END) t_delete_message FROM refund" << QStringLiteral("CREATE VIEW v_refund AS SELECT * FROM refund") << QStringLiteral("CREATE VIEW v_refund_amount AS " "SELECT *, " "(SELECT TOTAL(o.f_REALCURRENTAMOUNT) FROM v_suboperation_consolidated o WHERE o.r_refund_id=v_refund.id) AS f_CURRENTAMOUNT " "FROM v_refund") << QStringLiteral("CREATE VIEW v_refund_display AS " "SELECT *," "(SELECT MIN(o.d_date) FROM v_suboperation_consolidated o WHERE o.r_refund_id=v_refund_amount.id) AS d_FIRSTDATE, " "(SELECT MAX(o.d_date) FROM v_suboperation_consolidated o WHERE o.r_refund_id=v_refund_amount.id) AS d_LASTDATE " " FROM v_refund_amount") << QStringLiteral("CREATE VIEW v_refund_displayname AS " "SELECT *, t_name AS t_displayname FROM refund") // Payee << "CREATE VIEW v_payee_delete AS " "SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM operation WHERE r_payee_id=payee.id AND t_status='Y') THEN '" % SKGServices::stringToSqlString(i18nc("Error message", "You are not authorized to delete this payee because used by some checked operations")) % "' END) t_delete_message FROM payee" << QStringLiteral("CREATE VIEW v_payee_amount AS SELECT o.r_payee_id AS r_payee_id, TOTAL(o.f_CURRENTAMOUNT) AS f_CURRENTAMOUNT, COUNT(1) AS i_NBOPERATIONS FROM v_operation o GROUP BY o.r_payee_id") << QStringLiteral("CREATE VIEW v_payee AS SELECT *," "IFNULL((SELECT s.t_fullname FROM category s WHERE s.id=payee.r_category_id),'') AS t_CATEGORY " "FROM payee") << QStringLiteral("CREATE VIEW v_payee_display AS " "SELECT v_payee.*, " "(CASE WHEN p.f_CURRENTAMOUNT IS NULL THEN 0 ELSE p.f_CURRENTAMOUNT END) AS f_CURRENTAMOUNT, " "(CASE WHEN p.i_NBOPERATIONS IS NULL THEN 0 ELSE p.i_NBOPERATIONS END) AS i_NBOPERATIONS " "FROM v_payee LEFT OUTER JOIN v_payee_amount p ON p.r_payee_id=v_payee.id") << QStringLiteral("CREATE VIEW v_payee_displayname AS " "SELECT *, t_name AS t_displayname FROM payee") // category << "CREATE VIEW v_category_delete AS " "SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM v_suboperation_consolidated WHERE (t_REALCATEGORY=category.t_fullname OR t_REALCATEGORY like category.t_fullname||'%') AND t_status='Y') THEN '" % SKGServices::stringToSqlString(i18nc("Error message", "You are not authorized to delete this category because used by some checked operations")) % "' END) t_delete_message FROM category" << QStringLiteral("CREATE VIEW v_category_amount AS SELECT o.i_IDCATEGORY AS i_IDCATEGORY, TOTAL(o.f_REALCURRENTAMOUNT) AS f_REALCURRENTAMOUNT FROM v_suboperation_consolidated o GROUP BY o.i_IDCATEGORY") << QStringLiteral("CREATE VIEW v_category_display_tmp AS SELECT v_category.*, " "IFNULL(t.f_REALCURRENTAMOUNT, 0) AS f_REALCURRENTAMOUNT, " "(SELECT COUNT(DISTINCT(so.rd_operation_id)) FROM operation o, suboperation so WHERE +so.rd_operation_id=o.id AND so.r_category_id=v_category.ID AND o.t_template='N') AS i_NBOPERATIONS " "FROM v_category LEFT OUTER JOIN v_category_amount t ON t.i_IDCATEGORY=v_category.ID") << QStringLiteral("CREATE VIEW v_category_used1 AS SELECT v_category.*, " "(CASE WHEN EXISTS(SELECT 1 FROM operation o, suboperation so WHERE +so.rd_operation_id=o.id AND so.r_category_id=v_category.ID AND o.t_template='N') THEN 'Y' ELSE 'N' END) AS t_ISUSED " "FROM v_category") << "CREATE VIEW v_category_used2 AS SELECT v_category_used1.*, " "(CASE WHEN v_category_used1.t_ISUSED='Y' THEN 'Y' WHEN EXISTS(SELECT 1 FROM v_category_used1 c WHERE c.t_ISUSED='Y' AND c.t_fullname like v_category_used1.t_fullname||'" % OBJECTSEPARATOR % "%') THEN 'C' ELSE 'N' END) AS t_ISUSEDCASCADE " "FROM v_category_used1" << "CREATE VIEW v_category_display AS SELECT *," "v_category_display_tmp.f_REALCURRENTAMOUNT+(SELECT TOTAL(c.f_REALCURRENTAMOUNT) FROM v_category_display_tmp c WHERE c.t_fullname LIKE v_category_display_tmp.t_fullname||'" % OBJECTSEPARATOR % "%') AS f_SUMCURRENTAMOUNT, " "v_category_display_tmp.i_NBOPERATIONS+(SELECT CAST(TOTAL(c.i_NBOPERATIONS) AS INTEGER) FROM v_category_display_tmp c WHERE c.t_fullname like v_category_display_tmp.t_fullname||'" % OBJECTSEPARATOR % "%') AS i_SUMNBOPERATIONS, " "(CASE WHEN v_category_display_tmp.t_bookmarked='Y' THEN 'Y' WHEN EXISTS(SELECT 1 FROM category c WHERE c.t_bookmarked='Y' AND c.t_fullname like v_category_display_tmp.t_fullname||'" % OBJECTSEPARATOR % "%') THEN 'C' ELSE 'N' END) AS t_HASBOOKMARKEDCHILD, " "(CASE WHEN v_category_display_tmp.f_REALCURRENTAMOUNT<0 THEN '-' WHEN v_category_display_tmp.f_REALCURRENTAMOUNT=0 THEN '' ELSE '+' END) AS t_TYPEEXPENSE," "(CASE WHEN v_category_display_tmp.f_REALCURRENTAMOUNT<0 THEN '" % SKGServices::stringToSqlString(i18nc("Noun, financial operations with a negative amount", "Expenditure")) % "' WHEN v_category_display_tmp.f_REALCURRENTAMOUNT=0 THEN '' ELSE '" % SKGServices::stringToSqlString(i18nc("Noun, financial operations with a positive amount", "Income")) % "' END) AS t_TYPEEXPENSENLS " "FROM v_category_display_tmp" // recurrentoperation << QStringLiteral("CREATE VIEW v_recurrentoperation_display AS " "SELECT rop.*, op.t_ACCOUNT, op.t_number, op.t_mode, op.i_group_id, op.t_TRANSFER, op.t_PAYEE, op.t_comment, op.t_CATEGORY, op.t_status, op.f_CURRENTAMOUNT " "FROM v_recurrentoperation rop, v_operation_display_all AS op WHERE +rop.rd_operation_id=op.ID") // rule << QStringLiteral("CREATE VIEW v_rule AS SELECT *," "(SELECT COUNT(1) FROM rule r WHERE r.f_sortorder<=rule.f_sortorder) AS i_ORDER " "FROM rule") << QStringLiteral("CREATE VIEW v_rule_displayname AS SELECT *, t_description AS t_displayname FROM rule") << QStringLiteral("CREATE VIEW v_rule_display AS SELECT * FROM v_rule") // interest << QStringLiteral("CREATE VIEW v_interest AS SELECT *," "(SELECT s.t_name FROM account s WHERE s.id=interest.rd_account_id) AS t_ACCOUNT " " FROM interest") << "CREATE VIEW v_interest_displayname AS SELECT *, IFNULL(TOFORMATTEDDATE(d_date,'" % SKGServices::stringToSqlString(dateFormatShort) % "'),STRFTIME('%Y-%m-%d',d_date))||' '||f_rate||'%' AS t_displayname FROM interest" // budgetrule << "CREATE VIEW v_budgetrule AS " "SELECT *, " "(SELECT COUNT(1) FROM budgetrule r WHERE r.f_sortorder<=budgetrule.f_sortorder) AS i_ORDER, " "IFNULL((SELECT s.t_fullname FROM category s WHERE s.id=budgetrule.rc_category_id),'') AS t_CATEGORYCONDITION, " "IFNULL((SELECT s.t_fullname FROM category s WHERE s.id=budgetrule.rc_category_id_target),'') AS t_CATEGORY, " "(CASE " "WHEN budgetrule.i_condition=-1 THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Negative")) % "' " "WHEN budgetrule.i_condition=1 THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Positive")) % "' " "WHEN budgetrule.i_condition=0 THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "All")) % "' " "END) AS t_WHENNLS, " "f_quantity||(CASE WHEN budgetrule.t_absolute='N' THEN '%' ELSE (SELECT t_symbol FROM unit WHERE t_type='1') END) AS t_WHATNLS," "(CASE " "WHEN budgetrule.t_rule='N' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Next")) % "' " "WHEN budgetrule.t_rule='C' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Current")) % "' " "WHEN budgetrule.t_rule='Y' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Year")) % "' " "END) AS t_RULENLS " "FROM budgetrule" << QStringLiteral("CREATE VIEW v_budgetrule_display AS " "SELECT * " " FROM v_budgetrule") << QStringLiteral("CREATE VIEW v_budgetrule_displayname AS " "SELECT *, t_WHENNLS||' '||t_WHATNLS||' '||t_RULENLS||' '||t_CATEGORY AS t_displayname FROM v_budgetrule") // budget << QStringLiteral("CREATE VIEW v_budget_tmp AS " "SELECT *, " "IFNULL((SELECT s.t_fullname FROM category s WHERE s.id=budget.rc_category_id),'') AS t_CATEGORY, " "(budget.i_year||(CASE WHEN budget.i_month=0 THEN '' WHEN budget.i_month<10 THEN '-0'||budget.i_month ELSE '-'||budget.i_month END)) AS t_PERIOD, " "(SELECT TOTAL(o.f_REALCURRENTAMOUNT) FROM v_suboperation_consolidated o WHERE o.t_TYPEACCOUNT<>'L' AND o.i_SUBOPID IN " "(SELECT b2.id_suboperation FROM budgetsuboperation b2 WHERE b2.id=budget.id)" ") AS f_CURRENTAMOUNT, " "(SELECT GROUP_CONCAT(v_budgetrule_displayname.t_displayname,',') FROM v_budgetrule_displayname WHERE " "(v_budgetrule_displayname.t_year_condition='N' OR budget.i_year=v_budgetrule_displayname.i_year) AND " "(v_budgetrule_displayname.t_month_condition='N' OR budget.i_month=v_budgetrule_displayname.i_month) AND " "(v_budgetrule_displayname.t_category_condition='N' OR budget.rc_category_id=v_budgetrule_displayname.rc_category_id) " "ORDER BY v_budgetrule_displayname.t_absolute DESC, v_budgetrule_displayname.id) AS t_RULES " "FROM budget") << QStringLiteral("CREATE VIEW v_budget AS " "SELECT *, " "(f_CURRENTAMOUNT-f_budgeted_modified) AS f_DELTABEFORETRANSFER, " "(f_CURRENTAMOUNT-f_budgeted_modified-f_transferred) AS f_DELTA " "FROM v_budget_tmp") << QStringLiteral("CREATE VIEW v_budget_display AS " "SELECT *, " "(f_CURRENTAMOUNT-f_budgeted_modified) AS f_DELTABEFORETRANSFER, " "(f_CURRENTAMOUNT-f_budgeted_modified-f_transferred) AS f_DELTA " "FROM vm_budget_tmp") << QStringLiteral("CREATE VIEW v_budget_displayname AS " "SELECT *, t_CATEGORY||' '||t_PERIOD||' '||f_budgeted_modified AS t_displayname FROM v_budget") << QStringLiteral("CREATE VIEW v_operation_all_comment AS " "SELECT t_comment FROM operation UNION SELECT t_comment FROM suboperation"); IFOKDO(err, SKGDocument::refreshViewsIndexesAndTriggers(iForce)) QStringList tables; tables << QStringLiteral("account") << QStringLiteral("unit") << QStringLiteral("unitvalue") << QStringLiteral("bank") << QStringLiteral("recurrentoperation") << QStringLiteral("refund") << QStringLiteral("payee") << QStringLiteral("operation") << QStringLiteral("operationbalance") << QStringLiteral("interest") << QStringLiteral("rule") << QStringLiteral("suboperation") << QStringLiteral("budget") << QStringLiteral("budgetrule") << QStringLiteral("budgetcategory") << QStringLiteral("budgetsuboperation") << QStringLiteral("category"); IFOKDO(err, dropViewsAndIndexes(tables)) IFOKDO(err, executeSqliteOrders(BankInitialDataModelIndex)) IFOKDO(err, executeSqliteOrders(BankInitialDataModelView)) IFOKDO(err, executeSqliteOrders(BankInitialDataModelTrigger)) IFOKDO(err, executeSqliteOrder(QStringLiteral("ANALYZE"))) return err; } QStringList SKGDocumentBank::getMigationSteps() { SKGTRACEINFUNC(5); QStringList migrationSteps; migrationSteps.reserve(1000); migrationSteps // ============ << QLatin1String("") << QStringLiteral("0.1") << QStringLiteral("0.2") << QStringLiteral("ALTER TABLE unit ADD COLUMN rc_unit_id INTEGER NOT NULL DEFAULT 0") // ============ << QLatin1String("") << QStringLiteral("0.2") << QStringLiteral("0.3") << QStringLiteral("DROP TABLE IF EXISTS unitvalue2") << QStringLiteral("CREATE TABLE unitvalue2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "rd_unit_id INTEGER NOT NULL," "d_date DATE NOT NULL," "f_quantity FLOAT NOT NULL CHECK (f_quantity>=0))") << QStringLiteral("INSERT INTO unitvalue2 (id,rd_unit_id,d_date,f_quantity) SELECT id,rd_unit_id,d_date,f_value FROM unitvalue") << QStringLiteral("DROP TABLE IF EXISTS unitvalue") << QStringLiteral("ALTER TABLE unitvalue2 RENAME TO unitvalue") // ============ << QLatin1String("") << QStringLiteral("0.3") << QStringLiteral("0.4") << QStringLiteral("ALTER TABLE operation ADD COLUMN t_import_id TEXT DEFAULT ''") // ============ << QLatin1String("") << QStringLiteral("0.4") << QStringLiteral("0.5") << QStringLiteral("DROP TABLE IF EXISTS recurrentoperation") << QStringLiteral("CREATE TABLE recurrentoperation (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "rd_operation_id INTEGER NOT NULL," "i_period_increment INTEGER NOT NULL DEFAULT 1 CHECK (i_period_increment>=0)," "t_period_unit TEXT NOT NULL DEFAULT 'M' CHECK (t_period_unit IN ('D', 'M', 'Y'))," "t_auto_write VARCHAR(1) DEFAULT 'Y' CHECK (t_auto_write IN ('Y', 'N'))," "i_auto_write_days INTEGER NOT NULL DEFAULT 5 CHECK (i_auto_write_days>=0)," "t_warn VARCHAR(1) DEFAULT 'Y' CHECK (t_auto_write IN ('Y', 'N'))," "i_warn_days INTEGER NOT NULL DEFAULT 5 CHECK (i_warn_days>=0)" ")") << QStringLiteral("ALTER TABLE operation ADD COLUMN r_recurrentoperation_id INTEGER NOT NULL DEFAULT 0") // ============ << QLatin1String("") << QStringLiteral("0.5") << QStringLiteral("0.6") << QStringLiteral("ALTER TABLE account ADD COLUMN t_comment TEXT NOT NULL DEFAULT ''") // ============ << QLatin1String("") << QStringLiteral("0.6") << QStringLiteral("0.7") << QStringLiteral("DROP TABLE IF EXISTS unit2") << QStringLiteral("CREATE TABLE unit2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL," "t_symbol TEXT NOT NULL DEFAULT ''," "t_country TEXT NOT NULL DEFAULT ''," "t_type VARCHAR(1) NOT NULL DEFAULT 'C' CHECK (t_type IN ('1', '2', 'C', 'S', 'O'))," // 1=main currency, 2=secondary currency, C=currencies S=share O=object "t_internet_code TEXT NOT NULL DEFAULT ''," "rd_unit_id INTEGER NOT NULL DEFAULT 0)") << QStringLiteral("INSERT INTO unit2 (id,t_name,t_symbol,t_country,t_type,t_internet_code,rd_unit_id) SELECT id,t_name,t_symbol,t_country,t_type,t_internet_code,rc_unit_id FROM unit") << QStringLiteral("DROP TABLE IF EXISTS unit") << QStringLiteral("ALTER TABLE unit2 RENAME TO unit") // ============ << QLatin1String("") << QStringLiteral("0.7") << QStringLiteral("0.8") << QStringLiteral("DELETE FROM operation WHERE id IN (SELECT id FROM operation op WHERE NOT EXISTS(SELECT 1 FROM suboperation sop WHERE sop.rd_operation_id=op.id))") // ============ << QLatin1String("") << QStringLiteral("0.8") << QStringLiteral("0.9") << QStringLiteral("UPDATE operation SET i_group_id=0 WHERE i_group_id=''") // ============ << QLatin1String("") << QStringLiteral("0.9") << QStringLiteral("1.0") << QStringLiteral("DROP TABLE IF EXISTS unit2") << QStringLiteral("CREATE TABLE unit2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL," "t_symbol TEXT NOT NULL DEFAULT ''," "t_country TEXT NOT NULL DEFAULT ''," "t_type VARCHAR(1) NOT NULL DEFAULT 'C' CHECK (t_type IN ('1', '2', 'C', 'S', 'I', 'O'))," // 1=main currency, 2=secondary currency, C=currencies S=share, I=index, O=object "t_internet_code TEXT NOT NULL DEFAULT ''," "rd_unit_id INTEGER NOT NULL DEFAULT 0)") << QStringLiteral("INSERT INTO unit2 (id,t_name,t_symbol,t_country,t_type,t_internet_code,rd_unit_id) SELECT id,t_name,t_symbol,t_country,t_type,t_internet_code,rd_unit_id FROM unit") << QStringLiteral("DROP TABLE IF EXISTS unit") << QStringLiteral("ALTER TABLE unit2 RENAME TO unit") // ============ << QLatin1String("") << QStringLiteral("1.0") << QStringLiteral("1.1") << QStringLiteral("DELETE FROM parameters WHERE t_name LIKE 'SKG_MONTHLY_REPORT_%'") // ============ << QLatin1String("") << QStringLiteral("1.1") << QStringLiteral("1.2") << QStringLiteral("ALTER TABLE suboperation ADD COLUMN t_comment TEXT NOT NULL DEFAULT ''") // ============ << QLatin1String("") << QStringLiteral("1.2") << QStringLiteral("1.3") << QStringLiteral("UPDATE node SET f_sortorder=id WHERE f_sortorder IS NULL OR f_sortorder=''") // ============ << QLatin1String("") << QStringLiteral("1.3") << QStringLiteral("1.4") << QStringLiteral("DROP TABLE IF EXISTS refund") << QStringLiteral("CREATE TABLE refund (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL DEFAULT ''," "t_comment TEXT NOT NULL DEFAULT ''," "t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N')))") << QStringLiteral("ALTER TABLE suboperation ADD COLUMN r_refund_id INTEGER NOT NULL DEFAULT 0") // ============ << QLatin1String("") << QStringLiteral("1.4") << QStringLiteral("1.5") << QStringLiteral("DELETE FROM parameters WHERE (t_name LIKE 'SKG_DEFAULT_%' AND t_name!='SKG_DEFAULT_PROPERTIES') OR t_name='DBVERSION'") // ============ << QLatin1String("") << QStringLiteral("1.5") << QStringLiteral("1.6") << QStringLiteral("CREATE TABLE rule (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_description TEXT NOT NULL DEFAULT ''," "t_definition TEXT NOT NULL DEFAULT ''," "f_sortorder FLOAT" ")") // ============ << QLatin1String("") << QStringLiteral("1.6") << QStringLiteral("1.7") << QStringLiteral("CREATE TABLE action (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "rd_rule_id INTEGER NOT NULL," "t_description TEXT NOT NULL DEFAULT ''," "t_definition TEXT NOT NULL DEFAULT ''" ")") << QStringLiteral("DELETE FROM rule") << QStringLiteral("DROP TABLE IF EXISTS budget") // ============ << QLatin1String("") << QStringLiteral("1.7") << QStringLiteral("1.8") << QStringLiteral("DROP TABLE IF EXISTS action") << QStringLiteral("ALTER TABLE rule ADD COLUMN t_action_description TEXT NOT NULL DEFAULT ''") << QStringLiteral("ALTER TABLE rule ADD COLUMN t_action_definition TEXT NOT NULL DEFAULT ''") << QStringLiteral("DROP TRIGGER IF EXISTS fkdc_rule_action_id_rd_rule_id") // ============ << QLatin1String("") << QStringLiteral("1.8") << QStringLiteral("1.9") << QStringLiteral("DROP TABLE IF EXISTS operation2") << QStringLiteral("CREATE TABLE operation2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "i_group_id INTEGER NOT NULL DEFAULT 0," "i_number INTEGER DEFAULT 0 CHECK (i_number>=0)," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "rd_account_id INTEGER NOT NULL," "t_mode TEXT NOT NULL DEFAULT ''," "t_payee TEXT NOT NULL DEFAULT ''," "t_comment TEXT NOT NULL DEFAULT ''," "rc_unit_id INTEGER NOT NULL," "t_status VARCHAR(1) DEFAULT 'N' CHECK (t_status IN ('N', 'P', 'Y'))," "t_bookmarked VARCHAR(1) DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "t_imported VARCHAR(1) DEFAULT 'N' CHECK (t_imported IN ('Y', 'N', 'P'))," "t_import_id TEXT DEFAULT ''," "r_recurrentoperation_id INTEGER NOT NULL DEFAULT 0)") << QStringLiteral("INSERT INTO operation2 (id,i_group_id,i_number,d_date,rd_account_id,t_mode,t_payee,t_comment,rc_unit_id," "t_status,t_bookmarked,t_imported,t_import_id,r_recurrentoperation_id) " "SELECT id,i_group_id,i_number,d_date,rd_account_id,t_mode,t_payee,t_comment,rc_unit_id," "(CASE WHEN t_status='C' THEN 'Y' ELSE t_status END),t_bookmarked,t_imported,t_import_id,r_recurrentoperation_id FROM operation") << QStringLiteral("DROP TABLE IF EXISTS operation") << QStringLiteral("ALTER TABLE operation2 RENAME TO operation") // ============ << QLatin1String("") << QStringLiteral("1.9") << QStringLiteral("2.0") << QStringLiteral("ALTER TABLE operation ADD COLUMN i_tmp INTEGER NOT NULL DEFAULT 0") << QStringLiteral("ALTER TABLE suboperation ADD COLUMN i_tmp INTEGER NOT NULL DEFAULT 0") // ============ << QLatin1String("") << QStringLiteral("2.0") << QStringLiteral("2.1") << QStringLiteral("ALTER TABLE operation ADD COLUMN t_template VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_template IN ('Y', 'N'))") // ============ << QLatin1String("") << QStringLiteral("2.1") << QStringLiteral("2.2") << QStringLiteral("UPDATE recurrentoperation SET d_date=date(d_date,i_period_increment||(CASE WHEN t_period_unit='Y' THEN ' year' ELSE (CASE WHEN t_period_unit='M' THEN ' month' ELSE ' day' END) END))") << QStringLiteral("DROP TABLE IF EXISTS recurrentoperation2") << QStringLiteral("CREATE TABLE recurrentoperation2 (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "rd_operation_id INTEGER NOT NULL," "i_period_increment INTEGER NOT NULL DEFAULT 1 CHECK (i_period_increment>=0)," "t_period_unit TEXT NOT NULL DEFAULT 'M' CHECK (t_period_unit IN ('D', 'M', 'Y'))," "t_auto_write VARCHAR(1) DEFAULT 'Y' CHECK (t_auto_write IN ('Y', 'N'))," "i_auto_write_days INTEGER NOT NULL DEFAULT 5 CHECK (i_auto_write_days>=0)," "t_warn VARCHAR(1) DEFAULT 'Y' CHECK (t_warn IN ('Y', 'N'))," "i_warn_days INTEGER NOT NULL DEFAULT 5 CHECK (i_warn_days>=0)," "t_times VARCHAR(1) DEFAULT 'N' CHECK (t_times IN ('Y', 'N'))," "i_nb_times INTEGER NOT NULL DEFAULT 1 CHECK (i_nb_times>=0)" ")") << QStringLiteral("INSERT INTO recurrentoperation2 (id,d_date,rd_operation_id,i_period_increment,t_period_unit,t_auto_write,i_auto_write_days,t_warn,i_warn_days) " "SELECT id,d_date,rd_operation_id,i_period_increment,t_period_unit,t_auto_write,i_auto_write_days,t_warn,i_warn_days FROM recurrentoperation") << QStringLiteral("DROP TABLE IF EXISTS recurrentoperation") << QStringLiteral("ALTER TABLE recurrentoperation2 RENAME TO recurrentoperation") // ============ << QLatin1String("") << QStringLiteral("2.2") << QStringLiteral("2.3") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition,'%9','#ATT#')") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition,'''%1''','''#V1S#''')") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition,'''%2''','''#V2S#''')") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition,'''%%1%''','''%#V1S#%''')") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition,'''%1%''','''#V1S#%''')") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition,'''%%1''','''%#V1S#''')") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition,'%1','#V1#')") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition,'%2','#V2#')") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition,'%9','#ATT#')") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition,'''%1''','''#V1S#''')") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition,'''%2''','''#V2S#''')") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition,'''%%1%''','''%#V1S#%''')") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition,'''%1%''','''#V1S#%''')") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition,'''%%1''','''%#V1S#''')") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition,'%1','#V1#')") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition,'%2','#V2#')") // ============ << QLatin1String("") << QStringLiteral("2.3") << QStringLiteral("2.4") << QStringLiteral("UPDATE operation SET t_template='N' WHERE t_template NOT IN ('Y', 'N')") // ============ << QLatin1String("") << QStringLiteral("2.4") << QStringLiteral("2.5") << QStringLiteral("ALTER TABLE rule ADD COLUMN t_action_type VARCHAR(1) DEFAULT 'S' CHECK (t_action_type IN ('S', 'U', 'A'))") << QStringLiteral("UPDATE rule SET t_action_type='S' WHERE t_action_type NOT IN ('S', 'U', 'A') AND t_action_definition=''") << QStringLiteral("UPDATE rule SET t_action_type='U' WHERE t_action_type NOT IN ('S', 'U', 'A') AND t_action_definition!=''") // ============ << QLatin1String("") << QStringLiteral("2.5") << QStringLiteral("2.6") << QStringLiteral("ALTER TABLE unit ADD COLUMN i_nbdecimal INT NOT NULL DEFAULT 2") << QStringLiteral("UPDATE unit SET i_nbdecimal=2") // ============ << QLatin1String("") << QStringLiteral("2.6") << QStringLiteral("2.7") << QStringLiteral("CREATE TABLE operation2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "i_group_id INTEGER NOT NULL DEFAULT 0," "i_number INTEGER DEFAULT 0 CHECK (i_number>=0)," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "rd_account_id INTEGER NOT NULL," "t_mode TEXT NOT NULL DEFAULT ''," "t_payee TEXT NOT NULL DEFAULT ''," "t_comment TEXT NOT NULL DEFAULT ''," "rc_unit_id INTEGER NOT NULL," "t_status VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_status IN ('N', 'P', 'Y'))," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "t_imported VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_imported IN ('Y', 'N', 'P', 'T'))," "t_template VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_template IN ('Y', 'N'))," "t_import_id TEXT NOT NULL DEFAULT ''," "i_tmp INTEGER NOT NULL DEFAULT 0," "r_recurrentoperation_id INTEGER NOT NULL DEFAULT 0)") << QStringLiteral("INSERT INTO operation2 (" "id,i_group_id,i_number,d_date,rd_account_id,t_mode,t_payee,t_comment,rc_unit_id,t_status,t_bookmarked,t_imported,t_template,t_import_id,i_tmp,r_recurrentoperation_id) " "SELECT id,i_group_id,i_number,d_date,rd_account_id,t_mode,t_payee,t_comment,rc_unit_id,t_status,t_bookmarked,t_imported,t_template,t_import_id,i_tmp,r_recurrentoperation_id FROM operation") << QStringLiteral("DROP TABLE IF EXISTS operation") << QStringLiteral("ALTER TABLE operation2 RENAME TO operation") // ============ << QLatin1String("") << QStringLiteral("2.7") << QStringLiteral("2.8") << QStringLiteral("UPDATE rule SET t_action_type='U' WHERE t_action_type='S' AND t_action_definition!=''") // ============ << QLatin1String("") << QStringLiteral("2.8") << QStringLiteral("2.9") << QStringLiteral("DROP TABLE IF EXISTS interest") << QStringLiteral("CREATE TABLE interest(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "rd_account_id INTEGER NOT NULL," "d_date DATE NOT NULL," "f_rate FLOAT NOT NULL CHECK (f_rate>=0)," "t_income_value_date_mode VARCHAR(1) NOT NULL DEFAULT 'F' CHECK (t_income_value_date_mode IN ('F', '0', '1', '2', '3', '4', '5'))," "t_expenditure_value_date_mode VARCHAR(1) NOT NULL DEFAULT 'F' CHECK (t_expenditure_value_date_mode IN ('F', '0', '1', '2', '3', '4', '5'))," "t_base VARCHAR(3) NOT NULL DEFAULT '24' CHECK (t_base IN ('24', '360', '365'))" ")") // ============ << QLatin1String("") << QStringLiteral("2.9") << QStringLiteral("3.0") // Current month << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"1\"\"', 'period=\"\"1\"\" interval=\"\"2\"\" nb_intervals=\"\"1\"\"') WHERE t_data like '%Skrooge report plugin%'") // Previous month << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"2\"\"', 'period=\"\"2\"\" interval=\"\"2\"\" nb_intervals=\"\"1\"\"') WHERE t_data like '%Skrooge report plugin%'") // Current year << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"3\"\"', 'period=\"\"1\"\" interval=\"\"3\"\" nb_intervals=\"\"1\"\"') WHERE t_data like '%Skrooge report plugin%'") // Previous year << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"4\"\"', 'period=\"\"2\"\" interval=\"\"3\"\" nb_intervals=\"\"1\"\"') WHERE t_data like '%Skrooge report plugin%'") // Last 30 days << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"5\"\"', 'period=\"\"3\"\" interval=\"\"0\"\" nb_intervals=\"\"30\"\"') WHERE t_data like '%Skrooge report plugin%'") // Last 3 months << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"6\"\"', 'period=\"\"3\"\" interval=\"\"2\"\" nb_intervals=\"\"3\"\"') WHERE t_data like '%Skrooge report plugin%'") // Last 6 months << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"7\"\"', 'period=\"\"3\"\" interval=\"\"2\"\" nb_intervals=\"\"6\"\"') WHERE t_data like '%Skrooge report plugin%'") // Last 12 months << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"8\"\"', 'period=\"\"3\"\" interval=\"\"2\"\" nb_intervals=\"\"12\"\"') WHERE t_data like '%Skrooge report plugin%'") // Last 2 years << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"9\"\"', 'period=\"\"3\"\" interval=\"\"3\"\" nb_intervals=\"\"2\"\"') WHERE t_data like '%Skrooge report plugin%'") // Last 3 years << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"10\"\"', 'period=\"\"3\"\" interval=\"\"3\"\" nb_intervals=\"\"3\"\"') WHERE t_data like '%Skrooge report plugin%'") // Last 5 years << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"11\"\"', 'period=\"\"3\"\" interval=\"\"3\"\" nb_intervals=\"\"5\"\"') WHERE t_data like '%Skrooge report plugin%'") // Custom... << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'period=\"\"12\"\"', 'period=\"\"4\"\"') WHERE t_data like '%Skrooge report plugin%'") // All without transfers << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'type=\"\"0\"\"', 'incomes=\"\"Y\"\" expenses=\"\"Y\"\" transfers=\"\"N\"\"') WHERE t_data like '%Skrooge report plugin%'") // Income without transfers << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'type=\"\"1\"\"', 'incomes=\"\"Y\"\" expenses=\"\"N\"\" transfers=\"\"N\"\"') WHERE t_data like '%Skrooge report plugin%'") // Expenditure without transfers << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'type=\"\"2\"\"', 'incomes=\"\"N\"\" expenses=\"\"Y\"\" transfers=\"\"N\"\"') WHERE t_data like '%Skrooge report plugin%'") // All with transfers << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'type=\"\"3\"\"', 'incomes=\"\"Y\"\" expenses=\"\"Y\"\" transfers=\"\"Y\"\"') WHERE t_data like '%Skrooge report plugin%'") // Income with transfers << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'type=\"\"4\"\"', 'incomes=\"\"Y\"\" expenses=\"\"N\"\" transfers=\"\"Y\"\"') WHERE t_data like '%Skrooge report plugin%'") // Expenditure with transfers << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'type=\"\"5\"\"', 'incomes=\"\"N\"\" expenses=\"\"Y\"\" transfers=\"\"Y\"\"') WHERE t_data like '%Skrooge report plugin%'") // ============ << QLatin1String("") << QStringLiteral("3.0") << QStringLiteral("3.1") << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'columns=\"\"2\"\"', 'columns=\"\"4\"\"') WHERE t_data like '%Skrooge report plugin%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'columns=\"\"1\"\"', 'columns=\"\"3\"\"') WHERE t_data like '%Skrooge report plugin%'") // ============ << QLatin1String("") << QStringLiteral("3.1") << QStringLiteral("3.2") << QStringLiteral("UPDATE parameters SET t_name='SKGSEARCH_DEFAULT_PARAMETERS' WHERE t_name='SKGIMPORT_DEFAULT_PARAMETERS'") // ============ << QLatin1String("") << QStringLiteral("3.2") << QStringLiteral("3.3") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns="4"', ' columns=""') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns="3"', ' columns="d_DATEYEAR"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns="2"', ' columns="d_DATESEMESTER"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns="1"', ' columns="d_DATEQUARTER"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns="0"', ' columns="d_DATEMONTH"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns=\"\"4\"\"', ' columns=\"\"\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns=\"\"3\"\"', ' columns=\"\"d_DATEYEAR\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns=\"\"2\"\"', ' columns=\"\"d_DATESEMESTER\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns=\"\"1\"\"', ' columns=\"\"d_DATEQUARTER\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns=\"\"0\"\"', ' columns=\"\"d_DATEMONTH\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns="4"', ' columns=""') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns="3"', ' columns="d_DATEYEAR"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns="2"', ' columns="d_DATESEMESTER"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns="1"', ' columns="d_DATEQUARTER"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns="0"', ' columns="d_DATEMONTH"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="0"', ' lines="t_REALCATEGORY"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="1"', ' lines="t_payee"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="2"', ' lines="t_mode"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="3"', ' lines="t_TYPEEXPENSENLS"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="4"', ' lines="t_status"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="5"', ' lines="t_ACCOUNTTYPE"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="6"', ' lines="t_UNITTYPE"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="7"', ' lines="t_REALREFUND"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"0\"\"', ' lines=\"\"t_REALCATEGORY\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"1\"\"', ' lines=\"\"t_payee\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"2\"\"', ' lines=\"\"t_mode\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"3\"\"', ' lines=\"\"t_TYPEEXPENSENLS\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"4\"\"', ' lines=\"\"t_status\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"5\"\"', ' lines=\"\"t_ACCOUNTTYPE\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"6\"\"', ' lines=\"\"t_UNITTYPE\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"7\"\"', ' lines=\"\"t_REALREFUND\"\"') WHERE t_data like '%graphicViewState=%'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines="0"', ' lines="t_REALCATEGORY"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines="1"', ' lines="t_payee"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines="2"', ' lines="t_mode"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines="3"', ' lines="t_TYPEEXPENSENLS"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines="4"', ' lines="t_status"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines="5"', ' lines="t_ACCOUNTTYPE"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines="6"', ' lines="t_UNITTYPE"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines="7"', ' lines="t_REALREFUND"') WHERE t_name='SKGDASHBOARD_DEFAULT_PARAMETERS'") // ============ << QLatin1String("") << QStringLiteral("3.3") << QStringLiteral("3.4") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns=\"4\"', ' columns=\"\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns=\"3\"', ' columns=\"d_DATEYEAR\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns=\"2\"', ' columns=\"d_DATESEMESTER\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns=\"1\"', ' columns=\"d_DATEQUARTER\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns=\"0\"', ' columns=\"d_DATEMONTH\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=\"0\"', ' lines=\"t_REALCATEGORY\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=\"1\"', ' lines=\"t_payee\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=\"2\"', ' lines=\"t_mode\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=\"3\"', ' lines=\"t_TYPEEXPENSENLS\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=\"4\"', ' lines=\"t_status\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=\"5\"', ' lines=\"t_ACCOUNTTYPE\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=\"6\"', ' lines=\"t_UNITTYPE\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=\"7\"', ' lines=\"t_REALREFUND\"') WHERE t_name='SKGREPORT_DEFAULT_PARAMETERS'") // ============ << QLatin1String("") << QStringLiteral("3.4") << QStringLiteral("3.5") << QStringLiteral("ALTER TABLE account ADD COLUMN t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))") << QStringLiteral("UPDATE account SET t_bookmarked='N'") // ============ << QLatin1String("") << QStringLiteral("3.5") << QStringLiteral("3.6") << QStringLiteral("ALTER TABLE rule ADD COLUMN t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))") << QStringLiteral("UPDATE rule SET t_bookmarked='N'") // ============ << QLatin1String("") << QStringLiteral("3.6") << QStringLiteral("3.7") << QStringLiteral("UPDATE suboperation SET r_category_id=0 WHERE r_category_id=(SELECT id FROM category WHERE t_name='')") << QStringLiteral("DELETE FROM category WHERE t_name=''") // ============ << QLatin1String("") << QStringLiteral("3.7") << QStringLiteral("3.8") << QStringLiteral("UPDATE recurrentoperation SET t_times='N' WHERE t_times IS NULL") // ============ << QLatin1String("") << QStringLiteral("3.8") << QStringLiteral("3.9") << QStringLiteral("UPDATE node SET t_data=replace(t_data, 'Skrooge dashboard plugin', 'Dashboard plugin') WHERE t_data like '%Skrooge dashboard plugin%'") // ============ << QLatin1String("") << QStringLiteral("3.9") << QStringLiteral("4.0") << "UPDATE rule SET t_definition=replace(t_definition, '" % SKGServices::stringToSqlString(QStringLiteral("date('now','-1")) % "', '" % SKGServices::stringToSqlString(QStringLiteral("date('now','start of month','-1")) % "')" // ============ << QLatin1String("") << QStringLiteral("4.0") << QStringLiteral("4.1") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition,'t_REFUND','t_REALREFUND')") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition,'t_REFUND','t_REALREFUND')") // ============ << QLatin1String("") << QStringLiteral("4.1") << QStringLiteral("4.2") << QStringLiteral("UPDATE operation SET t_imported='Y' WHERE t_imported='T'") << QStringLiteral("UPDATE operation SET t_imported='N' WHERE t_imported!='N' AND t_import_id='';") // ============ << QLatin1String("") << QStringLiteral("4.2") << QStringLiteral("4.3") << QStringLiteral("CREATE TABLE payee (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL DEFAULT ''," "t_address TEXT NOT NULL DEFAULT '')") << QStringLiteral("INSERT INTO payee (t_name) " "SELECT distinct(operation.t_payee) FROM operation WHERE operation.t_payee<>''") << QStringLiteral("CREATE TABLE operation2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "i_group_id INTEGER NOT NULL DEFAULT 0," "i_number INTEGER DEFAULT 0 CHECK (i_number>=0)," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "rd_account_id INTEGER NOT NULL," "t_mode TEXT NOT NULL DEFAULT ''," "r_payee_id INTEGER NOT NULL DEFAULT 0," "t_comment TEXT NOT NULL DEFAULT ''," "rc_unit_id INTEGER NOT NULL," "t_status VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_status IN ('N', 'P', 'Y'))," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "t_imported VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_imported IN ('Y', 'N', 'P', 'T'))," "t_template VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_template IN ('Y', 'N'))," "t_import_id TEXT NOT NULL DEFAULT ''," "i_tmp INTEGER NOT NULL DEFAULT 0," "r_recurrentoperation_id INTEGER NOT NULL DEFAULT 0)") << QStringLiteral("INSERT INTO operation2 (" "id,i_group_id,i_number,d_date,rd_account_id,t_mode,r_payee_id,t_comment,rc_unit_id,t_status,t_bookmarked,t_imported,t_template,t_import_id,i_tmp,r_recurrentoperation_id) " "SELECT id,i_group_id,i_number,d_date,rd_account_id,t_mode,(CASE WHEN (SELECT payee.id FROM payee WHERE payee.t_name=operation.t_payee) IS NULL THEN 0 ELSE (SELECT payee.id FROM payee WHERE payee.t_name=operation.t_payee) END),t_comment,rc_unit_id,t_status,t_bookmarked,t_imported,t_template,t_import_id,i_tmp,r_recurrentoperation_id FROM operation") << QStringLiteral("DROP TABLE IF EXISTS operation") << QStringLiteral("ALTER TABLE operation2 RENAME TO operation") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, 't_payee', 't_PAYEE') WHERE t_name like '%_DEFAULT_PARAMETERS'") // ============ << QLatin1String("") << QStringLiteral("4.3") << QStringLiteral("4.4") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition, 't_payee', 't_PAYEE') WHERE t_definition like '%t_payee'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, 't_payee', 't_PAYEE') WHERE t_data like '%t_payee'") // ============ << QLatin1String("") << QStringLiteral("4.4") << QStringLiteral("4.5") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition, 't_payee', 't_PAYEE') WHERE t_definition like '%t_payee%'") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition, 't_payee', 't_PAYEE') WHERE t_action_definition like '%t_payee%'") // ============ << QLatin1String("") << QStringLiteral("4.5") << QStringLiteral("4.6") << QStringLiteral("DELETE FROM suboperation WHERE NOT EXISTS (SELECT 1 FROM operation WHERE operation.id=suboperation.rd_operation_id)") // ============ << QLatin1String("") << QStringLiteral("4.6") << QStringLiteral("4.7") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' smoothScrolling="N"', ' zoomPosition="0"') WHERE t_data like '% smoothScrolling="N"%'") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' smoothScrolling="Y"', ' zoomPosition="0"') WHERE t_data like '% smoothScrolling="Y"%'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' smoothScrolling="N"', ' zoomPosition="0"') WHERE t_value like '% smoothScrolling="N"%'") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' smoothScrolling="Y"', ' zoomPosition="0"') WHERE t_value like '% smoothScrolling="Y"%'") // ============ << QLatin1String("") << QStringLiteral("4.7") << QStringLiteral("4.8") << QStringLiteral("CREATE TABLE operationbalance(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "f_balance FLOAT NOT NULL DEFAULT 0," "r_operation_id INTEGER NOT NULL)") // ============ << QLatin1String("") << QStringLiteral("4.8") << QStringLiteral("4.9") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="t_ACCOUNTTYPE" nbLevelLines="0"', ' lines="" nbLevelLines="0"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"t_ACCOUNTTYPE\"\" nbLevelLines=\"\"0\"\"', ' lines=\"\"\"\" nbLevelLines=\"\"0\"\"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=&quot;t_ACCOUNTTYPE&quot; nbLevelLines=&quot;0&quot;', ' lines=&quot;&quot; nbLevelLines=&quot;0&quot;')") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=&quot;t_ACCOUNTTYPE&quot; nbLevelLines=&quot;0&quot;', ' lines=&quot;&quot; nbLevelLines=&quot;0&quot;')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="t_UNITTYPE"', ' lines="t_UNITTYPE" lines2="t_UNIT"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"t_UNITTYPE\"\"', ' lines=\"\"t_UNITTYPE\"\" lines2=\"\"t_UNIT\"\"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=&quot;t_UNITTYPE&quot;', ' lines=&quot;t_UNITTYPE&quot; lines2=&quot;t_UNIT&quot;')") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=&quot;t_UNITTYPE&quot;', ' lines=&quot;t_UNITTYPE&quot; lines2=&quot;t_UNIT&quot;')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines="t_ACCOUNTTYPE"', ' lines="t_ACCOUNTTYPE" lines2="t_ACCOUNT"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"t_ACCOUNTTYPE\"\"', ' lines=\"\"t_ACCOUNTTYPE\"\" lines2=\"\"t_ACCOUNT\"\"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=&quot;t_ACCOUNTTYPE&quot;', ' lines=&quot;t_ACCOUNTTYPE&quot; lines2=&quot;t_ACCOUNT&quot;')") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=&quot;t_ACCOUNTTYPE&quot;', ' lines=&quot;t_ACCOUNTTYPE&quot; lines2=&quot;t_ACCOUNT&quot;')") // ============ << QLatin1String("") << QStringLiteral("4.9") << QStringLiteral("5.0") << QStringLiteral("CREATE TABLE budget (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "rc_category_id INTEGER NOT NULL DEFAULT 0," "f_budgeted FLOAT NOT NULL DEFAULT 0.0," "i_year INTEGER NOT NULL DEFAULT 2010," "i_month INTEGER NOT NULL DEFAULT 0 CHECK (i_month>=0 AND i_month<=12)" ")") // ============ << QLatin1String("") << QStringLiteral("5.0") << QStringLiteral("5.1") << QStringLiteral("CREATE TABLE budgetrule (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "rc_category_id INTEGER NOT NULL DEFAULT 0," "i_year INTEGER NOT NULL DEFAULT 2010," "i_month INTEGER NOT NULL DEFAULT 0 CHECK (i_month>=0 AND i_month<=12)," "i_condition INTEGER NOT NULL DEFAULT 0 CHECK (i_condition IN (-1,0,1))," "f_quantity FLOAT NOT NULL DEFAULT 0.0," "t_absolute TEXT NOT NULL DEFAULT 'Y' CHECK (t_absolute IN ('Y', 'N'))," "rc_category_id_target INTEGER NOT NULL DEFAULT 0," "t_rule TEXT NOT NULL DEFAULT 'N' CHECK (t_rule IN ('N', 'C', 'Y'))" ")") // ============ << QLatin1String("") << QStringLiteral("5.1") << QStringLiteral("5.2") << QStringLiteral("CREATE TABLE budgetcategory(" "id INTEGER NOT NULL DEFAULT 0," "id_category INTEGER NOT NULL DEFAULT 0)") // ============ << QLatin1String("") << QStringLiteral("5.2") << QStringLiteral("5.3") << QStringLiteral("ALTER TABLE budget ADD COLUMN f_budgeted_modified FLOAT NOT NULL DEFAULT 0.0") << QStringLiteral("UPDATE budget SET f_budgeted_modified=f_budgeted") // ============ << QLatin1String("") << QStringLiteral("5.3") << QStringLiteral("5.4") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=""', ' lines="#NOTHING#"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=\"\"\"\"', ' lines=\"\"#NOTHING#\"\"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines=&quot;&quot;', ' lines=&quot;#NOTHING#&quot;')") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines=&quot;&quot;', ' lines=&quot;#NOTHING#&quot;')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines2=""', ' lines2="#NOTHING#"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines2=\"\"\"\"', ' lines2=\"\"#NOTHING#\"\"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' lines2=&quot;&quot;', ' lines2=&quot;#NOTHING#&quot;')") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' lines2=&quot;&quot;', ' lines2=&quot;#NOTHING#&quot;')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns=""', ' columns="#NOTHING#"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns=\"\"\"\"', ' columns=\"\"#NOTHING#\"\"')") << QStringLiteral("UPDATE node SET t_data=replace(t_data, ' columns=&quot;&quot;', ' columns=&quot;#NOTHING#&quot;')") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' columns=&quot;&quot;', ' columns=&quot;#NOTHING#&quot;')") // ============ << QLatin1String("") << QStringLiteral("5.4") << QStringLiteral("5.5") << QStringLiteral("ALTER TABLE budgetrule ADD COLUMN t_category_condition TEXT NOT NULL DEFAULT 'Y' CHECK (t_category_condition IN ('Y', 'N'))") << QStringLiteral("ALTER TABLE budgetrule ADD COLUMN t_year_condition TEXT NOT NULL DEFAULT 'Y' CHECK (t_year_condition IN ('Y', 'N'))") << QStringLiteral("ALTER TABLE budgetrule ADD COLUMN t_month_condition TEXT NOT NULL DEFAULT 'Y' CHECK (t_month_condition IN ('Y', 'N'))") << QStringLiteral("UPDATE budgetrule SET t_year_condition='Y'") << QStringLiteral("UPDATE budgetrule SET t_year_condition='N', i_year=2010 WHERE i_year=0") << QStringLiteral("UPDATE budgetrule SET t_month_condition='Y'") << QStringLiteral("UPDATE budgetrule SET t_month_condition='N', i_month=1 WHERE i_month=0") << QStringLiteral("UPDATE budgetrule SET t_category_condition='Y'") << QStringLiteral("UPDATE budgetrule SET t_category_condition='N' WHERE rc_category_id=0") // ============ << QLatin1String("") << QStringLiteral("5.5") << QStringLiteral("5.6") << QStringLiteral("ALTER TABLE budgetrule ADD COLUMN t_category_target TEXT NOT NULL DEFAULT 'Y' CHECK (t_category_target IN ('Y', 'N'))") << QStringLiteral("UPDATE budgetrule SET t_category_target='N'") // ============ << QLatin1String("") << QStringLiteral("5.6") << QStringLiteral("5.7") << QStringLiteral("ALTER TABLE budget ADD COLUMN f_transferred FLOAT NOT NULL DEFAULT 0.0") << QStringLiteral("UPDATE budget SET f_transferred=0") // ============ << QLatin1String("") << QStringLiteral("5.7") << QStringLiteral("5.8") << QStringLiteral("ALTER TABLE budget ADD COLUMN t_including_subcategories TEXT NOT NULL DEFAULT 'N' CHECK (t_including_subcategories IN ('Y', 'N'));") << QStringLiteral("UPDATE budget SET t_including_subcategories='N'") // ============ << QLatin1String("") << QStringLiteral("5.8") << QStringLiteral("5.9") << QStringLiteral("DELETE FROM parameters WHERE t_uuid_parent='advices';") // ============ << QLatin1String("") << QStringLiteral("5.9") << QStringLiteral("6.0") << QStringLiteral("UPDATE category SET t_name=t_name;") // ============ << QLatin1String("") << QStringLiteral("6.0") << QStringLiteral("6.1") << QStringLiteral("UPDATE node SET t_data=replace(t_data,'t_type', 't_TYPENLS')") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, 't_type', 't_TYPENLS') where t_name like '%_DEFAULT_PARAMETERS'") // ============ << QLatin1String("") << QStringLiteral("6.1") << QStringLiteral("6.2") << QStringLiteral("CREATE TABLE account2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL," "t_number TEXT NOT NULL DEFAULT ''," "t_agency_number TEXT NOT NULL DEFAULT ''," "t_agency_address TEXT NOT NULL DEFAULT ''," "t_comment TEXT NOT NULL DEFAULT ''," "t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "t_type VARCHAR(1) NOT NULL DEFAULT 'C' CHECK (t_type IN ('C', 'D', 'A', 'I', 'O', 'W'))," // C=current D=credit card A=assets (for objects) I=Investment W=Wallet O=other "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "rd_bank_id INTEGER NOT NULL)") << QStringLiteral("INSERT INTO account2 (id, t_name, t_number, t_agency_number, t_agency_address, t_comment, t_close, t_type, t_bookmarked, rd_bank_id) " "SELECT id, t_name, t_number, t_agency_number, t_agency_address, t_comment, t_close, t_type, t_bookmarked, rd_bank_id FROM account") << QStringLiteral("DROP TABLE IF EXISTS account") << QStringLiteral("ALTER TABLE account2 RENAME TO account") // ============ << QLatin1String("") << QStringLiteral("6.2") << QStringLiteral("6.3") << QStringLiteral("ALTER TABLE suboperation ADD COLUMN t_formula TEXT NOT NULL DEFAULT '';") << QStringLiteral("UPDATE suboperation SET t_formula=''") // ============ << QLatin1String("") << QStringLiteral("6.3") << QStringLiteral("6.4") << QStringLiteral("CREATE TABLE vm_category_display_tmp( id INT, t_name TEXT, t_fullname TEXT, rd_category_id INT, i_NBOPERATIONS, f_REALCURRENTAMOUNT)") // ============ << QLatin1String("") << QStringLiteral("6.4") << QStringLiteral("6.5") << QStringLiteral("ALTER TABLE category ADD COLUMN t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'));") << QStringLiteral("ALTER TABLE payee ADD COLUMN t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'));") << QStringLiteral("UPDATE category SET t_bookmarked='N'") << QStringLiteral("UPDATE payee SET t_bookmarked='N'") // ============ << QLatin1String("") << QStringLiteral("6.5") << QStringLiteral("6.6") << QStringLiteral("CREATE TABLE vm_budget_tmp( id INT, rc_category_id INT, f_budgeted REAL, i_year INT, i_month INT, f_budgeted_modified REAL, f_transferred REAL, t_including_subcategories TEXT, t_CATEGORY, t_PERIOD, f_CURRENTAMOUNT, t_RULES)") // ============ << QLatin1String("") << QStringLiteral("6.6") << QStringLiteral("6.7") << QStringLiteral("DROP TABLE IF EXISTS vm_category_display_tmp") << QStringLiteral("CREATE TABLE vm_category_display_tmp( id INT, t_name TEXT, t_fullname TEXT, rd_category_id INT, i_NBOPERATIONS, f_REALCURRENTAMOUNT, t_bookmarked)") // ============ << QLatin1String("") << QStringLiteral("6.7") << QStringLiteral("6.8") << QStringLiteral("CREATE TABLE recurrentoperation2 (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "rd_operation_id INTEGER NOT NULL," "i_period_increment INTEGER NOT NULL DEFAULT 1 CHECK (i_period_increment>=0)," "t_period_unit TEXT NOT NULL DEFAULT 'M' CHECK (t_period_unit IN ('D', 'W', 'M', 'Y'))," "t_auto_write VARCHAR(1) DEFAULT 'Y' CHECK (t_auto_write IN ('Y', 'N'))," "i_auto_write_days INTEGER NOT NULL DEFAULT 5 CHECK (i_auto_write_days>=0)," "t_warn VARCHAR(1) DEFAULT 'Y' CHECK (t_warn IN ('Y', 'N'))," "i_warn_days INTEGER NOT NULL DEFAULT 5 CHECK (i_warn_days>=0)," "t_times VARCHAR(1) DEFAULT 'N' CHECK (t_times IN ('Y', 'N'))," "i_nb_times INTEGER NOT NULL DEFAULT 1 CHECK (i_nb_times>=0)" ")") << QStringLiteral("INSERT INTO recurrentoperation2 (id,d_date,rd_operation_id,i_period_increment,t_period_unit,t_auto_write,i_auto_write_days,t_warn,i_warn_days,t_times,i_nb_times) " "SELECT id,d_date,rd_operation_id,i_period_increment,t_period_unit,t_auto_write,i_auto_write_days,t_warn,i_warn_days,t_times,i_nb_times FROM recurrentoperation") << QStringLiteral("DROP TABLE IF EXISTS recurrentoperation") << QStringLiteral("ALTER TABLE recurrentoperation2 RENAME TO recurrentoperation") // ============ << QLatin1String("") << QStringLiteral("6.8") << QStringLiteral("6.9") << "CREATE TABLE category2 (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL DEFAULT '' CHECK (t_name NOT LIKE '%" % OBJECTSEPARATOR % "%')," "t_fullname TEXT," "rd_category_id INT," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))" ")" << QStringLiteral("INSERT INTO category2 (id, t_name, t_fullname, rd_category_id, t_bookmarked) " "SELECT id, t_name, t_fullname, r_category_id, t_bookmarked FROM category") << QStringLiteral("DROP TABLE IF EXISTS category") << QStringLiteral("ALTER TABLE category2 RENAME TO category") << QStringLiteral("DROP TABLE IF EXISTS vm_category_display_tmp") << QStringLiteral("CREATE TABLE vm_category_display_tmp( id INT, t_name TEXT, t_fullname TEXT, rd_category_id INT, i_NBOPERATIONS, f_REALCURRENTAMOUNT, t_bookmarked)") // ============ << QLatin1String("") << QStringLiteral("6.9") << QStringLiteral("7.0") << QStringLiteral("DELETE FROM parameters WHERE t_name LIKE 'SKG_MONTHLY_REPORT_%'") // ============ SKROOGE 1.0.0 ^^^ << QLatin1String("") << QStringLiteral("7.0") << QStringLiteral("7.1") << QStringLiteral("ALTER TABLE unit ADD COLUMN t_source TEXT NOT NULL DEFAULT ''") << QStringLiteral("UPDATE unit SET t_source=''") // ============ << QLatin1String("") << QStringLiteral("7.1") << QStringLiteral("7.2") << QStringLiteral("UPDATE unit SET t_source='Yahoo' WHERE t_source='' AND t_internet_code<>''") // ============ << QLatin1String("") << QStringLiteral("7.2") << QStringLiteral("7.3") << QStringLiteral("CREATE TABLE account2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL," "t_number TEXT NOT NULL DEFAULT ''," "t_agency_number TEXT NOT NULL DEFAULT ''," "t_agency_address TEXT NOT NULL DEFAULT ''," "t_comment TEXT NOT NULL DEFAULT ''," "t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "t_type VARCHAR(1) NOT NULL DEFAULT 'C' CHECK (t_type IN ('C', 'D', 'A', 'I', 'L', 'W', 'O'))," // C=current D=credit card A=assets (for objects) I=Investment W=Wallet L=Loan O=other "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "rd_bank_id INTEGER NOT NULL)") << QStringLiteral("INSERT INTO account2 (id, t_name, t_number, t_agency_number, t_agency_address, t_comment, t_close, t_type, t_bookmarked, rd_bank_id) " "SELECT id, t_name, t_number, t_agency_number, t_agency_address, t_comment, t_close, t_type, t_bookmarked, rd_bank_id FROM account") << QStringLiteral("DROP TABLE IF EXISTS account") << QStringLiteral("ALTER TABLE account2 RENAME TO account") // ============ SKROOGE 1.1.0 ^^^ << QLatin1String("") << QStringLiteral("7.3") << QStringLiteral("7.4") << QStringLiteral("ALTER TABLE unit ADD COLUMN t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))") << QStringLiteral("UPDATE unit SET t_bookmarked='N'") // ============ << QLatin1String("") << QStringLiteral("7.4") << QStringLiteral("7.5") << QStringLiteral("DELETE FROM parameters WHERE t_name LIKE 'SKGOPERATION_%'") // ============ << QLatin1String("") << QStringLiteral("7.5") << QStringLiteral("7.6") << "CREATE TABLE category2 (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL DEFAULT '' CHECK (t_name NOT LIKE '%" % OBJECTSEPARATOR % "%')," "t_fullname TEXT," "rd_category_id INTEGER NOT NULL DEFAULT 0," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))" ")" << QStringLiteral("INSERT INTO category2 (id, t_name, t_fullname, rd_category_id, t_bookmarked) " "SELECT id, t_name, t_fullname, (CASE WHEN rd_category_id IS NULL OR rd_category_id='' THEN 0 ELSE rd_category_id END), t_bookmarked FROM category") << QStringLiteral("DROP TABLE IF EXISTS category") << QStringLiteral("ALTER TABLE category2 RENAME TO category") // ============ << QLatin1String("") << QStringLiteral("7.6") << QStringLiteral("7.7") << QStringLiteral("ALTER TABLE operationbalance ADD COLUMN f_balance_entered FLOAT NOT NULL DEFAULT 0") // ============ SKROOGE 1.3.2 ^^^ << QLatin1String("") << QStringLiteral("7.7") << QStringLiteral("7.8") << QStringLiteral("CREATE TABLE account2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL," "t_number TEXT NOT NULL DEFAULT ''," "t_agency_number TEXT NOT NULL DEFAULT ''," "t_agency_address TEXT NOT NULL DEFAULT ''," "t_comment TEXT NOT NULL DEFAULT ''," "t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "t_type VARCHAR(1) NOT NULL DEFAULT 'C' CHECK (t_type IN ('C', 'D', 'A', 'I', 'L', 'W', 'S', 'O'))," // C=current D=credit card A=assets (for objects) I=Investment W=Wallet L=Loan S=Saving O=other "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "rd_bank_id INTEGER NOT NULL)") << QStringLiteral("INSERT INTO account2 (id, t_name, t_number, t_agency_number, t_agency_address, t_comment, t_close, t_type, t_bookmarked, rd_bank_id) " "SELECT id, t_name, t_number, t_agency_number, t_agency_address, t_comment, t_close, t_type, t_bookmarked, rd_bank_id FROM account") << QStringLiteral("DROP TABLE IF EXISTS account") << QStringLiteral("ALTER TABLE account2 RENAME TO account") // ============ << QLatin1String("") << QStringLiteral("7.8") << QStringLiteral("7.9") << QStringLiteral("DROP TABLE IF EXISTS vm_budget_tmp") << QStringLiteral("CREATE TABLE vm_budget_tmp( id INT, rc_category_id INT, f_budgeted REAL, i_year INT, i_month INT, f_budgeted_modified REAL, f_transferred REAL, t_including_subcategories TEXT, t_CATEGORY, t_PERIOD, f_CURRENTAMOUNT, t_RULES)") << QStringLiteral("DROP TABLE IF EXISTS vm_category_display_tmp") << QStringLiteral("CREATE TABLE vm_category_display_tmp( id INT, t_name TEXT, t_fullname TEXT, rd_category_id INT, i_NBOPERATIONS, f_REALCURRENTAMOUNT, t_bookmarked)") // ============ SKROOGE 1.3.3 ^^^ << QLatin1String("") << QStringLiteral("7.9") << QStringLiteral("8.0") << QStringLiteral("DROP TABLE IF EXISTS operationbalance") << QStringLiteral("CREATE TABLE operationbalance(" "r_operation_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "f_balance FLOAT NOT NULL DEFAULT 0," "f_balance_entered FLOAT NOT NULL DEFAULT 0)") << QLatin1String("") << QStringLiteral("8.0") << QStringLiteral("8.1") << QStringLiteral("DROP TABLE IF EXISTS operationbalance") << QStringLiteral("CREATE TABLE operationbalance(" "r_operation_id INTEGER NOT NULL," "f_balance FLOAT NOT NULL DEFAULT 0," "f_balance_entered FLOAT NOT NULL DEFAULT 0)") // ============ SKROOGE 1.4.0 ^^^ << QLatin1String("") << QStringLiteral("8.1") << QStringLiteral("8.2") << QStringLiteral("DROP TABLE IF EXISTS budgetcategory") << QStringLiteral("CREATE TABLE budgetsuboperation(" "id INTEGER NOT NULL DEFAULT 0," "id_suboperation INTEGER NOT NULL DEFAULT 0," "i_priority INTEGER NOT NULL DEFAULT 0)") << QLatin1String("") << QStringLiteral("8.2") << QStringLiteral("8.3") << QStringLiteral("DROP TABLE IF EXISTS vm_category_display_tmp") << QStringLiteral("DROP TRIGGER IF EXISTS fkdc_category_vm_category_display_tmp_id_rd_category_id") // ============ SKROOGE 1.7.4 ^^^ << QLatin1String("") << QStringLiteral("8.3") << QStringLiteral("8.4") << QStringLiteral("ALTER TABLE account ADD COLUMN f_maxamount FLOAT NOT NULL DEFAULT 10000.0") << QStringLiteral("ALTER TABLE account ADD COLUMN t_maxamount_enabled VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))") << QStringLiteral("ALTER TABLE account ADD COLUMN f_minamount FLOAT NOT NULL DEFAULT 0.0") << QStringLiteral("ALTER TABLE account ADD COLUMN t_minamount_enabled VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))") << QStringLiteral("UPDATE account SET f_maxamount=10000.0, t_maxamount_enabled='N', f_minamount=0.0, t_minamount_enabled='N'") // ============ SKROOGE 1.7.7 ^^^ << QLatin1String("") << QStringLiteral("8.4") << QStringLiteral("8.5") << QStringLiteral("ALTER TABLE account ADD COLUMN d_reconciliationdate DATE") // ============ << QLatin1String("") << QStringLiteral("8.5") << QStringLiteral("8.6") << QStringLiteral("CREATE TABLE account2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL," "t_number TEXT NOT NULL DEFAULT ''," "t_agency_number TEXT NOT NULL DEFAULT ''," "t_agency_address TEXT NOT NULL DEFAULT ''," "t_comment TEXT NOT NULL DEFAULT ''," "t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "t_type VARCHAR(1) NOT NULL DEFAULT 'C' CHECK (t_type IN ('C', 'D', 'A', 'I', 'L', 'W', 'S', 'P', 'O'))," // C=current D=credit card A=assets (for objects) I=Investment W=Wallet L=Loan S=Saving P=Pension O=other "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "f_maxamount FLOAT NOT NULL DEFAULT 10000.0," "t_maxamount_enabled VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "f_minamount FLOAT NOT NULL DEFAULT 0.0," "t_minamount_enabled VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "d_reconciliationdate DATE," "rd_bank_id INTEGER NOT NULL)") << QStringLiteral("INSERT INTO account2 (id, t_name, t_number, t_agency_number, t_agency_address, t_comment, t_close, t_type, t_bookmarked, f_maxamount, t_maxamount_enabled, f_minamount, t_minamount_enabled, d_reconciliationdate, rd_bank_id) " "SELECT id, t_name, t_number, t_agency_number, t_agency_address, t_comment, t_close, t_type, t_bookmarked, f_maxamount, t_maxamount_enabled, f_minamount, t_minamount_enabled, d_reconciliationdate, rd_bank_id FROM account") << QStringLiteral("DROP TABLE IF EXISTS account") << QStringLiteral("ALTER TABLE account2 RENAME TO account") // ============ SKROOGE 1.8.0 ^^^ << QLatin1String("") << QStringLiteral("8.6") << QStringLiteral("8.7") << QStringLiteral("ALTER TABLE suboperation ADD COLUMN d_date DATE NOT NULL DEFAULT '0000-00-00'") << QStringLiteral("UPDATE suboperation SET d_date=(SELECT d_date FROM operation WHERE suboperation.rd_operation_id=operation.id)") << QLatin1String("") << QStringLiteral("8.7") << QStringLiteral("8.8") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition, '\"d_date\"', '\"d_DATEOP\"') WHERE t_action_definition like '%\"d_date\"%'") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition, '\"d_date\"', '\"d_DATEOP\"') WHERE t_definition like '%\"d_date\"%'") // ============ SKROOGE 1.9.0 ^^^ << QLatin1String("") << QStringLiteral("8.8") << QStringLiteral("8.9") << QStringLiteral("ALTER TABLE suboperation ADD COLUMN i_order INTEGER NOT NULL DEFAULT 0") << QStringLiteral("UPDATE suboperation SET i_order=id") << QLatin1String("") << QStringLiteral("8.9") << QStringLiteral("9.0") << QStringLiteral("ALTER TABLE account ADD COLUMN r_account_id INTEGER NOT NULL DEFAULT 0") << QStringLiteral("UPDATE account SET r_account_id=0") << QLatin1String("") << QStringLiteral("9.0") << QStringLiteral("9.1") << QStringLiteral("CREATE TABLE rule2 (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_description TEXT NOT NULL DEFAULT ''," "t_definition TEXT NOT NULL DEFAULT ''," "t_action_description TEXT NOT NULL DEFAULT ''," "t_action_definition TEXT NOT NULL DEFAULT ''," "t_action_type VARCHAR(1) DEFAULT 'S' CHECK (t_action_type IN ('S', 'U', 'A', 'T'))," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "f_sortorder FLOAT" ")") << QStringLiteral("INSERT INTO rule2 (id, t_description, t_definition, t_action_description, t_action_definition, t_action_type, t_bookmarked,f_sortorder) SELECT id, t_description, t_definition, t_action_description, t_action_definition, t_action_type, t_bookmarked,f_sortorder FROM rule") << QStringLiteral("DROP TABLE IF EXISTS rule") << QStringLiteral("ALTER TABLE rule2 RENAME TO rule") << QLatin1String("") << QStringLiteral("9.1") << QStringLiteral("9.2") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' limitVisible=&amp;quot;Y&amp;quot; ', ' limitVisible=&amp;quot;Y&amp;quot; averageVisible=&amp;quot;Y&amp;quot; ')") << QStringLiteral("UPDATE parameters SET t_value=replace(t_value, ' limitVisible=&amp;quot;N&amp;quot; ', ' limitVisible=&amp;quot;N&amp;quot; averageVisible=&amp;quot;N&amp;quot; ')") << QLatin1String("") << QStringLiteral("9.2") << QStringLiteral("9.3") << QStringLiteral("CREATE TABLE operation2 (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "i_group_id INTEGER NOT NULL DEFAULT 0," "i_number INTEGER DEFAULT 0 CHECK (i_number>=0)," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "d_createdate DATE NOT NULL DEFAULT CURRENT_TIMESTAMP," "rd_account_id INTEGER NOT NULL," "t_mode TEXT NOT NULL DEFAULT ''," "r_payee_id INTEGER NOT NULL DEFAULT 0," "t_comment TEXT NOT NULL DEFAULT ''," "rc_unit_id INTEGER NOT NULL," "t_status VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_status IN ('N', 'P', 'Y'))," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "t_imported VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_imported IN ('Y', 'N', 'P', 'T'))," "t_template VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_template IN ('Y', 'N'))," "t_import_id TEXT NOT NULL DEFAULT ''," "i_tmp INTEGER NOT NULL DEFAULT 0," "r_recurrentoperation_id INTEGER NOT NULL DEFAULT 0)") << QStringLiteral("INSERT INTO operation2 (id, i_group_id, i_number, d_date, d_createdate, rd_account_id, t_mode, r_payee_id, t_comment," "rc_unit_id, t_status, t_bookmarked, t_imported, t_template, t_import_id, i_tmp, r_recurrentoperation_id) " "SELECT id, i_group_id, i_number, d_date, CURRENT_TIMESTAMP, rd_account_id, t_mode, r_payee_id, t_comment," "rc_unit_id, t_status, t_bookmarked, t_imported, t_template, t_import_id, i_tmp, r_recurrentoperation_id FROM operation") << QStringLiteral("DROP TABLE IF EXISTS operation") << QStringLiteral("ALTER TABLE operation2 RENAME TO operation") << QLatin1String("") << QStringLiteral("9.3") << QStringLiteral("9.4") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition,'#ATT#>=#V1# AND #ATT#<=#V2#','((#ATT#>=#V1# AND #ATT#<=#V2#) OR (#ATT#>=#V2# AND #ATT#<=#V1#))')") << QLatin1String("") << QStringLiteral("9.4") << QStringLiteral("9.5") << QStringLiteral("ALTER TABLE account ADD COLUMN f_importbalance FLOAT") << QStringLiteral("UPDATE account SET f_importbalance=NULL") // ============ SKROOGE 2.4.0 ^^^ << QLatin1String("") << QStringLiteral("9.5") << QStringLiteral("9.6") << QStringLiteral("CREATE TABLE IF NOT EXISTS vm_budget_tmp( id INT, rc_category_id INT, f_budgeted REAL, i_year INT, i_month INT, f_budgeted_modified REAL, f_transferred REAL, t_including_subcategories TEXT, t_CATEGORY, t_PERIOD, f_CURRENTAMOUNT, t_RULES)") << QStringLiteral("ALTER TABLE budgetrule ADD COLUMN f_sortorder FLOAT") << QStringLiteral("UPDATE budgetrule SET f_sortorder=id WHERE f_sortorder IS NULL OR f_sortorder=''") << QLatin1String("") << QStringLiteral("9.6") << QStringLiteral("9.7") << QStringLiteral("ALTER TABLE budget ADD COLUMN t_modification_reasons TEXT NOT NULL DEFAULT ''") << QStringLiteral("UPDATE budget SET t_modification_reasons=''") // ============ SKROOGE 2.8.1 ^^^ << QLatin1String("") << QStringLiteral("9.7") << QStringLiteral("9.8") << QStringLiteral("UPDATE operation SET d_createdate=d_date WHERE d_createdate=''") // ============ SKROOGE 2.9.0 ^^^ << QLatin1String("") << QStringLiteral("9.8") << QStringLiteral("9.9") << QStringLiteral("ALTER TABLE payee ADD r_category_id INTEGER NOT NULL DEFAULT 0") << QStringLiteral("UPDATE payee SET r_category_id=0") << QLatin1String("") << QStringLiteral("9.9") << QStringLiteral("10.0") << QStringLiteral("ALTER TABLE payee ADD t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))") << QStringLiteral("UPDATE payee SET t_close='N'") << QLatin1String("") << QStringLiteral("10.0") << QStringLiteral("10.1") << QStringLiteral("ALTER TABLE category ADD t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))") << QStringLiteral("UPDATE category SET t_close='N'") // ============ SKROOGE 2.11.0 ^^^ << QLatin1String("") << QStringLiteral("10.1") << QStringLiteral("10.2") << QStringLiteral("CREATE TABLE operation2(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "i_group_id INTEGER NOT NULL DEFAULT 0," "t_number TEXT NOT NULL DEFAULT ''," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "d_createdate DATE NOT NULL DEFAULT CURRENT_TIMESTAMP," "rd_account_id INTEGER NOT NULL," "t_mode TEXT NOT NULL DEFAULT ''," "r_payee_id INTEGER NOT NULL DEFAULT 0," "t_comment TEXT NOT NULL DEFAULT ''," "rc_unit_id INTEGER NOT NULL," "t_status VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_status IN ('N', 'P', 'Y'))," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "t_imported VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_imported IN ('Y', 'N', 'P', 'T'))," "t_template VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_template IN ('Y', 'N'))," "t_import_id TEXT NOT NULL DEFAULT ''," "i_tmp INTEGER NOT NULL DEFAULT 0," "r_recurrentoperation_id INTEGER NOT NULL DEFAULT 0)") << QStringLiteral("INSERT INTO operation2 (id, i_group_id, t_number, d_date, d_createdate, rd_account_id, t_mode, r_payee_id, t_comment," "rc_unit_id, t_status, t_bookmarked, t_imported, t_template, t_import_id, i_tmp, r_recurrentoperation_id) " "SELECT id, i_group_id, (CASE WHEN i_number=0 OR i_number IS NULL THEN '' ELSE i_number END), d_date, CURRENT_TIMESTAMP, rd_account_id, t_mode, r_payee_id, t_comment," "rc_unit_id, t_status, t_bookmarked, t_imported, t_template, t_import_id, i_tmp, r_recurrentoperation_id FROM operation") << QStringLiteral("DROP TABLE IF EXISTS operation") << QStringLiteral("ALTER TABLE operation2 RENAME TO operation") << QLatin1String("") << QStringLiteral("10.2") << QStringLiteral("10.3") << QStringLiteral("UPDATE rule SET t_definition=replace(t_definition, 'i_number', 't_number')") << QStringLiteral("UPDATE rule SET t_action_definition=replace(t_action_definition, 'i_number', 't_number')") // ============ SKROOGE 2.11.0 ^^^ << QLatin1String("") << QStringLiteral("10.3") << QStringLiteral("10.4") << QStringLiteral("ALTER TABLE account ADD COLUMN f_reconciliationbalance FLOAT") << QStringLiteral("UPDATE account SET f_reconciliationbalance=NULL") // ============ SKROOGE 2.13.0 ^^^ << QLatin1String("") << QStringLiteral("10.4") << QStringLiteral("10.5") << QStringLiteral("ALTER TABLE account ADD COLUMN d_importdate DATE"); return migrationSteps; } SKGError SKGDocumentBank::migrate(bool& oMigrationDone) { SKGError err; SKGTRACEINFUNCRC(5, err); oMigrationDone = false; QStringList migrationSteps = getMigationSteps(); { int nbSteps = migrationSteps.count(); SKGBEGINPROGRESSTRANSACTION(*this, "#INTERNAL#" % i18nc("Progression step", "Migrate document"), err, 5); IFOK(err) { QString version = getParameter(QStringLiteral("SKG_DB_BANK_VERSION")); QString initialversion = version; QString lastversion = QStringLiteral("10.6"); if (version.isEmpty()) { SKGTRACEL(10) << "Initial creation" << endl; /** * This constant is used to initialized the data model. * Rules for attribute name: * t_xxx for TEXT and VARCHAR * d_xxx for DATE * f_xxx for FLOAT * i_xxx for INTEGER * r_xxx for a link without constraint * rc_pointed_table_pointed_attribute_xxx for link on other an object in named "pointed_table" with "pointed_attribute"=id of pointing object * a constraint will be created without DELETE CASCADE * rd_pointed_table_pointed_attribute_xxx for link on other an object in named "pointed_table" with "pointed_attribute"=id of pointing object * a constraint will be created with DELETE CASCADE * xxx must be in lower case for R/W attributes and in upper case for R/O attributes * Rules for table name: * v_yyy for views */ QStringList BankInitialDataModel; BankInitialDataModel // ================================================================== // Table unit << QStringLiteral("CREATE TABLE unit(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL," "t_symbol TEXT NOT NULL DEFAULT ''," "t_country TEXT NOT NULL DEFAULT ''," "t_type VARCHAR(1) NOT NULL DEFAULT 'C' CHECK (t_type IN ('1', '2', 'C', 'S', 'I', 'O'))," // 1=main currency, 2=secondary currency, C=currencies S=share, I=index, O=object "t_internet_code TEXT NOT NULL DEFAULT ''," "i_nbdecimal INT NOT NULL DEFAULT 2," "rd_unit_id INTEGER NOT NULL DEFAULT 0," "t_source TEXT NOT NULL DEFAULT ''," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))" ")") // ================================================================== // Table unitvalue << QStringLiteral("CREATE TABLE unitvalue(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "rd_unit_id INTEGER NOT NULL," "d_date DATE NOT NULL," "f_quantity FLOAT NOT NULL CHECK (f_quantity>=0))") // ================================================================== // Table bank << QStringLiteral("CREATE TABLE bank (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL DEFAULT ''," "t_bank_number TEXT NOT NULL DEFAULT ''," "t_icon TEXT NOT NULL DEFAULT '')") // ================================================================== // Table account << QStringLiteral("CREATE TABLE account(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL," "t_number TEXT NOT NULL DEFAULT ''," "t_agency_number TEXT NOT NULL DEFAULT ''," "t_agency_address TEXT NOT NULL DEFAULT ''," "t_comment TEXT NOT NULL DEFAULT ''," "t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "t_type VARCHAR(1) NOT NULL DEFAULT 'C' CHECK (t_type IN ('C', 'D', 'A', 'I', 'L', 'W', 'S', 'P', 'O'))," // C=current D=credit card A=assets (for objects) I=Investment W=Wallet L=Loan S=Saving P=Pension O=other "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "f_maxamount FLOAT NOT NULL DEFAULT 10000.0," "t_maxamount_enabled VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "f_minamount FLOAT NOT NULL DEFAULT 0.0," "t_minamount_enabled VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "d_importdate DATE," "f_importbalance FLOAT," "d_reconciliationdate DATE," "f_reconciliationbalance FLOAT," "r_account_id INTEGER NOT NULL DEFAULT 0," "rd_bank_id INTEGER NOT NULL)") // ================================================================== // Table interest << QStringLiteral("CREATE TABLE interest(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "rd_account_id INTEGER NOT NULL," "d_date DATE NOT NULL," "f_rate FLOAT NOT NULL CHECK (f_rate>=0)," "t_income_value_date_mode VARCHAR(1) NOT NULL DEFAULT 'F' CHECK (t_income_value_date_mode IN ('F', '0', '1', '2', '3', '4', '5'))," "t_expenditure_value_date_mode VARCHAR(1) NOT NULL DEFAULT 'F' CHECK (t_expenditure_value_date_mode IN ('F', '0', '1', '2', '3', '4', '5'))," "t_base VARCHAR(3) NOT NULL DEFAULT '24' CHECK (t_base IN ('24', '360', '365'))" ")") // ================================================================== // Table category << "CREATE TABLE category (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL DEFAULT '' CHECK (t_name NOT LIKE '%" % OBJECTSEPARATOR % "%')," "t_fullname TEXT," "t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "rd_category_id INTEGER NOT NULL DEFAULT 0," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))" ")" // ================================================================== // Table operation << QStringLiteral("CREATE TABLE operation(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "i_group_id INTEGER NOT NULL DEFAULT 0," "t_number TEXT NOT NULL DEFAULT ''," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "d_createdate DATE NOT NULL DEFAULT CURRENT_TIMESTAMP," "rd_account_id INTEGER NOT NULL," "t_mode TEXT NOT NULL DEFAULT ''," "r_payee_id INTEGER NOT NULL DEFAULT 0," "t_comment TEXT NOT NULL DEFAULT ''," "rc_unit_id INTEGER NOT NULL," "t_status VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_status IN ('N', 'P', 'Y'))," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "t_imported VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_imported IN ('Y', 'N', 'P', 'T'))," "t_template VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_template IN ('Y', 'N'))," "t_import_id TEXT NOT NULL DEFAULT ''," "i_tmp INTEGER NOT NULL DEFAULT 0," "r_recurrentoperation_id INTEGER NOT NULL DEFAULT 0)") << QStringLiteral("CREATE TABLE operationbalance(" "r_operation_id INTEGER NOT NULL," "f_balance FLOAT NOT NULL DEFAULT 0," "f_balance_entered FLOAT NOT NULL DEFAULT 0)") // ================================================================== // Table refund << QStringLiteral("CREATE TABLE refund (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL DEFAULT ''," "t_comment TEXT NOT NULL DEFAULT ''," "t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N')))") // ================================================================== // Table payee << QStringLiteral("CREATE TABLE payee (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_name TEXT NOT NULL DEFAULT ''," "t_address TEXT NOT NULL DEFAULT ''," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "t_close VARCHAR(1) DEFAULT 'N' CHECK (t_close IN ('Y', 'N'))," "r_category_id INTEGER NOT NULL DEFAULT 0" ")") // ================================================================== // Table suboperation << QStringLiteral("CREATE TABLE suboperation(" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "t_comment TEXT NOT NULL DEFAULT ''," "rd_operation_id INTEGER NOT NULL," "r_category_id INTEGER NOT NULL DEFAULT 0," "f_value FLOAT NOT NULL DEFAULT 0.0," "t_formula TEXT NOT NULL DEFAULT ''," "i_tmp INTEGER NOT NULL DEFAULT 0," "r_refund_id INTEGER NOT NULL DEFAULT 0," "i_order INTEGER NOT NULL DEFAULT 0" ")") // ================================================================== // Table recurrentoperation << QStringLiteral("CREATE TABLE recurrentoperation (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "d_date DATE NOT NULL DEFAULT '0000-00-00'," "rd_operation_id INTEGER NOT NULL," "i_period_increment INTEGER NOT NULL DEFAULT 1 CHECK (i_period_increment>=0)," "t_period_unit TEXT NOT NULL DEFAULT 'M' CHECK (t_period_unit IN ('D', 'W', 'M', 'Y'))," "t_auto_write VARCHAR(1) DEFAULT 'Y' CHECK (t_auto_write IN ('Y', 'N'))," "i_auto_write_days INTEGER NOT NULL DEFAULT 5 CHECK (i_auto_write_days>=0)," "t_warn VARCHAR(1) DEFAULT 'Y' CHECK (t_warn IN ('Y', 'N'))," "i_warn_days INTEGER NOT NULL DEFAULT 5 CHECK (i_warn_days>=0)," "t_times VARCHAR(1) DEFAULT 'N' CHECK (t_times IN ('Y', 'N'))," "i_nb_times INTEGER NOT NULL DEFAULT 1 CHECK (i_nb_times>=0)" ")") // ================================================================== // Table rule << QStringLiteral("CREATE TABLE rule (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "t_description TEXT NOT NULL DEFAULT ''," "t_definition TEXT NOT NULL DEFAULT ''," "t_action_description TEXT NOT NULL DEFAULT ''," "t_action_definition TEXT NOT NULL DEFAULT ''," "t_action_type VARCHAR(1) DEFAULT 'S' CHECK (t_action_type IN ('S', 'U', 'A', 'T'))," "t_bookmarked VARCHAR(1) NOT NULL DEFAULT 'N' CHECK (t_bookmarked IN ('Y', 'N'))," "f_sortorder FLOAT" ")") // ================================================================== // Table budget << QStringLiteral("CREATE TABLE budget (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "rc_category_id INTEGER NOT NULL DEFAULT 0," "t_including_subcategories TEXT NOT NULL DEFAULT 'N' CHECK (t_including_subcategories IN ('Y', 'N'))," "f_budgeted FLOAT NOT NULL DEFAULT 0.0," "f_budgeted_modified FLOAT NOT NULL DEFAULT 0.0," "t_modification_reasons TEXT NOT NULL DEFAULT ''," "f_transferred FLOAT NOT NULL DEFAULT 0.0," "i_year INTEGER NOT NULL DEFAULT 2010," "i_month INTEGER NOT NULL DEFAULT 0 CHECK (i_month>=0 AND i_month<=12)" ")") << QStringLiteral("CREATE TABLE budgetsuboperation(" "id INTEGER NOT NULL DEFAULT 0," "id_suboperation INTEGER NOT NULL DEFAULT 0," "i_priority INTEGER NOT NULL DEFAULT 0)") << QStringLiteral("CREATE TABLE budgetrule (" "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," "rc_category_id INTEGER NOT NULL DEFAULT 0," "t_category_condition TEXT NOT NULL DEFAULT 'Y' CHECK (t_category_condition IN ('Y', 'N'))," "t_year_condition TEXT NOT NULL DEFAULT 'Y' CHECK (t_year_condition IN ('Y', 'N'))," "i_year INTEGER NOT NULL DEFAULT 2010," "i_month INTEGER NOT NULL DEFAULT 0 CHECK (i_month>=0 AND i_month<=12)," "t_month_condition TEXT NOT NULL DEFAULT 'Y' CHECK (t_month_condition IN ('Y', 'N'))," "i_condition INTEGER NOT NULL DEFAULT 0 CHECK (i_condition IN (-1,0,1))," "f_quantity FLOAT NOT NULL DEFAULT 0.0," "t_absolute TEXT NOT NULL DEFAULT 'Y' CHECK (t_absolute IN ('Y', 'N'))," "rc_category_id_target INTEGER NOT NULL DEFAULT 0," "t_category_target TEXT NOT NULL DEFAULT 'Y' CHECK (t_category_target IN ('Y', 'N'))," "t_rule TEXT NOT NULL DEFAULT 'N' CHECK (t_rule IN ('N', 'C', 'Y'))," "f_sortorder FLOAT" ")") << QStringLiteral("CREATE TABLE vm_budget_tmp(" "id INT," "rc_category_id INT," "f_budgeted REAL," "i_year INT," "i_month INT," "f_budgeted_modified REAL," "t_modification_reasons TEXT," "f_transferred REAL," "t_including_subcategories TEXT," "t_CATEGORY TEXT," "t_PERIOD TEXT," "f_CURRENTAMOUNT REAL," "t_RULES TEXT)"); IFOKDO(err, this->executeSqliteOrders(BankInitialDataModel)) // Set new version version = lastversion; IFOKDO(err, SKGDocument::setParameter(QStringLiteral("SKG_DB_BANK_VERSION"), version)) } if (!err && SKGServices::stringToDouble(version) > SKGServices::stringToDouble(lastversion)) { err = SKGError(ERR_ABORT, i18nc("Error message", "Impossible to load a document generated by a more recent version")); } IFOK(err) { QString v1; QString v2; bool computeCaches = false; for (int i = 0; !err && i < nbSteps; ++i) { if (migrationSteps.at(i).isEmpty()) { ++i; v1 = migrationSteps.at(i); ++i; v2 = migrationSteps.at(i); if (version == v1) { SKGTRACEL(10) << "Migration from " << v1 << " to " << v2 << endl; for (int j = i + 1; !err && j < nbSteps; ++j) { const QString& sql = migrationSteps.at(j); if (!sql.isEmpty()) { ++i; IFOKDO(err, this->executeSqliteOrder(sql)) } else { break; } } if (v1 == QStringLiteral("4.7") || v1 == QStringLiteral("5.1") || v1 == QStringLiteral("5.7") || v1 == QStringLiteral("5.9") || v1 == QStringLiteral("8.0") || v1 == QStringLiteral("8.1") || v1 == QStringLiteral("10.0")) { computeCaches = true; } // Set new version version = v2; IFOKDO(err, SKGDocument::setParameter(QStringLiteral("SKG_DB_BANK_VERSION"), version)) oMigrationDone = true; } } } IFOKDO(err, stepForward(1, i18nc("Progression step", "Refresh views"))) if (!err && computeCaches) { err = refreshViewsIndexesAndTriggers(); IFOKDO(err, stepForward(2, i18nc("Progression step", "Computation of balances"))) IFOKDO(err, computeBalances()) IFOKDO(err, stepForward(3, i18nc("Progression step", "Computation of budgets"))) IFOKDO(err, computeBudgetSuboperationLinks()) IFOKDO(err, stepForward(4)) } IFOK(err) { bool mig = false; err = SKGDocument::migrate(mig); oMigrationDone = oMigrationDone || mig; } else { err.addError(ERR_FAIL, i18nc("Error message: Could not perform database migration", "Database migration from version %1 to version %2 failed", initialversion, version)); } IFOKDO(err, stepForward(5)) } } } return err; } SKGError SKGDocumentBank::dump(int iMode) const { SKGError err; if (Q_LIKELY(getMainDatabase())) { // dump parameters SKGTRACE << "=== START DUMP BANK DOCUMENT ===" << endl; err = SKGDocument::dump(iMode); if ((iMode & DUMPUNIT) != 0) { SKGTRACE << "=== DUMPUNIT (UNITS))===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_unit_display ORDER BY id"))); SKGTRACE << "=== DUMPUNIT (VALUES) ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_unitvalue_display ORDER BY rd_unit_id, d_date"))); } if ((iMode & DUMPACCOUNT) != 0) { SKGTRACE << "=== DUMPACCOUNT (BANKS) ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_bank ORDER BY id"))); SKGTRACE << "=== DUMPACCOUNT (ACCOUNTS) ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_account_display ORDER BY rd_bank_id, id"))); } if ((iMode & DUMPOPERATION) != 0) { SKGTRACE << "=== DUMPOPERATION (OPERATIONS) ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_operation_display_all ORDER BY id"))); SKGTRACE << "=== DUMPOPERATION (SUBOPERATIONS) ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_suboperation_display ORDER BY rd_operation_id, id"))); SKGTRACE << "=== DUMPOPERATION (RECURRENT) ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_recurrentoperation ORDER BY rd_operation_id, id"))); SKGTRACE << "=== DUMPOPERATION (TRACKER) ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_refund ORDER BY id"))); } if ((iMode & DUMPPAYEE) != 0) { SKGTRACE << "=== DUMPOPERATION (PAYEE) ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_payee ORDER BY id"))); } if ((iMode & DUMPCATEGORY) != 0) { SKGTRACE << "=== DUMPCATEGORY ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_category_display ORDER BY rd_category_id, id"))); } if ((iMode & DUMPBUDGET) != 0) { SKGTRACE << "=== DUMPBUDGET (BUDGET) ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_budget_display ORDER BY t_PERIOD"))); SKGTRACE << "=== DUMPBUDGET (RULES) ===" << endl; err.addError(dumpSelectSqliteOrder(QStringLiteral("SELECT * FROM v_budgetrule_display ORDER BY t_absolute DESC, id"))); } SKGTRACE << "=== END DUMP BANK DOCUMENT ===" << endl; } return err; } SKGError SKGDocumentBank::addOrModifyUnitValue(const QString& iUnitName, QDate iDate, double iValue, SKGUnitValueObject* oValue) const { SKGError err; SKGTRACEINFUNCRC(10, err); // Creation or update of the unit bool insertOrUpdate = true; SKGUnitObject unit(const_cast(this)); err = unit.setName(iUnitName); IFOKDO(err, unit.setSymbol(iUnitName)) if (!unit.exist()) { insertOrUpdate = false; IFOKDO(err, unit.save(insertOrUpdate)) } else { err = unit.load(); } // Creation or update of the value SKGUnitValueObject value; IFOKDO(err, unit.addUnitValue(value)) IFOKDO(err, value.setDate(iDate)) IFOKDO(err, value.setQuantity(iValue)) IFOKDO(err, value.save(insertOrUpdate)) if (oValue != nullptr) { *oValue = value; } // Add error if needed IFKO(err) err.addError(ERR_FAIL, i18nc("Error message", "Operation '%1' on '%2' failed", QStringLiteral("SKGDocumentBank::addOrModifyUnitValue"), iUnitName % " / " % SKGServices::dateToSqlString(QDateTime(iDate)) % " / " % SKGServices::doubleToString(iValue))); return err; } SKGServices::SKGUnitInfo SKGDocumentBank::getPrimaryUnit() const { SKGServices::SKGUnitInfo output; output.Name = getCachedValue(QStringLiteral("primaryUnitCache")); if (output.Name.isEmpty()) { this->refreshCache(QStringLiteral("unit")); output.Name = getCachedValue(QStringLiteral("primaryUnitCache")); } output.Value = 1; output.Symbol = getCachedValue(QStringLiteral("primaryUnitSymbolCache")); output.NbDecimal = SKGServices::stringToInt(getCachedValue(QStringLiteral("primaryUnitDecimalCache"))); return output; } SKGServices::SKGUnitInfo SKGDocumentBank::getSecondaryUnit() const { SKGServices::SKGUnitInfo output; output.Name = getCachedValue(QStringLiteral("secondaryUnitCache")); if (output.Name.isEmpty()) { this->refreshCache(QStringLiteral("unit")); output.Name = getCachedValue(QStringLiteral("secondaryUnitCache")); } output.Symbol = getCachedValue(QStringLiteral("secondaryUnitSymbolCache")); output.Value = SKGServices::stringToDouble(getCachedValue(QStringLiteral("secondaryUnitValueCache"))); output.NbDecimal = SKGServices::stringToInt(getCachedValue(QStringLiteral("secondaryUnitDecimalCache"))); return output; } QString SKGDocumentBank::formatPrimaryMoney(double iValue) const { return formatMoney(iValue, getPrimaryUnit(), false); } QString SKGDocumentBank::formatSecondaryMoney(double iValue) const { return formatMoney(iValue, getSecondaryUnit(), false); } QString SKGDocumentBank::getCategoryForPayee(const QString& iPayee, bool iComputeAllPayees) const { SKGTRACEINFUNC(10); QString output; QString key = "categoryForPayee-" + iPayee; output = getCachedValue(key); if (output.isEmpty()) { QString sql = "SELECT * FROM (SELECT 9999, t_name, t_CATEGORY FROM v_payee WHERE t_CATEGORY!='' UNION " - "SELECT COUNT(1), t_name, t_REALCATEGORY from (SELECT payee.t_name, t_REALCATEGORY, d_date FROM payee, v_suboperation_consolidated " - "WHERE r_payee_id=payee.id) GROUP BY t_name, t_REALCATEGORY) ORDER BY 2, 1 DESC"; + "SELECT COUNT(1), t_name, t_CATEGORY from (SELECT payee.t_name, t_CATEGORY FROM payee, v_suboperation_display sop, v_operation op WHERE r_payee_id=payee.id AND sop.rd_operation_id=op.ID) GROUP BY t_name, t_CATEGORY) ORDER BY 2, 1 DESC"; if (!iComputeAllPayees) { sql = "SELECT 9999, t_name, t_CATEGORY FROM v_payee WHERE t_name='" % SKGServices::stringToSqlString(iPayee) % "' AND t_CATEGORY!='' " "UNION ALL SELECT COUNT(1),t_PAYEE, t_REALCATEGORY FROM (SELECT t_PAYEE, t_REALCATEGORY, d_date FROM v_suboperation_consolidated " "WHERE t_PAYEE='" % SKGServices::stringToSqlString(iPayee) % "' ORDER BY d_date DESC LIMIT 50) GROUP BY t_REALCATEGORY ORDER BY COUNT(1) DESC"; } SKGStringListList result; executeSelectSqliteOrder(sql, result); int nb = result.count(); if (nb >= 1) { QString currentComputeKey; QString currentCat; int currentCount = 0; int sum = 0; for (int i = 1 ; i < nb; ++i) { int count = SKGServices::stringToInt(result.at(i).at(0)); QString newComputeKey = "categoryForPayee-" + result.at(i).at(1); if (newComputeKey != currentComputeKey) { // The computed key change if (!currentComputeKey.isEmpty()) { // Store the automatic category of the key if (sum > 0 && 100 * currentCount / sum > 70) { addValueInCache(currentComputeKey, currentCat); if (currentComputeKey == key) { output = currentCat; } } } // Start to compute the new sum and keep this category currentCount = count; currentCat = result.at(i).at(2); currentComputeKey = newComputeKey; sum = count; } else { // Continue to compute the sum sum += count; } } // Compute the last if (!currentComputeKey.isEmpty()) { // Store the automatic category of the key if (sum > 0 && 100 * currentCount / sum > 70) { addValueInCache(currentComputeKey, currentCat); if (currentComputeKey == key) { output = currentCat; } } } } } return output; } void SKGDocumentBank::refreshCache(const QString& iTable) const { if (iTable == QStringLiteral("unit") || iTable.isEmpty()) { SKGTRACEINFUNC(10); SKGStringListList result; executeSelectSqliteOrder(QStringLiteral("SELECT t_name, t_symbol, i_nbdecimal FROM unit WHERE t_type='1'"), result); if (result.size() == 2) { addValueInCache(QStringLiteral("primaryUnitCache"), result.at(1).at(0)); addValueInCache(QStringLiteral("primaryUnitSymbolCache"), result.at(1).at(1)); addValueInCache(QStringLiteral("primaryUnitDecimalCache"), result.at(1).at(2)); } else { addValueInCache(QStringLiteral("primaryUnitCache"), QLatin1String("")); addValueInCache(QStringLiteral("primaryUnitSymbolCache"), QLatin1String("")); addValueInCache(QStringLiteral("primaryUnitDecimalCache"), QStringLiteral("2")); } executeSelectSqliteOrder(QStringLiteral("SELECT t_name, t_symbol, f_CURRENTAMOUNT, i_nbdecimal FROM v_unit WHERE t_type='2'"), result); if (result.size() == 2) { addValueInCache(QStringLiteral("secondaryUnitCache"), result.at(1).at(0)); addValueInCache(QStringLiteral("secondaryUnitSymbolCache"), result.at(1).at(1)); addValueInCache(QStringLiteral("secondaryUnitValueCache"), result.at(1).at(2)); addValueInCache(QStringLiteral("secondaryUnitDecimalCache"), result.at(1).at(3)); } else { addValueInCache(QStringLiteral("secondaryUnitCache"), QLatin1String("")); addValueInCache(QStringLiteral("secondaryUnitSymbolCache"), QLatin1String("")); addValueInCache(QStringLiteral("secondaryUnitValueCache"), QStringLiteral("1")); addValueInCache(QStringLiteral("secondaryUnitDecimalCache"), QStringLiteral("2")); } } SKGDocument::refreshCache(iTable); } SKGError SKGDocumentBank::addOrModifyAccount(const QString& iName, const QString& iNumber, const QString& iBankName) const { SKGError err; SKGTRACEINFUNCRC(10, err); // Creation or update of the bank SKGBankObject bank(const_cast(this)); err = bank.setName(iBankName); IFOKDO(err, bank.save()) // Creation or update of the account SKGAccountObject account; IFOKDO(err, bank.addAccount(account)) IFOKDO(err, account.setAttribute(QStringLiteral("rd_bank_id"), SKGServices::intToString(bank.getID()))) IFOKDO(err, account.setName(iName)) IFOKDO(err, account.setAttribute(QStringLiteral("t_number"), iNumber)) IFOKDO(err, account.save()) IFKO(err) err.addError(ERR_FAIL, i18nc("Error message", "Operation '%1' on '%2' failed", QStringLiteral("SKGDocumentBank::addOrModifyAccount"), iName)); return err; } QString SKGDocumentBank::getFileExtension() const { return QStringLiteral("skg"); } QString SKGDocumentBank::getDocumentHeader() const { return QStringLiteral("SKROOGE"); } SKGDocument::SKGModelTemplateList SKGDocumentBank::getDisplaySchemas(const QString& iRealTable) const { SKGModelTemplateList listSchema; listSchema.reserve(10); // Get properties QStringList properties; QString tableForProperties = iRealTable; if (tableForProperties == QStringLiteral("suboperation")) { tableForProperties = QStringLiteral("operation"); } this->getDistinctValues(QStringLiteral("parameters"), QStringLiteral("t_name"), "(t_uuid_parent like '%-" % tableForProperties % "' OR t_uuid_parent like '%-sub" % tableForProperties % "') AND t_name NOT LIKE 'SKG_%'", properties); // Build property schema QString propSchema; int nb = properties.count(); for (int i = 0; i < nb; ++i) { propSchema += ";p_" % properties.at(i) % "|N"; } // Build schemas if (iRealTable == QStringLiteral("operation") || iRealTable == QStringLiteral("suboperation")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "d_date;d_DATEWEEK|N;d_DATEMONTH|N;d_DATEQUARTER|N;d_DATESEMESTER|N;d_DATEYEAR|N;i_NBRECURRENT;t_bookmarked;t_ACCOUNT;t_TOACCOUNT|N;t_number;t_mode;t_PAYEE;t_comment;t_REALCOMMENT;t_CATEGORY;t_REALCATEGORY;t_status;" "f_REALCURRENTAMOUNT;f_REALCURRENTAMOUNT_EXPENSE|N;f_REALCURRENTAMOUNT_INCOME|N;" "f_CURRENTAMOUNT;f_CURRENTAMOUNT_EXPENSE|N;f_CURRENTAMOUNT_INCOME|N;" "f_QUANTITY|N;f_QUANTITY_EXPENSE|N;f_QUANTITY_INCOME|N;f_REALQUANTITY|N;f_REALQUANTITY_EXPENSE|N;f_REALQUANTITY_INCOME|N;t_UNIT|N;" "t_imported|N;t_REALREFUND|N;t_REFUND|N;t_REFUNDDISPLAY|N" ";f_BALANCE|N;f_BALANCE_ENTERED|N;d_createdate|N;i_OPID|N" % propSchema; listSchema.push_back(def); SKGModelTemplate minimum; minimum.id = QStringLiteral("minimum"); minimum.name = i18nc("Noun, the minimum value of an item", "Minimum"); minimum.icon = QLatin1String(""); minimum.schema = "d_date;d_DATEWEEK|N;d_DATEMONTH|N;d_DATEQUARTER|N;d_DATESEMESTER|N;d_DATEYEAR|N;i_NBRECURRENT|N;t_bookmarked|N;t_ACCOUNT;t_TOACCOUNT|N;t_number|N;t_mode|N;t_PAYEE|N;t_comment|N;t_REALCOMMENT|N;t_CATEGORY|N;t_REALCATEGORY|N;t_status;" "f_REALCURRENTAMOUNT;f_REALCURRENTAMOUNT_EXPENSE|N;f_REALCURRENTAMOUNT_INCOME|N;" "f_CURRENTAMOUNT;f_CURRENTAMOUNT_EXPENSE|N;f_CURRENTAMOUNT_INCOME|N;" "f_QUANTITY|N;f_QUANTITY_EXPENSE|N;f_QUANTITY_INCOME|N;f_REALQUANTITY|N;f_REALQUANTITY_EXPENSE|N;f_REALQUANTITY_INCOME|N;t_UNIT|N;" "t_imported|N;t_REALREFUND|N;t_REFUND|N;t_REFUNDDISPLAY|N" ";f_BALANCE|N;f_BALANCE_ENTERED|N;d_createdate|N;i_OPID|N" % propSchema; listSchema.push_back(minimum); SKGModelTemplate doubleColumn; doubleColumn.id = QStringLiteral("doublecolumn"); doubleColumn.name = i18nc("Noun", "Amount in 2 columns"); doubleColumn.icon = QLatin1String(""); doubleColumn.schema = "d_date;d_DATEWEEK|N;d_DATEMONTH|N;d_DATEQUARTER|N;d_DATESEMESTER|N;d_DATEYEAR|N;i_NBRECURRENT;t_bookmarked;t_ACCOUNT;t_TOACCOUNT|N;t_number;t_mode;t_PAYEE;t_comment;t_REALCOMMENT;t_CATEGORY;t_REALCATEGORY;t_status;" "f_REALCURRENTAMOUNT|N;f_REALCURRENTAMOUNT_EXPENSE|Y;f_REALCURRENTAMOUNT_INCOME|Y;" "f_CURRENTAMOUNT|N;f_CURRENTAMOUNT_EXPENSE|Y;f_CURRENTAMOUNT_INCOME|Y;" "f_QUANTITY|N;f_QUANTITY_EXPENSE|N;f_QUANTITY_INCOME|N;f_REALQUANTITY|N;f_REALQUANTITY_EXPENSE|N;f_REALQUANTITY_INCOME|N;t_UNIT|N;" "t_imported|N;t_REALREFUND|N;t_REFUND|N;t_REFUNDDISPLAY|N" ";f_BALANCE|N;f_BALANCE_ENTERED|N;d_createdate|N;i_OPID|N" % propSchema; listSchema.push_back(doubleColumn); SKGModelTemplate amountEntered; amountEntered.id = QStringLiteral("amountentered"); amountEntered.name = i18nc("Noun", "Amount entered"); amountEntered.icon = QLatin1String(""); amountEntered.schema = "d_date;d_DATEWEEK|N;d_DATEMONTH|N;d_DATEQUARTER|N;d_DATESEMESTER|N;d_DATEYEAR|N;i_NBRECURRENT;t_bookmarked;t_ACCOUNT;t_TOACCOUNT|N;t_number;t_mode;t_PAYEE;t_comment;t_REALCOMMENT;t_CATEGORY;t_REALCATEGORY;t_status;" "f_REALCURRENTAMOUNT|N;f_REALCURRENTAMOUNT_EXPENSE|N;f_REALCURRENTAMOUNT_INCOME|N;" "f_CURRENTAMOUNT|N;f_CURRENTAMOUNT_EXPENSE|N;f_CURRENTAMOUNT_INCOME|N;" "f_QUANTITY|Y;f_QUANTITY_EXPENSE|N;f_QUANTITY_INCOME|N;f_REALQUANTITY|Y;f_REALQUANTITY_EXPENSE|N;f_REALQUANTITY_INCOME|N;t_UNIT|N;" "t_imported|N;t_REALREFUND|N;t_REFUND|N;t_REFUNDDISPLAY|N" ";f_BALANCE|N;f_BALANCE_ENTERED|N;d_createdate|N;i_OPID|N" % propSchema; listSchema.push_back(amountEntered); SKGModelTemplate doubleColumnEntered; doubleColumnEntered.id = QStringLiteral("doublecolumnentered"); doubleColumnEntered.name = i18nc("Noun", "Amount entered in 2 columns"); doubleColumnEntered.icon = QLatin1String(""); doubleColumnEntered.schema = "d_date;d_DATEWEEK|N;d_DATEMONTH|N;d_DATEQUARTER|N;d_DATESEMESTER|N;d_DATEYEAR|N;i_NBRECURRENT;t_bookmarked;t_ACCOUNT;t_TOACCOUNT|N;t_number;t_mode;t_PAYEE;t_comment;t_REALCOMMENT;t_CATEGORY;t_REALCATEGORY;t_status;" "f_REALCURRENTAMOUNT|N;f_REALCURRENTAMOUNT_EXPENSE|N;f_REALCURRENTAMOUNT_INCOME|N;" "f_CURRENTAMOUNT|N;f_CURRENTAMOUNT_EXPENSE|N;f_CURRENTAMOUNT_INCOME|N;" "f_QUANTITY|N;f_QUANTITY_EXPENSE|Y;f_QUANTITY_INCOME|Y;f_REALQUANTITY|N;f_REALQUANTITY_EXPENSE|Y;f_REALQUANTITY_INCOME|Y;t_UNIT|N;" "t_imported|N;t_REALREFUND|N;t_REFUND|N;t_REFUNDDISPLAY|N" ";f_BALANCE|N;f_BALANCE_ENTERED|N;d_createdate|N;i_OPID|N" % propSchema; listSchema.push_back(doubleColumnEntered); } else if (iRealTable == QStringLiteral("recurrentoperation")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "d_date;t_PERIODNLS;i_nb_times;i_auto_write_days;i_warn_days;t_ACCOUNT;t_number;t_mode;t_PAYEE;t_comment;t_CATEGORY;" "t_status;f_CURRENTAMOUNT" % propSchema; listSchema.push_back(def); SKGModelTemplate minimum; minimum.id = QStringLiteral("minimum"); minimum.name = i18nc("Noun, the minimum value of an item", "Minimum"); minimum.icon = QLatin1String(""); minimum.schema = "d_date;t_PERIODNLS;i_nb_times;i_auto_write_days;i_warn_days;t_ACCOUNT;t_number|N;t_mode|N;t_PAYEE;t_comment|N;t_CATEGORY|N;" "t_status;f_CURRENTAMOUNT" % propSchema; listSchema.push_back(minimum); } else if (iRealTable == QStringLiteral("account")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "t_BANK;t_close;t_bookmarked;t_name;t_TYPENLS;t_BANK_NUMBER;t_agency_number;t_number;t_agency_address;t_comment;f_CURRENTAMOUNT;f_QUANTITY|N;f_TODAYAMOUNT|N;f_CHECKED;f_COMING_SOON;f_importbalance|N;d_importdate|N;f_reconciliationbalance|N;d_reconciliationdate|N;i_NBOPERATIONS;f_RATE|N" % propSchema; listSchema.push_back(def); SKGModelTemplate minimum; minimum.id = QStringLiteral("minimum"); minimum.name = i18nc("Noun, the minimum value of an item", "Minimum"); minimum.icon = QLatin1String(""); minimum.schema = "t_BANK;t_close;t_bookmarked|N;t_name;t_TYPENLS|N;t_BANK_NUMBER|N;t_agency_number|N;t_number|N;t_agency_address|N;t_comment|N;f_CURRENTAMOUNT|N;f_QUANTITY|N;f_TODAYAMOUNT|N;f_CHECKED|N;f_COMING_SOON|N;f_importbalance|N;d_importdate|N;f_reconciliationbalance|N;d_reconciliationdate|N;i_NBOPERATIONS|N;f_RATE|N" % propSchema; listSchema.push_back(minimum); SKGModelTemplate intermediate; intermediate.id = QStringLiteral("intermediate"); intermediate.name = i18nc("Noun, an intermediate value between two extremums", "Intermediate"); intermediate.icon = QLatin1String(""); intermediate.schema = "t_BANK;t_close;t_bookmarked;t_name;t_TYPENLS|N;t_BANK_NUMBER|N;t_agency_number|N;t_number|N;t_agency_address|N;t_comment|N;f_CURRENTAMOUNT;f_QUANTITY|N;f_TODAYAMOUNT|N,f_CHECKED;f_COMING_SOON;f_importbalance|N;d_importdate|N;f_reconciliationbalance|N;d_reconciliationdate|N;i_NBOPERATIONS|N;f_RATE|N" % propSchema; listSchema.push_back(intermediate); } else if (iRealTable == QStringLiteral("category")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "t_name;t_close;t_bookmarked;i_NBOPERATIONS;f_REALCURRENTAMOUNT;i_SUMNBOPERATIONS;f_SUMCURRENTAMOUNT" % propSchema; listSchema.push_back(def); SKGModelTemplate minimum; minimum.id = QStringLiteral("minimum"); minimum.name = i18nc("Noun, the minimum value of an item", "Minimum"); minimum.icon = QLatin1String(""); minimum.schema = "t_name;t_close|N;t_bookmarked;i_NBOPERATIONS|N;f_REALCURRENTAMOUNT|N;i_SUMNBOPERATIONS|N;f_SUMCURRENTAMOUNT|N" % propSchema; listSchema.push_back(minimum); SKGModelTemplate op; op.id = QStringLiteral("with_operations"); op.name = i18nc("Noun", "With operations"); op.icon = QLatin1String(""); op.schema = "t_name;t_close;t_bookmarked;i_NBOPERATIONS;f_REALCURRENTAMOUNT;i_SUMNBOPERATIONS|N;f_SUMCURRENTAMOUNT|N" % propSchema; listSchema.push_back(op); SKGModelTemplate op2; op2.id = QStringLiteral("with_cumulative_operations"); op2.name = i18nc("Noun", "With cumulative operations"); op2.icon = QLatin1String(""); op2.schema = "t_name;t_close;t_bookmarked;i_NBOPERATIONS|N;f_REALCURRENTAMOUNT|N;i_SUMNBOPERATIONS;f_SUMCURRENTAMOUNT" % propSchema; listSchema.push_back(op2); } else if (iRealTable == QStringLiteral("unit")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "t_name;t_symbol;t_bookmarked;t_country;t_TYPENLS;t_source;t_internet_code;f_CURRENTAMOUNT;f_QUANTITYOWNED;f_AMOUNTOWNED;i_nbdecimal;t_UNIT;d_MAXDATE|N" % propSchema; listSchema.push_back(def); SKGModelTemplate minimum; minimum.id = QStringLiteral("minimum"); minimum.name = i18nc("Noun, the minimum value of an item", "Minimum"); minimum.icon = QLatin1String(""); minimum.schema = "t_name;t_symbol;t_bookmarked|N;t_country|N;t_TYPENLS;t_source|N;t_internet_code|N;f_CURRENTAMOUNT|N;f_QUANTITYOWNED|N;f_AMOUNTOWNED|N;i_nbdecimal|N;t_UNIT|N;d_MAXDATE|N" % propSchema; listSchema.push_back(minimum); } else if (iRealTable == QStringLiteral("unitvalue")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "d_date;f_quantity;t_UNIT|N;f_AMOUNTOWNED|N" % propSchema; listSchema.push_back(def); } else if (iRealTable == QStringLiteral("refund")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "t_name;t_comment;t_close;d_FIRSTDATE;d_LASTDATE;f_CURRENTAMOUNT" % propSchema; listSchema.push_back(def); SKGModelTemplate minimum; minimum.id = QStringLiteral("minimum"); minimum.name = i18nc("Noun, the minimum value of an item", "Minimum"); minimum.icon = QLatin1String(""); minimum.schema = "t_name;t_comment|N;t_close;d_FIRSTDATE|N;d_LASTDATE|N;f_CURRENTAMOUNT" % propSchema; listSchema.push_back(minimum); } else if (iRealTable == QStringLiteral("payee")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "t_name;t_close;t_bookmarked;t_address;i_NBOPERATIONS|N;f_CURRENTAMOUNT;t_CATEGORY|N" % propSchema; listSchema.push_back(def); SKGModelTemplate minimum; minimum.id = QStringLiteral("minimum"); minimum.name = i18nc("Noun, the minimum value of an item", "Minimum"); minimum.icon = QLatin1String(""); minimum.schema = "t_name;t_close|N;t_bookmarked;t_address|N;i_NBOPERATIONS|N;f_CURRENTAMOUNT;t_CATEGORY|N" % propSchema; listSchema.push_back(minimum); } else if (iRealTable == QStringLiteral("rule")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "i_ORDER;t_bookmarked;t_action_type;t_description;t_action_description" % propSchema; listSchema.push_back(def); } else if (iRealTable == QStringLiteral("interest")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "d_date;f_rate;t_income_value_date_mode;t_expenditure_value_date_mode;t_base" % propSchema; listSchema.push_back(def); SKGModelTemplate minimum; minimum.id = QStringLiteral("minimum"); minimum.name = i18nc("Noun, the minimum value of an item", "Minimum"); minimum.icon = QLatin1String(""); minimum.schema = "d_date;f_rate;t_income_value_date_mode|N;t_expenditure_value_date_mode|N;t_base|N" % propSchema; listSchema.push_back(minimum); } else if (iRealTable == QStringLiteral("interest_result")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "d_date;d_valuedate;t_comment;f_currentamount;f_coef;f_rate;f_annual_interest;f_accrued_interest" % propSchema; listSchema.push_back(def); SKGModelTemplate minimum; minimum.id = QStringLiteral("minimum"); minimum.name = i18nc("Noun, the minimum value of an item", "Minimum"); minimum.icon = QLatin1String(""); minimum.schema = "d_date;d_valuedate|N;t_comment|N;f_currentamount|N;f_coef|N;f_rate;f_annual_interest;f_accrued_interest|N" % propSchema; listSchema.push_back(minimum); } else if (iRealTable == QStringLiteral("budget")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "t_CATEGORY;t_PERIOD;i_year|N;i_month|N;f_budgeted;f_budgeted_modified;f_CURRENTAMOUNT;f_DELTABEFORETRANSFER|N;t_RULES;f_DELTA" % propSchema; listSchema.push_back(def); SKGModelTemplate minimum; minimum.id = QStringLiteral("minimum"); minimum.name = i18nc("Noun, the minimum value of an item", "Minimum"); minimum.icon = QLatin1String(""); minimum.schema = "t_CATEGORY;t_PERIOD;i_year|N;i_month|N;f_budgeted|N;f_budgeted_modified;f_CURRENTAMOUNT;f_DELTABEFORETRANSFER;t_RULES|N;f_DELTA|N" % propSchema; listSchema.push_back(minimum); } else if (iRealTable == QStringLiteral("budgetrule")) { SKGModelTemplate def; def.id = QStringLiteral("default"); def.name = i18nc("Noun, the default value of an item", "Default"); def.icon = QStringLiteral("edit-undo"); def.schema = "i_ORDER;t_CATEGORYCONDITION;i_year;i_month;t_WHENNLS;t_WHATNLS;t_RULENLS;t_CATEGORY" % propSchema; listSchema.push_back(def); } else { listSchema = SKGDocument::getDisplaySchemas(iRealTable); } return listSchema; } QString SKGDocumentBank::getIconName(const QString& iString) const { QString att = iString.toLower(); if (att.endsWith(QLatin1String("t_bookmarked"))) { return QStringLiteral("bookmarks"); } if (att.endsWith(QLatin1String("f_balance")) || att.endsWith(QLatin1String("f_balance_entered")) || att.endsWith(QLatin1String("f_reconciliationbalance"))) { return QStringLiteral("office-chart-line"); } if (att.endsWith(QLatin1String("i_nbrecurrent"))) { return QStringLiteral("chronometer"); } if (att.endsWith(QLatin1String("t_status")) || att.endsWith(QLatin1String("f_checked")) || att.endsWith(QLatin1String("f_coming_soon")) || att.endsWith(QLatin1String("d_reconciliationdate"))) { return QStringLiteral("dialog-ok"); } if (att.endsWith(QLatin1String("t_close"))) { return QStringLiteral("window-close"); } if (att.endsWith(QLatin1String("t_categorycondition")) || att.endsWith(QLatin1String("t_category")) || att.endsWith(QLatin1String("t_realcategory"))) { return QStringLiteral("view-categories"); } if (att.endsWith(QLatin1String("t_symbol"))) { return QStringLiteral("taxes-finances"); } if (att.endsWith(QLatin1String("t_typeexpensenls"))) { return QStringLiteral("skrooge_type"); } if (att.endsWith(QLatin1String("t_typenls"))) { if (att.contains(QStringLiteral("v_unit"))) { return QStringLiteral("view-bank-account-savings"); } if (att.contains(QStringLiteral("v_account"))) { return QStringLiteral("skrooge_credit_card"); } } if (att.endsWith(QLatin1String("t_unit")) || att.endsWith(QLatin1String("t_unittype"))) { return QStringLiteral("taxes-finances"); } if (att.endsWith(QLatin1String("f_value")) || att.endsWith(QLatin1String("f_currentamount")) || att.endsWith(QLatin1String("f_todayamount")) || att.endsWith(QLatin1String("f_sumcurrentamount")) || att.endsWith(QLatin1String("quantity")) || att.endsWith(QLatin1String("f_realcurrentamount"))) { return QStringLiteral("skrooge_type"); } if (att.endsWith(QLatin1String("_expense"))) { return QStringLiteral("list-remove"); } if (att.endsWith(QLatin1String("_income")) || att.endsWith(QLatin1String("f_annual_interest")) || att.endsWith(QLatin1String("f_accrued_interest"))) { return QStringLiteral("list-add"); } if (att.endsWith(QLatin1String("t_description"))) { return QStringLiteral("edit-find"); } if (att.endsWith(QLatin1String("t_action_description"))) { return QStringLiteral("system-run"); } if (att.endsWith(QLatin1String("t_imported")) || att.endsWith(QLatin1String("f_importbalance")) || att.endsWith(QLatin1String("d_importdate"))) { return QStringLiteral("utilities-file-archiver"); } if (att.endsWith(QLatin1String("t_refund")) || att.endsWith(QLatin1String("t_refunddisplay")) || att.endsWith(QLatin1String("t_realrefund"))) { return QStringLiteral("checkbox"); } if (att.endsWith(QLatin1String("t_mode"))) { return QStringLiteral("skrooge_credit_card"); } if (att.endsWith(QLatin1String("t_account")) || att.endsWith(QLatin1String("t_toaccount")) || att.endsWith(QLatin1String("t_accounttype"))) { return QStringLiteral("view-bank"); } if (att.endsWith(QLatin1String("t_payee"))) { return QStringLiteral("user-group-properties"); } if (att.endsWith(QLatin1String("t_comment")) || att.endsWith(QLatin1String("t_realcomment"))) { return QStringLiteral("draw-freehand"); } if (att.endsWith(QLatin1String("t_warn")) || att.endsWith(QLatin1String("i_warn_days"))) { return QStringLiteral("dialog-information"); } if (att.endsWith(QLatin1String("t_name"))) { if (att.contains(QStringLiteral("v_account"))) { return QStringLiteral("view-bank"); } if (att.contains(QStringLiteral("v_category"))) { return QStringLiteral("view-categories"); } if (att.contains(QStringLiteral("v_refund"))) { return QStringLiteral("checkbox"); } if (att.contains(QStringLiteral("v_unit"))) { return QStringLiteral("taxes-finances"); } if (att.contains(QStringLiteral("v_payee"))) { return QStringLiteral("user-group-properties"); } } if (att.endsWith(QLatin1String("f_rate"))) { return QStringLiteral("skrooge_more"); } if (att.endsWith(QLatin1String("t_internet_code")) || att.endsWith(QLatin1String("t_source")) || att.endsWith(QLatin1String("d_maxdate"))) { return QStringLiteral("download"); } if (att.contains(QStringLiteral(".d_")) || att.startsWith(QLatin1String("d_"))) { return QStringLiteral("view-calendar"); } if (att.endsWith(QLatin1String("i_year")) || att.endsWith(QLatin1String("i_month")) || att.endsWith(QLatin1String("t_period"))) { return QStringLiteral("view-calendar"); } if (att.endsWith(QLatin1String("f_delta"))) { return QStringLiteral("security-high"); } if (att.endsWith(QLatin1String("f_deltabeforetransfer"))) { return QStringLiteral("security-medium"); } if (att.endsWith(QLatin1String("f_budgeted")) || att.endsWith(QLatin1String("f_budgeted_modified"))) { return QStringLiteral("view-calendar-whatsnext"); } if (att.endsWith(QLatin1String("t_rules"))) { return QStringLiteral("system-run"); } if (att.endsWith(QLatin1String("t_whennls"))) { return QStringLiteral("view-calendar"); } if (att.endsWith(QLatin1String("t_whatnls"))) { return QStringLiteral("skrooge_type"); } if (att.endsWith(QLatin1String("t_rulenls"))) { return QStringLiteral("view-calendar-whatsnext"); } if (att.endsWith(QLatin1String("t_bank"))) { return QStringLiteral("view-bank"); } if (att.endsWith(QLatin1String("t_transfer"))) { return QStringLiteral("exchange-positions"); } if (att.endsWith(QLatin1String("_number"))) { return QStringLiteral("dialog-information"); } if (att.endsWith(QLatin1String("i_auto_write_days"))) { return QStringLiteral("insert-text"); } if (att.endsWith(QLatin1String("_address"))) { return QStringLiteral("address-book-new"); } if (att.endsWith(QLatin1String("i_order"))) { return QStringLiteral("view-sort-ascending"); } if (att.endsWith(QLatin1String("t_periodnls"))) { return QStringLiteral("smallclock"); } return SKGDocument::getIconName(iString); } QString SKGDocumentBank::getDisplay(const QString& iString) const { QString output = iString.toLower(); // Internationallization if (output.endsWith(QLatin1String("account.t_name")) || output.endsWith(QLatin1String("t_account"))) { return i18nc("Noun, an account as in a bank account", "Account"); } if (output.endsWith(QLatin1String("t_accounttype"))) { return i18nc("Noun, an account as in a bank account", "Account's type"); } if (output.endsWith(QLatin1String("t_operationname"))) { return i18nc("Noun, a financial operation", "Operation"); } if (output.endsWith(QLatin1String("t_name"))) { return i18nc("Noun, the name of an item", "Name"); } if (output.endsWith(QLatin1String("account.f_value")) || output.endsWith(QLatin1String("f_balance"))) { return i18nc("Noun, as in commercial balance", "Balance"); } if (output.endsWith(QLatin1String("f_balance_entered"))) { return i18nc("Noun, as in commercial balance", "Balance entered"); } if (output.endsWith(QLatin1String("f_value"))) { return i18nc("Name, the numerical amount of a financial operation", "Amount"); } if (output.endsWith(QLatin1String("f_currentamount")) || output.endsWith(QLatin1String("f_realcurrentamount"))) { return i18nc("Name, the numerical amount of a financial operation", "Amount"); } if (output.endsWith(QLatin1String("f_todayamount"))) { return i18nc("Name, the numerical amount of a financial operation", "Today amount"); } if (output.endsWith(QLatin1String("f_currentamount_income")) || output.endsWith(QLatin1String("f_realcurrentamount_income"))) { return i18nc("Noun, financial operations with a positive amount", "Income"); } if (output.endsWith(QLatin1String("f_currentamount_expense")) || output.endsWith(QLatin1String("f_realcurrentamount_expense"))) { return i18nc("Noun, financial operations with a negative amount", "Expenditure"); } if (output.endsWith(QLatin1String("f_quantity_income")) || output.endsWith(QLatin1String("f_realquantity_income"))) { return i18nc("Noun", "Income entered"); } if (output.endsWith(QLatin1String("f_quantity_expense")) || output.endsWith(QLatin1String("f_realquantity_expense"))) { return i18nc("Noun", "Expenditure entered"); } if (output.endsWith(QLatin1String("f_quantityowned"))) { return i18nc("Noun", "Quantity owned"); } if (output.endsWith(QLatin1String("f_amountowned"))) { return i18nc("Noun", "Amount owned"); } if (output.endsWith(QLatin1String("quantity"))) { return i18nc("Noun", "Amount entered"); } if (output.endsWith(QLatin1String("account.t_number"))) { return i18nc("Noun", "Account number"); } if (output.endsWith(QLatin1String("t_number"))) { return i18nc("Noun, a number identifying an item", "Number"); } if (output.endsWith(QLatin1String("t_bank_number"))) { return i18nc("Noun", "Bank number"); } if (output.endsWith(QLatin1String("t_agency_number"))) { return i18nc("Noun", "Agency number"); } if (output.endsWith(QLatin1String("t_agency_address"))) { return i18nc("Noun", "Agency address"); } if (output.endsWith(QLatin1String("t_address"))) { return i18nc("Noun", "Address"); } if (output.endsWith(QLatin1String("t_payee"))) { return i18nc("A person or institution receiving a payment, or paying the operation", "Payee"); } if (output.endsWith(QLatin1String("t_comment"))) { return i18nc("Noun, a user comment on an item", "Comment"); } if (output.endsWith(QLatin1String("t_realcomment"))) { return i18nc("Noun, a user comment on an item", "Sub comment"); } if (output.endsWith(QLatin1String("t_mode"))) { return i18nc("Noun, the mode used for payment of the operation (Credit Card, Cheque, Transfer...)", "Mode"); } if (output.contains(QStringLiteral("recurrentoperation")) && output.endsWith(QLatin1String("d_date"))) { return i18nc("Noun", "Next occurrence"); } if (output.endsWith(QLatin1String("d_date")) || output.endsWith(QLatin1String("d_dateop"))) { return i18nc("Noun, the date of an item", "Date"); } if (output.endsWith(QLatin1String("d_createdate"))) { return i18nc("Noun, the date of creation of an item", "Creation date"); } if (output.endsWith(QLatin1String("d_dateweek"))) { return i18nc("Noun, 7 days", "Week"); } if (output.endsWith(QLatin1String("d_datemonth"))) { return i18nc("Noun, the months in a year", "Month"); } if (output.endsWith(QLatin1String("d_datequarter"))) { return i18nc("Noun, 3 months", "Quarter"); } if (output.endsWith(QLatin1String("d_datesemester"))) { return i18nc("Noun, 6 months", "Semester"); } if (output.endsWith(QLatin1String("d_dateyear"))) { return i18nc("Noun, the years in a century", "Year"); } if (output.endsWith(QLatin1String("d_firstdate"))) { return i18nc("Noun, the date of an item", "First date"); } if (output.endsWith(QLatin1String("d_lastdate"))) { return i18nc("Noun, the date of an item", "Last date"); } if (output.endsWith(QLatin1String("d_maxdate"))) { return i18nc("Noun, the date of the last download", "Download date"); } if (output.endsWith(QLatin1String("d_reconciliationdate"))) { return i18nc("Noun, the date of the last reconciliation", "Reconciliation date"); } if (output.endsWith(QLatin1String("t_categorycondition")) || output.endsWith(QLatin1String("t_category")) || output.endsWith(QLatin1String("t_realcategory"))) { return i18nc("Noun, the category of an item", "Category"); } if (output.endsWith(QLatin1String("t_bank"))) { return i18nc("Noun, a financial institution", "Bank"); } if (output.endsWith(QLatin1String("t_unit"))) { return i18nc("Noun, the unit of an operation, usually a currency or a share", "Unit"); } if (output.endsWith(QLatin1String("t_unittype"))) { return i18nc("Noun, the unit of an operation, usually a currency or a share", "Unit's type"); } if (output.endsWith(QLatin1String("f_checked"))) { return i18nc("Adjective, has an item been checked or not", "Checked"); } if (output.endsWith(QLatin1String("f_coming_soon"))) { return i18nc("Adjective, a foreseen value", "To be Checked"); } if (output.endsWith(QLatin1String("t_symbol"))) { return i18nc("Noun, ahe unit symbol, something in the line of $, €, £...", "Symbol"); } if (output.endsWith(QLatin1String("t_country"))) { return i18nc("Noun, a country in the world (France, China...)", "Country"); } if (output.endsWith(QLatin1String("t_type")) || output.endsWith(QLatin1String("t_typenls"))) { return i18nc("Noun, the type of an item", "Type"); } if (output.endsWith(QLatin1String("t_typeexpensenls"))) { return i18nc("Noun, the type of an item", "Type"); } if (output.endsWith(QLatin1String("t_internet_code"))) { return i18nc("Noun", "Internet code"); } if (output.endsWith(QLatin1String("i_nboperations"))) { return i18nc("Noun", "Number of operations"); } if (output.endsWith(QLatin1String("t_periodnls"))) { return i18nc("Noun, how frequently something occurs", "Periodicity"); } if (output.endsWith(QLatin1String("i_auto_write_days"))) { return i18nc("Automatically write something", "Auto write"); } if (output.endsWith(QLatin1String("i_nb_times"))) { return i18nc("Noun", "Nb of occurrences"); } if (output.endsWith(QLatin1String("i_warn_days"))) { return i18nc("Verb, warn the user about an event", "Warn"); } if (output.endsWith(QLatin1String("t_close"))) { return i18nc("Adjective, a closed item", "Closed"); } if (output.endsWith(QLatin1String("t_bookmarked"))) { return i18nc("Adjective, an highlighted item", "Highlighted"); } if (output.endsWith(QLatin1String("t_status"))) { return i18nc("Noun, the status of an item", "Status"); } if (output.endsWith(QLatin1String("i_nbrecurrent"))) { return i18nc("Adjective, an item scheduled to happen on a regular basis", "Scheduled"); } if (output.endsWith(QLatin1String("i_sumnboperations"))) { return i18nc("Noun", "Number of operations (cumulative)"); } if (output.endsWith(QLatin1String("f_sumcurrentamount"))) { return i18nc("Noun", "Amount (cumulative)"); } if (output.endsWith(QLatin1String("t_description"))) { return i18nc("Noun", "Search description"); } if (output.endsWith(QLatin1String("t_action_description"))) { return i18nc("Noun", "Process description"); } if (output.endsWith(QLatin1String("t_action_type"))) { return i18nc("Noun, the type of action", "Action type"); } if (output.endsWith(QLatin1String("t_refund")) || output.endsWith(QLatin1String("t_realrefund"))) { return i18nc("Noun, something that is used to track items", "Tracker"); } if (output.endsWith(QLatin1String("t_refunddisplay"))) { return i18nc("Noun, something that is used to track items", "Trackers"); } if (output.endsWith(QLatin1String("t_imported"))) { return i18nc("Noun", "Import status"); } if (output.endsWith(QLatin1String("i_nbdecimal"))) { return i18nc("Noun, after the dot", "Nb decimal"); } if (output.endsWith(QLatin1String("f_rate"))) { return i18nc("Noun, for a share", "Rate"); } if (output.endsWith(QLatin1String("d_valuedate"))) { return i18nc("Noun", "Value date"); } if (output.endsWith(QLatin1String("f_coef"))) { return i18nc("Noun", "Coef"); } if (output.endsWith(QLatin1String("f_annual_interest"))) { return i18nc("Noun", "Annual Interest"); } if (output.endsWith(QLatin1String("f_accrued_interest"))) { return i18nc("Noun", "Accrued Interest"); } if (output.endsWith(QLatin1String("t_income_value_date_mode"))) { return i18nc("Noun", "Value date for credit"); } if (output.endsWith(QLatin1String("t_expenditure_value_date_mode"))) { return i18nc("Noun", "Value date for debit"); } if (output.endsWith(QLatin1String("t_base"))) { return i18nc("Noun", "Base computation"); } if (output.endsWith(QLatin1String("i_year"))) { return i18nc("Noun", "Year"); } if (output.endsWith(QLatin1String("i_month"))) { return i18nc("Noun", "Month"); } if (output.endsWith(QLatin1String("t_period"))) { return i18nc("Noun", "Period"); } if (output.endsWith(QLatin1String("i_order"))) { return i18nc("Noun, sort order", "Order"); } if (output.endsWith(QLatin1String("t_whennls"))) { return i18nc("Noun", "When"); } if (output.endsWith(QLatin1String("t_whatnls"))) { return i18nc("Noun", "What"); } if (output.endsWith(QLatin1String("t_rulenls"))) { return i18nc("Noun", "Impacted budget"); } if (output.endsWith(QLatin1String("t_rules"))) { return i18nc("Noun", "Rules"); } if (output.endsWith(QLatin1String("f_budgeted"))) { return i18nc("Noun", "Entered Budget"); } if (output.endsWith(QLatin1String("f_budgeted_modified"))) { return i18nc("Noun", "Corrected budget"); } if (output.endsWith(QLatin1String("f_delta"))) { return i18nc("Noun", "Delta after rules"); } if (output.endsWith(QLatin1String("f_deltabeforetransfer"))) { return i18nc("Noun", "Delta"); } if (output.endsWith(QLatin1String("t_source"))) { return i18nc("Noun", "Download source"); } if (output.endsWith(QLatin1String("t_transfer"))) { return i18nc("Noun", "Transfer"); } if (output.endsWith(QLatin1String("t_toaccount"))) { return i18nc("Noun, a target account of a transfer", "To account"); } if (output.endsWith(QLatin1String("f_maxamount"))) { return i18nc("Noun, a maximum limit", "Maximum limit"); } if (output.endsWith(QLatin1String("f_minamount"))) { return i18nc("Noun, a minimum limit", "Minimum limit"); } if (output.endsWith(QLatin1String("i_opid"))) { return i18nc("Noun, the id of an operation", "Operation id"); } if (output.endsWith(QLatin1String("#nothing#"))) { return i18nc("Noun, the absence of anything", "-- Nothing --"); } if (output.endsWith(QLatin1String("f_importbalance"))) { return i18nc("Noun", "Balance import"); } if (output.endsWith(QLatin1String("f_reconciliationbalance"))) { return i18nc("Noun", "Balance reconciliation"); } if (output.endsWith(QLatin1String("d_importdate"))) { return i18nc("Noun, the date of the last import", "Import date"); } return SKGDocument::getDisplay(iString); } QString SKGDocumentBank::getRealAttribute(const QString& iString) const { if (iString.endsWith(QLatin1String("t_BANK"))) { return QStringLiteral("bank.rd_bank_id.t_name"); } if (iString.endsWith(QLatin1String("t_BANK_NUMBER"))) { return QStringLiteral("bank.rd_bank_id.t_bank_number"); } return SKGDocument::getRealAttribute(iString); } SKGServices::AttributeType SKGDocumentBank::getAttributeType(const QString& iAttributeName) const { SKGServices::AttributeType output = SKGServices::TEXT; if (iAttributeName == QStringLiteral("t_status") || iAttributeName == QStringLiteral("t_imported")) { return SKGServices::TRISTATE; } if (iAttributeName == QStringLiteral("t_close") || iAttributeName == QStringLiteral("t_bookmarked") || iAttributeName == QStringLiteral("t_auto_write") || iAttributeName == QStringLiteral("t_warn") || iAttributeName == QStringLiteral("t_TRANSFER") || iAttributeName == QStringLiteral("t_template") || iAttributeName == QStringLiteral("t_times") || iAttributeName == QStringLiteral("t_absolute") || iAttributeName == QStringLiteral("t_category_condition") || iAttributeName == QStringLiteral("t_month_condition") || iAttributeName == QStringLiteral("t_year_condition") || iAttributeName == QStringLiteral("t_including_subcategories")) { return SKGServices::BOOL; } output = SKGDocument::getAttributeType(iAttributeName); return output; } QVariantList SKGDocumentBank::getBudget(const QString& iMonth) const { SKGTRACEINFUNC(10); QVariantList table; SKGStringListList listTmp; SKGError err = executeSelectSqliteOrder("SELECT t_CATEGORY, f_budgeted, f_CURRENTAMOUNT, f_DELTABEFORETRANSFER, f_budgeted_modified FROM v_budget " "where t_PERIOD='" % iMonth % "' ORDER BY t_CATEGORY;", listTmp); int nbval = listTmp.count(); if (!err && nbval > 1) { table.reserve(nbval + 1); table.push_back(QVariantList() << "sum" << getDisplay(QStringLiteral("t_CATEGORY")) << getDisplay(QStringLiteral("f_budgeted_modified")) << getDisplay(QStringLiteral("f_CURRENTAMOUNT")) << getDisplay(QStringLiteral("f_DELTA"))); double sum1 = 0; double sum2 = 0; double sum3 = 0; double sum4 = 0; for (int i = 1; i < nbval; ++i) { // Ignore header double v1 = SKGServices::stringToDouble(listTmp.at(i).at(1)); double v2 = SKGServices::stringToDouble(listTmp.at(i).at(2)); double v3 = SKGServices::stringToDouble(listTmp.at(i).at(3)); double v4 = SKGServices::stringToDouble(listTmp.at(i).at(4)); table.push_back(QVariantList() << false << listTmp.at(i).at(0) << v1 << v2 << v3 << v4); sum1 += v1; sum2 += v2; sum3 += v3; sum4 += v4; } table.push_back(QVariantList() << true << i18nc("Noun, the numerical total of a sum of values", "Total") << sum1 << sum2 << sum3 << sum4); } return table; } QVariantList SKGDocumentBank::getMainCategories(const QString& iPeriod, int iNb) { SKGTRACEINFUNC(10); QVariantList table; SKGServices::SKGUnitInfo primary = getPrimaryUnit(); QString wc = "t_TRANSFER='N' AND t_TYPEEXPENSE='-' AND " + SKGServices::getPeriodWhereClause(iPeriod); SKGStringListList listTmp; SKGError err = executeSelectSqliteOrder("SELECT t_REALCATEGORY, TOTAL(f_REALCURRENTAMOUNT), " "100*TOTAL(f_REALCURRENTAMOUNT)/(SELECT TOTAL(f_REALCURRENTAMOUNT) FROM v_suboperation_consolidated WHERE " % wc % ") " "FROM v_suboperation_consolidated " "WHERE " % wc % " GROUP BY t_REALCATEGORY ORDER BY TOTAL(f_REALCURRENTAMOUNT)", listTmp); int nbval = listTmp.count(); if (!err && (nbval != 0)) { table.reserve(nbval); table.push_back(QVariantList() << "sum" << getDisplay(QStringLiteral("t_REALCATEGORY")) << iPeriod << "url" << "percent"); // Add X main categories for (int i = 1; i < nbval && i <= iNb; ++i) { // Ignore header QString cat = listTmp.at(i).at(0); double v = qAbs(SKGServices::stringToDouble(listTmp.at(i).at(1))); double p = qAbs(SKGServices::stringToDouble(listTmp.at(i).at(2))); table.push_back(QVariantList() << false << cat << v << QString(wc % " AND t_REALCATEGORY='" % SKGServices::stringToSqlString(cat) % "'") << p); } // Build "Other" category QStringList listCat; listCat.reserve(nbval); double sum = 0.0; double sumPercent = 0.0; for (int i = iNb + 1; i < nbval; ++i) { listCat.push_back(SKGServices::stringToSqlString(listTmp.at(i).at(0))); sum += qAbs(SKGServices::stringToDouble(listTmp.at(i).at(1))); sumPercent += qAbs(SKGServices::stringToDouble(listTmp.at(i).at(2))); } if (listCat.count() != 0) { table.push_back(QVariantList() << false << i18nc("an other category", "Others") << sum << QString(wc % " AND t_REALCATEGORY IN ('" % listCat.join(QStringLiteral("','")) % "')") << sumPercent); } } return table; } QStringList SKGDocumentBank::get5MainCategoriesVariationList(const QString& iPeriod, const QString& iPreviousPeriod, bool iOnlyIssues, QStringList* oCategoryList) { SKGTRACEINFUNC(10); // Compute input string QString inputString = iPeriod % iPreviousPeriod % (iOnlyIssues ? 'Y' : 'N') % (oCategoryList != nullptr ? 'Y' : 'N'); // Use cache or not QStringList output; if (inputString == m_5mainVariations_inputs) { // Yes output = m_5mainVariations_cache; if (oCategoryList != nullptr) { *oCategoryList = m_5mainVariationsCat_cache; } } m_5mainVariations_inputs = inputString; if (output.isEmpty()) { SKGServices::SKGUnitInfo primary = getPrimaryUnit(); SKGStringListList listTmp; SKGError err = executeSelectSqliteOrder("select *, 100*(A2-A1)/ABS(A1) as 'V' from " "(SELECT t_REALCATEGORY as 'C1', TOTAL(f_REALCURRENTAMOUNT) as 'A1' FROM v_suboperation_consolidated where " "t_TRANSFER='N' AND " + SKGServices::getPeriodWhereClause(iPreviousPeriod) + " AND t_TYPEEXPENSE='-' group by t_REALCATEGORY) A," "(SELECT t_REALCATEGORY as 'C2', TOTAL(f_REALCURRENTAMOUNT) as 'A2' FROM v_suboperation_consolidated where " "t_TRANSFER='N' AND " + SKGServices::getPeriodWhereClause(iPeriod) + " AND t_TYPEEXPENSE='-' group by t_REALCATEGORY) B " "WHERE A.C1=B.C2 AND ABS(A2-A1)/ABS(A1)>0.1 " + (iOnlyIssues ? "AND ((A1<0 AND A2<0 AND A20 AND A2>0 AND A2 Grocery" in November decreased by 14% for a total of 220,48€. Expenses in category "Food" (no subcategory) in November increased by 24% for a total of 70,20€. Expenses in category "Automotive > Fuel" in November increased by 24% for a total of 122,48€. Expenses in category "Misc" in November decreased by 30% for a total of 36,52€. This month, you spent 75,00€ in Category "Bills > Subscriptions". No expense in that category was found in previous month Expenses with mode "withdrawal" reprensented 60,00€ of your expenses in current month*/ QString c1 = listTmp.at(i).at(0); double a1 = SKGServices::stringToDouble(listTmp.at(i).at(1)); double a2 = SKGServices::stringToDouble(listTmp.at(i).at(3)); double v = SKGServices::stringToDouble(listTmp.at(i).at(4)); QString a2f = formatMoney(qAbs(a2), primary); if (a1 < 0 && a2 < 0) { QString vf = formatPercentage(qAbs(v), v < 0); if (v < 0) { m_5mainVariations_cache.push_back(i18n("Expenses in category '%1' increased by %2 for a total of %3.", c1, vf, a2f)); m_5mainVariationsCat_cache.push_back(c1); } else { if (!iOnlyIssues) { m_5mainVariations_cache.push_back(i18n("Expenses in category '%1' decreased by %2 for a total of %3.", c1, vf, a2f)); m_5mainVariationsCat_cache.push_back(c1); } } } else if (a1 > 0 && a2 > 0) { QString vf = formatPercentage(qAbs(v)); if (v > 0) { if (!iOnlyIssues) { m_5mainVariations_cache.push_back(i18n("Incomes in category '%1' increased by %2 for a total of %3.", c1, vf, a2f)); m_5mainVariationsCat_cache.push_back(c1); } } else { m_5mainVariations_cache.push_back(i18n("Incomes in category '%1' decreased by %2 for a total of %3.", c1, vf, a2f)); m_5mainVariationsCat_cache.push_back(c1); } } } } output = m_5mainVariations_cache; if (oCategoryList != nullptr) { *oCategoryList = m_5mainVariationsCat_cache; } } return output; } SKGReport* SKGDocumentBank::getReport() const { return new SKGReportBank(const_cast(this)); }