The problems is that xaccQueryAddAccountMatch and xaccQueryAddAccountGUIDMatch
match all accounts rather than no accounts when given a null account list. This means
that gnc:accountlist-get-comm-balance-at-date returns a balance for all accounts when
given no accounts. This caused the balance sheet report to fail if there were no trading
accounts. There is a similar problem with gnc:account-get-trans-type-splits-interval in
gnc:html-acct-table-add-accounts! in html-acct-table.scm that is also fixed.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18455 57a11ea4-9604-0410-9ed3-97b8803252fd
The behaviour of the menu item is not yet clear: After
clicking on it, nothing changes in the transaction, only after I additionally
pressed "enter". After this, the running balance currently isn't
updated, which is additionally confusing. These two points would need to be
fixed before we can recommend this feature for the next stable version 2.4.0.
I disable it for now so that we can release something.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18450 57a11ea4-9604-0410-9ed3-97b8803252fd
libxml include files have changed between ubuntu 9.04 and 9.10.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18447 57a11ea4-9604-0410-9ed3-97b8803252fd
Unposted invoice has NULL tx guid, which wasn't being handled correctly. Doesn't crash
on linux but does on windows.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18444 57a11ea4-9604-0410-9ed3-97b8803252fd
With no file name, entered, filename returned from file_chooser is NULL,
which led to the crash. If NULL is returned, just ignore the button press.
Proper UI would not allow Save As to be clicked unless conditions were right,
but I'm not sure how to make that happen. There is a signal emitted when a
file is selected, but not when characters are typed into the name text field.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18443 57a11ea4-9604-0410-9ed3-97b8803252fd
logged into the gnucash.trace file. This can provide vital information in case of problems.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18441 57a11ea4-9604-0410-9ed3-97b8803252fd
When creating file names for the "books" or "data" directory under ".gnucash", convert
'/' and ':' to '_'. This may mean state is lost for cases with a full url including
type (since the previous conversion was '/' to ','), but this will only happen once.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18440 57a11ea4-9604-0410-9ed3-97b8803252fd
Patch by Forest Bond:
The budget income statement would be more useful if it allowed reporting for
single budget periods, rather than always reporting for the entire budget at
once. This patch implements the requested feature.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18439 57a11ea4-9604-0410-9ed3-97b8803252fd
Patch in r18417 from bug #602062 was buggy - removing the "-x c" argument.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18438 57a11ea4-9604-0410-9ed3-97b8803252fd
Patch by J. Alex Aycinena:
‘gtk_dialog_get_content_area’ is from GTK version 2.14. The attached
patch uses the prior '(GTK_DIALOG(dialog)->vbox)' in place of
'gtk_dialog_get_content_area (GTK_DIALOG (dialog))' and compiled
successfully on my GTK version 2.16 and the application operated
properly.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18433 57a11ea4-9604-0410-9ed3-97b8803252fd
Fix bug 598618 - does not calculate account balances correctly
Both of these are happening because not all transactions are being loaded at startup. Bug 591098
happens because the account assumes it has all splits loaded, and looks for the first one after the
requested date to get the present balance. The second happens because then the splits associated
with an invoice transaction are being loaded, the balance cannot be updated properly.
This change reverts back to loading all transactions on startup. Once gnucash is a proper database
app, we can change back to loading transactions only when needed.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18431 57a11ea4-9604-0410-9ed3-97b8803252fd
Before this change, gnucash crashes on start-up with Backtrace:
In unknown file:
?: 0* gnc:*book-label*
<unnamed port>: In expression gnc:*book-label*:
<unnamed port>: Unbound variable: gnc:*book-label*
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18430 57a11ea4-9604-0410-9ed3-97b8803252fd
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
Patch by James Raehl:
Currently, the only editable date in the register is the bank posting date.
This patch implements a second editable date in the first field of the second
line of a double-line mode register. The entry date is borrowed in this
implementation. I understand the entry date is used for such as stock
transactions, but to me is mostly useless for those keeping track of personal
finances.
This feature has been requested on occasion, such as at
https://lists.gnucash.org/pipermail/gnucash-devel/2003-August/010279.html and
https://bugzilla.gnome.org/show_bug.cgi?id=92274 and
http://lists.gnucash.org/pipermail/gnucash-user/2009-October/031839.html
"Transaction date" refers to such as the date the purchase was rung up in the
store cash register, payment mailed or possibly received by the recipient,
payment received by you, date you walked into the bank to make a deposit, or
even the date the expense was scheduled. Your intent to expend the money is
definitely determined. "Bank posting date" is when the bank has finally
debited or credited your account. "Date entered" in Gnucash would be identical
to "transaction date", if you always without fail entered the transaction into
Gnucash on the same date as the purchase, bank deposit, etc.
Bug #92274 describes it better. That mentions 3 dates, date mailed, date gas
company posts the payment, and date the bank debits the payment. I track even
more dates on credit card transactions: statement date, date bill received,
payment mailing date, card payment received (card transaction) date, card
posting date, and bank posting date. These are currently entered into my
transaction Notes field, which is one reason for my multi-line up/down Notes
field scroll patch, but Notes dates are not sortable.
Obviously, the use of sortable dates is flexible. I use one date as a budget
date (group budgeted expenses with paychecks), and the second as bank posting
date. I could obviously use a third date, the "transaction date", but haven't
implemented that yet (much more work).
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18428 57a11ea4-9604-0410-9ed3-97b8803252fd
Patch by Steven N. Severinghaus:
For me, it would be sufficient to have keyboard shortcuts to increment and
decrement the entry time of the transaction by one second. This is essentially
what I have to do when I edit the XAC file manually. If hidden functionality
isn't acceptable, we could add "Shift forward" and "Shift backward" items under
the "Transaction" menu.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18427 57a11ea4-9604-0410-9ed3-97b8803252fd
Patch by Matt Lavin:
Here is a patch that implements drag and drop reparenting in the accounts page.
The function works for me, and I can't think of anything more that needs to be
done, but I'm new to the Gnucash codebase so a thorough review would be great.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18426 57a11ea4-9604-0410-9ed3-97b8803252fd
After the change storing date-time values as a TIMESTAMP, a Timespec value of 0 could be stored in
mysql (I'm in EST timezone) because it converted to "19700101000000" which is "19700101050000" UTC
which is in the valid TIMESTAMP range of >= "19700101000001". However, someone in UTC couldn't
store that value because it is treated as in the local timezone, and for someone in UK, it is out of
range.
This change changes 0 Timespec values to NULL db values. Slots already allow NULL TIMESPEC values.
There are a few places where the db schema needs to be changed to allow NULL values.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18424 57a11ea4-9604-0410-9ed3-97b8803252fd
The keyboard shortcut hints in some dialogs are miscaptioned. This means that
in a save request dialog, for example, the button caption "Save Transaction"
spuriously reads "_Save Transaction" instead of "Save Transaction" with the "S" of "Save"
being underlined to mark the proper key on the keyboard to press in order to invoke
saving of the transaction.
Seems like new gtk-version is stricter and adds mnemonics only if told so.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18419 57a11ea4-9604-0410-9ed3-97b8803252fd
Patch by Halton Huo: Remove inline from qofmath128.c and qofmath128.h.
Cstim notes: The way the code is written (.h/.c) we should not have
any "inline" there. If the functions are intended to be used inline
only (and they are, in gnc-numeric.c), the definitions should be moved
into gnc-numeric.c anyway and the declarations removed.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18416 57a11ea4-9604-0410-9ed3-97b8803252fd
Patch by Halton Huo:
Since solaris ship gmp header files under /usr/include/gmp rather than
/usr/include, so this bug only happens on those systems which does not ship gmp
headers into /usr/include.
Actually this is aware during configure time through "guile-config compile". My
GUILE_INCS is -I/usr/include/gmp. So adding GUILE_INCS for AM_CPPFLAGS in
src/gnc-module/Makefile.am will fix this bug.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18415 57a11ea4-9604-0410-9ed3-97b8803252fd
After resolving a report module, add it to the list of used modules.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18414 57a11ea4-9604-0410-9ed3-97b8803252fd
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
Handle the "navigation requested" callback correctly. It was being called with
the uri "base-uri" when a page was being loaded. This needed to be accepted.
Then, when clicking on an account name, the correct register needs to be
opened and the navigation status needs to be IGNORE.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18408 57a11ea4-9604-0410-9ed3-97b8803252fd
the list rather than making a copy of each commodity. When a copy is made, this
copy is stored in the db, but is never deleted. This causes problems (loss of
reference from account/tx to commodity) when the file is reloaded.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18407 57a11ea4-9604-0410-9ed3-97b8803252fd
Patch by Mike Alexander (plus documentation comment by me):
Neither gnc:make-complex-boolean-option nor gnc:make-simple-boolean-option
(which calls it) correctly stores its result in the KVP that it is using.
This is because it calls kvp-frame-get-slot-path-gslist and
kvp-frame-set-slot-path-gslist to get and set the value. Both of these are
implemented in C and the code in kvp-scm.c can't convert a Scheme boolean value
to or from a KvpValue since there is no boolean type in KvpValue. There are
already a few places that have comments suggesting that there should be a
KVP_TYPE_BOOLEAN type, but adding this would be non-trivial. For now I'll
supply a patch that will store the boolean value as a string (which is what
code in xaccAccountSetAutoInterestXfer in Account.c does).
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18404 57a11ea4-9604-0410-9ed3-97b8803252fd
Usually an imported DTAUS file describes debit notes, which means "our
account" is credited (and the other debited). But DTAUS can also contain
transfers, which means "our account" is debited. In the DTAUS case, the
value would still be positive, so we have to query the transaction type
for this case as well. This is now fixed. (Needs aqbanking-4.1.10 though
because the earlier versions forgot to set the TypeTransfer.)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18402 57a11ea4-9604-0410-9ed3-97b8803252fd
Patch by Matt Lavin <matt.lavin@gmail.com> (with const added by myself).
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18401 57a11ea4-9604-0410-9ed3-97b8803252fd
This change will crash the Windows version at startup, unfortunately
with unknown reason.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18400 57a11ea4-9604-0410-9ed3-97b8803252fd