Commit Graph

19852 Commits

Author SHA1 Message Date
Christopher Lam
b30f4d7c90 [easy-invoice.scm] fix html to be parsable by sxml
Without this change the HTML cannot be parsed by sxml.
2018-06-12 23:40:13 +08:00
John Ralls
9e6760f7cb Bug 796527 - invalid currency on scheduled transactions
1. Don't even check for price/exchange rate on template transactions,
there's no point.

2. Extract function get_transaction_currency:
a. Check all split commodities are valid, abort transaction creation if
not.
b. If the template transaction's currency isn't used by any of the
splits set the new transaction's currency to the first-found currency if
there is one, otherwise to the first-found commodity.

3. Fix a minor typo in a comment.
2018-06-11 10:03:16 -07:00
goodvibes2
5f53e2926a Use HINTS instead of PATHS to tell cmake where to look for GTEST + GMOCK
files so it selects the paths in GTEST_ROOT + GMOCK_ROOT rather than the
system libraries.
2018-06-11 18:30:04 +10:00
John Ralls
6f0a3c4345 Bug 795362 - Special variable "i" not parsed in function calls
Limit the range of the random value to 1..1000 to prevent overflows,
particularly in number-of-periods or number-of-years variables.

While we're at it, g_random_int and g_random_int_range return ints so
piping the result through gnc_double_to_numeric() doesn't make much
sense. That's removed, we just construct a gnc_numeric.
2018-06-08 16:44:31 -07:00
Geert Janssens
dc7135920b Minor build error message improvement 2018-06-08 14:27:58 +02:00
John Ralls
cdcb230a31 Don't look for backend libraries in old autotools subdirs.
Partly addresses Bug 794526
2018-06-07 17:38:04 -07:00
Potuz
e3e1464a01 Bug 794617 - Can't compile with -DWITH_GNUCASH=NO due to scm-gnome-utils
Pricedb.go doesn't need gnc-gnome-utils and we don't need WebKit or
gwenhywfar-gtk3 if we have no GUI.
2018-06-07 14:17:49 -07:00
John Ralls
690ef626a8 Merge Carsten Rinke's branch 'Bug787401-TestReport-Definition' into maint. 2018-06-07 11:55:52 -07:00
John Ralls
8cfa078bd7 Merge Chris Lam's 'maint-html-layout' into maint. 2018-06-07 10:48:28 -07:00
John Ralls
b431b648a9 Merge Chris Lam's branch 'maint-test-transaction-amendments' into maint. 2018-06-07 10:10:31 -07:00
Christopher Lam
b787baaa8f [test-transaction] modify test to be acceptable to MacOS
This modification will convert string to number (using a customized
function defined in same file) to obviate need to encode #pound sign
in scheme.
2018-06-07 19:12:48 +08:00
Christopher Lam
1641c42247 [html-anytag] generic html tag object
Generic tag HTML-object.
Also defines (gnc:make-html-div/markup) (gnc:make-html-span/markup)

any html object can be enclosed with (gnc:make-html-span obj)
or (gnc:make-html-span/markup "class" obj), (gnc:make-html-div obj)
or (gnc:make-html-div/markup "class" obj)
2018-06-07 15:03:33 +08:00
Christopher Lam
ccf3ebda16 [STYLESHEETS] modify stylesheet to accept document style-text
This commit will modify stylesheet-*.scm to pass the *document*
style-text as well as the *style-sheet* style-text to the <style> tag.
2018-06-07 11:19:33 +08:00
Christopher Lam
da0160add8 [test-cashflow-barchart] hide debugging messages
These tests pass. Don't need debugging output anymore.
2018-06-07 11:19:33 +08:00
Carsten Rinke
848e3da105 Bug787401 - Test Report System - Report Definition
include change proposals from responses to PR#360
2018-06-05 22:01:18 +02:00
Carsten Rinke
324cfeb3a4 Bug787401 - Test Report System - Report Definition 2018-06-04 23:28:37 +02:00
John Ralls
0b10b4b9ed Bug 796423 - Cannot Input Chinese, seems does not work with...
other IME too .

Also Bug 795253 - Have problems input Chinese.

Adds GTK_IM_MODULE_FILE to environment on Macs so that IME is enabled.
Removes toggling the GtkEntry's editability in
gnucash_sheet_key_press_event_internal; disabling it killed the preedit
and that broke IME.
2018-06-04 13:46:23 -07:00
Keve Müller
b4b16be30f Small XML related fixes removing ambiguity improving uniformity
acctchrt_common:
there is a gratituous "i"

acctchrt_full (ja):
the Retirement and Spouse's retirement accounts have two parents
(Investment as well as ROOT), removed ROOT.

uk-vat:
the root account was pasted a line too high 7y ago. all other files have
the header block continuous
2018-06-04 13:46:23 -07:00
John Ralls
a97f9faf91 Revert "Merge Keve Mueller's 'xea-fixes' into maint"
This reverts commit eb67baba5b, reversing
changes made to 0064dafbad.

Keve Mueller's xea-fixes branch was made from master, so merging it into
maint effectively merged master onto maint, not something we want to do.
2018-06-04 13:46:23 -07:00
Geert Janssens
06808469d0 Merge branch 'maint-eradicate-gtkhtml' of https://github.com/christopherlam/gnucash into maint 2018-06-04 13:44:42 +02:00
Geert Janssens
aeb2531350 Merge branch 'maint-scheme-more-progress' of https://github.com/christopherlam/gnucash into maint 2018-06-04 11:46:46 +02:00
Christopher Lam
5093a8fb14 [webkit] eradicate gtkhtml in .scm
This commit does away with anything gtkhtml related. Some variables eg
css? must remain because they're used later on.
2018-06-04 11:01:23 +08:00
John Ralls
eb67baba5b Merge Keve Mueller's 'xea-fixes' into maint 2018-06-03 10:26:52 -07:00
John Ralls
0064dafbad Merge Bob Fewell's Bug Fixes 5 into maint. 2018-06-03 10:10:11 -07:00
Christopher Lam
0dc9a11501 [html-table] compact html-table-append-row! 2018-06-03 20:19:47 +08:00
Christopher Lam
5532de0481 [html-table] use srfi-1 2018-06-03 20:19:11 +08:00
Christopher Lam
7927597b3a [html-table] gnc:html-table-set-row-style! uses cons*
This cons* call creates a pair-terminated list.
2018-06-03 20:19:11 +08:00
Christopher Lam
39e976045b [html-table] unused gnc:html-table-merge
This function is not used through code.
2018-06-03 20:19:11 +08:00
Christopher Lam
03b57e5153 [hello-world] amend comment from timepair to time64 2018-06-03 20:19:11 +08:00
Christopher Lam
879ec75f20 [TR] [ENH] grid can easily display averages
The subtotal-grid can easily calculate average amounts per *row*. I
think this is useful enough to be set as default. Enable if number of
secondary-key groups > 1. Upgrade test suite as well.

The subtotal collectors do not calculate overall secondary-key
subtotals, therefore, we cannot easily calculate average amounts per
*column*.
2018-06-03 20:19:11 +08:00
Christopher Lam
e9535bfab6 [TR] [bugfix] disable grid if primary-key doesn't have subtotal
Formerly the logic would allow grid if secondary-subtotal enabled but
primary-subtotal disabled. This would produce a single-row grid. This
is now known to be inaccurate.

This is because there will be multiple secondary subtotals spread out
in the main table but no primary subtotal grouping to separate
them. This would make every subsequent secondary subtotal overwrite
the previous one. I think it is best to disable grid altogether if
primary-subtotal is not enabled.

The converse i.e. primary-subtotal enabled but secondary-subtotal
disabled, is handled correctly. It produces a single-column grid.
2018-06-03 20:17:35 +08:00
Christopher Lam
aafd46a442 [TR] [bugfix] upgrade add-subtotal-row & grid for >1 commodities.
This aims to handle multiple commodities correctly. If a row contains
subtotals with more than one commodity, the row is duplicated so that
every commodity gets its own line in the grid.

This is accompanied by an upgrade to the test suite.

Sample output if prime-sortkey = accounts, sec-sortkey = monthly dates

        Jan-17  Feb-17  Mar-17   Total
Food    $22.00  $23.00  $35.00  $80.00
Books    $8.50   $9.55  $15.00  $33.05
Apps     £2.55   £5.00   £9.60  £17.15
Total                          $113.05
                                £17.15

(note monthly totals are not displayed because they're not actually
generated with the above sorting options)
2018-06-03 20:17:26 +08:00
Christopher Lam
98964f7a6d [TR] refactor add-subtotal-row
Schemify to use (append) rather than (set!) calls to build
list-of-cells. This is (IMHO) neater and definitely favoured by
seasoned schemers.
2018-06-03 20:17:21 +08:00
John Ralls
333a14c0fd Fix ubuntu build failure.
%$^%$ C++11 initializer list behavior.
2018-06-02 17:57:42 -07:00
John Ralls
3b3074c28d Bug 796117 - Connecting 3.1 to an existing mysql db drops all data
Provide a backup recovery function that instead of dropping primaries
and restoring backups merges the primaries and backups. This should
handle a worst-case safe-save failure where the backup tables don't
have a complete set of rows for some reason.
2018-06-02 16:21:49 -07:00
John Ralls
f8045b2735 A wee bit of C++ style. 2018-06-02 16:21:05 -07:00
John Ralls
537fd995a3 Ensure full precision of doubles is saved to SQL.
std::iostream's operator<<(double) uses only 6 digits of precision
by default. We want 12 digits when saving.
2018-06-02 16:20:36 -07:00
John Ralls
9db60ca63c Make float database operations more consistent.
We don't use floats in GnuCash, we use doubles (and those as little as
possible), but dbd-sqlite3 is broken in that it stores only floats.
Simply casting floats to doubles introduces bogus additional digits
that can cause round-trip tests to fail. Instead convert floats to
doubles by multiplying by 10E6, rounding, then dividing by 10E6.
2018-06-02 16:16:41 -07:00
Robert Fewell
bc605d200e Prevent crash in gnc-tree-view.c
When getting information from the state file, protect against the key
not having a '_' which is used to split the string.
2018-06-02 11:24:53 +01:00
Robert Fewell
04836eb671 Add the full account name to the saved register settings
If you need to delete the layout for a register in the settings file,
the only thing identifying it is the account guid. To make it easier
for humans, add the full account name also.
2018-06-02 11:24:20 +01:00
Robert Fewell
709f69db32 When register pages are restored it uses the full account name.
When register pages are restored, the account is found from the full
name so if the separator changes it will fail. Instead, also save the
account guid and use that as default to find the account falling back
to the full name.
2018-06-02 11:23:40 +01:00
Robert Fewell
51093e43ba Bug 796256 - Closing Gnucash when minimized on windows
Closing Gnucash on Windows when minimized causes the window position to
be saved as -32000,-32000 and on restart the window can not be seen. To
fix this the previous retrieved position is saved and used if on exit
the window is minimized.
2018-06-02 11:22:58 +01:00
John Ralls
3e052e8dac [DBI Backend] Rework backup-table management.
Removes a public function, GncDbiSqlConnection::table_manage_backup that
should have been private in the first place.

Better encapsulates table renames and drops with private functions and
handles cases where there exist some primary tables and some backup tables.
2018-06-01 14:50:41 -07:00
John Ralls
e23769f078 [DBI Backend] If there's a set error value use that to set the backend error. 2018-06-01 14:13:11 -07:00
John Ralls
f504e39d78 Correct the type of error variables.
C++ doesn't like interchanging enums and ints.
2018-06-01 14:13:11 -07:00
John Ralls
464fdeeb26 [DBI Backend] Remove unused TableOpTypes. 2018-06-01 14:13:10 -07:00
Robert Fewell
f77e6e34c4 Bug 796083 - Reconcile view toggle not being drawn correctly
Out of site toggles on selected rows may not appear correctly drawn so
queue a draw for the tree view widget after the model has been updated.
2018-05-31 12:02:28 +01:00
Robert Fewell
5ff642e3a3 Remove some white space from gnc-budget-view.c 2018-05-31 10:53:40 +01:00
Robert Fewell
2a28c682a9 Adjust Budget editor totals column width
Totals column width is based on the larger of header title or column
content so with a header of "Total" and a column value of 700.00 there
is not much space between the previous column and the totals column so
set a minimum width based on the previous column header.
2018-05-31 10:53:40 +01:00
Robert Fewell
6730d1420c Budget editor total column label alignment
Align the column header label to that of the column.
2018-05-31 10:53:40 +01:00