Commit Graph

18812 Commits

Author SHA1 Message Date
John Ralls
23f25d74d9 Don't try to unref a NULL GDateTime*. 2017-11-19 11:41:08 -08:00
Geert Janssens
060e16b671 Fix a few travis failures (potentially uninitialized use) 2017-11-18 20:41:10 +01:00
Geert Janssens
75fb4e7a0c Bug 736765 - Assign as payment... should re-populate the payment represented by the selected transaction if any
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)
2017-11-18 18:53:55 +01:00
Geert Janssens
949f2db473 Bug 778692 - Assign as payment should work for employee expense vouchers
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.
2017-11-18 17:43:33 +01:00
Geert Janssens
cd9c3807c0 Assign as payment - when random transaction is selected, reset transaction description to owner
This will make the assigned payment more in line with traditionally created business payments
2017-11-18 17:43:33 +01:00
Geert Janssens
ce900d1df3 Assign as payment - refactor a few code blocks into separate functions
And some tweaks to the message strings displayed in case of uncertainty
2017-11-18 17:43:33 +01:00
Geert Janssens
d66469fef8 Assign as payment - Differentiate between new and existing payments for 'Assign as payment'
When the selected transaction is already involved in a business payment,
propose to Edit the payment instead of Assigning it as a payment.
This is more informative and will help prevent users from accidentally replacing existing payments.
2017-11-18 17:43:30 +01:00
Geert Janssens
18dcbeef8a Assign as payment - offer possible payment splits to user in case there are multiple valid candidates for assignment 2017-11-18 17:43:26 +01:00
Geert Janssens
aeb80a230e Bug 734865 - Assign as Payment... can silently 'unpay' a payed invoice
With this commit the 'assign as payment' logic now works as follows:
- if the selected transaction is already linked to an existing payment, the payment dialog
  will present this payment again (same partner, post-to account, same selected document(s),
  same amount, memo, and transfer account).
- if the selected transaction is not linked to an existing business transaction the logic
  will make a best guess as to whether the payment should be for a customer or vendor.
- in both situations if the existing transaction has multiple splits that can be considered
  as transfer (or 'payment') splits the payment  dialog can't work with it (it can only deal
  with one transfer split). In this case the user will be informed that only one valid
  transfer split will be retained and the others ignored.
- the other thing the payment dialog can't handle are APAR type splits that are not associated
  to a lot at all. In case of transactions not part of a business transaction they will be
  silently ignored on the assumptions these were manually entered transactions with the intention
  to be linked to business transactions. On the other hand if such a split is part of a transaction
  that is also linked to a business payment already, a warning will be issued these splits will
  be removed from the new payment.
2017-11-18 17:43:26 +01:00
Geert Janssens
0dfb921e86 Add functions to retrieve a copy of splits of a certain type from business transactions 2017-11-18 16:55:18 +01:00
Geert Janssens
de4414b2a1 Inform the user when assign as payment can't be used 2017-11-18 16:55:18 +01:00
Geert Janssens
954ce1ab11 Mark unused function parameters as such in dialog-payment.c 2017-11-18 16:55:18 +01:00
fell
ff76db28f5 Add po/glossary/gnc-glossary.pot to .gitignore 2017-11-15 03:33:57 +01:00
fell
742064ee87 Fix a few encodings and Content-* tags in glossary 2017-11-15 00:36:41 +01:00
John Ralls
61316648b8 Bug 789608 - Compilation problems when linking libraries.
Fix using a preproc macro in a different file from where it was declared
and more-strict template resolution of error_handler<> by gcc-7.x.
2017-11-09 13:47:08 -08:00
John Ralls
1895ae280c Merge branch 'maint' into unstable 2017-11-09 13:45:45 -08:00
John Ralls
f888eb88f0 Fix with_Python build in cmake. 2017-11-09 11:22:02 -08:00
Robert Fewell
179d022d1a Prevent the rename popup from appearing in the dense calendar
If you right mouse on the dense calendar, the treeview pops but also
the rename page popup. So stop the cascade of the button press event
when on the dense calendar.
2017-11-09 11:29:39 +00:00
Robert Fewell
1f4a2e36db Dense calendar popup window of screen at bottom
The get_allocation function was in the wrong place for the button press
2017-11-09 11:28:09 +00:00
Robert Fewell
54b492ee83 Add a margin to the Date label 2017-11-09 10:48:59 +00:00
Robert Fewell
4558521980 Don't re-populate dense calendar treeview on every mouse move
The treeview only needs to be re-populated when the mouse moves to a
different day so test for this.
2017-11-09 10:39:36 +00:00
Robert Fewell
9c3247d5cc Save the screen dimensions on button click
Instead of getting the dimensions on every mouse move, just save them
on button click and use the saved values.
2017-11-09 10:32:10 +00:00
Robert Fewell
9253b50210 If there are no marked days on Windows the dense calendar crashes
If there are no marked days in the dense calendar add a blank one. Also
make sure all pending events are processed be fore returning as the
treeview did not always populate correctly.
2017-11-09 10:12:52 +00:00
John Ralls
45bab93613 Bug 789928 - FTBFS with libdbi 0.9.0-5 on Debian
Commit 88b8477 on libdbi calls the error handler if one attempts to run
off the end of a result set. Since we often loop on
dbi_result_next_row() returning 0 this breaks our logic in several
places. This change simply returns from the error handler on a
DB_ERROR_BADIDX allowing the logic to work as before.
2017-11-07 18:06:04 -08:00
John Ralls
f9d5436adc Merge J. Marino's 'fix-negative-colors' into unstable. 2017-11-07 15:47:57 -08:00
John Ralls
6c01e54042 Convert shell-executed scheme tests to run directly from Guile.
I.e., remove the shell invocation and with it the need to set the shebang.

Surprisingly this required some build-system modifications particularly
for cmake in order to correctly set the environment.
2017-11-07 15:04:16 -08:00
John Ralls
f412795ef2 Remove extraneous parameters from GNC_ADD_SCHEME_TARGETS 2017-11-07 15:04:16 -08:00
Jose Marino
3b0bcf75e8 report: fix negative colors in barcharts
Specified bar colors only apply to positive bars in the plot.
Negative bars still have the default colors, which are slightly
darker shades of the default positive colors.

This commit forces negative bars to have the same colors as
positive bars.
2017-11-02 09:13:34 -06:00
Robert Fewell
ed3de42c96 Update the register for the change in RegisterColor enums
Change the map of RegisterColors to CSS style classes to reflect the
changes and reduce the get colour type to one call per class
2017-11-01 12:35:21 +00:00
Robert Fewell
6228881d6a Change the split and entry models to reflect the colour changes 2017-11-01 12:35:21 +00:00
Robert Fewell
98d8696b1a Reduce the RegisterColor enums so there is one for each type
Combine the foreground and background colour enums so there are only
eight and change the access function to gnc_table_get_color
2017-11-01 12:35:20 +00:00
Robert Fewell
7a2c1492fd Replace the cell foreground and background colour handlers
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.
2017-11-01 12:35:20 +00:00
Robert Fewell
451161837d Test the widget state to get the correct background colour.
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.
2017-11-01 12:35:19 +00:00
Robert Fewell
c5fb0d6dce Change the look of the toggle button
With these changes the button image is removed and you are left with
the arrow and frame on the yellow background. This can be dropped or
adjusted if it was deemed a good idea.
2017-11-01 12:35:11 +00:00
Robert Fewell
5500211305 Control the toggle button width
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.
2017-11-01 12:12:01 +00:00
Robert Fewell
0c44383696 Move the double line to be inside the cursor cell 2017-11-01 12:09:37 +00:00
Robert Fewell
2a93842574 If a font size is specified for the sheet, popup size may be wrong
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.
2017-11-01 12:08:02 +00:00
Robert Fewell
a278bcc052 Use previously created functions
Use the previously created functions to reduce code and for conformity.
As part of this some variables were renamed to be common.
2017-11-01 12:05:46 +00:00
Robert Fewell
0ba9b76899 Provide two functions for common code
These two sections of code appear in three separate files in slightly
different versions so define them hear for conformity
2017-11-01 12:01:54 +00:00
Robert Fewell
70ad2c3bc4 This function doesn't do much and is only used for new account registers
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 it is
square, just use the row height instead and the user will no doubt set
there own widths any way.
2017-11-01 11:57:58 +00:00
Robert Fewell
bb16e07d8f Adjust the sheet to get its spacings from the item_edit CSS 2017-11-01 11:56:12 +00:00
Robert Fewell
9f76441d50 Get the item_edit cell padding from CSS instead of defines
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.
2017-11-01 11:54:05 +00:00
John Ralls
4f9716362c Merge branch J. Marino's fix-report-colors into unstable 2017-10-31 17:31:33 -07:00
John Ralls
a6f4ea65e9 Merge J. Marino's 'fix/report-net-barchart' into unstable 2017-10-31 17:24:44 -07:00
Jose Marino
f4acb6c000 report/category-barchart: fix unit test to work with gnc-monetary
The unit test for category-barchart did not initialize html stylesheets.
Without any stylesheets available, the renderer defaults to a
trivial renderer. This works fine if the table in the report is
populated by doubles. However, now it is populated by gnc-monetary
and they need a stylesheet to be properly formatted.

This commit makes sure to initialize the html stylesheet code in
the unit test and adapts the parsing code to the new formatting.
2017-10-31 16:10:45 -06:00
Jose Marino
3913c528f1 report/category-barchart: calculate using gnc-monetary instead of double
Perform and store all calculations using gnc-monetary instead of double.
Conversion to double is only needed as a last step when adding data
to the chart (using new local function "monetary->double").

When a table is displayed, since the values are gnc-monetary, they are
properly formatted as monetary values.
2017-10-31 16:10:45 -06:00
Jose Marino
46b3e1caad report/net-linechart: fix unit test to work with gnc-monetary
The unit test for net-linechart did not initialize html stylesheets.
Without any stylesheets available, the renderer defaults to a
trivial renderer. This works fine if the table in the net-linechart
report is populated by doubles. However, now it is populated by
gnc-monetary and they need a stylesheet to be properly formatted.

This commit makes sure to initialize the html stylesheet code in
the unit test and adapts the parsing code to the new formatting.
2017-10-31 16:10:45 -06:00
Jose Marino
85e5651202 report/net-linechart: calculate using gnc-monetary instead of double
Perform and store all calculations using gnc-monetary instead of double.
Conversion to double is only needed as a last step when adding data
to the chart (using new function "monetary->double").

If the table is displayed, its values are properly formatted as monetary
values since they are gnc-monetary instead of doubles.
2017-10-31 16:10:45 -06:00
Jose Marino
9c7ba52315 report/net-barchart: fix unit test to work with gnc-monetary
The unit test for net-barchart did not initialize html stylesheets.
Without any stylesheets available, the renderer defaults to a
trivial renderer. This works fine if the table in the net-barchart
report is populated by doubles. However, now it is populated by
gnc-monetary and they need a stylesheet to be properly formatted.

Using doubles and the trivial renderer, a table cell looks like:
<td class="number-cell"><number> 6.0</td>

Using gnc-monetary and the trivial renderer, a table cell looks like:
<td class="number-cell"><gnc-monetary> #[unknown]</td>

Initializing the html stylesheets, the table cell looks like:
<td class="number-cell">$6.00</td>

This commit makes sure to initialize the html stylesheet code in
the unit test and adapts the parsing code to the new formatting.
2017-10-31 16:10:45 -06:00
Jose Marino
2fcd1efd6d report/net-barchart: default to list of zeros instead of empty list
This was the original behavior before the change to gnc-monetary.
2017-10-31 16:10:45 -06:00