Commit Graph

175 Commits

Author SHA1 Message Date
John Ralls
b694df7202 Prevent overflow.
LCD denom was equivalent to using rounding.denom, which is val.denom * 10.
If val.num was at the max # of digits that would overflow, so instead
fix val.denom and actually round the result; since we're adding
5/(val.denom * 10) to accomplish the rounding we want to truncate the result.
2014-12-03 16:28:54 -08:00
Frédéric Perrin
733e6e91da Bug 723145 - Currency display does not respect locale
Use the system-provided symbol for the locale currency
2014-05-20 16:18:21 +02:00
Geert Janssens
510c20b8a9 Use scm_[to/from]_utf8_string instead of scm_[to/from]_locale_string as per guile recommendation
Notes:
- in some situations the original *locale_string variant is retained. This
  is when locale encoded strings are processed (mostly file names).
- the utf8 variants don't exist for guile 1.8. For that version these
  functions will be rededefined to call the locale variants.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23556 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-12-13 20:21:41 +00:00
Geert Janssens
bc1970bf71 Use the symbol in iso-4217-currencies by default
Author:    Frédéric Perrin <frederic.perrin@resel.fr>

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23345 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-10-28 09:22:38 +00:00
Geert Janssens
7a0b3405da Use the new user_symbol property where relevant
Author:    Frédéric Perrin <frederic.perrin@resel.fr>

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23322 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-10-24 12:27:49 +00:00
Geert Janssens
ce33da254f Gsettings schema corrections
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23272 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-10-07 14:31:50 +00:00
Geert Janssens
1ca78698ce Gnc-Prefs: rename preferences to be compliant with gsettings syntax rules
Syntax changes in short:
1. replace all _ with - in preference keys and groups (_ is not allowed)
2. base path should be /org/gnucash instead of /apps/gnucash

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23266 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-10-07 14:30:10 +00:00
Geert Janssens
b453bf3838 Gnc-Prefs: migrate GtkRadiobutton widgets (and associated preferences)
All GtkRadiokButtons now use the new preferences backend
so drop the GtkRadiokButton-Gconf wiring as well.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23247 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-10-07 14:16:36 +00:00
Geert Janssens
939d8f5f3a Gnc-Prefs: migrate account_separator preference (and associated GtkEntry widget)
All GtkEntries now use the new preferences backend
so drop the GtkEntry-Gconf wiring as well.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23243 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-10-07 14:15:18 +00:00
Geert Janssens
f9e0da38f4 Gnc-Prefs: migrate GtkSpinbutton widgets (and associated preferences)
All GtkSpinkButtons now use the new preferences backend
so drop the GtkSpinkButton-Gconf wiring as well.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23240 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-10-07 14:13:51 +00:00
Geert Janssens
8984c78f94 Gnc-Prefs: migrate most preferences found in app-utils
This required  changes in dependent modules as well. And obviously
the gnc-gconf-utils.[ch] files are not removed yet. Too many
other files still require those.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23228 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-10-07 14:08:17 +00:00
Christian Stimming
fd9ea2d808 Improve transaction currency lookup by using the new account_or_default currency getter.
Previously, this could result in transactions that have a non-currency as
txn commodity, which is what the multi-currency register tried to avoid hard.
Now by using account_or_default_currency, the currency choosing policy from
the register is available in the other places where new transactions are
created, hence we better use that here.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23056 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-06-19 15:47:39 +00:00
Christian Stimming
2bbcd7733f Refactor lookup of a commodity that is a currency for a specific account into general function gnc_account_or_default_currency().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23055 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-06-19 15:47:27 +00:00
Christian Stimming
85749ec058 Change all usage of xaccTransSetDatePostedSecs to xaccTransSetDatePostedSecsNormalized.
In fact, all calls to this setter refer to the plain date and not to
any time-of-day. Consequently, only the normalized setter must be used
everywhere. (Subsequently, the previous setter could be removed, as
it turned out to be not used anywhere, but that's another story.)

As a side effect, this makes the register2 set the PostedDate in the
same way as the old register again. The register2 used to introduce a
time-of-day part in the PostedDate, but this should not be done. Only
the EnteredDate has a time-of-day part.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23045 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-06-09 21:33:19 +00:00
Geert Janssens
eb409ecd35 Refactor file backend settings to no longer depend on gconf
This affects many other components as well, including the
python bindings

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22942 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-05-03 12:03:38 +00:00
Geert Janssens
5666e5bd6d Properly use scm_dynwind_* functions where they still make sense
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22685 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-12-22 18:20:39 +00:00
J. Alex Aycinena
7cdd7372f5 Implement a Book Option to give users the choice to use the transaction number field (default and current behaviour) or, alternatively, the split action field of the anchor split for 'Num' column on registers, reports, import and export, where applicable. The difference between the two is that with the default, the same 'Num' is displayed for a given transaction regardless of what register it is viewed in and with the new option, a different 'Num' can be entered/displayed for a given transaction in each register it is viewed in. In both cases, the 'next number logic' of the 'Num' cell is based on the account of the register the transaction is entered/viewed from but in one case it fills the transaction number, in the other, it fills the split action field of the anchor split (with the transaction number field displayed in the register cell labeled 'T-Num'). In both cases, both fields are visible and can be used as free-form text in double-line mode for any value the user wants. If the new option is not selected, there should be no change in Gnucash's behaviour with the exception of displaying the book options dialog in 'new book' situations.
The changes made are:

1.  Implement the new book option to select source for 'num' cell:
     libqof/qof/qofbookslots.h - define num source option
     engine/engine.i - define 'NUM-FIELD-SOURCE' as an option name and
         'SPLIT-ACTION' as a term for sorting queries
     app-utils/business-prefs.scm - define book option for num-field-source
     app-utils/app-utils.scm - define and export book option for num-field-source

2.  Implement functions to get book option setting and to test:
     libqof/qof/qofbook.c & .h - define function to get number source book option
     libqof/qof/test/test-qofbook.c - test function to get number source book option

3.  Implement a notification mechanism for book option changes:
     engine/engine-helpers.c & .h - define functions to register callbacks,
         define function to remove callbacks and
         define function to initiate callbacks on book num-source option changes
     core-utils/gnc-features.c & .h - define feature for num-source
     app-utils/gnc-ui-util.c & .h - define gnc_book_option_num_field_source_change_cb;
         include setting of feature flag on initial use
     gnome-utils/gnc-main-window.c - change name of gnc_options_dialog_apply_cb
         function to gnc_book_options_dialog_apply_cb and adjust function to 
         call function gnc_book_option_num_field_source_change_cb when book
         option for num-field-source changes; change name of
         gnc_options_dialog_close_cb to gnc_book_options_dialog_close_cb

4.  Implement 'help' button response on Book Option Dialog:
     gnome-utils/gnc-ui.h - define "book-options" section of help manual
     gnome-utils/gnc-gnome-utils.c & .h - implement Book Options help callback
     gnome-utils/gnc-main-window.c - use gnc_options_dialog_set_book_options_help_cb
         to make help button active

5.  Implement utility functions to get/set number/action based on book option:
     engine/engine-helpers.c & .h - define 'gnc_get_num_action' function
         define 'gnc_get_action_num' function
         define 'gnc_set_num_action' function
     engine/engine.i - make get/set num/action functions available to guile &
         allow #f to be used in place of NULL from guile
     engine/Transaction.h - add reference to utility functions in comments to 
         xaccTransSetNum and xaccTransGetNum functions
     engine/Split.h -  add reference to utility functions in comments to 
         xaccSplitSetAction and xaccSplitGetAction functions

6.  Implement register use of num source book option; for General, Income and Search
    Ledgers, since there is no anchor split, always show tran-num in transaction
    cursor, but vary label to correspond to book option:
     register/ledger-core/split-register.h - define TNUM_CELL
         define CURSOR_DOUBLE_LEDGER_NUM_ACTN cursor name to use TNUM_CELL
         define CURSOR_DOUBLE_JOURNAL_NUM_ACTN cursor name to use TNUM_CELL
         add boolean to split_reg structure to hold num source book option
     register/ledger-core/split-register-layout.c -
         add logic to define and set up new ledger/journal cursors with TNUM_CELLs
         add logic to add the new cursors to a layout
         add logic to add TNUM_CELL to a layout
     register/ledger-core/split-register-model.c -
         define function to get TNUM_CELL label
         add logic to recognize ledger/journal cursors with TNUM_CELL
         modify function to get NUM_CELL value based on book option and register
             type
         define function to get TNUM_CELL value
         adjust num help text to reflect book option choice
         define function to get TNUM_CELL help
         modify function to get action help to reflect book option choice
         set up handlers for TNUM_CELL
     register/ledger-core/split-register-model-save.c -
         use 'gnc_set_num_action' function to set num/action for NUM_CELL based
             on book option
         define function to save TNUM_CELL using 'gnc_set_num_action' function
         set save handler for TNUM_CELL
     register/ledger-core/split-register-util.c - 
         modify logic to recognize ledger/journal cursors with tnum_cell
     register/ledger-core/split-register.c -
         define split_register_book_option_changed function
         register split_register_book_option_changed function in register init
         initialize register structure setting to book option
         remove split_register_book_option_changed function in register destroy
         modify gnc_split_register_save_to_scm to handle TNUM_CELL

7.  Enhance transaction copy/duplicate logic to accommodate new book option:
     gnome/gtkbuilder/gnc-plugin-page-register.glade -
         add widgets to handle trans number and/or split action based on book option
     gnome-utils/dialog-dup-trans.c & .h -
         add capability to display and handle 'Num' field according to book option
     gnome/gnc-plugin-page-register.c - define gnc_find_register_by_account
     register/ledger-core/split-register.c -
         modify gnc_split_register_duplicate_current to accomodate book option
         setting
     register/ledger-core/Makefile.am - add GNOME_CFLAGS
     register/ledger-core/test/Makefile.am - add libgnc-gnome.la

8.  Adjust register sort and sort labels related to Num/Action radio buttons to
    correspond to book option for clarity:
     gnome/gnc-plugin-page-register.c -
         define gnc_plugin_page_register_sort_book_option_changed to adjust labels
         register function in gnc_plugin_page_register_cmd_view_sort_by
             and save num and action radio widgets
         initialize radio widget labels to correspond to book option
         remove function in gnc_plugin_page_register_sort_response_cb
             and clear num and action radio widgets
     gnome/gnc-split-reg.c & h. - 
         create versions of gnc_split_reg_sort and gnc_split_reg_set_sort to force
             a re-sort to be used when num-source book option changes
     engine/Transaction.c & .h -
         modify default sort to use split action in place of tran num per book
             option if called from xaccSplitOrder
     engine/Split.c - 
         modify xaccSplitOrder to call xaccTransOrder_num_action to switch use of
             split action and tran num per book option
     engine/test/utest-Split.c -
         modify test_xaccSplitOrder to call xaccTransOrder_num_action based on
             book option

9.  Adjust transaction find labels related to Num/Action to correspond to book option
    for clarity:
     gnome/dialog-find-transactions.c - adjust labels in search criteria based
         on book option
     gnome-search/dialog-search.c -
         define gnc_search_dialog_book_option_changed to adjust labels
         register function in gnc_search_dialog_init_widgets when searching
             for splits
         remove function in gnc_search_dialog_close_cb if registered

10. Modify new file process to allow setting of num-source (actually, all) book
    option(s) during New Account Hierarchy Setup:
     gnome-utils/gtkbuilder/dialog-preferences.glade - add a user preference for
         the default setting for 'num-source' for new books
     core-utils/gnc-gconf-utils.h - define KEY_NUM_SOURCE
     gnome-utils/gnc-gnome-utils.c & h. -
         define gnc_options_dialog_set_new_book_option_values to retrieve
         preference values
     gnome-utils/dialog-options.c & .h - define gnc_options_dialog_new_modal to
         surpress apply button
     gnome-utils/gnc-main-window.c - define function gnc_book_options_dialog_cb
         with arguments so that the window can be called in modal mode and the
         title changed and return dialog widget; call gnc_options_dialog_new_modal
         instead of gnc_options_dialog_new; call this function from
         gnc_main_window_cmd_file_properties with new arguments; for modal mode,
         call gnc-options-dialog-set-new-book-option-values to initialize values
         from preferences
     app-utils/gnc-ui-util.c & h. - create function gnc_is_new_book for
         determining when a new book is being created
     gnome-utils/dialog-utils.c & h. - define gnc_new_book_option_display to
         display book options dialog in modal mode
     gnome/gtkbuilder/assistant-hierarchy.glade - add notification about book
         options to currency page
     gnome/assistant-hierarchy.c - add ability to set book option initialized
         from preferences value for new books by using functions gnc_is_new_book
         and gnc_new_book_option_display

11. Modify Import QIF process to recognize a new-book situation and allow setting
    of book options during first import into a new book; also follow book option
    setting for num source in importing number whether new book or not:
     import-export/qif-import/assistant-qif-import.glade - add notification about
         book options to currency page
     import-export/qif-import/assistant-qif-import.c - using function
         gnc_is_new_book to identify 'new book' situation and set flag; add
         logic to handle 'new-book' situation by calling
         gnc_new_book_option_display function
     import-export/qif-import/qif-to-gnc.scm - use 'gnc_set_num_action' function
         to import number to correct field based on book option

12. Modify Import OFX/QFX process to recognize a new-book situation and allow setting
    of book options during first import into a new book; also follow book option
    setting for num source in importing number whether new book or not:
     import-export/ofx/gnc-ofx-import.c - use 'gnc_set_num_action' function to import
         number based on book option; identify 'new book' situation using function
         gnc_is_new_book and set flag; add logic to handle 'new-book' situation
         by raising book options dialog by calling gnc_new_book_option_display
         function
     import-export/import-backend.c - use 'gnc_get_num_action' function to 
         retrieve number from transactions to be matched based on book option

13. Modify Import AqBanking process to recognize a new-book situation and allow
    setting of book options during first import into a new book; also follow
    book option setting for num source in importing number:
     import-export/aqbanking/gnc-file-aqb-import.c - identify 'new book'
         situation using function gnc_is_new_book and handle by raising book
         options dialog by calling gnc_new_book_option_display function
     import-export/aqbanking/gnc-ab-utils.c - use 'gnc_set_num_action' function
         to set number based on book option

14. Modify Import Transactions from CSV process to recognize a new-book situation
    and allow setting of book options during first import into a new book; also
    follow book option setting for num source in importing number whether new
    book or not:
     import-export/csv-import/assistant-csv-trans-import.glade - modify
         commments to alert user of raising book options dialog in cases of csv
         import into a new book
     import-export/csv-import/gnc-csv-model.c & h. - use 'gnc_set_num_action'
         function to import number based on book option
     import-export/csv-import/assistant-csv-trans-import.c - add logic to handle
         'new-book' situation by raising book options dialog by calling
         gnc_new_book_option_display function; identify 'new book' situation
         using function gnc_is_new_book and set flag

15. Modify Import Accounts from CSV process to recognize a new-book situation
    and allow setting of book options during first import into a new book
     import-export/csv-import/assistant-csv-account-import.c & .h - add logic to
         handle 'new-book' situation by raising book options dialog by calling
         gnc_new_book_option_display function; identify 'new book' situation
         using function gnc_is_new_book and set flag

16. Modify Export Transactions to CSV process to follow book option setting
    for num source in exporting transactions:
     import-export/csv-export/csv-transactions-export.c - modify headings to
         reflect num-source book option and use 'gnc_get_num_action' function
         to retrieve number and action

17. Modify register reporting to reflect book option setting for num source:
     gnome/gnc-plugin-page-register.c - determine and pass along ledger-type?
         argument to gnc:register-report-create function
     gnome/gnc-plugin-page-register2.c - determine and pass along ledger-type?
         argument to gnc:register-report-create function
     report/standard-reports/standard-reports.scm - add ledger-type? argument
         to gnc:register-report-create function; pass it along to
         gnc:register-report-create-internal function
     report/standard-reports/register.scm - add ledger-type? argument to
         gnc:register-report-create-internal function; use 'gnc-get-num-action'
         function in place of xaccTransGetNum and 'gnc-get-action-num' function
         in place of xaccSplitGetAction and modify report headings and option
         text accordingly

18. Modify all places that use xaccTransSetNum and/or xaccSplitSetAction to use
    'gnc_set_num_action' function to set number based on book option except
    engine/Transaction.c & .h, engine/test-core/test-engine-stuff.c,
    engine/Split.c & .h, engine/test/utest-Split.c, engine/engine-helpers.c & .h,
    engine/engine-interface.scm, backend/xml/gnc-transaction-xml-v2.c,
    backend/xml/io-gncxml-v1.c, import-export/log-replay/gnc-log-replay.c:
     engine/gncOwner.c - use 'gnc_set_num_action' function to set number based
         on book option
     engine/gncInvoice.c - use 'gnc_set_num_action' function to set number based
         on book option
     engine/SchedXaction.c - use 'gnc_set_num_action' function to set number and
         action
     engine/cap-gains.c - use 'gnc_set_num_action' function to set split-action
     gnome-utils/dialog-transfer.c - use 'gnc_set_num_action' function to set
         number based on book option
     gnome-utils/gnc-tree-view-split-reg.c - use 'gnc_set_num_action' function
         to set number/action based on book option
     gnome/assistant-stock-split.c - use 'gnc_set_num_action' function to set
         split-action

19. Modify all places that use xaccTransGetNum and/or xaccSplitGetAction to use
    'gnc_get_num_action' or 'gnc_get_action_num' functions to get number based
    on book option except engine/Transaction.c & .h,
    engine/test-core/test-engine-stuff.c, engine/Split.c & h.,
    engine/test/utest-Split.c, engine/engine-helpers.c,
    engine/engine-interface.scm, backend/xml/gnc-transaction-xml-v2.c,
    backend/xml/test/test-xml-transaction.c:
     gnome/dialog-lot-viewer.c - use 'gnc_get_num_action' function to retrieve
         number based on book option
     gnome/dialog-sx-from-trans.c - use 'gnc_get_num_action' function to
         retrieve number and action
     gnome/dialog-print-check.c - use 'gnc_get_num_action' function to
         retrieve number and 'gnc_get_action_num' function to retrieve action
     register/ledger-core/split-register-model.c - use 'gnc_get_num_action'
         function to retrieve number based on book option
     register/ledger-core/split-register-load.c - use 'gnc_get_num_action'
         function to retrieve number based on book option
     register/ledger-core/split-register-control.c - use 'gnc_get_num_action'
         function to retrieve action
     register/ledger-core/split-register.c - use 'gnc_get_num_action'
         function to retrieve transaction-num 
     engine/cap-gains.c - use 'gnc_get_num_action' function to get split-action
     gnome-utils/gnc-tree-view-split-reg.c - use 'gnc_get_num_action' function
         to retrieve number and 'gnc_get_action_num' function to retrieve action
     gnome-utils/gnc-tree-model-split-reg.c - use 'gnc_get_num_action' function
         to retrieve transaction-number but may not be getting what is expected
         if book option to use split-action for 'num' is set
     report/locale-specific/us/taxtxf.scm - use 'gnc-get-num-action' function in
         place of xaccTransGetNum and 'gnc-get-action-num' function in place of 
         xaccSplitGetAction and modify report headings and option text accordingly
     report/standard-reports/transaction.scm - use 'gnc-get-num-action' function
         in place of xaccTransGetNum, adjust sorting based on book option and
         modify report headings and option text accordingly; add 'SPLIT-ACTION'
         as a term for sorting queries
     report/business-reports/customer-summary.scm - use 'gnc-get-num-action'
         function in place of xaccTransGetNum
     report/business-reports/owner-report.scm - use 'gnc-get-num-action'
         function in place of xaccTransGetNum
     report/business-reports/job-report.scm - use 'gnc-get-num-action' function
         in place of xaccTransGetNum
     business/business-gnome/dialog-payment.c - use 'gnc_get_num_action'
         function to retrieve number based on book option


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22681 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-12-22 06:00:54 +00:00
Geert Janssens
bf896bcdfa Guile 2: replace deprecated functions
These are all simple one to one mappings.
The replacements require guile 1.8 or newer.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22652 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-12-15 17:58:58 +00:00
John Ralls
6716e3ac5b Convert all time_t to time64: app-utils
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22620 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-12-01 22:44:41 +00:00
Geert Janssens
c5e2adcb7a Refactor safe_strcmp into the glib standard g_strcmp0
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22290 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-08-07 17:24:55 +00:00
John Ralls
b391754ff6 Correct -Wunused warnings
The actual change to configure.ac (at line 1106) to enable -Wunused -- or rather to un-disable it -- is not included in order to not break the build for folks with buggy versions of swig.
(For example, https://sourceforge.net/tracker/?func=detail&aid=3530021&group_id=1645&atid=101645)

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22203 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-05-26 23:47:34 +00:00
Christian Stimming
3fcdf59adf Re-indentation of source code.
As usual, re-indentation was done using astyle-1.24 using the following options:

  astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21816 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-01-01 20:36:46 +00:00
John Ralls
6a6d3049dc [Testing] Stifle the spew in app-utils checks.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21700 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-12-09 23:49:41 +00:00
John Ralls
f4749ef3ed [Cruft Reduction] Remove unused functions from src/app-utils
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21571 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-11-17 21:27:56 +00:00
Christian Stimming
10891aa738 Fix erroneous return value of gnc_gconf_get_float()
Discovered in bug#663433 - the return value was cached in an int variable
instead of a gdouble one.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21541 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-11-09 13:07:05 +00:00
Geert Janssens
14b5d38115 Move ui related balance calculation functions to separate file
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21216 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-08-23 21:20:27 +00:00
Christian Stimming
1961766c99 Re-indentation of source code.
As usual, re-indentation was done using astyle-1.24 using the following options:

  astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21205 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-08-22 07:10:56 +00:00
Geert Janssens
98f42d2ecd Owner balances: flip sign
Now a positive balance means, amount still due, a negative balance
means overpayment. This aligns with other uses of balances like in the
"Bills Due Reminder" dialog

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21186 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-08-17 10:54:41 +00:00
Geert Janssens
1b7bd7b3e9 Implement a balance for owners and show it on the owners view page
The Balance column is not visible by default, but can be activated
with the blue arrow in the top-right of the page.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21182 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-08-13 15:33:42 +00:00
Geert Janssens
4fadc8eaf2 Spelling corrections in comments
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21180 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-08-13 15:33:17 +00:00
J. Alex Aycinena
c370528908 Correct memory leaks found with Valgrind.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20631 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-05-11 22:17:56 +00:00
J. Alex Aycinena
b8e8f51330 Improve txf scheme routines to handle invalid tax-entity-types more gracefully.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20611 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-05-06 00:02:54 +00:00
J. Alex Aycinena
32dd7413dd Add validation of tax-entity-type in book relative to locale-based tsx.scm
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20608 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-05-03 00:06:11 +00:00
Christian Stimming
ffa95c6c03 Bug #645518: Partly revert r20378, "Correct memory leaks found with valgrind"
The original author (Alex) asked to have this part reverted as it seems
to cause the crash explained in the bugreport, but he doesn't have time
to investigate this in detail right now.

BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20496 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-03-27 19:18:10 +00:00
J. Alex Aycinena
4516270399 Correct memory leaks found with valgrind
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20378 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-03-05 23:29:12 +00:00
J. Alex Aycinena
c17a907f08 Correct memory leak found with valgrind
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20364 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-03-03 00:30:10 +00:00
Christian Stimming
af2630904f Re-indentation of source code.
This re-indentation was done using astyle-1.24 using the following options:

  astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20343 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-02-26 14:04:34 +00:00
Christian Stimming
5f7e50efef Make log warning about bad gnc_numeric print the actual error code.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20281 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-02-12 15:53:37 +00:00
John Ralls
8ff535a1af Move gnc_locale functions from src/app-utils/gnc-ui-util to src/core-utils/gnc-locale-utils (new files) and adjust accordingly.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20209 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-01-31 04:29:48 +00:00
J. Alex Aycinena
9968d038a2 Modify Tax Info on Account Page to display or not display sub-account info based on whether row is expanded.
Revert changes made in gnc-ui-util.c in rev 20039 and instead put those changes in new function: gnc_ui_account_get_tax_info_sub_acct_string.

Define a new column, GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO_SUB_ACCT, in gnc-tree-model-account.c filled with gnc_ui_account_get_tax_info_sub_acct_string.

Modify gnc-tree-view-account.c to define a tax_info_data_func that displays only the the data in the GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO model column if the row is expanded; otherwise it combines it with the data in the GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO_SUB_ACCT model column. Modily the view creation function to use the new tax_info_data_func.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20207 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-01-30 20:34:55 +00:00
Christian Stimming
2057e6ed34 Re-indentation of source code.
This re-indentation was done using astyle-1.24 using the following options:

  astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20200 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-01-29 21:37:27 +00:00
John Ralls
4187f8dc78 Adjust gnc_push_locale and gnc_pop_locale to take a locale category and
to handle MSWin32 (following gnome/druid-hierarchy.c) correctly.
Use them in gnc-backend-dbi.c instead of the incorrect code from r20189 
(Thanks, Christian).



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20192 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-01-29 20:40:02 +00:00
Christian Stimming
c8f1244fff Re-indentation of source code.
This re-indentation was done using astyle-1.24 using the following options:

  astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20163 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-01-24 14:10:09 +00:00
Geert Janssens
19d75d552b Bug 639322 part 3: provide users with a sensible first time "Save As..." path on Windows
While $HOME is fine on linux, on Windows the most sensible location is "My Documents"
(or its translated equivalent).

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20101 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-01-14 21:47:44 +00:00
J. Alex Aycinena
04078234c0 Add info about sub-accounts to Tax Info column on Accounts page.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20039 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-01-08 23:52:13 +00:00
Phil Longstaff
920f5ab815 Plug memory leak
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20009 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-12-31 01:38:37 +00:00
Christian Stimming
febe74e6c0 Replace more obsolete #define'd function names by their current names.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19936 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-12-13 21:00:23 +00:00
Christian Stimming
6dfd0f28f4 Re-indentation of source code.
This re-indentation was done using astyle-1.24 using the following options:

  astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19907 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-12-04 21:09:57 +00:00
Geert Janssens
6ad9f9f74f Rename old gnc_book_get_commodity_table into the newer gnc_commodity_table_get_table.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19666 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-10-16 14:05:29 +00:00
Geert Janssens
072ee537ab Rework two nearly identical fuctions into a common function with parameters.
Keep the old function names as convenience wrappers around the new function.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19657 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-10-14 21:00:46 +00:00