Bug 767772 - Associated file with transaction is lost

when moving entry between accounts

When using the cut transaction option the 'associated file' value was
not being pasted to the new transaction. Added scheme code to get this
value and save it to new transaction when using 'cut/copy' and then
'paste' operations. When using the duplicate option, a dialogue allows
you to keep the copied association or not. It does not get copied for
autocomplete.
This commit is contained in:
Robert Fewell
2018-10-31 12:05:34 +00:00
committed by Geert Janssens
parent 692e22668b
commit 2634f23f87
8 changed files with 117 additions and 13 deletions

View File

@@ -757,6 +757,7 @@ xaccTransCopyFromClipBoard(const Transaction *from_trans, Transaction *to_trans,
xaccTransSetNum(to_trans, xaccTransGetNum(from_trans));
xaccTransSetNotes(to_trans, xaccTransGetNotes(from_trans));
xaccTransSetAssociation(to_trans, xaccTransGetAssociation (from_trans));
if(!no_date)
{
xaccTransSetDatePostedSecs(to_trans, xaccTransRetDatePosted (from_trans));

View File

@@ -136,7 +136,7 @@
(make-record-type
"gnc:transaction-structure"
'(transaction-guid currency date-entered date-posted
num description notes split-scms)))
num description notes association split-scms)))
;; constructor
(define gnc:make-transaction-scm
@@ -168,6 +168,9 @@
(define gnc:transaction-scm-get-notes
(record-accessor gnc:transaction-structure 'notes))
(define gnc:transaction-scm-get-association
(record-accessor gnc:transaction-structure 'association))
(define gnc:transaction-scm-get-split-scms
(record-accessor gnc:transaction-structure 'split-scms))
@@ -206,6 +209,9 @@
(define gnc:transaction-scm-set-notes
(record-modifier gnc:transaction-structure 'notes))
(define gnc:transaction-scm-set-association
(record-modifier gnc:transaction-structure 'association))
(define gnc:transaction-scm-set-split-scms
(record-modifier gnc:transaction-structure 'split-scms))
@@ -235,6 +241,7 @@
#f)
(xaccTransGetDescription trans)
(xaccTransGetNotes trans)
(xaccTransGetAssociation trans)
(trans-splits 0)))
;; Copy a scheme representation of a transaction onto a C transaction.
@@ -254,11 +261,13 @@
(description (gnc:transaction-scm-get-description trans-scm))
(num (gnc:transaction-scm-get-num trans-scm))
(notes (gnc:transaction-scm-get-notes trans-scm))
(association (gnc:transaction-scm-get-association trans-scm))
(date-posted (gnc:transaction-scm-get-date-posted trans-scm)))
(if currency (xaccTransSetCurrency trans currency))
(if description (xaccTransSetDescription trans description))
(if num (xaccTransSetNum trans num))
(if notes (xaccTransSetNotes trans notes))
(if association (xaccTransSetAssociation trans association))
(if date-posted (xaccTransSetDatePostedSecs trans date-posted)))
;; strip off the old splits