Commit Graph
100 Commits
Author SHA1 Message Date
Chris Shoemaker c2ae90cc94 Factor out and create new function: xaccAccountIsPriced() that does the
common STOCK, MUTUAL or CURRENCY check.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13513 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 05:31:54 +00:00
Chris Shoemaker 5badb824e6 When periodically checking for ui events, avoid creating a QofSession
if we don't already have one.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13512 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 04:45:46 +00:00
Chris Shoemaker 15e375ad1c Minor code factoring, line-wraps, control-flow simplifications, etc.
centered around split-register-load.c.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13510 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 03:41:39 +00:00
Chris Shoemaker 2f97e55f9f Factor out one small piece of the huge gnc_split_register_load() into
new static function add_quickfill_completions().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13508 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 03:07:41 +00:00
Chris Shoemaker a914a4da55 Factor out and create new function: gnc_commodity_is_currency().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13507 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 02:42:12 +00:00
Chris Shoemaker 113daf6340 Move both old an new-style Account MODIFY events into the "on_done" case
of qof_commit_edit_part2().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13505 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-07 00:27:38 +00:00
Chris Shoemaker a34235d810 Don't force a resort of Account's split lists during xaccTransCommitEdit().
This happens already in xaccAccountCommitEdit() and if the Account isn't
   being edited, then we inserted the Split in sorted order anyway.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13498 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-05 23:46:39 +00:00
Chris Shoemaker 3e662fcbf0 ChangeLog updates from 'svn log -v'
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13494 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-05 19:47:21 +00:00
Chris Shoemaker 84bcf5685b Convert xaccTransGetSplit() and xaccTransCountSplits() to return the
index and count reflective of any in-progress edit.
   Convert some split iterators from directly using the GList of Splits to 
   using xaccTransGetSplit().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13487 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-05 04:14:38 +00:00
Chris Shoemaker 4a63eb5c65 Use for-each, lambda expressions for iterating over split lists.
In contrast to the previous looping construct, this will work even if 
   the split operations don't have side-effects on the split lists.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13476 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 18:12:34 +00:00
Chris Shoemaker 9a65cc1cc6 When the book is shutting down, don't be so eager to destroy the whole
transaction.  This makes it easier to safely iterate over a split list.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13471 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 06:56:27 +00:00
Chris Shoemaker 803e157ed6 Destroy Transactions without rebalancing when shutting down the book.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13469 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 05:10:15 +00:00
Chris Shoemaker d0f3042d8f Generate REMOVE events when a Split is removed from a Transaction.
Pass the *old* parent transaction (since the Split may be moving into 
   a new transaction) and the old index of the Split in the old Transaction's
   list of Splits.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13468 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 03:21:34 +00:00
Chris Shoemaker 7921695276 Look for orphan Splits even when there is no Transaction imbalance.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13466 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 02:42:49 +00:00
Chris Shoemaker 10138bb1d3 Delete unused dialog-exchange.h
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13465 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:27:38 +00:00
Chris Shoemaker cfe743fd8e Remove an unnecessary Account edit-block.
Minor control-flow simplification.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13464 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:23:07 +00:00
Chris Shoemaker 5382b075cd Bits to let the register see the in-progress Transaction edit.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13463 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:13:15 +00:00
Chris Shoemaker 8eadc7cd23 Remove xaccAccountRemoveSplit, and xaccAccountInsertSplit.
(Actually, xaccAccountInsertSplit is #def'd to xaccSplitSetAccount().)
   Accounts no longer manage their Split lists.  The Account split lists
   should only ever be modified from within xaccTransCommitEdit().  This
   simplifies some of the operations on Accounts, since they can now be 
   expressed in terms of operations on Splits.

   Also, the consolidation of two operations (RemoveSplit and InsertSplit) 
   into one operation (xaccSplitSetAccount) means that it's no longer 
   possible to orphan a Split.

   Incidental:
      Fix a leak of a KVP frame.
      Don't recompute the account balance if we're shutting down.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13462 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:11:44 +00:00
Chris Shoemaker 6782a2b49d The xaccTransRollbackEdit() part of the Begin/Commit edit-block rewrite.
Broken out just for clarity.

   Note: There's one piece that I didn't change that I think is conceptually
   awkward.  It has to do with how/when we would discover that another
   user has deleted the transaction we're currently editing.  I think it makes
   more sense to detect and handle this case in xaccTransCommitEdit() instead
   of xaccTransRollbackEdit(), because (a) we don't actually have to do the 
   rollback if we just destroy the trans, (b) some rollbacks are not backend-
   induced, but rather voluntary, (c) we need a generalized mechanism
   anyway for detecting and handling deleted transactions even when
   we're not editing them.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13461 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:11:16 +00:00
Chris Shoemaker dd80eaa743 Move one data-validation function from Scrub.c into Transaction.c
One simplification in xaccTransScrubImbalance() to always find the root
   AccountGroup from the Transaction's book.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13460 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:10:44 +00:00
Chris Shoemaker 7bad37599c A good bit of notes about how the Transaction Begin/Commit
edit-blocks should work, and why. 

   Converts the very important xaccTransCommitEdit function to use the 
   qof_commit_edit_part2() function instead of something that is 90%
   similar.

   Transactions have a Split list that keeps track of Splits during the edit.
   During edits, this list only grows and never shrinks.  Splits that
   have been destroyed or reparented to other transactions remain in
   the list, along with pre-edit Splits and newly added Splits.  Only after a 
   successful commit does the Split list drop reparented or destroyed
   Splits.  A couple out-of-engine users (mainly the register) call
   xaccTransGetSplitList() an work from the Transaction's split list,
   but they expect to be working with only the Splits that would still be in 
   the Transaction if the in-progress edit would be committed.  So, we
   provide the function xaccTransStillHasSplit(t, s) to allow users to query 
   the in-edit state of the Transaction's Split list.

   xaccTransRemoveSplit() and xaccTransInsertSplit() have been replaced by
   xaccSplitSetParent().

   The new xaccTransCommitEdit tries to take a more conservative approach
   to event generation, too.  Instead of generating every possible event for 
   any commit, it should generate only events that indicate a change to an 
   engine object or relation.

   Move some of the financial-constraint-enforcing functions closer to the 
   relevant data-structures. (from Scrub.c)



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13459 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:10:12 +00:00
Chris Shoemaker 241f37379a Remove some testing of an engine API that has been removed.
The engine used to have functions that made it possible to orphan a Split.
   As this is no longer possible, we can't test anymore.

   Incidental:
      Fix three or four small leaks in the test functions.
      Allow test-period to be randomized based on optional command-line arg.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13458 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:09:31 +00:00
Chris Shoemaker ed94e594b2 Splits can now keep track of their own rollback state.
The Split <-> Account and Split <-> Transaction relationships are now
   treated as properties of the Split.  In terms of the BeginEdit/CommitEdit 
   block, Splits are subordinate to Transactions.  There is no public 
   BeginEdit/CommitEdit block for Splits; changes to Splits should be wrapped
   in their Transaction's Edit-block.

   In the case of the Split <-> Account relationship, the call to
   xaccSplitSetAccount() will be immediately visible from
   xaccSplitGetAccount(), but the Account does not learn about the
   Split until and if the edit is committed.

   In the case of the Split <-> Transaction relationship, calling
   xaccSplitSetParent() will immediately add the Split to the
   Transactions split list.  This is because the Split's Transaction
   owns the reference to the Split.  However, see the Transaction.c 
   patch for how to distinguish pre-edit state from in-edit state.

   In both cases, events are not generated until the edits are committed.
   Most of this new logic is in an engine-private helper xaccSplitCommitEdit(),
   which is called from xaccTransCommitEdit().

   Incidental:
      Increased error-checking in xaccSplitSetValue().
      Internalize a Transaction Begin/Commit edit-block in every setter func.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13457 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:09:03 +00:00
Chris Shoemaker 9b63e08746 Remove two slightly different definitions of
gnc:transaction-map-splits, both unused.
   Remove g-wrapped versions of functions being removed:
      gnc:account-fix-split-date-order,
      gnc:trans-fix-split-date-order



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13456 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-04 00:08:16 +00:00
Chris Shoemaker f32bc537d1 Make register use engine-provided xaccTransGetAccountConvRate() instead of
writing its own.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13426 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-28 19:57:24 +00:00
Chris Shoemaker c0962037f6 Make register use engine-provided xaccTransGetAccountBalance() instead
of writing its own.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13425 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-28 19:46:19 +00:00
Chris Shoemaker 3dd5ea248e Make register use engine-provided xaccTransGetAccountAmount() instead of
writing its own.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13424 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-28 19:38:29 +00:00
Chris Shoemaker 66f3a0a401 Make register use engine-provided xaccTransHasReconciledSplits() instead
of writing it's own.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13423 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-28 19:34:42 +00:00
Chris Shoemaker cec7bb732c Use function version of QOF_COMMIT_EDIT_PART2.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13395 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-26 18:36:05 +00:00
Chris Shoemaker dd8ce0e090 Keep track of exactly how many bytes we've sent to md5_process_bytes().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13391 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-26 05:00:52 +00:00
Chris Shoemaker 6a8404df1d Implement QOF_COMMIT_EDIT_PART2 as a function instead of a macro.
Any of the callbacks passed to this function may be NULL to decline the 
   use of that callback.  Also, the three callbacks are now called in three
   mutually exclusive cases, corresponding to: 
      1) a failed commit, ('on_error')
      2) a successful commit where the object remains valid, ('on_done'), and 
      3) a successful commit where the object has been destroyed, ('on_free').


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13390 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-26 04:56:47 +00:00
Chris Shoemaker ee28ca912d Since QOF no longer keeps track of the "current" session,
qof_session_destroy() no longer clears the current session when we destroy
   it.  Therefore, explicitly call gnc_clear_current_session() when we want
   to destroy the current session.
   Also, avoid accidentally creating a new book and session if there is no
   open book/current session when we run the bill reminder.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13378 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-24 05:53:35 +00:00
Chris Shoemaker b4456caf23 When we malloc a Transaction, then TransBeginEdit, then want to abort,
just call xaccTransDestroy(), xaccTransCommitEdit().  No rollback needed.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13369 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-23 20:11:02 +00:00
Chris Shoemaker a652fc59d0 Dirty Splits when they change.
Add const to Split where appropriate.
   Fix GCache crash cause by using non-cached value in cached 'action' field 
   from the qsf-backend.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13368 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-23 17:44:42 +00:00
Chris Shoemaker 3d6a06e208 Separate the Split functions from Transaction.c into Split.c.
Introduce xaccSplitVoid() and xaccSplitUnvoid() to aid the separation.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13363 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-22 21:52:46 +00:00
Chris Shoemaker 00ba10ef00 Add some comments, error checks, ENTER/LEAVE balances and a special-case
early-return for the conversion-rate calculation.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13362 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-22 17:41:58 +00:00
Chris Shoemaker 9958820d8e Use correct function name qof_instance_set_dirty.
Comment on current state of Lot behavior.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13360 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-22 14:22:30 +00:00
Chris Shoemaker 656889ecce Convert Lots from a QofEntity to a QofInstance.
They now store their own dirty state.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13359 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-22 06:01:07 +00:00
Chris Shoemaker da35e7c127 No need to run the BOOK_OPENED hook twice when open a book.
And no need to run it at all when we fail to open a book.
   Also, require HAVE_GTK26 before using gtk_get_option_group().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13358 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-22 03:30:48 +00:00
Chris Shoemaker e1e0d326d0 Avoid instantiating the current session until we're actually opening a file.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13357 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-22 03:05:20 +00:00
Chris Shoemaker 6ec9c70b26 Files accidentally left out of previous commit (r13355).
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13356 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-22 02:43:20 +00:00
Chris Shoemaker 53cd1da9cf Remove uses of deprecated qof_session_get_current_session() and
qof_session_set_current_session().  GnuCash now manages its own current
   session.  New function: gnc_current_session_exist() to test whether there
   is a current session.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13355 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-22 02:39:02 +00:00
Chris Shoemaker d3fc3ba57e Mark the QofCollection as dirty when a new QofEntity is added or removed.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13351 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-21 21:46:07 +00:00
Chris Shoemaker acb3913e7a Mark the GNC_LOT QofCollection dirty whenever a Lot changes.
This includes when the KVP is changed via the setters. 


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13350 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-21 21:44:42 +00:00
Chris Shoemaker e13c1fc160 Avoid qof-dirtying Accounts when Splits or Lots are inserted or removed.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13347 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-21 20:27:40 +00:00
Chris Shoemaker 2d1804e67c Move the code that (usually) ensures value/amount consistency for Splits
from add_random_splits() to get_random_split().
   Avoid numeric overflow when creating split values.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13345 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-21 19:43:00 +00:00
Chris Shoemaker 416a64337f Use glib's slice allocator in favor of GMemChunks for glib >= 2.9.
Patch by Andreas Köhler <andi5.py@gmx.net>.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13338 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-21 01:24:03 +00:00
Chris Shoemaker 6a6b7c5776 Add a local copy of GtkTreeModelSort from gtk 2.8.12. Our local copy is
called GncTreeModelSort.  This newer version of GtkTreeModelSort fixes at 
   least one observed bug with our use of sorted models.  The 
   gtktreedatalist.[ch] files are used by GtkTreeModelSort and are directly 
   from gtk 2.8.12 without any renames because they aren't exported by gtk.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13330 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-20 20:47:01 +00:00
Chris Shoemaker 3c72393369 Explictly require gtk2.6 for conditionally compiled code that needs it.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13329 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-20 20:22:24 +00:00
Chris Shoemaker 0b46642d65 Factor out a compat definition of GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID
into gtk-compat.h.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13328 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-20 20:09:02 +00:00
Chris Shoemaker ceebdbd6c7 Fix for 'use of uninitialized' warning.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13313 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-20 02:58:29 +00:00
Chris Shoemaker 11c0a19191 Use GPOINTER_TO_INT to avoid casting pointer to integer of different size.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13280 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-17 15:03:23 +00:00
Chris Shoemaker cdf1e2e316 Convert the AccountType selection functions to work with GtkTreeSelections
from views using the filtered GncTreeModelAccountTypes.
   Privatize the unfiltered GncTreeModelAccountTypes - now, every accessible
     account-types TreeModel is a new GtkTreeModelFilter, and their 
     ref-counting is always the same.
   Add some tweaks to gnc-tree-model-account-types.[ch] from 
     Andreas Köhler <andi5.py@gmx.net>, plus the conversion of the Account 
     Dialog's account-types field to use the filtered GncTreeModelAccountTypes
     instead of a GtkListStore, but simplified to use the AccountType 
     selection functions.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13271 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-15 22:06:37 +00:00
Chris Shoemaker 9808b664a5 Remove --enable-opt-style-install configure option.
That's one less thing to test.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13267 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-15 14:58:34 +00:00
Chris Shoemaker 387b8eca2f Changed balance calculations in three reports from using local
copies of buggy accountlist-get-comm-balance-at-date to using a new
   gnc:accountlist-get-comm-balance-interval provided by
   report-utilities.scm.  For the affected calculations, the balances no 
   longer exclude transactions on the first day of the reporting period.  
   This fixes http://bugzilla.gnome.org/show_bug.cgi?id=331005.

   Changed calculations:
     Income Statement: Total Expenses, Total Revenues
     Balance Sheet: Retained Earnings (*)
     Equity Statement: Retained Earnings (*), Net Income

   (*) The Retained Earning calculations use a start-date of "forever-ago"
   so they are not affected, but still converted to the new function.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13266 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-15 01:52:15 +00:00
Chris Shoemaker 850dd5b341 Copy 'svn log -v' output from past 20 days to ChangeLog.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13247 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-12 23:13:06 +00:00
Chris Shoemaker bcdf245a9b Don't continue to parse the expression if we've already reached the end.
Fixes http://bugzilla.gnome.org/show_bug.cgi?id=166840.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13243 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-12 20:31:11 +00:00
Chris Shoemaker 465a454667 Use the price nearest to midday to get the value in the default currency.
Patch by Mike Alexander <mta.umich.edu>, closes bug #330361


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13229 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-12 05:21:09 +00:00
Chris Shoemaker 358f677a4b Take #2: Fixups for two botched gnc-plugin-page-report.c commits tonight.
1) Correctly handle gc protection for non-boolean 'edited_reports' field.
   2) Pass list argument instead of immediate to gfec_apply.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13228 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-12 04:13:29 +00:00
Chris Shoemaker 0dccf4e0cb Gracefully handle errors in report options.
This prevents the whole program from crashing when unrecognized report
   options are used.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13227 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-12 02:40:35 +00:00
Chris Shoemaker c1e65f6925 gc_protect SCM reports while they are in the GHashTable.
Also, use gfec to be a bit more defensive about potential errors while 
   running a report.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13223 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-11 21:07:32 +00:00
Chris Shoemaker 9482462ac3 Tweak the preferences labels for accounting periods.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13200 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-11 05:23:12 +00:00
Chris Shoemaker 71625058fa Change the reports from using a hard-coded fiscal year to using the global
accounting period set in the preferences.  Both the start date and the end
   date are used, so the user is free to choose any arbitrary period.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13199 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-11 05:14:21 +00:00
Chris Shoemaker 6ab484e319 Move the accounting period preference functions from window-main-summarybar
to gnc-accounting-period.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13198 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-11 05:00:02 +00:00
Chris Shoemaker 5f56bec772 Remove forgotten unused variable.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13167 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-09 05:23:51 +00:00
Chris Shoemaker 1b418bfeec Add two columns to the Accounts page: "Total (Period)" & "Balance (Period)"
These are the recursive and non-recursive, respectively, period balances,
   where the accounting period is specified in the preferences.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13165 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-09 04:53:43 +00:00
Chris Shoemaker c7413168ae Fix an off-by-one (day) error in the dates used by the summarybar.
Factor out and publicize functions to get the start and end of the
   accounting period in the preferences.
   Mark one comment as probably obsolete.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13158 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-09 04:17:27 +00:00
Chris Shoemaker 3407c31beb Factor out an "approved" method for getting the GtkCellRenderer from a
GtkTreeViewColumn that's been added to a GncTreeView with one of the 
   convenience functions.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13156 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-09 01:47:26 +00:00
Chris Shoemaker 9f0643fa6e Move window-main-summarybar.[ch] from gnome/ to gnome-utils/.
It doesn't depend on anything in gnome/.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13155 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-09 01:24:47 +00:00
Chris Shoemaker 5e5084037b Change name of SplitRegister variable name to 'reg' for consistency.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13154 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-08 15:05:28 +00:00
Chris Shoemaker 91c112f432 A little error checking for report titles.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13153 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-08 15:00:24 +00:00
Chris Shoemaker 943532c8cd Don't allow the event handler list to shrink while we're traversing it.
This change isn't ideal in the sense that the handler list is now a 
   monotonically increasing resource, but it's better than crashing when the
   handler in node N+1 happens to be deleted while servicing the handler in
   node N.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13152 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-08 06:04:51 +00:00
Chris Shoemaker c2196a9b50 Convert GncTreeModel from a GtkObject to a GObject.
Replace gtk_object_sink calls on the models with g_object_unref calls.
   Correctly increase the refcount of "remembered" models when we return them.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13150 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-08 05:55:04 +00:00
Chris Shoemaker 3cb9687799 Convert GncTreeModelPrice and GncTreeModelCommodity to use GObject dispose
path instead of GtkObject destroy path.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13149 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-08 02:23:59 +00:00
Chris Shoemaker 22d0463a3d Convert GncTreeModelAccount to use the GObject dispose path instead of
the GtkObject destroy path.  Also, remove the gconf callback during dispose.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13148 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-08 01:55:07 +00:00
Chris Shoemaker 89c9f6821e Recompute argc after argv may have changed.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13140 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-07 19:52:29 +00:00
Chris Shoemaker 3908088b52 Fix two places where we were letting the split values become incoherent
with account balances.
   Comment two possible bugs related to capgains and dirtying (or not) Splits.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13134 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-06 20:41:40 +00:00
Chris Shoemaker 720dd91074 Fix breakage from missed case in Split QofEntity->QofInstance conversion.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13133 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-06 18:31:49 +00:00
Chris Shoemaker 359013e2a5 Keep QOF aware of the dirty-state of Transactions.
Also, dirty transactions upon changing due date and read-only status, 
   which didn't used to happen.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13132 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-06 17:57:45 +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
Chris Shoemaker fccb17ff12 Replace check_open() in setter API with internal qof_{begin,commit}_edit().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13130 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-06 16:18:52 +00:00
Chris Shoemaker 69dc61aac4 Remove check_open() calls from Transaction setters.
These calls were probably a copied idiom from the Split setters in this
   same file, but Split and Transaction use completely different mechanisms
   for managing dirty state.  Transactions inherit from QofInstance and so
   use the .dirty field.  Splits inherit from QofEntity, so their
   check_open(split->parent) calls are their way of letting someone know
   they've changed.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13128 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-06 04:50:02 +00:00
Chris Shoemaker 9291a1a514 Hook-up the new budget value estimation dialog.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13096 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-04 16:34:57 +00:00
Chris Shoemaker 186c3c0f50 New dialog for estimating budget values from past transactions.
Minor string and glade tweaks.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13095 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-04 16:32:30 +00:00
Chris Shoemaker 17927cdfe8 gnc_date_edit_set_gdate(): A GDate setter for GNCDateEdit is useful, too.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13094 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-04 16:29:00 +00:00
Chris Shoemaker 0219a9d23e Add getter gnc_date_edit_get_gdate() for getting the value of a GNCDateEdit
widget as a GDate.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13093 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-04 15:17:51 +00:00
Chris Shoemaker edb52e4d32 Factor out some code from gnc-budget into Recurrence so that the budget
estimation code can use stand-alone recurrences to estimate budget values.
  Also, tweak the initial budget so that it begins at the beginning of the 
  current month.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13092 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-04 15:12:09 +00:00
Chris Shoemaker bbb8d1be33 Teach PrintAmountInternal() to correctly handle a reciprocal denominator.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13091 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-04 15:06:19 +00:00
Chris Shoemaker 85a99a1987 Add some test-cases for gnc_numerics using the reciprocal denominator.
Even though we don't explicitly ask for this representation, certain
   calculations (e.g. those involving GNC_HOW_DENOM_SIGFIGS in the loan    
   druid and soon in budgets) will return numbers using this representation.

   Unfortunately, these numbers aren't handled correctly by most of the
   gnc_numeric functions, like the ones for comparison, equality testing,
   arithmetic and conversion.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13090 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-04 05:37:50 +00:00
Chris Shoemaker 5631500dda Use the string cache for budget name and description.
Dirty the book when the budget changes.
   Remove some obsolete budget code.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13089 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-03 21:29:06 +00:00
Chris Shoemaker 9b20cbd6d2 Allow make-gnucash-potfiles to run from directories other than srcdir.
Better documentation of exactly what m-g-potfiles excludes, and a general
   clean-up of the script.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13079 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-02 18:47:34 +00:00
Chris Shoemaker c95bd2c9cc Check for any accidentally-distributed files not marked for translation.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13072 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-02 00:07:58 +00:00
Chris Shoemaker 48a51e7492 Add POTFILES.skip to EXTRA_DIST.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13070 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-01 22:38:41 +00:00
Chris Shoemaker c4dd32e179 Don't translate obsolete files.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13067 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-01 20:33:36 +00:00
Chris Shoemaker d814359990 When generating POTFILES.in, don't include files we don't want to translate.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13066 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-01 20:32:11 +00:00
Chris Shoemaker 53b5dc8ef7 Fail 'make distcheck' if POTFILES.in contains undistributed files.
The failure will also helpfully explain which files are the problem.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13065 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-01 20:30:14 +00:00
Chris Shoemaker abbc6b6197 Don't add markup to tax report titles.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13056 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-01-31 03:41:01 +00:00
Chris Shoemaker c947a7778e New function: gnc_tree_view_add_combo_column().
This function is only compiled when HAVE_GTK26 because it uses 
   GtkCellRendererCombo.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13047 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-01-30 03:53:09 +00:00
Chris Shoemaker 7620b1918d Add some convenience functions for getting values from various combinations
of Accounts, Transactions, and Splits.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13045 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-01-30 02:59:43 +00:00
Chris Shoemaker 295c475ea4 Convert account types filter dialog to use checkboxes for selection.
Patch by Eskil Bylund <eskil.bylund@gmail.com>


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13040 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-01-30 00:59:25 +00:00