Commit Graph

21278 Commits

Author SHA1 Message Date
Christopher Lam
c81e9354f7 [eguile-gnc] fix whitespace 2019-07-28 22:57:46 +08:00
Christopher Lam
955a5651d8 [eguile-gnc] use string-for-each instead of regex 2019-07-28 22:57:46 +08:00
Christopher Lam
e506b7c332 [eguile-utilities] compact functions
* whitespace
* move string-repeat to eguile-html-utilities where it's used
2019-07-28 22:57:25 +08:00
Christopher Lam
e3a695d0d4 [qif-imp/string] fix argument order for string-delete
Guile formerly used the wrong argument order for string-delete and
string-filter. Fix to correct order.

See bug report http://savannah.gnu.org/bugs/?31681
2019-07-28 20:03:12 +08:00
Christopher Lam
e8a41bbf54 [options] compact lookup-option 2019-07-28 12:16:58 +08:00
Christopher Lam
bd0cbbf931 [test-options] initial commit
* test lookup option changed section/name
2019-07-28 12:16:58 +08:00
Christopher Lam
66511f17bb [c-interface] compact functions
fix whitespace. this module has good coverage in test-c-interface.scm.
2019-07-28 12:16:58 +08:00
John Ralls
887f7fac32 Bug 746937 - Template transaction splits are loaded in reverse order...
and then not sorted before saving.

Actually not sorted after loading because the template accounts weren't
being committed.
2019-07-27 15:15:55 -07:00
John Ralls
456ab2241f Remove unused ifdefs for IMPLEMENT_BOOK_DOM_TREES_LATER.
Apparently stub code for a different way of generating the DOM tree, never implemented.
2019-07-26 16:17:09 -07:00
Frank H. Ellenberger
a0a0ffbb77 Bug 797319 - Mauritanian ouguiya MRO shows too few decimals
Add info about cash vs. banking
2019-07-25 23:51:50 +02:00
Frank H. Ellenberger
c77607c8c0 Bug 797316 - New Mauritanian ouguiya MRU not supported
Add info, which Mauritanian ouguiya is recent
2019-07-25 23:33:42 +02:00
Christopher Lam
7c9d5ee7ee Bug 797158 - gnc:make-account-sel-limited-option is not working
Option was being deliberately reset to default_value every time.
2019-07-25 20:22:12 +08:00
Christopher Lam
e9554e39b4 [test-stress-options] improve coverage
* improve documentation
* reuse (create-test-data) for various regular transactions
* run (create-test-invoice-data) for business invoices
* fix max arguments which would crash for reports without options
* if report has start-date and end-date, insert valid dates to ensure
report runs on non-null book data.
* enable testing of previously disabled reports
* also dump book and invoices generated in populated book
* modify output to show full backtrace on error: In case of test
failure, previous would show a shortened exception name. Change to
display full backtrace, similar to crashing in live code. Uses
gnc:apply-with-error-handling existing API call.

Also clean up code.
2019-07-25 20:22:12 +08:00
Christopher Lam
54c0765044 [test-invoice] modified to call (create-test-invoice-data)
test-invoice will call (create-business-test-data) to create the 8
sample invoices as previously generated.
2019-07-25 20:22:12 +08:00
Christopher Lam
681e023cd5 [date-utilities][API] deprecate unused exports, add comments
* deprecated:
  gnc:make-reldate-hash
  gnc:reldate-string-db
  gnc:relative-date-values
  gnc:get-relative-date-strings

* remove gnc:reldate-list, unused

* comment sections
2019-07-25 20:22:12 +08:00
Christopher Lam
7e9ec00906 [date-utilities] tidy up gnc:make-date-interval-list 2019-07-24 23:44:56 +08:00
Christopher Lam
9e3aca2ea9 [balsheet-pnl] fixcrash: price-conversion with 'overall-period
previously price-conversion with overall-period would fail when
considering the pricing date for the overall-period column. Use the
last date for the overall-period.
2019-07-24 21:57:33 +08:00
Christopher Lam
c3eab984ce [average-balance] fixcrash: asset-accounts present but no splits
restore the analyze-splits function. previously it would run on an
empty splitlist (obtained via empty accounts for example) and crash
with div/0. this commit will break loop back to analyze-splits
function, and only call it if the splitlist is not null.
2019-07-24 21:57:33 +08:00
Christopher Lam
cf6ea4c612 [report-utilities] update gnc:dump-book
gnc:dump-book also shows
* account balances
* split memo and reconcile status

Exmaple:

Account: <Root.A/Payable> Comm<USD> Type<A/Payable>
n Split: 09/03/80 Amt<-$6.00> Val<-$6.00> Desc<vend-1-name> Memo<vendor-bill>
c Split: 09/04/80 Amt<-$6.00> Val<-$6.00> Desc<emp-1-name> Memo<emp-bill>
y Split: 09/06/80 Amt<$6.00> Val<$6.00> Desc<vend-1-name> Memo<vend-credit-note>
f Split: 09/07/80 Amt<$6.00> Val<$6.00> Desc<emp-1-name> Memo<emp-credit-note>
Balance: $0.00 Cleared: $0.00 Reconciled: $0.00
2019-07-24 20:01:02 +08:00
Christopher Lam
a4811b3b46 [test-extras] add (create-test-invoice-data) for tests
this function creates some business data. moved from test-invoice.scm
without the invoice-specific tests. verified all invoices/bills are
created correctly.

it returns a vector-list of the 8 invoices generated.
2019-07-24 20:01:02 +08:00
Christopher Lam
c9cf35de5d [commodity-utils] document gnc:case-exchange-time-fn 2019-07-24 20:01:02 +08:00
Christopher Lam
e5b756fada [commodity-utils] refactor gnc:pricelist-price-find-nearest
instead of O(3n), this implementation is O(n)
2019-07-24 20:01:02 +08:00
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