from .../gnucash-4.8/libgnucash/app-utils/gnc-quotes.cpp:33:
/usr/include/boost/bind.hpp:36:1: note: ‘#pragma message:
The practice of declaring the Bind placeholders (_1, _2, ...) in the
global namespace is deprecated.
Please use <boost/bind/bind.hpp> + using namespace boost::placeholders,
or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
The issue was fixed in boost 1.76, but, e.g ubuntu 22.04 has boost 1.74
The idea behind this is to not assume the project is always built
as "gnucash" exactly.
One example where it can be useful to use a different project name
would be when building multiple development versions of the project
on the same system and don't want these different versions share
the same settings in GSettings or the same stored passwords.
When higher and lower limits are zero, when used for a a suspense
account, change the icon to 'dialog-warning'. This type of use is to
indicate that a non zero balance exists.
Root cause is using boost::locale::translate because it ignores
the LANGUAGES environment variable and doesn't support different
values for LC_MESSAGES, LC_DATE, LC_MONETARY, and LC_NUMERIC.
That makes it impossible to configure a user environment that
presents translated strings in a different locale from the one
applied to formatting dates and numbers.
To correct this replace all use of boost::locale::translate
with GNU gettext.
Don't create a new book in the new-user dialog unless the user says to.
Don't automatically create a new book when retrieving default commodities
because the retrieve might be requested in a context like the Preferences
dialog when there is no book.
Some report tests relied on requesting the default commodity creating
the book, so in those tests ensure that the book is created first.
Control character check doesn't need normalization, the control character
codepoints aren't graphic and so can't be composed nor have compatible
equivalents.
There were two issues here, the first one was that the copied doclink
was pointing to the original doclink which lead to a double-free. The
second is the setting of the doclink on the copied invoice needs to be
done with gncInvoiceSetDocLink otherwise on closure the doclink value
will disappear.
- avoid hashing Account* twice. one call to operator[] is sufficient.
- don't need use std::move with better constructors
- sanity check - can't have a budget with num_periods = 0
- remove unused headers
- don't need to create/destroy GHashTable for each feature query
- plugs leak: g_hash_table_unref (features_used) not always called properly
- to check 1 feature, don't need to traverse whole GHashTable
By embedding a minimal Info.plist with a bundle ID into the executable.
This necessitated a change to binreloc because the unix-style install
depended on there being a bundle ID only when the program was run from
an application bundle.
Plus there's no need for a "not found" version string because GncQuotes
construction will throw if Finance::Quote isn't correctly installed. No
object, nothing to call version() on.
With XCode 14 or newer CMake tries to use the "new build system" which has a
requirement that if two targets depend on the same generated file one of them
must depend on the other. This commit adds reduntant dependencies to satisfy
this requirement.
A check of the F::Q modules found that the only ones that return a quote
time return a bogus one and do so only to mollify GnuCash.
Since there's no good way to determine the TZ of the exchange originating
the quote there's no good way to decide if the quote is current or from
a previous market session, so we just punt and use a time of 16:00 for
all quotes.
Allows for cleaner code with less state, less coupling of the GncQuotes
class, and better transfer of error messages to client code.
Also translates some error messages for presentation to users.
Provide a specialization GncFQQuoteSource and move the F::Q command
construction and query functions to GncFQQuoteSource.
This allows for dependency injection to provide testing that doesn't
need F::Q to be installed.
- make more use of auto
- mark user visible strings as translatable
- return early on input errors
- fix date conversion fallback to actually fall back to today
The book parameter is only needed while fetching quotes.
In case the user passes one or more commodities to process
the book can be readily derived from the commodity/commodities.
In the other case (fetch all quotes) the user now is
required to pass a book to the call.
This code will convert the json data into GncPrice objects and add them
to the pricedb, effectively doing what price-quotes.scm does.
A few notable remarks:
- still requires plenty of cleaning up. This is the first proof of concept
- like the original scm based code, this parser completely ignores timezone
information. As it wasn't used before and nobody complained, it may not
be that important. Or it can be implemented later.
- price-quotes.scm would first check if a price already existed in the pricedb
and try to update that one instead of adding one (only if the old price's
type is inferior). However that is redundant as gnc_pricedb_add_price does
the same check. So I have omitted this extra check from GncQuotes.
- currency quotes can be inverted. I have slightly changed the way to handle
this. The perl wrapper code will simply set an "inverted" flag in that case,
but will otherwise not swap currency and commodity as it used to be the case.
On parsing, the inversion flag will cause the GncNumeric that's parsed from
the price to be inverted. As it's still a GncNumeric that shouldn't result
in any loss of precision, while keeping prices in the db always in the default
currency.
That allows the private implementation to pass a number of variables
based on various boost libraries. It's better to not have them in
the public interface to keep compilation times down.
For all but the basic check a book is required. Might
as well be able to pass it directly and store a reference
to it. That will simplify member function declarations.
I have been reading on singleton implementations and there appears
to be a lot of pushback against those.
We can revisit this if it turns out performance degrades
significantly by running the F::Q check multiple times.
This rewritten version takes JSON input and spits out JSON.
Additionally inverted currency quotes will only be flagged.
The old code also swapped currencies in the result.
GncQuotes will be written towards these new implementation
choices.
At the same time do an explicit reinstantiation of quotes_cached at first use
to work around what seems to be a race condition between static instantiation
and binreloc.
This library intends to wrap Finance::Quote the way price-quotes.scm currently does.
In this first commit the library replaces price-quotes.scm's library to install
quote sources. In addition it exposes a new command line parameter in gnucash-cli
to show which version of Finance::Quote is installed on the system (if any) and
which quotes sources that verions exposes.
Instead of using static_assert. This prevents the compiler from even
trying and avoids weird compilation errors when testing types for
instantiating other templates.
The compiler complains that there's no matching
gnc_register_number_range_option for GncOptionDB*, which without this
commit is true because the explicit templates are for GncOptionDBPtr&.
Note that the original template definition is for GncOptionDB* and
that the header-defined inlines that take GncOptionDBPtr& call the
GncOptionDB* version.
Instead of using static_assert. This prevents the compiler from even
trying and avoids weird compilation errors when testing types for
instantiating other templates.
The compiler complains that there's no matching
gnc_register_number_range_option for GncOptionDB*, which without this
commit is true because the explicit templates are for GncOptionDBPtr&.
Note that the original template definition is for GncOptionDB* and
that the header-defined inlines that take GncOptionDBPtr& call the
GncOptionDB* version.
Because when loading the value the split in the xml backend doesn't yet
have a parent so the code tried to convert to GNC_COMMODITY_MAX_FRACTION
and if the numerator was larger than 10^10 that would overflow.
To fix it this changes the "don't know" response to get_currency_denom
and get_commodity_denom to GNC_DENOM_AUTO which will normally leave
the denominator alone.
Handle template transactions that don't have any splits with empty credit
and debit strings and those having no set transaction account.
Set the concrete transaction commodity to the first found of:
The template transaction's commodity
The commodity of the first split with a credit or debit string
The commodity of the first split.
Test these scheduled transactions:
* 2 splits with fixed amounts "123"
* 2 splits with fixed amounts "0"
* 2 splits with empty amounts ""
Verify that automatically created scheduled transactions exist.
Enables full functionality for complex-boolean and multichoice-callback
options.
Note that setter-function callback isn't used in any GnuCash code so it
is not implemented and is not present in the register-callback functions.
The root cause of which is that on recent releases of GLib (recent
meaning 2.66 in the current Debian stable!) g_type_instance_get_private
looks in the wrong place for the private data. When running the script
in question it returned NULL and since the code didn't check for a valid
pointer, it crashed.
So this change replaces all calls to g_type_instance_get_private with
the function [type_prefix]_get_instance_private() added in glib-2.36
except for two register2 files that have been removed from master; those
are ignored to avoid unnecessary merge conflicts.
This scrubbing function calls xaccTransRollbackEdit which is
leaky. Instead of trying to fix xaccTransRollbackEdit which requires
superhuman skills, it's easiest to track the changes separately in a
GList, and use xaccTransBeginEdit/xaccTransCommitEdit only if
necessary.
tests TXN_TYPE_NONE in utest-Transaction.c
testing TXN_TYPE_INVOICE, TXN_TYPE_PAYMENT, and TXN_TYPE_LINK will
require valid posted invoices, so, are best tested in utest-Invoice.c
When a top level bayesian entry is deleted, the book is not marked
dirty and so the save button is not highlighted. Deleting individual
entries did mark book dirty.
Fixed in gnc_account_delete_all_bayes_maps by wrapping the deletion
with xaccAccountBeginEdit/CommitEdit block.
These functions depend on both libgnc-app-utils and libgnucash-guile,
creating a circular dependency when the app-utils bindings are added to
libgnucash-guile.
day of fall change from Daylight Time to Standard Time.
Really any day where the period crosses the dst->std change, and
since the date dialog returns local midnight for the time that includes
the day of the change.
Convert both the parameter time and the return time to neutral time
to ensure that the interval is handled correctly.
With the accounting period preference settings set to 'Start/End of
previous quarter' and balance sheet report using 'End of accounting
period' the date is wrong, currently is 30/03/2022 when it should be
31/03/2022.
Simplify gnc_gdate_set_quarter_end to get correct last day and
subtract the 3 months befor calling said function.
With these changes the currency works but the commodity allows you to
set the commodity but will crash if you save config or leave report
open, this was tested on the 'Price scatter plot' report. Fixed with
John's commit a8e6a59
The GncOptionRangeValue can be used with integers or doubles, the
default being doubles. When used for setting the plot width/height,
integers are used so all ValueTypes need to be integers other wise
the when create_range_spinner is used you end up with the upper_bound
value being G_MAXDOUBLE, a 309 character wide spin button. To
differentiate the two, use 'set_alternate(true)' for integers.
The new plot setting does both settings, values above 100 are treated
as pixels and ones below are treated as a percentage. This means the
maximum valid setting must be higher and also the tooltip needs to be
changed.
Found via `codespell -q 3 -S *.po,./po,*.min.js,./ChangeLog*,./NEWS,./borrowed,./doc/README*,./AUTHORS,./libgnucash/tax/us/txf-de*,./data/accounts -L ans,ba,cas,dragable,gae,iff,iif,mut,nd,numer,parm,parms,startd,stoll`
The Book Options, counter formats were being stored under the 'options'
tree but need to be stored in the 'counter_format' tree similar to the
'counters' tree.
.
Because March has more days than February the previous month offset was
getting normalized back to the current month--th 29 February this
year is really 1 March, so normalizing before setting the day caused
begin/end previous month to return the begin/end of the current month.
That probably happened on the 31st of May, July, October, and December
as well, I just hadn't managed to test on those days. Switching the
normalization to after calculating the day of the month broke the
previous quarter calculation because now the month was out of range, so
normalize month & year first.
Separate the "All noncurrency" convenience category in the commodity
selector and the default non-commodity namespace proposed by the QIF
importer because they have different functions.
Also remove the namespace guessing code from qif-dialog because with
only one default non-currency namespace there's nothing to guess.
The changes 09296dfb96, 1373233cd0 and 189db58e6 had caused
inconsistencies. Best restore original guile variable names using
underscore, bound to strings instead of functions returning strings.
When Gnucash is run in Hebrew which is a RTL language, on the accounts
page the tree view is displaying the required number as the following...
TreeView entry is '1,500.00 ₪' or '-1,500.00 ₪'
TreeModel string is '₪ 1,500.00' or '₪ 1,500.00-'
This seems to be down to the GTK 'Unicode Bidirectional Text Algorithm'
which is changing the representation of the model string based on the
first strongly typed character, in this case the Israeli shekel sign.
To fix this, when creating the displayed monetary amount insert a BiDi
ltr isolate uni-character at the start of the string.
Converting them to pointers for Scheme to use. Prevents
dangling pointers when the user deletes a QofInstance as long as the
Scheme report code re-fetches its pointers from the options when it's
regenerated.
Leave it to users to categorize their non-currency commodities. In the
QIF importer default non-classifiable commodities to
GNC_COMMODITY_NS_NONCURRENCY.