mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add tax module.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5200 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
449c6ea7f0
commit
12e23fa376
@ -681,6 +681,9 @@ AC_OUTPUT(
|
|||||||
src/scm/Makefile
|
src/scm/Makefile
|
||||||
src/scm/gnumeric/Makefile
|
src/scm/gnumeric/Makefile
|
||||||
src/scm/printing/Makefile
|
src/scm/printing/Makefile
|
||||||
|
src/tax/Makefile
|
||||||
|
src/tax/us/Makefile
|
||||||
|
src/tax/us/test/Makefile
|
||||||
src/test-core/Makefile
|
src/test-core/Makefile
|
||||||
|
|
||||||
dnl # non-makefiles
|
dnl # non-makefiles
|
||||||
|
@ -6,6 +6,7 @@ SUBDIRS = \
|
|||||||
engine \
|
engine \
|
||||||
backend \
|
backend \
|
||||||
calculation \
|
calculation \
|
||||||
|
tax \
|
||||||
app-utils \
|
app-utils \
|
||||||
register \
|
register \
|
||||||
import-export \
|
import-export \
|
||||||
|
@ -38,3 +38,5 @@ report/stylesheets predefined style sheet templates
|
|||||||
|
|
||||||
app-utils utils for the gnucash app framework (component
|
app-utils utils for the gnucash app framework (component
|
||||||
mgr, cmd line processing, gettext stuff, etc)
|
mgr, cmd line processing, gettext stuff, etc)
|
||||||
|
|
||||||
|
tax/us US tax information
|
||||||
|
@ -266,12 +266,12 @@ gnc_ui_account_get_tax_info_string (Account *account)
|
|||||||
{
|
{
|
||||||
GNCModule module;
|
GNCModule module;
|
||||||
|
|
||||||
module = gnc_module_load ("gnucash/report/locale-specific/us", 0);
|
module = gnc_module_load ("gnucash/tax/us", 0);
|
||||||
|
|
||||||
g_return_val_if_fail (module, NULL);
|
g_return_val_if_fail (module, NULL);
|
||||||
|
|
||||||
get_form = gh_eval_str ("gnc:txf-get-form");
|
get_form = gh_eval_str ("(false-if-exception gnc:txf-get-form)");
|
||||||
get_desc = gh_eval_str ("gnc:txf-get-description");
|
get_desc = gh_eval_str ("(false-if-exception gnc:txf-get-description)");
|
||||||
}
|
}
|
||||||
|
|
||||||
g_return_val_if_fail (gh_procedure_p (get_form), NULL);
|
g_return_val_if_fail (gh_procedure_p (get_form), NULL);
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
SUBDIRS=. test
|
SUBDIRS = . test
|
||||||
|
|
||||||
pkglib_LTLIBRARIES=libgncmod-locale-reports-us.la
|
pkglib_LTLIBRARIES = libgncmod-locale-reports-us.la
|
||||||
|
|
||||||
libgncmod_locale_reports_us_la_SOURCES=\
|
libgncmod_locale_reports_us_la_SOURCES = \
|
||||||
gncmod-locale-reports-us.c
|
gncmod-locale-reports-us.c
|
||||||
|
|
||||||
libgncmod_locale_reports_us_la_LDFLAGS=-module
|
libgncmod_locale_reports_us_la_LDFLAGS = -module
|
||||||
|
|
||||||
INCLUDES=-I${top_srcdir}/src/gnc-module ${GLIB_CFLAGS}
|
INCLUDES = -I${top_srcdir}/src/gnc-module ${GLIB_CFLAGS}
|
||||||
|
|
||||||
.scm-links:
|
.scm-links:
|
||||||
rm -f gnucash report locale-specific us
|
rm -f gnucash report locale-specific us
|
||||||
@ -19,13 +19,10 @@ INCLUDES=-I${top_srcdir}/src/gnc-module ${GLIB_CFLAGS}
|
|||||||
|
|
||||||
noinst_DATA = .scm-links
|
noinst_DATA = .scm-links
|
||||||
|
|
||||||
gncscmmoddir=${GNC_SHAREDIR}/guile-modules/gnucash/report/locale-specific
|
gncscmmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/report/locale-specific
|
||||||
gncscmmod_DATA = us.scm
|
gncscmmod_DATA = us.scm
|
||||||
|
|
||||||
gncscmothermoddir=${GNC_SHAREDIR}/guile-modules/gnucash/report/
|
gncscmothermoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/report/
|
||||||
gncscmothermod_DATA=taxtxf.scm
|
gncscmothermod_DATA = taxtxf.scm
|
||||||
|
|
||||||
gncscmdir=${GNC_SHAREDIR}/scm
|
|
||||||
gncscm_DATA = txf-export.scm txf-export-help.scm
|
|
||||||
|
|
||||||
CLEANFILES += gnucash report locale-specific us
|
CLEANFILES += gnucash report locale-specific us
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* gncmod-locale-reports-us.c
|
* gncmod-locale-reports-us.c
|
||||||
* module definition/initialization for the standard reports
|
* module definition/initialization for the US reports
|
||||||
*
|
*
|
||||||
* Copyright (c) 2001 Linux Developers Group, Inc.
|
* Copyright (c) 2001 Linux Developers Group, Inc.
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
@ -32,6 +32,11 @@ gnc_module_description(void) {
|
|||||||
|
|
||||||
int
|
int
|
||||||
gnc_module_init(int refcount) {
|
gnc_module_init(int refcount) {
|
||||||
|
/* load us tax info */
|
||||||
|
if(!gnc_module_load("gnucash/tax/us", 0)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* load the report system */
|
/* load the report system */
|
||||||
if(!gnc_module_load("gnucash/report/report-system", 0)) {
|
if(!gnc_module_load("gnucash/report/report-system", 0)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -34,24 +34,9 @@
|
|||||||
(require 'printf)
|
(require 'printf)
|
||||||
|
|
||||||
(use-modules (gnucash gnc-module))
|
(use-modules (gnucash gnc-module))
|
||||||
|
(gnc:module-load "gnucash/tax/us" 0)
|
||||||
(gnc:module-load "gnucash/report/report-system" 0)
|
(gnc:module-load "gnucash/report/report-system" 0)
|
||||||
|
|
||||||
(export gnc:txf-get-payer-name-source)
|
|
||||||
(export gnc:txf-get-form)
|
|
||||||
(export gnc:txf-get-description)
|
|
||||||
(export gnc:txf-get-format)
|
|
||||||
(export gnc:txf-get-multiple)
|
|
||||||
(export gnc:txf-get-category-key)
|
|
||||||
(export gnc:txf-get-help)
|
|
||||||
(export gnc:txf-get-codes)
|
|
||||||
(export gnc:txf-get-code-info)
|
|
||||||
(export txf-help-categories)
|
|
||||||
(export txf-income-categories)
|
|
||||||
(export txf-expense-categories)
|
|
||||||
|
|
||||||
(load-from-path "txf-export.scm")
|
|
||||||
(load-from-path "txf-export-help.scm")
|
|
||||||
|
|
||||||
(define (make-level-collector num-levels)
|
(define (make-level-collector num-levels)
|
||||||
(let ((level-collector (make-vector num-levels)))
|
(let ((level-collector (make-vector num-levels)))
|
||||||
(do ((i 0 (+ i 1)))
|
(do ((i 0 (+ i 1)))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
TESTS=test-load-module
|
TESTS=test-load-module
|
||||||
|
|
||||||
TESTS_ENVIRONMENT= \
|
TESTS_ENVIRONMENT= \
|
||||||
GNC_MODULE_PATH=${top_srcdir}/src/engine:${top_srcdir}/src/report/report-system:${top_srcdir}/src/app-utils:${top_srcdir}/src/calculation:.. \
|
GNC_MODULE_PATH=${top_srcdir}/src/engine:${top_srcdir}/src/report/report-system:${top_srcdir}/src/app-utils:${top_srcdir}/src/calculation:${top_srcdir}/src/tax/us:.. \
|
||||||
GUILE_LOAD_PATH=${top_srcdir}/src/gnc-module:${top_srcdir}/lib:..:${G_WRAP_MODULE_DIR} \
|
GUILE_LOAD_PATH=${top_srcdir}/src/gnc-module:${top_srcdir}/lib:..:${G_WRAP_MODULE_DIR} \
|
||||||
LD_LIBRARY_PATH=${top_srcdir}/src/gnc-module:${top_srcdir}/src/gnc-module/.libs:${top_srcdir}/src/engine:${top_srcdir}/src/engine/.libs:${top_srcdir}/src/app-utils:${top_srcdir}/src/app-utils/.libs:${top_srcdir}/src/calculation:${top_srcdir}/src/calculation/.libs
|
LD_LIBRARY_PATH=${top_srcdir}/src/gnc-module:${top_srcdir}/src/gnc-module/.libs:${top_srcdir}/src/engine:${top_srcdir}/src/engine/.libs:${top_srcdir}/src/app-utils:${top_srcdir}/src/app-utils/.libs:${top_srcdir}/src/calculation:${top_srcdir}/src/calculation/.libs
|
||||||
|
@ -1,16 +1,2 @@
|
|||||||
(define-module (gnucash report locale-specific us))
|
(define-module (gnucash report locale-specific us))
|
||||||
(use-modules (gnucash report taxtxf))
|
(use-modules (gnucash report taxtxf))
|
||||||
|
|
||||||
(export gnc:txf-get-payer-name-source)
|
|
||||||
(export gnc:txf-get-form)
|
|
||||||
(export gnc:txf-get-description)
|
|
||||||
(export gnc:txf-get-format)
|
|
||||||
(export gnc:txf-get-multiple)
|
|
||||||
(export gnc:txf-get-category-key)
|
|
||||||
(export gnc:txf-get-help)
|
|
||||||
(export gnc:txf-get-codes)
|
|
||||||
(export gnc:txf-get-code-info)
|
|
||||||
(export txf-help-categories)
|
|
||||||
(export txf-income-categories)
|
|
||||||
(export txf-expense-categories)
|
|
||||||
|
|
||||||
|
2
src/tax/.cvsignore
Normal file
2
src/tax/.cvsignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
1
src/tax/Makefile.am
Normal file
1
src/tax/Makefile.am
Normal file
@ -0,0 +1 @@
|
|||||||
|
SUBDIRS = us
|
2
src/tax/us/.cvsignore
Normal file
2
src/tax/us/.cvsignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
26
src/tax/us/Makefile.am
Normal file
26
src/tax/us/Makefile.am
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
SUBDIRS = . test
|
||||||
|
|
||||||
|
pkglib_LTLIBRARIES = libgncmod-tax-us.la
|
||||||
|
|
||||||
|
libgncmod_tax_us_la_SOURCES = \
|
||||||
|
gncmod-tax-us.c
|
||||||
|
|
||||||
|
libgncmod_tax_us_la_LDFLAGS = -module
|
||||||
|
|
||||||
|
INCLUDES = -I${top_srcdir}/src/gnc-module ${GLIB_CFLAGS}
|
||||||
|
|
||||||
|
.scm-links:
|
||||||
|
rm -f gnucash tax
|
||||||
|
ln -sf . gnucash
|
||||||
|
ln -sf . tax
|
||||||
|
touch .scm-links
|
||||||
|
|
||||||
|
noinst_DATA = .scm-links
|
||||||
|
|
||||||
|
gncscmmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/tax
|
||||||
|
gncscmmod_DATA = us.scm
|
||||||
|
|
||||||
|
gncscmdir = ${GNC_SHAREDIR}/scm
|
||||||
|
gncscm_DATA = txf.scm txf-help.scm
|
||||||
|
|
||||||
|
CLEANFILES += gnucash tax
|
50
src/tax/us/gncmod-tax-us.c
Normal file
50
src/tax/us/gncmod-tax-us.c
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/*********************************************************************
|
||||||
|
* gncmod-tax-us.c
|
||||||
|
* module definition/initialization for us tax info
|
||||||
|
*
|
||||||
|
* Copyright (c) 2001 Linux Developers Group, Inc.
|
||||||
|
*********************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <guile/gh.h>
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
|
#include "gnc-module.h"
|
||||||
|
#include "gnc-module-api.h"
|
||||||
|
|
||||||
|
/* version of the gnc module system interface we require */
|
||||||
|
int gnc_module_system_interface = 0;
|
||||||
|
|
||||||
|
/* module versioning uses libtool semantics. */
|
||||||
|
int gnc_module_current = 0;
|
||||||
|
int gnc_module_revision = 0;
|
||||||
|
int gnc_module_age = 0;
|
||||||
|
|
||||||
|
char *
|
||||||
|
gnc_module_path(void) {
|
||||||
|
return g_strdup("gnucash/tax/us");
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
gnc_module_description(void) {
|
||||||
|
return g_strdup("US income tax information");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
lmod(char * mn)
|
||||||
|
{
|
||||||
|
char * form = g_strdup_printf("(use-modules %s)\n", mn);
|
||||||
|
gh_eval_str(form);
|
||||||
|
g_free(form);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
gnc_module_init(int refcount) {
|
||||||
|
lmod("(gnucash tax us)");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
gnc_module_end(int refcount) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
2
src/tax/us/test/.cvsignore
Normal file
2
src/tax/us/test/.cvsignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
6
src/tax/us/test/Makefile.am
Normal file
6
src/tax/us/test/Makefile.am
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
TESTS = test-load-module
|
||||||
|
|
||||||
|
TESTS_ENVIRONMENT= \
|
||||||
|
GNC_MODULE_PATH=.. \
|
||||||
|
GUILE_LOAD_PATH=${top_srcdir}/src/gnc-module:${top_srcdir}/lib:..:${G_WRAP_MODULE_DIR} \
|
||||||
|
LD_LIBRARY_PATH=${top_srcdir}/src/gnc-module:${top_srcdir}/src/gnc-module/.libs
|
15
src/tax/us/test/test-load-module
Executable file
15
src/tax/us/test/test-load-module
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
exec guile -s "$0"
|
||||||
|
!#
|
||||||
|
|
||||||
|
(display " testing US tax info module load ... ")
|
||||||
|
(use-modules (gnucash gnc-module))
|
||||||
|
(gnc:module-system-init)
|
||||||
|
|
||||||
|
(if (gnc:module-load "gnucash/tax/us" 0)
|
||||||
|
(begin
|
||||||
|
(display "ok\n")
|
||||||
|
(exit 0))
|
||||||
|
(begin
|
||||||
|
(display "failed\n")
|
||||||
|
(exit -1)))
|
17
src/tax/us/us.scm
Normal file
17
src/tax/us/us.scm
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
(define-module (gnucash tax us))
|
||||||
|
|
||||||
|
(export gnc:txf-get-payer-name-source)
|
||||||
|
(export gnc:txf-get-form)
|
||||||
|
(export gnc:txf-get-description)
|
||||||
|
(export gnc:txf-get-format)
|
||||||
|
(export gnc:txf-get-multiple)
|
||||||
|
(export gnc:txf-get-category-key)
|
||||||
|
(export gnc:txf-get-help)
|
||||||
|
(export gnc:txf-get-codes)
|
||||||
|
(export gnc:txf-get-code-info)
|
||||||
|
(export txf-help-categories)
|
||||||
|
(export txf-income-categories)
|
||||||
|
(export txf-expense-categories)
|
||||||
|
|
||||||
|
(load-from-path "txf.scm")
|
||||||
|
(load-from-path "txf-help.scm")
|
Loading…
Reference in New Issue
Block a user