Commit Graph

379 Commits

Author SHA1 Message Date
Geert Janssens
e79e82edcf CMake - remove parameter repetition in else() and endif() statements
This follows Professional CMake's recommended practises
2020-02-05 11:38:14 +01:00
Geert Janssens
0131780b30 Add guile function to extract a lot's guid
Useful for debugging lot issues in reports.
2020-01-29 18:55:35 +08:00
Geert Janssens
073e47801d Drop useless ifdefs
The parameter it checks is always defined these days
2020-01-17 18:25:43 +01:00
Geert Janssens
d8a304c2c9 Housekeeping - reduce the number of PACKAGE and VERSION related cmake variables
This starts by setting the gnucash version number in the 'project' call.
This will result in a number of variables set by cmake. The remainder
of this commit is to reuse the auto-generated
PROJECT_NAME, PROJECT_VERSION, PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR, PROJECT_VERSION_PATCH and PROJECT_VERSION_TWEAK
instead of all the various instances of PACKAGE, GNUCASH_MAJOR_VERSION
and so on.

One parameter is worth mentioning - GETTEXT_PACKAGE
GnuCash is not using this directly (any more) but it has to be set before
including gi18n-lib.h.
2020-01-17 18:15:27 +01:00
Christopher Lam
c4ab772d4b Bug 797576 - xaccAccountOrder shouldn't sort account codes as base-36
Thanks to yegor for discovering it is unreliable for sorting. It has
been present since 50646f04
2020-01-15 18:25:16 +08:00
John Ralls
df92200c8e Restrict gnucash.pot comment collection to ones beginning with Translators.
On recommendation of the Translation Project's Benno Schulenberg.

Required re-annotating some comments. Also removed several comments
about leaving a line break to prevent inserting it into gnucash.pot.
That didn't actually work: they were inserted anyway.
2020-01-04 15:57:02 -08:00
Daniel Dittmann
31c0fed1dc test_gnc_setlocale: use trailing whitespaces 2020-01-02 14:02:04 +01:00
Daniel Dittmann
5c478713d6 test_gnc_setlocale: add missing whitespaces to diagnostic message 2019-12-30 00:38:09 +01:00
John Ralls
d51b4d7f08 Bug 797532 - Crash/Coredump Lots
Replace the asserts in cap-gains.c with g_return_val_if_fail. There's
nothing about cap-gains.c that justifies crashing the program.
2019-12-28 13:36:11 -08:00
Geert Janssens
cd8698321d Bug 797482 - Can't edit date when using Edit Payment function 2019-12-27 18:38:55 +01:00
Christopher Lam
8fb73c7ed1 [gnc-lot.h] amend description for gnc_lot_get_earliest_split
this function doesn't necessarily point to the lot opening split.
2019-12-24 16:43:55 +07:00
Christopher Lam
5ebbb74435 [new-owner-report] invoice->payments displays lot links
Change of algorithm to display invoice->payments.

Previously: invoice->lot->splitlist; filtered to payments; retrieve
splits->parent->xaccPaymentAcctSplitList This would find payment
splits in originating currency.

But this fails for lot-link txns whose PaymentAcctSplitList is null.

New algorithm:

- invoice->lot->split-list, each lot-split analysed

- TXN-TYPE-PAYMENT lot-splits will query TransferAcct and each will be
rendered in the originating currency, if they haven't been encountered
before in this invoice.

- TXN-TYPE-LINK lot-splits are rendered as a generic 'Offset
Documents' link to lot-link splits. This helps link invoice to the
link transaction to locate the corresponding credit-note. It is not
possible to link to the corresponding credit-note because a
link-transaction can group many invoices to many credit-notes.

Also:

Increase right-hand-side links from 3 to 4 columns. I think it's quite
useful to add 'Credit Note' 'Invoice' 'Payment' as a separate
column.
2019-12-24 10:55:26 +07: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
Christopher Lam
ded336f987 [gnc-features] enable reading of unreversed budgets 2019-12-05 17:26:46 +08:00
Christopher Lam
c06191a656 Transaction.c: avoid slow g_list_nth_data 2019-12-05 13:06:11 +08:00
Christopher Lam
2df672bdb2 [gncOwner] i18n gncOwnerGetTypeString types 2019-11-02 09:05:22 +08:00
Christopher Lam
644cb4100e [gncOwner] add gncOwnerGetTypeString returns owner-type
* will have several uses
2019-10-28 20:18:47 +08:00
Christopher Lam
b2fcfbd3c6 Bug 797326 - Enhancement: budget's Estimate tool should ignore Closing Entries
Addendum to 8b8c957ed -- if budgeted amounts exclude closing entries,
actual amounts should also exclude closing entries.

Amend documentation, modify budget test to add a closing entry which
will be ignored.
2019-10-25 18:27:47 +08:00
John Ralls
1dc22e53c5 Fix test_xaccTransEqual.
Needed to make the noclosing_balances equal to get the balance-equality test to pass.
2019-10-23 20:09:40 +08:00
Christopher Lam
198570d8c8 Bug 797390 - xaccAccountRecomputeBalance also tallies no-closing balances
Add a few API, enough for fixing bug 797326 easily.
2019-10-23 20:09:40 +08:00
Christopher Lam
c6195d6e7a [test-budget] centralize gnc:create-budget-and-transactions
it will be reused by test-stress-options
2019-10-03 08:23:29 +08:00
Christopher Lam
22cdd237f1 [test-portfolios] initial commit
1.1.1980 seed $10,000
1.2.1980 buy 1 AAPL @ $100
1.3.1980 buy 1 AAPL @ $200
1.5.1980 sell 1 AAPL @ $400, FIFO capgain = $300, less $10 fee
1.10.1980 1:10 stock split 1 to 10 AAPL, price now $40
1.11.1980 1:10 stock split 10 to 100 AAPL, price now $4
1.12.1980 3:1 stock split 100 to 33 AAPL, price now $12;
          cash-in-lieu for 1/3 AAPL = $4

tests both portfolio.scm and advanced-portfolio.csm
tests report output using average/fifo/lifo

pending: DRP etc
2019-09-24 23:07:47 +08:00
John Ralls
c23f3f05e3 Fix deprecated G_TYPE_INSTANCE_GET_PRIVATE and G_INLINE_FUNC
with the function/declaration that they substituted.
Note that this doesn't use the recommended new GObject creation macros
because the class names in libgnucash/engine don't follow the gnome
naming convention.
2019-09-12 15:25:42 -07:00
Frank H. Ellenberger
fa4fc551af Remove obsolete "disambiguation prefix" translator comments
https://lists.gnucash.org/pipermail/gnucash-devel/2019-September/044199.html

Continuation of commit d30fe7a
2019-09-10 00:13:01 +02:00
John Ralls
e6e2258a74 Bug 797356 - ninja check fails with GCC-9 2019-09-09 14:44:10 -07:00
Robert Fewell
d677e3c5df Do not log an error when no default tax tables set 2019-08-29 11:27:10 +01:00
John Ralls
f00777ca07 Add scm-srfi64-extras and scm-qif-import as check dependencies
Fixes make check when make all hasn't been run.
2019-08-27 11:50:25 -07:00
Craig
04aab7cea3 Correctly parse decimals between 0 and -1.
The negative sign was being lost because stoll("-0") is 0.
Also permits parsing decimals between -1 and 1 without the leading 0.
2019-08-25 15:50:29 -07:00
John Ralls
fcc1653822 Replace overly indirect gnc_business_get_default_tax_table.
With gncTaxTableGetDefault.

qof_book_get_default_tax_table would have been even better but it
would have created a circular dependency between QofBook and
GncTaxTable.
2019-08-22 12:30:33 -07:00
John Ralls
8eb3819a3c Merge Christian Gruber's 'rework_gtest_src' into maint. 2019-08-15 15:18:07 -07:00
John Ralls
24d4576617 Include libicu-i18n in libgncmod-engine linkage for new ICU API usage. 2019-08-15 15:17:16 -07:00
Christian Gruber
1b4e481296 Add gtest_main.cc to libgtest.a
Currently when compiling GoogleTest from source code, source file
gtest_main.cc from GoogleTest repository is not compiled into any
library as in GoogleTest repository, where it is compiled into
libgtest_main.a. Instead gtest_main.cc is added to source file list
GTEST_SRC, which is then added to the list of source files of every
single GoogleTest based test application.

To simplify this gtest_main.cc is added to the source file list of
target gtest now. Additionally GTEST_SRC is merged into
lib_gtest_SOURCES, since both variables defined source files for
GoogleTest libraries.

Now target gtest generates library libgtest.a, which already contains
the main function from source file gtest_main.cc. This is different to
GoogleTest build system, where both are separated into two independent
libraries libgtest.a and libgtest_main.a.
2019-08-15 23:20:45 +02:00
Geert Janssens
ec6602adf9 [gnc-date][API] find locale's start of week using ICU.
gnc_start_of_week

* ICU has a mature C++ api, so prefer that one in our C++ code
* Use PERR instead of fprintf for consistent reporting
* Add the ICU specific linker flags to the test case
2019-08-15 13:18:43 +08:00
Frank H. Ellenberger
a0a0ffbb77 Bug 797319 - Mauritanian ouguiya MRO shows too few decimals
Add info about cash vs. banking
2019-07-25 23:51:50 +02:00
Frank H. Ellenberger
c77607c8c0 Bug 797316 - New Mauritanian ouguiya MRU not supported
Add info, which Mauritanian ouguiya is recent
2019-07-25 23:33:42 +02:00
Christopher Lam
a4811b3b46 [test-extras] add (create-test-invoice-data) for tests
this function creates some business data. moved from test-invoice.scm
without the invoice-specific tests. verified all invoices/bills are
created correctly.

it returns a vector-list of the 8 invoices generated.
2019-07-24 20:01:02 +08:00
John Ralls
ca87572a2c Bug 797319 - Mauritanian ouguiya MRO shows too few decimals
Changed MRO smallest-fraction to 100 based on information provided
by the reporter. ISO4217 has moved the MRO to the "Historical Currencies"
list that doesn't include CcyMnrUnits.
2019-07-23 09:42:43 -07:00
John Ralls
b02f7ac409 Bug 797316 - New Mauritanian ouguiya MRU not supported
Add new MRU with info from
https://www.currency-iso.org/dam/downloads/lists/list_one.xml
2019-07-23 09:42:28 -07:00
Christopher Lam
fdeff65f06 [business-core] refactor & document gnc:owner-from-split
This function helps to establish UI link from register split to an
owner's split. It should not be used anywhere else. Its use in reports
will be removed.

It is also unnecessarily complex -- it is called from an AP/AR account
register split, it should have all necessary information via split
metadata. e.g. this function *can* return a split owner if originating
from an Asset/Liability account which settles an invoice, but this
functionality is not used because there is no asset/liability register
hook to call it.
2019-07-20 21:10:08 +08:00
Christopher Lam
d0bf4ad8ae [test-business-core] add to dist_list 2019-07-20 21:10:08 +08:00
Christopher Lam
0c433e02f7 [business-core] deprecate gnc:entry-type-percent-p
This function is only used once. deprecate it.
2019-07-19 22:22:28 +08:00
Christopher Lam
e654bd34af [business-core] simplify functions 2019-07-19 22:22:28 +08:00
Christopher Lam
57f291af86 [test-business-core] initial commit 2019-07-19 02:50:24 +08:00
Christopher Lam
429077ee8e completion wrap qoflog 2019-07-07 08:41:13 +08:00
Christopher Lam
898a9cdb8e wrap qoflog 2019-07-06 11:15:18 +08: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
Geert Janssens
4ffc4d046f GncEntry - Fix inverted comparison 2019-05-28 17:19:29 +02:00
John Ralls
2d4f771bed Merge Adrién Panella's 'budget' into maint. 2019-05-23 09:50:20 -07:00
Adrian Panella
5bb54d073c [budget] Fix error in qof_book property path
The "Default budget" property had an erroneus path
and was not returning any value.
2019-05-17 23:12:19 -05:00
John Ralls
217418bb8c Merge Adrián Panella's 'numeric' into maint. 2019-05-14 10:09:16 -07:00