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
* If currencies are not converted, Unrealized Gains are
meaningless. Hide them.
* If there are no income/expense accounts, retained earnings will be
nil. Remove row.
AQBanking6 uses a separate method for retrieving account numbers
for account info and transactions, where the transactions method can
have additional characters, most often the ISO4217 currency code. That
results in match failures when importing.
As a work-around, compare only the length of the account-info-generated
online id when comparing it to the transaction-generated one.
Note that this is only a partial solution: At least one German bank
also appends characters to the transaction-generated bank id and that
will still cause the match to fail.
Previous code would call gnc:account-get-comm-value-at-date for each
report-date; this function generates qof-query, retrieves account
splits, scans them to accumulate split->transaction->currency and
split->value into a commodity collector.
This commit will hook into the existing gnc:account-accumulate
function, accumulating the same split->transaction->currency and
split->value into a collector.
Note we must make a copy of the accumulator at each report-date
via (gnc:collector+ val-coll) otherwise the same val-coll will be
mutated through subsequent splits.
For a multicolumn balsheet, for every account with N old splits, and
reporting on M report dates, it would run in O(N*M) time. This
algorithm will hook into existing accumulator, i.e. I think O(1).
The majority speed-up however comes from avoiding M qof-queries per
report.
This commit adds tests for multicolumn balance-sheet and
income-statement. It mainly tests:
* multiple periods
* unrealized gains calculators
* amounts/balances are predictable
srfi-9 records can contain complex objects eg lists/vectors also
gnc:monetary or gnc:html-table objects. previously gnc:strify would
use the default printer; this commit modifies so that they are
prettified.
example output; a :col-datum record from balsheet-pnl. the record's
split-balance contains a $0 monetary object.
Rec::col-datum{last-split=#f, split-balance=[$0.00]}
this last pretty-printer must be the last one before object->string,
because we want previous printers which may be records too
eg. monetary->str etc to use their own printer.
Previous would call gnc:account-get-balances-at-dates and
gnc:account-accumulate-at-dates to retrieve balances and
last-split. This commit reduces the O(2*N) operation to O(N) which
becomes significant with accounts with large number of splits.
Maybe we can reduce other account splitlist scans in the future; these
will be easier and would only require augmenting the record.
Some invalid txns with splits in the wrong APAR account can be
processed, creating cases whereby split->owner returns an invalid
freshly-allocated owner.