Commit Graph

21256 Commits

Author SHA1 Message Date
Christopher Lam
1387c05f4d [test-commodity-utils] augment weighted-average tests
this is to increase 100% coverage pricealist-nearest finder
2019-07-24 20:01:02 +08:00
iggyvolz
49771ee9f9 Fix typo in CMakeLists.txt 2019-07-24 19:17:22 +08:00
John Ralls
ca87572a2c Bug 797319 - Mauritanian ouguiya MRO shows too few decimals
Changed MRO smallest-fraction to 100 based on information provided
by the reporter. ISO4217 has moved the MRO to the "Historical Currencies"
list that doesn't include CcyMnrUnits.
2019-07-23 09:42:43 -07:00
John Ralls
b02f7ac409 Bug 797316 - New Mauritanian ouguiya MRU not supported
Add new MRU with info from
https://www.currency-iso.org/dam/downloads/lists/list_one.xml
2019-07-23 09:42:28 -07:00
Thomas Klausner
507ef68dc7 Bug 795251 - googletest detection cannot be overridden
For the part about the GTest linking problem.
2019-07-20 18:05:13 -07:00
Christopher Lam
aa95d61c6c various reports: use more efficient report-utilities.scm functions
instead of delete-duplicates
2019-07-20 21:10:08 +08:00
Christopher Lam
ae4b7e1582 [report-utilities][API] gnc:accounts-and-all-descendants
return a list of accounts and their descendant accounts
2019-07-20 21:10:08 +08:00
Christopher Lam
38b2d4708b [report-utilities] gnc:accounts-get-commodities more efficient
more efficient function
2019-07-20 21:10:08 +08:00
Christopher Lam
273ae720cc [scm-utilities][API] add sort-and-delete-duplicates
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.
2019-07-20 21:10:08 +08:00
Christopher Lam
fdeff65f06 [business-core] refactor & document gnc:owner-from-split
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.
2019-07-20 21:10:08 +08:00
Christopher Lam
d0bf4ad8ae [test-business-core] add to dist_list 2019-07-20 21:10:08 +08:00
Christopher Lam
ce6c3c22a1 Fix CMakeLists error
need to include module
2019-07-20 21:09:34 +08:00
John Ralls
e88f31e05c Bug 784623 - GNUCash does not work with sql backend, I can open...
in read only mode

Upgrade the splits table as well, an oversight from the original fix.
2019-07-19 21:20:43 -07:00
Christopher Lam
0c433e02f7 [business-core] deprecate gnc:entry-type-percent-p
This function is only used once. deprecate it.
2019-07-19 22:22:28 +08:00
Christopher Lam
e654bd34af [business-core] simplify functions 2019-07-19 22:22:28 +08:00
Christopher Lam
57f291af86 [test-business-core] initial commit 2019-07-19 02:50:24 +08:00
Christopher Lam
75d5d8106b [report-utilities] fix gnc:strify
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
2019-07-19 01:12:38 +08:00
Christopher Lam
8adcacbdd2 [test-owner-report] basic tests for customer and job reports
create invoices, due dates at various points in the past
2019-07-14 11:55:40 +08:00
Christopher Lam
dae26da037 [owner-report] sanitize strings in preparation for tests 2019-07-14 11:35:19 +08:00
Christopher Lam
fee383e85e [job-report] sanitize strings in preparation for tests 2019-07-14 11:35:19 +08:00
Christopher Lam
74169114d5 [report-utilities] add gnc:dump-book and gnc:dump-invoices
(gnc:dump-book)
utility function for tests. dumps the whole book. sample output:

 Account: <Root> Comm<USD> Type<Asset>

 Account: <Root.Asset> Comm<USD> Type<Asset>

 Account: <Root.Asset.Bank> Comm<USD> Type<Asset>
   Split: 07/13/19 Amt<$17,479.18> Val<$17,479.18> Desc<cust-1-name>

 Account: <Root.VAT> Comm<USD> Type<Asset>

 Account: <Root.VAT.VAT-on-Sales> Comm<USD> Type<Liability>
   Split: 07/13/19 Amt<-$1,111.01> Val<-$1,111.01> Desc<cust-1-name>

 Account: <Root.A/Receivable> Comm<USD> Type<A/Receivable>
   Split: 07/13/19 Amt<-$17,479.18> Val<-$17,479.18> Desc<cust-1-name>
   Split: 07/13/19 Amt<$17,479.18> Val<$17,479.18> Desc<cust-1-name>

 Account: <Root.Income> Comm<USD> Type<Income>
   Split: 07/13/19 Amt<-$16,368.17> Val<-$16,368.17> Desc<cust-1-name>

(gnc:dump-invoices)

Invoice: ID<> Owner<cust-1-name>
   Date: Open<?> Post<07/13/19> Due<07/13/19>
  Entry: Date<07/13/19> Desc<taxable=N tax-inc...> Action<action> Notes<> Qty<11>
  Entry: Date<07/13/19> Desc<taxable=N tax-inc...> Action<action> Notes<> Qty<11>
  Entry: Date<07/13/19> Desc<taxable=N tax-inc...> Action<action> Notes<> Qty<11>
  Entry: Date<07/13/19> Desc<taxable=Y tax-inc...> Action<action> Notes<> Qty<11>
  Entry: Date<07/13/19> Desc<taxable=Y tax-inc...> Action<action> Notes<> Qty<11>
  Entry: Date<07/13/19> Desc<taxable=Y tax-inc...> Action<action> Notes<> Qty<11>
  Entry: Date<07/13/19> Desc<taxable=Y tax-inc...> Action<action> Notes<> Qty<11>
  Entry: Date<07/13/19> Desc<taxable=Y tax-inc...> Action<action> Notes<> Qty<11>
 Totals: Total<$17,479.18> TotalSubtotal<$16,368.17> TotalTax<$1,111.01>
2019-07-14 11:35:05 +08:00
Christopher Lam
105f5396fc Merge branch 'maint-budget-ytd-upgrade' into maint 2019-07-13 10:50:16 +08:00
Christopher Lam
89749a1b63 [test-budget] add tests for envelope budgeting 2019-07-13 10:48:44 +08:00
Christopher Lam
ec28835d78 [budget] upgrade to support envelope budgeting
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
2019-07-13 10:48:23 +08:00
Christopher Lam
c05ba6415f [budget] compact functions in options-generator 2019-07-13 10:44:34 +08:00
Christopher Lam
43c8b16ba5 [budget] remove unused options
these options are unused

* general/price-source
* general/show-full-names?
2019-07-13 10:44:34 +08:00
Christopher Lam
1ad4ae30be [owner-report] fix html to be parsable by sxml
in preparation for tests
2019-07-13 00:07:04 +08:00
Christopher Lam
6c4ae89012 [business-options] fix whitespace 2019-07-12 21:08:15 +08:00
Christopher Lam
560b313f85 [business-options] deprecate unused option-types 2019-07-12 20:50:18 +08:00
John Ralls
c9d001d550 Bug 797295 - problems with entering swedish åäö in company address
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.
2019-07-11 17:39:57 -07:00
Christopher Lam
22f22b0a28 Merge branch 'wrapqoflog' into maint 2019-07-12 08:16:46 +08:00
Christopher Lam
9f40cac254 [taxinvoice] bugfix: remove option 'Report Currency'
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.
2019-07-10 23:11:24 +08:00
Christopher Lam
5112210e42 [invoice] Payments should be shown in invoice by default
If an invoice has payments already applied, by default the
invoice-report should show payments.
2019-07-10 23:10:32 +08:00
Christopher Lam
06e3fd4d28 [customer-summary] fix no-owner sorting properly
this comparison now works for no-owner sorting. 3a927ce2a, second
attempt.
2019-07-10 23:10:32 +08:00
John Ralls
1a16ba704b Bug 797306 - "URL cannot be shown" when one clicks an account line link...
in report.

perform_navigation_policy hadn't been implemented for webkit2gtk-3.0.
2019-07-09 16:22:52 -07:00
John Ralls
f80e025b7b Bug 797297 - GNUCash is in English even though MacOS is set-up to French.
Thanks to a misplaced #endif.
Also allow info of selected locale, the comment about MacOS wasn't
correct.
2019-07-09 11:59:19 -07:00
Christian Stimming
39cfcb30f9 Online-banking: add value for fintsRegistrationKey with most recent aqbanking. 2019-07-07 22:39:09 +02:00
Pedro Albuquerque
adbf8afeae Updated pt.po 2019-07-07 10:59:11 -07:00
Christopher Lam
b3a4cd6277 completion redefine gnc:debug 2019-07-07 09:04:04 +08:00
Christopher Lam
429077ee8e completion wrap qoflog 2019-07-07 08:41:13 +08:00
Christian Stimming
629569b792 Update German translation 2019-07-06 22:17:34 +02:00
Christopher Lam
bb6d84e03d [html-utilities] [API] further deprecations
* gnc:html-build-acct-table -- unused for decades
* gnc:html-table-append-ruler/markup
* gnc:html-acct-table-row-helper!
* gnc:html-acct-table-comm-row-helper!
2019-07-06 23:13:24 +08:00
Christopher Lam
463c3124ef [commodity-utilities] [API] deprecate gnc:sum-collector-stocks
this function is never reachable in code
2019-07-06 23:13:24 +08:00
Christopher Lam
b9382d2cf2 [commodity-utilities] move gnc:debug to less CPU critical code
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.
2019-07-06 23:13:24 +08:00
Christopher Lam
e783335cf2 [commodity-utilities] compact gnc:sum-collector-commodity
This function converted to purely functional approach.

Note that commodity-collectors always round amounts to the currency
SCU therefore we replicate the behaviour here.
2019-07-06 23:13:24 +08:00
Christopher Lam
dd1873eb05 [test-cash-flow] fix test which was badly designed
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.
2019-07-06 23:13:24 +08:00
Christopher Lam
4214f7eb76 [balsheet-pnl] bugfix prevent crash on missing accts
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.
2019-07-06 23:12:36 +08:00
Christopher Lam
1e66d3b2f6 [balsheet-pnl] cosmetic: improve maxindent calc
75ab45ac3 without 1+ some alignment is incorrect
2019-07-06 14:42:09 +08:00
Christopher Lam
42b6fb993b call strify only if debugging enabled 2019-07-06 11:15:18 +08:00
Christopher Lam
898a9cdb8e wrap qoflog 2019-07-06 11:15:18 +08:00