Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.54 KB | None | 0 0
  1. diff --git a/gnucash/report/report-system/trep-engine.scm b/gnucash/report/report-system/trep-engine.scm
  2. index 7509a40ad..899ebb1c0 100644
  3. --- a/gnucash/report/report-system/trep-engine.scm
  4. +++ b/gnucash/report/report-system/trep-engine.scm
  5. @@ -89,6 +89,8 @@
  6.  (define optname-transaction-matcher (N_ "Transaction Filter"))
  7.  (define optname-transaction-matcher-regex
  8.    (N_ "Use regular expressions for transaction filter"))
  9. +(define optname-transaction-matcher-exclude
  10. +  (N_ "Exclude transactions matching the filter"))
  11.  (define optname-reconcile-status (N_ "Reconcile Status"))
  12.  (define optname-void-transactions (N_ "Void Transactions"))
  13.  (define optname-closing-transactions (N_ "Closing transactions"))
  14. @@ -604,6 +606,13 @@ enable full POSIX regular expressions capabilities. '#work|#family' will match b
  15.  tags within description, notes or memo. ")
  16.      #f))
  17.  
  18. +  (gnc:register-trep-option
  19. +   (gnc:make-simple-boolean-option
  20. +    pagename-filter optname-transaction-matcher-exclude
  21. +    "i3"
  22. +    (_ "If this option is selected, transactions matching above are excluded.")
  23. +    #f))
  24. +
  25.    (gnc:register-trep-option
  26.     (gnc:make-multichoice-option
  27.      pagename-filter optname-reconcile-status
  28. @@ -1969,6 +1978,8 @@ be excluded from periodic reporting.")
  29.                       (lambda () (make-regexp transaction-matcher))
  30.                       (const 'invalid-transaction-regex))
  31.                     'no-guile-regex-support)))
  32. +         (transaction-exclude-match?
  33. +          (opt-val pagename-filter optname-transaction-matcher-exclude))
  34.           (reconcile-status-filter
  35.            (keylist-get-info reconcile-status-list
  36.                              (opt-val pagename-filter optname-reconcile-status)
  37. @@ -2129,9 +2140,10 @@ be excluded from periodic reporting.")
  38.                      ((include) (is-filter-member split c_account_2))
  39.                      ((exclude) (not (is-filter-member split c_account_2))))
  40.                    (or (string-null? transaction-matcher)
  41. -                      (match? (xaccTransGetDescription trans))
  42. -                      (match? (xaccTransGetNotes trans))
  43. -                      (match? (xaccSplitGetMemo split)))
  44. +                      ((if transaction-exclude-match? not identity)
  45. +                       (or (match? (xaccTransGetDescription trans))
  46. +                           (match? (xaccTransGetNotes trans))
  47. +                           (match? (xaccSplitGetMemo split)))))
  48.                    (or (not custom-split-filter)
  49.                        (custom-split-filter split)))))
  50.           splits))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement