Commit Graph

21997 Commits

Author SHA1 Message Date
Robert Fewell
e4ac6b480f Merge branch 'maint' 2019-12-12 16:33:34 +00:00
Christopher Lam
b372f28829 [test-owner-report] initial tests new-owner-report
mainly tests amounts being displayed are correct
2019-12-12 22:27:24 +08:00
Christopher Lam
670811455d [report-utilities] bugfix: aging-list was incorrect. off-by-1 error.
off-by-1 error in aging-list dates.
2019-12-12 22:27:24 +08:00
Christopher Lam
1c605a6b10 [report-utilities] bugfix: overpayment works for AP accounts
and fix comment from 5f6b9946d.
2019-12-12 22:27:09 +08:00
Robert Fewell
cac155a97c Swap the buttons around on the Budget Open dialogue
Swap the OK and Cancel buttons so they conform to the normal layout.
2019-12-11 15:16:48 +00:00
Robert Fewell
8e155bfccf Change the spacing in files gnc-plugin-page-budget.* 2019-12-11 15:16:48 +00:00
Robert Fewell
1320b79dc7 Change the spacing in files gnc-plugin-budget.* 2019-12-11 15:16:48 +00:00
Robert Fewell
eb7810788b Missing g_strfreev in gnc-plugin-page-report for keys value 2019-12-11 15:16:48 +00:00
Robert Fewell
803d4c511e Bug 797489 - No option to use account codes in Budget View - Part1
In the budget view there is no option to add the account code column
which some uses use for sorting their accounts. This commit introduces
a feature flag to be used in version 4.0 but if set in 3.8 will hide
the new account code column so the view is not disrupted.
2019-12-11 15:16:48 +00:00
Robert Fewell
d0727a1bfb Bug797519 - Budget Viewer Totals do not redraw upon to Sign-Reversal changes
Connect to the 'row-changed' signal for the account tree and do a
redraw on the totals tree view. Also fixes when changing the preference
for using negative amounts in red.
2019-12-11 15:16:48 +00:00
Robert Fewell
dc1881bd4b Make sure the same variable name is used for GncBudgetView
GncBudgetView was name differently through out the file so change all
uses to be the same.
2019-12-11 15:16:48 +00:00
Robert Fewell
4a4e0ae562 Change some spacing in source files gnc-budget-view.* 2019-12-11 15:16:48 +00:00
Christopher Lam
5f6b9946d4 [report-utilities] bugfix: fix overpayment detection
For 1 payment to >1 invoices, previous would miscalculate overpayment.

Old overpayment definition -- from the payment amount, successively
subtract the invoice totals. If remaining is >0, then this is
overpayment. But this fails whereby invoice was partially paid
elsewhere because the overpayment would miss them.

New overpayment definition -- the payment txn is analysed, and all
APAR-splits' lots are analysed. Any lot with no invoice is a
prepayment.

This is a simpler algorithm and does not require the creation and
searching of invoices-and-splits.
2019-12-11 21:37:12 +08:00
Christopher Lam
0212537cca [new-owner-report] bugfix: fix overpayment detection
For 1 payment to >1 invoices, previous would miscalculate overpayment.

Old overpayment definition -- from the payment amount, successively
subtract the invoice totals. If remaining is >0, then this is
overpayment. But this fails whereby invoice was partially paid
elsewhere because the overpayment would miss them.

New overpayment definition -- the payment txn is analysed, and all
APAR-splits' lots are analysed. Any lot with no invoice is a
prepayment.
2019-12-11 21:37:04 +08:00
Christopher Lam
3efb960daf Bug 797521 - Receivable Aging (beta): prepayments logic doesn't work, appears to use incorrect absolute value logic
Overpayments create at least 2 APAR splits (1 for each invoice, and 1
for the overpayment), they were processed multiple times.

Modify query to return unique transactions, thereby ensuring a payment
gets processed once only.
2019-12-11 16:08:17 +08:00
Christopher Lam
60765e388a Bug 797279 - Reports RTL do not support RTL
RTL autodetect seems to rely on the report-title being RTL.
2019-12-09 19:31:31 +08:00
Christopher Lam
e40bee0ff6 [Bug 797520] Balance Sheet (Multicolumn) the retained earnings amount in the equity section has its sign reversed
c21bb66d6 had a regression: income-expense-balances was originally
negated, only to be negated again for use in retained-earnings-fn. The
previous change forgot to negate income-expense-balances.

This commit removes the negation before use of income-expense-balances
in retained-earnings-fn, thereby simplifying code.
2019-12-09 19:06:50 +08:00
Christopher Lam
279a5fcde8 Merge branch 'maint' 2019-12-08 20:34:49 +08:00
Geert Janssens
3b1b78d54c Drop a few left-over references to the deprecated gnc-module scheme wrapper 2019-12-07 21:05:58 +01:00
Christopher Lam
6266ca2f12 g_free() output of get_negative_color
because gdk_rgba_to_string() returns a newly-allocated string

* get_negative_color is gchar* instead of const gchar*
* move to dialog-utils.c
* rename get_negative_color() to get_negative_color_str() in
window-main-summarybar.c
* add g_free to gnc_tree_model_account_dispose ()
* modify code to g_free () after use
2019-12-07 21:03:11 +08:00
Christopher Lam
17bbf870e5 Bug 797401 - Invoice Reports need an overall page width set
Use html5 @media to set main-table to page width.
2019-12-07 21:03:11 +08:00
Geert Janssens
f52c581ddc Merge branch 'dropgml' 2019-12-07 09:15:48 +01:00
Geert Janssens
633f2e3001 Merge branch 'splitreg_copyops' 2019-12-07 09:15:39 +01:00
Geert Janssens
7f6367410e price quotes - move scm file from bindings to gnucash
This isn't wrapping anything really.
As discussed with John on PR#611
2019-12-06 20:38:21 +01:00
Geert Janssens
88706e5657 bindings/guile - remove gnc-module wrapper
Emit appropriate deprecation warnings in case code tries to invoke the removed functions.
Only for gnc:module-load a more elaborate compat function has
been written which should allow code using this obsolete function
to continue to function. The emitted deprecation warning will
guide the user to update his/her code for future compatibility.
2019-12-06 20:38:21 +01:00
Geert Janssens
e8451ae1db tax - remove gncmod boilerplate
This is now an ordinary shared library

* Remove test to load the gnc-module in scheme
* Rewrite test to load the module in C to actually test something.
2019-12-06 20:38:21 +01:00
Geert Janssens
c1493c8c85 cleanup - use guile's C interface to load modules when in C context
That should be slightly more efficient than having it first
parse a string.
2019-12-06 20:38:21 +01:00
Geert Janssens
d52aa0a0dd app-utils - remove gnc-module boilerplate
app-utils now is an ordinery shared library

A few bits worth mentioning:
1. it's not guile-free just yet, so instead of a gnc_module_load
   your code may have to call scm_c_use_module("gnucash app-utils");
   to expose the scm side of the app-utils api. This call has been
   added to gnucash-bin.c for example
2. while lots of noise in this commit is to rename from gncmodule-app-utils
   to gnc-app-utils, I'll point out the library has also been moved from
   <libdir>/gnucash to <libdir>. This required changes in app-util's
   CMakeLists.txt file for the install side and in the top level
   CMakeLists.txt file for the build directory structure.
3. The C side link module test has been removed as linking an ordinary
   shared library should be considered well tested by the compiler devs.
   The scheme side module load test has been slightly tweaked to no longer
   try to use gnc:module-load, but instead now checks whether the app-utils
   api is properly exposed to scheme after loading it via use-modules.
4. Dropped a completely obsolete README file.
2019-12-06 20:38:21 +01:00
Geert Janssens
90aa539908 app-utils - make gnc-expression-parser responsible for its own cleanup
It already ensured it would initialize on first use.
It can as well register the hooks it needs for its
cleanup directly itself instead of depending on the
module loading system to do so.
2019-12-06 20:38:21 +01:00
Geert Janssens
43647c7a54 app-utils - move component manager to gnome-utils
It's primary purpose is to track gui objects' lifetimes. There's no
need for libgnucash (a non-gui library) to deal with that.
This required two book options related gui-only call backs
to be moved to gnome-utils as well.
2019-12-06 20:38:21 +01:00
Geert Janssens
0de3dc6bf1 guile/bindings cleanup - only load module gnome-modules when really in use 2019-12-06 20:38:21 +01:00
Geert Janssens
4c77f7670e engine - remove gncmod boilerplate
engine is now an ordinary shared library

This requires a few more places to run gnc_engine_init as
this is no longer done as part of module loading.
2019-12-06 20:38:21 +01:00
Geert Janssens
95b81844ad Update documentation referring to the deprecated gnc:module wrapper 2019-12-06 20:38:21 +01:00
Geert Janssens
b96dc6ff89 html - expose wrapped api directly from a newly created html.scm
With that in place we no longer need to (gnc:module-load "gnucash/html" 0)
the html gncmodule. An ordinary (use-modules (gnucash html)) suffices

html.scm is newly created. It serves two purposes:
1. expose the swigified html api to scheme
2. ensure gnc_html_initialize is run before first use (in scheme) of the api
2019-12-06 20:38:21 +01:00
Geert Janssens
bd311d5dfb report - expose wrapped api directly from report-core.scm
With that in place we no longer need to (gnc:module-load "gnucash/report" 0)
the report gncmodule. An ordinary (use-modules (gnucash report)) suffices

Note: as gncmod-report did additional initialization, most reports
needed additional tweaks like using app-utils.
And in app-utils the initialization of the relative date terms
has been tweaked as well to run whenever the app-utils module
gets loaded first time, rather than having this initialized by
gncmod-report.
2019-12-06 20:38:21 +01:00
Geert Janssens
25cce83f29 gnome-utils - expose wrapped api directly from gnome-utils.scm
With that in place we no longer need to (gnc:module-load "gnucash/gnome-utils" 0)
the gnome-utils gncmodule. An ordinary (use-modules (gnucash gnome-utils)) suffices
2019-12-06 20:38:20 +01:00
Geert Janssens
ee722b85c1 bindings/guile cleanup - fold engine-utilities.scm into engine.scm
It was only exposed via engine.scm anyway and combining them
in one file eliminates one explicit load_extension and sw_engine call.
2019-12-06 20:38:20 +01:00
Geert Janssens
c00bf6bcdb app-utils - expose wrapped api directly from app-utils.scm
With that in place we no longer need to (gnc:module-load "gnucash/app-utils" 0)
the app-utils gncmodule. An ordinary (use-modules (gnucash app-utils)) suffices
2019-12-06 20:38:20 +01:00
Geert Janssens
5a650ad566 gnc-module - fix test build on Windows 2019-12-06 20:38:20 +01:00
Geert Janssens
63e89aecf7 gnc-module - fix incompatdep test
The test passed but for the wrong reasons:
as no GNC_MODULE_PATH was passed to the test
it just didn't find the module. That's different
from finding a module with the same name but
a wrong sysver. This commit fixes that.
2019-12-06 19:59:12 +01:00
Geert Janssens
043c6367a5 gnc-module test updates
- move test modules into a subdirectory on Windows as well
- move the futuremod module into its own subdirectory
  to avoid its load warnings each time gnc_module_init is called
  That also tends to happen when building guile modules.
- remove the log handlers filtering out the futuremodsys warnings
  They didn't match the actual warning signature anyway and
  they're no longer emitted during testing
2019-12-06 19:59:12 +01:00
Geert Janssens
8aed43ec55 gnc-module - drop redundant extra_dist specificiation
There was only the README left in this list and that was already in
the local dist list by itself
2019-12-06 19:59:12 +01:00
Geert Janssens
2c61662113 gnc-module - remove guile traces from c-interface tests and examples
None of them still depend on guile.
2019-12-06 19:59:12 +01:00
Geert Janssens
331039cdcc gnc-module - expand c-interface load test and make it guile independent 2019-12-06 19:59:12 +01:00
Geert Janssens
fbd73c83cf gnc-module - move most of scm tests to bindings/guile
This is a first rudimentary separation of gnc-module tests
based on whether they require guile or not. Needs plenty of refinement
which will be applied in followup commits.
2019-12-06 19:59:12 +01:00
Geert Janssens
6eb0ccfa11 gnc-module - move guile wrappers to bindings/guile 2019-12-06 19:59:12 +01:00
Geert Janssens
096a515154 bindings/guile - fix typos in error messages
These were imported verbatim from libgnucash/app-utils/guile-util.c
2019-12-06 19:59:12 +01:00
Geert Janssens
6a3505d01f app-utils - move price-quotes support functions directly into bindings
- wrappers for glib functions go into glib-guile
- engine convenience functions go into gnc-engine-guile
2019-12-06 19:59:12 +01:00
Geert Janssens
9ed9621363 app-utils - remove unused guile includes 2019-12-06 19:59:12 +01:00
Geert Janssens
d777128e6f app-utils - simplify and move gettext wrappers
1. Instead of creating a C wrapper around gettext to then wrap in
guile, use guile's builtin gettext support directly.

The code still defines the _ and N_ shorthands. However it doesn't
really warant a separate module just for these two shorthands.
Instead define them in core-utils. So all code wanting to use
_ or N_ in guile should now use the (gnucash core-utils) module.

The bulk of this commit is actually deleting the scm-gettext
target and using (gnucash core-utils) instead of (gnucash gettext).

2. As the definition of _ and N_ is removed from app-utils.scm,
the app-utils test for a functional N_ macro has been moved to a
new test file in the guile bindinds tests.

3. The (gnucash gettext) module has been deprecated. Use
(gnucash core-utils) from now on.
2019-12-06 19:59:12 +01:00