This is about as far as I can go on the SQL/DBI backend without changes
to QofBackend, QofQuery, QofInstance, and the engine classes. The XML
backend needs the same OO treatment before that's possible, so that's
the next stage.
Fixing incorrect implementation in gnc-bill-term-sql and gnc-tax-table-sql,
where there was no test for the parent actually having been loaded.
Also #ifdef-out the starting balances part of GncSqlAccountBackend::load_all
and move its variable decls inside the ifdef as auto.
Added an option of "No Fancy Date Format" to date-format so it can be
the default. In this position, the format returned is that of what ever
the preference date is set to.
This is really just a copy of the number-range-option with some tests
for the saved value being a pair which is used in later versions. If the
pair is a pixel setting, then that value will be used, otherwise the
default value is used. Should any report get saved, the saved values
will be over written in the old format.
When you have reports open but they are not selected, resizing the
window does not always resize the hidden report views properly. Use
the expose call back so the reports are reloaded on expose event.
Added progress bar updates for refresh/reload button press and also for
when the options change. Created a new function to set progress bar
height from previous commit to be used for above changes.
When the report is run and the progress bar is updated, the height
changes and then changes back forcing the webkit view to change height
and ultimately use the wrong value.
The reason for webkit not using the full report area is that this area
has not been realized when the report is created and so webkit does not
know the correct size. By using the idle function, the page is created
and realized before loading the report with the added advantage the
progress bar updates on the blank report page.
- Update the lot list of the lot's account only when the account itself is not being destroyed
- Fix the test cases to accept the new (improved) lot destruction handling
Two parts to this bug:
1. never reverse signs in the free splits list. Sign reversals don't
make sense there.
2. Sign reversal only makes sense for capital gains, not for business
transactions. So only to the sign dance for non-business lots in the
list of splits in the selected lot.
There have been situations where a lot refered to an invoice while
it doesn't actually contain splits for that invoice (any more).
The new code corrects this by removing the invoice reference from the lot.
Also if the lot and its splits don't agree on the invoice they belong to
set the lot invoice to whatever the splits indicate.
- don't attempt to merge splits that belong to an invoice transaction. These splits are managed by the business code.
- lot link cleanup can leave empty splits, remove these as well
There was no way the account was informed about the lot being deleted.
This was resulting into invalid lot lists in an account while scrubbing.
Which would bomb at later stages like when re-running check & repair or
opening the lot viewer. Also saving would report a number of critical messages
about invalid objects, but these didn't result in a segfault.
Where it was required only to pass down to the CT_TIMESPEC specialization
of template<GncSqlObjectType Type>GncSqlColumnTableEntryImpl::add_to_query().
The primary motivation was to enable removing the sql_be parameter from
get_object_values and all of the templates it calls for the sole purpose
of using a customized per-server time output format (next commit). All
known sql servers/libraries can ingest GMT in ISO form (yyyy-mm-dd hh:mm:ss)
so there's no reason not to use a single standard format.
This has the secondary benefit of also removing an ugly character-by-character
formatting routine.
Since these are now parent-class member functions they can be called
directly from dbi_be without any casting gymnastics.
Also: Move the GncSqlObjectBackend registry to its own class, a private
member of GncSqlBackend. This eliminates a static variable in gnc-backend-sql.cpp
and allows the GncSqlBackend::ObjectRegistry constructor to insert all of
the backends into the list, eliminating gnc_sql_init() and all of the
gnc_sql_init_foo_handler() functions. The cost of this is that the objects
are now created on the free store instead of the text segment.
Because the object backends are created at GncSqlBackend construction
there is now a GncSqlBookBackend in the registry and the second error
message in test_gnc_sql_commit_edit is no longer emitted; instead, the
object is properly committed.