this can be used instead of delete-duplicates when the list must also
be sorted.
the main reason for this function will be for the upcoming aging.scm
report which will use it heavily to slice APAR splits into owner list.
This function helps to establish UI link from register split to an
owner's split. It should not be used anywhere else. Its use in reports
will be removed.
It is also unnecessarily complex -- it is called from an AP/AR account
register split, it should have all necessary information via split
metadata. e.g. this function *can* return a split owner if originating
from an Asset/Liability account which settles an invoice, but this
functionality is not used because there is no asset/liability register
hook to call it.
Try monetary-collector and value-collector printers earlier; output is
fixed and will be "coll<([$200.00])>" for commodity-collectors or
"coll<23>" for value-collectors
merges ideas from Phil Longstaff's ytd-budget.scm report. differences
from non-envelope budget:
* envelope budgeting accumulates bgt/act/diff amounts from period=0
e.g. selecting periods 2 to 4 means amounts must accumulate from
period 0 to 1 (not shown) and accumulated amounts 2 to 4 (shown).
* total column must encompass all periods from 0 to maxperiod
scm_c_string_length() returns the wrong answer when the C string is
UTF8: It returns the number of codepoints because the SCM string is in
UTF32, but we need the number of bytes for gtk_text_buffer_set_text.
Fortunately scm_to_utf8_string returns a null-terminated string so
we can just tell gtk_text_buffer_set_text to figure it out on its own.
Guile doesn't use g_malloc so don't use g_free, and gpointer* is a
void** so change the cast to void* for free.
this option is useless; it does not enforce currency conversion, it
was merely used for "Amount Due, XXX" currency-mnemonic. Remove this
option, and modify code to use invoice currency instead.
pricealist is a long list generated once, yet is dumped via gnc:debug
for every call to gnc:exchange-by-pricealist-nearest. This change
moves gnc:debug to the initial pricealist generation, ensuring that
gnc:exchange-by-pricealist-nearest is much faster.
This function converted to purely functional approach.
Note that commodity-collectors always round amounts to the currency
SCU therefore we replicate the behaviour here.
this test had confused 2 functions:
(exchange-fn monetary currency) --> monetary
and
(to-report-currency currency amount date) --> amount
this flaw surfaces with the shortened gnc:sum-collector-commodity definition.
When asset/liability/income/expense accounts are either missing or
deselected, the report would crash. This commit will ensure the
date-specific balance calculators do not crash.
The reason for crash is the form (apply map gnc:monetaries-add lists)
where lists is usually a list-of-list-of-monetaries, e.g.
(list (list $1.00 $2.00 $3.00)
(list $2.35 $3.44 $4.45))
and (apply map gnc:monetaries-add lists) will return a list of the
matched sums, i.e. commodity-collectors (list (list <$3.35> <$5.44>
<$7.45>)), whereby each commodity-collector is denoted by <...>
When there are missing account-types (or deselected) the lists are
empty-lists, therefore mapping will fail. This change ensures that
null-lists are handled by returning (list (list <> <> <>)), with null
commodity-collectors.
code sets date-option to today. it fails to set the default-value. the
date will reset when user click 'reset options', and this commit
ensures the 'today' date remains the default date.
Previous 9ed0174cb would place any entry with customername == "No
Customer" last, including genuine customers with this particular
name. This commit modifies to test on presence of owner-report-url to
detect owner/no-owner entries. This is reliable for this report.