Where possible in the Python SWIG code use the builtin SWIG conversion
code over custom code. This ensures appropriate overflow/type checking.
With this I have enabled GncNumeric from longs and tested for correct
overflow handling.
Note: This could be extended to GUILE but I am not familiar enought to
safely enable this.
At current the Python GncNumeric has issues with type conversion eg.
* GncNumeric(1.3) = 1.00
* GncNumeric("1.3") is OK but any future methods error
This behaviour was relied on for the Account tests to pass as it used
GncNumeric(0.5) == GncNumeric(1.0) but this is not what many users would
expect.
This fix alows GncNumeric to be constructed from a (int, int)
numerator/denominator pair or int/float/str where double_to_gnc_numeric
and string_to_gnc_numeric from C is used.
Only string values should be quoted in queries; in particular NULL
isn't a string value and must not be quoted.
Note that this is a less than perfect solution because it doesn't use
the Database's quoting function and so doesn't escape quotes, linefeeds,
or carriage returns inside the string. That's because the SQL generating
logic is independent of the connection class and can't easily get to it.
The default color of a color option is set during a call to "gnc:make-color-option"
as a list of rgba values. In all color option instances in the scheme code this
default color is incorrectly set to transparent.
For example, white color was being set with:
(list #xff #xff #xff 0)
The last value in the list is the value of the alpha channel, with 0 meaning
transparent. When the color button is displayed in the gui it shows a checkerboard
pattern instead of the intended color.
This commit changes all default colors of color options to have alpha=#xff, i.e.,
fully opaque.
Wherin the problem is that MySQL's TIMESTAMP has a date range of
1970-01-01 00:00:01 to 2038-01-19 03:14:07 and is unable to handle
time_t of 0. MySQL's TIMESTAMP also assumes that input is in the server's
timezone and adjusts it to UTC. GnuCash has already done that conversion.
There did not seem to be an easier way to control the toggle button
width so created a custom one based on the GtkToggleButton. This
allowed the use of the class function get_preferred_width which is set
at two thirds the height.
When you specify a font size for the sheet, the popup will inherit this
but when first popped it will use the minimum height value and so may
be different resulting in not being in the right position. So check on
allocation and if different remove and pop again.
This function is used to get the width of the toggle button and add it
to the sample text length to set the default column width. As the it is
square, just use the row height instead and the user will no doubt set
there own widths any way.
This commit sets up getting the vertical and horizontal item_edit cell
margins, borders and padding from CSS. This increases the option to
specify individual values for top, right, bottom and left instead of
just specifying just two values.
By using CSS classes, there is no need to have separate handlers for
the foreground and background colours so replace them with one being of
a similar format to that of cell_border_handlers. This also involves
changing the map of RegisterColors to CSS style classes to reflect the
changes and reduce the get colour type to one call per class
When the cell borders are not displayed, the border colour is set to
the background colour so test for the widget being in an insensitive
state to get the correct background colour.
For each subclass, getting rid of GNC_SQL_OBJECT_BACKEND_VERSION which
was a bit misguided.
Also remove the bogus test the skipped loading a table if its version
didn't match GNC_SQL_OBJECT_BACKEND_VERSION which was even more misguided.
glib-compile-resources lists the resource files as absolute paths,
but SET_LOCAL_DIST expects relative paths; the result was that the
tarball code was looking for ${CMAKE_SOURCE_DIR}/${CMAKE_CURRENT_SOURCE_DIR}/foo.
This change strips off ${CMAKE_CURRENT_SOURCE_DIR} from the filenames
before passing them to SET_LOCAL_DIST.
The main topic of this bug was already fixed in earlier commits. This commit
handles the minor improvements also mentioned here:
- don't show the menu option for invoice/bill transactions as that doesn't make sense
- don't show the pre-payment line if the selected transaction was one, in this case only set the amount
- allow users to edit lot link transactions via this mechanism as well (which essentially are payments without an explicit payment split)
The way this is implemented is as follows
- if gnucash can deduce a partner from the transaction that partner will be proposed
this works for all transactions that are part of a business transaction already
and will correctly detect pre-existing customer, vendor and employee payments
- if no partner can be deduced gnucash will assume the transaction to be a vendor
or customer payment based on the sign
- in all cases the user can change the partner type in the payment window that's presented
to any of customer, vendor or employee to correct gnucash' suggestion.