Commit Graph

21292 Commits

Author SHA1 Message Date
Christopher Lam
8b7093e8d0 [qif/test-qif-parse] initial commit
near-100% coverage for qif-parse.scm
2019-08-01 20:19:25 +08:00
Christopher Lam
a7a3f78648 [qif/test-qif-imp] initial commit
* strings.scm
* qif-objects.scm
2019-08-01 20:19:09 +08:00
Robert Fewell
19114cc111 Fix register tooltip crash
When the register is in double line mode, a tooltip for the transaction
association column can be shown if one is present by hovering the mouse
over the cell. If the register 'cursor' is highlighting any transaction
row this works but if the 'cursor' is on a split and mouse moves to an
association cell with an entry, Gnucash will crash. To fix this use the
SheetBlockStyle from block instead of the GnucashCursor.
2019-07-30 15:11:12 +01:00
Christopher Lam
db93aec58d [qif-utils] use srfi-13 instead of regexp functions 2019-07-30 18:17:52 +08:00
Christopher Lam
fbb6a95600 [simple-obj] deprecate this module
* it's only a wrapper for make-record-type
* use record-types directly in modules
2019-07-30 18:17:52 +08:00
Robert Fewell
76ba133174 Account Picker dialogue warning message placement
Currently this message is below the dialogue buttons so move the
message to above them.
2019-07-30 09:58:11 +01:00
Robert Fewell
d4dd289113 Error when cancelling the create a new account in register
When you are asked whether you want to create a new account on the
register, possibly due to a typo and you answer no, the same dialogue
will appear another three times before resetting the account cell to
the original value.

These changes eliminate that by returning you back to the cell with the
invalid entry so that you can amend / cancel or use the dialogue again
to create a new account based on an amended entry.
2019-07-30 09:58:11 +01:00
Robert Fewell
aca8a734b0 Error when creating a new account on expanded transaction
With the register in journal mode and you edit the account field so the
'Account x does not exist, do you want to create it' dialogue is shown
you get the following error...

gboolean boolean_from_key(const Account*, const std::vector<std::
__cxx11::basic_string<char> >&): assertion 'GNC_IS_ACCOUNT(acc)' failed

This was tracked down to a refresh being triggered with the account
dialogue so add a check for a valid account as part of the placeholder
test.
2019-07-30 09:58:11 +01:00
Robert Fewell
69f76c6378 Bug 797301/2 - Sub-account register not seeing changes to sub accounts.
If you have a sub account register open and you create another account
that is a descendant of the top account the transaction will not be
seen as the query used for the sub account register does not include
the new account. Add a check to 'refresh_handler' to check for the same
number of sub accounts, if different recreate query.
2019-07-30 09:58:11 +01:00
Robert Fewell
b56203e06f Bug 797301/1 - Menu View->Refresh not refreshing register
The Menu 'View->Refresh' only worked for the report page which reloaded
the report so added functions for other pages as follows. The Register
and Budget pages are reloaded with the remaining pages being redrawn
with a call to gtk_widget_queue_draw.
2019-07-30 09:58:11 +01:00
Mike Evans
aadb3d1462 Bug 797085 - Import Bills & Invoices – headers not translated.
Make strings translatable.

Translators: This adds 22 new translatable strings.
2019-07-29 14:01:31 +01:00
Christopher Lam
5de4b27b25 [balsheet-eg] dedupe functions 2019-07-28 22:57:46 +08:00
Christopher Lam
8cd7c6f755 [taxinvoice-eg] fix html
<nobr> has never been standard. Don't need it because (nbsp ...) will
insert <span white-space=nowrap> tags.
2019-07-28 22:57:46 +08:00
Christopher Lam
326927215c [eguile-html-utilities] dedupe, fix html
* prefer srfi-13 over regex
* instead of <nobr> use <span style="white-space:nowrap">
* reuse functions defined in eguile-gnc and eguile-utilities
* compact functions
* move make-regexp toplevel to ensure one compilation
2019-07-28 22:57:46 +08:00
Christopher Lam
c81e9354f7 [eguile-gnc] fix whitespace 2019-07-28 22:57:46 +08:00
Christopher Lam
955a5651d8 [eguile-gnc] use string-for-each instead of regex 2019-07-28 22:57:46 +08:00
Christopher Lam
e506b7c332 [eguile-utilities] compact functions
* whitespace
* move string-repeat to eguile-html-utilities where it's used
2019-07-28 22:57:25 +08:00
Christopher Lam
e3a695d0d4 [qif-imp/string] fix argument order for string-delete
Guile formerly used the wrong argument order for string-delete and
string-filter. Fix to correct order.

See bug report http://savannah.gnu.org/bugs/?31681
2019-07-28 20:03:12 +08:00
Christopher Lam
e8a41bbf54 [options] compact lookup-option 2019-07-28 12:16:58 +08:00
Christopher Lam
bd0cbbf931 [test-options] initial commit
* test lookup option changed section/name
2019-07-28 12:16:58 +08:00
Christopher Lam
66511f17bb [c-interface] compact functions
fix whitespace. this module has good coverage in test-c-interface.scm.
2019-07-28 12:16:58 +08:00
John Ralls
887f7fac32 Bug 746937 - Template transaction splits are loaded in reverse order...
and then not sorted before saving.

Actually not sorted after loading because the template accounts weren't
being committed.
2019-07-27 15:15:55 -07:00
John Ralls
456ab2241f Remove unused ifdefs for IMPLEMENT_BOOK_DOM_TREES_LATER.
Apparently stub code for a different way of generating the DOM tree, never implemented.
2019-07-26 16:17:09 -07:00
Frank H. Ellenberger
a0a0ffbb77 Bug 797319 - Mauritanian ouguiya MRO shows too few decimals
Add info about cash vs. banking
2019-07-25 23:51:50 +02:00
Frank H. Ellenberger
c77607c8c0 Bug 797316 - New Mauritanian ouguiya MRU not supported
Add info, which Mauritanian ouguiya is recent
2019-07-25 23:33:42 +02:00
Christopher Lam
7c9d5ee7ee Bug 797158 - gnc:make-account-sel-limited-option is not working
Option was being deliberately reset to default_value every time.
2019-07-25 20:22:12 +08:00
Christopher Lam
e9554e39b4 [test-stress-options] improve coverage
* improve documentation
* reuse (create-test-data) for various regular transactions
* run (create-test-invoice-data) for business invoices
* fix max arguments which would crash for reports without options
* if report has start-date and end-date, insert valid dates to ensure
report runs on non-null book data.
* enable testing of previously disabled reports
* also dump book and invoices generated in populated book
* modify output to show full backtrace on error: In case of test
failure, previous would show a shortened exception name. Change to
display full backtrace, similar to crashing in live code. Uses
gnc:apply-with-error-handling existing API call.

Also clean up code.
2019-07-25 20:22:12 +08:00
Christopher Lam
54c0765044 [test-invoice] modified to call (create-test-invoice-data)
test-invoice will call (create-business-test-data) to create the 8
sample invoices as previously generated.
2019-07-25 20:22:12 +08:00
Christopher Lam
681e023cd5 [date-utilities][API] deprecate unused exports, add comments
* deprecated:
  gnc:make-reldate-hash
  gnc:reldate-string-db
  gnc:relative-date-values
  gnc:get-relative-date-strings

* remove gnc:reldate-list, unused

* comment sections
2019-07-25 20:22:12 +08:00
Christopher Lam
7e9ec00906 [date-utilities] tidy up gnc:make-date-interval-list 2019-07-24 23:44:56 +08:00
Christopher Lam
9e3aca2ea9 [balsheet-pnl] fixcrash: price-conversion with 'overall-period
previously price-conversion with overall-period would fail when
considering the pricing date for the overall-period column. Use the
last date for the overall-period.
2019-07-24 21:57:33 +08:00
Christopher Lam
c3eab984ce [average-balance] fixcrash: asset-accounts present but no splits
restore the analyze-splits function. previously it would run on an
empty splitlist (obtained via empty accounts for example) and crash
with div/0. this commit will break loop back to analyze-splits
function, and only call it if the splitlist is not null.
2019-07-24 21:57:33 +08:00
Christopher Lam
cf6ea4c612 [report-utilities] update gnc:dump-book
gnc:dump-book also shows
* account balances
* split memo and reconcile status

Exmaple:

Account: <Root.A/Payable> Comm<USD> Type<A/Payable>
n Split: 09/03/80 Amt<-$6.00> Val<-$6.00> Desc<vend-1-name> Memo<vendor-bill>
c Split: 09/04/80 Amt<-$6.00> Val<-$6.00> Desc<emp-1-name> Memo<emp-bill>
y Split: 09/06/80 Amt<$6.00> Val<$6.00> Desc<vend-1-name> Memo<vend-credit-note>
f Split: 09/07/80 Amt<$6.00> Val<$6.00> Desc<emp-1-name> Memo<emp-credit-note>
Balance: $0.00 Cleared: $0.00 Reconciled: $0.00
2019-07-24 20:01:02 +08:00
Christopher Lam
a4811b3b46 [test-extras] add (create-test-invoice-data) for tests
this function creates some business data. moved from test-invoice.scm
without the invoice-specific tests. verified all invoices/bills are
created correctly.

it returns a vector-list of the 8 invoices generated.
2019-07-24 20:01:02 +08:00
Christopher Lam
c9cf35de5d [commodity-utils] document gnc:case-exchange-time-fn 2019-07-24 20:01:02 +08:00
Christopher Lam
e5b756fada [commodity-utils] refactor gnc:pricelist-price-find-nearest
instead of O(3n), this implementation is O(n)
2019-07-24 20:01:02 +08:00
Christopher Lam
1387c05f4d [test-commodity-utils] augment weighted-average tests
this is to increase 100% coverage pricealist-nearest finder
2019-07-24 20:01:02 +08:00
iggyvolz
49771ee9f9 Fix typo in CMakeLists.txt 2019-07-24 19:17:22 +08:00
John Ralls
ca87572a2c Bug 797319 - Mauritanian ouguiya MRO shows too few decimals
Changed MRO smallest-fraction to 100 based on information provided
by the reporter. ISO4217 has moved the MRO to the "Historical Currencies"
list that doesn't include CcyMnrUnits.
2019-07-23 09:42:43 -07:00
John Ralls
b02f7ac409 Bug 797316 - New Mauritanian ouguiya MRU not supported
Add new MRU with info from
https://www.currency-iso.org/dam/downloads/lists/list_one.xml
2019-07-23 09:42:28 -07:00
Thomas Klausner
507ef68dc7 Bug 795251 - googletest detection cannot be overridden
For the part about the GTest linking problem.
2019-07-20 18:05:13 -07:00
Christopher Lam
aa95d61c6c various reports: use more efficient report-utilities.scm functions
instead of delete-duplicates
2019-07-20 21:10:08 +08:00
Christopher Lam
ae4b7e1582 [report-utilities][API] gnc:accounts-and-all-descendants
return a list of accounts and their descendant accounts
2019-07-20 21:10:08 +08:00
Christopher Lam
38b2d4708b [report-utilities] gnc:accounts-get-commodities more efficient
more efficient function
2019-07-20 21:10:08 +08:00
Christopher Lam
273ae720cc [scm-utilities][API] add sort-and-delete-duplicates
this can be used instead of delete-duplicates when the list must also
be sorted.

the main reason for this function will be for the upcoming aging.scm
report which will use it heavily to slice APAR splits into owner list.
2019-07-20 21:10:08 +08:00
Christopher Lam
fdeff65f06 [business-core] refactor & document gnc:owner-from-split
This function helps to establish UI link from register split to an
owner's split. It should not be used anywhere else. Its use in reports
will be removed.

It is also unnecessarily complex -- it is called from an AP/AR account
register split, it should have all necessary information via split
metadata. e.g. this function *can* return a split owner if originating
from an Asset/Liability account which settles an invoice, but this
functionality is not used because there is no asset/liability register
hook to call it.
2019-07-20 21:10:08 +08:00
Christopher Lam
d0bf4ad8ae [test-business-core] add to dist_list 2019-07-20 21:10:08 +08:00
Christopher Lam
ce6c3c22a1 Fix CMakeLists error
need to include module
2019-07-20 21:09:34 +08:00
John Ralls
e88f31e05c Bug 784623 - GNUCash does not work with sql backend, I can open...
in read only mode

Upgrade the splits table as well, an oversight from the original fix.
2019-07-19 21:20:43 -07:00
Christopher Lam
0c433e02f7 [business-core] deprecate gnc:entry-type-percent-p
This function is only used once. deprecate it.
2019-07-19 22:22:28 +08:00