Commit Graph

144 Commits

Author SHA1 Message Date
Geert Janssens
53f59f7794 RptCleanup - Restructure installation of gnucash scm files
These files were installed fairly ad-hoc into the share/gnucash/scm directory making
it hard to get an idea of where each file comes from.
The files are now structured as follows:
- any scm file authored by gnucash should go in share/gnucash/scm/gnucash or below
- most scm modules will be directly in that directory
- each module that comes with support files will get a subdirectory named after the
  module's base name. For example next to engine.scm there will be directory
  named engine for all support files of the engine module
- scm files that are not modules, but are loaded by modules go into
  <module-dir>. For example gnc-utils.scm loads gnc-menu-extensions.scm
  so that file will be installed in gnc-utils/gnc-menu-extensions.scm
- the report system is our largest module and only part of the restructuring
  is done at this point. It will be refined further in future commits.

The same restructuring is also done for the compiled files.
2019-06-18 14:25:04 +02:00
John Ralls
354e868716 Move simple-obj.scm to import-export/qif-imp, the one place it's used. 2019-06-13 16:29:10 -07:00
Geert Janssens
30ac2cf266 Remove guile functions that were marked as deprecated in gnucash the 3.x series 2019-06-12 16:55:53 +02:00
Geert Janssens
d3e03ff662 Drop code to migrate preferences from gconf to gsettings
This change was introduced in 2.6. Anyone wishing to migrate from 2.4 to 4 should
first pass via 2.6 and/or 3 anyway so this code will never be used again for 4.x
2019-06-12 15:17:25 +02:00
John Ralls
9ec5eab714 Merge branch 'maint' 2019-06-09 12:43:12 -07:00
Geert Janssens
15a35e6a3b Housekeeping - replace plenty of http links with https
There are more, but these are most common ones.
There are also a number of urls that don't behave well when https, so those are skipped
At some point I have also started marking non-working URLs as [DEAD LINK], though
that's not a full coverage.
2019-06-06 15:52:30 +02:00
Christopher Lam
885689b42d [options] bugfix don't override inbuilt list keyword
fixing a 17 year old bug.

previous version had defined (save-acc list count) and (save-item list
count) thereby overwriting the inbuilt 'list' keyword, and tried to use
the it later on with (list key)... best rewrite with neater code.
2019-05-31 23:31:54 +08:00
Christopher Lam
ed42f8acb6 Bug 797197 - Transaction report: Error message when sorting on month
guile's strftime is/was buggy; cannot handle non-UTF8 locales. Use
gnc_print_time64 instead. see the following

http://lists.gnu.org/archive/html/bug-guile/2019-05/msg00003.html
2019-05-27 21:20:29 +08:00
Geert Janssens
cc7ca438c0 Merge branch 'maint' 2019-05-27 11:58:18 +02:00
John Ralls
06bc064379 Fix dependencies for Scheme tests requiring SRFI64.
So ninja check passes without having run ninja first.
2019-05-25 10:09:12 +02:00
John Ralls
cac307602f Build or link all Scheme test files into a directory "tests".
Instead of random locations only occasionally related to the
corresponding source.

Includes renaming libgnucash/engine/test/test-extras.scm and
gnucash/report/report-system/test/test-extras.scm to avoid a
naming conflict.
2019-05-25 10:09:07 +02:00
John Ralls
141e777893 Suppress installing Scheme test programs. 2019-05-25 10:07:42 +02:00
Robert Fewell
416b79d304 Reformat source files gnc-accounting-period.*
Change tabs to white space and some other white space changes.
2019-05-17 11:01:24 +01:00
Robert Fewell
037f5ed5be Bug 797089 - Wrong time for accounting period end date
In the Preferences/Accounting Period, there is an option to specify
absolute dates but the end date was being set to start of day instead
of end of day, changed this.
2019-05-17 11:01:24 +01:00
Christopher Lam
6e246ef8ad [options] compact option-setter in generator
slightly more compact, avoids confusing structure whereby 'option' is
both the lambda's argument and the definition of argument.
2019-05-04 06:19:59 +08:00
John Ralls
114efe5936 Transcode non-constant strings before passing them to scm_eval_string.
Instead of using scm_c_eval_string, which transcodes with
scm_from_locale_string. That doesn't work on Windows.
2019-04-29 15:00:54 -07:00
John Ralls
94bb28d9ab Bug 797127 - Company name and address in reports not display properly
Ensure that all includes of swig-runtime.h are *followed* by
including guile-mappings.h so that the defines masking
scm_to_utf8_string and scm_from_utf8_string are undone.
2019-04-27 13:39:27 -07:00
thetedmunds
483f9a4c83 Bug 797196 - Allow for per-payment rounding in amortization calculations
Provides functions gnc:amort_pmt, gnc:amort_ppmt, and gnc:amort_ipmt in
fin.scm.
2019-04-25 13:28:40 -07:00
John Ralls
5311e5a386 Revert "Merge T Edmunds's 'amortization-rounding' into maint."
This reverts commit aa53c23239, reversing
changes made to 3c946a8449, because
aa53c23 was based on master and so undid other changes made to maint
since the last merge-to-master.
2019-04-25 13:19:28 -07:00
John Ralls
aa53c23239 Merge T Edmunds's 'amortization-rounding' into maint. 2019-04-20 12:36:51 -07:00
thetedmunds
9afc856c20 Changed gnc:computeInterestIncrement to directly calculate the amount of interest accrued in the specified compounding period. Bug 797195. 2019-04-17 12:11:29 -07:00
thetedmunds
5f9020016a Amended commit to address pull-request comments. 2019-04-17 11:52:24 -07:00
Christopher Lam
3923dfa19a [business-prefs] tidy counter definitions
(for-each) is more appropriate here because the (map) output is
unused...
2019-04-04 19:43:44 +08:00
Christopher Lam
a4eb5b1a59 [options] compact book-currency-acounting functions 2019-03-30 01:39:55 +08:00
Christopher Lam
faf1b08cec [options] compact valid-gains-loss-account? 2019-03-30 00:59:24 +08:00
Christopher Lam
0b8ff4b5d6 [options] deprecate gnc:save-options
this is unused.
2019-03-25 17:38:50 +08:00
Christopher Lam
4f6344963d [options] simplify gnc:value->string 2019-03-25 17:38:50 +08:00
christopherlam
d711cc35f8 Bug 639049 - Asset Barchart Report includes also the first day of next month transactions
If the original date is an end-of-month date, we take it as an
indicator they always want monthdelta dates to be end-of-months.

This works for monthly/quarterly/halfyearly/annual.

Addendum to commit 65bfeaf5de which was
deemed to be an incomplete fix.

Also I'd forgotten to activate a test in test-date-utilities. Enable it.
2019-03-21 19:44:33 +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
4f0e9a5168 [options] gnc:warn when looking up old option names
the option lookup mechanism will dynamically translate option
names. warn the user if this takes place so that the report writer may
use new option names.
2019-02-19 22:28:12 +08:00
Christopher Lam
a4789fcac5 bugfix: fix crasher when loading saved-report with unknown choices.
If a saved-report with e.g. relative date, multichoice option is
unknown, the report would crash, and the Report-Options would
segfault. This commit fixes both: report-date defaults to 'today',
multichoice-options defaults to default-value.

Following this commit, if a report loads a saved-report or .gcm from a
future version, a gnc:warn will be emitted and the report will not
crash; it will use relative-date today. Multichoice will remain the
default value. Report Options will not segfault.

The user will be notified via a gnc:gui-warn dialog
2019-02-17 11:25:06 +08:00
Christopher Lam
65bfeaf5de [date-utilities] bugfix: date-intervals produces good month deltas
Instead of recursing the date, we calculate the next month using an
index-based multiplier, and apply modulo/remainder as appropriate to
determine the next month/year.

Then we attempt to create new mktime, and if the resulting mktime's
month is not as expected, reduce the mday by 1 until resulting month
is correct. This fixes monthly intervals for end-of-month days.

Test via monthly/quarterly deltas, and also includes leapyear
calculation.
2019-02-13 22:23:44 +08:00
Alex Aycinena
7d0adfd0c6 remove unnecessary KVPs and frames related to US Income Tax name and type 2019-01-27 15:58:46 -08:00
John Ralls
84d1c3645d Use NULL, not '\0', to set a char* argument to NULL. 2019-01-25 12:52:14 -08:00
Alex Aycinena
fc15364326 remove unnecesary 'home' level in path for US Income Tax book tax information 2019-01-24 18:36:13 -08:00
Christopher Lam
0d4575da6c [income-gst-statement] rename options
Further commit to fix 3466ce78b

Discussion as follows
https://code.gnucash.org/logs/2018/12/27.html#T12:31:58
https://code.gnucash.org/logs/2018/12/28.html#T19:12:18
2018-12-29 04:03:45 +01:00
Geert Janssens
d22e1db340 gnc-uri - refer to 'scheme' instead of 'protocol' as that's the more formal term used in uris
This involves renaming 3 functions:
gnc_uri_get_protocol -> gnc_uri_get_scheme
gnc_uri_is_known_protocol -> gnc_uri_is_known_scheme
gnc_uri_is_file_protocol -> gnc_uri_is_file_scheme

The *_protocol variants are marked as deprecated.
Additionally a number of local variables have been renamed from
protocol to scheme to support this change.
2018-12-27 22:33:17 +01:00
Geert Janssens
4b398325ea Redesign gnc-uri-utils
- gnc_uri_get_components will now return NULL as protocol if the input is a normal
  file system path instead of a uri (it used to return 'file')
- gnc_uri_get_protocol will now return NULL if the input is a normal
  file system path instead of a uri (it used to return 'file')
- gnc_uri_is_file_protocol now returns FALSE if protocol is NULL (it used to return TRUE)
- gnc_uri_is_file_uri now returns FALSE if input is a normal file
  system path instead of a uri (it used to return TRUE)
- a new function gnc_uri_targets_local_fs will return TRUE only if its input
  is either a file uri or a normal file system path. This function is now mostly
  used instead of gnc_uri_is_file_uri in the current code base
- a new function gnc_uri_is_uri is added to check whether its input
  is a valid uri (has protocol, path and hostname for non-file uris)
2018-12-27 20:53:33 +01:00
John Ralls
bf55c30aeb Fix most of the unused assignment errors from static analysis.
There are a very few left that need deeper study, but this gets
rid of most of the noise. For the most part it's just getting rid of
extra variables or removing an assignment that is always
replaced later but before any reads of the variable. A few are
discarded result variables.
2018-11-30 15:08:41 +09:00
John Ralls
24ce92056d Protect from potential nullptr dereferences.
pmtsched is created in only one banch of the opening switch.
Found by clang static analyzer.
2018-11-30 15:08:41 +09:00
John Ralls
faba7975ac Fix a bunch of memory allocation errors found by clang static analysis. 2018-11-30 15:08:41 +09:00
Geert Janssens
cd04e805e3 Bug 796919 - Leading '+' character not accepted in amount when value surrounded by quotes
Use a variant of xaccParseAmount that allows to ignore the locale's positive_sign character
or the + sign if locale doesn't define a positive_sign character.

In a future redesign it would probably be better to replace use
of xaccParseAmount with some variant of the gnc-expression-parser
but that would require more that a few tweaks to get right.
2018-11-18 17:23:14 +01:00
Geert Janssens
f13d21b973 Bug 498072 - GnuCash show taxes on invoice when individual taxes is not checked
Use more descriptive option name and tool tip as proposed in the bug.
2018-11-18 15:38:59 +01:00
Geert Janssens
406953c2ae Bug 796820 - References to 'Gnome Bugzilla' should be changed to 'GnuCash Bugzilla'
Additionally use https everywhere to refer to bugs.gnucash.org or bugzilla.gnome.org
2018-09-28 15:00:43 +02:00
John Ralls
26714d2e17 Bug 792446 - Mixed languages in error dialog. 2018-09-27 18:05:42 -07:00
Robert Fewell
b6f2b111bc Block registered prefs when preference dialogue loaded
When the preference dialogue is loaded and options are set, the ones
with registered callbacks fire causing parts of Gnucash to be updated.
This was observed with gnc_split_register_load being executed 5 times
for each open register when the preference dialogue was loaded.

To overcome this, a couple of functions have been created to block and
unblock all registered prefs and used while the preference dialogue is
loaded.
2018-09-27 15:57:34 +01:00
Geert Janssens
48b29f5e91 Fix memory leak in char* type KvpValue and fix improper uses
The core issue was that the delete visitor was never called because its parameter
type (char *) didn't match the boost::variant type (const char *).
Fixing the visitor's parameter type also require a const_cast
back to char * because that's what g_free takes as argument.

The rest of this commit is merely fixing KvpValue instantiations that
tried to create a char* KvpValue from a stack based const string instead
of a heap allocated one. That would bomb out on calling the
delete visitor.
2018-09-10 19:49:43 +02:00
Geert Janssens
3634e8f59d Fix memory leak using qof_instance_get on a GncGUID
The underlying boxed type will return a copy so we should free this
when no longer needed.
2018-09-09 22:50:05 +02:00
John Ralls
b05082a09d Merge Chris Lam's consolidated invoice report into maint. 2018-09-08 14:43:33 -07:00