Commit Graph

22235 Commits

Author SHA1 Message Date
Christopher Lam
fd76a31104 [utilities] deprecate gnc:substring-replace-from-to
with jqplot gone, no need to use this function anymore.
2020-02-19 06:19:27 +08:00
Christopher Lam
d5729306a0 [report-core] don't need to remove jquery anymore 2020-02-19 06:19:27 +08:00
David Cousens
8e1dba7eae Bug 797338 - Change "U+R" and "R" labels to "U+C" and "C" in Import matcher
This closes #554
2020-02-18 18:31:29 +01:00
Christopher Lam
1f83cfaf64 [html-chart] compact, use (ice-9 match)
Use (ice-9 match) for easier matching for the variable
'path'. Explanation; consider the snippet

(cond
 ((null? path) ...A...)
 ((and (pair? (car path)) (number (caar path))) ...B...)
 (else ...C...))

This snippet is a shorthand for nested if-then-else clauses, testing
'path' successfully to determine whether to evaluate A, B or C. Some
code will also use components of 'path' eg B uses (caar path).

Using Alex Shinn's match.scm library allows more concise matching and
assignment at the same time. The syntax is (match EXPR (CLAUSE BODY ...))

(define (try path)
 (match path
   (() (display "null"))
   ((((? number? idx)) . tail) (display "B") (display idx) (newline) (display tail))
   ((head . tail) (display "C") (display head) (newline) (display tail))))

A: the first match is easy -- if path is '() then evaluate the first
body.

     (try '())
 --> "null"

C: the third match is easy -- if path is a pair, then assign 'head' to
pair's car, 'tail' to the pair's cdr, and evaluate the body which has
access to head and tail. Note the head is a string, and the tail is a
list containing a single string.

     (try '("this" "that"))
 --> Cthis
     (that)

B: the second match is more difficult -- let's consider the
broken-down clause: a pair, (HEAD . tail); where HEAD is a
single-element list (ELT), and ELT is a match conditional satisfying
number? and is also assigns the variable idx (? number? idx).

Example:
    (try '((2) "two"))
--> B2
    (two)

This means the match is successful when 'path' is a pair, the pair's
car is a single-element list, and the list's sole element is a
number. The latter is bound to the variable 'idx' which is accessible
in the body. The variable 'tail' contains the path's cdr which
contains a single string.

Note: later in same commit we also use the identifier _ to denote
elements which *must* be matched, but are *not* bound to any variable.

e.g. the clause (((? out-of-bound?)) . _) means that path is a pair,
whose car is a single-element list, and the element satisfies the
predicate out-of-bound?. We don't need to use the (cdr path) therefore
we use _ as a placeholder.
2020-02-18 18:44:12 +08:00
Christopher Lam
172e371d8a [report-core] compact, use (ice-9 match) 2020-02-18 18:21:44 +08:00
Christopher Lam
c671c57947 [jqplot] bye bye jqplot 2020-02-18 18:21:44 +08:00
Robert Fewell
6149352e6b Bug 797489 - No option to use account codes in Budget View - Part2
Add option to allow the account code column to be shown in the budget
tree view and as such the account tree view can be sorted by this column
2020-02-17 14:14:43 +00:00
Robert Fewell
2b2fa8476e Change the negative numbers CSS class name to new format
Change from negative-numbers to gnc-class-negative-numbers
2020-02-17 13:36:11 +00:00
Robert Fewell
e7cfcb3f70 Rename dialog-utils get_negative_color
Rename dialog-utils 'get_negative_color' to 'gnc_get_negative_color' as
it is used in more than one source file.
2020-02-17 13:28:27 +00:00
Robert Fewell
bc14e05027 Use a cached value for preference 'use red for negative' in budgets
Instead of retrieving the preference 'use red for negative numbers'
every time the budget cells are updated/refreshed which could be many
times retrieve it on create and store it in GncBudgetView and set up a
preference call back to track the value.
2020-02-17 13:14:23 +00:00
Robert Fewell
1d1d736938 Change some additional spacing in source files gnc-budget-view.* 2020-02-17 12:49:34 +00:00
Robert Fewell
ff514e3b37 Bug797486 - Add dialog to cascade placeholder and hidden
Make changes to the existing cascade colour dialog to allow the
selection of cascading colour, placeholder and hidden account properties
2020-02-17 12:07:01 +00:00
Robert Fewell
ad4c150db9 Bug 797485 - Show account hidden column on CoA.
To make it easier to change the hidden property on multiple accounts,
a new column can be added to the CoA to toggle the account hidden
property. This only makes sense if the 'View->Filter By...' other tab
has been accessed to enable showing of hidden accounts first.
2020-02-17 11:48:19 +00:00
Robert Fewell
f2cc1a1c35 Realign text in dialog-billterms.glade
Missed changing the alignment of text when you select 'Proximo' and
change to using a grid widget.
2020-02-17 11:36:49 +00:00
Robert Fewell
5475f39f0b Merge branch 'maint' 2020-02-17 10:33:00 +00:00
Geert Janssens
7a16e04822 Use GNUCASH_BUILD_ID in the gnucash appdata file
Add it to the release version if
- it was defined
- and it's not the same as GNC_VCS_REV
2020-02-16 20:02:47 +01:00
Robert Fewell
832ad7e85e Reformat source files gnc-plugin-page.*
Change tabs for spaces and change some space positioning.
2020-02-16 14:39:37 +00:00
Robert Fewell
ba1af5504d Add the 'page_changed' signal to GncEmbeddedWindow
This fixes an error message 'page_changed is invalid for instance of
type GncEmbeddedWindow' when you double click on the selected schedule
in the sx editor.
2020-02-16 14:38:38 +00:00
Robert Fewell
ce0d52e1ef Reports were not being loaded
The reports page uses a g_idle_add against the plugin_page to load the
report once the container for the report is realized. With the changes
to the page focus functions, the use of g_idle_remove_by_data removed
this idle function so no report. Change the page focus functions to
record the id used and then use this id to remove the page focus idle
function.
2020-02-16 14:37:43 +00:00
Christopher Lam
c60555e9c5 [stylesheet-css] reflect recent changes to default CSS
default css contains changes:
* td.highlight
* dark color schemes
2020-02-16 22:28:55 +08:00
Christopher Lam
efed709414 Merge branch 'maint' 2020-02-15 23:13:40 +08:00
Christopher Lam
555a467aba [new-owner-report] revert highlight trigger to onclick
and use Windows libwebkit1-compatible javascript
2020-02-15 22:25:21 +08:00
Christopher Lam
3ac60ed2e4 compact, use (ice-9 match) 2020-02-15 18:28:21 +08:00
Robert Fewell
b23d2445fc New budgets save state information with no changes
If you create a new budget and do not change any thing when closing the
budget or quitting with new budget open the state information for that
budget is saved but the budget is not. To fix this make a change to the
new budget description to force the save of the new budget.
2020-02-13 16:34:25 +00:00
Robert Fewell
7577afe0a9 Bug 796911 - Minimum window width to large.
This is down to the amount of information that is displayed on the
register status bar which can also be influenced by the type of
register being displayed. To fix this the text labels used have been
enabled to ellipsize at the end and also the displayed information has
been added to a tooltip. So for example the minimum app size was
957x736 and after the changes it can be 610x475.
2020-02-13 15:00:54 +00:00
Robert Fewell
f66b7ed275 Follow up to previous commit 94cb965
This commit moves the setting up of the page changed signal callback to
when the plugin page is inserted and also records the id used. This is
used to disconnect this callback when the page is moved to a different
window and also when the page is destroyed.
2020-02-13 10:34:56 +00:00
Christopher Lam
907bff34c3 [gnc-module] clean up deprecation warnings
* use reasonable max-width
* compact code
* use (ice-9 match)
2020-02-09 11:34:43 +08:00
Christopher Lam
f5c0ddd786 Merge branch 'maint' 2020-02-09 11:30:10 +08:00
Christopher Lam
58ddb47f56 [new-owner-report] change highlight trigger: onclick to onmousedown
and also disable event propagation; this disables text selection
2020-02-09 11:29:28 +08:00
Christopher Lam
3be42bebb8 [test-new-owner-report] refine test to target exact table row 2020-02-09 10:35:03 +08:00
Christopher Lam
18acb42344 [new-owner-report] clarify payment-txn processor
use unique varnames
2020-02-09 10:34:58 +08:00
Christopher Lam
09d3e95379 [new-owner-report] if Payment amount is negative, label "Refund"
and add logic to properly handle AP/AR negation rules
2020-02-09 10:10:38 +08:00
Christopher Lam
6e64a37839 [new-owner-report] fix comment for non-document accumulator 2020-02-09 10:10:34 +08:00
Christopher Lam
19db1daed6 Bug 797419 - equity-statement unrealized-gain calculator uses weighted-average
for consistency. all other unrealized-gain calculators use average-cost.
2020-02-08 23:46:29 +08:00
Christopher Lam
7cbe367caf [new-owner-report] LHS invoice->payment LINK/PAYMENT merge
* invoice->payment LINK or PAYMENT txns are handled identically. Merge.
* reorder definitions in document handler.
* rename variable 'invoice' to 'document'; invoice was clashing with
  outer variable. This fixes a credit-note negation bug.
2020-02-08 23:46:17 +08:00
Christopher Lam
70d8acc7ac [test-new-owner-report] add tests for "$120 to partially repay" 2020-02-08 22:47:32 +08:00
Christopher Lam
50b882aa82 [test-new-owner-report] import reports to allow testing 2020-02-08 22:21:46 +08:00
Christopher Lam
f07c7e6fa7 [new-owner-report] use engine's debit/credit string functions
... instead of the deprecated ones
2020-02-08 22:21:40 +08:00
Geert Janssens
69df81e7ef Merge branch 'maint'
- gettext minimum required version on master becomes 0.19.6
- simplify gettext detection code and appdata/desktop file creation
  based on this new minimum
- fix merge conflict for new test-new-owner-report
- update deprecated scheme modules for test-new-owner-report
2020-02-08 14:32:21 +01:00
Geert Janssens
1ccea05b6e CMake - drop LC_ALL=C for generation of appdata and desktop files
It doesn't seem to have any noticable effect.
2020-02-08 13:54:28 +01:00
Geert Janssens
cce69e37d2 Rework appdata and desktop file generation
- attempt to merge in translations before merging in version data
- add the intermediate file (with translations) to the dist tarball
- dist builds no longer have to run the translation merge, but can instead
  use the included intermediate file. This accomodates distros with
  older gettext versions.
2020-02-08 13:43:02 +01:00
Geert Janssens
8243496ed0 Rework our gettext tests
- only abort configuration if gettext is older than 0.18.1 (required for string extraction from scheme files)
- otherwise always continue but disable a few other build steps depending on the gettext version
- use feature variables to more clearly convey what is enabled or disabled
2020-02-08 13:19:23 +01:00
Geert Janssens
f27cbd4a11 Fix dist after renaming account directory hu_HU to hu 2020-02-08 13:19:23 +01:00
Christopher Lam
e90e9cbd8c [test-new-owner-report] initial commit
Tests some basic business transactions

* 1 invoice for $6.75

* 1 invoice for $11.50
  2 partial payments $1.50 and $2.00

* 1 credit-note for $3.00

* 1 invoice for $28
  1 credit note for $27
  1 payment linking both including $1 bank transfer
2020-02-08 09:02:12 +08:00
Christopher Lam
9a90e97009 [new-owner-report] negate RHS inv amounts if credit-note. 2020-02-08 09:02:07 +08:00
Geert Janssens
2d907ff495 Lower gettext version again until a better solution is found 2020-02-06 20:10:42 +01:00
Geert Janssens
01f00a35fb Fix tests for previous commit 2020-02-06 18:50:50 +01:00
Geert Janssens
74c007312e Update lot-viewer report for master's guile refactoring 2020-02-06 17:10:18 +01:00
Geert Janssens
ab5b7155af CMake - remove parameter repetition in else() and endif() statements
Fix leftovers after the maint branch merge
2020-02-06 17:01:26 +01:00
Geert Janssens
301db9020d Merge branch 'maint' 2020-02-06 16:50:08 +01:00