Commit Graph

217 Commits

Author SHA1 Message Date
Geert Janssens
695065a0aa Merge branch 'maint' 2017-01-23 12:03:00 +01:00
klemens
2a97675bee spelling fixes 2017-01-23 11:50:00 +01:00
John Ralls
d8711619ce Merge branch 'maint' 2016-09-17 17:09:51 -07:00
Geert Janssens
bd34059d29 Bug 770136 - 'Reverse Order' in 'View'->'Sort by' is not saved 2016-08-24 11:53:44 +02:00
Robert Fewell
213db2de52 Use GncImapInfo instead of struct imap_info where
it makes sense to.
2016-03-13 10:33:47 +01:00
Robert Fewell
dae07facf0 Create function to change Bayesian entries based
on full account name to that of the account guid
2016-03-13 10:33:36 +01:00
Robert Fewell
1bb8778989 Some more name changes 2016-01-11 12:23:22 -08:00
Robert Fewell
43e122ca9c Rename some functions and structures based on imap 2016-01-11 12:23:22 -08:00
Robert Fewell
8a536d4152 Rename probability to count. 2016-01-11 12:23:22 -08:00
Robert Fewell
035bc761aa Moved all KVP handling to Account.c, Added two
main functions that return a Glist of kvp_info
for Bayesian and Non Bayesian entries. Also added
a get and delete function based on kvp path.
2016-01-11 12:21:30 -08:00
Robert Fewell
1ef201c7d1 Bug 706021 Rename and Move Imap functions.
This patch renames the Imap functions in Account.c and
adds them to the .h file to make accessible. Also added
a delete function to the non Baysian functions along with
a test.
2015-11-03 11:16:17 +01:00
Geert Janssens
ccbd09d5e3 Merge branch 'maint'
* Bug 732545 - gnucash-2.6.3 segfaults when started
* Bug 720427 - Review of french account templates
* Bug 671615 - French: 'New Customer' button in Find Customer dialog is translated to 'Nouvel onglet'
* Add context to generic translatable string
* Convert ISO-8859-1 account chart templates to UTF-8
* Set default currency for French account chart templates
* Use same default setting for quotes in csv import and export
* This patch fixes bug 726888, cancel button is available on all pages of assistant.
* Avoid undocumented dependency on progress page type in assistant to skip page
* Use same test for payment dialog transfer accounts and assign as payment checks
* Bug 630638 - 'Process payment' should allow to select equity accounts for payment
* Bug 736703 - Scheduled transaction are registered without credit/debit
* This patch fixes bug 731519. The fix sets the upper limit before it sets the value of the end row spin button.
* Part Bug fix for 729476, this fixes the quoting of quotes, newlines and separator to make it more compatible with CSV format.
* Part Bug fix for 729476, this changes the line endings to \r\n to make it more compatible with CSV format.
* This patch just changes the white space to be of a consistent format.
* Various small code improvements in csv import/export
* Rework assistant csv import regex code to eliminate the mandatory dummy field (#eol).
2014-09-26 17:02:52 +02:00
Geert Janssens
e693a68972 Bug 630638 - 'Process payment' should allow to select equity accounts for payment 2014-09-23 10:26:00 +02:00
Geert Janssens
4ecc4cb7d0 Merge branch 'maint'
* Bug 711440 - Tab labels have different background colour than containing gui element
* Bug 434462 - register color don't work correct with system theme color
* Add scrub function for (business) lots to eliminate unneeded lot links
* Rewrite invoice payment logic to use lot links only when absolutely needed
* Bug 684719 - Man pages for gnc-fq-* perl scripts
2014-09-02 22:59:41 +02:00
Geert Janssens
da9071fe49 Move account type checking functions into the engine 2014-09-02 18:26:21 +02:00
Geert Janssens
cac3b5c215 Rename xaccAccountGetNrSplits to xaccAccountCountSplits for api consistency 2014-05-20 16:21:09 +02:00
Michalis Kamprianis
e76ba2a0f0 Bug 541541 - RFE: auto-hide unused accounts
Add a checkbox on Filter by -> Others to show (default)
or hide accounts that don't have any transactions.
If an account does not have any transactions, but it's children do
it will still be shown (unlike the zero total amount).
2014-05-20 16:21:08 +02:00
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
Mike Alexander
035959a250 Fix some comments. 2014-02-11 22:56:32 -05: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
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
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
John Ralls
e62e56c1c3 [Cruft Reduction] Remove unused functions in src/engine -- reprise
Delete a bunch more functions left commented out from r21579

Remove references to deleted functions from gnucash_core.py

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21587 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-11-19 22:42:02 +00:00
John Ralls
eeaa897be1 [Cruft Reduction] Remove unused functions from src/engine
Nothing in gnc-session-scm.c was being used, so deleted it and its corresponding header.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21579 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-11-18 21:04:01 +00:00
John Ralls
f2fcf51cbd [Engine Unit Testing] Unit tests for Account.c
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21525 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-11-05 23:05:00 +00:00
Geert Janssens
3eacb2c3c8 Bug #420342 - remember register filter and ordering settings
Patch by Robert Fewell

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21499 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-10-28 12:26:58 +00:00
Geert Janssens
7bc5e89950 Bug #420342 - remember register filter and ordering settings
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21421 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-10-14 17:45:45 +00:00
John Ralls
9d9db4cc40 [Decruftification] Combine xaccCloneAccountSimple and
xaccCloneAccountCommon into a single xaccCloneAccount

Since removing the qofinstance-gemini xaccCloneAccount means that the
only user of xaccCloneAccountCommon is xaccCloneAccountSimple, which
adds only one line beyond calling xaccCloneAccountCommon, combine them
into a single function, called xaccCloneAccount (no need to make it
simple since it's the only one.)

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21208 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-08-22 18:19:03 +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
John Ralls
c318a112a5 Delete qofinstance_gemini and all related functions; they were left over from the clone-the-book-when-closing code abandoned in 2005
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21203 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-08-22 03:58:10 +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
Christian Stimming
bd71091499 Minor documentation clarifications.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21128 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-08-08 07:00:05 +00:00
Christian Stimming
64418350b7 Clarify documentation of gnc_account_get_children() vs. xaccAccountGetSplitList().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20803 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-06-27 08:02:15 +00:00
John Ralls
28b598fc4f Reverting screwups r20683, 20684, and 20685
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20686 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-05-23 19:44:24 +00:00
John Ralls
07eea7f6ec revert bogus directory added in r20682
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20685 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-05-23 19:36:01 +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
Mike Evans
356d51060d Remove variable names that conflict with Python keywords. Relevent when using SWIG autodoc feature for python bindings.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19924 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-12-10 13:09:50 +00:00
Geert Janssens
f06363cf2a Bug #525821 - new or edited account names should be checked for reserved chars like ":"
This patch checks if the separator character is used in account names when loading
a data file, or when changing the separator character in the preferences.
If the separator character is incompatible with some account names, a warning
dialog box is popped up explaining the situation. This dialog also lists the
violating account names.
Additionally, the preferences dialog will show a warning sign as long as the separator
clashes with some account names. The tooltip for this sign will also display the
violating account names.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18984 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-30 22:19:39 +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
Christian Stimming
1abc138cbc Bug #608329: Add Color to Account tabs
Patch by "Bob":
I wanted a way to select an account easily when I have several accounts open in
the main window. I decided to add a color option to the account so that the tab
can be set to a specific color and so easily identifiable. This could also be
used to link like minded accounts together.

This patch also fixes the account tooltip not being
updated when the name changes.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18637 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-02-10 20:35:11 +00:00
Christian Stimming
b578c56b27 Bug #537476: Implement currency trading accounts optionally, to be enabled per-book.
Patch by Mike Alexander:

This patch implements trading accounts somewhat as described in Peter
Selinger's document at
<http://www.mathstat.dal.ca/~selinger/accounting/gnucash.html>.  Although he
describes it as a multiple currency problem, it really applies to any
transactions involving multiple commodities (for example buying or selling a
stock)  Hence I've called the trading accounts "commodity exchange accounts"
which seems more descriptive.

In summary these patches add an option to use commodity exchange accounts and
if it is on a transaction must be balanced both in value (in the transaction
currency) and in each commodity or currency used in any split in the
transaction.  If a transaction only contains splits in the transaction currency
then this is the same rule as Gnucash has always enforced.

In this patch, the option to use trading accounts has been moved from
Edit->Preferences to File->Properties and is now associated with the active
book instead of being a global option.  If you have set the global value on in
a previous version you will need to set it on again in each file for which you
want trading accounts, the previous global setting will be ignored.

A more detailed list of changes follows:

1.  Added a "Use commodity exchange accounts" per-book option.

2.  Added gnc_monetary and MonetaryList data types.

3.  Renamed xaccTransGetImbalance to xaccTransGetImbalanceValue and added a new
xaccTransGetImbalance that returns a MonetaryList.  Also added
xaccTransIsBalanced to see if the transaction is balanced without returning a
GList that needs to be freed.  It calls both xaccTransGetImbalance and
xaccTransGetImbalanceValue since a transaction may be unbalanced with regard to
either without being unbalanced with regard to the other.

4.  Changed gnc_split_register_get_debcred_bg_color to use xaccTransIsBalanced.

5.  Changed gnc_split_register_balance_trans to not offer to adjust an existing
split if there imbalances in multiple currencies.  Because of bugs in the
register code this is rarely called.

6.  Changed importers to use xaccTransGetImbalanceValue to check for imbalance,
assuming that they won't create multiple currency trasactions.

7.  Changed xaccTransScrubImbalance to create a balancing split for each
imbalanced commodity in the transaction.  Also balances the transaction value.
The commodity balancing splits go into accounts in the hierarchy
Trading:NAMESPACE:COMMODITY.  The value balancing splits go into
Imbalance-CURRENCY as before.

8.  Changed xaccSplitConvertAmount to use xaccTransIsBalanced instead of
xaccTransGetImbalance.

9.  Changed gnc_split_register_get_debcred_entry to sometimes use the split
amount instead of value if using currency accounts.

If the register is a stock register (i.e., shows shares and prices), it uses
the value if the split is in the register commodity (i.e. is for the stock) and
the amount otherwise.  It shows the currency symbol unless the commodity is the
default currency.

If the register is not a stock register it always uses the amount and shows the
currency symbol if the split is not in the register commodity.

Also changed it to not return a value for a null split unless the transaction
is unbalanced in exactly one currency.  This is what goes in a blank split as
the proposed value.

10. Changed refresh_model_row to use xaccTransGetImbalanceValue to get the
imbalance, assuming that importers don't create transactions in multiple
currencies.  Also same change in gnc_import_process_trans_item,
downloaded_transaction_append, and gnc_import_TransInfo_is_balanced.

11. Changed the TRANS_IMBALANCE accessor method in xaccTransRegister to use
xaccTransGetImbalanceValue.  As far as I can tell this is only used by the
"pd-balance" query type in gnc_scm2query_term_query_v1() defined in
engine-helpers.c.  This query type only tests the result for zero/non-zero.

12. Changed xaccTransGetAccountConvRate to accept any split into the correct
commodity instead of insisting on one into the provided account.  Then can use
it in xaccTransScrubImbalance to set the value of the imbalance split from its
amount, however later changed xaccTransScrubImbalance to not use it.  Instead
it sets the value for the new split correctly to keep the value of the whole
transaction balanced.

13. Changed the balance sheet report to include a new option to not compute
unrealized gains and losses.

14. Related to 9 above, changed gnc_split_register_auto_calc to not do anything
if given a stock register where the value cell doesn't contain the value.

15. Also related to 9, changed gnc_split_register_save_amount_values to set the
amount and value fields in the split correctly when using trading accounts.

16. Changed the new account and edit account dialogs to allow any commodity or
currency for an income account if using trading accounts.  It would be better
to add a new account type for trading accounts, but that's a big deal and I'll
leave that for later after we see whether this set of changes is going to be
accepted or rejected.

17. Change gnc_xfer_dialog_run_exchange_dialog to understand that the new value
is really the split's amount if using trading accounts.

18. Changed xaccSplitGetOtherSplit to ignore trading splits if using commodity
exchange accounts.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18429 57a11ea4-9604-0410-9ed3-97b8803252fd
2009-11-20 20:11:03 +00:00
Christian Stimming
b5e09a6685 Bug #554394: Income Tax Enhancements
Patch by J. Alex Aycinena. Patch does the following:

- update the tax information in 'txf.scm', which is based on V037 of
the TXF Spec,  to V041, the last version issued (bug #554394)
- provide support for multiple copies of certain tax Forms/Schedules
(e.g., Schedule C(1), Schedule C(2), etc.)
- support multiple types of tax entities: partnerships, corporations
and S corporations, in addition to individual tax payers
- support balance sheet accounts, required for these new tax entity types
- add the term 'Income' in several places to avoid confusion with
sales or VAT style taxes in the business features (e.g., change the
menu from 'Tax Options' to 'Income Tax Options')

The following files were changed, as follows, to implement these changes:

1. src/engine/Account.c and
2. src/engine/Account.h: add copy number capability (define
'xaccAccountGetTaxUSCopyNumber' and 'xaccAccountSetTaxUSCopyNumber');
modify 'xaccAccountSetTaxUSCode' to remove KVP when no tax-code
assigned, clean up tax-source descriptions

3. src/gnome/gnc-plugin-basic-commands.c: change 'Tax Options' to
'Income Tax Options'

4. src/app-utils/gnc-ui-util.c and
5. src/app-utils/gnc-ui-util.h: add setter and getter functions for
book tax name and book tax type which are stored in a book KVP, show
copy information in accounts page, tax column, show error messages for
various conditions

6. src/app-utils/app-utils.i: add 'gnc_get_current_book_tax_name' and
'gnc_get_current_book_tax_type' functions

7. src/gnome/dialog-tax-info.c: add copy number and tax entity name
and type, and balance sheet account handling capability

8. src/gnome/glade/tax.glade: add tax entity name, tax entity type,
asset, liability/equity and copy number widgets

9. src/tax/us/txf.scm: update to V041 for individuals, add V041
support for multiple additional tax entity types and balance sheet
accounts and related tax codes, add tax form line data

10. src/tax/us/us.scm: export new functions defined in txf.scm

11. src/report/locale-specific/us/taxtxf.scm: add support for multiple
copies of Forms/Schedules, add support for Format 6, use Form/Schedule
line #'s to sort report, update from "V037" to "V041", add support for
taxpayer types other than F1040, add warning messages if there are
some inconsistent codes assigned and list

12. src/tax/us/txf-de_DE.scm: make functions called from outside (e.g., from
dialog-tax-info.c) have a consistent signature with those same
functions in txf.scm (define tax-entity-type , define getters/setters,
add tax-entity-type as an argument to existing functions)

13. src/tax/us/de_DE.scm: export new functions added to txf-de_DE.scm

14. src/report/locale-specific/us/taxtxf-de_DE.scm: add "" as
tax-entity-type argument to functions
called on txf-de_DE.scm (which defaults to existing codes)

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18413 57a11ea4-9604-0410-9ed3-97b8803252fd
2009-11-15 20:35:50 +00:00
Phil Longstaff
f85972c85f Move gnc_account_get_full_name() from app-utils to engine and remove xaccAccountGetFullName
in engine.  The old routine in app-utils just called the one in engine.  There isn't even the
excuse that the one in app-utils was just there for SCM, because there were SCM calls to
xaccAccountGetFullName.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18309 57a11ea4-9604-0410-9ed3-97b8803252fd
2009-09-11 02:11:38 +00:00
Phil Longstaff
b4f040a6ce Use SWIG properly to wrap functions to free strings which need to be freed by the caller.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18303 57a11ea4-9604-0410-9ed3-97b8803252fd
2009-09-08 23:48:42 +00:00
Phil Longstaff
945e700a37 Fix lots of splint issues (including memory leaks). This includes some changes
in qof and gnc files adding annotation comments to help splint analyze ownership
of memory and objects.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17983 57a11ea4-9604-0410-9ed3-97b8803252fd
2009-03-09 17:17:57 +00:00
Charles Day
f4f9fed740 Doxygen: Adjust the style of a comment block for consistency and to eliminate a splint warning.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17929 57a11ea4-9604-0410-9ed3-97b8803252fd
2009-02-17 16:49:52 +00:00