sort-and-delete-duplicates require that the < proc can sort elements
properly.
In new-owner-report, previous used split->parent->posted_date for
sorting during call to sort-and-delete-duplicates. This does not
guarantee equal elements will be adjacent. Using xaccSplitOrder
satisfies that guarantee, and splits will be deduped properly.
Also account and commodity comparison functions similarly defined to
have consistent code.
This change will modify the output in some tests (e.g. balsheet-pnl
will now group currencies and commodities together due to
string-comparison using gnc-commodity-get-full-name) which must be
modified.
The adding of the register comment to the state file is at the start
of the gnc_table_save_state function but this only gets added if the
state_section already exists and on first register save it does not so
move it to after the register column widths are added so the
state_section will exist.
On first start up, cells with a pop up were initialised with the sample
text plus the cell height. This worked most of the time but with small
fonts the height could be smaller than the minimum button width so the
cell was too small. Add a function to retrieve the button width which
can not be less than the minimum button width and add this to be the
sample text width.
Also when you double clicked on the header of a pop up cell column to
auto size the cell width it did not take into account the button width
and so was too narrow, this is also fixed by getting the button width.
When processing payment->invoices, don't show duplicate invoices. This
is an unusual case documented in the bug.
Note: Instead of sort-and-delete-duplicates the invoices, we could
replace the invoice accumulator with the O(N^2) version:
(if (member invoice invoices) invoices (cons invoice invoices))
When processing invoice->payments, we used gnc-lot-get-earliest-split
to find the lot opening-split to skip it.
However it does not always return the lot opening-split, because a
lot-reducing split may be dated earlier than the lot opening-split.
This change means that the posting-split is processed together with
the payment splits, but its PaymentAcctSplitList is null, so it does
not add any row to the result.
It should receive 1 arg instead of 2.
guile-2.2 allows internal defines to be called with a higher number of
args. This may be a guile bug. Follow-up tracking at
https://lists.gnu.org/archive/html/bug-guile/2019-12/msg00011.html
guile-2.0 (IMHO correctly) does not allow this invalid call.
Previous would search invoices->payments and payment->invoices during
the report by analysing each posting and payment txn.
This change will remove the splits searching and use gnc-lot API to
find these links.
* also use ice-9 match for easier matching
* also use global gnc:multiline-to-html-text
* also remove some duplicate sanity checks
Previous test wasn't comprehensive; due to variable row lengths,
the (td 11) wouldn't consistently select the link amount. using
(td -1) will select the last <td> element in the row.
Moreover also test the class-name to target the link amounts otherwise
other elements (eg the aging-list) will also be returned.
In the budget view there is no option to add the account code column
which some uses use for sorting their accounts. This commit introduces
a feature flag to be used in version 4.0 but if set in 3.8 will hide
the new account code column so the view is not disrupted.
Connect to the 'row-changed' signal for the account tree and do a
redraw on the totals tree view. Also fixes when changing the preference
for using negative amounts in red.
For 1 payment to >1 invoices, previous would miscalculate overpayment.
Old overpayment definition -- from the payment amount, successively
subtract the invoice totals. If remaining is >0, then this is
overpayment. But this fails whereby invoice was partially paid
elsewhere because the overpayment would miss them.
New overpayment definition -- the payment txn is analysed, and all
APAR-splits' lots are analysed. Any lot with no invoice is a
prepayment.
This is a simpler algorithm and does not require the creation and
searching of invoices-and-splits.
For 1 payment to >1 invoices, previous would miscalculate overpayment.
Old overpayment definition -- from the payment amount, successively
subtract the invoice totals. If remaining is >0, then this is
overpayment. But this fails whereby invoice was partially paid
elsewhere because the overpayment would miss them.
New overpayment definition -- the payment txn is analysed, and all
APAR-splits' lots are analysed. Any lot with no invoice is a
prepayment.
Overpayments create at least 2 APAR splits (1 for each invoice, and 1
for the overpayment), they were processed multiple times.
Modify query to return unique transactions, thereby ensuring a payment
gets processed once only.
c21bb66d6 had a regression: income-expense-balances was originally
negated, only to be negated again for use in retained-earnings-fn. The
previous change forgot to negate income-expense-balances.
This commit removes the negation before use of income-expense-balances
in retained-earnings-fn, thereby simplifying code.
because gdk_rgba_to_string() returns a newly-allocated string
* get_negative_color is gchar* instead of const gchar*
* move to dialog-utils.c
* rename get_negative_color() to get_negative_color_str() in
window-main-summarybar.c
* add g_free to gnc_tree_model_account_dispose ()
* modify code to g_free () after use
previous showed income/expense/transfers/totals budget totals, of
uncertain meaning. now shows income/expense/asset/liability/equity
budget totals.
the 5 lines also become sensitive to global sign-reverses property
introduce new API
* gnc_using_unreversed_budgets - queries book's unreversed feature
* gnc_reverse_budget_balance - check if book unreversal status matches
2nd argument. if so, return account's reversal status. else, return
FALSE.
* gnome-budget-view can now show both natural and reversed budgets
* gnome-plugin-page-budget will now read&write both natural and
reversed budgets.
* use fold, more efficient, removes the need for intermediate list
(map cdr (filter filter-fn accounts-balances)): filter will create 1
intermediate list, which is passed as an argument to map which
creates the final list. using fold will remove the need for
intermediate list.
* list->vector for O(1) access