Commit Graph

20153 Commits

Author SHA1 Message Date
Christopher Lam
353eee58cb [transaction] convert collector map to for-each
collectors are accumulator-type objects, being mutated with each call,
rather than functional objects. (map) is meant for functional
constructs, returning a list to current continuation. We're not using
the (map) output, so, change it to (for-each) to emphasise this.
2018-09-09 22:17:29 +08:00
Christopher Lam
83ad9e4b89 [transaction] convert add-split-row to functional style
This commit removes need for row-contents, building a list of
table-cells directly.
2018-09-09 22:17:29 +08:00
Christopher Lam
f3100ddc0a [transaction] convert add-subheading to functional style
This commit removes need for row-contents, building a list of
subheadings directly.
2018-09-09 22:17:29 +08:00
Christopher Lam
5163541666 [report] remove test-report-system-flag
This flag is not required if we test (gnucash-ui-is-running) instead.
2018-09-09 22:17:29 +08:00
John Ralls
7e56a44f66 Remove deleted files from POTFILES.in 2018-09-08 15:08:39 -07:00
John Ralls
b05082a09d Merge Chris Lam's consolidated invoice report into maint. 2018-09-08 14:43:33 -07:00
John Ralls
1a7c5b9a32 Merge Christoff Holterman's Bug 796137 repair into maint. 2018-09-08 13:20:51 -07:00
Christoph Holtermann
3ab66623cd Bug 796137 - implement search_for as method of Python Query
The last three commits fix the main part of Bug 796137. An inconvenience
with GSList remains as for the moment qof_query_add_boolean_match only
accepts bytes as parameter and no strings. This still needs to be fixed.
2018-09-08 09:31:45 +02:00
Christoph Holtermann
6384854319 Bug 796137 - Fix QofIdType and QofIdTypeConst to work with python3
Patch by David Osguthorpe to provide typemaps so that SWIG doesn't
free buffers mem when buffer is saved as part of query struct leading
to garbage content. See https://bugs.gnucash.org/show_bug.cgi?id=796137
2018-09-08 09:31:45 +02:00
Christoph Holtermann
0551ee36e8 add option to exclude specified methods
an exclude option is being added to add_constructor_and_methods_with_prefix and
add_methods_with_prefix
2018-09-08 09:26:23 +02:00
John Ralls
148f24135b Merge Bob Fewell's 'fixes9' into maint. 2018-09-06 15:30:47 -07:00
John Ralls
75ccd57dbf Bug 796734 - Auto-complete entry not highlighting to allow...
for incremental entry.

Because the Quartz Input Method module (imquartz.c) messes with the
selected text, so we cache it in the gnucash_sheet object and restore it
after the input module is done with the keypress.
2018-09-04 14:53:20 -07:00
Geert Janssens
f6d873dc27 Bug 796833 - Excel csv Format misprocessed
Convert all line ending styles to the one expected by the C++ standard
library before starting to parse a csv file.
2018-09-04 11:28:22 +02:00
Geert Janssens
e47b460acb Set toolbar buttons to show both icon and text
And make the icon small to recover some vertical screen estate.
The motivation for this is that Gtk has dropped the ability for users
to change a toolbar's appearance. And as our icons are often less
than descriptive many users benefit from having textual descriptions
as well. This is the best compromise we can make until the gui
gets an in-depth redesign.
2018-09-03 19:39:16 +02:00
Geert Janssens
705e866472 Bug 796054 follow up
Now that a separate wiki section has been written for the side effects of this bug
make the memo field of affected splits point to this wiki section.
2018-09-01 16:22:42 +02:00
Geert Janssens
d07f759ca3 Use alignment-safe buffer handling
Casting a char* to a struct containing a uint32_t is not universally safe
due to alignment constraints on reads on some platforms. Copy our possibly
unaligned source data into an aligned area of memory to avoid SIGBUS on
armhf.
Reported by vorlonofportland in PR#403. This commit the John's optimized
version of Vorlon's proposed fix.
2018-09-01 12:07:42 +02:00
Geert Janssens
4c87dd05ec Fix compiler warning issues
- add -Wno-deprecated-declarations to CXX_FLAGS as well. This was
  reported by vorlonofportland in PR#401 to become necessary for glib 2.58
  as that has deprecated g_type_class_add_private which appears in our
  c++ code.
- change -Wno-deprecated-register into -Wregister. The former appeared to
  be a clang dialect and alias for the latter (see
  https://github.com/Barro/compiler-warnings for an overview of clang
  and gcc warnings). It was moved to global CXX_FLAGS as it can only be
  added for g++.
2018-09-01 12:07:38 +02:00
Geert Janssens
bf00330eed Merge branch 'Bug796725' of https://github.com/Bob-IT/gnucash into maint 2018-08-31 23:55:01 +02:00
Geert Janssens
131df82135 Merge branch 'date-bugs' of https://github.com/Bob-IT/gnucash into maint 2018-08-31 22:01:45 +02:00
Geert Janssens
caaf9edc45 Use one single function to determine if an invoice is posted to ensure consistent behaviour
While debugging for bug 796054 I found cases where an invoice was unposted, but the toolbar
buttons and menu items were configured for a posted invoice. This should now be solved.
2018-08-31 20:58:36 +02:00
Geert Janssens
baf933acf2 Bug 796054 - unposting and reposting invoice doubles amounts
Add scrub function to unblock the double post transaction
2018-08-31 20:24:39 +02:00
Geert Janssens
1239876b5b Use GnuCash instead of Gnucash in OSX environment file
This is the result of a discussion on
Bug 796837 - GnuCash 3 has changed the capitalisation of the folder in Application Support on macOS
2018-08-31 19:04:40 +02:00
Geert Janssens
5ffb7fa20b Fix input of invoice post and due dates
In the conversion from a timespec pointer to a time64 in
https://github.com/Gnucash/gnucash/commit/6f89bd62b3cf
we lost the write-back of these two dates to the calling function.
Fixed by making the time64 members pointers again as the timespecs were before.
2018-08-31 14:35:15 +02:00
John Ralls
fc368b91d2 Restore the timespec_val column name in the slots table.
Renaming it would require a backwards-incompatible schema change,
something that shouldn't happen in the middle of a stable series.
2018-08-30 17:03:41 -07:00
John Ralls
6dfbf3d5e7 gnc:get-commodity-totalavg-prices shouldn't use 0-amount splits.
get-commodity-totalavg-prices seeks to create a share-weighted average of
all prices for a commodity and 0-share splits (normally used to book
trading gains) don't represent a price and so distort (sometimes
dramatically) the resulting average as well as creating extra invalid
entries in the resulting alist.
2018-08-30 11:02:58 -07:00
Geert Janssens
c977c2350a Merge branch 'sort-filter' of https://github.com/Bob-IT/gnucash into maint 2018-08-30 12:18:15 +02:00
John Ralls
28691b46ba Create srfi-64 tests for gnucash/report/report-system/commodity-utils.scm. 2018-08-28 15:11:14 -07:00
John Ralls
b1ee7c6eec Clarify and de-duplicate sumlist and report-list descriptions.
Also correct descriptions of gnc:get-exchange-totals and
gnc:get-exchange-cost-totals. Neither calculates prices.
2018-08-28 15:10:29 -07:00
John Ralls
704afc6e02 Comment to explain structuring an (env-transfer-foreign). 2018-08-28 15:10:29 -07:00
John Ralls
fe73f52bdb Guard against divide-by-zero errors. 2018-08-28 15:10:29 -07:00
John Ralls
4e88b8cb6c Remove the number-collector.
It is redundant and incorrect since gnc-numeric was replaced with Scheme
rationals in the report code.
2018-08-28 15:10:28 -07:00
Robert Fewell
a639dd9236 Reduce the number of times the register loads
When a register is created an initial query is run and then the filter
and sort item/reverse order is added and after each item the ledger is
refreshed. By adding a parameter to the three main functions to toggle
the refreshing, with a value of false at register creation, and moving
the gnc_ledger_display_refresh command this can be reduced to 2 from 5.

In the sort/filter dialogue the refresh parameter is TRUE allowing the
changes to be seen immediately.
2018-08-28 19:30:37 +01:00
Robert Fewell
e2801fd937 Change the default filter for General Ledger
The General Ledger default for the number of days shown is 30 but for
the Register it is 0, meaning show all. So change the default filter
based on ledger type and use this when determining if the setting should
 be saved or removed.
2018-08-28 19:30:28 +01:00
Robert Fewell
2dcb316280 White space removal and change tabs to spaces in qofbook.cpp/h 2018-08-25 11:10:32 +01:00
Robert Fewell
fd750a22eb Cache the number of days read only value
The KVP value for the qof_book_get_num_days_autoreadonly was being
called many times so it makes sense to cache it in the book to avoid
the KVP lookup.
2018-08-25 11:10:24 +01:00
Robert Fewell
8ad6e04549 Book Options did not raise when already open
If you open File->Properties and the dialogue gets hidden and you go to
open it again the existing dialogue was not being raised to the front.
This was due to a bad cast.
2018-08-24 16:52:17 +01:00
John Ralls
93f3a8ea82 Fix build of jenny.c on 32-bit builds, mingw-w64. 2018-08-23 11:49:49 -07:00
Robert Fewell
3456596a1c Bug 796814 - Changing a book's read-only threshold doesn't immediately affect open registers
Add test for change of read-only threshold to helper function for the
gnc_book_options_dialog_apply_cb which will then do a gui refresh.
2018-08-22 20:40:17 +01:00
Robert Fewell
67ee1d99a4 Bug 796812 - gnc_date_cell_get_date and gnc_date_cell_get_date_gdate have different date validation behaviour - part 2
Change the two register get_help functions to use gnc_date_cell_get_date
with the warn parameter FALSE, this way we only get one warning when the
date is out of range.

Also as no functions use gnc_date_cell_get_date_gdate it can be removed.
2018-08-22 20:38:36 +01:00
Robert Fewell
aabae1caf9 Bug 796812 - gnc_date_cell_get_date and gnc_date_cell_get_date_gdate have different date validation behaviour - part 1
Add gboolean parameter to gnc_date_cell_get_date to enable warning for
the date out of range dialogue and update every occurrence accordingly.
2018-08-22 20:36:51 +01:00
Robert Fewell
dd49756f4e Bug 796813 - Date validation inconsistent
Change gnc_split_register_save_date_cell function and the equivalent one
 in gncEntryLedgerModel to use time64 version of gnc_date_cell_get_date
which includes the warning for dates out of range.
2018-08-22 20:35:54 +01:00
Robert Fewell
4a3c6f8f85 Change saving to .gcm and Kvp for GNC_FEATURE_REG_SORT_FILTER
For the LD_GL save the filter and sort settings to the .gcm always.
For the rest, keep saving the filter and sort settings to kvp only
when the GNC_FEATURE_REG_SORT_FILTER is not set, if set then save
only to the .gcm file. This will be set on first use in version
4.0 where a conversion will be run to only use the .gcm meta file.
2018-08-19 16:06:17 +01:00
Robert Fewell
995e6b0f95 White space and tabs changed in search-date.c 2018-08-19 11:59:25 +01:00
Robert Fewell
39b24325d9 Bug 796725 - 4 of 6 Date Posted options fail to return
matching transactions.

gnc_date_edit_get_date returns the time64 value set to 00:00:00 for the
day entered so for the LTE and GT options gnc_date_edit_get_date_end
needs to be used for 23:59:59. For finding transactions on the date,
the use of QOF_DATE_MATCH_DAY needs to be used.
2018-08-19 11:55:43 +01:00
Geert Janssens
54a5097c60 Bug 796777 - CVE-2008-1391: Integer overflow in included strfmon function
We only used strfmon in one source file to generate three fixed format
strings. Instead of updating to a newer strfmon in borrowed I have
chosen to reimplement the string formatters for these strings in C++.
Note this is *not* a full c++ conversion of the full functionality
of assistant-loan. Only the string parsing has been redone.
2018-08-17 16:23:12 +02:00
Geert Janssens
34cb4925a4 Compile assistant-loan as c++
Fix only c++ compatibility issues, which primarily boils down
to dealing with stricter type checking.
2018-08-17 16:23:12 +02:00
Robert Fewell
6ba47846c0 Improve the generation of the filter text 2018-08-17 11:31:25 +01:00
Robert Fewell
a650693d07 New feature for register sort/filter settings move. 2018-08-17 11:31:25 +01:00
Robert Fewell
9423e0913b Remove white space and re-indent gnc-features.c 2018-08-17 11:31:25 +01:00
Robert Fewell
c6001d855a Allow loading the sort and filter settings for the GL
By default the GL loads the last 30 days but this can be changed and
saved depending on requirements.
2018-08-17 11:31:25 +01:00