Commit Graph

74 Commits

Author SHA1 Message Date
Geert Janssens
45cb5504f3 Merge branch 'private-kvp' into master again
This was done by branching right before the original merge
and redoing a clean merge of the private-kvp branch again.

This result was then cherry-picked onto master with
git cherry-pick <merge-commit> -m 1

It was done like this because git merge would consider
the private-kvp branch already merged even after a revert
(see git-revert man page) and won't allow to merge a
second time on the same branch.

Resolved conflicts:
	README.dependencies
	src/app-utils/gnc-sx-instance-model.c
	src/engine/cap-gains.c
	src/engine/test/Makefile.am
	src/gnome/assistant-hierarchy.c
	src/import-export/import-match-map.c
	src/import-export/import-utilities.c
	src/import-export/ofx/gnc-ofx-kvp.c
	src/libqof/qof/qofbook.cpp
	src/libqof/qof/qofinstance-p.h
	src/libqof/qof/qofinstance.cpp
	src/libqof/qof/test/test-kvp_frame.c
	src/report/report-gnome/gnc-plugin-page-report.c
2014-05-07 18:32:47 +02:00
Geert Janssens
ae98012d0c Revert "Merge branch 'private-kvp'"
This reverts commit f49983b801, reversing
changes made to acad5a02bb.
2014-05-07 18:32:44 +02:00
John Ralls
f49983b801 Merge branch 'private-kvp'
Makes all kvp operations private to the object of which the kvp is
a member. Access from outside of the object is accomplished via
GObject Properties. A convenience function, qof_instance_set(),
is provided that wraps g_object_set and marks dirty the instance
so that it will be saved. It is still necessary to wrap calls in
begin_edit/commit to accomplish the save to the SQL backend. A
like-named wrapper, qof_instance_get() is provided to balance the API.

Note that the XML backend retains direct access to KVP to avoid having
to catalog the properties.
2014-05-01 14:57:34 -07:00
John Ralls
6dfb7febf2 Convert capital gains kvp access to properties on Split. 2014-05-01 13:02:07 -07:00
John Ralls
1ead96dc1a Bug 644044 - Lots: SQL backend loses link to Gain/Loss Txn
Gotta edit/commit the source transaction as well as the gains txn.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23438 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-11-25 21:11:08 +00:00
John Ralls
9ea9896620 Remove convenience functions which return a pointer to kvm_data. 2013-11-04 11:32:24 -08:00
John Ralls
e58bcaac34 Move the capital gains account creation from cap-gains.c to Account.c
Functions which change an object's state should be members of the objects class.
2013-11-04 11:32:20 -08:00
John Ralls
9b51d42e7e Remove unused functions. 2013-11-04 11:32:20 -08: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
John Ralls
7694f858d1 Convert all time_t to time64: engine
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22621 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-12-01 22:44:53 +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
Geert Janssens
a0c19b4c71 Bug #502853 - Incorrent tax rounding in invoice (rounding of .5)
This patch changes the default rounding behaviour in GnuCash from
"Round to nearest even" to "Round away to infinity". See the bugreport
for more details on these different rounding methods.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19695 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-10-23 10:38:48 +00:00
Christian Stimming
a57ed88ee0 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@19627 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-10-03 12:27:44 +00:00
Mike Alexander
4bc072690b FIx bug 596124: don't crash if someone adds a split to a capital gains transaction
created by the lot scrubber.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19380 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-07-28 03:48:07 +00:00
Christian Stimming
a322015eb8 Rename the type GUID into GncGUID because on Windows, the system headers have a type GUID which clashes with ours.
Note that only the type was renamed, but not any enums or function names.
Hence, the scheme wrappers should be unchanged completely (hopefully).

Discussed at http://lists.gnucash.org/pipermail/gnucash-devel/2010-March/027679.html

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18969 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-27 21:01:21 +00:00
Christian Stimming
763e4c3d15 Re-indentation of source code, next batch: src/engine/*
This also strips trailing whitespaces from lines where they existed.
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@18788 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-02 21:40:28 +00:00
Phil Longstaff
46c071490b Don't include gnc-lot-p.h where not needed
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18758 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-02-28 13:13:27 +00:00
Phil Longstaff
a3ca714396 Convert GNCLot to use more gobject features. Removes all direct access to lot object fields, which are now accessed through functions or property names (for backend sql load).
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18745 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-02-27 15:54:20 +00:00
Phil Longstaff
8de27ea72d Make some parameters const
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16762 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-12-29 17:43:46 +00:00
Derek Atkins
fec3d53296 Allow creation of new lots from lot viewer. (#420543)
Patch by Klee Dienes <klee@mit.edu>

        * src/engine/Account.c (xaccAccountRemoveLot): Generate a
        QOF_EVENT_REMOVE for the lot and QOF_EVENT_MODIFY for the account.
        (xaccAccountInsertLot): Ditto, but QOF_EVENT_ADD.
        * src/engine/gnc-lot.c (gnc_lot_make_default): Move from
        cap-gains.c.
        * src/engine/gnc-lot.h (gnc_lot_make_default): Add prototype.
        * src/engine/cap-gains.c (MakeDefaultLot): Move to gnc-lot.c as
        gnc_lot_make_default().
        * src/gnome/lot-viewer.c: Add code to support lot creation:
        (RESPONSE_NEW_LOT): Add enumerated value.
        (lv_save_current_row): New function.
        (lv_select_row): Add call to lv_save_current_row.
        (lv_unselect_row): Use lv_save_current_row.
        (lv_close_handler): Use lv_save_current_row.
        (lv_response_cb): Handle RESPONSE_NEW_LOT.
        (gnc_lot_viewer_dialog): Watch for QOF_EVENT_ADD and
        QOF_EVENT_REMOVE for lots.
        * src/gnome/glade/lots.glade: Add "new lot" button.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16725 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-12-26 02:14:55 +00:00
Derek Atkins
6f39c0c26e (#492137) Re-apply r16619 and make a change to the test
harness to actually get the checks to pass with r16690.
This was an overflow in the test harness.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16716 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-12-24 21:18:09 +00:00
Derek Atkins
27fcf8ff7c Back out r16619 (#492137) because it breaks test-lots
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16712 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-12-24 04:40:46 +00:00
Andreas Köhler
1a408c8160 #492137: Patch from Mike Alexander to fix regression in lot scrubber introduced in r16370.
Timespec uses a signed integer for the seconds instead of an unsigned.

BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16619 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-12-08 14:11:03 +00:00
David Hampton
4f6fd1b090 Move QofInstance book properties from its public data structure to its
private data structure.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16038 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-02 03:18:46 +00:00
David Hampton
ce65024722 Start putting an API in place for access to the members of the
QofInstance object.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16025 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-30 05:33:33 +00:00
David Hampton
cfa50383a5 Replace a function name mapping with the real function call.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15936 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-19 05:09:34 +00:00
David Hampton
468b8995bf Finish moving account specific properties from the public data
structure to a private data structure.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15933 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-19 04:16:39 +00:00
David Hampton
c6a609b8f7 Move more account properties from the public data structure to a
private data structure, with access to them as properties of the
object.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15921 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-18 04:50:34 +00:00
David Hampton
c089bf0fbd More moving of properties from the public data structure to a private
data structure, with access to them as properties of the object.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15891 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-14 22:48:22 +00:00
Derek Atkins
12461c5b30 * Merge QofEntity into QofInstance
- QofEntity -> QofInstance
  - qof_entity -> qof_instance
  - QOF_ENTITY -> QOF_INSTANCE
* remove references to instance.entity
* keep qof_entity_init() and qof_entity_release() for now


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/gobject-engine-dev-warlord@15773 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-01 22:18:50 +00:00
David Hampton
6fbada92ec Remove all traces of the AccountGroup data structure. Accounts now
point directly to their parent and have a simple GList of children.
(The old method was alternating data structures in the form Account,
AccountGroup, Account, AccountGroup, etc.)


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15647 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-23 01:23:31 +00:00
Chris Shoemaker
dde4a52308 More comments, spelling fixes, line-wraps, whitespace cleanups.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14615 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-08 23:16:54 +00:00
David Hampton
fc5fe1e5a6 Regularize the account type names into the form ACCT_TYPE_xxx.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14599 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-06 22:07:12 +00:00
David Hampton
4ec2cc45e7 This patch fixes almost all of the test-period errors. It still
sometimes gets an error because it generates an amount that can't be
represented with the denominator it has chosen, but there's not much
gnucash can do about that.  From #342153.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14122 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-18 02:06:36 +00:00
Chris Shoemaker
40a9ed1925 Move some gains-related transaction-scrubbing operations to from
cap-gains.c to Transaction.c.
   Fix a logic error where "split->gains |= ~GAINS_STATUS_ADIRTY" was supposed
   to be "split->gains &= ~GAINS_STATUS_ADIRTY".

   Disable the loop-restart code in xaccTransScrubGainsDate() because I think
   the state changes inside the loop will never cause a previously-skipped 
   Split to be not skipped during another pass.

   Incidental:
      make both xaccTransFindSplitByAccount() arguments 'const'
      Internalize Begin/Commit edit block into xaccTransScrubSplits()


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13921 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-05 00:40:15 +00:00
David Hampton
2f5698d619 Patch from Mike Alexander's to handle multiple lot dispositions on the
same day.  Needed since the transaction sorting code may sort gains
splits after other splits on the same day. Add a new function to find
the source split associated with a capital gains split.  Also use
lot_amount and lot_value consistently instead of opening_amount and
opening_value.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13887 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-30 03:52:05 +00:00
David Hampton
4a5f6e30ca Mike Alexander's patch to fix lot date calculation, and to include all
splits when computing capital gain's instead of just the opening lot.
Scrub lots when scrubbing everything else.  Some MacOs X fixes.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13872 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-04-28 21:11:01 +00:00
Chris Shoemaker
c1ef3fd6db Convert Split from QofEntity to QofInstance.
Let QofInstance manage the book pointer and kvp frame instead of Split 
   managing its own.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13131 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-06 17:12:39 +00:00
David Hampton
f990299ddb Remove extraneous carriage returns from text that will be put into a
GtkLabel (since labels know how to wrap text).


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13046 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-01-30 03:13:28 +00:00
Chris Shoemaker
d96b0c7d81 Constify some Split and Transaction functions.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12229 57a11ea4-9604-0410-9ed3-97b8803252fd
2005-12-31 23:35:55 +00:00
David Hampton
db2bed0e58 Include file cleanup. Remove the messages.[ch] files in favor of the
glib supplied gi18n.h file.  Replace includes of gnome.h with gtk.h
(or better yet glib.h) wherever possible.  Don't include gnome.h from
any header files.  Remove some extraneous includes.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@11981 57a11ea4-9604-0410-9ed3-97b8803252fd
2005-11-19 23:53:34 +00:00
David Hampton
0b8a944f30 Update FSF street address.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@11964 57a11ea4-9604-0410-9ed3-97b8803252fd
2005-11-17 05:35:02 +00:00
David Hampton
f28d033d74 Collapse the gnome2 branch back into HEAD.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@11565 57a11ea4-9604-0410-9ed3-97b8803252fd
2005-11-02 03:32:36 +00:00
Linas Vepstas
8113c9ccaf fix null pointer deref
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10229 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-08-27 18:46:44 +00:00
Linas Vepstas
0d5411a571 sync with German Wiki (I'm copying the description I wrote there to here).
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10189 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-10 14:33:09 +00:00
Linas Vepstas
441046b19e add check -- cap gains not possible is value and amount are in the same
currency


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10171 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-06 14:39:19 +00:00
Linas Vepstas
f732926232 remove really dorky memory leak during debug printing
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10160 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-04 17:26:50 +00:00
Linas Vepstas
1a66b7b8d4 improved diagnostic messages
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10154 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-04 04:26:01 +00:00
Linas Vepstas
cc663f2098 -- reject voided transactions in cap-gains caluclations;
-- improve diagnostic error messages


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10147 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-03 18:57:31 +00:00
Linas Vepstas
fdbd2da2ab -- improve debug printing messages.
-- re-order math to make overflow less like to occur


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10131 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-07-02 04:03:59 +00:00