Commit Graph

20673 Commits

Author SHA1 Message Date
Christopher Lam
d49a51ca73 [report] convert (gnc:restore-report) to use closure
Instead of a global variable gnc:old-style-restore-warned, use closure
to isolate variable within the only function which uses it.
2019-02-27 20:15:24 +08:00
Christopher Lam
6e7cd33308 [report] centralize strings, (gui-error-dialog) logic 2019-02-27 20:15:24 +08:00
Christopher Lam
afda387988 [report] enforce gnu coding style
no dangling parentheses
(if a a b) -> (or a b)
2019-02-27 20:15:24 +08:00
Christopher Lam
f021658382 [report] *delete-trailing-whitespace/reindent/untabify* 2019-02-27 20:15:24 +08:00
Christopher Lam
8f8f5b8461 [test-report-system] improve test coverage to ~40%
test many more functions. this is not 100%; many functions are
incomprehensible.
2019-02-27 20:14:47 +08:00
loftx
d5297a46bf Resolve 'basic_string::_M_construct null not valid' error when no database is provided in connection string 2019-02-26 15:37:01 +01:00
Christopher Lam
548ee9f56b [test-report-system] tests functions instead of returned values
Previous tests for report definition had modified report.scm to return
bool #f to signify 'aborted definition'. This had mistakenly
invalidated an old-report handling code path whereby guid was missing.

This commit will modify old tests to define reports, and verify
success/failure according to the (gnc:all-report-template-guids) list
length which, indirectly, is a surrogate marker for a successful
report definition.
2019-02-26 20:49:27 +08:00
Christopher Lam
c6b7338fbc [test-report-system] reindent
improve readability of test suite.
2019-02-26 19:48:31 +08:00
Christopher Lam
d980bb50f7 [report] display gnc-error-dialog only when UI is running
This is preparation work for creating report.scm tests.
2019-02-26 18:23:05 +08:00
Christopher Lam
0ce6999ff6 [html-utilities] compact (gnc:html-make-exchangerates)
and also right-align the commodities, as originally planned.
2019-02-24 17:29:34 +08:00
Christopher Lam
5cdc515885 [transaction] html anchor should target split
Previous would create html anchor to target the transaction containing
the report split.

This would mean the anchor would link the correct transaction, but
would always link to the first account in the transaction. This change
will ensure that the account containing the exact report split is
opened.
2019-02-24 17:29:34 +08:00
milotype
316a22a282 Initial release of croatian fixedassets account file 2019-02-24 10:18:07 +01:00
milotype
d2dce42587 Initial release of croatian eduloan account file 2019-02-24 10:17:28 +01:00
milotype
4845d1081c Various small improvements in the Croatian account files 2019-02-24 10:17:12 +01:00
Frank H. Ellenberger
49ebc967e9 Merge branch 'hr' into maint 2019-02-23 23:29:11 +01:00
Frank H. Ellenberger
a4e08d7cda add data/accounts/hr and README-hr.win32-bin.txt to CMakeLists 2019-02-23 22:39:44 +01:00
Christopher Lam
c9ddd6c828 [register] use scheme numeric operators instead of gnc-numeric 2019-02-23 08:02:12 +08:00
Christopher Lam
b1763ed13d [register] simplify make-split-table main loop
Previous was using nested ifs. use cond instead which is more
appropriate.

Also handle dangling-split separately.
2019-02-23 08:02:12 +08:00
Christopher Lam
bae74fed0a [register] simplify named let
many args were not modified.
2019-02-23 07:47:03 +08:00
Christopher Lam
a23b945a11 [register] simplify splits-leader
They were using complicated algorithm to get the split account.  Also
change leader output from account/null to account/#f.

It is simpler to return #f if there is no 'leader'
2019-02-23 07:47:03 +08:00
Christopher Lam
27c0ab490a [register] change other-rows-driver to named-let 2019-02-23 07:47:03 +08:00
Christopher Lam
beaf945907 [register] *delete-trailing-whitespace/reindent/untabify* 2019-02-23 07:47:03 +08:00
Frank H. Ellenberger
da7da035f4 Remove obsolete hr_HR direcory
Recent versions are in hr
2019-02-22 22:40:41 +01:00
Frank H. Ellenberger
33a376bddf add hr.po's to CMakeLists.txt 2019-02-22 22:37:14 +01:00
Frank H. Ellenberger
c01955bb12 PR #455: initial release of the croatian translation
Merge branch 'milotype-hr-01' of https://github.com/milotype/Gnucash into maint
2019-02-22 22:22:59 +01:00
Christopher Lam
3759099e1e [register] changed do-rows-with-subtotals to named-let
this function is defined and used only once.
2019-02-22 23:36:48 +08:00
Christopher Lam
83d5c21c4b [register] remove dead utility and invoice code 2019-02-22 23:36:48 +08:00
Christopher Lam
b96e48f23f [register] trim reg-renderer
there was dead code to handle printing invoices. remove.
2019-02-22 23:36:48 +08:00
Christopher Lam
102a357cfe [test-register] basic test for register.scm 2019-02-22 23:36:15 +08:00
Christopher Lam
09e0e02a75 [test-extras] abstract test-data skeleton 2019-02-22 23:36:15 +08:00
Christopher Lam
f92b9459ba [tests] encapsulate tests with (test-begin/end)
this ensures that any test failures will return #f as appropriate.
2019-02-22 23:36:15 +08:00
Frank H. Ellenberger
609bd48a0d Shorten a german column header 2019-02-22 05:03:47 +01:00
Geert Janssens
fce75ea748 Add dedicated api to query build-time, version related compile constants
And use it in several location in the code for consistent behaviour
2019-02-21 17:00:15 +01:00
milotype
1d82a6dcb1
update hr.po
changes:
- hr.po:3638 => added accelerator mark
- hr.po:7788 => added accelerator mark
- hr.po:10957 => removed accelerator mark
- hr.po:16166 => no change, ignored
- some minor other changes in wording
2019-02-21 05:57:45 +01:00
Joshua "jag" Ginsberg
b53d5c65e0
Fixes to traceback calls in pycons 2019-02-20 18:56:41 -05:00
Christopher Lam
b334366f63 [html-document] if headers? is #f, do not add <body> tag
This is a step towards creating valid html in multiple-charts reports.
2019-02-20 22:49:54 +08:00
Christopher Lam
25f2abb011 [html-document] compact functions
These functions were unnecessarily complex and used to build html
report. Tests are not mandatory here... All tests still pass which
means the html-documents are being built up correctly.
2019-02-20 22:47:38 +08:00
Christopher Lam
fe6cc534a0 [engine-utilities] deprecate account utility functions
These functions are obsolete with SRFI-1
2019-02-20 22:47:03 +08:00
Christopher Lam
972562421e [engine-utilities] deprecate split utility functions
These functions are obsolete with srfi-1
2019-02-20 22:47:01 +08:00
Christopher Lam
9ba0d9658d [test-extras] (create-transaction) adds price trading commodities/currency
this will modify a test which was calibrated to record purchase price
only. fix transaction creation to add prices for both purchase and
sales, and also fix test which was assuming no sale price was bring
recorded.
2019-02-20 21:41:49 +08:00
Christopher Lam
918321aafa [test-extras] for tests: (env-create-multisplit-transaction)
This is the general case for any transaction creation.  Rewrite other
transaction creation routines to use it.  All tests still work
unchanged, which confirms this function works well.

This will allow tests to create multisplit transactions, of an
arbitrary number of splits. If the list-of-split's values are not
balanced (i.e. total 0), the engine will create an Imbalance-CUR
split.

The motivation is to allow creation of complex multisplit
multicommodity transactions eg USD50 + GBP20 (USD25) = EUR66 (USD75)
as well as their prices GBP/USD = 25/20 and EUR/USD = 75/66.

* USD -50
* USD -25 = GBP -20
* USD +75 = EUR +66

This will be useful in creating tests for stock-based reports, whereby
stock sales need splits in STOCK/ASSET/INCOME accounts.
2019-02-20 21:41:49 +08:00
Christopher Lam
82edec26fc [test-extras] (gnc:options->sxml) dumps better error
The exception catcher gives a (k . args) pair which contain useful
information about the exception. Show in test log output.
2019-02-20 21:41:49 +08:00
Christopher Lam
768132236a [general-ledger] Void-Transactions had moved from Accounts to Filter
TR void-transaction moved from Account tab to Filter tab.
2019-02-20 21:41:11 +08:00
Christopher Lam
971be33951 [html-fonts] compact (font-name-to-style-info)
which was badly written. compact, and create tests.
2019-02-20 21:09:22 +08:00
Christopher Lam
4a2b5e9641 [hooks.scm] deprecate hooks.scm
this module has a single function which is used only once. inline it.
2019-02-20 21:09:22 +08:00
Christopher Lam
f64586b873 [app-utils] remove config-var.scm
unused since 1999?
2019-02-20 21:04:23 +08:00
Christopher Lam
6945e1c7d7 [cash-flow][budget] logic error in sub-accounts handling
Previous logic would cycle through accounts' sub-accounts, and each
sub-account would be queried for inclusion in accounts; if not
present, the accounts would be appended by all sub-accounts.

Logic would dictate that only the missing sub-account should be added
to the accounts list.

No functional change is expected; previous behaviour would generate an
unnecessarily long resulting accounts list (includes sub-accounts as
many times as there are sub-accounts).
2019-02-20 20:46:27 +08:00
Christopher Lam
2215dfc5e1 [cash-flow] clean up cash-flow calculator
1. remove split-seen? helper function. use a simple list.

2. they were maintaining 2 lists for in, 2 lists for out. simplify to
1 list each.

3. convert single-use function to named let

4. remove transaction date filter - transactions were already
date-filtered by the query prior.

5. use simple lists instead of split/account hash tables. use the
incredible versatile srfi-1 functions.

6. s-report-value can be defined earlier

7. clean up whitespace so that line maxwidth is 80

8. tests already exist in test-cash-flow.scm
2019-02-20 20:15:57 +08:00
Christopher Lam
c6f5e6736b [cash-flow] *untabify/delete-trailing-whitespace/reindent* 2019-02-20 20:02:08 +08:00
Christopher Lam
d97d4930ba [cash-flow] replace account-in-alist with srfi-1 equivalent 2019-02-20 20:02:08 +08:00