* src/import-export/qif-import/qif-file.scm: mark "splits" as negative

to make sure the numbers are reflected appropriately.
	* src/import-export/qif-import/qif-objects.scm: add a neg? value to
	  a qif-split; use this when converting the split-amount.
	Fixes bug #105179


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7942 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2003-02-04 15:47:21 +00:00
parent 99620e4d4e
commit bc9f171dd7
3 changed files with 24 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2003-02-04 Derek Atkins <derek@ihtfp.com>
* src/import-export/qif-import/qif-file.scm: mark "splits" as negative
to make sure the numbers are reflected appropriately.
* src/import-export/qif-import/qif-objects.scm: add a neg? value to
a qif-split; use this when converting the split-amount.
Fixes bug #105179
2003-02-03 Derek Atkins <derek@ihtfp.com>
* src/calculation/Makefile.am: need to add GUILE_INCS

View File

@ -174,6 +174,9 @@
(qif-split:set-category! default-split value)))
;; S : split category
;; At this point we are ignoring the default-split
;; completely! So, we need to reverse the current-split
;; values!
((#\S)
(set! current-split (make-qif-split))
(set! default-split #f)
@ -190,7 +193,9 @@
;; $ : split amount (if there are splits)
((#\$)
(if current-split
(qif-split:set-amount! current-split value)))
(begin
(qif-split:set-amount! current-split value)
(qif-split:set-neg! current-split #t))))
;; ^ : end-of-record
((#\^)

View File

@ -82,7 +82,7 @@
(make-simple-class
'qif-split
'(category class memo amount category-is-account? matching-cleared mark
miscx-category miscx-is-account? miscx-class)))
miscx-category miscx-is-account? miscx-class negative)))
(define qif-split:category
(simple-obj-getter <qif-split> 'category))
@ -124,6 +124,12 @@
(define qif-split:set-amount!
(simple-obj-setter <qif-split> 'amount))
(define qif-split:neg?
(simple-obj-getter <qif-split> 'negative))
(define qif-split:set-neg!
(simple-obj-setter <qif-split> 'negative))
(define qif-split:mark
(simple-obj-getter <qif-split> 'mark))
@ -163,6 +169,7 @@
(define (make-qif-split)
(let ((self (make-simple-obj <qif-split>)))
(qif-split:set-category! self "")
(qif-split:set-neg! self #f)
self))
@ -288,7 +295,8 @@
(define (qif-xtn:set-split-amounts! self amounts)
(map
(lambda (split amount)
(qif-split:set-amount! split amount))
(let ((neg? (qif-split:neg? split)))
(qif-split:set-amount! split (if neg? (gnc:numeric-neg amount) amount))))
(qif-xtn:splits self) amounts))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;