Commit Graph

17898 Commits

Author SHA1 Message Date
Robert Fewell
a8ebc794ab Bug388500 - Add option to remove deleted files from the history list
If a file is opened from the history list and does not exist the dialog
advises of this and asks if it should be removed from the list. If a
file is opened from the command line and does not exist, the normal
dialog is used
2017-03-16 20:21:12 +01:00
Geert Janssens
954110c479 Fixup last commit
This fixup was accidentally merged in another private branch of mine
rather than in the previous commit...
2017-03-16 19:52:52 +01:00
Geert Janssens
86fbcb0892 Csv Import - drop another reference to the no longer used lib/stf 2017-03-15 19:23:22 +01:00
Geert Janssens
dd9b8adc2a Csv Import - Fix doxygen comment 2017-03-15 19:23:22 +01:00
John Ralls
2b4137c566 Fix up building on MinGW with autotools. 2017-03-14 21:27:12 -07:00
John Ralls
3cb044c8fc Adjust locale test so that it works on both Ubuntu and MacOS. 2017-03-14 21:26:20 -07:00
John Ralls
f795d7ff59 Fix missing fi in configure.ac. 2017-03-13 12:16:25 -07:00
John Ralls
744fc29680 Require ICU.
Note that Boost::regex and Boost::locale must also be built with ICU
support.
2017-03-13 11:56:33 -07:00
John Ralls
a44c621f2b Change 'uint' to 'uint32_t'.
'uint' is a non-standard typedef not supported by MinGW.
2017-03-13 11:56:32 -07:00
Christoph Rohland
d9303023e0 Fix logic error for discounts
Got it all wrong before. Don’t use to complex expressions!
2017-03-11 15:58:21 +01:00
Christoph Rohland
8c8af54420 Fix taxinvoice for bill entries with taxes
taxinvoice was throwing an exception when there were taxes on bill entries.
It also did scan the invoice parts to determine if there were taxes and discounts.
2017-03-11 15:58:21 +01:00
Christoph Rohland
9d57447fe1 Let taxinvoice optionally show the net instead of the given price
This is needed if there is a mix of entries with tax included and
excluded
2017-03-11 15:58:21 +01:00
Geert Janssens
6bba55128f Merge branch 'maint' 2017-03-11 15:57:44 +01:00
Christoph Rohland
4949499bd4 Charge back net value of bill entries in invoices
When charging entries from bills we need to exclude taxes since the tax
rate of the invoice might be different than that of the bill.

This fixes Bug 776380 - Gross value of bills charged back instead of
net value (https://bugzilla.gnome.org/show_bug.cgi?id=776380)
2017-03-11 11:55:11 +01:00
John Ralls
80e64a1296 Fix failed unit test from previous commit. 2017-03-10 14:23:20 -08:00
John Ralls
3889606dd6 Bug 779217 - Transactions rounded to 5 decimal places when opening file.
xaccSplitSetValue and xaccSplitSetAmount round to the denominator found by
get_currency_denom and get_commodity_denom. The problem was that if the
commodity was unfindable because either the split’s parent or account hadn’t
been set (as is the case during loading, because the parent isn’t yet complete)
the returned denominator would be 100000, smaller than the max supported.
That would cause the value/amount to be prematurely rounded.
2017-03-10 13:21:02 -08:00
John Ralls
bc50f3da00 Bug 777949 - Accounts implicitly created in ledger attempt creation twice
Guard against recursively calling the account doesn’t exist query or creation
dialog if one is already in the account creation dialog.

The underlying problem is that creating the dialog forces a UI update that
in turn sets the cell value and checks for the existence of the account.
In basic view the cell being displayed (“transfer”) isn’t the one being
changed (“account”) so the account check isn’t invoked, but in
multi-split view the “account” cell *is* displayed so the check is invoked
again.
2017-03-10 10:54:22 -08:00
John Ralls
97598c4306 Bug 776564 - Creating a scheduled transaction from an existing...
transaction does not include the notes field.

In fact, notes support was entirely missing from scheduled transactions.
2017-03-09 11:38:42 -08:00
Geert Janssens
03ff5d3778 Allow only date entry for opening balances on new accounts
This anomaly was spotted by Christopher Lam
2017-03-04 12:25:56 +01:00
Geert Janssens
be260a4305 Merge branch 'maint' 2017-03-04 10:28:31 +01:00
hcrohland
de360cabb3 Revert the taxinvoice.scm changes
Since they touch strings and user behavior they cannot go into maint.
The pull request now only includes the backend change. By that you can
easily tweak the invoice reports to show the net price.
2017-03-04 10:15:00 +01:00
hcrohland
3445ef8845 Make the net price option better compatible with master
Create one gncEntryGetPrice function which can create given price or
net price for both invoices and bills based on option parameters.
The master version of taxinvoice.eguile.scm needs this for bills too.
2017-03-04 10:14:55 +01:00
hcrohland
78c5203d8c Enable taxinvoice to show net price
Add gncEntryGetNetPrice
Create an option in taxinvoice to either use gncEntryGetNetPrice or
gncEntryGetPrice

So far taxinvoice would show net or gross prices dependent on the internal flag tax_included.
This is inconsistent for the reader of the invoice since there is no notion of that flag.
This patch adds the option to always show net prices.
It does not change the default behaviour even if I would consider it broken.
2017-03-04 10:14:48 +01:00
Geert Janssens
3e9d0c1fda Make older compilers happy by using std::isnan instead of isnan
Both forms apparently work on more recent compilers
2017-03-01 12:34:53 +01:00
Geert Janssens
8e09bae7c7 Remove redundant gtk_widget_show_all call 2017-03-01 12:29:40 +01:00
Robert Fewell
0078de0be3 Bug 778042 These are the script changes for jqplot reports.
I have added the resize function to all jqplot reports and an on load
function to bar and line charts. This last change is required when a
table is added to the report and the vertical scroll bar appears and
covers part of the plot. This was observed in the Gnucash and also when
opening the generated file in the gnome browser.
2017-03-01 11:45:37 +01:00
Robert Fewell
22191afb1e Bug 778042 Change the way reports are loaded in conjunction with script changes.
With these changes the reports are not created until the page is shown,
realized. It still uses the idle add to create the page but is started
from the realized call back. Doing it this way has the added advantage
that if the app is closed on a non report page, the next start up is
quicker as the reports are not created.
2017-03-01 11:45:35 +01:00
Geert Janssens
7a394321e2 Csv Import - Use GncNumeric rather than GncRational
This simplifies several lines of code.
2017-02-21 16:57:07 +01:00
Geert Janssens
c2f21f0162 Fix typo in GcnRational's + operator 2017-02-21 16:56:14 +01:00
Geert Janssens
7c041eb283 Fix gnc-numeric locale test on travis
- Change locale from de_DE to fr_FR.utf8
- Expect correct thousands separator

This also partly undoes the previous commit (it removes the
test for gcc 5 or more)
2017-02-21 16:49:48 +01:00
John Ralls
75e6a41bd7 Prevent localizing the decimal point in gcc<5.
Apparently gcc V4.8 provides a defective implementation of
std::locale which first doesn't support std::numpunct and second
throws the wrong exception type.

Unfortunately boost::locale isn't a solution because it uses the
gcc facets.

So for now, we don't compile that bit if gcc is too old.
2017-02-20 16:51:06 -08:00
John Ralls
cbe52dad34 Merge fetaure-branch 'numeric', provides GncNumeric C++ API. 2017-02-20 16:05:30 -08:00
John Ralls
e322457e45 Fix Geert’s code review comments.
Except the big one about string IO not being flexible enough.
2017-02-20 15:50:32 -08:00
John Ralls
a193b9a2c1 Fix documentation errors. 2017-02-20 15:50:32 -08:00
John Ralls
0b09b58cf6 Relax comparison test for GncRational::round_to_numeric
To allow for a difference of 1 on very large numbers (>1e16). At the
same time made the test harder with a wider range, skipping cases where
the result overflows. Use GncRational::valid() instead of testing
components for both overflow and NaN.
2017-02-20 15:50:32 -08:00
John Ralls
d0726de391 Replace std::regex with boost::regex.
Gcc's std::regex compiler doesn't correctly recognize capture blocks.
2017-02-20 15:50:32 -08:00
John Ralls
b60d6a8466 Add libgnc-qof to dependencies for test-numeric. 2017-02-20 15:50:32 -08:00
John Ralls
bff0e745fc Fix indentation error. 2017-02-20 15:50:32 -08:00
John Ralls
6220b85045 Remove a commented-out diagnostic. 2017-02-20 15:50:32 -08:00
John Ralls
ea44b16f54 Make the GncRational and GncNumeric APIs mostly identical.
Leaving string conversion and stream operators out of GncRational.
2017-02-20 15:50:32 -08:00
John Ralls
739c91a4cc Change GncRational::round to GncRational::convert.
With the same signature as the GncNumeric version.
2017-02-20 15:50:32 -08:00
John Ralls
e506f9a4a1 Make the rounding functions templates and move them to their own header. 2017-02-20 15:50:31 -08:00
John Ralls
0403a6667a Replace GncInt128’s flags variable with bit-stuffing in the high leg.
Loses three bits so GncInt128 becomes really a GncInt125, but we don’t
really need the single order-of-magnitude: 10**38 is big enough. Saves
a full word of memory for each GncInt128, which means 2 words for GncRational.
That’s a 33% saving in memory for 64-bit and makes the object size the
same (32 bytes) for all architectures.
2017-02-20 15:50:31 -08:00
John Ralls
c633e80a24 Convert GncRational to throw instead of using a status byte.
More consistent with GncNumeric and saves a word of memory per instance.
Still bleeping huge because the two GncInt128s each need 128 bits (2 or 4 words)
plus a word for status (for 3 bits!).
Also provide a couple of convenience functions, is_big() and valid() to
test if the either numerator and denominator is big or overflowed or NaN.
2017-02-20 15:50:31 -08:00
John Ralls
ff7e6a37d5 Reimplement gnc_numeric in terms of GncNumeric instead of GncRational.
Except when how has DenomType::exact; that triggers direct use of GncRational
and direct rounding to the specified denominator.
2017-02-20 15:50:31 -08:00
John Ralls
c3d22c429f Add GncRational test for GncRational::round_to_numeric().
Needed GncNumeric to be defined.
2017-02-20 15:50:31 -08:00
John Ralls
4a46ae3ddf Fix GncInt128 tests for older compilers. 2017-02-20 15:50:31 -08:00
John Ralls
a54edf1a5e Add GncRational(GncNumeric) constructor. 2017-02-20 15:50:31 -08:00
John Ralls
82fe06e390 Extract new class GncNumeric.
Similar to GncRational, except that it’s based on int64_t instead of
GncInt128 and throws instead of using a status byte.

Most calculations are performed using GncRational, the result is then
rounded (RoundType::half_down) to fit. GncRational should be used in
circumstances where the automatic rounding is undesirable.
2017-02-20 15:50:31 -08:00
John Ralls
4fef04c17b Remove #ifdef __cplusplus from gnu-numeric.cpp
It’s always compiled with C++.
2017-02-20 15:50:31 -08:00