r18409 - gnucash/trunk/src/tax/us - Bug #554394: Fix (incomplete) German tax report with latest txf.scm changes.
Christian Stimming
cstim at code.gnucash.org
Wed Nov 11 15:13:49 EST 2009
Author: cstim
Date: 2009-11-11 15:13:48 -0500 (Wed, 11 Nov 2009)
New Revision: 18409
Trac: http://svn.gnucash.org/trac/changeset/18409
Modified:
gnucash/trunk/src/tax/us/txf-de_DE.scm
Log:
Bug #554394: Fix (incomplete) German tax report with latest txf.scm changes.
Patch by J. Alex Aycinena.
Modified: gnucash/trunk/src/tax/us/txf-de_DE.scm
===================================================================
--- gnucash/trunk/src/tax/us/txf-de_DE.scm 2009-11-09 23:35:25 UTC (rev 18408)
+++ gnucash/trunk/src/tax/us/txf-de_DE.scm 2009-11-11 20:13:48 UTC (rev 18409)
@@ -15,31 +15,80 @@
;; e.g. the Winston software
;; http://www.felfri.de/winston/schnittstellen.htm
;;
-(define (gnc:txf-get-payer-name-source categories code)
- (gnc:txf-get-code-info categories code 0))
-(define (gnc:txf-get-form categories code)
- (gnc:txf-get-code-info categories code 1))
-(define (gnc:txf-get-description categories code)
- (gnc:txf-get-code-info categories code 2))
-(define (gnc:txf-get-format categories code)
- (gnc:txf-get-code-info categories code 3))
-(define (gnc:txf-get-multiple categories code)
- (gnc:txf-get-code-info categories code 4))
-(define (gnc:txf-get-category-key categories code)
- (gnc:txf-get-code-info categories code 5))
+
+(define txf-tax-entity-types
+ (list
+ (cons 'Ind #("Individual, Joint, etc." "Files Individual German Tax Return"))
+ (cons 'Other #("None" "No Income Tax Options Provided"))))
+
+(define (gnc:tax-type-txf-get-code-info tax-entity-types type-code index)
+ (let ((tax-entity-type (assv type-code tax-entity-types)))
+ (and tax-entity-type
+ (vector-ref (cdr tax-entity-type) index))))
+
+(define (gnc:txf-get-tax-entity-type type-code)
+ (gnc:tax-type-txf-get-code-info txf-tax-entity-types type-code 0))
+
+(define (gnc:txf-get-tax-entity-type-description type-code)
+ (gnc:tax-type-txf-get-code-info txf-tax-entity-types type-code 1))
+
+(define (gnc:txf-get-tax-entity-type-codes)
+ (map car txf-tax-entity-types))
+
+(define (gnc:txf-get-payer-name-source categories code tax-entity-type)
+ (gnc:txf-get-code-info categories code 0 tax-entity-type))
+(define (gnc:txf-get-form categories code tax-entity-type)
+ (gnc:txf-get-code-info categories code 1 tax-entity-type))
+(define (gnc:txf-get-description categories code tax-entity-type)
+ (gnc:txf-get-code-info categories code 2 tax-entity-type))
+(define (gnc:txf-get-format categories code tax-entity-type)
+ (gnc:txf-get-code-info categories code 3 tax-entity-type))
+(define (gnc:txf-get-multiple categories code tax-entity-type)
+ (gnc:txf-get-code-info categories code 4 tax-entity-type))
+(define (gnc:txf-get-category-key categories code tax-entity-type)
+ (gnc:txf-get-code-info categories code 5 tax-entity-type))
+(define (gnc:txf-get-line-data categories code tax-entity-type)
+ (let* ((tax-entity-codes (cdr (assv (string->symbol tax-entity-type)
+ categories)))
+ (category (assv code tax-entity-codes)))
+ (if (or (not category) (< (vector-length (cdr category)) 7))
+ #f
+ (gnc:txf-get-code-info categories code 6 tax-entity-type))))
+(define (gnc:txf-get-last-year categories code tax-entity-type)
+ (let* ((tax-entity-codes (cdr (assv (string->symbol tax-entity-type)
+ categories)))
+ (category (assv code tax-entity-codes)))
+ (if (or (not category) (< (vector-length (cdr category)) 8))
+ #f
+ (gnc:txf-get-code-info categories code 7 tax-entity-type))))
+
(define (gnc:txf-get-help categories code)
(let ((pair (assv code txf-help-strings)))
(if pair
(cdr pair)
"No help available.")))
-(define (gnc:txf-get-codes categories)
- (map car categories))
+(define (gnc:txf-get-codes categories tax-entity-type)
+ (let* ((tax-entity-code-list-pair (assv (if (eqv? tax-entity-type "")
+ 'Ind
+ (string->symbol tax-entity-type))
+ categories))
+ (tax-entity-codes (if tax-entity-code-list-pair
+ (cdr tax-entity-code-list-pair)
+ '())))
+ (map car tax-entity-codes)))
;;;; Private
-(define (gnc:txf-get-code-info categories code index)
- (let ((category (assv code categories)))
+(define (gnc:txf-get-code-info categories code index tax-entity-type)
+ (let* ((tax-entity-code-list-pair (assv (if (eqv? tax-entity-type "")
+ 'Ind
+ (string->symbol tax-entity-type))
+ categories))
+ (tax-entity-codes (if tax-entity-code-list-pair
+ (cdr tax-entity-code-list-pair)
+ '()))
+ (category (assv code tax-entity-codes)))
(and category
(vector-ref (cdr category) index))))
@@ -56,7 +105,9 @@
;; Format: (name-source form description format multiple category-key)
(define txf-income-categories
- (list
+ (list
+ (cons 'Ind
+ (list
(cons 'N000 #(none "" "Nur zur Voransicht im Steuer-Bericht -- kein Export" 0 #f ""))
(cons 'K35 #(none "35" "Umsätze, die anderen Steuersätzen unterliegen (Bemessungsgrundlage)" 2 #f "35"))
@@ -82,7 +133,9 @@
(cons 'K97 #(none "97" "Steuerpflichtige innergemeinschaftliche Erwerbe zum Steuersatz von 16 v.H." 2 #f "97"))
(cons 'K98 #(none "98" "Steuerpflichtige innergemeinschaftliche Erwerbe zu anderen Steuersätzen (Steuer)" 1 #f "98"))
- ))
+ )
+ )
+))
;; We use several formats; nr. 1 means Euro+Cent, nr. 2 means only full Euro
@@ -92,7 +145,9 @@
;; Format: (name-source form description format multiple category-key)
(define txf-expense-categories
- (list
+ (list
+ (cons 'Ind
+ (list
(cons 'N000 #(none "" "Nur zur Voransicht im Steuer-Bericht -- kein Export" 0 #f ""))
(cons 'K52 #(none "52" "Leistungen eines im Ausland ansässigen Unternehmers (Bemessungsgrundlage)" 2 #f "52"))
@@ -114,10 +169,28 @@
(cons 'K94 #(none "94" "Innergemeinschaftliche Erwerbe neuer Fahrzeuge von Lieferern ohne USt-IdNr. (Bemessungsgrundlage)" 2 #f "94"))
(cons 'K95 #(none "95" "Steuerpflichtige innergemeinschaftliche Erwerbe zu anderen Steuersätzen (Bemessungsgrundlage)" 2 #f "95"))
(cons 'K96 #(none "96" "Innergemeinschaftliche Erwerbe neuer Fahrzeuge von Lieferern ohne USt-IdNr. (Steuer)" 1 #f "96"))
+ )
+ )
))
+(define txf-asset-categories
+ (list
+ (cons 'Ind
+ (list
+ (cons 'N000 #(none "" "Nur zur Voransicht im Steuer-Bericht -- kein Export" 0 #f ""))
+ )
+ )
+))
+(define txf-liab-eq-categories
+ (list
+ (cons 'Ind
+ (list
+ (cons 'N000 #(none "" "Nur zur Voransicht im Steuer-Bericht -- kein Export" 0 #f ""))
+ )
+ )
+))
;;; Register global options in this book
(define (book-options-generator options)
More information about the gnucash-changes
mailing list