Hi Peter

If you're comfortable patching transaction.scm, here are the changes to
enable grouping/subtotals according to either memo or notes.
(Not thoroughly tested)

C


On 30 April 2018 at 14:34, Peter Jackson <jack...@fastmail.net> wrote:

> Essentially,
> 1) Primary Key = Memo/Notes
> 2) Sort on Primary Key
> 3) Consolidate Transactions over selected period. The Standard Gnucash
> Period offering is fine.
>
> Regards
>
> Peter
>
>
> On 29 April 2018 at 23:22, Christopher Lam <christopher....@gmail.com>
> wrote:
>
>> Hi Peter
>>
>> Just putting out there... Which part of the Consolidated Transaction
>> Report is particularly useful?
>>
>> I think the Transaction Report 3.1 can be augmented to support some of
>> them...
>>
>> HTH
>>
>>
>> On 30/04/18 05:58, John Ralls wrote:
>>
>>>
>>> On Apr 29, 2018, at 12:28 PM, Peter Jackson <jack...@fastmail.net>
>>>> wrote:
>>>>
>>>> Thank you for v 3.1, which on a clean install, opens my gnucash file and
>>>> runs perfectly.
>>>> However, if I install it over my existing 2.6.21 application, v3.1
>>>> crashes
>>>> as it is loading ...../Reports-Gnome.
>>>> Of course I want to be able to do this so that I can run my Saved
>>>> Reports,
>>>> especially Cindy's excellent Consolidated Transaction report.
>>>> Will the ability to install over 2.6.21 and convert the reports be
>>>> addressed in a later release?
>>>>
>>> Sounds like the Doughty reports aren't compatible with the changes in
>>> GnuCash's API; I'd guess that it has to do with date handling. They're not
>>> part of GnuCash and the GnuCash development team doesn't support them.
>>> Since nothing has been heard from the author in almost a year it seems that
>>> they're not interested in supporting the reports either. Sorry.
>>>
>>> Regards,
>>> John Ralls
>>>
>>>
>>> _______________________________________________
>>> gnucash-user mailing list
>>> gnucash-u...@gnucash.org
>>> To update your subscription preferences or to unsubscribe:
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>> If you are using Nabble or Gmane, please see
>>> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>> -----
>>> Please remember to CC this list on all your replies.
>>> You can do this by using Reply-To-List or Reply-All.
>>>
>>
>>
>
diff --git a/gnucash/report/standard-reports/transaction.scm b/gnucash/report/standard-reports/transaction.scm
index 6dbb8945a..c6d050abf 100644
--- a/gnucash/report/standard-reports/transaction.scm
+++ b/gnucash/report/standard-reports/transaction.scm
@@ -117,11 +117,13 @@ in the Options panel."))
 ;; which a subtotal should be enabled.
 (define SUBTOTAL-ENABLED (list 'account-name 'corresponding-acc-name
                                'account-code 'corresponding-acc-code
+                               'memo 'notes
                                'reconciled-status))
 
 (define ACCOUNT-SORTING-TYPES (list 'account-name 'corresponding-acc-name
                                     'account-code 'corresponding-acc-code))
-(define CUSTOM-SORTING (list 'reconciled-status))
+
+(define CUSTOM-SORTING (list 'notes 'reconciled-status))
 
 (define SORTKEY-INFORMAL-HEADERS (list 'account-name 'account-code))
 
@@ -227,10 +229,16 @@ in the Options panel."))
                                    (cons 'renderer-fn #f)))
 
         (cons 'memo          (list (cons 'sortkey (list SPLIT-MEMO))
-                                   (cons 'split-sortvalue #f)
+                                   (cons 'split-sortvalue (lambda(a) (xaccSplitGetMemo a)))
                                    (cons 'text (_ "Memo"))
                                    (cons 'tip (_ "Sort by memo."))
-                                   (cons 'renderer-fn #f)))
+                                   (cons 'renderer-fn (lambda (a) (xaccSplitGetMemo a)))))
+
+        (cons 'notes         (list (cons 'sortkey #f)
+                                   (cons 'split-sortvalue (lambda (a) (xaccTransGetNotes (xaccSplitGetParent a))))
+                                   (cons 'text (_ "Notes"))
+                                   (cons 'tip (_ "Sort by notes."))
+                                   (cons 'renderer-fn (lambda (a) (xaccTransGetNotes (xaccSplitGetParent a))))))
 
         (cons 'none          (list (cons 'sortkey '())
                                    (cons 'split-sortvalue #f)
@@ -1418,7 +1426,7 @@ tags within description, notes or memo. ")
           (render-date date-subtotal-key split))
          ((member sortkey ACCOUNT-SORTING-TYPES)
           (render-account sortkey split anchor?))
-         ((eq? sortkey 'reconciled-status)
+         (else
           (render-generic sortkey split)))))
 
     (define (render-grand-total)
@@ -1808,6 +1816,7 @@ tags within description, notes or memo. ")
               ((t-number) (lambda (s) (xaccTransGetNum (xaccSplitGetParent s))))
               ((register-order) (lambda (s) #f))
               ((memo) (lambda (s) (xaccSplitGetMemo s)))
+              ((notes) (lambda (s) (xaccTransGetNotes (xaccSplitGetParent s))))
               ((none) (lambda (s) #f)))))
       (cond
        ((string? (comparator-function X)) ((if ascend? string<? string>?) (comparator-function X) (comparator-function Y)))
_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to