Commit Graph
100 Commits
Author SHA1 Message Date
Christopher Lam 2fa442638d fix typo in he/CMakelists.txt templates dist_list 2019-08-27 22:29:45 +08:00
Christopher Lam f4a1b2fdf2 Revert "[standard-reports] modernise to srfi-9 records"
This reverts commit
123033e5ea. Unfortunately srfi-9 records
don't travel well outside modules, so, will fail on master.
2019-08-27 22:29:28 +08:00
Christopher Lam d963ca0d3a fincalc: remove C accelerator for Clear
because it clashes with Close button
2019-08-27 21:15:28 +08:00
Christopher Lam 13d3179729 Bug 605602 - precision of Financial Calculator seems to depend on locale
* the calc_clicked_cb had mechanism to abort if no fields were
  empty. disable it.

* to convert gnc_numeric to string, the only suitable print_info is
  gnc_share_print_info_places which takes decimal and outputs suitable
  print_info. Not very appropriate, but works.
2019-08-27 21:15:28 +08:00
Christopher Lam 90da06b8af [dialog-import] connect delete_event to gnc_gen_trans_list_delete 2019-08-27 06:48:28 +08:00
Christopher Lam 18aff5d1c1 Bug 797355 - General Journal report seems to be off balance
Previously, for general-journal, each split was being analyzed, and
only the source split was counted for totals. This change will means
the source split *and* its peers were accounted for.
2019-08-26 18:36:46 +08:00
Christopher Lam 0d35e7c63d [register] remove unused functions 2019-08-26 18:36:46 +08:00
Christopher Lam 6b0bfa075c [register] fix Transfer acc for single-account splits
single account splits shouldn't show "-- Split Transaction --" in
transfer account. show "None".
2019-08-26 18:36:45 +08:00
Christopher Lam d7813206ce [register] compact functions, inline single-use function 2019-08-26 18:36:45 +08:00
Christopher Lam 3d608efc22 [test-options] add to CMakeLists.txt
forgto to add to dist_list.
2019-08-23 19:51:13 +08:00
Christopher Lam 67751665b3 [taxtxf(-de_DE)] compact functions, use srfi-2
srfi-2 and-let* allows concise code and returns #f if any intermediate
var is #f.
2019-08-23 19:34:14 +08:00
Christopher Lam 123033e5ea [standard-reports] modernise to srfi-9 records 2019-08-23 18:40:37 +08:00
Christopher Lam 0a3fd5984e [general-journal] deprecate the journal report generator
it is unused.
2019-08-19 20:42:00 +08:00
Christopher Lam 416e7f7e5e [general-journal] set document title after rendering
Instead of setting document <title> register.scm's General/Title
option, set it in the document returned by register.scm's
renderer. This is in anticipation of "General"/"Title" option in
register.scm being removed.
2019-08-19 20:41:12 +08:00
Christopher Lam b3ff04eedc [balsheet-pnl] reuse i18n strings 2019-08-19 19:30:17 +08:00
Christopher Lam bd9edbbbf6 Bug 797279 - Reports RTL do not support RTL - fix string
fix guile-2.0 string handling to prevent munging unicode in
report-titles etc. while loading/saving reports
2019-08-19 08:06:27 +08:00
Christopher Lam bf7d121e27 Bug 797279 - Reports RTL do not support RTL - fix reports 2019-08-19 08:06:27 +08:00
Christopher Lam 99c69023cc Bug 793018 - Balance (with >>eguile<<) - Report Title can't be changed 2019-08-18 19:26:09 +08:00
Christopher Lam 4a81bb34ce [general-ledger] internationalize general-ledger title 2019-08-18 14:14:30 +08:00
Christopher Lam a13e8f9237 [general-ledger] deprecate gnc:make-general-ledger-report 2019-08-18 13:40:16 +08:00
Christopher Lam 8b1ada6048 [balsheet-eguile] monetaries must be rounded to their scu
previously balsheet-eguile would convert monetaries to exact fractions.
2019-08-18 11:14:27 +08:00
Christopher Lam f64dd0860f Bug 752395 - Start Day of weekly report doesn't respond to change in locale
Redefines some functions to ensure weekly grouping in transaction
report obeys locale's start-of-week.
2019-08-15 13:18:46 +08:00
Christopher Lam bdbb06b722 [price-quotes] remove no F::Q message 2019-08-15 13:18:16 +08:00
Christopher Lam 2a6a4e34d6 [price-quotes] compact commodity-tz-quote-triple->price 2019-08-13 18:50:59 +08:00
Christopher Lam e15f2610ba [price-quotes] compact gnc:book-add-quotes 2019-08-13 18:50:57 +08:00
Christopher Lam 4a4f81b320 [price-quotes] compact book->commodity->fq-call-data
make function more readable.
2019-08-13 18:50:55 +08:00
Christopher Lam 5e8663772a [price-quotes] compact gnc:fq-get-quotes 2019-08-13 18:50:53 +08:00
Christopher Lam d5122c97ea [price-quotes] compact gnc:fq-check-sources
improve locality of vars.
2019-08-13 18:50:51 +08:00
Christopher Lam fab1c8db3e [price-quotes] show if F::Q not installed, remove dead code 2019-08-13 18:50:48 +08:00
Christopher Lam 112cf99d2d [test-report-html] add coverage and function test
* function gnc:html-table-add-labeled-amount-line! has full coverage
test.

* function gnc:make-html-acct-table/env/accts has good coverage
confirming nothing crashes.
2019-08-13 18:50:13 +08:00
Christopher Lam a42f1211d8 [html-acct-table] modernise to srfi-9 records 2019-08-13 18:50:13 +08:00
Christopher Lam 81b20d0a62 [html-acct-table] timepair -> time64
* fix timepair -> time64 - this is technically dead code.
2019-08-12 23:33:44 +08:00
Christopher Lam 0c3f460e9f [invoice] deprecate easy/fancy-invoice creation hooks 2019-08-11 23:32:51 +08:00
Christopher Lam c7e60c1d53 [qif/test-qif-parse] increase coverage 2019-08-08 08:08:55 +08:00
Christopher Lam 6252de21fd [qif/qif-parse] restore handle non-4-digit dates, and erratum
db93aec58 contained logic error in date-handling, would invalidate
2-digit years.

Also parse-bang-field needs to trim trailing space.
2019-08-05 18:16:49 +08:00
Christopher Lam d1fddf557c Modifications to consider module changes in master 2019-08-04 20:52:57 +08:00
Christopher Lam 5bd854c550 Merge branch 'maint' 2019-08-04 13:44:12 +08:00
Christopher Lam 08de1a0ab0 [qif/qif-import] fix whitespace 2019-08-04 11:35:46 +08:00
Christopher Lam 409b97a988 [qif/string] compact function 2019-08-04 11:35:43 +08:00
Christopher Lam 944e78144e [qif/qif-merge-groups] speed up duplicate-transaction finding
old method would scan the new-xtn-list (i.e. imported qif
transactions), create a query for each, and run query to find
candidate old-transactions to match each new-transaction.

new method creates 1 query only to scan old-transactions within 1 week
of earliest and latest new-transaction date. then creates a match list
using same heuristics:

* account full name must match
* split value must match
* dates must differ by 1 week maximum
2019-08-04 11:35:24 +08:00
Christopher Lam b2d1ad526c [qif/qif-merge-groups] compact functions 2019-08-04 11:35:22 +08:00
Christopher Lam a146d2cd58 [qif/qif-parse] compact functions 2019-08-04 11:35:19 +08:00
Christopher Lam a3150f383f [qif/test-qif-merge-groups] initial commit 2019-08-03 22:50:19 +08:00
Christopher Lam 277ba729d1 [qif/test-qif-parse] increase coverage 2019-08-03 19:09:51 +08:00
Christopher Lam 1873c2f705 [qif/assistant-qif-import.c] gfec_apply requires a list of arguments
* instead of argument, send a list of arguments.
* the undo scm function would never run otherwise
2019-08-03 17:25:49 +08:00
Christopher Lam 8b7093e8d0 [qif/test-qif-parse] initial commit
near-100% coverage for qif-parse.scm
2019-08-01 20:19:25 +08:00
Christopher Lam a7a3f78648 [qif/test-qif-imp] initial commit
* strings.scm
* qif-objects.scm
2019-08-01 20:19:09 +08:00
Christopher Lam db93aec58d [qif-utils] use srfi-13 instead of regexp functions 2019-07-30 18:17:52 +08:00
Christopher Lam fbb6a95600 [simple-obj] deprecate this module
* it's only a wrapper for make-record-type
* use record-types directly in modules
2019-07-30 18:17:52 +08:00
Christopher Lam 5de4b27b25 [balsheet-eg] dedupe functions 2019-07-28 22:57:46 +08:00
Christopher Lam 8cd7c6f755 [taxinvoice-eg] fix html
<nobr> has never been standard. Don't need it because (nbsp ...) will
insert <span white-space=nowrap> tags.
2019-07-28 22:57:46 +08:00
Christopher Lam 326927215c [eguile-html-utilities] dedupe, fix html
* prefer srfi-13 over regex
* instead of <nobr> use <span style="white-space:nowrap">
* reuse functions defined in eguile-gnc and eguile-utilities
* compact functions
* move make-regexp toplevel to ensure one compilation
2019-07-28 22:57:46 +08:00
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
Christopher Lam e5aabe41d8 [test-stress-options] fix to consider changes in master
* reports are loaded by the (gnucash reports) module.
* skip the "Hello, World" report which has option to trigger a crash.
2019-07-25 21:06:36 +08:00
Christopher Lam 720f176417 Merge branch 'maint' 2019-07-25 20:30:32 +08: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
Christopher Lam 63f484c555 Merge branch 'maint' 2019-07-20 21:13:54 +08: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
Christopher Lam 3514600841 [engine/test/CMakeLists] add new section for scheme tests 2019-07-20 00:14:32 +08:00
Christopher Lam d3f43fe360 [test-business-core] fix: module names were changed 2019-07-20 00:05:38 +08:00
Christopher Lam 6d75be3b5e [test-owner-report] fix: module names were changed 2019-07-19 22:56:18 +08:00
Christopher Lam d0af343ee4 Merge branch 'maint' 2019-07-19 22:41:17 +08: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