Bug #141003: QIF Import: Allow the British Pound symbol and the dollar symbol to be used interchangeably.

BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17489 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Charles Day 2008-09-02 20:20:09 +00:00
parent a1d189431e
commit b55b08e4cf
3 changed files with 11 additions and 10 deletions

View File

@ -287,7 +287,8 @@
(qif-split:set-memo! current-split value))) (qif-split:set-memo! current-split value)))
;; $ : split amount (if there are splits) ;; $ : split amount (if there are splits)
((#\$) ;; Also allowing pound symbol just in case (#141003)
((#\$ #\£)
(if (and current-split (if (and current-split
(not-bad-numeric-string? value)) (not-bad-numeric-string? value))
(qif-split:set-amount! current-split value))) (qif-split:set-amount! current-split value)))

View File

@ -177,7 +177,7 @@
;; [Y] name of security ;; [Y] name of security
;; [O] commission (parsed) ;; [O] commission (parsed)
;; [L] category : string ;; [L] category : string
;; [S]/[E]/[$] splits : a list of <qif-split> ;; [S]/[E]/[$]/[£] splits : a list of <qif-split>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define <qif-xtn> (define <qif-xtn>

View File

@ -19,13 +19,13 @@
(define decimal-radix-regexp (define decimal-radix-regexp
(make-regexp (make-regexp
"^ *\\$?[+-]?\\$?[0-9]+$|^ *\\$?[+-]?\\$?[0-9]?[0-9]?[0-9]?([,'][0-9][0-9][0-9])*(\\.[0-9]*)? *$|^ *\\$?[+-]?\\$?[0-9]+\\.[0-9]* *$")) "^ *[$£]?[+-]?[$£]?[0-9]+$|^ *[$£]?[+-]?[$£]?[0-9]?[0-9]?[0-9]?([,'][0-9][0-9][0-9])*(\\.[0-9]*)? *$|^ *[$£]?[+-]?[$£]?[0-9]+\\.[0-9]* *$"))
(define comma-radix-regexp (define comma-radix-regexp
(make-regexp (make-regexp
"^ *\\$?[+-]?\\$?[0-9]+$|^ *\\$?[+-]?\\$?[0-9]?[0-9]?[0-9]?([\\.'][0-9][0-9][0-9])*(,[0-9]*)? *$|^ *\\$?[+-]?\\$?[0-9]+,[0-9]* *$")) "^ *[$£]?[+-]?[$£]?[0-9]+$|^ *[$£]?[+-]?[$£]?[0-9]?[0-9]?[0-9]?([\\.'][0-9][0-9][0-9])*(,[0-9]*)? *$|^ *[$£]?[+-]?[$£]?[0-9]+,[0-9]* *$"))
(define integer-regexp (make-regexp "^\\$?[+-]?\\$?[0-9]+ *$")) (define integer-regexp (make-regexp "^[$£]?[+-]?[$£]?[0-9]+ *$"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; qif-split:parse-category ;; qif-split:parse-category
@ -549,7 +549,7 @@
(define (qif-parse:parse-number/format value-string format) (define (qif-parse:parse-number/format value-string format)
(case format (case format
((decimal) ((decimal)
(let* ((filtered-string (gnc:string-delete-chars value-string ",$'")) (let* ((filtered-string (gnc:string-delete-chars value-string ",$£'"))
(read-val (with-input-from-string filtered-string (read-val (with-input-from-string filtered-string
(lambda () (read))))) (lambda () (read)))))
(if (number? read-val) (if (number? read-val)
@ -561,7 +561,7 @@
(gnc-numeric-zero)))) (gnc-numeric-zero))))
((comma) ((comma)
(let* ((filtered-string (gnc:string-replace-char (let* ((filtered-string (gnc:string-replace-char
(gnc:string-delete-chars value-string ".$'") (gnc:string-delete-chars value-string ".$£'")
#\, #\.)) #\, #\.))
(read-val (with-input-from-string filtered-string (read-val (with-input-from-string filtered-string
(lambda () (read))))) (lambda () (read)))))
@ -573,8 +573,8 @@
GNC-RND-ROUND)) GNC-RND-ROUND))
(gnc-numeric-zero)))) (gnc-numeric-zero))))
((integer) ((integer)
(let ((read-val (with-input-from-string (string-remove-char value-string (let ((read-val (with-input-from-string
#\$) (gnc:string-delete-chars value-string "$£'")
(lambda () (read))))) (lambda () (read)))))
(if (number? read-val) (if (number? read-val)
(double-to-gnc-numeric (double-to-gnc-numeric