2015-09-29 14:08:48 -05:00
|
|
|
/********************************************************************\
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU General Public License as *
|
|
|
|
* published by the Free Software Foundation; either version 2 of *
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License*
|
|
|
|
* along with this program; if not, contact: *
|
|
|
|
* *
|
|
|
|
* Free Software Foundation Voice: +1-617-542-5942 *
|
|
|
|
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
|
|
|
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
|
|
|
* *
|
|
|
|
\********************************************************************/
|
|
|
|
|
2006-10-15 14:02:05 -05:00
|
|
|
%module sw_app_utils
|
|
|
|
%{
|
|
|
|
/* Includes the header in the wrapper code */
|
|
|
|
#include <config.h>
|
|
|
|
#include <option-util.h>
|
|
|
|
#include <gnc-euro.h>
|
|
|
|
#include <gnc-exp-parser.h>
|
|
|
|
#include <gnc-ui-util.h>
|
|
|
|
#include <gnc-gettext-util.h>
|
2013-10-07 09:06:23 -05:00
|
|
|
#include <gnc-prefs-utils.h>
|
2006-10-15 14:02:05 -05:00
|
|
|
#include <gnc-helpers.h>
|
|
|
|
#include <gnc-accounting-period.h>
|
|
|
|
#include <gnc-session.h>
|
|
|
|
#include <gnc-component-manager.h>
|
2007-02-25 11:35:57 -06:00
|
|
|
#include <guile-util.h>
|
2017-08-10 06:56:00 -05:00
|
|
|
#include <gnc-sx-instance-model.h>
|
2006-10-15 14:02:05 -05:00
|
|
|
|
2013-04-13 05:40:55 -05:00
|
|
|
#include "engine-helpers-guile.h"
|
2011-01-27 13:09:27 -06:00
|
|
|
%}
|
2006-10-15 14:02:05 -05:00
|
|
|
|
2011-01-27 13:09:27 -06:00
|
|
|
#if defined(SWIGGUILE)
|
|
|
|
%{
|
2013-12-14 10:40:42 -06:00
|
|
|
#include "guile-mappings.h"
|
|
|
|
|
2006-10-15 14:02:05 -05:00
|
|
|
SCM scm_init_sw_app_utils_module (void);
|
|
|
|
%}
|
2011-01-27 13:09:27 -06:00
|
|
|
#endif
|
2006-10-15 14:02:05 -05:00
|
|
|
|
2011-03-23 16:37:03 -05:00
|
|
|
#if defined(SWIGPYTHON)
|
|
|
|
%{
|
|
|
|
/* avoid no previous prototype warning/error */
|
|
|
|
#if PY_VERSION_HEX >= 0x03000000
|
|
|
|
PyObject*
|
|
|
|
#else
|
|
|
|
void
|
|
|
|
#endif
|
|
|
|
SWIG_init (void);
|
|
|
|
%}
|
|
|
|
#endif
|
|
|
|
|
2006-10-15 22:35:56 -05:00
|
|
|
%import "base-typemaps.i"
|
2006-10-15 14:02:05 -05:00
|
|
|
|
|
|
|
typedef void (*GNCOptionChangeCallback) (gpointer user_data);
|
|
|
|
typedef int GNCOptionDBHandle;
|
|
|
|
|
2013-05-03 07:03:38 -05:00
|
|
|
void gnc_prefs_init();
|
|
|
|
|
2006-10-15 14:02:05 -05:00
|
|
|
QofBook * gnc_get_current_book (void);
|
2017-02-18 09:38:46 -06:00
|
|
|
QofSession * gnc_get_current_session (void);
|
Bug #554394: Income Tax Enhancements
Patch by J. Alex Aycinena. Patch does the following:
- update the tax information in 'txf.scm', which is based on V037 of
the TXF Spec, to V041, the last version issued (bug #554394)
- provide support for multiple copies of certain tax Forms/Schedules
(e.g., Schedule C(1), Schedule C(2), etc.)
- support multiple types of tax entities: partnerships, corporations
and S corporations, in addition to individual tax payers
- support balance sheet accounts, required for these new tax entity types
- add the term 'Income' in several places to avoid confusion with
sales or VAT style taxes in the business features (e.g., change the
menu from 'Tax Options' to 'Income Tax Options')
The following files were changed, as follows, to implement these changes:
1. src/engine/Account.c and
2. src/engine/Account.h: add copy number capability (define
'xaccAccountGetTaxUSCopyNumber' and 'xaccAccountSetTaxUSCopyNumber');
modify 'xaccAccountSetTaxUSCode' to remove KVP when no tax-code
assigned, clean up tax-source descriptions
3. src/gnome/gnc-plugin-basic-commands.c: change 'Tax Options' to
'Income Tax Options'
4. src/app-utils/gnc-ui-util.c and
5. src/app-utils/gnc-ui-util.h: add setter and getter functions for
book tax name and book tax type which are stored in a book KVP, show
copy information in accounts page, tax column, show error messages for
various conditions
6. src/app-utils/app-utils.i: add 'gnc_get_current_book_tax_name' and
'gnc_get_current_book_tax_type' functions
7. src/gnome/dialog-tax-info.c: add copy number and tax entity name
and type, and balance sheet account handling capability
8. src/gnome/glade/tax.glade: add tax entity name, tax entity type,
asset, liability/equity and copy number widgets
9. src/tax/us/txf.scm: update to V041 for individuals, add V041
support for multiple additional tax entity types and balance sheet
accounts and related tax codes, add tax form line data
10. src/tax/us/us.scm: export new functions defined in txf.scm
11. src/report/locale-specific/us/taxtxf.scm: add support for multiple
copies of Forms/Schedules, add support for Format 6, use Form/Schedule
line #'s to sort report, update from "V037" to "V041", add support for
taxpayer types other than F1040, add warning messages if there are
some inconsistent codes assigned and list
12. src/tax/us/txf-de_DE.scm: make functions called from outside (e.g., from
dialog-tax-info.c) have a consistent signature with those same
functions in txf.scm (define tax-entity-type , define getters/setters,
add tax-entity-type as an argument to existing functions)
13. src/tax/us/de_DE.scm: export new functions added to txf-de_DE.scm
14. src/report/locale-specific/us/taxtxf-de_DE.scm: add "" as
tax-entity-type argument to functions
called on txf-de_DE.scm (which defaults to existing codes)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18413 57a11ea4-9604-0410-9ed3-97b8803252fd
2009-11-15 14:35:50 -06:00
|
|
|
const gchar * gnc_get_current_book_tax_name (void);
|
|
|
|
const gchar * gnc_get_current_book_tax_type (void);
|
2007-02-22 19:23:31 -06:00
|
|
|
Account * gnc_get_current_root_account (void);
|
2006-10-15 14:02:05 -05:00
|
|
|
|
2007-05-07 08:24:27 -05:00
|
|
|
%newobject gnc_gettext_helper;
|
2006-10-15 14:02:05 -05:00
|
|
|
char * gnc_gettext_helper(const char *string);
|
|
|
|
|
|
|
|
GNCOptionDB * gnc_option_db_new(SCM guile_options);
|
|
|
|
void gnc_option_db_destroy(GNCOptionDB *odb);
|
|
|
|
|
|
|
|
void gnc_option_db_set_option_selectable_by_name(SCM guile_option,
|
|
|
|
const char *section, const char *name, gboolean selectable);
|
|
|
|
|
2011-01-27 13:09:27 -06:00
|
|
|
#if defined(SWIGGUILE)
|
2006-10-21 19:58:42 -05:00
|
|
|
%typemap(out) GncCommodityList * {
|
2006-10-15 22:35:56 -05:00
|
|
|
SCM list = SCM_EOL;
|
|
|
|
GList *node;
|
|
|
|
|
|
|
|
for (node = $1; node; node = node->next)
|
|
|
|
list = scm_cons(gnc_quoteinfo2scm(node->data), list);
|
|
|
|
|
|
|
|
$result = scm_reverse(list);
|
|
|
|
}
|
|
|
|
|
2011-11-24 08:04:46 -06:00
|
|
|
%inline %{
|
|
|
|
typedef GList GncCommodityList;
|
|
|
|
|
|
|
|
GncCommodityList *
|
|
|
|
gnc_commodity_table_get_quotable_commodities(const gnc_commodity_table * table);
|
|
|
|
%}
|
|
|
|
|
2006-10-15 14:02:05 -05:00
|
|
|
gnc_commodity * gnc_default_currency (void);
|
|
|
|
gnc_commodity * gnc_default_report_currency (void);
|
|
|
|
|
|
|
|
void gncp_option_invoke_callback(GNCOptionChangeCallback callback, void *data);
|
|
|
|
void gnc_option_db_register_option(GNCOptionDBHandle handle,
|
|
|
|
SCM guile_option);
|
|
|
|
|
|
|
|
GNCPrintAmountInfo gnc_default_print_info (gboolean use_symbol);
|
|
|
|
GNCPrintAmountInfo gnc_account_print_info (const Account *account,
|
|
|
|
gboolean use_symbol);
|
|
|
|
GNCPrintAmountInfo gnc_commodity_print_info (const gnc_commodity *commodity,
|
|
|
|
gboolean use_symbol);
|
|
|
|
GNCPrintAmountInfo gnc_share_print_info_places (int decplaces);
|
|
|
|
const char * xaccPrintAmount (gnc_numeric val, GNCPrintAmountInfo info);
|
|
|
|
|
2007-03-12 22:43:24 -05:00
|
|
|
gchar *number_to_words(gdouble val, gint64 denom);
|
|
|
|
const gchar *printable_value (gdouble val, gint denom);
|
|
|
|
|
2019-10-19 03:19:11 -05:00
|
|
|
gboolean gnc_using_unreversed_budgets (QofBook* book);
|
|
|
|
gboolean gnc_reverse_budget_balance (const Account *account, gboolean unreversed);
|
2006-10-15 14:02:05 -05:00
|
|
|
gboolean gnc_reverse_balance (const Account *account);
|
|
|
|
|
|
|
|
gboolean gnc_is_euro_currency(const gnc_commodity * currency);
|
|
|
|
gnc_numeric gnc_convert_to_euro(const gnc_commodity * currency,
|
|
|
|
gnc_numeric value);
|
|
|
|
gnc_numeric gnc_convert_from_euro(const gnc_commodity * currency,
|
|
|
|
gnc_numeric value);
|
|
|
|
|
2012-12-01 16:44:31 -06:00
|
|
|
time64 gnc_accounting_period_fiscal_start(void);
|
|
|
|
time64 gnc_accounting_period_fiscal_end(void);
|
2006-10-15 14:02:05 -05:00
|
|
|
|
|
|
|
void gnc_register_kvp_option_generator(QofIdType id_type, SCM generator);
|
|
|
|
|
2007-02-25 11:35:57 -06:00
|
|
|
%typemap(in) GList * {
|
|
|
|
SCM path_scm = $input;
|
|
|
|
GList *path = NULL;
|
2009-12-31 08:41:12 -06:00
|
|
|
while (!scm_is_null (path_scm))
|
2007-02-25 11:35:57 -06:00
|
|
|
{
|
|
|
|
SCM key_scm = SCM_CAR (path_scm);
|
|
|
|
char *key;
|
2011-01-09 12:00:32 -06:00
|
|
|
gchar* gkey;
|
2009-12-31 08:41:12 -06:00
|
|
|
if (!scm_is_string (key_scm))
|
2007-02-25 11:35:57 -06:00
|
|
|
break;
|
2011-01-09 12:00:32 -06:00
|
|
|
key = scm_to_locale_string (key_scm);
|
|
|
|
gkey = g_strdup (key);
|
2011-03-21 10:10:40 -05:00
|
|
|
free (key);
|
2011-01-09 12:00:32 -06:00
|
|
|
path = g_list_prepend (path, gkey);
|
2007-02-25 11:35:57 -06:00
|
|
|
path_scm = SCM_CDR (path_scm);
|
|
|
|
}
|
|
|
|
$1 = g_list_reverse (path);
|
|
|
|
}
|
|
|
|
Process *gnc_spawn_process_async(GList *argl, const gboolean search_path);
|
|
|
|
%clear GList *;
|
|
|
|
|
|
|
|
gint gnc_process_get_fd(const Process *proc, const guint std_fd);
|
|
|
|
void gnc_detach_process(Process *proc, const gboolean kill_it);
|
2007-04-28 14:13:43 -05:00
|
|
|
|
2012-12-01 16:44:31 -06:00
|
|
|
time64 gnc_parse_time_to_time64(const gchar *s, const gchar *format);
|
2010-09-01 11:23:50 -05:00
|
|
|
|
|
|
|
%typemap(out) GHashTable * {
|
|
|
|
SCM table = scm_c_make_hash_table (g_hash_table_size($1) + 17);
|
|
|
|
GHashTableIter iter;
|
|
|
|
gpointer key, value;
|
|
|
|
|
|
|
|
g_hash_table_iter_init (&iter, $1);
|
|
|
|
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
|
|
|
const GncGUID* c_guid = (const GncGUID*) key;
|
|
|
|
const gnc_numeric* c_numeric = (const gnc_numeric*) value;
|
|
|
|
SCM scm_guid = gnc_guid2scm(*c_guid);
|
|
|
|
SCM scm_numeric = gnc_numeric_to_scm(*c_numeric);
|
|
|
|
|
|
|
|
scm_hash_set_x(table, scm_guid, scm_numeric);
|
|
|
|
}
|
|
|
|
g_hash_table_destroy($1);
|
|
|
|
$result = table;
|
|
|
|
}
|
|
|
|
GHashTable* gnc_sx_all_instantiate_cashflow_all(GDate range_start, GDate range_end);
|
|
|
|
%clear GHashTable *;
|
2011-01-27 13:09:27 -06:00
|
|
|
#endif
|