Commit Graph

20823 Commits

Author SHA1 Message Date
Christopher Lam
b1571f2548 [report] annotate and reindent 2019-03-25 17:38:50 +08:00
Christopher Lam
50e9640243 [report] simplify functions to use srfi-1, annotate
hash-map->list is simpler than hash-fold

All refactored functions are tested in test-report-system.scm
2019-03-25 17:38:50 +08:00
Christopher Lam
0b8ff4b5d6 [options] deprecate gnc:save-options
this is unused.
2019-03-25 17:38:50 +08:00
Christopher Lam
4f6344963d [options] simplify gnc:value->string 2019-03-25 17:38:50 +08:00
Christopher Lam
98811d7e71 [customer-summary] rewrite string-expand 2019-03-25 17:38:50 +08:00
Christopher Lam
07f44ad7c5 [customer-summary] convert loop to srfi-1 2019-03-25 17:38:50 +08:00
Christopher Lam
523837ddbe [customer-summary] remove unused functions 2019-03-25 17:38:50 +08:00
Christopher Lam
b47ab716c9 [average-balance] tidy loop conditionals
Previously the splits handling used nested conditionals. Rearrange and
tidy; i.e. handle empty-splits or empty-interval-splits first, and use
last conditional to test for internal-transactions handling. This
avoids nested conditionals.
2019-03-25 17:38:50 +08:00
Christopher Lam
1d11ee21bc [average-balance] no need sanity check
accounts is not null (from prior sanity check) so don't need to
recheck.
2019-03-25 17:22:54 +08:00
Christopher Lam
bc553ed00e [average-balance] destroy the query after using it
also fix comments and whitespace
2019-03-25 17:22:54 +08:00
Christopher Lam
9b9d264a04 [daily-reports] destroy query after using it 2019-03-25 17:22:54 +08:00
Christopher Lam
dedccd56f3 [test-average-balance] test ignore-internal? algorithms
tests gain/loss ignore-internal? algorithms
2019-03-25 17:22:54 +08:00
milotype
480d13ba27
Updated croatian hr.po
Some wording corrections
2019-03-24 13:45:20 +01:00
milotype
35122d814f
Updated croatian glossary hr.po
Some wording corrections
2019-03-24 13:41:12 +01:00
John Ralls
790ee4a502 Merge Chris Lam's 'maint-scheme-cleanups' into maint. 2019-03-22 14:09:51 -07:00
John Ralls
4e3bd4f7bc Silence 'Negative content width -2' warning.
Seems buttons have grown.
2019-03-22 13:36:07 -07:00
John Ralls
d209fec4c9 Merge Chris Lam's 'maint-fix-639049' into maint. 2019-03-22 12:15:00 -07:00
John Ralls
67c41aba56 Add new balance-forecast.scm to potfiles.in. 2019-03-22 12:14:38 -07:00
christopherlam
96b65a50c9 [report-system] deprecate stats/dr-cr collectors 2019-03-22 23:51:52 +08:00
christopherlam
362fb99c13 [average-balance] handle include-subaccts? earlier
much simpler
2019-03-22 23:51:52 +08:00
Christopher Lam
57b3531ce6 Bug 748431 - Wrong average balance for transactions during DST
Replace average-splits with custom loop, cycling through the
balancelist and splitlist, creating interval summaries along the way.
2019-03-22 23:50:47 +08:00
christopherlam
9b0b233bf4 [test-average-balance] create tests 2019-03-22 17:10:54 +08:00
christopherlam
d711cc35f8 Bug 639049 - Asset Barchart Report includes also the first day of next month transactions
If the original date is an end-of-month date, we take it as an
indicator they always want monthdelta dates to be end-of-months.

This works for monthly/quarterly/halfyearly/annual.

Addendum to commit 65bfeaf5de which was
deemed to be an incomplete fix.

Also I'd forgotten to activate a test in test-date-utilities. Enable it.
2019-03-21 19:44:33 +08:00
John Ralls
ee9f1d5efa Merge Ryan Turner's 'balance_forecast_negative' into maint. 2019-03-19 10:14:32 -07:00
John Ralls
bc9d83c90f Merge Christoph Holterman's 'PR-G_ADD_PRIVATE-clean' into maint. 2019-03-19 09:12:48 -07:00
John Ralls
b0d0ee1a40 Bug 797091 - About window misbehaves.
Caching it is silly. Don't.
2019-03-19 08:29:05 -07:00
John Ralls
715a079be0 Remove copied code from gnc_quartz_should_quit.
Just call gnc_main_window_quit instead.
2019-03-19 08:29:05 -07:00
Ryan Turner
23790dd672 [balance-forecast] Allow negative values for reserve and target 2019-03-18 20:09:18 -07:00
Christopher Lam
dd64cec273 [average-balance] set chart-title instead of document-title
previous setting would set document-title which adds an <h1> element
and prevents the chart from fitting into the canvas viewport set 100%
width x height.
2019-03-16 19:12:25 +08:00
Christopher Lam
e9b91f16eb [daily-reports] simplify amount/weekday algorithm
This commit removes the need for analyze-splits, and counts all
split-amounts directly into the daily-totals list.

Because we're not using analyze-splits, there's no need for startbal
anymore.
2019-03-16 19:12:25 +08:00
Christopher Lam
12a46e62de [balance-forecast] use gnc:case-exchange-time-fn
The gnc:case-exchange-fn seems to be designed for single-date reports,
whereas gnc:case-exchange-time-fn for multi-date reports. It may be
faster to have a single exchange-fn definition.

The main reason for this change is to harmonize - all multidate charts
are using case-exchange-time-fn.
2019-03-14 16:31:26 +08:00
Christopher Lam
29c0e19283 [balance-forecast] reuse i18n strings
this commit will modify to reuse some strings which are already
translated, and also add help strings for the various options.
2019-03-14 16:31:26 +08:00
Christopher Lam
784b34a048 [balance-forecast] add null-account and zero-amounts handling 2019-03-14 16:31:26 +08:00
Christopher Lam
6e76cb3d3b [balance-forecast] refactor to avoid xaccAccountGetBalanceAsOfDate
previous will call gnc:account-get-comm-balance-at-date which calls
xaccAccountGetBalanceAsOfDate for every account at every date
point. The xaccAccountGetBalanceAsOfDate is an expensive function
because it scans the account's whole splitlist from the start every
time. use gnc:account-get-balances-at-dates instead which scans an
account only once to generate a balancelist.

this should be a much faster chart.
2019-03-14 16:31:26 +08:00
Christopher Lam
1ade6fe6b4 [balance-forecast] adjust sx accumulator until report from-date
this commit will initialize the sx accumulator by adding all
instantiated sx amounts, from the earliest split posted-date among the
selected accounts, until the report start-date.
2019-03-14 16:31:26 +08:00
Christopher Lam
a4d76177fb [balance-forecast] modify boolean option to effect number box
1. convert simple boolean to complex boolean to toggle amounts
2. convert list processing functions to scheme conventions
2019-03-14 16:31:26 +08:00
Ryan Turner
d0deda9252 [balance-forecast] More clean-up.
* Draw the "balance" line over the "minimum" line.
 * X axis labels should be for the end of the period,
   as that's when all the balance samples are taken.
2019-03-14 16:31:26 +08:00
Ryan Turner
0cf973c123 [balance-forecast] Clean-up
* Fix dates display to ISO format
* Use make-list properly to create a list with identical elements
2019-03-14 16:31:26 +08:00
Ryan Turner
55583829b0 Report: Balance Forecast
This report forecasts the combined balances of the selected accounts
based on the scheduled transactions and plots them on a line graph.

You can set a "reserve" amount, which will draw a red line on the
graph, so you can easily see if your forecast dips below a given value.

There is also a "future minimum" line which shows what the lowest future
balance will be at a given point. I find this useful in conjunction with
the "target" line for planning.
2019-03-14 16:31:26 +08:00
Christopher Lam
b6a708196e [commodity-utilities] rewrite gnc:exchange-by-pricealist-nearest
this function made clearer. first we can remove sanity-check:
pricealist will always be sent as a list, and doesn't need to be
confirmed it is a pair? because assoc-ref can handle an empty list
returning #f.

then the conversion routine is reordered to be clearer.
2019-03-14 16:18:20 +08:00
Christopher Lam
274897fb8c [commodity-utilities] inline gnc:pricealist-lookup-nearest-in-time
this is an unexported single-use function. we can safely inline.
2019-03-14 16:18:20 +08:00
Christopher Lam
0e60c77577 [commodity-utilities] deprecate gnc:exchange-by-pricevalue-helper
This function is only used once, internally, and performs a sanity
check (if price-value ... ...) which is, never needed because the
price-value received has been sanitized to return a price, or 0 and
will never be #f. Inlining this function means we can skip this sanity
check.
2019-03-14 16:18:01 +08:00
Christopher Lam
9a0aaedc05 Bug 797136 - Balance sheet report "Show Exchange rate" broken when foreign currency is sold completely
For cases where total(amount)/total(value) = 0/0, the price is
reported as 0.
2019-03-13 19:37:43 +08:00
Christopher Lam
27985ee337 i18n: commit was missing GNC-OWNER-JOB
The commit 4ee0c3ef4 was incomplete and was missing GNC-OWNER-JOB
which would return #unspecified to string-append causing error. This
commit restores this conditional and also a fallback "" to return to
string-append.
2019-03-12 22:57:04 +08:00
Christopher Lam
b57f6d60f5 Revert "[report-utilities] fix gnc:strify for value/commodity collectors"
This reverts commit fc805d6155 which
causes test failure. I'll find a proper fix when I've found the cause.
2019-03-12 22:54:47 +08:00
Christopher Lam
fc805d6155 [report-utilities] fix gnc:strify for value/commodity collectors
this debugging tool was flawed and was not able to strify the value
collector.  we have to forego the procedure->str strify function
because scheme isn't typed and procedures would be called by the
value-collector section.
2019-03-12 17:42:40 +08:00
Christopher Lam
4ee0c3ef46 i18n: fix embedded translated strings 2019-03-12 17:41:59 +08:00
Christopher Lam
d6f4831a50 [commodity-utilities] deprecate gnc:exchange-by-pricedb-helper
this function is unused.
2019-03-11 20:57:49 +08:00
Christopher Lam
e107d861d3 [commodity-utilities] deprecate gnc:get-commoditylist-inst-prices
This function is "called" by gnc:case-exchange-function when the
latter is called with parameter 'actual-transactions but the later is
never used.

To boot it was called with 3 arguments but expects 5. I "fixed" this.

It can be deprecated.
2019-03-11 20:57:49 +08:00
John Ralls
4fd6497c31 Bug 797098 - Quitting Gnucash shortly after clicking Save...
may abort file save.

Fix mistake in d906ac41.
2019-03-10 14:54:00 -07:00