Derek Atkins' qif importer patch.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3728 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-03-01 21:36:21 +00:00
parent 1fdbf22c2d
commit fbf73bf006
2 changed files with 13 additions and 15 deletions

View File

@ -35,11 +35,6 @@
(start-time #f)
(end-time #f)
(delimiters (string #\cr #\nl))
(valid-acct-types
'(type:bank type:cash
type:ccard type:invst
type:port
#{type:oth\ a}# #{type:oth\ l}#))
(progress-dialog #f)
(file-stats (stat path))
(file-size (stat:size file-stats))

View File

@ -271,6 +271,14 @@
(ok-types (qif-map-entry:allowed-types acctinfo))
(equity? (memv GNC-EQUITY-TYPE ok-types)))
;; Debug
;; (for-each
;; (lambda (expr)
;; (display expr))
;; (list "Account: " acctinfo "\nsecurity = " security
;; "\nequity? = " equity?
;; "\n"))
(cond ((and equity? security) ;; a "retained holdings" acct
(qif-import:find-or-make-acct acctinfo #f
security security
@ -452,15 +460,12 @@
;; in the acct-hash if it's an account.
((and (not (string=? cat ""))
(qif-split:category-is-account? qif-split))
(set! far-acct-info
(hash-ref qif-acct-map
(qif-split:category qif-split))))
(set! far-acct-info (hash-ref qif-acct-map cat)))
;; .. look it up in the cat-hash if it's a category
((not (string=? cat ""))
(set! far-acct-info
(hash-ref qif-cat-map
(qif-split:category qif-split))))
(set! far-acct-info (hash-ref qif-cat-map cat)))
;; otherwise, try to find the payee in the
;; memo-map if it's likely to have been used (only
;; 1 split). then try the memo. if neither
@ -476,10 +481,8 @@
(not (string=? qif-memo ""))
(hash-ref qif-memo-map memo))))
(if (not far-acct-info)
(set! far-acct-info
(hash-ref
qif-cat-map
(qif-split:category qif-split))))))
(set! far-acct-info (hash-ref qif-cat-map cat)))))
(set! far-acct-name (qif-map-entry:gnc-name far-acct-info))
(set! far-acct (hash-ref gnc-acct-hash far-acct-name))