Commit Graph

65 Commits

Author SHA1 Message Date
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
Linas Vepstas
5870f0d581 add some debug statements,
audit the math usage,
tweak the scrub routines to get rid of the no-root error message
(some debugging printfs remain, which I'll remove later)


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10117 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-06-27 22:32:59 +00:00
Linas Vepstas
4f6c678a34 little tweak to attempt to avoid overflow errors
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10035 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-06-07 03:04:21 +00:00
Linas Vepstas
53507304cd add debugging print statements
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9982 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-05-30 05:10:27 +00:00
Linas Vepstas
bd7a8b732d partial fix for the failure of the test-lots test case:
Change the FIFO policy to avoid mixed-currency lots.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9977 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-05-29 20:06:03 +00:00
Linas Vepstas
c90c817e64 merge first round of entity rework back into head branch
The net total of this work is (i beleive) fewer lines of code.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9530 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-10-17 04:25:53 +00:00
Linas Vepstas
9df9674b96 change Account to use qofinstance
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9481 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-10-12 04:44:40 +00:00
Linas Vepstas
697846331a quick whack to add LIFO accounting policy (in addition to FIFO)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9410 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-09-23 03:25:37 +00:00
Linas Vepstas
929bca04c5 tweaks; add wrappers for lot title, lot notes
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9392 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-09-21 20:43:52 +00:00
Linas Vepstas
b7f1c25c2d move code from transaction.c to cap-gains.c
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9385 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-09-21 03:41:32 +00:00