mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-10-14 10:22:00 -05:00
Merge branch 'maint'
This commit is contained in:
commit
3ec00f5275
83 files changed
+8598
-7458
No files matched your search
+12
-15
@@ -3,7 +3,7 @@
|
||||
if (WIN32 OR APPLE)
|
||||
cmake_minimum_required (VERSION 3.3.2)
|
||||
else()
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
cmake_minimum_required (VERSION 3.2)
|
||||
endif()
|
||||
|
||||
project (gnucash)
|
||||
@@ -238,23 +238,21 @@ if (MSVC)
|
||||
add_definitions ( -DNOMINMAX )
|
||||
endif (MSVC)
|
||||
|
||||
find_path (LIBINTL_INCLUDE_PATH NAMES libintl.h
|
||||
PATHS /usr/include /opt/gnome/include)
|
||||
find_library (LIBINTL_LIBRARY NAMES intl)
|
||||
|
||||
find_path (LTDL_INCLUDE_PATH NAMES ltdl.h PATHS /usr/include)
|
||||
|
||||
if(NOT LTDL_INCLUDE_PATH-NOTFOUND)
|
||||
set(HAVE_LTDL_H 1)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
find_program(GLIB_COMPILE_SCHEMAS glib-compile-schemas HINTS ${CMAKE_PREFIX_PATH}/gnome/bin)
|
||||
if (NOT GLIB_COMPILE_SCHEMAS)
|
||||
message(SEND_ERROR "Can't find glib-compile-schemas program. Please set GLIB_COMPILE_SCHEMAS.")
|
||||
endif(NOT GLIB_COMPILE_SCHEMAS)
|
||||
|
||||
find_path (REGEX_INCLUDE_PATH NAMES regex.h
|
||||
PATHS /usr/include /opt/gnome/include)
|
||||
find_library (REGEX_LIBRARY NAMES regex)
|
||||
|
||||
# I18N
|
||||
if (ALLOW_OLD_GETTEXT)
|
||||
find_package (Gettext REQUIRED)
|
||||
else (ALLOW_OLD_GETTEXT)
|
||||
@@ -273,9 +271,11 @@ if (${GETTEXT_VERSION_STRING} VERSION_LESS 0.19.6)
|
||||
message (WARNING "Got gettext version ${GETTEXT_VERSION_STRING}, however you need at least gettext version 0.19.6 in order to handle translation of the gnucash.appdata file. The build will be configured with an untranslated gnucash.appdata file.")
|
||||
endif ()
|
||||
|
||||
find_path (REGEX_INCLUDE_PATH NAMES regex.h
|
||||
find_path (LIBINTL_INCLUDE_PATH NAMES libintl.h
|
||||
PATHS /usr/include /opt/gnome/include)
|
||||
find_library (REGEX_LIBRARY NAMES regex)
|
||||
find_library (LIBINTL_LIBRARY NAMES intl)
|
||||
|
||||
# HELP
|
||||
if (WIN32)
|
||||
message(STATUS "Looking for htmlhelp.h and htmlhelp.a")
|
||||
find_path (HTMLHELP_INCLUDE_PATH NAMES htmlhelp.h)
|
||||
@@ -474,8 +474,8 @@ if (WITH_PYTHON)
|
||||
message(SEND_ERROR "Python support enabled, but Python interpreter not found.")
|
||||
endif()
|
||||
|
||||
if (PYTHON_VERSION_STRING VERSION_LESS "2.4.0")
|
||||
message(SEND_ERROR "Found python version ${PYTHON_VERSION_STRING}, but it's too old. Need python >= 2.4.0")
|
||||
if (PYTHON_VERSION_STRING VERSION_LESS "3.2.0")
|
||||
message(SEND_ERROR "Found python version ${PYTHON_VERSION_STRING}, but it's too old. Need python >= 3.2.0")
|
||||
endif()
|
||||
|
||||
find_package(PythonLibs 3)
|
||||
@@ -697,9 +697,6 @@ endif(UNIX OR MINGW)
|
||||
endif(ENABLE_BINRELOC)
|
||||
|
||||
if (UNIX OR MINGW)
|
||||
set (HAVE_BIND_TEXTDOMAIN_CODESET 1)
|
||||
set (HAVE_DCGETTEXT 1)
|
||||
set (HAVE_GETTEXT 1)
|
||||
set (HAVE_GETTIMEOFDAY 1)
|
||||
set (HAVE_GUILE 1)
|
||||
set (HAVE_LIBM 1)
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ Libraries/Deps
|
||||
|
||||
libofx 0.9.0 OFX/QFX import
|
||||
|
||||
python 3.4.0 python bindings; headers
|
||||
python 3.2.0 python bindings; headers
|
||||
required, not just binaries.
|
||||
|
||||
makeinfo Not really needed, it
|
||||
|
||||
@@ -239,7 +239,7 @@ class Book(GnuCashCoreClass):
|
||||
|
||||
def InvoiceNextID(self, customer):
|
||||
''' Return the next invoice ID.
|
||||
This works but I'm not entirely happy with it. FIX ME'''
|
||||
'''
|
||||
from gnucash.gnucash_core_c import gncInvoiceNextID
|
||||
return gncInvoiceNextID(self.get_instance(),customer.GetEndOwner().get_instance()[1])
|
||||
|
||||
|
||||
@@ -78,9 +78,6 @@
|
||||
/* Don't use deprecated glib functions */
|
||||
#cmakedefine G_DISABLE_DEPRECATED 1
|
||||
|
||||
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
|
||||
#cmakedefine HAVE_BIND_TEXTDOMAIN_CODESET 1
|
||||
|
||||
/* define if the Boost library is available */
|
||||
#cmakedefine HAVE_BOOST
|
||||
|
||||
@@ -93,9 +90,6 @@
|
||||
/* Define to 1 if you have the <dbi/dbi.h> header file. */
|
||||
#cmakedefine HAVE_DBI_DBI_H 1
|
||||
|
||||
/* Define to 1 if you have the `dcgettext' function. */
|
||||
#cmakedefine HAVE_DCGETTEXT 1
|
||||
|
||||
/* Define to 1 if you have the <dirent.h> header file. */
|
||||
#cmakedefine HAVE_DIRENT_H 1
|
||||
|
||||
@@ -120,9 +114,6 @@
|
||||
/* Define to 1 if you have the `getppid' function. */
|
||||
#cmakedefine HAVE_GETPPID 1
|
||||
|
||||
/* Define if the GNU gettext() function is already present or preinstalled. */
|
||||
#cmakedefine HAVE_GETTEXT 1
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#cmakedefine HAVE_GETTIMEOFDAY 1
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* assistant-xml-encoding.c -- Coversion of old XML file
|
||||
* assistant-xml-encoding.c -- Conversion of old XML file
|
||||
* Copyright (C) 2006 Andreas Koehler <andi5.py@gmx.net>
|
||||
* Copyright (C) 2011 Robert Fewell
|
||||
*
|
||||
@@ -174,6 +174,7 @@ void gxi_add_custom_enc_clicked_cb (GtkButton *button, GncXmlImportData *data);
|
||||
void gxi_selected_enc_activated_cb (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, GncXmlImportData *data);
|
||||
void gxi_remove_enc_clicked_cb (GtkButton *button, GncXmlImportData *data);
|
||||
|
||||
/* Translators: Run the assistent in your language to see GTK's translation of the button labels. */
|
||||
static const gchar *encodings_doc_string = N_(
|
||||
"\nThe file you are trying to load is from an older version of "
|
||||
"GnuCash. The file format in the older versions was missing the "
|
||||
@@ -187,21 +188,21 @@ static const gchar *encodings_doc_string = N_(
|
||||
"file. On the next page GnuCash will show the resulting texts when "
|
||||
"using this guess. You have to check whether the words look as "
|
||||
"expected. Either everything looks fine and you can simply press "
|
||||
"'Forward'. Or the words contain unexpected characters, in which "
|
||||
"\"Next\". Or the words contain unexpected characters, in which "
|
||||
"case you should select different character encodings to see "
|
||||
"different results. You may have to edit the list of character "
|
||||
"encodings by clicking on the respective button."
|
||||
"\n\n"
|
||||
"Press 'Forward' now to select the correct character encoding for "
|
||||
"Press \"Next\" now to select the correct character encoding for "
|
||||
"your data file.\n");
|
||||
|
||||
static const gchar *encodings_doc_page_title = N_("Ambiguous character encoding");
|
||||
|
||||
static const gchar *finish_convert_string = N_(
|
||||
"The file has been loaded successfully. If you click 'Apply' it will be saved "
|
||||
"The file has been loaded successfully. If you click \"Apply\" it will be saved "
|
||||
"and reloaded into the main application. That way you will have a working "
|
||||
"file as backup in the same directory.\n\n"
|
||||
"You can also go back and verify your selections by clicking on 'Back'.");
|
||||
"You can also go back and verify your selections by clicking on \"Back\".");
|
||||
|
||||
/* The debugging module that this .o belongs to. */
|
||||
static QofLogModule log_module = GNC_MOD_ASSISTANT;
|
||||
|
||||
@@ -766,7 +766,7 @@ get_selected_prices_helper (GtkTreeModel *s_model,
|
||||
}
|
||||
|
||||
/*
|
||||
* Given an price tree view, return a list of the selected commodities. The
|
||||
* Given a price tree view, return a list of the selected prices. The
|
||||
* price tree must be in multiple selection mode.
|
||||
*
|
||||
* Note: It is the responsibility of the caller to free the returned
|
||||
@@ -782,3 +782,47 @@ gnc_tree_view_price_get_selected_prices (GncTreeViewPrice *view)
|
||||
gtk_tree_selection_selected_foreach(selection, get_selected_prices_helper, &return_list);
|
||||
return return_list;
|
||||
}
|
||||
|
||||
static void
|
||||
get_selected_commodity_helper (GtkTreeModel *s_model,
|
||||
GtkTreePath *s_path,
|
||||
GtkTreeIter *s_iter,
|
||||
gpointer data)
|
||||
{
|
||||
GList **return_list = data;
|
||||
GtkTreeModel *model, *f_model;
|
||||
GtkTreeIter iter, f_iter;
|
||||
gnc_commodity *commodity;
|
||||
|
||||
gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (s_model),
|
||||
&f_iter, s_iter);
|
||||
|
||||
f_model = gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(s_model));
|
||||
gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (f_model),
|
||||
&iter, &f_iter);
|
||||
|
||||
model = gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(f_model));
|
||||
commodity = gnc_tree_model_price_get_commodity (GNC_TREE_MODEL_PRICE(model), &iter);
|
||||
|
||||
if (commodity)
|
||||
*return_list = g_list_append(*return_list, commodity);
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a price tree view, return a list of the selected rows that have
|
||||
* commodities but are not prices, the parent rows for prices. The
|
||||
* price tree must be in multiple selection mode.
|
||||
*
|
||||
* Note: It is the responsibility of the caller to free the returned
|
||||
* list.
|
||||
*/
|
||||
GList *
|
||||
gnc_tree_view_price_get_selected_commodities (GncTreeViewPrice *view)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
GList *return_list = NULL;
|
||||
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view));
|
||||
gtk_tree_selection_selected_foreach (selection, get_selected_commodity_helper, &return_list);
|
||||
return return_list;
|
||||
}
|
||||
@@ -208,6 +208,19 @@ void gnc_tree_view_price_set_selected_price (GncTreeViewPrice *view,
|
||||
GList * gnc_tree_view_price_get_selected_prices (GncTreeViewPrice *view);
|
||||
|
||||
|
||||
/** This function returns a list of commodities associated with the
|
||||
* selected rows that are not prices but are the parent rows for
|
||||
* prices in the price tree view.
|
||||
*
|
||||
* @note It only makes sense to call this function when the price
|
||||
* tree is set to select multiple items.
|
||||
*
|
||||
* @param view A pointer to an price tree view.
|
||||
*
|
||||
* @return A list of commodities, or NULL if no commodity was selected.
|
||||
*/
|
||||
GList * gnc_tree_view_price_get_selected_commodities (GncTreeViewPrice *view);
|
||||
|
||||
/** @} */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -1723,6 +1723,10 @@ gnc_tree_view_add_toggle_column (GncTreeView *view,
|
||||
g_return_val_if_fail (GNC_IS_TREE_VIEW(view), NULL);
|
||||
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
if (!toggle_edited_cb)
|
||||
{
|
||||
gtk_cell_renderer_toggle_set_activatable (GTK_CELL_RENDERER_TOGGLE (renderer), FALSE);
|
||||
}
|
||||
column =
|
||||
gtk_tree_view_column_new_with_attributes (column_short_title,
|
||||
renderer,
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
|
||||
(define-module (gnucash gnome-utils))
|
||||
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash gnc-module))
|
||||
|
||||
(eval-when
|
||||
(compile load eval expand)
|
||||
(load-extension "libgncmod-gnome-utils" "scm_init_sw_gnome_utils_module"))
|
||||
(eval-when (compile load eval expand)
|
||||
(load-extension "libgncmod-gnome-utils" "scm_init_sw_gnome_utils_module"))
|
||||
|
||||
(use-modules (sw_gnome_utils))
|
||||
(gnc:module-load "gnucash/app-utils" 0)
|
||||
|
||||
|
||||
@@ -363,12 +363,14 @@ ap_assistant_book_prepare (GtkAssistant *assistant, gpointer user_data)
|
||||
nacc = gnc_account_n_descendants (gnc_book_get_root_account (currbook));
|
||||
|
||||
/* Display the book info */
|
||||
|
||||
period_text =
|
||||
/* Translators: Run the assistent in your language to see GTK's translation of the button labels. */
|
||||
_("You have asked for a book to be created. This book "
|
||||
"will contain all transactions up to midnight %s "
|
||||
"(for a total of %d transactions spread over %d accounts).\n\n "
|
||||
"Amend the Title and Notes or Click on 'Forward' to proceed.\n "
|
||||
"Click on 'Back' to adjust the dates or 'Cancel'.");
|
||||
"Amend the Title and Notes or Click on \"Next\" to proceed.\n "
|
||||
"Click on \"Back\" to adjust the dates or \"Cancel\".");
|
||||
str = g_strdup_printf (period_text, close_date_str, ntrans, nacc);
|
||||
gtk_label_set_text (GTK_LABEL(info->book_details), str);
|
||||
g_free (str);
|
||||
@@ -400,8 +402,8 @@ ap_assistant_apply_prepare (GtkAssistant *assistant, gpointer user_data)
|
||||
char *str;
|
||||
const char *apply_text =
|
||||
_("The book will be created with the title %s when you "
|
||||
"click on 'Apply'. Click on 'Back' to adjust, "
|
||||
"or 'Cancel' to not create any book.");
|
||||
"click on \"Apply\". Click on \"Back\" to adjust, "
|
||||
"or \"Cancel\" to not create any book.");
|
||||
|
||||
btitle = gtk_entry_get_text (GTK_ENTRY(info->book_title));
|
||||
str = g_strdup_printf (apply_text, btitle);
|
||||
|
||||
@@ -161,7 +161,8 @@ struct _invoice_window
|
||||
GtkWidget * posted_date_hbox;
|
||||
GtkWidget * posted_date;
|
||||
GtkWidget * active_check;
|
||||
|
||||
GtkWidget * paid_label;
|
||||
|
||||
GtkWidget * owner_box;
|
||||
GtkWidget * owner_label;
|
||||
GtkWidget * owner_choice;
|
||||
@@ -760,12 +761,12 @@ gnc_dialog_post_invoice(InvoiceWindow *iw, char *message,
|
||||
*ddue = *postdate;
|
||||
*memo = NULL;
|
||||
{
|
||||
GncGUID *guid = NULL;
|
||||
owner_inst = qofOwnerGetOwner (gncOwnerGetEndOwner (&(iw->owner)));
|
||||
qof_instance_get (owner_inst,
|
||||
"invoice-last-posted-account", &guid,
|
||||
NULL);
|
||||
*acc = xaccAccountLookup (guid, iw->book);
|
||||
GncGUID *guid = NULL;
|
||||
owner_inst = qofOwnerGetOwner (gncOwnerGetEndOwner (&(iw->owner)));
|
||||
qof_instance_get (owner_inst,
|
||||
"invoice-last-posted-account", &guid,
|
||||
NULL);
|
||||
*acc = xaccAccountLookup (guid, iw->book);
|
||||
}
|
||||
/* Get the default for the accumulate option */
|
||||
*accumulate = gnc_prefs_get_bool(GNC_PREFS_GROUP_INVOICE, GNC_PREF_ACCUM_SPLITS);
|
||||
@@ -957,12 +958,12 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params)
|
||||
*/
|
||||
owner_inst = qofOwnerGetOwner (gncOwnerGetEndOwner (&(iw->owner)));
|
||||
{
|
||||
const GncGUID *guid = qof_instance_get_guid (QOF_INSTANCE (acc));
|
||||
qof_begin_edit (owner_inst);
|
||||
qof_instance_set (owner_inst,
|
||||
"invoice-last-posted-account", guid,
|
||||
NULL);
|
||||
qof_commit_edit (owner_inst);
|
||||
const GncGUID *guid = qof_instance_get_guid (QOF_INSTANCE (acc));
|
||||
qof_begin_edit (owner_inst);
|
||||
qof_instance_set (owner_inst,
|
||||
"invoice-last-posted-account", guid,
|
||||
NULL);
|
||||
qof_commit_edit (owner_inst);
|
||||
}
|
||||
|
||||
/* ... post it ... */
|
||||
@@ -1872,22 +1873,12 @@ gnc_invoice_update_window (InvoiceWindow *iw, GtkWidget *widget)
|
||||
|
||||
if (is_posted)
|
||||
{
|
||||
hide = GTK_WIDGET (gtk_builder_get_object (iw->builder, "hide3"));
|
||||
gtk_widget_hide (hide);
|
||||
hide = GTK_WIDGET (gtk_builder_get_object (iw->builder, "hide4"));
|
||||
gtk_widget_hide (hide);
|
||||
|
||||
show = GTK_WIDGET (gtk_builder_get_object (iw->builder, "posted_label"));
|
||||
gtk_widget_show (show);
|
||||
gtk_widget_show (iw->posted_date_hbox);
|
||||
show = GTK_WIDGET (gtk_builder_get_object (iw->builder, "acct_label"));
|
||||
gtk_widget_show (show);
|
||||
gtk_widget_show (acct_entry);
|
||||
|
||||
show = GTK_WIDGET (gtk_builder_get_object (iw->builder, "hide1"));
|
||||
gtk_widget_show (show);
|
||||
show = GTK_WIDGET (gtk_builder_get_object (iw->builder, "hide2"));
|
||||
gtk_widget_show (show);
|
||||
}
|
||||
else /* ! posted */
|
||||
{
|
||||
@@ -1898,11 +1889,6 @@ gnc_invoice_update_window (InvoiceWindow *iw, GtkWidget *widget)
|
||||
hide = GTK_WIDGET (gtk_builder_get_object (iw->builder, "acct_label"));
|
||||
gtk_widget_hide (hide);
|
||||
gtk_widget_hide (acct_entry);
|
||||
|
||||
hide = GTK_WIDGET (gtk_builder_get_object (iw->builder, "hide1"));
|
||||
gtk_widget_hide (hide);
|
||||
hide = GTK_WIDGET (gtk_builder_get_object (iw->builder, "hide2"));
|
||||
gtk_widget_hide (hide);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1931,12 +1917,31 @@ gnc_invoice_update_window (InvoiceWindow *iw, GtkWidget *widget)
|
||||
// GtkWidget *hide;
|
||||
|
||||
/* Setup viewer for read-only access */
|
||||
/*
|
||||
gtk_widget_set_sensitive (acct_entry, FALSE);
|
||||
gtk_widget_set_sensitive (iw->id_entry, FALSE);
|
||||
gtk_widget_set_sensitive (iw->id_entry, TRUE);
|
||||
gtk_widget_set_sensitive (iw->terms_menu, FALSE);
|
||||
gtk_widget_set_sensitive (iw->notes_text, FALSE); *//* XXX: should notes remain writable? */
|
||||
gtk_widget_set_sensitive (iw->owner_box, FALSE);
|
||||
gtk_widget_set_sensitive (iw->job_box, FALSE);
|
||||
gtk_widget_set_sensitive (iw->billing_id_entry, FALSE);
|
||||
gtk_widget_set_sensitive (iw->notes_text, FALSE); /* XXX: should notes remain writable?*/
|
||||
}
|
||||
else /* ! posted */
|
||||
{
|
||||
gtk_widget_set_sensitive (acct_entry, TRUE);
|
||||
gtk_widget_set_sensitive (iw->terms_menu, TRUE);
|
||||
gtk_widget_set_sensitive (iw->owner_box, TRUE);
|
||||
gtk_widget_set_sensitive (iw->job_box, TRUE);
|
||||
gtk_widget_set_sensitive (iw->billing_id_entry, TRUE);
|
||||
gtk_widget_set_sensitive (iw->notes_text, TRUE);
|
||||
}
|
||||
|
||||
/* Translators: This is a label to show whether the invoice is paid or not. */
|
||||
if(gncInvoiceIsPaid (invoice))
|
||||
gtk_label_set_text(GTK_LABEL(iw->paid_label), _("PAID"));
|
||||
else
|
||||
gtk_label_set_text(GTK_LABEL(iw->paid_label), _("UNPAID"));
|
||||
|
||||
if (widget)
|
||||
gtk_widget_show (widget);
|
||||
else
|
||||
@@ -2305,6 +2310,10 @@ gnc_invoice_create_page (InvoiceWindow *iw, gpointer page)
|
||||
iw->owner_label = GTK_WIDGET (gtk_builder_get_object (builder, "page_owner_label"));
|
||||
iw->job_label = GTK_WIDGET (gtk_builder_get_object (builder, "page_job_label"));
|
||||
iw->job_box = GTK_WIDGET (gtk_builder_get_object (builder, "page_job_hbox"));
|
||||
iw->paid_label = GTK_WIDGET (gtk_builder_get_object (builder, "paid_label"));
|
||||
|
||||
// Set the style context for this label so it can be easily manipulated with css
|
||||
gnc_widget_set_style_context (GTK_WIDGET(iw->paid_label), "gnc-class-highlight");
|
||||
|
||||
/* grab the project widgets */
|
||||
iw->proj_frame = GTK_WIDGET (gtk_builder_get_object (builder, "page_proj_frame"));
|
||||
@@ -2351,6 +2360,8 @@ gnc_invoice_create_page (InvoiceWindow *iw, gpointer page)
|
||||
/* Make the opened and posted dates insensitive in this window */
|
||||
gtk_widget_set_sensitive (iw->opened_date, FALSE);
|
||||
gtk_widget_set_sensitive (iw->posted_date, FALSE);
|
||||
/* Also the invoice ID */
|
||||
gtk_widget_set_sensitive (iw->id_entry, FALSE);
|
||||
|
||||
/* Build the ledger */
|
||||
ledger_type = GNCENTRY_INVOICE_VIEWER;
|
||||
@@ -3344,7 +3355,7 @@ gnc_invoice_show_docs_due (GtkWindow *parent, QofBook *book, double days_in_adva
|
||||
if (param_list == NULL)
|
||||
{
|
||||
/* Translators: This abbreviation is the column heading for
|
||||
the condition "Is this invoice a Credit Note?" */
|
||||
the condition "Is this invoice a Credit Note?" */
|
||||
param_list = gnc_search_param_prepend (param_list, _("CN?"), NULL, type,
|
||||
INVOICE_IS_CN, NULL);
|
||||
param_list = gnc_search_param_prepend (param_list, _("Amount"), NULL, type,
|
||||
|
||||
@@ -90,8 +90,6 @@ struct _order_window
|
||||
GtkWidget * active_check;
|
||||
|
||||
GtkWidget * cd_label;
|
||||
GtkWidget * hide1;
|
||||
GtkWidget * hide2;
|
||||
GtkWidget * close_order_button;
|
||||
|
||||
GtkWidget * owner_box;
|
||||
@@ -512,8 +510,6 @@ gnc_order_update_window (OrderWindow *ow)
|
||||
{
|
||||
gtk_widget_hide (ow->closed_date);
|
||||
gtk_widget_hide (ow->cd_label);
|
||||
gtk_widget_hide (ow->hide1);
|
||||
gtk_widget_hide (ow->hide2);
|
||||
}
|
||||
|
||||
if (ow->dialog_type == VIEW_ORDER)
|
||||
@@ -606,8 +602,6 @@ gnc_order_new_window (GtkWindow *parent, QofBook *bookp, OrderDialogType type,
|
||||
ow->owner_label = GTK_WIDGET(gtk_builder_get_object (builder, "owner_label"));
|
||||
|
||||
ow->cd_label = GTK_WIDGET(gtk_builder_get_object (builder, "cd_label"));
|
||||
ow->hide1 = GTK_WIDGET(gtk_builder_get_object (builder, "hide1"));
|
||||
ow->hide2 = GTK_WIDGET(gtk_builder_get_object (builder, "hide2"));
|
||||
ow->close_order_button = GTK_WIDGET(gtk_builder_get_object (builder, "close_order_button"));
|
||||
|
||||
|
||||
|
||||
@@ -353,6 +353,8 @@ selection_changed_cb (GtkTreeSelection *selection, gpointer data)
|
||||
gboolean have_rows = (g_list_length (rows) > 0 ? TRUE : FALSE);
|
||||
|
||||
change_source_flag (PRICE_REMOVE_SOURCE_COMM, have_rows, pdb_dialog);
|
||||
g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL);
|
||||
g_list_free (rows);
|
||||
}
|
||||
|
||||
static GDate
|
||||
@@ -513,16 +515,33 @@ gnc_prices_dialog_add_clicked (GtkWidget *widget, gpointer data)
|
||||
PricesDialog *pdb_dialog = data;
|
||||
GNCPrice *price = NULL;
|
||||
GList *price_list;
|
||||
GList *comm_list;
|
||||
gboolean unref_price = FALSE;
|
||||
|
||||
ENTER(" ");
|
||||
price_list = gnc_tree_view_price_get_selected_prices(pdb_dialog->price_tree);
|
||||
if (price_list)
|
||||
price_list = gnc_tree_view_price_get_selected_prices (pdb_dialog->price_tree);
|
||||
comm_list = gnc_tree_view_price_get_selected_commodities (pdb_dialog->price_tree);
|
||||
|
||||
if (price_list) // selected row is on a price
|
||||
{
|
||||
price = price_list->data;
|
||||
g_list_free(price_list);
|
||||
g_list_free (price_list);
|
||||
}
|
||||
else if (comm_list) // selection contains price parent rows
|
||||
{
|
||||
if (g_list_length (comm_list) == 1) // make sure it is only one parent
|
||||
{
|
||||
price = gnc_price_create (pdb_dialog->book);
|
||||
gnc_price_set_commodity (price, comm_list->data);
|
||||
unref_price = TRUE;
|
||||
}
|
||||
g_list_free (comm_list);
|
||||
}
|
||||
gnc_price_edit_dialog (pdb_dialog->window, pdb_dialog->session,
|
||||
price, GNC_PRICE_NEW);
|
||||
|
||||
if (unref_price)
|
||||
gnc_price_unref (price);
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
@@ -570,12 +589,25 @@ gnc_prices_dialog_selection_changed (GtkTreeSelection *treeselection,
|
||||
gpointer data)
|
||||
{
|
||||
PricesDialog *pdb_dialog = data;
|
||||
GtkTreeModel *model;
|
||||
GList *price_list;
|
||||
GList *rows;
|
||||
gint length;
|
||||
|
||||
ENTER(" ");
|
||||
price_list = gnc_tree_view_price_get_selected_prices(pdb_dialog->price_tree);
|
||||
length = g_list_length(price_list);
|
||||
price_list = gnc_tree_view_price_get_selected_prices (pdb_dialog->price_tree);
|
||||
length = g_list_length (price_list);
|
||||
g_list_free (price_list);
|
||||
|
||||
model = gtk_tree_view_get_model (GTK_TREE_VIEW(pdb_dialog->price_tree));
|
||||
rows = gtk_tree_selection_get_selected_rows (treeselection, &model);
|
||||
|
||||
// if selected rows greater than length, parents must of been selected also
|
||||
if (g_list_length (rows) > length)
|
||||
length = 0;
|
||||
|
||||
g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL);
|
||||
g_list_free (rows);
|
||||
|
||||
gtk_widget_set_sensitive (pdb_dialog->edit_button,
|
||||
length == 1);
|
||||
|
||||
@@ -330,39 +330,37 @@ pedit_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
|
||||
PriceEditDialog *pedit_dialog = data;
|
||||
GNCPrice *new_price = NULL;
|
||||
const char *error_str;
|
||||
gboolean price_is_ok = TRUE;
|
||||
|
||||
if ((response == GTK_RESPONSE_OK) || (response == GTK_RESPONSE_APPLY))
|
||||
{
|
||||
error_str = gui_to_price (pedit_dialog);
|
||||
if (g_strcmp0 (error_str, "CANCEL") == 0)
|
||||
price_is_ok = FALSE;
|
||||
else if (error_str)
|
||||
if (g_strcmp0 (error_str, "CANCEL") == 0) // cancel from replace price dialog
|
||||
{
|
||||
// set the ok and cancel buttons sensitivity
|
||||
gnc_prices_set_changed (pedit_dialog, FALSE);
|
||||
return;
|
||||
}
|
||||
else if (error_str) // error string from gui
|
||||
{
|
||||
gnc_warning_dialog (GTK_WINDOW (pedit_dialog->dialog), "%s", error_str);
|
||||
return;
|
||||
}
|
||||
|
||||
// set the ok and cancel buttons sensitivity
|
||||
gnc_prices_set_changed (pedit_dialog, FALSE);
|
||||
if (price_is_ok)
|
||||
{
|
||||
if (pedit_dialog->is_new)
|
||||
gnc_pricedb_add_price (pedit_dialog->price_db, pedit_dialog->price);
|
||||
|
||||
gnc_gui_refresh_all ();
|
||||
}
|
||||
if (pedit_dialog->is_new)
|
||||
gnc_pricedb_add_price (pedit_dialog->price_db, pedit_dialog->price);
|
||||
|
||||
gnc_gui_refresh_all ();
|
||||
}
|
||||
|
||||
if (response == GTK_RESPONSE_APPLY)
|
||||
{
|
||||
if (price_is_ok)
|
||||
{
|
||||
new_price = gnc_price_clone (pedit_dialog->price, pedit_dialog->book);
|
||||
pedit_dialog->is_new = TRUE;
|
||||
new_price = gnc_price_clone (pedit_dialog->price, pedit_dialog->book);
|
||||
pedit_dialog->is_new = TRUE;
|
||||
|
||||
gnc_price_unref (pedit_dialog->price);
|
||||
pedit_dialog->price = new_price;
|
||||
}
|
||||
gnc_price_unref (pedit_dialog->price);
|
||||
pedit_dialog->price = new_price;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -618,9 +616,10 @@ gnc_price_edit_dialog (GtkWidget * parent,
|
||||
if (price)
|
||||
{
|
||||
price = gnc_price_clone(price, pedit_dialog->book);
|
||||
// } else {
|
||||
// price = gnc_price_create (pedit_dialog->book);
|
||||
|
||||
gnc_price_set_source (price, PRICE_SOURCE_EDIT_DLG);
|
||||
gnc_price_set_time64 (price, gnc_time (NULL));
|
||||
gnc_price_set_value (price, gnc_numeric_zero ());
|
||||
}
|
||||
|
||||
pedit_dialog->is_new = TRUE;
|
||||
|
||||
+104
-59
@@ -58,15 +58,19 @@
|
||||
#include "guile-mappings.h"
|
||||
#ifdef __MINGW32__
|
||||
#include <Windows.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static QofLogModule log_module = GNC_MOD_GUI;
|
||||
|
||||
#ifdef HAVE_GETTEXT
|
||||
# include <libintl.h>
|
||||
# include <locale.h>
|
||||
#endif
|
||||
/* Change the following to have a console window attached to GnuCash
|
||||
* for displaying stdout and stderr on Windows.
|
||||
*/
|
||||
#define __MSWIN_CONSOLE__ 0
|
||||
|
||||
#include <libintl.h>
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef MAC_INTEGRATION
|
||||
# include <Foundation/Foundation.h>
|
||||
@@ -96,7 +100,7 @@ static const char *add_quotes_file = NULL;
|
||||
static char *namespace_regexp = NULL;
|
||||
static const char *file_to_load = NULL;
|
||||
static gchar **args_remaining = NULL;
|
||||
static gchar *sys_locale = NULL;
|
||||
static gchar *sys_locale = NULL;
|
||||
|
||||
static GOptionEntry options[] =
|
||||
{
|
||||
@@ -611,23 +615,7 @@ inner_main (void *closure, int argc, char **argv)
|
||||
|
||||
main_mod = scm_c_resolve_module("gnucash utilities");
|
||||
scm_set_current_module(main_mod);
|
||||
#ifdef __MINGW32__
|
||||
/* Guile initialization calls setlocale(LC_ALL, "") which on
|
||||
* windows resets the locale to what the user has set in the
|
||||
* registry. Put it back to what we set from the environment or
|
||||
* environment file.
|
||||
*/
|
||||
if (sys_locale)
|
||||
{
|
||||
setlocale (LC_ALL, sys_locale);
|
||||
g_free (sys_locale);
|
||||
sys_locale = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
setlocale (LC_ALL, "C");
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Check whether the settings need a version update */
|
||||
gnc_gsettings_version_upgrade ();
|
||||
|
||||
@@ -763,37 +751,102 @@ gnc_log_init()
|
||||
}
|
||||
|
||||
#ifdef __MINGW32__
|
||||
/* Set the Win32 internal localization for the main thread if the
|
||||
* locale has been overridden in the environment. Note that this is
|
||||
* separate from what setlocale() does; that only affects POSIX
|
||||
* functions and does *not* set the Windows locale.
|
||||
/* If one of the Unix locale variables LC_ALL, LC_MESSAGES, or LANG is
|
||||
* set in the environment check to see if it's a valid locale and if
|
||||
* it is set both the Windows and POSIX locales to that. If not
|
||||
* retrieve the Windows locale and set POSIX to match.
|
||||
*/
|
||||
static void
|
||||
set_win32_thread_locale()
|
||||
{
|
||||
gunichar2* wlocale = NULL;
|
||||
WCHAR lpLocaleName[LOCALE_NAME_MAX_LENGTH];
|
||||
char *locale = NULL;
|
||||
int len = 0;
|
||||
if (((locale = getenv ("LC_ALL")) == NULL || locale[0] == '\0')
|
||||
&& ((locale = getenv ("LC_MESSAGES")) == NULL || locale[0] == '\0')
|
||||
&& ((locale = getenv ("LANG")) == NULL || locale[0] == '\0'))
|
||||
return;
|
||||
len = strchr(locale, '.') - locale;
|
||||
locale[2] = '-';
|
||||
wlocale = g_utf8_to_utf16 (locale, len, NULL, NULL, NULL);
|
||||
if (IsValidLocaleName(wlocale))
|
||||
|
||||
if (((locale = getenv ("LC_ALL")) != NULL && locale[0] != '\0') ||
|
||||
((locale = getenv ("LC_MESSAGES")) != NULL && locale[0] != '\0') ||
|
||||
((locale = getenv ("LANG")) != NULL && locale[0] != '\0'))
|
||||
{
|
||||
LCID lcid = LocaleNameToLCID(wlocale, LOCALE_ALLOW_NEUTRAL_NAMES);
|
||||
SetThreadLocale(lcid);
|
||||
gunichar2* wlocale = NULL;
|
||||
int len = 0;
|
||||
len = strchr(locale, '.') - locale;
|
||||
locale[2] = '-';
|
||||
wlocale = g_utf8_to_utf16 (locale, len, NULL, NULL, NULL);
|
||||
if (IsValidLocaleName(wlocale))
|
||||
{
|
||||
LCID lcid = LocaleNameToLCID(wlocale, LOCALE_ALLOW_NEUTRAL_NAMES);
|
||||
SetThreadLocale(lcid);
|
||||
locale[2] = '_';
|
||||
setlocale (LC_ALL, locale);
|
||||
sys_locale = locale;
|
||||
g_free(wlocale);
|
||||
return;
|
||||
}
|
||||
g_free(locale);
|
||||
g_free(wlocale);
|
||||
}
|
||||
if (GetUserDefaultLocaleName(lpLocaleName, LOCALE_NAME_MAX_LENGTH))
|
||||
{
|
||||
sys_locale = g_utf16_to_utf8((gunichar2*)lpLocaleName,
|
||||
LOCALE_NAME_MAX_LENGTH,
|
||||
NULL, NULL, NULL);
|
||||
sys_locale[2] = '_';
|
||||
setlocale (LC_ALL, sys_locale);
|
||||
return;
|
||||
}
|
||||
g_free(locale);
|
||||
g_free(wlocale);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Creates a console window on MSWindows to display stdout and stderr
|
||||
* when __MSWIN_CONSOLE__ is defined at the top of the file.
|
||||
*
|
||||
* Useful for displaying the diagnostics printed before logging is
|
||||
* started and if logging is redirected with --logto=stderr.
|
||||
*/
|
||||
static void
|
||||
redirect_stdout (void)
|
||||
{
|
||||
#if defined __MINGW32__ && __MSWIN_CONSOLE__
|
||||
static const WORD MAX_CONSOLE_LINES = 500;
|
||||
int hConHandle;
|
||||
long lStdHandle;
|
||||
CONSOLE_SCREEN_BUFFER_INFO coninfo;
|
||||
FILE *fp;
|
||||
|
||||
// allocate a console for this app
|
||||
AllocConsole();
|
||||
|
||||
// set the screen buffer to be big enough to let us scroll text
|
||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
|
||||
coninfo.dwSize.Y = MAX_CONSOLE_LINES;
|
||||
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
|
||||
|
||||
// redirect unbuffered STDOUT to the console
|
||||
lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
|
||||
fp = _fdopen( hConHandle, "w" );
|
||||
*stdout = *fp;
|
||||
setvbuf( stdout, NULL, _IONBF, 0 );
|
||||
|
||||
// redirect unbuffered STDIN to the console
|
||||
lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE);
|
||||
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
|
||||
fp = _fdopen( hConHandle, "r" );
|
||||
*stdin = *fp;
|
||||
setvbuf( stdin, NULL, _IONBF, 0 );
|
||||
|
||||
// redirect unbuffered STDERR to the console
|
||||
lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE);
|
||||
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
|
||||
fp = _fdopen( hConHandle, "w" );
|
||||
*stderr = *fp;
|
||||
setvbuf( stderr, NULL, _IONBF, 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
gchar *localedir = gnc_path_get_localedir();
|
||||
#if !defined(G_THREADS_ENABLED) || defined(G_THREADS_IMPL_NONE)
|
||||
# error "No GLib thread implementation available!"
|
||||
#endif
|
||||
@@ -807,6 +860,7 @@ main(int argc, char ** argv)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
redirect_stdout ();
|
||||
|
||||
/* This should be called before gettext is initialized
|
||||
* The user may have configured a different language via
|
||||
@@ -814,12 +868,12 @@ main(int argc, char ** argv)
|
||||
*/
|
||||
#ifdef MAC_INTEGRATION
|
||||
set_mac_locale();
|
||||
#elif defined __MINGW32__
|
||||
set_win32_thread_locale();
|
||||
#endif
|
||||
gnc_environment_setup();
|
||||
#ifndef MAC_INTEGRATION /* setlocale already done */
|
||||
#if ! defined MAC_INTEGRATION && ! defined __MINGW32__/* setlocale already done */
|
||||
sys_locale = g_strdup (setlocale (LC_ALL, ""));
|
||||
#ifdef __MINGW32__
|
||||
set_win32_thread_locale();
|
||||
#endif
|
||||
if (!sys_locale)
|
||||
{
|
||||
@@ -828,18 +882,12 @@ main(int argc, char ** argv)
|
||||
g_setenv ("LC_ALL", "C", TRUE);
|
||||
setlocale (LC_ALL, "C");
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETTEXT
|
||||
{
|
||||
gchar *localedir = gnc_path_get_localedir();
|
||||
bindtextdomain(GETTEXT_PACKAGE, localedir);
|
||||
bindtextdomain("iso_4217", localedir); // For win32 to find currency name translations
|
||||
bind_textdomain_codeset("iso_4217", "UTF-8");
|
||||
textdomain(GETTEXT_PACKAGE);
|
||||
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
|
||||
g_free(localedir);
|
||||
}
|
||||
#endif
|
||||
bindtextdomain(GETTEXT_PACKAGE, localedir);
|
||||
bindtextdomain("iso_4217", localedir); // For win32 to find currency name translations
|
||||
bind_textdomain_codeset("iso_4217", "UTF-8");
|
||||
textdomain(GETTEXT_PACKAGE);
|
||||
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
|
||||
g_free(localedir);
|
||||
|
||||
gnc_parse_command_line(&argc, &argv);
|
||||
gnc_print_unstable_message();
|
||||
@@ -858,12 +906,9 @@ main(int argc, char ** argv)
|
||||
* To be on the safe side, only do this if not on OS X,
|
||||
* to avoid unintentionally messing up the locale settings */
|
||||
PINFO ("System locale returned %s", sys_locale ? sys_locale : "(null)");
|
||||
PINFO ("Effective locale set to %s.", setlocale (LC_ALL, ""));
|
||||
#ifndef __MINGW32__
|
||||
/* We need it for later on Windows, see inner_main(). */
|
||||
PINFO ("Effective locale set to %s.", setlocale (LC_ALL, NULL));
|
||||
g_free (sys_locale);
|
||||
sys_locale = NULL;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* If asked via a command line parameter, fetch quotes only */
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
</key>
|
||||
<child name="match-picker" schema="org.gnucash.dialogs.import.generic.match-picker"/>
|
||||
<child name="transaction-list" schema="org.gnucash.dialogs.import.generic.transaction-list"/>
|
||||
<child name="account-picker" schema="org.gnucash.dialogs.import.generic.account-picker"/>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.import.generic.match-picker" path="/org/gnucash/dialogs/import/generic/match-picker/">
|
||||
@@ -59,6 +60,16 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.import.generic.account-picker" path="/org/gnucash/dialogs/import/generic/account-picker/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
<description>This setting describes the size and position of the window when it was last closed.
|
||||
The numbers are the X and Y coordinates of the top left corner of the window
|
||||
followed by the width and height of the window.</description>
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.import.generic.transaction-list" path="/org/gnucash/dialogs/import/generic/transaction-list/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
|
||||
@@ -32,5 +32,16 @@
|
||||
<summary>Show documentation</summary>
|
||||
<description>Show some documentation-only pages in QIF Import assistant.</description>
|
||||
</key>
|
||||
<child name="account-picker" schema="org.gnucash.dialogs.import.qif.account-picker"/>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.import.qif.account-picker" path="/org/gnucash/dialogs/import/qif/account-picker/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
<description>This setting describes the size and position of the window when it was last closed.
|
||||
The numbers are the X and Y coordinates of the top left corner of the window
|
||||
followed by the width and height of the window.</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
@@ -27,14 +27,14 @@
|
||||
<object class="GtkLabel" id="start_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">
|
||||
<property name="label" translatable="yes" comments="Run the assistent in your language to see GTK's translation of the button labels.">
|
||||
This assistant will help you import Accounts from a file.
|
||||
|
||||
The file must be in the same format as that exported as this is a fixed format import which can be seen by looking at a file created by using the 'Export Account Tree to CSV' export menu option.
|
||||
The file must be in the same format as that exported as this is a fixed format import which can be seen by looking at a file created by using the "Export Account Tree to CSV" export menu option.
|
||||
|
||||
If the account is missing, based on the full account name, it will be added as long as the security / currency specified exists. If the account exists, then four fields will be updated. These are code, description, notes and color.
|
||||
|
||||
Click on 'Forward' to proceed or 'Cancel' to Abort Import.
|
||||
Click on "Next" to proceed or "Cancel" to Abort Import.
|
||||
</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="wrap">True</property>
|
||||
|
||||
@@ -61,7 +61,7 @@ Lastly, for repeated imports the preview page has buttons to Load and Save the s
|
||||
|
||||
This operation is not reversable, so make sure you have a working backup.
|
||||
|
||||
Click on 'Forward' to proceed or 'Cancel' to Abort Import.</property>
|
||||
Click on "Next" to proceed or "Cancel" to Abort Import.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -82,7 +82,7 @@ Click on 'Forward' to proceed or 'Cancel' to Abort Import.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">
|
||||
Select location and file name for the Import, then click 'OK'...
|
||||
Select location and file name for the Import, then click "OK"...
|
||||
</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
@@ -759,8 +759,8 @@ Select location and file name for the Import, then click 'OK'...
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Starting from the first line that is actually imported every second line will be skipped. This option will take the leading lines to skip into account as well.
|
||||
For example
|
||||
* if 'Leading Lines to Skip' is set to 3, the first line to import will be line 4. Lines 5, 7, 9,... will be skipped.
|
||||
* if 'Leading Lines to Skip' is set to 4, the first line to import will be line 5. Lines 6, 8, 10,... will be skipped.</property>
|
||||
* if "Leading Lines to Skip" is set to 3, the first line to import will be line 4. Lines 5, 7, 9,... will be skipped.
|
||||
* if "Leading Lines to Skip" is set to 4, the first line to import will be line 5. Lines 6, 8, 10,... will be skipped.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="csv_price_imp_preview_skiprows_cb" swapped="no"/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.4 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkListStore" id="account_match_store">
|
||||
@@ -1080,17 +1080,20 @@ For example
|
||||
<object class="GtkLabel" id="label8">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">On the following page you will be able to associate each transaction to a category.
|
||||
<property name="label" translatable="yes">If you click "Next" Gnucash will perform a number of checks.
|
||||
|
||||
If there were problems with the import settings, pressing forward will take you back to the preview page to try and correct.
|
||||
If one of those <i>checks fails</i> you'll be automatically redirected to the preview page to try and correct.
|
||||
|
||||
If this is the first time importing, you will find that all lines may need to be associated. On subsequent imports, the importer will try to associate the transactions based on previous imports.
|
||||
On the following page you will be able to associate each transaction to a category.
|
||||
|
||||
If this is your initial import into a new file, you will first see a dialog for setting book options, since these can affect how imported data are converted to GnuCash transactions. If this is an existing file, the dialog will not be shown.
|
||||
If this is your <i>initial import into a new file</i>, you will first see a dialog for setting book options, since these can affect how imported data are converted to GnuCash transactions. If this is an existing file, the dialog will not be shown.
|
||||
|
||||
If this is the <i>first time importing</i>, you will find that all lines may need to be associated. On subsequent imports, the importer will try to associate the transactions based on previous imports.
|
||||
|
||||
The confidence of a correct association is displayed as a colored bar.
|
||||
|
||||
More information can be displayed by using the help button.</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkListStore" id="currency_liststore">
|
||||
@@ -32,15 +32,18 @@
|
||||
<signal name="cancel" handler="gnc_ui_qif_import_cancel_cb" swapped="no"/>
|
||||
<signal name="close" handler="gnc_ui_qif_import_close_cb" swapped="no"/>
|
||||
<signal name="prepare" handler="gnc_ui_qif_import_prepare_cb" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="start_page">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">GnuCash can import financial data from QIF (Quicken Interchange Format) files written by Quicken/QuickBooks, MS Money, Moneydance, and many other programs.
|
||||
<property name="label" translatable="yes" comments="Run the assistent in your language to see GTK's translation of the button labels.">GnuCash can import financial data from QIF (Quicken Interchange Format) files written by Quicken/QuickBooks, MS Money, Moneydance, and many other programs.
|
||||
|
||||
The import process has several steps. Your GnuCash accounts will not be changed until you click "Apply" at the end of the process.
|
||||
|
||||
Click "Forward" to start loading your QIF data, or "Cancel" to abort the process. </property>
|
||||
Click "Next" to start loading your QIF data, or "Cancel" to abort the process. </property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -60,7 +63,7 @@ Click "Forward" to start loading your QIF data, or "Cancel" to abort the process
|
||||
<object class="GtkLabel" id="label822">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Please select a file to load. When you click "Forward", the file will be loaded and analyzed. You may need to answer some questions about the account(s) in the file.
|
||||
<property name="label" translatable="yes" comments="Run the assistent in your language to see GTK's translation of the button labels.">Please select a file to load. When you click "Next", the file will be loaded and analyzed. You may need to answer some questions about the account(s) in the file.
|
||||
|
||||
You will have the opportunity to load as many files as you wish, so don't worry if your data is in multiple files.
|
||||
</property>
|
||||
@@ -378,6 +381,7 @@ Please enter a name for the account. If the file was exported from another accou
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<signal name="changed" handler="gnc_ui_qif_import_acct_valid_cb" swapped="no"/>
|
||||
<signal name="activate" handler="gnc_ui_qif_import_acct_enter_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
@@ -447,9 +451,9 @@ Please enter a name for the account. If the file was exported from another accou
|
||||
<object class="GtkLabel" id="label816">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Click "Load another file" if you have more data to import at this time. Do this if you have saved your accounts to separate QIF files.
|
||||
<property name="label" translatable="yes" comments="Run the assistent in your language to see GTK's translation of the button labels.">Click "Load another file" if you have more data to import at this time. Do this if you have saved your accounts to separate QIF files.
|
||||
|
||||
Click "Forward" to finish loading files and move to the next step of the QIF import process. </property>
|
||||
Click "Next" to finish loading files and move to the next step of the QIF import process. </property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -983,25 +987,78 @@ In the following page, you will see the text that appears in the Payee and Memo
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="commodity_doc_page">
|
||||
<object class="GtkBox" id="commodity_page">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label833">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">In the following pages you will be asked to provide information about stocks, mutual funds, and other investments that appear in the QIF file(s) you are importing. GnuCash needs some additional details about these investments that the QIF format does not provide.
|
||||
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label833">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_bottom">12</property>
|
||||
<property name="label" translatable="yes">Below you are asked to provide information about stocks, mutual funds, and other investments that appear in the QIF file(s) you are importing. GnuCash needs some additional details about these investments that the QIF format does not provide.
|
||||
|
||||
Each stock, mutual fund, or other investment must have a name and an abbreviation, such as a stock symbol. Because some unrelated investments have the same abbreviation, you also need to indicate what type of abbreviation you have entered. For example, you could select the exchange that assigned the symbol (NASDAQ, NYSE, etc.), or select an investment type.
|
||||
|
||||
If you don't see your exchange listed, or none of the available choices are appropriate, you can enter a new one.</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label834">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Enter Information about...</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkNotebook" id="commodity_notebook">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="tab_pos">left</property>
|
||||
<property name="scrollable">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label835">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">All fields must be complete to continue...</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -1165,12 +1222,12 @@ If you don't see your exchange listed, or none of the available choices are appr
|
||||
<object class="GtkLabel" id="label847694">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">
|
||||
<property name="label" translatable="yes" comments="Run the assistent in your language to see GTK's translation of the button labels.">
|
||||
If you are importing a QIF file from a bank or other financial institution, some of the transactions may already exist in your GnuCash accounts. To avoid duplication, GnuCash has tried to identify matches and needs your help to review them.
|
||||
|
||||
On the next page you will be shown a list of imported transactions. As you select each one, a list of possible matches will be shown below it. If you find a correct match, click on it. Your selection will be confirmed by a check mark in the "Match?" column.
|
||||
|
||||
Click "Forward" to review the possible matches.</property>
|
||||
Click "Next" to review the possible matches.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -1196,7 +1253,7 @@ Click "Forward" to review the possible matches.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame45">
|
||||
<property name="visible">True</property>
|
||||
@@ -1319,10 +1376,8 @@ Click "Cancel" to abort the QIF import process.</property>
|
||||
<property name="has_padding">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkBox" id="assistant-action_area2">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -244,7 +244,7 @@
|
||||
<object class="GtkLabel" id="stock_cash_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">If you received a cash disbursement as a result of the stock split, enter the details of that payment here. Otherwise, just click `Forward'.</property>
|
||||
<property name="label" translatable="yes">If you received a cash disbursement as a result of the stock split, enter the details of that payment here. Otherwise, just click "Next".</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
@@ -417,7 +417,7 @@
|
||||
<object class="GtkLabel" id="finish_page_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">If you are finished creating the stock split or merger, press `Apply'. You may also press `Back' to review your choices, or `Cancel' to quit without making any changes.</property>
|
||||
<property name="label" translatable="yes">If you are finished creating the stock split or merger, press "Apply". You may also press "Back" to review your choices, or "Cancel" to quit without making any changes.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkAdjustment" id="cust_days_in_adj">
|
||||
@@ -40,6 +40,9 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Preferences</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="business_prefs">
|
||||
<property name="visible">True</property>
|
||||
@@ -47,181 +50,7 @@
|
||||
<property name="border_width">6</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label53">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label54">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><b>Invoices</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.bill/tax-included">
|
||||
<property name="label" translatable="yes">Ta_x included</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Whether tax is included by default in entries on Bills. This setting is inherited by new customers and vendors.</property>
|
||||
<property name="tooltip_text" translatable="yes">Whether tax is included by default in entries on Bills. This setting is inherited by new customers and vendors.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">13</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="pref/dialogs.business.bill/days-in-advance">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">How many days in the future to warn about Bills coming due.</property>
|
||||
<property name="tooltip_text" translatable="yes">How many days in the future to warn about Bills coming due.</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="adjustment">days_in_adj</property>
|
||||
<property name="climb_rate">1</property>
|
||||
<property name="numeric">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">12</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label15">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">_Days in advance:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">pref/dialogs.business.bill/days-in-advance</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">12</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.bill/notify-when-due">
|
||||
<property name="label" translatable="yes">_Notify when due</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Whether to display the list of Bills Due at startup.</property>
|
||||
<property name="tooltip_text" translatable="yes">Whether to display the list of Bills Due at startup.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">12</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label51">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><b>Bills</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">11</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label50">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.invoice/tax-included">
|
||||
<property name="label" translatable="yes">_Tax included</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Whether tax is included by default in entries on Invoices. This setting is inherited by new customers and vendors.</property>
|
||||
<property name="tooltip_text" translatable="yes">Whether tax is included by default in entries on Invoices. This setting is inherited by new customers and vendors.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.invoice/accumulate-splits">
|
||||
<property name="label" translatable="yes">_Accumulate splits on post</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Whether multiple entries in an invoice which transfer to the same account should be accumulated into a single split by default. This setting can be changed in the Post dialog.</property>
|
||||
<property name="tooltip_text" translatable="yes">Whether multiple entries in an invoice which transfer to the same account should be accumulated into a single split by default. This setting can be changed in the Post dialog.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.invoice/use-new-window">
|
||||
<property name="label" translatable="yes">_Open in new window</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">If checked, each invoice will be opened in its own top level window. If clear, the invoice will be opened in the current window.</property>
|
||||
<property name="tooltip_text" translatable="yes">If checked, each invoice will be opened in its own top level window. If clear, the invoice will be opened in the current window.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
@@ -252,6 +81,246 @@
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.invoice/use-new-window">
|
||||
<property name="label" translatable="yes">_Open in new window</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">If checked, each invoice will be opened in its own top level window. If clear, the invoice will be opened in the current window.</property>
|
||||
<property name="tooltip_text" translatable="yes">If checked, each invoice will be opened in its own top level window. If clear, the invoice will be opened in the current window.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.invoice/accumulate-splits">
|
||||
<property name="label" translatable="yes">_Accumulate splits on post</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Whether multiple entries in an invoice which transfer to the same account should be accumulated into a single split by default. This setting can be changed in the Post dialog.</property>
|
||||
<property name="tooltip_text" translatable="yes">Whether multiple entries in an invoice which transfer to the same account should be accumulated into a single split by default. This setting can be changed in the Post dialog.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><b>Invoices</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.invoice/notify-when-due">
|
||||
<property name="label" translatable="yes">Not_ify when due</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Whether to display the list of Bills Due at startup.</property>
|
||||
<property name="tooltip_text" translatable="yes">Whether to display the list of Bills Due at startup.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="label" translatable="yes">Report for printing:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.invoice/tax-included">
|
||||
<property name="label" translatable="yes">_Tax included</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Whether tax is included by default in entries on Bills. This setting is inherited by new customers and vendors.</property>
|
||||
<property name="tooltip_text" translatable="yes">Whether tax is included by default in entries on Bills. This setting is inherited by new customers and vendors.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.invoice/auto-pay">
|
||||
<property name="label" translatable="yes" comments="See the tooltip "At post time..." for details.">_Process payments on posting</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">At post time, automatically attempt to pay customer documents with outstanding pre-payments and counter documents. The pre-payments and documents obviously have to be against the same customer. Counter documents are documents with opposite sign. For example for an invoice, customer credit notes and negative invoices are considered counter documents.</property>
|
||||
<property name="tooltip_text" translatable="yes">At post time, automatically attempt to pay customer documents with outstanding pre-payments and counter documents. The pre-payments and documents obviously have to be against the same customer. Counter documents are documents with opposite sign. For example for an invoice, customer credit notes and negative invoices are considered counter documents.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">10</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><b>Bills</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">11</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.bill/notify-when-due">
|
||||
<property name="label" translatable="yes">_Notify when due</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Whether to display the list of Bills Due at startup.</property>
|
||||
<property name="tooltip_text" translatable="yes">Whether to display the list of Bills Due at startup.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">12</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.bill/tax-included">
|
||||
<property name="label" translatable="yes">Ta_x included</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Whether tax is included by default in entries on Invoices. This setting is inherited by new customers and vendors.</property>
|
||||
<property name="tooltip_text" translatable="yes">Whether tax is included by default in entries on Invoices. This setting is inherited by new customers and vendors.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">13</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.bill/auto-pay">
|
||||
<property name="label" translatable="yes" comments="See the tooltip "At post time..." for details.">Pro_cess payments on posting</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">At post time, automatically attempt to pay vendor documents with outstanding pre-payments and counter documents. The pre-payments and documents obviously have to be against the same vendor. Counter documents are documents with opposite sign. For example for a bill, vendor credit notes and negative bills are considered counter documents.</property>
|
||||
<property name="tooltip_text" translatable="yes">At post time, automatically attempt to pay vendor documents with outstanding pre-payments and counter documents. The pre-payments and documents obviously have to be against the same vendor. Counter documents are documents with opposite sign. For example for a bill, vendor credit notes and negative bills are considered counter documents.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">14</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Days in ad_vance:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">pref/dialogs.business.bill/days-in-advance</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">12</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="pref/dialogs.business.bill/days-in-advance">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">How many days in the future to warn about Bills coming due.</property>
|
||||
<property name="tooltip_text" translatable="yes">How many days in the future to warn about Bills coming due.</property>
|
||||
<property name="adjustment">days_in_adj</property>
|
||||
<property name="climb_rate">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">12</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="pref/dialogs.business.invoice/invoice-printreport">
|
||||
<property name="visible">True</property>
|
||||
@@ -273,75 +342,13 @@
|
||||
<property name="width">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="label" translatable="yes">Report for printing:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.invoice/auto-pay">
|
||||
<property name="label" translatable="yes" comments="See the tooltip "At post time..." for details.">_Process payments on posting</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_text" translatable="yes">At post time, automatically attempt to pay customer documents with outstanding pre-payments and counter documents. The pre-payments and documents obviously have to be against the same customer. Counter documents are documents with opposite sign. For example for an invoice, customer credit notes and negative invoices are considered counter documents.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.bill/auto-pay">
|
||||
<property name="label" translatable="yes" comments="See the tooltip "At post time..." for details.">Pro_cess payments on posting</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_text" translatable="yes">At post time, automatically attempt to pay vendor documents with outstanding pre-payments and counter documents. The pre-payments and documents obviously have to be against the same vendor. Counter documents are documents with opposite sign. For example for a bill, vendor credit notes and negative bills are considered counter documents.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">14</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.business.invoice/notify-when-due">
|
||||
<property name="label" translatable="yes">Not_ify when due</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_markup" translatable="yes">Whether to display the list of Invoices Due at startup.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="pref/dialogs.business.invoice/days-in-advance">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="tooltip_markup" translatable="yes">How many days in the future to warn about Bills coming due.</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">How many days in the future to warn about Invoices coming due.</property>
|
||||
<property name="tooltip_text" translatable="yes">How many days in the future to warn about Invoices coming due.</property>
|
||||
<property name="adjustment">cust_days_in_adj</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -351,12 +358,12 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">_Days in advance:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">pref/dialogs.business.bill/days-in-advance</property>
|
||||
<property name="mnemonic_widget">pref/dialogs.business.invoice/days-in-advance</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
@@ -471,9 +478,6 @@
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkWindow" id="preferences_window">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Preferences</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="prefs_table">
|
||||
<property name="visible">True</property>
|
||||
@@ -141,6 +144,9 @@
|
||||
<property name="default_width">300</property>
|
||||
<property name="default_height">400</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
@@ -248,6 +254,44 @@
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="placeholder_warning_hbox">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">6</property>
|
||||
<property name="margin_right">6</property>
|
||||
<property name="margin_top">6</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="placeholder_warning_image">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="stock">gtk-dialog-warning</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="placeholder_warning_label">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.4 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkImage" id="account_new_icon">
|
||||
@@ -14,6 +14,9 @@
|
||||
<property name="default_height">600</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="map" handler="gnc_ui_generic_account_picker_map_cb" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="account_picker_vbox">
|
||||
<property name="visible">True</property>
|
||||
@@ -80,16 +83,83 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
<object class="GtkLabel" id="label847715">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Please select or create an appropriate GnuCash account for:</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
<object class="GtkLabel" id="online_id_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Online account ID here...</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
<object class="GtkBox" id="placeholder_warning_hbox">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">6</property>
|
||||
<property name="margin_right">6</property>
|
||||
<property name="margin_top">6</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="placeholder_warning_image">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="stock">gtk-dialog-warning</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="placeholder_warning_label">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
<object class="GtkScrolledWindow" id="account_tree_sw">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
@@ -99,51 +169,6 @@
|
||||
<action-widget response="-5">okbutton</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
<object class="GtkBox" id="account_picker_content">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label847715">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Please select or create an appropriate GnuCash account for:</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="online_id_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Online account ID here...</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="account_tree_sw">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="atm_fee_adj">
|
||||
<property name="upper">1000</property>
|
||||
<property name="value">2</property>
|
||||
@@ -165,7 +190,6 @@
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkDialog" id="format_picker_dialog">
|
||||
<property name="visible">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Choose a format</property>
|
||||
<property name="resizable">False</property>
|
||||
@@ -173,6 +197,9 @@
|
||||
<property name="default_width">600</property>
|
||||
<property name="default_height">400</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox16">
|
||||
<property name="visible">True</property>
|
||||
@@ -301,6 +328,9 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Preferences</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="matcher_prefs">
|
||||
<property name="visible">True</property>
|
||||
@@ -554,6 +584,9 @@
|
||||
<property name="default_width">600</property>
|
||||
<property name="default_height">400</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox14">
|
||||
<property name="visible">True</property>
|
||||
@@ -726,6 +759,9 @@
|
||||
<property name="resizable">False</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="close" handler="on_matcher_help_close_clicked" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox18">
|
||||
<property name="visible">True</property>
|
||||
@@ -1119,9 +1155,6 @@
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="show_source_account_button">
|
||||
<property name="label" translatable="yes">Show the Source Account column</property>
|
||||
@@ -1145,6 +1178,9 @@
|
||||
<property name="default_height">400</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="close" handler="on_matcher_cancel_clicked" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="transaction_matcher_vbox">
|
||||
<property name="visible">True</property>
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+121
-178
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkDialog" id="job_dialog">
|
||||
@@ -8,6 +8,9 @@
|
||||
<property name="resizable">False</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="destroy" handler="gnc_job_window_destroy_cb" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox3">
|
||||
<property name="visible">True</property>
|
||||
@@ -87,99 +90,70 @@
|
||||
<property name="border_width">3</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="hbox8">
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox4">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Job Number</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Job Name</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Job Number</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox12">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="id_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">The job ID number. If left blank a reasonable number will be chosen for you</property>
|
||||
<property name="tooltip_text" translatable="yes">The job ID number. If left blank a reasonable number will be chosen for you</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<signal name="changed" handler="gnc_job_name_changed_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="name_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<signal name="changed" handler="gnc_job_name_changed_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Job Name</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="id_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">The job ID number. If left blank a reasonable number will be chosen for you</property>
|
||||
<property name="tooltip_text" translatable="yes">The job ID number. If left blank a reasonable number will be chosen for you</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<signal name="changed" handler="gnc_job_name_changed_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="name_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<signal name="changed" handler="gnc_job_name_changed_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
@@ -205,120 +179,89 @@
|
||||
<property name="border_width">3</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="hbox9">
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox5">
|
||||
<object class="GtkLabel" id="owner_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="owner_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label">(owner)</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Billing ID</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="labelrate">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Rate</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="halign">end</property>
|
||||
<property name="label">(owner)</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox13">
|
||||
<object class="GtkLabel" id="labelrate">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Rate</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Billing ID</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="customer_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="customer_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="desc_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="rate_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="rate_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="desc_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkTextBuffer" id="notes_buffer"/>
|
||||
@@ -9,6 +9,9 @@
|
||||
<property name="default_width">950</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="destroy" handler="gnc_order_window_destroy_cb" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox4">
|
||||
<property name="visible">True</property>
|
||||
@@ -107,150 +110,116 @@
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="hbox2">
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox2">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">2</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Order ID</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Date Opened</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="cd_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Date Closed</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label8">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Order ID</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox3">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Date Opened</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="cd_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Date Closed</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="id_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="opened_date_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="id_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="opened_date_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="closed_date_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="active_check">
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="closed_date_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="active_check">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
@@ -276,139 +245,62 @@
|
||||
<property name="border_width">3</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="hbox3">
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox8">
|
||||
<object class="GtkLabel" id="owner_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="owner_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label">(owner)</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label7">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Reference</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="hide1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label11">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="halign">end</property>
|
||||
<property name="label">(owner)</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox9">
|
||||
<object class="GtkLabel" id="label7">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Reference</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="owner_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="owner_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ref_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="hide2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label12">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ref_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
@@ -446,8 +338,8 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="wrap_mode">word</property>
|
||||
<property name="accepts_tab">False</property>
|
||||
<property name="buffer">notes_buffer</property>
|
||||
<property name="accepts_tab">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -530,6 +422,9 @@
|
||||
<property name="title" translatable="yes">New Order</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="destroy" handler="gnc_order_window_destroy_cb" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox6">
|
||||
<property name="visible">True</property>
|
||||
@@ -610,95 +505,67 @@
|
||||
<property name="border_width">3</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="hbox4">
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox12">
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Order ID</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Date Opened</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Order ID</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox13">
|
||||
<object class="GtkEntry" id="entry_id">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">The order ID number. If left blank a reasonable number will be chosen for you</property>
|
||||
<property name="tooltip_text" translatable="yes">The order ID number. If left blank a reasonable number will be chosen for you</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Date Opened</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="date_opened_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry_id">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">The order ID number. If left blank a reasonable number will be chosen for you</property>
|
||||
<property name="tooltip_text" translatable="yes">The order ID number. If left blank a reasonable number will be chosen for you</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="activates_default">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="date_opened_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
@@ -724,91 +591,64 @@
|
||||
<property name="border_width">3</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="hbox5">
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox14">
|
||||
<object class="GtkLabel" id="bill_owner_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="bill_owner_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">(owner)</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label16">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Reference</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">(owner)</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox15">
|
||||
<object class="GtkBox" id="bill_owner_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="bill_owner_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry_ref">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label16">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Reference</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry_ref">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
@@ -848,8 +688,8 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="wrap_mode">word</property>
|
||||
<property name="accepts_tab">False</property>
|
||||
<property name="buffer">text_buffer</property>
|
||||
<property name="accepts_tab">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.2 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkAdjustment" id="auto_decimal_places_adj">
|
||||
@@ -105,6 +105,9 @@
|
||||
<property name="default_height">400</property>
|
||||
<property name="type_hint">normal</property>
|
||||
<signal name="response" handler="gnc_preferences_response_cb" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox2">
|
||||
<property name="visible">True</property>
|
||||
@@ -2008,7 +2011,7 @@ many months before the current month:</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label56">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
@@ -2039,16 +2042,6 @@ many months before the current month:</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label66">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/general.register/auto-raise-lists">
|
||||
<property name="label" translatable="yes">_Auto-raise lists</property>
|
||||
@@ -2061,7 +2054,6 @@ many months before the current month:</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -2070,7 +2062,36 @@ many months before the current month:</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label75">
|
||||
<object class="GtkCheckButton" id="pref/general.register/tab-to-transfer-on-memorised">
|
||||
<property name="label" translatable="yes">Tab order in_cludes Transfer on Memorised Transactions</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Move to Transfer field when memorised transaction auto filled.</property>
|
||||
<property name="tooltip_text" translatable="yes">Move to Transfer field when memorised transaction auto filled.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
@@ -2082,16 +2103,6 @@ many months before the current month:</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label76">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">10</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/dialogs.reconcile/check-cleared">
|
||||
<property name="label" translatable="yes">Check cleared _transactions</property>
|
||||
@@ -2168,6 +2179,86 @@ many months before the current month:</property>
|
||||
<property name="top_attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">10</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><b>Graphics</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">11</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/general.register/use-gnucash-color-theme">
|
||||
<property name="label" translatable="yes">_Use GnuCash built-in color theme</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">GnuCash uses a yellow/green theme by default for register windows. Uncheck this if you want to use the system color theme instead.</property>
|
||||
<property name="tooltip_text" translatable="yes">GnuCash uses a yellow/green theme by default for register windows. Uncheck this if you want to use the system color theme instead.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">12</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/general.register/alternate-color-by-transaction">
|
||||
<property name="label" translatable="yes">Double _mode colors alternate with transactions</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Alternate the primary and secondary colors by transaction instead of by alternating by row.</property>
|
||||
<property name="tooltip_text" translatable="yes">Alternate the primary and secondary colors by transaction instead of by alternating by row.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">13</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/general.register/draw-horizontal-lines">
|
||||
<property name="label" translatable="yes">Draw hori_zontal lines between rows</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Show horizontal borders on the cells.</property>
|
||||
<property name="tooltip_text" translatable="yes">Show horizontal borders on the cells.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">14</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/general.register/draw-vertical-lines">
|
||||
<property name="label" translatable="yes">Draw _vertical lines between columns</property>
|
||||
@@ -2188,7 +2279,7 @@ many months before the current month:</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label46">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
@@ -2198,7 +2289,7 @@ many months before the current month:</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label47">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
@@ -2229,106 +2320,6 @@ many months before the current month:</property>
|
||||
<property name="top_attach">18</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/general.register/draw-horizontal-lines">
|
||||
<property name="label" translatable="yes">Draw hori_zontal lines between rows</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Show horizontal borders on the cells.</property>
|
||||
<property name="tooltip_text" translatable="yes">Show horizontal borders on the cells.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">14</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/general.register/alternate-color-by-transaction">
|
||||
<property name="label" translatable="yes">Double _mode colors alternate with transactions</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Alternate the primary and secondary colors by transaction instead of by alternating by row.</property>
|
||||
<property name="tooltip_text" translatable="yes">Alternate the primary and secondary colors by transaction instead of by alternating by row.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">13</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/general.register/use-gnucash-color-theme">
|
||||
<property name="label" translatable="yes">_Use GnuCash built-in color theme</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">GnuCash uses a yellow/green theme by default for register windows. Uncheck this if you want to use the system color theme instead.</property>
|
||||
<property name="tooltip_text" translatable="yes">GnuCash uses a yellow/green theme by default for register windows. Uncheck this if you want to use the system color theme instead.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">12</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label45">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><b>Graphics</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">11</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pref/general.register/tab-to-transfer-on-memorised">
|
||||
<property name="label" translatable="yes">Tab order in_cludes Transfer on Memorised Transactions</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_markup">Move to Transfer field when memorised transaction auto filled.</property>
|
||||
<property name="tooltip_text" translatable="yes">Move to Transfer field when memorised transaction auto filled.</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label121">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">5</property>
|
||||
@@ -2847,7 +2838,7 @@ many months before the current month:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="top_attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -2873,9 +2864,22 @@ many months before the current month:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">7</property>
|
||||
<property name="top_attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
@@ -3338,8 +3342,5 @@ many months before the current month:</property>
|
||||
<action-widget response="-11">helpbutton2</action-widget>
|
||||
<action-widget response="-7">closebutton2</action-widget>
|
||||
</action-widgets>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkDialog" id="totd_dialog">
|
||||
@@ -10,6 +10,9 @@
|
||||
<property name="default_height">300</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="response" handler="gnc_totd_dialog_response_cb" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox3">
|
||||
<property name="visible">True</property>
|
||||
@@ -23,12 +26,13 @@
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="back-button">
|
||||
<property name="label" translatable="yes">_Back</property>
|
||||
<property name="label">gtk-media-previous</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -38,12 +42,13 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="forward-button">
|
||||
<property name="label" translatable="yes">_Forward</property>
|
||||
<property name="label">gtk-media-next</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -53,12 +58,13 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="close-button">
|
||||
<property name="label" translatable="yes">_Close</property>
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -125,10 +131,10 @@
|
||||
<property name="border_width">6</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="wrap_mode">word</property>
|
||||
<property name="accepts_tab">False</property>
|
||||
<property name="left_margin">5</property>
|
||||
<property name="right_margin">5</property>
|
||||
<property name="cursor_visible">False</property>
|
||||
<property name="accepts_tab">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkAssistant" id="aqbanking_init_assistant">
|
||||
@@ -7,6 +7,7 @@
|
||||
<property name="border_width">12</property>
|
||||
<property name="title" translatable="yes">AqBanking Initial Assistant</property>
|
||||
<property name="default_width">400</property>
|
||||
<property name="default_height">500</property>
|
||||
<signal name="cancel" handler="aai_on_cancel" swapped="no"/>
|
||||
<signal name="close" handler="aai_on_finish" swapped="no"/>
|
||||
<signal name="prepare" handler="aai_on_prepare" swapped="no"/>
|
||||
@@ -14,12 +15,29 @@
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="start_page">
|
||||
<object class="GtkGrid" id="start_page">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">
|
||||
This assistant helps you setting up your Online Banking connection with your bank.
|
||||
|
||||
<property name="margin_left">12</property>
|
||||
<property name="border_width">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">This assistant helps you setting up your Online Banking connection with your bank.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">
|
||||
You first need to apply for Online Banking access at your bank. If your bank decides to grant you electronic access, they will send you a letter containing
|
||||
|
||||
* The bank code of your bank
|
||||
@@ -27,59 +45,67 @@ You first need to apply for Online Banking access at your bank. If your bank de
|
||||
* The Internet address of your bank's Online Banking server
|
||||
* For HBCI Online Banking, information about the cryptographic public key of your bank ("Ini-Letter").
|
||||
|
||||
This information will be needed in the following. Press "Forward" now.
|
||||
This information will be needed in the following. Press "Next" now.
|
||||
|
||||
NOTE: NO WARRANTIES FOR ANYTHING. Some banks run a poorly implemented Online Banking server. You should not rely on time-critical transfers through Online Banking, because sometimes the bank does not give you correct feedback when a transfer is rejected.
|
||||
|
||||
Press "Cancel" if you do not wish to setup any Online Banking connection now.
|
||||
</property>
|
||||
<property name="wrap">True</property>
|
||||
|
||||
Lastly, for repeated imports the preview page has buttons to Load and Save the settings. To save the settings, tweak the settings to your preferences (optionally starting from an existing preset), then (optionally change the settings name and press the Save Settings button. Note you can't save to built-in presets.
|
||||
|
||||
This operation is not reversable, so make sure you have a working backup.
|
||||
|
||||
Click on "Next" to proceed or "Cancel" to Abort Import.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">intro</property>
|
||||
<property name="title" translatable="yes">Initial Online Banking Setup</property>
|
||||
<property name="complete">True</property>
|
||||
<property name="has_padding">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="wizard_page">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label8877441">
|
||||
<object class="GtkLabel" id="wizard_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">The Setup of your Online Banking connection is handled by the external program "AqBanking Setup Wizard". Please press the button below to start this program.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment7">
|
||||
<object class="GtkButton" id="ab_wizard_button">
|
||||
<property name="label" translatable="yes">_Start AqBanking Wizard</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xscale">0</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="ab_wizard_button">
|
||||
<property name="label" translatable="yes">_Start AqBanking Wizard</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="aai_wizard_button_clicked_cb" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="aai_wizard_button_clicked_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -87,88 +113,89 @@ Press "Cancel" if you do not wish to setup any Online Banking connection now.
|
||||
<packing>
|
||||
<property name="page_type">intro</property>
|
||||
<property name="title" translatable="yes">Start Online Banking Wizard</property>
|
||||
<property name="complete">True</property>
|
||||
<property name="has_padding">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="account_match_page">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox157">
|
||||
<object class="GtkScrolledWindow" id="account_scrolledwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">12</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow25">
|
||||
<object class="GtkTreeView" id="account_page_view">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="account_page_view">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="rules_hint">True</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
</object>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label828">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Double Click on the line of an Online Banking account name if you want to match it to a GnuCash account. Click "Next" when all desired accounts are matching.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="account_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Double Click on the line of an Online Banking account name if you want to match it to a GnuCash account. Click "Next" when all desired accounts are matching.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="title" translatable="yes">Match Online accounts with GnuCash accounts</property>
|
||||
<property name="has_padding">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="finish_page">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="finish_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">The setup for matching Online Banking accounts to GnuCash accounts is now finished. You can now invoke Online Banking actions on those accounts.
|
||||
|
||||
If you want to add another bank, user, or account, you can start this assistant again anytime.
|
||||
|
||||
Press "Apply" now.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="title" translatable="yes">Match Online accounts with GnuCash accounts</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="finish_page">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">The setup for matching Online Banking accounts to GnuCash accounts is now finished. You can now invoke Online Banking actions on those accounts.
|
||||
|
||||
If you want to add another bank, user, or account, you can start this assistant again anytime.
|
||||
|
||||
Press "Apply" now.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">confirm</property>
|
||||
<property name="title" translatable="yes">Online Banking Setup Finished</property>
|
||||
<property name="complete">True</property>
|
||||
<property name="has_padding">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkBox">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -79,7 +79,7 @@ gnc_ab_enter_daterange(GtkWidget *parent,
|
||||
if (parent)
|
||||
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent));
|
||||
|
||||
heading_label = GTK_WIDGET(gtk_builder_get_object (builder, "heading_label"));
|
||||
heading_label = GTK_WIDGET(gtk_builder_get_object (builder, "date_heading_label"));
|
||||
first_button = GTK_WIDGET(gtk_builder_get_object (builder, "first_button"));
|
||||
last_retrieval_button = GTK_WIDGET(gtk_builder_get_object (builder, "last_retrieval_button"));
|
||||
info.enter_from_button = GTK_WIDGET(gtk_builder_get_object (builder, "enter_from_button"));
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -238,7 +238,7 @@ struct _GncGWENGui
|
||||
GtkWidget *dialog;
|
||||
|
||||
/* Progress bars */
|
||||
GtkWidget *entries_table;
|
||||
GtkWidget *entries_grid;
|
||||
GtkWidget *top_entry;
|
||||
GtkWidget *top_progress;
|
||||
GtkWidget *second_entry;
|
||||
@@ -531,7 +531,7 @@ setup_dialog(GncGWENGui *gui)
|
||||
|
||||
gui->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "aqbanking_connection_dialog"));
|
||||
|
||||
gui->entries_table = GTK_WIDGET(gtk_builder_get_object (builder, "entries_table"));
|
||||
gui->entries_grid = GTK_WIDGET(gtk_builder_get_object (builder, "entries_grid"));
|
||||
gui->top_entry = GTK_WIDGET(gtk_builder_get_object (builder, "top_entry"));
|
||||
gui->top_progress = GTK_WIDGET(gtk_builder_get_object (builder, "top_progress"));
|
||||
gui->second_entry = GTK_WIDGET(gtk_builder_get_object (builder, "second_entry"));
|
||||
@@ -604,8 +604,8 @@ reset_dialog(GncGWENGui *gui)
|
||||
|
||||
if (gui->other_entries_box)
|
||||
{
|
||||
gtk_table_resize(GTK_TABLE(gui->entries_table),
|
||||
OTHER_ENTRIES_ROW_OFFSET, 2);
|
||||
gtk_grid_remove_row (GTK_GRID(gui->entries_grid),
|
||||
OTHER_ENTRIES_ROW_OFFSET);
|
||||
gtk_widget_destroy(gui->other_entries_box);
|
||||
gui->other_entries_box = NULL;
|
||||
}
|
||||
@@ -806,11 +806,8 @@ show_progress(GncGWENGui *gui, Progress *progress)
|
||||
gtk_widget_show(entry);
|
||||
if (new_box)
|
||||
{
|
||||
gtk_table_resize(GTK_TABLE(gui->entries_table),
|
||||
OTHER_ENTRIES_ROW_OFFSET + 1, 2);
|
||||
gtk_table_attach_defaults(
|
||||
GTK_TABLE(gui->entries_table), box, 1, 2,
|
||||
OTHER_ENTRIES_ROW_OFFSET, OTHER_ENTRIES_ROW_OFFSET + 1);
|
||||
gtk_grid_attach (GTK_GRID(gui->entries_grid), box,
|
||||
1, OTHER_ENTRIES_ROW_OFFSET, 1, 1);
|
||||
gtk_widget_show(box);
|
||||
}
|
||||
}
|
||||
@@ -885,8 +882,8 @@ hide_progress(GncGWENGui *gui, Progress *progress)
|
||||
else
|
||||
{
|
||||
/* Last other progress to be hided */
|
||||
gtk_table_resize(GTK_TABLE(gui->entries_table),
|
||||
OTHER_ENTRIES_ROW_OFFSET, 2);
|
||||
gtk_grid_remove_row (GTK_GRID(gui->entries_grid),
|
||||
OTHER_ENTRIES_ROW_OFFSET);
|
||||
gtk_widget_destroy(box);
|
||||
gui->other_entries_box = NULL;
|
||||
}
|
||||
|
||||
@@ -76,27 +76,28 @@ void csv_export_end_date_cb (GtkWidget *radio, gpointer user_data);
|
||||
void csv_export_file_chooser_file_activated_cb (GtkFileChooser *chooser, CsvExportInfo *info);
|
||||
void csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser, CsvExportInfo *info);
|
||||
|
||||
/* Fixme: Can we simplify the work of translators by splitting in invariant and variant paragraphs? */
|
||||
static const gchar *finish_tree_string = N_(
|
||||
/* Translators: %s is the file name string. */
|
||||
"The account tree will be exported to the file '%s' when you click 'Apply'.\n\n"
|
||||
"You can also verify your selections by clicking on 'Back' or 'Cancel' to Abort Export.\n");
|
||||
"The account tree will be exported to the file '%s' when you click \"Apply\".\n\n"
|
||||
"You can also verify your selections by clicking on \"Back\" or \"Cancel\" to abort the export.\n");
|
||||
|
||||
static const gchar *finish_trans_string = N_(
|
||||
/* Translators: %s is the file name string and %u the number of accounts. */
|
||||
"When you click 'Apply', the transactions will be exported to the file '%s' and"
|
||||
"When you click \"Apply\", the transactions will be exported to the file '%s' and"
|
||||
" the number of accounts exported will be %u.\n\n"
|
||||
"You can also verify your selections by clicking on 'Back' or 'Cancel' to Abort Export.\n");
|
||||
"You can also verify your selections by clicking on \"Back\" or \"Cancel\" to abort the export.\n");
|
||||
|
||||
static const gchar *finish_trans_search_gl_string = N_(
|
||||
/* Translators: %s is the file name string. */
|
||||
"When you click 'Apply', the transactions will be exported to the file '%s'.\n\n"
|
||||
"You can also verify your selections by clicking on 'Back' or 'Cancel' to Abort Export.\n");
|
||||
"When you click \"Apply\", the transactions will be exported to the file '%s'.\n\n"
|
||||
"You can also verify your selections by clicking on \"Back\" or \"Cancel\" to abort the export.\n");
|
||||
|
||||
static const gchar *start_tree_string = N_(
|
||||
"This assistant will help you export the Account Tree to a file\n"
|
||||
" with the separator specified below.\n\n"
|
||||
"Select the settings you require for the file and then click 'Forward' to proceed"
|
||||
" or 'Cancel' to Abort Export.\n");
|
||||
"Select the settings you require for the file and then click \"Next\" to proceed"
|
||||
" or \"Cancel\" to abort the export.\n");
|
||||
|
||||
static const gchar *start_trans_string = N_(
|
||||
"This assistant will help you export the Transactions to a file\n"
|
||||
@@ -105,8 +106,8 @@ static const gchar *start_trans_string = N_(
|
||||
" require further manipulation to get them in a format you can use.\n\n"
|
||||
"Each Transaction will appear once in the export and will be listed in"
|
||||
" the order the accounts were processed\n\n"
|
||||
"Select the settings you require for the file and then click 'Forward' to proceed"
|
||||
" or 'Cancel' to Abort Export.\n");
|
||||
"Select the settings you require for the file and then click \"Next\" to proceed"
|
||||
" or \"Cancel\" to abort the export.\n");
|
||||
|
||||
static const gchar *start_trans_simple_string = N_(
|
||||
"This assistant will help you export the Transactions to a file\n"
|
||||
@@ -117,8 +118,8 @@ static const gchar *start_trans_simple_string = N_(
|
||||
" were processed\n\n"
|
||||
"By selecting the simple layout, the output will be equivalent to a single"
|
||||
" row register view and as such some of the transfer detail could be lost.\n\n"
|
||||
"Select the settings you require for the file and then click 'Forward' to proceed"
|
||||
" or 'Cancel' to Abort Export.\n");
|
||||
"Select the settings you require for the file and then click \"Next\" to proceed"
|
||||
" or \"Cancel\" to abort the export.\n");
|
||||
|
||||
|
||||
/**************************************************
|
||||
@@ -189,7 +190,7 @@ csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser,
|
||||
{
|
||||
GtkAssistant *assistant = GTK_ASSISTANT(info->assistant);
|
||||
|
||||
/* Enable the forward button based on a valid filename */
|
||||
/* Enable the "Next" button based on a valid filename */
|
||||
gtk_assistant_set_page_complete (assistant, info->file_page,
|
||||
csv_export_assistant_check_filename (chooser, info));
|
||||
}
|
||||
@@ -419,7 +420,7 @@ csv_export_account_changed_cb (GtkTreeSelection *selection,
|
||||
|
||||
info->csva.num_accounts = update_accounts_tree (info);
|
||||
|
||||
/* Enable the Forward Assistant Button if we have accounts */
|
||||
/* Enable the "Next" Assistant Button if we have accounts */
|
||||
if (info->csva.num_accounts > 0)
|
||||
gtk_assistant_set_page_complete (assistant, info->account_page, TRUE);
|
||||
else
|
||||
@@ -686,7 +687,7 @@ csv_export_assistant_account_page_prepare (GtkAssistant *assistant,
|
||||
{
|
||||
CsvExportInfo *info = user_data;
|
||||
|
||||
/* Enable the Forward Assistant Button if we have accounts */
|
||||
/* Enable the "Next" Assistant Button if we have accounts */
|
||||
if (info->csva.num_accounts > 0)
|
||||
gtk_assistant_set_page_complete (assistant, info->account_page, TRUE);
|
||||
else
|
||||
@@ -705,7 +706,7 @@ csv_export_assistant_file_page_prepare (GtkAssistant *assistant,
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(info->file_chooser), info->starting_dir);
|
||||
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER(info->file_chooser), "");
|
||||
|
||||
/* Disable the Forward Assistant Button */
|
||||
/* Disable the "Next" Assistant Button */
|
||||
gtk_assistant_set_page_complete (assistant, info->file_page, FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ csv_import_file_chooser_selection_changed_cb (GtkFileChooser *chooser,
|
||||
GtkAssistant *assistant = GTK_ASSISTANT(info->assistant);
|
||||
gtk_assistant_set_page_complete (assistant, info->account_page, FALSE);
|
||||
|
||||
/* Enable the forward button based on a valid filename */
|
||||
/* Enable the "Next" button based on a valid filename */
|
||||
gtk_assistant_set_page_complete (assistant, info->file_page,
|
||||
csv_import_assistant_check_filename (chooser, info));
|
||||
}
|
||||
@@ -255,14 +255,14 @@ void csv_import_hrows_cb (GtkWidget *spin, gpointer user_data)
|
||||
/*******************************************************
|
||||
* csv_import_assistant_enable_account_forward
|
||||
*
|
||||
* enaable forward button on account_page if store has rows
|
||||
* enable "Next" button on account_page if store has rows
|
||||
*******************************************************/
|
||||
static void csv_import_assistant_enable_account_forward (CsvImportInfo *info)
|
||||
{
|
||||
GtkAssistant *assistant = GTK_ASSISTANT(info->assistant);
|
||||
gboolean store_has_rows = TRUE;
|
||||
|
||||
/* if the store is empty, disable forward button */
|
||||
/* if the store is empty, disable "Next" button */
|
||||
if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL(info->store), NULL) == 0)
|
||||
store_has_rows = FALSE;
|
||||
|
||||
@@ -320,7 +320,7 @@ void csv_import_sep_cb (GtkWidget *radio, gpointer user_data)
|
||||
else
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON(info->header_row_spin), 0); //reset header spin to 0
|
||||
|
||||
/* if the store has rows, enable forward button */
|
||||
/* if the store has rows, enable "Next" button */
|
||||
csv_import_assistant_enable_account_forward (info);
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ csv_import_assistant_file_page_prepare (GtkAssistant *assistant,
|
||||
if (info->starting_dir)
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(info->file_chooser), info->starting_dir);
|
||||
|
||||
/* Disable the Forward Assistant Button */
|
||||
/* Disable the "Next" Assistant Button */
|
||||
gtk_assistant_set_page_complete (assistant, info->file_page, FALSE);
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ csv_import_assistant_account_page_prepare (GtkAssistant *assistant,
|
||||
CsvImportInfo *info = user_data;
|
||||
csv_import_result res;
|
||||
|
||||
/* Disable the Forward Assistant Button */
|
||||
/* Disable the "Next" Assistant Button */
|
||||
gtk_assistant_set_page_complete (assistant, info->account_page, FALSE);
|
||||
|
||||
/* test read one line */
|
||||
@@ -477,7 +477,7 @@ csv_import_assistant_account_page_prepare (GtkAssistant *assistant,
|
||||
else
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON(info->header_row_spin), 0); //reset header spin to 0
|
||||
|
||||
/* if the store has rows, enable forward button */
|
||||
/* if the store has rows, enable "Next" button */
|
||||
csv_import_assistant_enable_account_forward (info);
|
||||
}
|
||||
|
||||
|
||||
@@ -678,7 +678,7 @@ CsvImpPriceAssist::~CsvImpPriceAssist ()
|
||||
* Code related to the file chooser page
|
||||
**************************************************/
|
||||
|
||||
/* check_for_valid_filename for a valid file to activate the forward button
|
||||
/* check_for_valid_filename for a valid file to activate the "Next" button
|
||||
*/
|
||||
bool
|
||||
CsvImpPriceAssist::check_for_valid_filename ()
|
||||
@@ -727,7 +727,7 @@ CsvImpPriceAssist::file_activated_cb ()
|
||||
void
|
||||
CsvImpPriceAssist::file_selection_changed_cb ()
|
||||
{
|
||||
/* Enable the forward button based on a valid filename */
|
||||
/* Enable the "Next" button based on a valid filename */
|
||||
gtk_assistant_set_page_complete (csv_imp_asst, file_page,
|
||||
check_for_valid_filename ());
|
||||
}
|
||||
@@ -1741,7 +1741,7 @@ void CsvImpPriceAssist::preview_validate_settings ()
|
||||
void
|
||||
CsvImpPriceAssist::assist_file_page_prepare ()
|
||||
{
|
||||
/* Disable the Forward Assistant Button */
|
||||
/* Disable the "Next" Assistant Button */
|
||||
gtk_assistant_set_page_complete (csv_imp_asst, file_page, false);
|
||||
gtk_assistant_set_page_complete (csv_imp_asst, preview_page, false);
|
||||
|
||||
@@ -1796,7 +1796,7 @@ CsvImpPriceAssist::assist_preview_page_prepare ()
|
||||
// set over_write to false as default
|
||||
price_imp->over_write (false);
|
||||
|
||||
/* Disable the Forward Assistant Button */
|
||||
/* Disable the "Next" Assistant Button */
|
||||
gtk_assistant_set_page_complete (csv_imp_asst, preview_page, false);
|
||||
|
||||
/* Load the data into the treeview. */
|
||||
|
||||
@@ -682,7 +682,7 @@ CsvImpTransAssist::~CsvImpTransAssist ()
|
||||
* Code related to the file chooser page
|
||||
**************************************************/
|
||||
|
||||
/* check_for_valid_filename for a valid file to activate the forward button
|
||||
/* check_for_valid_filename for a valid file to activate the "Next" button
|
||||
*/
|
||||
bool
|
||||
CsvImpTransAssist::check_for_valid_filename ()
|
||||
@@ -731,7 +731,7 @@ CsvImpTransAssist::file_activated_cb ()
|
||||
void
|
||||
CsvImpTransAssist::file_selection_changed_cb ()
|
||||
{
|
||||
/* Enable the forward button based on a valid filename */
|
||||
/* Enable the "Next" button based on a valid filename */
|
||||
gtk_assistant_set_page_complete (csv_imp_asst, file_page,
|
||||
check_for_valid_filename ());
|
||||
}
|
||||
@@ -1885,7 +1885,7 @@ CsvImpTransAssist::assist_file_page_prepare ()
|
||||
g_free (starting_dir);
|
||||
}
|
||||
|
||||
/* Disable the Forward Assistant Button */
|
||||
/* Disable the "Next" Assistant Button */
|
||||
gtk_assistant_set_page_complete (csv_imp_asst, account_match_page, false);
|
||||
}
|
||||
|
||||
@@ -1933,7 +1933,7 @@ CsvImpTransAssist::assist_preview_page_prepare ()
|
||||
|
||||
tx_imp->req_mapped_accts (false);
|
||||
|
||||
/* Disable the Forward Assistant Button */
|
||||
/* Disable the "Next" Assistant Button */
|
||||
gtk_assistant_set_page_complete (csv_imp_asst, preview_page, false);
|
||||
|
||||
/* Load the data into the treeview. */
|
||||
@@ -1962,7 +1962,7 @@ CsvImpTransAssist::assist_account_match_page_prepare ()
|
||||
gtk_widget_set_sensitive (account_match_view, true);
|
||||
gtk_widget_set_sensitive (account_match_btn, true);
|
||||
|
||||
/* Enable the Forward Assistant Button */
|
||||
/* Enable the "Next" Assistant Button */
|
||||
gtk_assistant_set_page_complete (csv_imp_asst, account_match_page,
|
||||
csv_tximp_acct_match_check_all (store));
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include "gnc-commodity.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-prefs.h"
|
||||
#include "gnc-tree-view-account.h"
|
||||
#include "gnc-ui.h"
|
||||
|
||||
@@ -47,6 +48,9 @@ static QofLogModule log_module = GNC_MOD_IMPORT;
|
||||
|
||||
#define STATE_SECTION "dialogs/import/generic_matcher/account_matcher"
|
||||
|
||||
#define GNC_PREFS_GROUP "dialogs.import.generic.account-picker"
|
||||
|
||||
|
||||
/*-******************************************************************\
|
||||
* Functions needed by gnc_import_select_account
|
||||
*
|
||||
@@ -58,7 +62,6 @@ static AccountPickerDialog* gnc_import_new_account_picker(void)
|
||||
{
|
||||
AccountPickerDialog* picker = g_new(AccountPickerDialog, 1);
|
||||
picker->dialog = NULL;
|
||||
picker->assistant = NULL;
|
||||
picker->account_tree = NULL;
|
||||
picker->account_tree_sw = NULL;
|
||||
picker->auto_create = TRUE;
|
||||
@@ -147,8 +150,6 @@ gnc_import_add_account(GtkWidget *button, AccountPickerDialog *picker)
|
||||
|
||||
if (picker->dialog != NULL)
|
||||
parent = GTK_WINDOW (picker->dialog);
|
||||
else
|
||||
parent = GTK_WINDOW (picker->assistant);
|
||||
|
||||
/*DEBUG("Begin"); */
|
||||
if (picker->new_account_default_type != ACCT_TYPE_NONE)
|
||||
@@ -167,6 +168,53 @@ gnc_import_add_account(GtkWidget *button, AccountPickerDialog *picker)
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************
|
||||
* show_placeholder_warning
|
||||
*
|
||||
* show the warning when account is a place holder and disable
|
||||
* OK button
|
||||
************************************************************/
|
||||
static void
|
||||
show_placeholder_warning (AccountPickerDialog *picker, const gchar *name)
|
||||
{
|
||||
gchar *text = g_strdup_printf (_("The account %s is a placeholder account and does not allow "
|
||||
"transactions. Please choose a different account."), name);
|
||||
|
||||
gtk_label_set_text (GTK_LABEL(picker->pwarning), text);
|
||||
gnc_label_set_alignment (picker->pwarning, 0.0, 0.5);
|
||||
gtk_widget_show_all (GTK_WIDGET(picker->pwhbox));
|
||||
g_free (text);
|
||||
|
||||
gtk_widget_set_sensitive (picker->ok_button, FALSE); // disable OK button
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* account_tree_row_changed_cb
|
||||
*
|
||||
* Callback for when user selects a different row
|
||||
*******************************************************/
|
||||
static void
|
||||
account_tree_row_changed_cb (GtkTreeSelection *selection,
|
||||
AccountPickerDialog *picker)
|
||||
{
|
||||
|
||||
Account *sel_account = gnc_tree_view_account_get_selected_account (picker->account_tree);
|
||||
|
||||
gtk_widget_set_sensitive (picker->ok_button, TRUE); // enable OK button
|
||||
|
||||
/* See if the selected account is a placeholder. */
|
||||
if (sel_account && xaccAccountGetPlaceholder (sel_account))
|
||||
{
|
||||
const gchar *retval_name = xaccAccountGetName (sel_account);
|
||||
|
||||
show_placeholder_warning (picker, retval_name);
|
||||
}
|
||||
else
|
||||
gtk_widget_hide (GTK_WIDGET(picker->pwhbox)); // hide the placeholder warning
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* account_tree_row_activated_cb
|
||||
*
|
||||
@@ -177,53 +225,7 @@ account_tree_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
|
||||
GtkTreeViewColumn *column,
|
||||
AccountPickerDialog *picker)
|
||||
{
|
||||
const gchar *retval_name = NULL;
|
||||
Account *old_id_acc;
|
||||
|
||||
/* See if we have a dialog, if not we are an assistant */
|
||||
if (picker->dialog == NULL)
|
||||
{
|
||||
GtkAssistant *assistant = GTK_ASSISTANT(picker->assistant);
|
||||
gint num = gtk_assistant_get_current_page (assistant);
|
||||
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
|
||||
|
||||
picker->retAccount = gnc_tree_view_account_get_selected_account(picker->account_tree);
|
||||
if (picker->retAccount)
|
||||
retval_name = xaccAccountGetName(picker->retAccount);
|
||||
if (!retval_name)
|
||||
retval_name = "(null)";
|
||||
DEBUG("Selected account %p, %s", picker->retAccount, retval_name);
|
||||
|
||||
/* See if the selected account is a placeholder. */
|
||||
if (picker->retAccount && xaccAccountGetPlaceholder (picker->retAccount))
|
||||
{
|
||||
gnc_error_dialog (GTK_WINDOW (picker->dialog),
|
||||
_("The account %s is a placeholder account and does not allow "
|
||||
"transactions. Please choose a different account."),
|
||||
retval_name);
|
||||
}
|
||||
else if ( picker->account_online_id_value != NULL)
|
||||
{
|
||||
/* find the old account for this on line id value and reset it */
|
||||
old_id_acc =
|
||||
gnc_account_foreach_descendant_until(gnc_get_current_root_account (),
|
||||
test_acct_online_id_match,
|
||||
/* This argument will only be used as a "const char*" */
|
||||
(void*)picker->account_online_id_value);
|
||||
|
||||
if (old_id_acc != NULL)
|
||||
gnc_import_set_acc_online_id(old_id_acc, "");
|
||||
|
||||
gnc_import_set_acc_online_id(picker->retAccount, picker->account_online_id_value);
|
||||
gtk_assistant_set_page_complete (assistant, page, TRUE);
|
||||
}
|
||||
else
|
||||
gtk_assistant_set_page_complete (assistant, page, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_dialog_response(GTK_DIALOG(picker->dialog), GTK_RESPONSE_OK);
|
||||
}
|
||||
gtk_dialog_response(GTK_DIALOG(picker->dialog), GTK_RESPONSE_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -247,7 +249,8 @@ Account * gnc_import_select_account(GtkWidget *parent,
|
||||
Account * retval = NULL;
|
||||
const gchar *retval_name = NULL;
|
||||
GtkBuilder *builder;
|
||||
GtkWidget * online_id_label, *box, *pbox;
|
||||
GtkTreeSelection *selection;
|
||||
GtkWidget * online_id_label;
|
||||
gchar account_description_text[ACCOUNT_DESCRIPTION_MAX_SIZE + 1] = "";
|
||||
gboolean ok_pressed_retval = FALSE;
|
||||
|
||||
@@ -303,21 +306,22 @@ Account * gnc_import_select_account(GtkWidget *parent,
|
||||
builder = gtk_builder_new();
|
||||
gnc_builder_add_from_file (builder, "dialog-import.glade", "account_new_icon");
|
||||
gnc_builder_add_from_file (builder, "dialog-import.glade", "account_picker_dialog");
|
||||
gnc_builder_add_from_file (builder, "dialog-import.glade", "account_picker_content");
|
||||
/* connect the signals in the interface */
|
||||
if (builder == NULL)
|
||||
{
|
||||
PERR("Error opening the glade builder interface");
|
||||
}
|
||||
picker->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "account_picker_dialog"));
|
||||
picker->pwhbox = GTK_WIDGET(gtk_builder_get_object (builder, "placeholder_warning_hbox"));
|
||||
picker->pwarning = GTK_WIDGET(gtk_builder_get_object (builder, "placeholder_warning_label"));
|
||||
picker->ok_button = GTK_WIDGET(gtk_builder_get_object (builder, "okbutton"));
|
||||
|
||||
if (parent)
|
||||
gtk_window_set_transient_for (GTK_WINDOW (picker->dialog),
|
||||
GTK_WINDOW (parent));
|
||||
|
||||
/* Pack the content into the dialog vbox */
|
||||
pbox = GTK_WIDGET(gtk_builder_get_object (builder, "account_picker_vbox"));
|
||||
box = GTK_WIDGET(gtk_builder_get_object (builder, "account_picker_content"));
|
||||
gtk_box_pack_start( GTK_BOX(pbox), box, TRUE, TRUE, 0);
|
||||
gnc_restore_window_size (GNC_PREFS_GROUP,
|
||||
GTK_WINDOW(picker->dialog), GTK_WINDOW (parent));
|
||||
|
||||
picker->account_tree_sw = GTK_WIDGET(gtk_builder_get_object (builder, "account_tree_sw"));
|
||||
online_id_label = GTK_WIDGET(gtk_builder_get_object (builder, "online_id_label"));
|
||||
@@ -342,11 +346,17 @@ Account * gnc_import_select_account(GtkWidget *parent,
|
||||
}
|
||||
gtk_label_set_text((GtkLabel*)online_id_label, account_description_text);
|
||||
build_acct_tree(picker);
|
||||
gnc_tree_view_account_set_selected_account(picker->account_tree, default_selection);
|
||||
|
||||
gtk_window_set_modal(GTK_WINDOW(picker->dialog), TRUE);
|
||||
g_signal_connect(picker->account_tree, "row-activated",
|
||||
G_CALLBACK(account_tree_row_activated_cb), picker);
|
||||
|
||||
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(picker->account_tree));
|
||||
g_signal_connect(selection, "changed",
|
||||
G_CALLBACK(account_tree_row_changed_cb), picker);
|
||||
|
||||
gnc_tree_view_account_set_selected_account(picker->account_tree, default_selection);
|
||||
|
||||
do
|
||||
{
|
||||
response = gtk_dialog_run(GTK_DIALOG(picker->dialog));
|
||||
@@ -373,11 +383,7 @@ Account * gnc_import_select_account(GtkWidget *parent,
|
||||
/* See if the selected account is a placeholder. */
|
||||
if (retval && xaccAccountGetPlaceholder (retval))
|
||||
{
|
||||
gnc_error_dialog
|
||||
(GTK_WINDOW (picker->dialog),
|
||||
_("The account %s is a placeholder account and does not allow "
|
||||
"transactions. Please choose a different account."),
|
||||
retval_name);
|
||||
show_placeholder_warning (picker, retval_name);
|
||||
response = GNC_RESPONSE_NEW;
|
||||
break;
|
||||
}
|
||||
@@ -397,6 +403,7 @@ Account * gnc_import_select_account(GtkWidget *parent,
|
||||
while (response == GNC_RESPONSE_NEW);
|
||||
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(picker->dialog));
|
||||
gtk_widget_destroy(picker->dialog);
|
||||
}
|
||||
else
|
||||
@@ -415,131 +422,4 @@ Account * gnc_import_select_account(GtkWidget *parent,
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* These are the routines for use with an Assistant page
|
||||
**********************************************************************/
|
||||
|
||||
/*******************************************************
|
||||
* gnc_import_account_assist_setup
|
||||
*
|
||||
* Main call for page setup in an assistant
|
||||
*******************************************************/
|
||||
AccountPickerDialog* gnc_import_account_assist_setup(GtkWidget *parent)
|
||||
{
|
||||
AccountPickerDialog * picker;
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *box, *h_box;
|
||||
|
||||
/* Init the account picker structure */
|
||||
picker = gnc_import_new_account_picker();
|
||||
|
||||
/* load the interface */
|
||||
builder = gtk_builder_new();
|
||||
gnc_builder_add_from_file (builder, "dialog-import.glade", "account_picker_content");
|
||||
/* connect the signals in the interface */
|
||||
if (builder == NULL)
|
||||
{
|
||||
PERR("Error opening the glade builder interface");
|
||||
}
|
||||
|
||||
picker->assistant = gtk_widget_get_parent(parent);
|
||||
/* Pack content into Assistant page widget */
|
||||
box = GTK_WIDGET(gtk_builder_get_object (builder, "account_picker_content"));
|
||||
gtk_box_pack_start( GTK_BOX(parent), box, TRUE, TRUE, 6);
|
||||
|
||||
picker->account_tree_sw = GTK_WIDGET(gtk_builder_get_object (builder, "account_tree_sw"));
|
||||
picker->account_online_id_label = GTK_WIDGET(gtk_builder_get_object (builder, "online_id_label"));
|
||||
|
||||
/* Add the New Account Button */
|
||||
picker->new_button = gtk_button_new_with_mnemonic (_("_New Account"));
|
||||
|
||||
h_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_box_set_homogeneous (GTK_BOX (h_box), TRUE);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(h_box), picker->new_button, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start( GTK_BOX(box), h_box, FALSE, FALSE, 6);
|
||||
gtk_widget_show (picker->new_button);
|
||||
g_signal_connect(picker->new_button, "clicked",
|
||||
G_CALLBACK(gnc_import_add_account), picker);
|
||||
|
||||
build_acct_tree(picker);
|
||||
|
||||
g_signal_connect(picker->account_tree, "row-activated",
|
||||
G_CALLBACK(account_tree_row_activated_cb), picker);
|
||||
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
return picker;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* gnc_import_account_assist_disable
|
||||
*
|
||||
* disables account picker input.
|
||||
*******************************************************/
|
||||
void
|
||||
gnc_import_account_assist_disable (AccountPickerDialog *picker, gboolean disable)
|
||||
{
|
||||
gtk_widget_set_sensitive (picker->account_tree_sw, !disable);
|
||||
gtk_widget_set_sensitive (picker->new_button, !disable);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* gnc_import_account_assist_update
|
||||
*
|
||||
* updates the page and returns account found.
|
||||
*******************************************************/
|
||||
Account * gnc_import_account_assist_update (AccountPickerDialog *picker)
|
||||
{
|
||||
#define ACCOUNT_DESCRIPTION_MAX_SIZE 255
|
||||
|
||||
const gchar *retval_name = NULL;
|
||||
gchar account_description_text[ACCOUNT_DESCRIPTION_MAX_SIZE + 1] = "";
|
||||
|
||||
ENTER("Default commodity received: %s", gnc_commodity_get_fullname( picker->new_account_default_commodity));
|
||||
DEBUG("Default account type received: %s", xaccAccountGetTypeStr( picker->new_account_default_type));
|
||||
|
||||
/*DEBUG("Looking for account with online_id: %s", picker->account_online_id_value);*/
|
||||
if (picker->account_online_id_value != NULL)
|
||||
{
|
||||
picker->retAccount =
|
||||
gnc_account_foreach_descendant_until(gnc_get_current_root_account (),
|
||||
test_acct_online_id_match,
|
||||
/* This argument will only be used as a "const char*" */
|
||||
(void*)picker->account_online_id_value);
|
||||
}
|
||||
|
||||
if (picker->account_human_description != NULL)
|
||||
{
|
||||
strncat(account_description_text, picker->account_human_description,
|
||||
ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
|
||||
strncat(account_description_text, "\n",
|
||||
ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
|
||||
}
|
||||
if (picker->account_online_id_value != NULL)
|
||||
{
|
||||
strncat(account_description_text, _("(Full account ID: "),
|
||||
ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
|
||||
strncat(account_description_text, picker->account_online_id_value,
|
||||
ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
|
||||
strncat(account_description_text, ")",
|
||||
ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
|
||||
}
|
||||
gtk_label_set_text(GTK_LABEL( picker->account_online_id_label), account_description_text);
|
||||
|
||||
if (picker->default_account == NULL)
|
||||
gnc_tree_view_account_set_selected_account(picker->account_tree, picker->retAccount);
|
||||
else
|
||||
gnc_tree_view_account_set_selected_account(picker->account_tree, picker->default_account);
|
||||
|
||||
/*FIXME: DEBUG("WRITEME: Here we should check if an account type is compatible, currency matches, etc.\n"); */
|
||||
|
||||
/*DEBUG("Return value: %p%s%s%s",picker->retAccount,", account name:",xaccAccountGetName(picker->retAccount),"\n");*/
|
||||
retval_name = picker->retAccount ? xaccAccountGetName(picker->retAccount) : NULL;
|
||||
LEAVE("Selected account %p, %s", picker->retAccount, retval_name ? retval_name : "(null)");
|
||||
return picker->retAccount;
|
||||
}
|
||||
|
||||
/**@}*/
|
||||
@@ -38,8 +38,8 @@
|
||||
typedef struct
|
||||
{
|
||||
GtkWidget *dialog; /* Dialog Widget */
|
||||
GtkWidget *assistant; /* assistant Widget */
|
||||
GtkWidget *new_button; /* new account button Widget */
|
||||
GtkWidget *ok_button; /* ok button Widget */
|
||||
GncTreeViewAccount *account_tree; /* Account tree */
|
||||
GtkWidget *account_tree_sw; /* Scroll Window for Account tree */
|
||||
gboolean auto_create; /* Auto create retAccount, can be used to step over this stage */
|
||||
@@ -50,6 +50,8 @@ typedef struct
|
||||
GNCAccountType new_account_default_type; /* new account default type, incoming */
|
||||
Account *default_account; /* default account for selection, incoming */
|
||||
Account *retAccount; /* Account value returned to caller */
|
||||
GtkWidget *pwhbox; /* Placeholder Warning HBox */
|
||||
GtkWidget *pwarning; /* Placeholder Warning Label */
|
||||
} AccountPickerDialog;
|
||||
|
||||
/** Must be called with a string containing a unique identifier for the
|
||||
@@ -123,39 +125,5 @@ Account * gnc_import_select_account(GtkWidget *parent,
|
||||
gboolean * ok_pressed
|
||||
);
|
||||
|
||||
|
||||
/** Must be called with the parent widget, ie. a vbox that the
|
||||
account picker dialog will be packed into. The data structure
|
||||
AccountPickerDialog is initialised and default values populated.
|
||||
|
||||
@param parent The parent widget. This is the place the account picker dialog will
|
||||
be packed into.
|
||||
|
||||
@return A pointer to the AccountPickerDialog which has been setup.
|
||||
*/
|
||||
AccountPickerDialog * gnc_import_account_assist_setup (GtkWidget *parent);
|
||||
|
||||
|
||||
/** Must be called with an AccountPickerDialog structure allready setup.
|
||||
If an account with a matching online_id is found, which is
|
||||
allready present in the dialog structure, the function returns with a
|
||||
pointer to that account or NULL if not found.
|
||||
|
||||
@param Account picker Dialog structure, AccountPickerDialog
|
||||
|
||||
@return A pointer to the found account, or NULL if account not found.
|
||||
*/
|
||||
Account * gnc_import_account_assist_update (AccountPickerDialog *picker);
|
||||
|
||||
|
||||
/** Must be called with an AccountPickerDialog structure allready setup.
|
||||
Set the sensitivity of the account picker to disable input.
|
||||
|
||||
@param Account picker Dialog structure, AccountPickerDialog
|
||||
|
||||
@param TRUE to make picker insensitve.
|
||||
*/
|
||||
void gnc_import_account_assist_disable (AccountPickerDialog *picker, gboolean disable);
|
||||
|
||||
#endif
|
||||
/**@}*/
|
||||
File diff suppressed because it is too large.
Load diff
@@ -33,15 +33,19 @@
|
||||
#include "dialog-utils.h"
|
||||
#include "assistant-qif-import.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-prefs.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "guile-mappings.h"
|
||||
#include "gnc-guile-utils.h"
|
||||
#include "gnc-ui.h" /* for GNC_RESPONSE_NEW */
|
||||
|
||||
#define GNC_PREFS_GROUP "dialogs.import.qif.account-picker"
|
||||
|
||||
enum account_cols
|
||||
{
|
||||
ACCOUNT_COL_NAME = 0,
|
||||
ACCOUNT_COL_FULLNAME,
|
||||
ACCOUNT_COL_PLACEHOLDER,
|
||||
ACCOUNT_COL_CHECK,
|
||||
NUM_ACCOUNT_COLS
|
||||
};
|
||||
@@ -50,8 +54,11 @@ struct _accountpickerdialog
|
||||
{
|
||||
GtkWidget * dialog;
|
||||
GtkTreeView * treeview;
|
||||
GtkWidget * pwhbox;
|
||||
GtkWidget * pwarning;
|
||||
GtkWidget * ok_button;
|
||||
QIFImportWindow * qif_wind;
|
||||
SCM map_entry;
|
||||
SCM map_entry;
|
||||
gchar * selected_name;
|
||||
};
|
||||
|
||||
@@ -80,9 +87,11 @@ acct_tree_add_accts(SCM accts,
|
||||
gboolean leafnode;
|
||||
SCM current;
|
||||
gboolean checked;
|
||||
Account * account;
|
||||
|
||||
while (!scm_is_null(accts))
|
||||
{
|
||||
gboolean placeholder = FALSE;
|
||||
current = SCM_CAR(accts);
|
||||
|
||||
if (scm_is_null(current))
|
||||
@@ -119,10 +128,15 @@ acct_tree_add_accts(SCM accts,
|
||||
|
||||
checked = (SCM_CADR(current) == SCM_BOOL_T);
|
||||
|
||||
account = gnc_account_lookup_by_full_name (gnc_get_current_root_account(), acctname);
|
||||
if (account)
|
||||
placeholder = xaccAccountGetPlaceholder (account);
|
||||
|
||||
gtk_tree_store_append(store, &iter, parent);
|
||||
gtk_tree_store_set(store, &iter,
|
||||
ACCOUNT_COL_NAME, compname,
|
||||
ACCOUNT_COL_FULLNAME, acctname,
|
||||
ACCOUNT_COL_PLACEHOLDER, placeholder,
|
||||
ACCOUNT_COL_CHECK, checked,
|
||||
-1);
|
||||
|
||||
@@ -188,6 +202,8 @@ build_acct_tree(QIFAccountPickerDialog * picker, QIFImportWindow * import)
|
||||
{
|
||||
gtk_tree_view_expand_to_path(picker->treeview, path);
|
||||
gtk_tree_selection_select_path(selection, path);
|
||||
gtk_tree_view_scroll_to_cell (picker->treeview, path,
|
||||
NULL, TRUE, 0.5, 0.0);
|
||||
gtk_tree_path_free(path);
|
||||
}
|
||||
gtk_tree_row_reference_free(reference);
|
||||
@@ -264,15 +280,34 @@ gnc_ui_qif_account_picker_changed_cb(GtkTreeSelection *selection,
|
||||
SCM name_setter = scm_c_eval_string("qif-map-entry:set-gnc-name!");
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
gboolean placeholder;
|
||||
|
||||
gtk_widget_set_sensitive (wind->ok_button, TRUE); // enable OK button
|
||||
|
||||
g_free(wind->selected_name);
|
||||
if (gtk_tree_selection_get_selected(selection, &model, &iter))
|
||||
{
|
||||
gtk_tree_model_get(model, &iter,
|
||||
ACCOUNT_COL_PLACEHOLDER, &placeholder,
|
||||
ACCOUNT_COL_FULLNAME, &wind->selected_name,
|
||||
-1);
|
||||
scm_call_2(name_setter, wind->map_entry,
|
||||
wind->selected_name ? scm_from_utf8_string(wind->selected_name) : SCM_BOOL_F);
|
||||
|
||||
if (placeholder)
|
||||
{
|
||||
gchar *text = g_strdup_printf (_("The account %s is a placeholder account and does not allow "
|
||||
"transactions. Please choose a different account."), wind->selected_name);
|
||||
|
||||
gtk_label_set_text (GTK_LABEL(wind->pwarning), text);
|
||||
gnc_label_set_alignment (wind->pwarning, 0.0, 0.5);
|
||||
gtk_widget_show_all (GTK_WIDGET(wind->pwhbox));
|
||||
g_free (text);
|
||||
|
||||
gtk_widget_set_sensitive (wind->ok_button, FALSE); // disable OK button
|
||||
}
|
||||
else
|
||||
gtk_widget_hide (GTK_WIDGET(wind->pwhbox)); // hide the placeholder warning
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -315,6 +350,31 @@ gnc_ui_qif_account_picker_map_cb(GtkWidget * w, gpointer user_data)
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* dialog_response_cb
|
||||
*
|
||||
****************************************************************/
|
||||
static void
|
||||
dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data)
|
||||
{
|
||||
QIFAccountPickerDialog * wind = user_data;
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
gboolean placeholder;
|
||||
|
||||
if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection
|
||||
(wind->treeview), &model, &iter))
|
||||
gtk_tree_model_get (model, &iter,
|
||||
ACCOUNT_COL_PLACEHOLDER, &placeholder, -1);
|
||||
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
{
|
||||
if (placeholder)
|
||||
g_signal_stop_emission_by_name (dialog, "response");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* qif_account_picker_dialog
|
||||
*
|
||||
@@ -351,18 +411,21 @@ qif_account_picker_dialog(GtkWindow *parent, QIFImportWindow * qif_wind, SCM map
|
||||
|
||||
wind->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "qif_import_account_picker_dialog"));
|
||||
wind->treeview = GTK_TREE_VIEW(gtk_builder_get_object (builder, "account_tree"));
|
||||
wind->pwhbox = GTK_WIDGET(gtk_builder_get_object (builder, "placeholder_warning_hbox"));
|
||||
wind->pwarning = GTK_WIDGET(gtk_builder_get_object (builder, "placeholder_warning_label"));
|
||||
wind->ok_button = GTK_WIDGET(gtk_builder_get_object (builder, "okbutton"));
|
||||
wind->qif_wind = qif_wind;
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (wind->dialog), parent);
|
||||
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreeStore *store;
|
||||
GtkCellRenderer *renderer;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkTreeSelection *selection;
|
||||
|
||||
store = gtk_tree_store_new(NUM_ACCOUNT_COLS, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_BOOLEAN);
|
||||
G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
|
||||
gtk_tree_view_set_model(wind->treeview, GTK_TREE_MODEL(store));
|
||||
g_object_unref(store);
|
||||
|
||||
@@ -375,6 +438,15 @@ qif_account_picker_dialog(GtkWindow *parent, QIFImportWindow * qif_wind, SCM map
|
||||
g_object_set(column, "expand", TRUE, NULL);
|
||||
gtk_tree_view_append_column(wind->treeview, column);
|
||||
|
||||
renderer = gtk_cell_renderer_toggle_new();
|
||||
g_object_set(renderer, "activatable", FALSE, NULL);
|
||||
column = gtk_tree_view_column_new_with_attributes(_("Placeholder?"),
|
||||
renderer,
|
||||
"active",
|
||||
ACCOUNT_COL_PLACEHOLDER,
|
||||
NULL);
|
||||
gtk_tree_view_append_column(wind->treeview, column);
|
||||
|
||||
renderer = gtk_cell_renderer_toggle_new();
|
||||
g_object_set(renderer, "activatable", FALSE, NULL);
|
||||
column = gtk_tree_view_column_new_with_attributes(_("New?"),
|
||||
@@ -396,15 +468,22 @@ qif_account_picker_dialog(GtkWindow *parent, QIFImportWindow * qif_wind, SCM map
|
||||
G_CALLBACK(gnc_ui_qif_account_picker_map_cb),
|
||||
wind);
|
||||
|
||||
gnc_restore_window_size (GNC_PREFS_GROUP,
|
||||
GTK_WINDOW(wind->dialog), parent);
|
||||
|
||||
/* this is to get the checkmarks set up right.. it will get called
|
||||
* again after the window is mapped. */
|
||||
build_acct_tree(wind, wind->qif_wind);
|
||||
|
||||
g_signal_connect (wind->dialog, "response",
|
||||
G_CALLBACK (dialog_response_cb), wind);
|
||||
|
||||
do
|
||||
{
|
||||
response = gtk_dialog_run(GTK_DIALOG(wind->dialog));
|
||||
}
|
||||
while (response == GNC_RESPONSE_NEW);
|
||||
gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(wind->dialog));
|
||||
gtk_widget_destroy(wind->dialog);
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
|
||||
|
||||
@@ -95,8 +95,13 @@ class Console (cons.Console):
|
||||
|
||||
# Change this to "if True:" to switch on a python console at gnucash
|
||||
# startup:
|
||||
# shelltype can either be "python" or "ipython" (the latter is not yet fully functional)
|
||||
if False:
|
||||
console = Console(argv = [], shelltype = 'python', banner = [['woop', 'title']], size = 100)
|
||||
shelltype = "python"
|
||||
title = "gnucash "+shelltype+" shell"
|
||||
banner_style = 'title'
|
||||
banner = "Welcome to "+title+"!\n"
|
||||
console = Console(argv = [], shelltype = shelltype, banner = [[banner, banner_style]], size = 100)
|
||||
|
||||
window = Gtk.Window(type = Gtk.WindowType.TOPLEVEL)
|
||||
window.set_position(Gtk.WindowPosition.CENTER)
|
||||
|
||||
@@ -709,9 +709,9 @@ gnucash_sheet_style_destroy (GnucashSheet *sheet, SheetBlockStyle *style)
|
||||
|
||||
if (style->dimensions->refcount == 0)
|
||||
{
|
||||
style_dimensions_destroy (style->dimensions);
|
||||
g_hash_table_remove (sheet->dimensions_hash_table,
|
||||
style_get_key (style));
|
||||
style_dimensions_destroy (style->dimensions);
|
||||
}
|
||||
|
||||
g_free (style);
|
||||
|
||||
@@ -298,94 +298,34 @@
|
||||
(string->symbol (if (string-null? code) "N000" code))))
|
||||
|
||||
(define (get-acct-txf-info info-type acct-type code)
|
||||
(let ((tax-entity-type (gnc-get-current-book-tax-type)))
|
||||
(cond
|
||||
((= acct-type ACCT-TYPE-INCOME)
|
||||
(cond
|
||||
((eqv? info-type 'form)
|
||||
(gnc:txf-get-form txf-income-categories code tax-entity-type))
|
||||
((eqv? info-type 'desc)
|
||||
(gnc:txf-get-description txf-income-categories code tax-entity-type))
|
||||
((eqv? info-type 'pns)
|
||||
(gnc:txf-get-payer-name-source txf-income-categories code
|
||||
tax-entity-type))
|
||||
((eqv? info-type 'format)
|
||||
(gnc:txf-get-format txf-income-categories code tax-entity-type))
|
||||
((eqv? info-type 'multiple)
|
||||
(gnc:txf-get-multiple txf-income-categories code tax-entity-type))
|
||||
((eqv? info-type 'cat-key)
|
||||
(gnc:txf-get-category-key txf-income-categories code tax-entity-type))
|
||||
((eqv? info-type 'line)
|
||||
(gnc:txf-get-line-data txf-income-categories code tax-entity-type))
|
||||
((eqv? info-type 'last-yr)
|
||||
(gnc:txf-get-last-year txf-income-categories code tax-entity-type))
|
||||
(else #f)))
|
||||
((= acct-type ACCT-TYPE-EXPENSE)
|
||||
(cond
|
||||
((eqv? info-type 'form)
|
||||
(gnc:txf-get-form txf-expense-categories code tax-entity-type))
|
||||
((eqv? info-type 'desc)
|
||||
(gnc:txf-get-description txf-expense-categories code tax-entity-type))
|
||||
((eqv? info-type 'pns)
|
||||
(gnc:txf-get-payer-name-source txf-expense-categories code
|
||||
tax-entity-type))
|
||||
((eqv? info-type 'format)
|
||||
(gnc:txf-get-format txf-expense-categories code tax-entity-type))
|
||||
((eqv? info-type 'multiple)
|
||||
(gnc:txf-get-multiple txf-expense-categories code tax-entity-type))
|
||||
((eqv? info-type 'cat-key)
|
||||
(gnc:txf-get-category-key txf-expense-categories code tax-entity-type))
|
||||
((eqv? info-type 'line)
|
||||
(gnc:txf-get-line-data txf-expense-categories code tax-entity-type))
|
||||
((eqv? info-type 'last-yr)
|
||||
(gnc:txf-get-last-year txf-expense-categories code tax-entity-type))
|
||||
(else #f)))
|
||||
((or (= acct-type ACCT-TYPE-BANK) (= acct-type ACCT-TYPE-CASH)
|
||||
(= acct-type ACCT-TYPE-ASSET) (= acct-type ACCT-TYPE-STOCK)
|
||||
(= acct-type ACCT-TYPE-MUTUAL) (= acct-type ACCT-TYPE-RECEIVABLE))
|
||||
(cond
|
||||
((eqv? info-type 'form)
|
||||
(gnc:txf-get-form txf-asset-categories code tax-entity-type))
|
||||
((eqv? info-type 'desc)
|
||||
(gnc:txf-get-description txf-asset-categories code tax-entity-type))
|
||||
((eqv? info-type 'pns)
|
||||
(gnc:txf-get-payer-name-source txf-asset-categories code
|
||||
tax-entity-type))
|
||||
((eqv? info-type 'format)
|
||||
(gnc:txf-get-format txf-asset-categories code tax-entity-type))
|
||||
((eqv? info-type 'multiple)
|
||||
(gnc:txf-get-multiple txf-asset-categories code tax-entity-type))
|
||||
((eqv? info-type 'cat-key)
|
||||
(gnc:txf-get-category-key txf-asset-categories code tax-entity-type))
|
||||
((eqv? info-type 'line)
|
||||
(gnc:txf-get-line-data txf-asset-categories code tax-entity-type))
|
||||
((eqv? info-type 'last-yr)
|
||||
(gnc:txf-get-last-year txf-asset-categories code tax-entity-type))
|
||||
(else #f)))
|
||||
((or (= acct-type ACCT-TYPE-CREDIT) (= acct-type ACCT-TYPE-LIABILITY)
|
||||
(= acct-type ACCT-TYPE-EQUITY) (= acct-type ACCT-TYPE-PAYABLE))
|
||||
(cond
|
||||
((eqv? info-type 'form)
|
||||
(gnc:txf-get-form txf-liab-eq-categories code tax-entity-type))
|
||||
((eqv? info-type 'desc)
|
||||
(gnc:txf-get-description txf-liab-eq-categories code tax-entity-type))
|
||||
((eqv? info-type 'pns)
|
||||
(gnc:txf-get-payer-name-source txf-liab-eq-categories code
|
||||
tax-entity-type))
|
||||
((eqv? info-type 'format)
|
||||
(gnc:txf-get-format txf-liab-eq-categories code tax-entity-type))
|
||||
((eqv? info-type 'multiple)
|
||||
(gnc:txf-get-multiple txf-liab-eq-categories code tax-entity-type))
|
||||
((eqv? info-type 'cat-key)
|
||||
(gnc:txf-get-category-key txf-liab-eq-categories code tax-entity-type))
|
||||
((eqv? info-type 'line)
|
||||
(gnc:txf-get-line-data txf-liab-eq-categories code tax-entity-type))
|
||||
((eqv? info-type 'last-yr)
|
||||
(gnc:txf-get-last-year txf-liab-eq-categories code tax-entity-type))
|
||||
(else #f)))
|
||||
(else #f))
|
||||
)
|
||||
)
|
||||
(let ((categories (assv-ref
|
||||
(list (cons ACCT-TYPE-INCOME txf-income-categories)
|
||||
(cons ACCT-TYPE-EXPENSE txf-expense-categories)
|
||||
(cons ACCT-TYPE-BANK txf-asset-categories)
|
||||
(cons ACCT-TYPE-CASH txf-asset-categories)
|
||||
(cons ACCT-TYPE-ASSET txf-asset-categories)
|
||||
(cons ACCT-TYPE-STOCK txf-asset-categories)
|
||||
(cons ACCT-TYPE-MUTUAL txf-asset-categories)
|
||||
(cons ACCT-TYPE-RECEIVABLE txf-asset-categories)
|
||||
(cons ACCT-TYPE-CREDIT txf-liab-eq-categories)
|
||||
(cons ACCT-TYPE-LIABILITY txf-liab-eq-categories)
|
||||
(cons ACCT-TYPE-EQUITY txf-liab-eq-categories)
|
||||
(cons ACCT-TYPE-PAYABLE txf-liab-eq-categories))
|
||||
acct-type))
|
||||
(get-info-fn
|
||||
(case info-type
|
||||
((form) gnc:txf-get-form)
|
||||
((desc) gnc:txf-get-description)
|
||||
((pns) gnc:txf-get-payer-name-sourcecategories)
|
||||
((format) gnc:txf-get-formatcategories)
|
||||
((multiple) gnc:txf-get-multiplecategories)
|
||||
((cat-key) gnc:txf-get-category-keycategories)
|
||||
((line) gnc:txf-get-line-datacategories)
|
||||
((last-yr) gnc:txf-get-last-yearcategories)
|
||||
(else #f))))
|
||||
(and categories
|
||||
get-info-fn
|
||||
(get-info-fn categories code (gnc-get-current-book-tax-type)))))
|
||||
|
||||
(define (gnc:account-get-txf-payer-source account)
|
||||
(let ((pns (xaccAccountGetTaxUSPayerNameSource account)))
|
||||
|
||||
@@ -390,8 +390,8 @@ gnc_style_sheet_select_dialog_response_cb (GtkDialog *unused,
|
||||
|
||||
case GTK_RESPONSE_CLOSE:
|
||||
default:
|
||||
gnc_style_sheet_dialog = NULL;
|
||||
gtk_widget_destroy(ss->toplevel);
|
||||
gnc_style_sheet_dialog = NULL;
|
||||
g_free(ss);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -932,8 +932,7 @@ gnc_plugin_page_report_recreate_page (GtkWidget *window,
|
||||
LEAVE("bad value");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
scm_id = scm_c_eval_string(option_string);
|
||||
scm_id = scm_eval_string(scm_from_utf8_string(option_string));
|
||||
g_free(option_string);
|
||||
|
||||
if (!scm_integer_p(scm_id))
|
||||
|
||||
@@ -25,16 +25,15 @@
|
||||
|
||||
|
||||
(define-module (gnucash report report-gnome))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash gnome-utils))
|
||||
(use-modules (gnucash gettext))
|
||||
(use-modules (gnucash report utility-reports))
|
||||
|
||||
(eval-when
|
||||
(compile load eval expand)
|
||||
(load-extension "libgncmod-gnome-utils" "scm_init_sw_gnome_utils_module")
|
||||
(load-extension "libgncmod-report-gnome" "scm_init_sw_report_gnome_module"))
|
||||
(eval-when (compile load eval expand)
|
||||
(load-extension "libgncmod-gnome-utils" "scm_init_sw_gnome_utils_module")
|
||||
(load-extension "libgncmod-report-gnome" "scm_init_sw_report_gnome_module"))
|
||||
(use-modules (sw_report_gnome))
|
||||
|
||||
(gnc:module-load "gnucash/gnome-utils" 0)
|
||||
@@ -46,54 +45,30 @@
|
||||
(define (gnc:add-report-template-menu-items)
|
||||
(define *template-items* '())
|
||||
|
||||
(define (add-template-menu-item name template)
|
||||
(if (gnc:report-template-in-menu? template)
|
||||
(let ((title (string-append (_ "Report") ": " (_ name)))
|
||||
(menu-path (gnc:report-template-menu-path template))
|
||||
(menu-tip (gnc:report-template-menu-tip template))
|
||||
(item #f))
|
||||
(gnc:report-templates-for-each
|
||||
(lambda (report-guid template)
|
||||
(let ((name (or (gnc:report-template-menu-name template)
|
||||
(gnc:report-template-name template))))
|
||||
(set! *template-items* (cons (cons name template) *template-items*)))))
|
||||
|
||||
;;(if (not menu-path)
|
||||
;;(set! menu-path '(""))
|
||||
;;(set! menu-path
|
||||
;; (append menu-path '(""))))
|
||||
|
||||
(if (not menu-path)
|
||||
(set! menu-path '()))
|
||||
|
||||
(set! menu-path (append (list gnc:menuname-reports) menu-path))
|
||||
|
||||
(if (not menu-tip)
|
||||
(set! menu-tip
|
||||
(format #f (_ "Display the ~a report") (_ name))))
|
||||
|
||||
(set! item
|
||||
(gnc:make-menu-item
|
||||
name
|
||||
(gnc:report-template-report-guid template)
|
||||
menu-tip
|
||||
menu-path
|
||||
(lambda (window)
|
||||
(let ((report (gnc:make-report
|
||||
(gnc:report-template-report-guid template))))
|
||||
(gnc-main-window-open-report report window)))))
|
||||
(gnc-add-scm-extension item))))
|
||||
|
||||
(define (add-template report-guid template)
|
||||
(let ((name (gnc:report-template-name template))
|
||||
(menu-name (gnc:report-template-menu-name template)))
|
||||
(if menu-name (set! name menu-name))
|
||||
(set! *template-items* (cons (cons name template) *template-items*))))
|
||||
|
||||
(define (sort-templates a b)
|
||||
(string>? (car a) (car b)))
|
||||
|
||||
(gnc:report-templates-for-each add-template)
|
||||
(for-each
|
||||
(lambda (item)
|
||||
(add-template-menu-item (car item) (cdr item)))
|
||||
(sort *template-items* sort-templates)))
|
||||
|
||||
(let* ((menu-name (car item))
|
||||
(template (cdr item))
|
||||
(report-guid (gnc:report-template-report-guid template))
|
||||
(menu-tip (or (gnc:report-template-menu-tip template)
|
||||
(format #f (_ "Display the ~a report") (_ menu-name))))
|
||||
(menu-path (append (list gnc:menuname-reports)
|
||||
(or (gnc:report-template-menu-path template)
|
||||
'()))))
|
||||
(gnc-add-scm-extension
|
||||
(gnc:make-menu-item
|
||||
menu-name report-guid menu-tip menu-path
|
||||
(lambda (window)
|
||||
(gnc-main-window-open-report
|
||||
(gnc:make-report report-guid) window))))))
|
||||
(sort (filter (compose gnc:report-template-in-menu? cdr) *template-items*)
|
||||
(lambda (a b) (string>? (car a) (car b))))))
|
||||
|
||||
(define (gnc:report-menu-setup)
|
||||
(define asset-liability-menu
|
||||
@@ -104,25 +79,29 @@
|
||||
(gnc:make-menu gnc:menuname-budget (list gnc:menuname-reports)))
|
||||
(define utility-menu
|
||||
(gnc:make-menu gnc:menuname-utility (list gnc:menuname-reports)))
|
||||
(define tax-menu
|
||||
(define experimental-menu
|
||||
(gnc:make-menu gnc:menuname-experimental (list gnc:menuname-reports)))
|
||||
(define tax-menu
|
||||
(gnc:make-menu gnc:menuname-taxes (list gnc:menuname-reports)))
|
||||
(define business-menu
|
||||
(define business-menu
|
||||
(gnc:make-menu gnc:menuname-business-reports (list gnc:menuname-reports)))
|
||||
|
||||
(gnc-add-scm-extension
|
||||
(gnc-add-scm-extension
|
||||
(gnc:make-menu-item
|
||||
(N_ "Saved Report Configurations")
|
||||
"4d3dcdc8890b11df99dd94cddfd72085"
|
||||
(N_ "Manage and run saved report configurations")
|
||||
(list "Reports/SavedReportConfigs")
|
||||
(lambda (window)
|
||||
(gnc:spawn-custom-report-dialog window))))
|
||||
(N_ "Saved Report Configurations")
|
||||
"4d3dcdc8890b11df99dd94cddfd72085"
|
||||
(N_ "Manage and run saved report configurations")
|
||||
(list "Reports/SavedReportConfigs")
|
||||
(lambda (window)
|
||||
(gnc:debug "called into custom report dialog, window is " window)
|
||||
(gnc-ui-custom-report window))))
|
||||
|
||||
;; (gnc-add-scm-extension tax-menu)
|
||||
(gnc-add-scm-extension income-expense-menu)
|
||||
(gnc-add-scm-extension asset-liability-menu)
|
||||
(gnc-add-scm-extension budget-menu)
|
||||
(gnc-add-scm-extension utility-menu)
|
||||
(gnc-add-scm-extension experimental-menu)
|
||||
(gnc-add-scm-extension business-menu)
|
||||
|
||||
;; run report-hook danglers
|
||||
@@ -133,16 +112,10 @@
|
||||
|
||||
;; the Welcome to GnuCash "extravaganza" report
|
||||
(gnc-add-scm-extension
|
||||
(gnc:make-menu-item
|
||||
(gnc:make-menu-item
|
||||
(N_ "Welcome Sample Report")
|
||||
"ad80271c890b11dfa79f2dcedfd72085"
|
||||
(N_ "Welcome-to-GnuCash report screen")
|
||||
(list gnc:menuname-reports gnc:menuname-utility "")
|
||||
(lambda (window)
|
||||
(gnc-main-window-open-report (gnc:make-welcome-report) window))))
|
||||
|
||||
)
|
||||
|
||||
(define (gnc:spawn-custom-report-dialog window)
|
||||
(gnc:debug "called into custom report dialog, window is " window)
|
||||
(gnc-ui-custom-report window))
|
||||
(gnc-main-window-open-report (gnc:make-welcome-report) window)))))
|
||||
@@ -76,6 +76,7 @@ set (report_system_SCHEME_3
|
||||
options-utilities.scm
|
||||
report-utilities.scm
|
||||
report.scm
|
||||
trep-engine.scm
|
||||
)
|
||||
|
||||
set(GUILE_DEPENDS
|
||||
|
||||
@@ -90,11 +90,6 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
(gnc:make-gnc-monetary foreign-commodity foreign-numeric)
|
||||
domestic date))
|
||||
|
||||
;; Returns true if the given pricealist element is a non-zero price.
|
||||
(define (gnc:price-is-not-zero? elem)
|
||||
(and (cadr elem)
|
||||
(not (zero? (cadr elem)))))
|
||||
|
||||
;; Create a list of all prices of 'price-commodity' measured in the currency
|
||||
;; 'report-currency'. The prices are taken from all splits in
|
||||
;; 'currency-accounts' up until the date 'end-date'. Returns a list of
|
||||
@@ -121,86 +116,66 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
currency-accounts end-date price-commodity)))
|
||||
|
||||
(define (gnc:get-commodity-totalavg-prices-internal
|
||||
currency-accounts end-date price-commodity report-currency
|
||||
commodity-splits)
|
||||
(let ((total-foreign 0)
|
||||
(total-domestic 0))
|
||||
(filter
|
||||
gnc:price-is-not-zero?
|
||||
(map-in-order
|
||||
(lambda (a)
|
||||
(let* ((transaction-comm (xaccTransGetCurrency
|
||||
(xaccSplitGetParent a)))
|
||||
(account-comm (xaccAccountGetCommodity
|
||||
(xaccSplitGetAccount a)))
|
||||
(share-amount (abs
|
||||
(xaccSplitGetAmount a)))
|
||||
(value-amount (abs
|
||||
(xaccSplitGetValue a)))
|
||||
(transaction-date (xaccTransGetDate
|
||||
(xaccSplitGetParent a)))
|
||||
(foreignlist
|
||||
(if (and
|
||||
(not (zero? share-amount))
|
||||
(not (zero? value-amount)))
|
||||
(if (gnc-commodity-equiv transaction-comm
|
||||
price-commodity)
|
||||
(list account-comm
|
||||
share-amount value-amount)
|
||||
(list transaction-comm
|
||||
value-amount share-amount))
|
||||
#f)))
|
||||
currency-accounts end-date price-commodity report-currency commodity-splits)
|
||||
(let loop ((tot-foreign 0)
|
||||
(tot-domestic 0)
|
||||
(commodity-splits commodity-splits)
|
||||
(result '()))
|
||||
(if (null? commodity-splits)
|
||||
(reverse! result)
|
||||
(let* ((a (car commodity-splits))
|
||||
(share-amt (abs (xaccSplitGetAmount a)))
|
||||
(value-amt (abs (xaccSplitGetValue a)))
|
||||
(txn-comm (xaccTransGetCurrency (xaccSplitGetParent a)))
|
||||
(acc-comm (xaccAccountGetCommodity (xaccSplitGetAccount a)))
|
||||
(txn-date (xaccTransGetDate (xaccSplitGetParent a))))
|
||||
(cond
|
||||
((or (zero? share-amt) (zero? value-amt))
|
||||
(loop tot-foreign
|
||||
tot-domestic
|
||||
(cdr commodity-splits)
|
||||
result))
|
||||
|
||||
;; Try EURO exchange if necessary
|
||||
(if (and foreignlist
|
||||
(not (gnc-commodity-equiv (car foreignlist)
|
||||
report-currency)))
|
||||
(let ((exchanged (gnc:exchange-by-euro-numeric
|
||||
(car foreignlist) (cadr foreignlist)
|
||||
report-currency transaction-date)))
|
||||
(if exchanged
|
||||
(set! foreignlist
|
||||
(list report-currency
|
||||
(gnc:gnc-monetary-amount exchanged)
|
||||
(caddr foreignlist))))))
|
||||
((gnc-commodity-equiv acc-comm report-currency)
|
||||
(let ((new-foreign (+ tot-foreign value-amt))
|
||||
(new-domestic (+ tot-domestic share-amt)))
|
||||
(loop new-foreign
|
||||
new-domestic
|
||||
(cdr commodity-splits)
|
||||
(cons (list txn-date (/ new-domestic new-foreign)) result))))
|
||||
|
||||
(list
|
||||
transaction-date
|
||||
(if foreignlist
|
||||
(if (not (gnc-commodity-equiv (car foreignlist)
|
||||
report-currency))
|
||||
(begin
|
||||
(warn "gnc:get-commodity-totalavg-prices: "
|
||||
"Sorry, currency exchange not yet implemented:"
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary
|
||||
(car foreignlist) (cadr foreignlist)))
|
||||
" (buying "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary
|
||||
price-commodity (caddr foreignlist)))
|
||||
") =? "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary
|
||||
report-currency 0)))
|
||||
0)
|
||||
(begin
|
||||
(set! total-foreign (gnc-numeric-add total-foreign
|
||||
(caddr foreignlist)
|
||||
GNC-DENOM-AUTO
|
||||
GNC-DENOM-LCD))
|
||||
(set! total-domestic (gnc-numeric-add total-domestic
|
||||
(cadr foreignlist)
|
||||
GNC-DENOM-AUTO
|
||||
GNC-DENOM-LCD))
|
||||
(if (not (zero? total-foreign))
|
||||
(gnc-numeric-div
|
||||
total-domestic
|
||||
total-foreign
|
||||
GNC-DENOM-AUTO
|
||||
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)) 0)))
|
||||
#f))))
|
||||
commodity-splits))))
|
||||
((gnc-commodity-equiv txn-comm report-currency)
|
||||
(let ((new-foreign (+ tot-foreign share-amt))
|
||||
(new-domestic (+ tot-domestic value-amt)))
|
||||
(loop new-foreign
|
||||
new-domestic
|
||||
(cdr commodity-splits)
|
||||
(cons (list txn-date (/ new-domestic new-foreign)) result))))
|
||||
|
||||
((gnc:exchange-by-euro-numeric txn-comm value-amt report-currency txn-date)
|
||||
=> (lambda (amt)
|
||||
(let ((new-foreign (+ tot-foreign share-amt))
|
||||
(new-domestic (+ tot-domestic (gnc:gnc-monetary-amount amt))))
|
||||
(loop new-foreign
|
||||
new-domestic
|
||||
(cdr commodity-splits)
|
||||
(cons (list txn-date (/ new-domestic new-foreign)) result)))))
|
||||
|
||||
(else
|
||||
(warn "gnc:get-commodity-totalavg-prices: "
|
||||
"Sorry, currency exchange not yet implemented:"
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary txn-comm value-amt))
|
||||
" (buying "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary price-commodity share-amt))
|
||||
") =? "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary report-currency 0)))
|
||||
(loop tot-foreign
|
||||
tot-domestic
|
||||
(cdr commodity-splits)
|
||||
result)))))))
|
||||
|
||||
|
||||
;; Create a list of prices for all commodities in 'commodity-list',
|
||||
@@ -222,14 +197,12 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
(gnc-account-get-descendants-sorted (gnc-get-current-root-account)))
|
||||
(all-splits (get-all-splits currency-accounts end-date))
|
||||
(interesting-splits (sort (filter interesting-split? all-splits) date<?))
|
||||
(work-to-do (length commodity-list))
|
||||
(work-done 0))
|
||||
(work-to-do (length commodity-list)))
|
||||
(map
|
||||
(lambda (c)
|
||||
(lambda (c work-done)
|
||||
(define (split-has-commodity? s)
|
||||
(or (gnc-commodity-equiv c (xaccTransGetCurrency (xaccSplitGetParent s)))
|
||||
(gnc-commodity-equiv c (xaccAccountGetCommodity (xaccSplitGetAccount s)))))
|
||||
(set! work-done (1+ work-done))
|
||||
(if start-percent
|
||||
(gnc:report-percent-done
|
||||
(+ start-percent (* delta-percent (/ work-done work-to-do)))))
|
||||
@@ -237,7 +210,8 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
(gnc:get-commodity-totalavg-prices-internal
|
||||
currency-accounts end-date c report-currency
|
||||
(filter split-has-commodity? interesting-splits))))
|
||||
commodity-list)))
|
||||
commodity-list
|
||||
(iota work-to-do))))
|
||||
|
||||
;; Get the instantaneous prices for the 'price-commodity', measured in
|
||||
;; amounts of the 'report-currency'. The prices are taken from all
|
||||
@@ -248,68 +222,49 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
(define (gnc:get-commodity-inst-prices
|
||||
currency-accounts end-date price-commodity report-currency)
|
||||
;; go through all splits; convert all splits into a price.
|
||||
(filter
|
||||
gnc:price-is-not-zero?
|
||||
(map-in-order
|
||||
(lambda (a)
|
||||
(let* ((transaction-comm (xaccTransGetCurrency
|
||||
(xaccSplitGetParent a)))
|
||||
(account-comm (xaccAccountGetCommodity
|
||||
(xaccSplitGetAccount a)))
|
||||
(share-amount (abs
|
||||
(xaccSplitGetAmount a)))
|
||||
(value-amount (abs
|
||||
(xaccSplitGetValue a)))
|
||||
(transaction-date (xaccTransGetDate
|
||||
(xaccSplitGetParent a)))
|
||||
(foreignlist
|
||||
(if (gnc-commodity-equiv transaction-comm price-commodity)
|
||||
(list account-comm
|
||||
share-amount value-amount)
|
||||
(list transaction-comm
|
||||
value-amount share-amount))))
|
||||
(let loop ((result '())
|
||||
(commodity-splits (gnc:get-match-commodity-splits-sorted
|
||||
currency-accounts end-date price-commodity)))
|
||||
(if (null? commodity-splits)
|
||||
(reverse! result)
|
||||
(let* ((a (car commodity-splits))
|
||||
(txn-comm (xaccTransGetCurrency (xaccSplitGetParent a)))
|
||||
(acc-comm (xaccAccountGetCommodity (xaccSplitGetAccount a)))
|
||||
(share-amt (abs (xaccSplitGetAmount a)))
|
||||
(value-amt (abs (xaccSplitGetValue a)))
|
||||
(txn-date (xaccTransGetDate (xaccSplitGetParent a))))
|
||||
(cond
|
||||
((or (zero? share-amt) (zero? value-amt))
|
||||
(loop result
|
||||
(cdr commodity-splits)))
|
||||
|
||||
;; Try EURO exchange if necessary
|
||||
(if (not (gnc-commodity-equiv (car foreignlist)
|
||||
report-currency))
|
||||
(let ((exchanged (gnc:exchange-by-euro-numeric
|
||||
(car foreignlist) (cadr foreignlist)
|
||||
report-currency transaction-date)))
|
||||
(if exchanged
|
||||
(set! foreignlist
|
||||
(list report-currency
|
||||
(gnc:gnc-monetary-amount exchanged)
|
||||
(caddr foreignlist))))))
|
||||
((gnc-commodity-equiv acc-comm report-currency)
|
||||
(loop (cons (list txn-date (/ share-amt value-amt)) result)
|
||||
(cdr commodity-splits)))
|
||||
|
||||
(list
|
||||
transaction-date
|
||||
(if (not (gnc-commodity-equiv (car foreignlist)
|
||||
report-currency))
|
||||
(begin
|
||||
(warn "get-commodity-inst-prices: "
|
||||
"Sorry, currency exchange not yet implemented:"
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary
|
||||
(car foreignlist) (cadr foreignlist)))
|
||||
" (buying "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary
|
||||
price-commodity (caddr foreignlist)))
|
||||
") =? "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary
|
||||
report-currency 0)))
|
||||
0)
|
||||
(if (not (zero? (caddr foreignlist)))
|
||||
(gnc-numeric-div
|
||||
(cadr foreignlist)
|
||||
(caddr foreignlist)
|
||||
GNC-DENOM-AUTO
|
||||
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)) 0)))))
|
||||
;; Get all the interesting splits, sorted by date.
|
||||
(gnc:get-match-commodity-splits-sorted
|
||||
currency-accounts
|
||||
end-date price-commodity))))
|
||||
((gnc-commodity-equiv txn-comm report-currency)
|
||||
(loop (cons (list txn-date (/ value-amt share-amt)) result)
|
||||
(cdr commodity-splits)))
|
||||
|
||||
((gnc:exchange-by-euro-numeric txn-comm value-amt report-currency txn-date)
|
||||
=> (lambda (amt)
|
||||
(loop (cons (list txn-date (/ (gnc:gnc-monetary-amount amt) share-amt))
|
||||
result)
|
||||
(cdr commodity-splits))))
|
||||
|
||||
(else
|
||||
(warn "get-commodity-inst-prices: "
|
||||
"Sorry, currency exchange not yet implemented:"
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary txn-comm value-amt))
|
||||
" (buying "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary price-commodity share-amt))
|
||||
") =? "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary report-currency 0)))
|
||||
(loop result
|
||||
(cdr commodity-splits))))))))
|
||||
|
||||
;; Get the instantaneous prices for all commodities in
|
||||
;; 'commodity-list', i.e. the same thing as get-commodity-inst-prices
|
||||
@@ -323,19 +278,17 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
"gnc:get-commoditylist-inst-prices is deprecated.")
|
||||
(let ((currency-accounts
|
||||
(gnc-account-get-descendants-sorted (gnc-get-current-root-account)))
|
||||
(work-to-do (length commodity-list))
|
||||
(work-done 0))
|
||||
(work-to-do (length commodity-list)))
|
||||
(map
|
||||
(lambda (c)
|
||||
(begin
|
||||
(set! work-done (+ 1 work-done))
|
||||
(if start-percent
|
||||
(gnc:report-percent-done
|
||||
(+ start-percent (* delta-percent (/ work-done work-to-do)))))
|
||||
(cons c
|
||||
(gnc:get-commodity-inst-prices
|
||||
currency-accounts end-date c report-currency))))
|
||||
commodity-list)))
|
||||
(lambda (c work-done)
|
||||
(if start-percent
|
||||
(gnc:report-percent-done
|
||||
(+ start-percent (* delta-percent (/ work-done work-to-do)))))
|
||||
(cons c
|
||||
(gnc:get-commodity-inst-prices
|
||||
currency-accounts end-date c report-currency)))
|
||||
commodity-list
|
||||
(iota work-to-do))))
|
||||
|
||||
|
||||
;; Find the price in 'pricelist' that's nearest to 'date'. The
|
||||
@@ -353,14 +306,6 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
pricelist))
|
||||
(earlier (and (not (null? earlierlist))
|
||||
(last earlierlist))))
|
||||
;; (if earlier
|
||||
;; (warn "earlier"
|
||||
;; (qof-print-date (car earlier))
|
||||
;; (gnc-numeric-to-double (cadr earlier))))
|
||||
;; (if later
|
||||
;; (warn "later"
|
||||
;; (qof-print-date (car later))
|
||||
;; (gnc-numeric-to-double (cadr later))))
|
||||
|
||||
(if (and earlier later)
|
||||
(if (< (abs (- date (car earlier)))
|
||||
@@ -398,117 +343,114 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
;; report-commodity, and now the transactions with unknown
|
||||
;; currencies should be added to that list (with an appropriate
|
||||
;; exchange rate).
|
||||
(let ((reportlist (cadr (assoc report-commodity sumlist))))
|
||||
|
||||
;; Helper function to calculate (a*b)/c and create the new pair of
|
||||
;; numeric-collectors, where [abc] are numeric-collectors. See the
|
||||
;; real variable names below.
|
||||
(define (make-newrate unknown-coll un->known-coll known-pair)
|
||||
(let ((a (gnc:make-value-collector))
|
||||
(b (gnc:make-value-collector)))
|
||||
(a 'add (unknown-coll 'total #f))
|
||||
(b 'add
|
||||
;; round to (at least) 8 significant digits
|
||||
(gnc-numeric-div
|
||||
(gnc-numeric-mul
|
||||
(un->known-coll 'total #f)
|
||||
((cdadr known-pair) 'total #f)
|
||||
GNC-DENOM-AUTO
|
||||
(logior (GNC-DENOM-SIGFIGS 9) GNC-RND-ROUND))
|
||||
((caadr known-pair) 'total #f)
|
||||
GNC-DENOM-AUTO
|
||||
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)))
|
||||
;; in other words: (/ (* (caadr un->known-coll) (cdadr
|
||||
;; known-pair)) (caadr known-pair) ))
|
||||
(cons a b)))
|
||||
;; Helper function to calculate (a*b)/c and create the new pair of
|
||||
;; numeric-collectors, where [abc] are numeric-collectors. See the
|
||||
;; real variable names below.
|
||||
(define (make-newrate unknown-coll un->known-coll known-pair)
|
||||
(let ((a (gnc:make-value-collector))
|
||||
(b (gnc:make-value-collector))
|
||||
(c ((caadr known-pair) 'total #f)))
|
||||
(a 'add (unknown-coll 'total #f))
|
||||
(unless (zero? c)
|
||||
(b 'add (/ (* (un->known-coll 'total #f)
|
||||
((cdadr known-pair) 'total #f))
|
||||
c)))
|
||||
(cons a b)))
|
||||
|
||||
;; Go through sumlist.
|
||||
(for-each
|
||||
(lambda (otherlist)
|
||||
(if (not (gnc-commodity-equiv (car otherlist) report-commodity))
|
||||
(for-each
|
||||
(lambda (pair)
|
||||
;; Check whether by any accident the report-commodity
|
||||
;; appears here.
|
||||
(if
|
||||
(not (gnc-commodity-equiv (car pair) report-commodity))
|
||||
;; pair-{a,b}: Try to find either the currency of
|
||||
;; otherlist or of pair in reportlist.
|
||||
(let ((pair-a
|
||||
(or
|
||||
;; Find the otherlist's currency in reportlist
|
||||
(assoc (car otherlist) reportlist)
|
||||
;; Or try whether that's an Euro currency.
|
||||
(let
|
||||
((euro-monetary
|
||||
(gnc:exchange-by-euro (gnc:make-gnc-monetary
|
||||
(car otherlist)
|
||||
((cdadr pair) 'total #f))
|
||||
report-commodity #f)))
|
||||
;; If this is an Euro currency, create the
|
||||
;; pair of appropriately exchanged amounts.
|
||||
(if euro-monetary
|
||||
(let ((a (gnc:make-value-collector)))
|
||||
(a 'add
|
||||
(gnc:gnc-monetary-amount euro-monetary))
|
||||
(list report-commodity
|
||||
(cons (cdadr pair) a)))
|
||||
#f))))
|
||||
;; Find the pair's currency in reportlist. FIXME:
|
||||
;; Also try the Euro here.
|
||||
(pair-b (assoc (car pair) reportlist))
|
||||
(rate 0))
|
||||
(if (and (not pair-a) (not pair-b))
|
||||
;; If neither the currency of otherlist nor of
|
||||
;; pair was found in reportlist then we can't
|
||||
;; resolve the exchange rate to this currency.
|
||||
(warn "gnc:resolve-unknown-comm:"
|
||||
"can't calculate rate for "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary (car pair) ((caadr pair) 'total #f)))
|
||||
" = "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary (car otherlist) ((cdadr pair) 'total #f)))
|
||||
" to "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary report-commodity 0)))
|
||||
(if (and pair-a pair-b)
|
||||
;; If both currencies are found then something
|
||||
;; went wrong inside
|
||||
;; gnc:get-exchange-totals. FIXME: Find a
|
||||
;; better thing to do in this case.
|
||||
(warn "gnc:resolve-unknown-comm:"
|
||||
"Oops - exchange rate ambiguity error: "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary (car pair) ((caadr pair) 'total #f)))
|
||||
" = "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary (car otherlist)
|
||||
((cdadr pair) 'total #f))))
|
||||
(let
|
||||
;; Usual case: one of pair-{a,b} was found
|
||||
;; in reportlist, i.e. this transaction
|
||||
;; can be resolved to report-commodity.
|
||||
((newrate
|
||||
(if (not pair-a)
|
||||
(list (car otherlist)
|
||||
(make-newrate (cdadr pair)
|
||||
(caadr pair) pair-b))
|
||||
(list (car pair)
|
||||
(make-newrate (caadr pair)
|
||||
(cdadr pair) pair-a)))))
|
||||
(set! reportlist (cons newrate reportlist))))))
|
||||
;; Huh, the report-currency showed up on the wrong side
|
||||
;; -- we will just add it to the reportlist on the
|
||||
;; right side.
|
||||
(let ((newrate (list (car otherlist)
|
||||
(cons (cdadr pair) (caadr pair)))))
|
||||
(set! reportlist (cons newrate reportlist)))))
|
||||
(cadr otherlist))))
|
||||
sumlist)
|
||||
;; Go through sumlist.
|
||||
(let loop ((sumlist sumlist)
|
||||
(reportlist (cadr (assoc report-commodity sumlist))))
|
||||
(cond
|
||||
((null? sumlist) reportlist)
|
||||
|
||||
((gnc-commodity-equiv (caar sumlist) report-commodity)
|
||||
(loop (cdr sumlist) reportlist))
|
||||
|
||||
(else
|
||||
(let innerloop ((pairs (cadr (car sumlist)))
|
||||
(reportlist reportlist))
|
||||
(cond
|
||||
((null? pairs)
|
||||
(loop (cdr sumlist) reportlist))
|
||||
|
||||
;; Check whether by any accident the report-commodity appears
|
||||
;; here. Huh, the report-currency showed up on the wrong
|
||||
;; side -- we will just add it to the reportlist on the right
|
||||
;; side.
|
||||
((gnc-commodity-equiv (caar pairs) report-commodity)
|
||||
(innerloop (cdr pairs)
|
||||
(cons (list (caar sumlist)
|
||||
(cons (cdadr (car pairs)) (caadr (car pairs))))
|
||||
reportlist)))
|
||||
|
||||
(else
|
||||
;; pair-{a,b}: Try to find either the currency of (car
|
||||
;; sumlist) or of pair in reportlist.
|
||||
(let* ((pair (car pairs))
|
||||
(pair-a (or (assoc (car (car sumlist)) reportlist)
|
||||
;; Find the (car sumlist)'s currency in reportlist
|
||||
;; Or try whether that's an Euro currency.
|
||||
(let ((euro-monetary
|
||||
(gnc:exchange-by-euro
|
||||
(gnc:make-gnc-monetary
|
||||
(car (car sumlist))
|
||||
((cdadr pair) 'total #f))
|
||||
report-commodity #f)))
|
||||
;; If this is an Euro currency, create the
|
||||
;; pair of appropriately exchanged amounts.
|
||||
(and euro-monetary
|
||||
(let ((a (gnc:make-value-collector)))
|
||||
(a 'add (gnc:gnc-monetary-amount euro-monetary))
|
||||
(list report-commodity
|
||||
(cons (cdadr pair) a)))))))
|
||||
;; Find the pair's currency in reportlist. FIXME:
|
||||
;; Also try the Euro here.
|
||||
(pair-b (assoc (car pair) reportlist)))
|
||||
|
||||
(cond
|
||||
((and (not pair-a) (not pair-b))
|
||||
;; If neither the currency of (car sumlist) nor of pair
|
||||
;; was found in reportlist then we can't resolve the
|
||||
;; exchange rate to this currency.
|
||||
(warn "gnc:resolve-unknown-comm:"
|
||||
"can't calculate rate for "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary (car pair) ((caadr pair) 'total #f)))
|
||||
" = "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary (caar sumlist) ((cdadr pair) 'total #f)))
|
||||
" to "
|
||||
(gnc:monetary->string (gnc:make-gnc-monetary report-commodity 0)))
|
||||
(innerloop (cdr pairs) reportlist))
|
||||
|
||||
((and pair-a pair-b)
|
||||
;; If both currencies are found then something went
|
||||
;; wrong inside gnc:get-exchange-totals. FIXME: Find a
|
||||
;; better thing to do in this case.
|
||||
(warn "gnc:resolve-unknown-comm:"
|
||||
"Oops - exchange rate ambiguity error: "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary (car pair) ((caadr pair) 'total #f)))
|
||||
" = "
|
||||
(gnc:monetary->string
|
||||
(gnc:make-gnc-monetary (caar sumlist) ((cdadr pair) 'total #f))))
|
||||
(innerloop (cdr pairs) reportlist))
|
||||
|
||||
;; Usual case: one of pair-{a,b} was found in reportlist,
|
||||
;; i.e. this transaction can be resolved to
|
||||
;; report-commodity.
|
||||
(pair-a
|
||||
(innerloop (cdr pairs)
|
||||
(cons (list (car pair)
|
||||
(make-newrate (caadr pair) (cdadr pair) pair-a))
|
||||
reportlist)))
|
||||
(pair-b
|
||||
(innerloop (cdr pairs)
|
||||
(cons (list (car (car sumlist))
|
||||
(make-newrate (cdadr pair) (caadr pair) pair-b))
|
||||
reportlist))))))))))))
|
||||
|
||||
;; Return the reportlist.
|
||||
reportlist))
|
||||
;; Some thoughts: In the (and (not pair-a) (not pair-b)) case above we
|
||||
;; will have unresolvable transaction exchange rates. But there might
|
||||
;; be cases where we will be able to resolve this, but only after one
|
||||
@@ -523,148 +465,162 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
;; amount total of 2000 GBP and a value of 2400 EUR. Returns a report-list.
|
||||
|
||||
(define (gnc:get-exchange-totals report-commodity end-date)
|
||||
(let ((curr-accounts
|
||||
(gnc-account-get-descendants-sorted (gnc-get-current-root-account)))
|
||||
(sumlist (list (list report-commodity '()))))
|
||||
(let ((curr-accounts (gnc-account-get-descendants-sorted
|
||||
(gnc-get-current-root-account))))
|
||||
|
||||
(if (not (null? curr-accounts))
|
||||
;; Go through all splits and add up all value-amounts
|
||||
;; and share-amounts
|
||||
(for-each
|
||||
(lambda (a)
|
||||
(let* ((transaction-comm (xaccTransGetCurrency
|
||||
(xaccSplitGetParent a)))
|
||||
(account-comm (xaccAccountGetCommodity
|
||||
(xaccSplitGetAccount a)))
|
||||
;; Always use the absolute value here.
|
||||
(share-amount (abs
|
||||
(xaccSplitGetAmount a)))
|
||||
(value-amount (abs
|
||||
(xaccSplitGetValue a)))
|
||||
(comm-list (or (assoc transaction-comm sumlist)
|
||||
(assoc account-comm sumlist))))
|
||||
;; Go through all splits and add up all value-amounts
|
||||
;; and share-amounts
|
||||
(let loop ((comm-splits (gnc:get-all-commodity-splits curr-accounts end-date))
|
||||
(sumlist (list (list report-commodity '()))))
|
||||
(cond
|
||||
((null? comm-splits)
|
||||
(gnc:resolve-unknown-comm sumlist report-commodity))
|
||||
|
||||
(cond ((zero? share-amount)
|
||||
;; Without shares this is not a buy or sell; ignore it.
|
||||
#f)
|
||||
(else
|
||||
(let* ((a (car comm-splits))
|
||||
(txn-comm (xaccTransGetCurrency (xaccSplitGetParent a)))
|
||||
(acc-comm (xaccAccountGetCommodity (xaccSplitGetAccount a)))
|
||||
;; Always use the absolute value here.
|
||||
(share-amt (abs (xaccSplitGetAmount a)))
|
||||
(value-amt (abs (xaccSplitGetValue a))))
|
||||
(cond
|
||||
;; Without shares this is not a buy or sell; ignore it.
|
||||
((zero? share-amt)
|
||||
(loop (cdr comm-splits)
|
||||
sumlist))
|
||||
|
||||
((not comm-list)
|
||||
;; entry doesn't exist in comm-list
|
||||
;; create sub-alist from scratch
|
||||
(let ((pair (list transaction-comm
|
||||
(cons (gnc:make-value-collector)
|
||||
(gnc:make-value-collector)))))
|
||||
((caadr pair) 'add value-amount)
|
||||
((cdadr pair) 'add share-amount)
|
||||
(set! comm-list (list account-comm (list pair)))
|
||||
;; and add the new sub-alist to sumlist.
|
||||
(set! sumlist (cons comm-list sumlist))))
|
||||
((assoc txn-comm sumlist)
|
||||
=> (lambda (comm-list)
|
||||
(cond
|
||||
((assoc acc-comm (cadr comm-list)) =>
|
||||
;; second commodity already exists in comm-list:
|
||||
(lambda (pair)
|
||||
((caadr pair) 'add share-amt)
|
||||
((cdadr pair) 'add value-amt)
|
||||
(loop (cdr comm-splits)
|
||||
sumlist)))
|
||||
(else
|
||||
;; if not, create a new entry in comm-list.
|
||||
(let ((pair (list acc-comm (cons (gnc:make-value-collector)
|
||||
(gnc:make-value-collector)))))
|
||||
((caadr pair) 'add share-amt)
|
||||
((cdadr pair) 'add value-amt)
|
||||
(loop (cdr comm-splits)
|
||||
(cons (list txn-comm (cons pair (cadr comm-list)))
|
||||
(alist-delete txn-comm sumlist))))))))
|
||||
|
||||
(else
|
||||
(let*
|
||||
;; Put the amounts in the right place.
|
||||
((foreignlist
|
||||
(if (gnc-commodity-equiv transaction-comm
|
||||
(car comm-list))
|
||||
(list account-comm
|
||||
share-amount value-amount)
|
||||
(list transaction-comm
|
||||
value-amount share-amount)))
|
||||
;; second commodity already existing in comm-list?
|
||||
(pair (assoc (car foreignlist) (cadr comm-list))))
|
||||
;; if not, create a new entry in comm-list.
|
||||
(if (not pair)
|
||||
(begin
|
||||
(set!
|
||||
pair (list (car foreignlist)
|
||||
(cons (gnc:make-value-collector)
|
||||
(gnc:make-value-collector))))
|
||||
(set!
|
||||
comm-list (list (car comm-list)
|
||||
(cons pair (cadr comm-list))))
|
||||
(set!
|
||||
sumlist (cons comm-list
|
||||
(alist-delete
|
||||
(car comm-list) sumlist)))))
|
||||
;; And add the balances to the comm-list entry.
|
||||
((caadr pair) 'add (cadr foreignlist))
|
||||
((cdadr pair) 'add (caddr foreignlist)))))))
|
||||
(gnc:get-all-commodity-splits curr-accounts end-date)))
|
||||
((assoc acc-comm sumlist)
|
||||
=> (lambda (comm-list)
|
||||
(cond
|
||||
((assoc txn-comm (cadr comm-list)) =>
|
||||
;; second commodity already exists in comm-list:
|
||||
(lambda (pair)
|
||||
((caadr pair) 'add value-amt)
|
||||
((cdadr pair) 'add share-amt)
|
||||
(loop (cdr comm-splits)
|
||||
sumlist)))
|
||||
(else
|
||||
;; if not, create a new entry in comm-list.
|
||||
(let ((pair (list txn-comm (cons (gnc:make-value-collector)
|
||||
(gnc:make-value-collector)))))
|
||||
((caadr pair) 'add value-amt)
|
||||
((cdadr pair) 'add share-amt)
|
||||
(loop (cdr comm-splits)
|
||||
(cons (list acc-comm (cons pair (cadr comm-list)))
|
||||
(alist-delete acc-comm sumlist))))))))
|
||||
|
||||
(gnc:resolve-unknown-comm sumlist report-commodity)))
|
||||
;; entry doesn't exist in sumlist. create sub-alist from scratch
|
||||
(else
|
||||
(let ((pair (list txn-comm
|
||||
(cons (gnc:make-value-collector)
|
||||
(gnc:make-value-collector)))))
|
||||
((caadr pair) 'add value-amt)
|
||||
((cdadr pair) 'add share-amt)
|
||||
(loop (cdr comm-splits)
|
||||
(cons (list acc-comm (list pair))
|
||||
sumlist)))))))))))
|
||||
|
||||
;; Sum the net amounts and values in the report commodity, including booked
|
||||
;; gains and losses, of each commodity across all accounts. Returns a
|
||||
;; report-list.
|
||||
(define (gnc:get-exchange-cost-totals report-commodity end-date)
|
||||
(let ((curr-accounts
|
||||
(gnc-account-get-descendants-sorted (gnc-get-current-root-account)))
|
||||
(sumlist (list (list report-commodity '()))))
|
||||
(let ((curr-accounts (gnc-account-get-descendants-sorted
|
||||
(gnc-get-current-root-account))))
|
||||
|
||||
(if (not (null? curr-accounts))
|
||||
;; Go through all splits and add up all value-amounts
|
||||
;; and share-amounts
|
||||
;; However skip splits in trading accounts as these counterbalance
|
||||
;; the actual value and share amounts back to zero
|
||||
(for-each
|
||||
(lambda (a)
|
||||
(if (not (eq? (xaccAccountGetType (xaccSplitGetAccount a)) ACCT-TYPE-TRADING))
|
||||
(let* ((transaction-comm (xaccTransGetCurrency
|
||||
(xaccSplitGetParent a)))
|
||||
(account-comm (xaccAccountGetCommodity
|
||||
(xaccSplitGetAccount a)))
|
||||
(share-amount (xaccSplitGetAmount a))
|
||||
(value-amount (xaccSplitGetValue a))
|
||||
(comm-list (or (assoc transaction-comm sumlist)
|
||||
(assoc account-comm sumlist))))
|
||||
(let loop ((comm-splits (gnc:get-all-commodity-splits curr-accounts end-date))
|
||||
(sumlist (list (list report-commodity '()))))
|
||||
(cond
|
||||
((null? comm-splits)
|
||||
(gnc:resolve-unknown-comm sumlist report-commodity))
|
||||
|
||||
;; entry exists already in comm-list?
|
||||
(if (not comm-list)
|
||||
;; no, create sub-alist from scratch
|
||||
(let ((pair (list transaction-comm
|
||||
(cons (gnc:make-value-collector)
|
||||
;; However skip splits in trading accounts as these counterbalance
|
||||
;; the actual value and share amounts back to zero
|
||||
((eqv? (xaccAccountGetType (xaccSplitGetAccount (car comm-splits)))
|
||||
ACCT-TYPE-TRADING)
|
||||
(loop (cdr comm-splits)
|
||||
sumlist))
|
||||
|
||||
;; Go through all splits and add up all value-amounts
|
||||
;; and share-amounts
|
||||
(else
|
||||
(let* ((a (car comm-splits))
|
||||
(txn-comm (xaccTransGetCurrency (xaccSplitGetParent a)))
|
||||
(acc-comm (xaccAccountGetCommodity (xaccSplitGetAccount a)))
|
||||
(share-amt (xaccSplitGetAmount a))
|
||||
(value-amt (xaccSplitGetValue a)))
|
||||
|
||||
(cond
|
||||
((assoc txn-comm sumlist)
|
||||
=> (lambda (comm-list)
|
||||
(cond
|
||||
;; other commodity already exists in comm-list?
|
||||
((assoc acc-comm (cadr comm-list))
|
||||
=> (lambda (pair)
|
||||
((caadr pair) 'add share-amt)
|
||||
((cdadr pair) 'add value-amt)
|
||||
(loop (cdr comm-splits)
|
||||
sumlist)))
|
||||
;; if not, create a new entry in comm-list.
|
||||
(else
|
||||
(let ((pair (list acc-comm (cons (gnc:make-value-collector)
|
||||
(gnc:make-value-collector)))))
|
||||
((caadr pair) 'add share-amt)
|
||||
((cdadr pair) 'add value-amt)
|
||||
(loop (cdr comm-splits)
|
||||
(cons (list (car comm-list) (cons pair (cadr comm-list)))
|
||||
(alist-delete
|
||||
(car comm-list) sumlist))))))))
|
||||
|
||||
((assoc acc-comm sumlist)
|
||||
=> (lambda (comm-list)
|
||||
(cond
|
||||
;; other commodity already exists in comm-list?
|
||||
((assoc txn-comm (cadr comm-list))
|
||||
=> (lambda (pair)
|
||||
((caadr pair) 'add (- value-amt))
|
||||
((cdadr pair) 'add (- share-amt))
|
||||
(loop (cdr comm-splits)
|
||||
sumlist)))
|
||||
(else
|
||||
(let ((pair (list txn-comm (cons (gnc:make-value-collector)
|
||||
(gnc:make-value-collector)))))
|
||||
;; And add the balances to the comm-list entry.
|
||||
((caadr pair) 'add (- value-amt))
|
||||
((cdadr pair) 'add (- share-amt))
|
||||
(loop (cdr comm-splits)
|
||||
(cons (list (car comm-list) (cons pair (cadr comm-list)))
|
||||
(alist-delete
|
||||
(car comm-list) sumlist))))))))
|
||||
|
||||
(else
|
||||
;; no, create sub-alist from scratch
|
||||
(let ((pair (list txn-comm (cons (gnc:make-value-collector)
|
||||
(gnc:make-value-collector)))))
|
||||
((caadr pair) 'add value-amount)
|
||||
((cdadr pair) 'add share-amount)
|
||||
(set! comm-list (list account-comm (list pair)))
|
||||
;; and add the new sub-alist to sumlist.
|
||||
(set! sumlist (cons comm-list sumlist)))
|
||||
;; yes, check for second commodity.
|
||||
(let*
|
||||
;; Put the amounts in the right place.
|
||||
((foreignlist
|
||||
(if (gnc-commodity-equiv transaction-comm
|
||||
(car comm-list))
|
||||
(list account-comm
|
||||
share-amount value-amount)
|
||||
(list transaction-comm
|
||||
(- value-amount)
|
||||
(- share-amount))))
|
||||
;; second commodity already existing in comm-list?
|
||||
(pair (assoc (car foreignlist) (cadr comm-list))))
|
||||
;; if not, create a new entry in comm-list.
|
||||
(if (not pair)
|
||||
(begin
|
||||
(set!
|
||||
pair (list (car foreignlist)
|
||||
(cons (gnc:make-value-collector)
|
||||
(gnc:make-value-collector))))
|
||||
(set!
|
||||
comm-list (list (car comm-list)
|
||||
(cons pair (cadr comm-list))))
|
||||
(set!
|
||||
sumlist (cons comm-list
|
||||
(alist-delete
|
||||
(car comm-list) sumlist)))))
|
||||
;; And add the balances to the comm-list entry.
|
||||
((caadr pair) 'add (cadr foreignlist))
|
||||
((cdadr pair) 'add (caddr foreignlist)))))))
|
||||
(gnc:get-all-commodity-splits curr-accounts end-date)))
|
||||
|
||||
(gnc:resolve-unknown-comm sumlist report-commodity)))
|
||||
|
||||
;; Anybody feel free to reimplement any of these functions, either in
|
||||
;; scheme or in C. -- cstim
|
||||
((caadr pair) 'add value-amt)
|
||||
((cdadr pair) 'add share-amt)
|
||||
;; and add the new sub-alist to sumlist.
|
||||
(loop (cdr comm-splits)
|
||||
(cons (list acc-comm (list pair)) sumlist)))))))))))
|
||||
|
||||
(define (gnc:make-exchange-alist report-commodity end-date)
|
||||
;; This returns the alist with the actual exchange rates, i.e. the
|
||||
@@ -673,11 +629,8 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
(map
|
||||
(lambda (e)
|
||||
(list (car e)
|
||||
(abs
|
||||
(gnc-numeric-div ((cdadr e) 'total #f)
|
||||
((caadr e) 'total #f)
|
||||
GNC-DENOM-AUTO
|
||||
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)))))
|
||||
(abs (/ ((cdadr e) 'total #f)
|
||||
((caadr e) 'total #f)))))
|
||||
(gnc:get-exchange-totals report-commodity end-date)))
|
||||
|
||||
(define (gnc:make-exchange-cost-alist report-commodity end-date)
|
||||
@@ -687,12 +640,10 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
(map
|
||||
(lambda (e)
|
||||
(list (car e)
|
||||
(if (zero? ((caadr e) 'total #f)) 0
|
||||
(abs
|
||||
(gnc-numeric-div ((cdadr e) 'total #f)
|
||||
((caadr e) 'total #f)
|
||||
GNC-DENOM-AUTO
|
||||
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))))))
|
||||
(if (zero? ((caadr e) 'total #f))
|
||||
0
|
||||
(abs (/ ((cdadr e) 'total #f)
|
||||
((caadr e) 'total #f))))))
|
||||
(gnc:get-exchange-cost-totals report-commodity end-date)))
|
||||
|
||||
|
||||
@@ -739,25 +690,19 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
;; the <gnc:commodity*> domestic-commodity, exchanges the amount into
|
||||
;; the domestic currency and returns a <gnc-monetary>.
|
||||
(define (gnc:make-exchange-function exchange-alist)
|
||||
(let ((exchangelist exchange-alist))
|
||||
(lambda (foreign domestic)
|
||||
(gnc:debug "foreign: " (gnc:monetary->string foreign))
|
||||
(gnc:debug "domestic: " (gnc-commodity-get-printname domestic))
|
||||
(and foreign
|
||||
(or (gnc:exchange-by-euro foreign domestic #f)
|
||||
(gnc:exchange-if-same foreign domestic)
|
||||
(lambda (foreign domestic)
|
||||
(gnc:debug "foreign: " (gnc:monetary->string foreign))
|
||||
(gnc:debug "domestic: " (gnc-commodity-get-printname domestic))
|
||||
(and foreign
|
||||
(or (gnc:exchange-by-euro foreign domestic #f)
|
||||
(gnc:exchange-if-same foreign domestic)
|
||||
(let* ((foreign-comm (gnc:gnc-monetary-commodity foreign))
|
||||
(pair (assoc foreign-comm exchange-alist)))
|
||||
(gnc:make-gnc-monetary
|
||||
domestic
|
||||
(let ((pair (assoc (gnc:gnc-monetary-commodity foreign)
|
||||
exchangelist))
|
||||
(foreign-amount (gnc:gnc-monetary-amount foreign)))
|
||||
(if (or (not pair)
|
||||
(zero? foreign-amount))
|
||||
0
|
||||
(gnc-numeric-mul foreign-amount
|
||||
(cadr pair)
|
||||
(gnc-commodity-get-fraction domestic)
|
||||
GNC-RND-ROUND)))))))))
|
||||
(if pair
|
||||
(* (gnc:gnc-monetary-amount foreign) (cadr pair))
|
||||
0)))))))
|
||||
|
||||
;; Helper for the gnc:exchange-by-pricalist* below. Exchange the
|
||||
;; <gnc:monetary> 'foreign' into the <gnc:commodity*> 'domestic' by
|
||||
@@ -770,10 +715,8 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
(gnc:make-gnc-monetary
|
||||
domestic
|
||||
(if price-value
|
||||
(gnc-numeric-mul (gnc:gnc-monetary-amount foreign)
|
||||
price-value
|
||||
(gnc-commodity-get-fraction domestic)
|
||||
GNC-RND-ROUND)
|
||||
(* (gnc:gnc-monetary-amount foreign)
|
||||
price-value)
|
||||
(begin
|
||||
(warn "gnc:exchange-by-pricevalue-helper: No price found for "
|
||||
(gnc:monetary->string foreign) " into "
|
||||
@@ -794,10 +737,8 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
|
||||
domestic
|
||||
(if price
|
||||
(let ((result
|
||||
(gnc-numeric-mul (gnc:gnc-monetary-amount foreign)
|
||||
(gnc-price-get-value price)
|
||||
(gnc-commodity-get-fraction domestic)
|
||||
GNC-RND-ROUND)))
|
||||
(* (gnc:gnc-monetary-amount foreign)
|
||||
(gnc-price-get-value price))))
|
||||
(gnc-price-unref price)
|
||||
result)
|
||||
(begin
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
(export gnc:menuname-budget)
|
||||
(export gnc:menuname-taxes)
|
||||
(export gnc:menuname-utility)
|
||||
(export gnc:menuname-experimental)
|
||||
(export gnc:menuname-custom)
|
||||
(export gnc:menuname-business-reports)
|
||||
(export gnc:pagename-general)
|
||||
@@ -743,6 +744,10 @@
|
||||
(export gnc:strify)
|
||||
(export gnc:pk)
|
||||
|
||||
;; trep-engine.scm
|
||||
(export gnc:trep-options-generator)
|
||||
(export gnc:trep-renderer)
|
||||
|
||||
(load-from-path "commodity-utilities")
|
||||
(load-from-path "html-barchart")
|
||||
(load-from-path "html-document")
|
||||
@@ -761,5 +766,6 @@
|
||||
(load-from-path "options-utilities")
|
||||
(load-from-path "report-utilities")
|
||||
(load-from-path "report")
|
||||
(load-from-path "trep-engine")
|
||||
|
||||
(gnc-hook-add-scm-dangler HOOK-SAVE-OPTIONS gnc:save-style-sheet-options)
|
||||
@@ -63,6 +63,7 @@
|
||||
(define gnc:menuname-budget (N_ "B_udget"))
|
||||
(define gnc:menuname-taxes (N_ "_Taxes"))
|
||||
(define gnc:menuname-utility (N_ "_Sample & Custom"))
|
||||
(define gnc:menuname-experimental (N_ "_Experimental"))
|
||||
(define gnc:menuname-custom (N_ "_Custom"))
|
||||
(define gnc:pagename-general (N_ "General"))
|
||||
(define gnc:pagename-accounts (N_ "Accounts"))
|
||||
|
||||
@@ -566,26 +566,22 @@
|
||||
(test-equal "MSFT totalavg 2012-01-15" (/ 4216500/100 1500)
|
||||
(cadr (assoc (gnc-dmy2time64-neutral 15 01 2012)
|
||||
report-list)))
|
||||
;; We have to use gnc-numeric-div with rounding in order to match the results
|
||||
;; from the function. Astute observers will notice that the totals include the
|
||||
;; Astute observers will notice that the totals include the
|
||||
;; capital gain split but not the acutal sell split on the day because the
|
||||
;; capital gain price is first in the list so that's the one (assoc) finds. See
|
||||
;; the comment at the gnc:get-commodity-totalavg-prices definition for more
|
||||
;; about the prices from this function.
|
||||
(test-equal "MSFT totalavg 2014-12-05"
|
||||
(gnc-numeric-div 6637500/100 2000 GNC-DENOM-AUTO
|
||||
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))
|
||||
(cadr (assoc (gnc-dmy2time64-neutral 5 12 2014)
|
||||
report-list)))
|
||||
(/ 6637500/100 2000)
|
||||
(cadr (assoc (gnc-dmy2time64-neutral 5 12 2014)
|
||||
report-list)))
|
||||
(test-equal "MSFT totalavg 2015-04-02"
|
||||
(gnc-numeric-div 9860700/100 2800 GNC-DENOM-AUTO
|
||||
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))
|
||||
(cadr (assoc (gnc-dmy2time64-neutral 2 4 2015) report-list)))
|
||||
(/ 9860700/100 2800)
|
||||
(cadr (assoc (gnc-dmy2time64-neutral 2 4 2015) report-list)))
|
||||
(test-equal "MSFT totalavg 2016-03-11"
|
||||
(gnc-numeric-div 14637000/100 3700 GNC-DENOM-AUTO
|
||||
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))
|
||||
(cadr (assoc (gnc-dmy2time64-neutral 11 3 2016)
|
||||
report-list))))
|
||||
(/ 14637000/100 3700)
|
||||
(cadr (assoc (gnc-dmy2time64-neutral 11 3 2016)
|
||||
report-list))))
|
||||
(test-end "Microsoft-USD")
|
||||
|
||||
(test-begin "Daimler-DEM")
|
||||
@@ -701,7 +697,7 @@
|
||||
(gnc-dmy2time64-neutral 20 02 2016)
|
||||
#f #f)))
|
||||
(test-equal "gnc:case-exchange-time-fn average-cost 20/02/2012"
|
||||
8073/100
|
||||
14127/175
|
||||
(gnc:gnc-monetary-amount
|
||||
(exchange-fn
|
||||
(gnc:make-gnc-monetary AAPL 1)
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -10,6 +10,7 @@ set (standard_reports_SCHEME_2
|
||||
average-balance.scm
|
||||
balance-sheet.scm
|
||||
balance-forecast.scm
|
||||
balsheet-pnl.scm
|
||||
budget-balance-sheet.scm
|
||||
budget-barchart.scm
|
||||
budget-flow.scm
|
||||
@@ -27,6 +28,7 @@ set (standard_reports_SCHEME_2
|
||||
net-charts.scm
|
||||
portfolio.scm
|
||||
price-scatter.scm
|
||||
reconcile-report.scm
|
||||
register.scm
|
||||
sx-summary.scm
|
||||
transaction.scm
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -34,7 +34,6 @@
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash gettext))
|
||||
(use-modules (gnucash report standard-reports transaction))
|
||||
|
||||
(gnc:module-load "gnucash/report/report-system" 0)
|
||||
|
||||
@@ -52,7 +51,7 @@
|
||||
;; options generator
|
||||
|
||||
(define (general-ledger-options-generator)
|
||||
(let* ((options (trep-options-generator)))
|
||||
(let ((options (gnc:trep-options-generator)))
|
||||
|
||||
(define pagename-sorting (N_ "Sorting"))
|
||||
(define (set-option! section name value)
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash gettext))
|
||||
(gnc:module-load "gnucash/report/report-system" 0)
|
||||
(use-modules (gnucash report standard-reports transaction))
|
||||
|
||||
;; Define the strings here to avoid typos and make changes easier.
|
||||
(define reportname (N_ "Income and GST Statement"))
|
||||
@@ -57,11 +56,12 @@ accounts must be of type ASSET for taxes paid on expenses, and type LIABILITY fo
|
||||
(gnc:html-markup-br)
|
||||
(gnc:html-markup-br)))
|
||||
|
||||
(define (income-gst-statement-renderer rpt)
|
||||
(trep-renderer rpt
|
||||
#:custom-calculated-cells gst-calculated-cells
|
||||
#:empty-report-message TAX-SETUP-DESC
|
||||
#:custom-split-filter gst-custom-split-filter))
|
||||
(define (gst-statement-renderer rpt)
|
||||
(gnc:trep-renderer
|
||||
rpt
|
||||
#:custom-calculated-cells gst-calculated-cells
|
||||
#:empty-report-message TAX-SETUP-DESC
|
||||
#:custom-split-filter gst-custom-split-filter))
|
||||
|
||||
(define (gst-custom-split-filter split)
|
||||
;; split -> bool
|
||||
@@ -74,7 +74,7 @@ accounts must be of type ASSET for taxes paid on expenses, and type LIABILITY fo
|
||||
(define (gst-statement-options-generator)
|
||||
|
||||
;; Retrieve the list of options specified within the transaction report
|
||||
(define options (trep-options-generator))
|
||||
(define options (gnc:trep-options-generator))
|
||||
|
||||
;; Delete Accounts selector
|
||||
(gnc:unregister-option options gnc:pagename-accounts (N_ "Accounts"))
|
||||
@@ -112,7 +112,7 @@ for taxes paid on expenses, and type LIABILITY for taxes collected on sales.")
|
||||
(list (N_ "Net Balance") "t" (N_ "Display the net balance (sales without tax - purchases without tax)") #f)
|
||||
(list (N_ "Tax payable") "u" (N_ "Display the tax payable (tax on sales - tax on purchases)") #f)))
|
||||
|
||||
;; Enable secret option to delete transactions with >1 split
|
||||
;; Enable option to retrieve unique transactions only
|
||||
(gnc:option-set-value (gnc:lookup-option options "__trep" "unique-transactions") #t)
|
||||
;; Disable account filtering
|
||||
(gnc:option-make-internal! options gnc:pagename-accounts "Filter Type")
|
||||
@@ -134,48 +134,45 @@ for taxes paid on expenses, and type LIABILITY for taxes collected on sales.")
|
||||
|
||||
(define (gst-calculated-cells options)
|
||||
(define (opt-val section name)
|
||||
(let ((option (gnc:lookup-option options section name)))
|
||||
(if option
|
||||
(gnc:option-value option)
|
||||
(gnc:error "gnc:lookup-option error: " section "/" name))))
|
||||
(gnc:option-value (gnc:lookup-option options section name)))
|
||||
(define (accfilter accounts type)
|
||||
(filter
|
||||
(lambda (acc)
|
||||
(eqv? (xaccAccountGetType acc) type))
|
||||
accounts))
|
||||
(letrec*
|
||||
((myadd (lambda (X Y) (if X (if Y (gnc:monetary+ X Y) X) Y))) ; custom monetary adder which understands #f
|
||||
(myneg (lambda (X) (and X (gnc:monetary-neg X)))) ; custom monetary negator which understands #f
|
||||
((myadd (lambda (X Y) (if X (if Y (gnc:monetary+ X Y) X) Y)))
|
||||
(myneg (lambda (X) (and X (gnc:monetary-neg X))))
|
||||
(accounts (opt-val gnc:pagename-accounts "Accounts"))
|
||||
(tax-accounts (opt-val gnc:pagename-accounts "Tax Accounts"))
|
||||
(accounts-tax-collected (filter (lambda (acc) (eq? (xaccAccountGetType acc) ACCT-TYPE-LIABILITY)) tax-accounts))
|
||||
(accounts-tax-paid (filter (lambda (acc) (eq? (xaccAccountGetType acc) ACCT-TYPE-ASSET)) tax-accounts))
|
||||
(accounts-sales (filter (lambda (acc) (eq? (xaccAccountGetType acc) ACCT-TYPE-INCOME)) accounts))
|
||||
(accounts-purchases (filter (lambda (acc) (eq? (xaccAccountGetType acc) ACCT-TYPE-EXPENSE)) accounts))
|
||||
(common-currency (and (opt-val gnc:pagename-general "Common Currency") ; if a common currency was specified,
|
||||
(opt-val gnc:pagename-general "Report's currency"))) ; use it
|
||||
(split-date (lambda (s) (xaccTransGetDate (xaccSplitGetParent s))))
|
||||
(split-currency (lambda (s) (xaccAccountGetCommodity (xaccSplitGetAccount s))))
|
||||
(accounts-tax-collected (accfilter tax-accounts ACCT-TYPE-LIABILITY))
|
||||
(accounts-tax-paid (accfilter tax-accounts ACCT-TYPE-ASSET))
|
||||
(accounts-sales (accfilter accounts ACCT-TYPE-INCOME))
|
||||
(accounts-purchases (accfilter accounts ACCT-TYPE-EXPENSE))
|
||||
(common-currency (and (opt-val gnc:pagename-general "Common Currency")
|
||||
(opt-val gnc:pagename-general "Report's currency")))
|
||||
(split->date (lambda (s) (xaccTransGetDate (xaccSplitGetParent s))))
|
||||
(split->currency (lambda (s) (xaccAccountGetCommodity (xaccSplitGetAccount s))))
|
||||
(split-adder (lambda (split accountlist)
|
||||
(let* (;; 1. from split, get the trans
|
||||
(transaction (xaccSplitGetParent split))
|
||||
;; 2. from trans, get all splits
|
||||
(splits-in-transaction (xaccTransGetSplitList transaction))
|
||||
;; 3. but only from accounts specified
|
||||
(include-split? (lambda (s) (member (xaccSplitGetAccount s) accountlist)))
|
||||
(filtered-splits (filter include-split? splits-in-transaction))
|
||||
;; 4. get the filtered split amount
|
||||
(split-get-monetary (lambda (s)
|
||||
(gnc:make-gnc-monetary
|
||||
(split-currency s)
|
||||
(if (xaccTransGetVoidStatus transaction)
|
||||
(xaccSplitVoidFormerAmount s)
|
||||
(xaccSplitGetAmount s)))))
|
||||
;; 5. amount - always convert to
|
||||
;; either report currency or the original split currency
|
||||
(split-monetary-converted (lambda (s)
|
||||
(gnc:exchange-by-pricedb-nearest
|
||||
(split-get-monetary s)
|
||||
(or common-currency
|
||||
(split-currency split))
|
||||
(time64CanonicalDayTime
|
||||
(split-date s)))))
|
||||
(list-of-values (map split-monetary-converted filtered-splits)))
|
||||
(let* ((txn (xaccSplitGetParent split))
|
||||
(filtered-splits (filter
|
||||
(lambda (s)
|
||||
(member (xaccSplitGetAccount s)
|
||||
accountlist))
|
||||
(xaccTransGetSplitList txn)))
|
||||
(split->monetary (lambda (s)
|
||||
(gnc:make-gnc-monetary
|
||||
(split->currency s)
|
||||
(if (xaccTransGetVoidStatus txn)
|
||||
(xaccSplitVoidFormerAmount s)
|
||||
(xaccSplitGetAmount s)))))
|
||||
(split->converted
|
||||
(lambda (s)
|
||||
(gnc:exchange-by-pricedb-nearest
|
||||
(split->monetary s)
|
||||
(or common-currency (split->currency split))
|
||||
(time64CanonicalDayTime (split->date s)))))
|
||||
(list-of-values (map split->converted filtered-splits)))
|
||||
(fold myadd #f list-of-values))))
|
||||
(account-adder (lambda (acc) (lambda (s) (split-adder s (list acc)))))
|
||||
(account-adder-neg (lambda (acc) (lambda (s) (myneg (split-adder s (list acc))))))
|
||||
@@ -283,4 +280,4 @@ for taxes paid on expenses, and type LIABILITY for taxes collected on sales.")
|
||||
'name reportname
|
||||
'report-guid "5bf27f249a0d11e7abc4cec278b6b50a"
|
||||
'options-generator gst-statement-options-generator
|
||||
'renderer income-gst-statement-renderer)
|
||||
'renderer gst-statement-renderer)
|
||||
@@ -0,0 +1,109 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; reconcile-report.scm : Reconciliation report
|
||||
;;
|
||||
;; calls functions defined in trep-engine.scm with defaults suitable
|
||||
;; for a reconciliation report including alternative date filtering
|
||||
;; strategy
|
||||
;;
|
||||
;; 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
|
||||
;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define-module (gnucash report standard-reports reconcile-report))
|
||||
|
||||
(use-modules (gnucash gettext))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-load "gnucash/report/report-system" 0)
|
||||
|
||||
(define (reconcile-report-options-generator)
|
||||
(let ((options (gnc:trep-options-generator)))
|
||||
(gnc:option-set-value
|
||||
(gnc:lookup-option options "Sorting" "Primary Key") 'reconciled-status)
|
||||
(gnc:option-set-value
|
||||
(gnc:lookup-option options "Sorting" "Secondary Key") 'date)
|
||||
(gnc:option-set-value
|
||||
(gnc:lookup-option options "Sorting" "Secondary Subtotal for Date Key") 'none)
|
||||
(gnc:option-set-value
|
||||
(gnc:lookup-option options gnc:pagename-general "Start Date")
|
||||
(cons 'relative 'start-prev-quarter))
|
||||
(gnc:option-set-value
|
||||
(gnc:lookup-option options gnc:pagename-general "End Date")
|
||||
(cons 'relative 'today))
|
||||
(gnc:option-set-value
|
||||
(gnc:lookup-option options gnc:pagename-display "Reconciled Date") #t)
|
||||
(gnc:option-set-value
|
||||
(gnc:lookup-option options gnc:pagename-display "Running Balance") #f)
|
||||
(gnc:option-set-value
|
||||
(gnc:lookup-option options gnc:pagename-display "Memo") #f)
|
||||
(gnc:option-make-internal! options gnc:pagename-display "Running Balance")
|
||||
options))
|
||||
|
||||
(define reconcile-report-instructions
|
||||
(gnc:make-html-text
|
||||
(_ "The reconcile report is designed to be similar to the formal \
|
||||
reconciliation tool. Please select the account from Report \
|
||||
Options. Please note the dates specified in the options will apply \
|
||||
to the Reconciliation Date.")
|
||||
(gnc:html-markup-br)
|
||||
(gnc:html-markup-br)))
|
||||
|
||||
(define (split->reconcile-date split)
|
||||
(and (char=? (xaccSplitGetReconcile split) #\y)
|
||||
(xaccSplitGetDateReconciled split)))
|
||||
|
||||
(define (reconcile-report-calculated-cells options)
|
||||
(letrec
|
||||
((split-amount (lambda (s)
|
||||
(if (gnc:split-voided? s)
|
||||
(xaccSplitVoidFormerAmount s)
|
||||
(xaccSplitGetAmount s))))
|
||||
(split-currency (compose xaccAccountGetCommodity xaccSplitGetAccount))
|
||||
(amount (lambda (s)
|
||||
(gnc:make-gnc-monetary (split-currency s) (split-amount s))))
|
||||
(debit-amount (lambda (s)
|
||||
(and (positive? (split-amount s))
|
||||
(amount s))))
|
||||
(credit-amount (lambda (s)
|
||||
(and (not (positive? (split-amount s)))
|
||||
(gnc:monetary-neg (amount s))))))
|
||||
;; similar to default-calculated-cells but disable dual-subtotals.
|
||||
(list (vector (_ "Funds In")
|
||||
debit-amount #f #t #f
|
||||
(const ""))
|
||||
(vector (_ "Funds Out")
|
||||
credit-amount #f #t #f
|
||||
(const "")))))
|
||||
|
||||
(define (reconcile-report-renderer rpt)
|
||||
(gnc:trep-renderer
|
||||
rpt
|
||||
#:custom-calculated-cells reconcile-report-calculated-cells
|
||||
#:split->date split->reconcile-date
|
||||
#:split->date-include-false? #t
|
||||
#:empty-report-message reconcile-report-instructions))
|
||||
|
||||
(gnc:define-report
|
||||
'version 1
|
||||
'name (_ "Reconciliation Report")
|
||||
'report-guid "e45218c6d76f11e7b5ef0800277ef320"
|
||||
'options-generator reconcile-report-options-generator
|
||||
;; the renderer is the same as trep, however we're using a different
|
||||
;; split-date strategy. we're comparing reconcile date for
|
||||
;; inclusion, and if split is unreconciled, include it anyway.
|
||||
'renderer reconcile-report-renderer)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
|
||||
(use-modules (gnucash engine test test-extras))
|
||||
(use-modules (gnucash report standard-reports transaction))
|
||||
(use-modules (gnucash report standard-reports reconcile-report))
|
||||
(use-modules (gnucash report stylesheets))
|
||||
(use-modules (gnucash report report-system))
|
||||
(use-modules (gnucash report report-system test test-extras))
|
||||
@@ -890,9 +891,8 @@
|
||||
|
||||
|
||||
(let* ((options (default-testing-options)))
|
||||
(let ((sxml (options->sxml options "null test")))
|
||||
(test-assert "sxml"
|
||||
sxml))
|
||||
(test-assert "reconcile-report basic run"
|
||||
(options->sxml options "null test"))
|
||||
(set-option! options "General" "Start Date" (cons 'absolute (gnc-dmy2time64 01 03 1970)))
|
||||
(set-option! options "General" "End Date" (cons 'absolute (gnc-dmy2time64 31 03 1970)))
|
||||
(let ((sxml (options->sxml options "filter reconcile date")))
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -4,23 +4,23 @@
|
||||
;;
|
||||
;; Copyright 2004 James Strandboge <jstrand1@rochester.rr.com>
|
||||
;;
|
||||
;; 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.
|
||||
;;
|
||||
;; 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
|
||||
;;
|
||||
;;
|
||||
;; Based on work from:
|
||||
;; stylesheet-header.scm
|
||||
;; Copyright 2000 Bill Gribble <grib@gnumatic.com>
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
(define-module (gnucash report stylesheet-easy))
|
||||
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash gettext))
|
||||
|
||||
@@ -38,34 +38,34 @@
|
||||
|
||||
(define (easy-options)
|
||||
(let* ((options (gnc:new-options))
|
||||
(opt-register
|
||||
(lambda (opt)
|
||||
(gnc:register-option options opt))))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(lambda (opt)
|
||||
(gnc:register-option options opt))))
|
||||
(opt-register
|
||||
(gnc:make-string-option
|
||||
(N_ "General")
|
||||
(N_ "Preparer") "a"
|
||||
(N_ "Name of person preparing the report.")
|
||||
(N_ "Name of person preparing the report.")
|
||||
""))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(gnc:make-string-option
|
||||
(N_ "General")
|
||||
(N_ "Prepared for") "b"
|
||||
(N_ "Name of organization or company prepared for.")
|
||||
(N_ "Name of organization or company prepared for.")
|
||||
""))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(gnc:make-simple-boolean-option
|
||||
(N_ "General")
|
||||
(N_ "Show preparer info") "c"
|
||||
(N_ "Name of organization or company.")
|
||||
(N_ "Name of organization or company.")
|
||||
#f))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(gnc:make-simple-boolean-option
|
||||
(N_ "General")
|
||||
(N_ "Enable Links") "d"
|
||||
(N_ "Enable hyperlinks in reports.")
|
||||
(N_ "Enable hyperlinks in reports.")
|
||||
#t))
|
||||
|
||||
|
||||
(opt-register
|
||||
(gnc:make-pixmap-option
|
||||
(N_ "Images")
|
||||
@@ -82,14 +82,14 @@
|
||||
(N_ "Heading Alignment") "c" (N_ "Banner for top of report.")
|
||||
'left
|
||||
(list (vector 'left
|
||||
(N_ "Left")
|
||||
(N_ "Align the banner to the left."))
|
||||
(N_ "Left")
|
||||
(N_ "Align the banner to the left."))
|
||||
(vector 'center
|
||||
(N_ "Center")
|
||||
(N_ "Align the banner in the center."))
|
||||
(N_ "Center")
|
||||
(N_ "Align the banner in the center."))
|
||||
(vector 'right
|
||||
(N_ "Right")
|
||||
(N_ "Align the banner to the right."))
|
||||
(N_ "Right")
|
||||
(N_ "Align the banner to the right."))
|
||||
)))
|
||||
(opt-register
|
||||
(gnc:make-pixmap-option
|
||||
@@ -102,14 +102,14 @@
|
||||
(N_ "Colors")
|
||||
(N_ "Background Color") "a" (N_ "General background color for report.")
|
||||
(list #xff #xff #xff #xff)
|
||||
255 #f))
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
(N_ "Colors")
|
||||
(N_ "Text Color") "b" (N_ "Normal body text color.")
|
||||
(list #x00 #x00 #x00 #xff)
|
||||
255 #f))
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
@@ -123,7 +123,7 @@
|
||||
(N_ "Colors")
|
||||
(N_ "Table Cell Color") "c" (N_ "Default background for table cells.")
|
||||
(list #xff #xff #xff #xff)
|
||||
255 #f))
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
@@ -157,20 +157,20 @@
|
||||
(list #xff #xff #x00 #xff)
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table cell spacing") "a" (N_ "Space between table cells.")
|
||||
1 0 20 0 1))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table cell padding") "b" (N_ "Space between table cell edge and content.")
|
||||
1 0 20 0 1))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table border width") "c" (N_ "Bevel depth on tables.")
|
||||
1 0 20 0 1))
|
||||
@@ -180,47 +180,47 @@
|
||||
|
||||
(define (easy-renderer options doc)
|
||||
(let* ((ssdoc (gnc:make-html-document))
|
||||
(opt-val
|
||||
(lambda (section name)
|
||||
(gnc:option-value
|
||||
(gnc:lookup-option options section name))))
|
||||
(color-val
|
||||
(lambda (section name)
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options section name))))
|
||||
(preparer (opt-val (N_ "General") (N_ "Preparer")))
|
||||
(prepared-for (opt-val (N_ "General") (N_ "Prepared for")))
|
||||
(show-preparer? (opt-val (N_ "General") (N_ "Show preparer info")))
|
||||
(links? (opt-val (N_ "General") (N_ "Enable Links")))
|
||||
(bgcolor (color-val (N_ "Colors") (N_ "Background Color")))
|
||||
(textcolor (color-val (N_ "Colors") (N_ "Text Color")))
|
||||
(linkcolor (color-val (N_ "Colors") (N_ "Link Color")))
|
||||
(normal-row-color (color-val (N_ "Colors") (N_ "Table Cell Color")))
|
||||
(alternate-row-color (color-val (N_ "Colors")
|
||||
(N_ "Alternate Table Cell Color")))
|
||||
(primary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Subheading/Subtotal Cell Color")))
|
||||
(secondary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Sub-subheading/total Cell Color")))
|
||||
(grand-total-color (color-val (N_ "Colors")
|
||||
(N_ "Grand Total Cell Color")))
|
||||
(bgpixmap (opt-val (N_ "Images") (N_ "Background Tile")))
|
||||
(headpixmap (opt-val (N_ "Images") (N_ "Heading Banner")))
|
||||
(logopixmap (opt-val (N_ "Images") (N_ "Logo")))
|
||||
(opt-val
|
||||
(lambda (section name)
|
||||
(gnc:option-value
|
||||
(gnc:lookup-option options section name))))
|
||||
(color-val
|
||||
(lambda (section name)
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options section name))))
|
||||
(preparer (opt-val (N_ "General") (N_ "Preparer")))
|
||||
(prepared-for (opt-val (N_ "General") (N_ "Prepared for")))
|
||||
(show-preparer? (opt-val (N_ "General") (N_ "Show preparer info")))
|
||||
(links? (opt-val (N_ "General") (N_ "Enable Links")))
|
||||
(bgcolor (color-val (N_ "Colors") (N_ "Background Color")))
|
||||
(textcolor (color-val (N_ "Colors") (N_ "Text Color")))
|
||||
(linkcolor (color-val (N_ "Colors") (N_ "Link Color")))
|
||||
(normal-row-color (color-val (N_ "Colors") (N_ "Table Cell Color")))
|
||||
(alternate-row-color (color-val (N_ "Colors")
|
||||
(N_ "Alternate Table Cell Color")))
|
||||
(primary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Subheading/Subtotal Cell Color")))
|
||||
(secondary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Sub-subheading/total Cell Color")))
|
||||
(grand-total-color (color-val (N_ "Colors")
|
||||
(N_ "Grand Total Cell Color")))
|
||||
(bgpixmap (opt-val (N_ "Images") (N_ "Background Tile")))
|
||||
(headpixmap (opt-val (N_ "Images") (N_ "Heading Banner")))
|
||||
(logopixmap (opt-val (N_ "Images") (N_ "Logo")))
|
||||
(align (gnc:value->string(opt-val (N_ "Images") (N_ "Heading Alignment"))))
|
||||
(spacing (opt-val (N_ "Tables") (N_ "Table cell spacing")))
|
||||
(padding (opt-val (N_ "Tables") (N_ "Table cell padding")))
|
||||
(border (opt-val (N_ "Tables") (N_ "Table border width")))
|
||||
(spacing (opt-val (N_ "Tables") (N_ "Table cell spacing")))
|
||||
(padding (opt-val (N_ "Tables") (N_ "Table cell padding")))
|
||||
(border (opt-val (N_ "Tables") (N_ "Table border width")))
|
||||
(headcolumn 0))
|
||||
|
||||
; center the document without elements inheriting anything
|
||||
; center the document without elements inheriting anything
|
||||
(gnc:html-document-add-object! ssdoc
|
||||
(gnc:make-html-text "<center>"))
|
||||
(gnc:make-html-text "<center>"))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "bgcolor" bgcolor)
|
||||
'attribute (list "text" textcolor)
|
||||
'attribute (list "link" linkcolor))
|
||||
@@ -293,13 +293,13 @@
|
||||
'attribute (list "class" "centered-label-cell"))
|
||||
|
||||
(if (and bgpixmap
|
||||
(not (string=? bgpixmap "")))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "background" (make-file-url bgpixmap))))
|
||||
|
||||
(not (string=? bgpixmap "")))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "background" (make-file-url bgpixmap))))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "table"
|
||||
ssdoc "table"
|
||||
'attribute (list "border" border)
|
||||
'attribute (list "cellspacing" spacing)
|
||||
'attribute (list "cellpadding" padding))
|
||||
@@ -311,38 +311,38 @@
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "alternate-row"
|
||||
'attribute (list "bgcolor" alternate-row-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "primary-subheading"
|
||||
'attribute (list "bgcolor" primary-subheading-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "secondary-subheading"
|
||||
'attribute (list "bgcolor" secondary-subheading-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "grand-total"
|
||||
'attribute (list "bgcolor" grand-total-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
|
||||
;; don't surround marked-up links with <a> </a>
|
||||
(if (not links?)
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "a" 'tag ""))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "a" 'tag ""))
|
||||
|
||||
(let ((t (gnc:make-html-table)))
|
||||
;; we don't want a bevel for this table, but we don't want
|
||||
;; that to propagate
|
||||
;; we don't want a bevel for this table, but we don't want
|
||||
;; that to propagate
|
||||
(gnc:html-table-set-style!
|
||||
t "table"
|
||||
t "table"
|
||||
'attribute (list "border" 0)
|
||||
'inheritable? #f)
|
||||
|
||||
; set the header column to be the 2nd when we have a logo
|
||||
; do this so that when logo is not present, the document
|
||||
; is perfectly centered
|
||||
; set the header column to be the 2nd when we have a logo
|
||||
; do this so that when logo is not present, the document
|
||||
; is perfectly centered
|
||||
(if (and logopixmap (> (string-length logopixmap) 0))
|
||||
(set! headcolumn 1))
|
||||
(set! headcolumn 1))
|
||||
|
||||
(add-css-information-to-doc options ssdoc doc)
|
||||
|
||||
@@ -350,10 +350,10 @@
|
||||
(doc-headline (gnc:html-document-headline doc))
|
||||
(headline (if (eq? doc-headline #f) title doc-headline)))
|
||||
|
||||
(gnc:html-table-set-cell!
|
||||
(gnc:html-table-set-cell!
|
||||
t 1 headcolumn
|
||||
(if show-preparer?
|
||||
;; title plus preparer info
|
||||
(if show-preparer?
|
||||
;; title plus preparer info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-h3 headline)
|
||||
(gnc:html-markup-br)
|
||||
@@ -367,42 +367,42 @@
|
||||
(qof-print-date
|
||||
(current-time)))
|
||||
|
||||
;; title only
|
||||
;; title only
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-h3 headline))))
|
||||
)
|
||||
|
||||
; only setup an image if we specified one
|
||||
|
||||
; only setup an image if we specified one
|
||||
(if (and logopixmap (> (string-length logopixmap) 0))
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 0
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-img (make-file-url logopixmap))))))
|
||||
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 0
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-img (make-file-url logopixmap))))))
|
||||
|
||||
(if (and headpixmap (> (string-length headpixmap) 0))
|
||||
(begin
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text
|
||||
(string-append
|
||||
"<div align=\"" align "\">"
|
||||
"<img src=\"" (make-file-url headpixmap) "\">"
|
||||
"</div>")))
|
||||
)
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text
|
||||
(string-append
|
||||
"<div align=\"" align "\">"
|
||||
"<img src=\"" (make-file-url headpixmap) "\">"
|
||||
"</div>")))
|
||||
)
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text " ")))
|
||||
|
||||
(apply
|
||||
gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text " ")))
|
||||
|
||||
(apply
|
||||
gnc:html-table-set-cell!
|
||||
t 2 headcolumn
|
||||
(gnc:html-document-objects doc))
|
||||
(gnc:html-document-add-object! ssdoc t))
|
||||
(gnc:html-document-add-object! ssdoc (gnc:make-html-text "</center>")) ;;TODO: make this a div instead of <center> (deprecated)
|
||||
ssdoc))
|
||||
|
||||
(gnc:define-html-style-sheet
|
||||
(gnc:define-html-style-sheet
|
||||
'version 1
|
||||
'name (N_ "Easy")
|
||||
'renderer easy-renderer
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; stylesheet-header.scm : stylesheet with nicer layout
|
||||
;; Copyright 2000 Bill Gribble <grib@gnumatic.com>
|
||||
;;
|
||||
;; 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.
|
||||
;;
|
||||
;;
|
||||
;; 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:
|
||||
;;
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
(define-module (gnucash report stylesheet-fancy))
|
||||
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash gettext))
|
||||
|
||||
@@ -32,34 +32,34 @@
|
||||
|
||||
(define (fancy-options)
|
||||
(let* ((options (gnc:new-options))
|
||||
(opt-register
|
||||
(lambda (opt)
|
||||
(gnc:register-option options opt))))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(lambda (opt)
|
||||
(gnc:register-option options opt))))
|
||||
(opt-register
|
||||
(gnc:make-string-option
|
||||
(N_ "General")
|
||||
(N_ "Preparer") "a"
|
||||
(N_ "Name of person preparing the report.")
|
||||
(N_ "Name of person preparing the report.")
|
||||
""))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(gnc:make-string-option
|
||||
(N_ "General")
|
||||
(N_ "Prepared for") "b"
|
||||
(N_ "Name of organization or company prepared for.")
|
||||
(N_ "Name of organization or company prepared for.")
|
||||
""))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(gnc:make-simple-boolean-option
|
||||
(N_ "General")
|
||||
(N_ "Show preparer info") "c"
|
||||
(N_ "Name of organization or company.")
|
||||
(N_ "Name of organization or company.")
|
||||
#f))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(gnc:make-simple-boolean-option
|
||||
(N_ "General")
|
||||
(N_ "Enable Links") "d"
|
||||
(N_ "Enable hyperlinks in reports.")
|
||||
(N_ "Enable hyperlinks in reports.")
|
||||
#t))
|
||||
|
||||
|
||||
(opt-register
|
||||
(gnc:make-pixmap-option
|
||||
(N_ "Images")
|
||||
@@ -76,14 +76,14 @@
|
||||
(N_ "Heading Alignment") "c" (N_ "Banner for top of report.")
|
||||
'left
|
||||
(list (vector 'left
|
||||
(N_ "Left")
|
||||
(N_ "Align the banner to the left."))
|
||||
(N_ "Left")
|
||||
(N_ "Align the banner to the left."))
|
||||
(vector 'center
|
||||
(N_ "Center")
|
||||
(N_ "Align the banner in the center."))
|
||||
(N_ "Center")
|
||||
(N_ "Align the banner in the center."))
|
||||
(vector 'right
|
||||
(N_ "Right")
|
||||
(N_ "Align the banner to the right."))
|
||||
(N_ "Right")
|
||||
(N_ "Align the banner to the right."))
|
||||
)))
|
||||
(opt-register
|
||||
(gnc:make-pixmap-option
|
||||
@@ -96,14 +96,14 @@
|
||||
(N_ "Colors")
|
||||
(N_ "Background Color") "a" (N_ "General background color for report.")
|
||||
(list #xff #xff #xff #xff)
|
||||
255 #f))
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
(N_ "Colors")
|
||||
(N_ "Text Color") "b" (N_ "Normal body text color.")
|
||||
(list #x00 #x00 #x00 #xff)
|
||||
255 #f))
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
@@ -117,7 +117,7 @@
|
||||
(N_ "Colors")
|
||||
(N_ "Table Cell Color") "c" (N_ "Default background for table cells.")
|
||||
(list #xff #xff #xff #xff)
|
||||
255 #f))
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
@@ -151,20 +151,20 @@
|
||||
(list #xff #xff #x00 #xff)
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table cell spacing") "a" (N_ "Space between table cells.")
|
||||
1 0 20 0 1))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table cell padding") "b" (N_ "Space between table cell edge and content.")
|
||||
1 0 20 0 1))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table border width") "c" (N_ "Bevel depth on tables.")
|
||||
1 0 20 0 1))
|
||||
@@ -174,47 +174,47 @@
|
||||
|
||||
(define (fancy-renderer options doc)
|
||||
(let* ((ssdoc (gnc:make-html-document))
|
||||
(opt-val
|
||||
(lambda (section name)
|
||||
(gnc:option-value
|
||||
(gnc:lookup-option options section name))))
|
||||
(color-val
|
||||
(lambda (section name)
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options section name))))
|
||||
(preparer (opt-val (N_ "General") (N_ "Preparer")))
|
||||
(prepared-for (opt-val (N_ "General") (N_ "Prepared for")))
|
||||
(show-preparer? (opt-val (N_ "General") (N_ "Show preparer info")))
|
||||
(links? (opt-val (N_ "General") (N_ "Enable Links")))
|
||||
(bgcolor (color-val (N_ "Colors") (N_ "Background Color")))
|
||||
(textcolor (color-val (N_ "Colors") (N_ "Text Color")))
|
||||
(linkcolor (color-val (N_ "Colors") (N_ "Link Color")))
|
||||
(normal-row-color (color-val (N_ "Colors") (N_ "Table Cell Color")))
|
||||
(alternate-row-color (color-val (N_ "Colors")
|
||||
(N_ "Alternate Table Cell Color")))
|
||||
(primary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Subheading/Subtotal Cell Color")))
|
||||
(secondary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Sub-subheading/total Cell Color")))
|
||||
(grand-total-color (color-val (N_ "Colors")
|
||||
(N_ "Grand Total Cell Color")))
|
||||
(bgpixmap (opt-val (N_ "Images") (N_ "Background Tile")))
|
||||
(headpixmap (opt-val (N_ "Images") (N_ "Heading Banner")))
|
||||
(logopixmap (opt-val (N_ "Images") (N_ "Logo")))
|
||||
(opt-val
|
||||
(lambda (section name)
|
||||
(gnc:option-value
|
||||
(gnc:lookup-option options section name))))
|
||||
(color-val
|
||||
(lambda (section name)
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options section name))))
|
||||
(preparer (opt-val (N_ "General") (N_ "Preparer")))
|
||||
(prepared-for (opt-val (N_ "General") (N_ "Prepared for")))
|
||||
(show-preparer? (opt-val (N_ "General") (N_ "Show preparer info")))
|
||||
(links? (opt-val (N_ "General") (N_ "Enable Links")))
|
||||
(bgcolor (color-val (N_ "Colors") (N_ "Background Color")))
|
||||
(textcolor (color-val (N_ "Colors") (N_ "Text Color")))
|
||||
(linkcolor (color-val (N_ "Colors") (N_ "Link Color")))
|
||||
(normal-row-color (color-val (N_ "Colors") (N_ "Table Cell Color")))
|
||||
(alternate-row-color (color-val (N_ "Colors")
|
||||
(N_ "Alternate Table Cell Color")))
|
||||
(primary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Subheading/Subtotal Cell Color")))
|
||||
(secondary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Sub-subheading/total Cell Color")))
|
||||
(grand-total-color (color-val (N_ "Colors")
|
||||
(N_ "Grand Total Cell Color")))
|
||||
(bgpixmap (opt-val (N_ "Images") (N_ "Background Tile")))
|
||||
(headpixmap (opt-val (N_ "Images") (N_ "Heading Banner")))
|
||||
(logopixmap (opt-val (N_ "Images") (N_ "Logo")))
|
||||
(align (gnc:value->string(opt-val (N_ "Images") (N_ "Heading Alignment"))))
|
||||
(spacing (opt-val (N_ "Tables") (N_ "Table cell spacing")))
|
||||
(padding (opt-val (N_ "Tables") (N_ "Table cell padding")))
|
||||
(border (opt-val (N_ "Tables") (N_ "Table border width")))
|
||||
(spacing (opt-val (N_ "Tables") (N_ "Table cell spacing")))
|
||||
(padding (opt-val (N_ "Tables") (N_ "Table cell padding")))
|
||||
(border (opt-val (N_ "Tables") (N_ "Table border width")))
|
||||
(headcolumn 0))
|
||||
|
||||
; center the document without elements inheriting anything
|
||||
; center the document without elements inheriting anything
|
||||
(gnc:html-document-add-object! ssdoc
|
||||
(gnc:make-html-text "<center>"))
|
||||
(gnc:make-html-text "<center>"))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "bgcolor" bgcolor)
|
||||
'attribute (list "text" textcolor)
|
||||
'attribute (list "link" linkcolor))
|
||||
@@ -288,13 +288,13 @@
|
||||
'attribute (list "class" "centered-label-cell"))
|
||||
|
||||
(if (and bgpixmap
|
||||
(not (string=? bgpixmap "")))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "background" (make-file-url bgpixmap))))
|
||||
|
||||
(not (string=? bgpixmap "")))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "background" (make-file-url bgpixmap))))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "table"
|
||||
ssdoc "table"
|
||||
'attribute (list "border" border)
|
||||
'attribute (list "cellspacing" spacing)
|
||||
'attribute (list "cellpadding" padding))
|
||||
@@ -306,32 +306,32 @@
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "alternate-row"
|
||||
'attribute (list "bgcolor" alternate-row-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "primary-subheading"
|
||||
'attribute (list "bgcolor" primary-subheading-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "secondary-subheading"
|
||||
'attribute (list "bgcolor" secondary-subheading-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "grand-total"
|
||||
'attribute (list "bgcolor" grand-total-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
|
||||
;; don't surround marked-up links with <a> </a>
|
||||
(if (not links?)
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "a" 'tag ""))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "a" 'tag ""))
|
||||
|
||||
(add-css-information-to-doc options ssdoc doc)
|
||||
|
||||
(let ((t (gnc:make-html-table)))
|
||||
;; we don't want a bevel for this table, but we don't want
|
||||
;; that to propagate
|
||||
;; we don't want a bevel for this table, but we don't want
|
||||
;; that to propagate
|
||||
(gnc:html-table-set-style!
|
||||
t "table"
|
||||
t "table"
|
||||
'attribute (list "border" 0)
|
||||
'inheritable? #f)
|
||||
|
||||
@@ -339,18 +339,18 @@
|
||||
(doc-headline (gnc:html-document-headline doc))
|
||||
(headline (if (eq? doc-headline #f) title doc-headline)))
|
||||
|
||||
; set the header column to be the 2nd when we have a logo
|
||||
; do this so that when logo is not present, the document
|
||||
; is perfectly centered
|
||||
(if (and logopixmap (> (string-length logopixmap) 0))
|
||||
(set! headcolumn 1))
|
||||
; set the header column to be the 2nd when we have a logo
|
||||
; do this so that when logo is not present, the document
|
||||
; is perfectly centered
|
||||
(if (and logopixmap (> (string-length logopixmap) 0))
|
||||
(set! headcolumn 1))
|
||||
|
||||
(gnc:html-table-set-cell!
|
||||
(gnc:html-table-set-cell!
|
||||
t 1 headcolumn
|
||||
(if show-preparer?
|
||||
;; title plus preparer info
|
||||
(if show-preparer?
|
||||
;; title plus preparer info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-h3 headline)
|
||||
(gnc:html-markup-h3 headline)
|
||||
(gnc:html-markup-br)
|
||||
(_ "Prepared by: ")
|
||||
(gnc:html-markup-b preparer)
|
||||
@@ -362,48 +362,48 @@
|
||||
(qof-print-date
|
||||
(current-time)))
|
||||
|
||||
;; title only
|
||||
;; title only
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-h3 headline))))
|
||||
)
|
||||
|
||||
|
||||
(if (and logopixmap
|
||||
(not (string=? logopixmap "")))
|
||||
;; check for logo image file name non blank
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 0
|
||||
(not (string=? logopixmap "")))
|
||||
;; check for logo image file name non blank
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 0
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-img (make-file-url logopixmap)))) )
|
||||
(gnc:html-markup-img (make-file-url logopixmap)))) )
|
||||
|
||||
(if (and headpixmap
|
||||
(not (string=? headpixmap "")))
|
||||
;; check for header image file name nonblank
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
(not (string=? headpixmap "")))
|
||||
;; check for header image file name nonblank
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text
|
||||
;; XX: isn't there some way to apply the alignment to
|
||||
;; (gnc:html-markup-img headpixmap)?
|
||||
(string-append
|
||||
"<div align=\"" align "\">"
|
||||
"<img src=\"" (make-file-url headpixmap) "\">"
|
||||
"</div>")))
|
||||
)
|
||||
(gnc:html-table-set-cell!
|
||||
;; XX: isn't there some way to apply the alignment to
|
||||
;; (gnc:html-markup-img headpixmap)?
|
||||
(string-append
|
||||
"<div align=\"" align "\">"
|
||||
"<img src=\"" (make-file-url headpixmap) "\">"
|
||||
"</div>")))
|
||||
)
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text " ")))
|
||||
|
||||
(apply
|
||||
gnc:html-table-set-cell!
|
||||
(apply
|
||||
gnc:html-table-set-cell!
|
||||
t 2 headcolumn
|
||||
(gnc:html-document-objects doc))
|
||||
|
||||
|
||||
(gnc:html-document-add-object! ssdoc t))
|
||||
(gnc:html-document-add-object! ssdoc
|
||||
(gnc:make-html-text "</center>")) ;;TODO: make this a div instead of <center> (deprecated)
|
||||
(gnc:make-html-text "</center>")) ;;TODO: make this a div instead of <center> (deprecated)
|
||||
ssdoc))
|
||||
|
||||
(gnc:define-html-style-sheet
|
||||
(gnc:define-html-style-sheet
|
||||
'version 1.01
|
||||
'name (N_ "Fancy")
|
||||
'renderer fancy-renderer
|
||||
|
||||
@@ -4,23 +4,23 @@
|
||||
;;
|
||||
;; Copyright 2004 James Strandboge <jstrand1@rochester.rr.com>
|
||||
;;
|
||||
;; 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.
|
||||
;;
|
||||
;; 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
|
||||
;;
|
||||
;;
|
||||
;; Based on work from:
|
||||
;; stylesheet-header.scm
|
||||
;; Copyright 2000 Bill Gribble <grib@gnumatic.com>
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
(define-module (gnucash report stylesheet-footer))
|
||||
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash gettext))
|
||||
|
||||
@@ -43,34 +43,34 @@
|
||||
|
||||
(define (footer-options)
|
||||
(let* ((options (gnc:new-options))
|
||||
(opt-register
|
||||
(lambda (opt)
|
||||
(gnc:register-option options opt))))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(lambda (opt)
|
||||
(gnc:register-option options opt))))
|
||||
(opt-register
|
||||
(gnc:make-string-option
|
||||
(N_ "General")
|
||||
(N_ "Preparer") "a"
|
||||
(N_ "Name of person preparing the report.")
|
||||
(N_ "Name of person preparing the report.")
|
||||
""))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(gnc:make-string-option
|
||||
(N_ "General")
|
||||
(N_ "Prepared for") "b"
|
||||
(N_ "Name of organization or company prepared for.")
|
||||
(N_ "Name of organization or company prepared for.")
|
||||
""))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(gnc:make-simple-boolean-option
|
||||
(N_ "General")
|
||||
(N_ "Show preparer info") "c"
|
||||
(N_ "Name of organization or company.")
|
||||
(N_ "Name of organization or company.")
|
||||
#f))
|
||||
(opt-register
|
||||
(opt-register
|
||||
(gnc:make-simple-boolean-option
|
||||
(N_ "General")
|
||||
(N_ "Enable Links") "d"
|
||||
(N_ "Enable hyperlinks in reports.")
|
||||
(N_ "Enable hyperlinks in reports.")
|
||||
#t))
|
||||
; FIXME: put this in a more sensible tab like Text or Header/Footer
|
||||
;; FIXME: put this in a more sensible tab like Text or Header/Footer
|
||||
(opt-register
|
||||
(gnc:make-text-option
|
||||
(N_ "General")
|
||||
@@ -95,14 +95,14 @@
|
||||
(N_ "Heading Alignment") "c" (N_ "Banner for top of report.")
|
||||
'left
|
||||
(list (vector 'left
|
||||
(N_ "Left")
|
||||
(N_ "Align the banner to the left."))
|
||||
(N_ "Left")
|
||||
(N_ "Align the banner to the left."))
|
||||
(vector 'center
|
||||
(N_ "Center")
|
||||
(N_ "Align the banner in the center."))
|
||||
(N_ "Center")
|
||||
(N_ "Align the banner in the center."))
|
||||
(vector 'right
|
||||
(N_ "Right")
|
||||
(N_ "Align the banner to the right."))
|
||||
(N_ "Right")
|
||||
(N_ "Align the banner to the right."))
|
||||
)))
|
||||
(opt-register
|
||||
(gnc:make-pixmap-option
|
||||
@@ -115,14 +115,14 @@
|
||||
(N_ "Colors")
|
||||
(N_ "Background Color") "a" (N_ "General background color for report.")
|
||||
(list #xff #xff #xff #xff)
|
||||
255 #f))
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
(N_ "Colors")
|
||||
(N_ "Text Color") "b" (N_ "Normal body text color.")
|
||||
(list #x00 #x00 #x00 #xff)
|
||||
255 #f))
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
@@ -136,7 +136,7 @@
|
||||
(N_ "Colors")
|
||||
(N_ "Table Cell Color") "c" (N_ "Default background for table cells.")
|
||||
(list #xff #xff #xff #xff)
|
||||
255 #f))
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
@@ -170,20 +170,20 @@
|
||||
(list #xff #xff #x00 #xff)
|
||||
255 #f))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table cell spacing") "a" (N_ "Space between table cells.")
|
||||
1 0 20 0 1))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table cell padding") "b" (N_ "Space between table cell edge and content.")
|
||||
1 0 20 0 1))
|
||||
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table border width") "c" (N_ "Bevel depth on tables.")
|
||||
1 0 20 0 1))
|
||||
@@ -193,48 +193,48 @@
|
||||
|
||||
(define (footer-renderer options doc)
|
||||
(let* ((ssdoc (gnc:make-html-document))
|
||||
(opt-val
|
||||
(lambda (section name)
|
||||
(gnc:option-value
|
||||
(gnc:lookup-option options section name))))
|
||||
(color-val
|
||||
(lambda (section name)
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options section name))))
|
||||
(preparer (opt-val (N_ "General") (N_ "Preparer")))
|
||||
(prepared-for (opt-val (N_ "General") (N_ "Prepared for")))
|
||||
(show-preparer? (opt-val (N_ "General") (N_ "Show preparer info")))
|
||||
(links? (opt-val (N_ "General") (N_ "Enable Links")))
|
||||
(footer-text (opt-val (N_ "General") (N_ "Footer")))
|
||||
(bgcolor (color-val (N_ "Colors") (N_ "Background Color")))
|
||||
(textcolor (color-val (N_ "Colors") (N_ "Text Color")))
|
||||
(linkcolor (color-val (N_ "Colors") (N_ "Link Color")))
|
||||
(normal-row-color (color-val (N_ "Colors") (N_ "Table Cell Color")))
|
||||
(alternate-row-color (color-val (N_ "Colors")
|
||||
(N_ "Alternate Table Cell Color")))
|
||||
(primary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Subheading/Subtotal Cell Color")))
|
||||
(secondary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Sub-subheading/total Cell Color")))
|
||||
(grand-total-color (color-val (N_ "Colors")
|
||||
(N_ "Grand Total Cell Color")))
|
||||
(bgpixmap (opt-val (N_ "Images") (N_ "Background Tile")))
|
||||
(headpixmap (opt-val (N_ "Images") (N_ "Heading Banner")))
|
||||
(logopixmap (opt-val (N_ "Images") (N_ "Logo")))
|
||||
(opt-val
|
||||
(lambda (section name)
|
||||
(gnc:option-value
|
||||
(gnc:lookup-option options section name))))
|
||||
(color-val
|
||||
(lambda (section name)
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options section name))))
|
||||
(preparer (opt-val (N_ "General") (N_ "Preparer")))
|
||||
(prepared-for (opt-val (N_ "General") (N_ "Prepared for")))
|
||||
(show-preparer? (opt-val (N_ "General") (N_ "Show preparer info")))
|
||||
(links? (opt-val (N_ "General") (N_ "Enable Links")))
|
||||
(footer-text (opt-val (N_ "General") (N_ "Footer")))
|
||||
(bgcolor (color-val (N_ "Colors") (N_ "Background Color")))
|
||||
(textcolor (color-val (N_ "Colors") (N_ "Text Color")))
|
||||
(linkcolor (color-val (N_ "Colors") (N_ "Link Color")))
|
||||
(normal-row-color (color-val (N_ "Colors") (N_ "Table Cell Color")))
|
||||
(alternate-row-color (color-val (N_ "Colors")
|
||||
(N_ "Alternate Table Cell Color")))
|
||||
(primary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Subheading/Subtotal Cell Color")))
|
||||
(secondary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Sub-subheading/total Cell Color")))
|
||||
(grand-total-color (color-val (N_ "Colors")
|
||||
(N_ "Grand Total Cell Color")))
|
||||
(bgpixmap (opt-val (N_ "Images") (N_ "Background Tile")))
|
||||
(headpixmap (opt-val (N_ "Images") (N_ "Heading Banner")))
|
||||
(logopixmap (opt-val (N_ "Images") (N_ "Logo")))
|
||||
(align (gnc:value->string(opt-val (N_ "Images") (N_ "Heading Alignment"))))
|
||||
(spacing (opt-val (N_ "Tables") (N_ "Table cell spacing")))
|
||||
(padding (opt-val (N_ "Tables") (N_ "Table cell padding")))
|
||||
(border (opt-val (N_ "Tables") (N_ "Table border width")))
|
||||
(spacing (opt-val (N_ "Tables") (N_ "Table cell spacing")))
|
||||
(padding (opt-val (N_ "Tables") (N_ "Table cell padding")))
|
||||
(border (opt-val (N_ "Tables") (N_ "Table border width")))
|
||||
(headcolumn 0))
|
||||
|
||||
; center the document without elements inheriting anything
|
||||
;; center the document without elements inheriting anything
|
||||
(gnc:html-document-add-object! ssdoc
|
||||
(gnc:make-html-text "<center>"))
|
||||
(gnc:make-html-text "<center>"))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "bgcolor" bgcolor)
|
||||
'attribute (list "text" textcolor)
|
||||
'attribute (list "link" linkcolor))
|
||||
@@ -307,13 +307,13 @@
|
||||
'attribute (list "class" "centered-label-cell"))
|
||||
|
||||
(if (and bgpixmap
|
||||
(not (string=? bgpixmap "")))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "background" (make-file-url bgpixmap))))
|
||||
|
||||
(not (string=? bgpixmap "")))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "background" (make-file-url bgpixmap))))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "table"
|
||||
ssdoc "table"
|
||||
'attribute (list "border" border)
|
||||
'attribute (list "cellspacing" spacing)
|
||||
'attribute (list "cellpadding" padding))
|
||||
@@ -325,48 +325,48 @@
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "alternate-row"
|
||||
'attribute (list "bgcolor" alternate-row-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "primary-subheading"
|
||||
'attribute (list "bgcolor" primary-subheading-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "secondary-subheading"
|
||||
'attribute (list "bgcolor" secondary-subheading-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "grand-total"
|
||||
'attribute (list "bgcolor" grand-total-color)
|
||||
'tag "tr")
|
||||
'tag "tr")
|
||||
|
||||
;; don't surround marked-up links with <a> </a>
|
||||
(if (not links?)
|
||||
(gnc:html-document-set-style! ssdoc "a" 'tag ""))
|
||||
|
||||
(gnc:html-document-set-style! ssdoc "a" 'tag ""))
|
||||
|
||||
(add-css-information-to-doc options ssdoc doc)
|
||||
|
||||
(let ((t (gnc:make-html-table)))
|
||||
;; we don't want a bevel for this table, but we don't want
|
||||
;; that to propagate
|
||||
;; we don't want a bevel for this table, but we don't want
|
||||
;; that to propagate
|
||||
(gnc:html-table-set-style!
|
||||
t "table"
|
||||
t "table"
|
||||
'attribute (list "border" 0)
|
||||
'inheritable? #f)
|
||||
|
||||
; set the header column to be the 2nd when we have a logo
|
||||
; do this so that when logo is not present, the document
|
||||
; is perfectly centered
|
||||
;; set the header column to be the 2nd when we have a logo
|
||||
;; do this so that when logo is not present, the document
|
||||
;; is perfectly centered
|
||||
(if (and logopixmap (> (string-length logopixmap) 0))
|
||||
(set! headcolumn 1))
|
||||
(set! headcolumn 1))
|
||||
|
||||
(let* ((title (gnc:html-document-title doc))
|
||||
(doc-headline (gnc:html-document-headline doc))
|
||||
(headline (if (eq? doc-headline #f) title doc-headline)))
|
||||
|
||||
(gnc:html-table-set-cell!
|
||||
(gnc:html-table-set-cell!
|
||||
t 1 headcolumn
|
||||
(if show-preparer?
|
||||
;; title plus preparer info
|
||||
(if show-preparer?
|
||||
;; title plus preparer info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-h3 headline)
|
||||
(gnc:html-markup-br)
|
||||
@@ -380,47 +380,48 @@
|
||||
(qof-print-date
|
||||
(current-time)))
|
||||
|
||||
;; title only
|
||||
;; title only
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-h3 headline))))
|
||||
)
|
||||
|
||||
; only setup an image if we specified one
|
||||
|
||||
;; only setup an image if we specified one
|
||||
(if (and logopixmap (> (string-length logopixmap) 0))
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 0
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-img (make-file-url logopixmap))))))
|
||||
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 0
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-img (make-file-url logopixmap))))))
|
||||
|
||||
(if (and headpixmap (> (string-length headpixmap) 0))
|
||||
(begin
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text
|
||||
(string-append
|
||||
"<div align=\"" align "\">"
|
||||
"<img src=\"" (make-file-url headpixmap) "\">"
|
||||
"</div>")))
|
||||
)
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text
|
||||
(string-append
|
||||
"<div align=\"" align "\">"
|
||||
"<img src=\"" (make-file-url headpixmap) "\">"
|
||||
"</div>")))
|
||||
)
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text " ")))
|
||||
|
||||
(apply
|
||||
gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text " ")))
|
||||
|
||||
(apply
|
||||
gnc:html-table-set-cell!
|
||||
t 2 headcolumn
|
||||
(gnc:html-document-objects doc))
|
||||
(gnc:html-document-add-object! ssdoc t)
|
||||
|
||||
; I think this is the correct place to put the footer
|
||||
(gnc:html-table-set-cell!
|
||||
;; I think this is the correct place to put the footer
|
||||
(gnc:html-table-set-cell!
|
||||
t 3 headcolumn
|
||||
(gnc:make-html-text footer-text)))
|
||||
(gnc:html-document-add-object! ssdoc (gnc:make-html-text "</center>")) ;;TODO: make this a div instead of <center> (deprecated)
|
||||
(gnc:html-document-add-object! ssdoc (gnc:make-html-text "</center>"))
|
||||
;;TODO: make this a div instead of <center> (deprecated)
|
||||
ssdoc))
|
||||
|
||||
(gnc:define-html-style-sheet
|
||||
(gnc:define-html-style-sheet
|
||||
'version 1
|
||||
'name (N_ "Footer")
|
||||
'renderer footer-renderer
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
(define-module (gnucash report stylesheet-head-or-tail))
|
||||
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash core-utils)) ; for gnc:version
|
||||
(use-modules (gnucash gettext))
|
||||
@@ -45,9 +45,9 @@
|
||||
|
||||
(define (head-or-tail-options)
|
||||
(let* ((options (gnc:new-options))
|
||||
(opt-register
|
||||
(lambda (opt)
|
||||
(gnc:register-option options opt))))
|
||||
(opt-register
|
||||
(lambda (opt)
|
||||
(gnc:register-option options opt))))
|
||||
(opt-register
|
||||
(gnc:make-string-option
|
||||
(N_ "General")
|
||||
@@ -96,7 +96,7 @@
|
||||
(N_ "Enable Links") "h"
|
||||
(N_ "Enable hyperlinks in reports.")
|
||||
#t))
|
||||
; FIXME: put this in a more sensible tab like Text or Header/Footer
|
||||
;; FIXME: put this in a more sensible tab like Text or Header/Footer
|
||||
(opt-register
|
||||
(gnc:make-text-option
|
||||
(N_ "General")
|
||||
@@ -151,14 +151,14 @@
|
||||
(N_ "Heading Alignment") "c" (N_ "Banner for top of report.")
|
||||
'left
|
||||
(list (vector 'left
|
||||
(N_ "Left")
|
||||
(N_ "Align the banner to the left."))
|
||||
(N_ "Left")
|
||||
(N_ "Align the banner to the left."))
|
||||
(vector 'center
|
||||
(N_ "Center")
|
||||
(N_ "Align the banner in the center."))
|
||||
(N_ "Center")
|
||||
(N_ "Align the banner in the center."))
|
||||
(vector 'right
|
||||
(N_ "Right")
|
||||
(N_ "Align the banner to the right."))
|
||||
(N_ "Right")
|
||||
(N_ "Align the banner to the right."))
|
||||
)))
|
||||
(opt-register
|
||||
(gnc:make-pixmap-option
|
||||
@@ -249,54 +249,54 @@
|
||||
|
||||
(define (head-or-tail-renderer options doc)
|
||||
(let* ((ssdoc (gnc:make-html-document))
|
||||
(opt-val
|
||||
(lambda (section name)
|
||||
(gnc:option-value
|
||||
(gnc:lookup-option options section name))))
|
||||
(color-val
|
||||
(lambda (section name)
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options section name))))
|
||||
(preparer (opt-val (N_ "General") (N_ "Preparer")))
|
||||
(prepared-for (opt-val (N_ "General") (N_ "Prepared for")))
|
||||
(show-preparer? (opt-val (N_ "General") (N_ "Show preparer info")))
|
||||
(show-receiver? (opt-val (N_ "General") (N_ "Show receiver info")))
|
||||
(show-date? (opt-val (N_ "General") (N_ "Show date")))
|
||||
(show-time? (opt-val (N_ "General") (N_ "Show time in addition to date")))
|
||||
(show-gnucash-version? (opt-val (N_ "General") (N_ "Show GnuCash Version")))
|
||||
(opt-val
|
||||
(lambda (section name)
|
||||
(gnc:option-value
|
||||
(gnc:lookup-option options section name))))
|
||||
(color-val
|
||||
(lambda (section name)
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options section name))))
|
||||
(preparer (opt-val (N_ "General") (N_ "Preparer")))
|
||||
(prepared-for (opt-val (N_ "General") (N_ "Prepared for")))
|
||||
(show-preparer? (opt-val (N_ "General") (N_ "Show preparer info")))
|
||||
(show-receiver? (opt-val (N_ "General") (N_ "Show receiver info")))
|
||||
(show-date? (opt-val (N_ "General") (N_ "Show date")))
|
||||
(show-time? (opt-val (N_ "General") (N_ "Show time in addition to date")))
|
||||
(show-gnucash-version? (opt-val (N_ "General") (N_ "Show GnuCash Version")))
|
||||
(show-preparer-at-bottom? (opt-val (N_ "General") (N_ "Show preparer info at bottom")))
|
||||
(show-receiver-at-bottom? (opt-val (N_ "General") (N_ "Show receiver info at bottom")))
|
||||
(show-date-time-at-bottom? (opt-val (N_ "General") (N_ "Show date/time at bottom")))
|
||||
(show-comments-at-bottom? (opt-val (N_ "General") (N_ "Show comments at bottom")))
|
||||
(show-gnucash-version-at-bottom? (opt-val (N_ "General") (N_ "Show GnuCash version at bottom")))
|
||||
(links? (opt-val (N_ "General") (N_ "Enable Links")))
|
||||
(additional-comments (opt-val (N_ "General") (N_ "Additional Comments")))
|
||||
(bgcolor (color-val (N_ "Colors") (N_ "Background Color")))
|
||||
(textcolor (color-val (N_ "Colors") (N_ "Text Color")))
|
||||
(linkcolor (color-val (N_ "Colors") (N_ "Link Color")))
|
||||
(normal-row-color (color-val (N_ "Colors") (N_ "Table Cell Color")))
|
||||
(alternate-row-color (color-val (N_ "Colors")
|
||||
(N_ "Alternate Table Cell Color")))
|
||||
(primary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Subheading/Subtotal Cell Color")))
|
||||
(secondary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Sub-subheading/total Cell Color")))
|
||||
(grand-total-color (color-val (N_ "Colors")
|
||||
(N_ "Grand Total Cell Color")))
|
||||
(bgpixmap (opt-val (N_ "Images") (N_ "Background Tile")))
|
||||
(headpixmap (opt-val (N_ "Images") (N_ "Heading Banner")))
|
||||
(logopixmap (opt-val (N_ "Images") (N_ "Logo")))
|
||||
(links? (opt-val (N_ "General") (N_ "Enable Links")))
|
||||
(additional-comments (opt-val (N_ "General") (N_ "Additional Comments")))
|
||||
(bgcolor (color-val (N_ "Colors") (N_ "Background Color")))
|
||||
(textcolor (color-val (N_ "Colors") (N_ "Text Color")))
|
||||
(linkcolor (color-val (N_ "Colors") (N_ "Link Color")))
|
||||
(normal-row-color (color-val (N_ "Colors") (N_ "Table Cell Color")))
|
||||
(alternate-row-color (color-val (N_ "Colors")
|
||||
(N_ "Alternate Table Cell Color")))
|
||||
(primary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Subheading/Subtotal Cell Color")))
|
||||
(secondary-subheading-color
|
||||
(color-val (N_ "Colors")
|
||||
(N_ "Sub-subheading/total Cell Color")))
|
||||
(grand-total-color (color-val (N_ "Colors")
|
||||
(N_ "Grand Total Cell Color")))
|
||||
(bgpixmap (opt-val (N_ "Images") (N_ "Background Tile")))
|
||||
(headpixmap (opt-val (N_ "Images") (N_ "Heading Banner")))
|
||||
(logopixmap (opt-val (N_ "Images") (N_ "Logo")))
|
||||
(align (gnc:value->string(opt-val (N_ "Images") (N_ "Heading Alignment"))))
|
||||
(spacing (opt-val (N_ "Tables") (N_ "Table cell spacing")))
|
||||
(padding (opt-val (N_ "Tables") (N_ "Table cell padding")))
|
||||
(border (opt-val (N_ "Tables") (N_ "Table border width")))
|
||||
(spacing (opt-val (N_ "Tables") (N_ "Table cell spacing")))
|
||||
(padding (opt-val (N_ "Tables") (N_ "Table cell padding")))
|
||||
(border (opt-val (N_ "Tables") (N_ "Table border width")))
|
||||
(headcolumn 0))
|
||||
|
||||
; center the document without elements inheriting anything
|
||||
;; center the document without elements inheriting anything
|
||||
(gnc:html-document-add-object! ssdoc
|
||||
(gnc:make-html-text "<center>"))
|
||||
(gnc:make-html-text "<center>"))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
@@ -372,10 +372,10 @@
|
||||
'attribute (list "class" "centered-label-cell"))
|
||||
|
||||
(if (and bgpixmap
|
||||
(not (string=? bgpixmap "")))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "background" (make-file-url bgpixmap))))
|
||||
(not (string=? bgpixmap "")))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "background" (make-file-url bgpixmap))))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "table"
|
||||
@@ -406,7 +406,7 @@
|
||||
|
||||
;; don't surround marked-up links with <a> </a>
|
||||
(if (not links?)
|
||||
(gnc:html-document-set-style! ssdoc "a" 'tag ""))
|
||||
(gnc:html-document-set-style! ssdoc "a" 'tag ""))
|
||||
|
||||
(add-css-information-to-doc options ssdoc doc)
|
||||
|
||||
@@ -418,122 +418,122 @@
|
||||
'attribute (list "border" 0)
|
||||
'inheritable? #f)
|
||||
|
||||
; set the header column to be the 2nd when we have a logo
|
||||
; do this so that when logo is not present, the document
|
||||
; is perfectly centered
|
||||
;; set the header column to be the 2nd when we have a logo
|
||||
;; do this so that when logo is not present, the document
|
||||
;; is perfectly centered
|
||||
(if (and logopixmap (> (string-length logopixmap) 0))
|
||||
(set! headcolumn 1))
|
||||
(set! headcolumn 1))
|
||||
|
||||
(let* ((title (gnc:html-document-title doc))
|
||||
(doc-headline (gnc:html-document-headline doc))
|
||||
(headline (if (eq? doc-headline #f) title doc-headline)))
|
||||
|
||||
(gnc:html-table-set-cell!
|
||||
t 1 headcolumn
|
||||
;; print title
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-h3 headline))
|
||||
(if (and show-preparer? (not show-preparer-at-bottom?))
|
||||
;; print preparer info as additional header info
|
||||
(gnc:make-html-text
|
||||
t 1 headcolumn
|
||||
;; print title
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-h3 headline))
|
||||
(if (and show-preparer? (not show-preparer-at-bottom?))
|
||||
;; print preparer info as additional header info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Prepared by: ")
|
||||
(gnc:html-markup-b preparer)
|
||||
)
|
||||
(_ "Prepared by: ")
|
||||
(gnc:html-markup-b preparer)
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-receiver? (not show-receiver-at-bottom?))
|
||||
;; print receiver info as additional header info
|
||||
(gnc:make-html-text
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-receiver? (not show-receiver-at-bottom?))
|
||||
;; print receiver info as additional header info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Prepared for: ")
|
||||
(gnc:html-markup-b prepared-for)
|
||||
(gnc:html-markup-br)
|
||||
(_ "Prepared for: ")
|
||||
(gnc:html-markup-b prepared-for)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-date? (not show-date-time-at-bottom?))
|
||||
;; print date/time info as additional header info
|
||||
(if show-time?
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Report Creation Date: ")
|
||||
(qof-print-date (gnc:get-today))
|
||||
" "
|
||||
(strftime "%X %Z" (localtime (current-time)))
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Report Creation Date: ")
|
||||
(qof-print-date (gnc:get-today))
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-gnucash-version? (not show-gnucash-version-at-bottom?))
|
||||
;; print the GnuCash version string as additional header info
|
||||
(gnc:make-html-text
|
||||
" "
|
||||
)
|
||||
(if (and show-date? (not show-date-time-at-bottom?))
|
||||
;; print date/time info as additional header info
|
||||
(if show-time?
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Report Creation Date: ")
|
||||
(qof-print-date (gnc:get-today))
|
||||
" "
|
||||
(strftime "%X %Z" (localtime (current-time)))
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Report Creation Date: ")
|
||||
(qof-print-date (gnc:get-today))
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-gnucash-version? (not show-gnucash-version-at-bottom?))
|
||||
;; print the GnuCash version string as additional header info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
"GnuCash "
|
||||
gnc:version
|
||||
)
|
||||
"GnuCash "
|
||||
gnc:version
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (not show-comments-at-bottom?)
|
||||
;; print additional comments as additional header info
|
||||
(gnc:make-html-text
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (not show-comments-at-bottom?)
|
||||
;; print additional comments as additional header info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-br)
|
||||
(gnc:html-markup-i additional-comments)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
" "
|
||||
)
|
||||
;; add separator line if any additional header info is printed
|
||||
(if (or
|
||||
(and show-preparer? (not show-preparer-at-bottom?))
|
||||
(and show-receiver? (not show-receiver-at-bottom?))
|
||||
(and show-date? (not show-date-time-at-bottom?))
|
||||
(and show-gnucash-version? (not show-gnucash-version-at-bottom?))
|
||||
(not show-comments-at-bottom?)
|
||||
)
|
||||
(gnc:make-html-text
|
||||
" "
|
||||
)
|
||||
;; add separator line if any additional header info is printed
|
||||
(if (or
|
||||
(and show-preparer? (not show-preparer-at-bottom?))
|
||||
(and show-receiver? (not show-receiver-at-bottom?))
|
||||
(and show-date? (not show-date-time-at-bottom?))
|
||||
(and show-gnucash-version? (not show-gnucash-version-at-bottom?))
|
||||
(not show-comments-at-bottom?)
|
||||
)
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
" "
|
||||
)
|
||||
)
|
||||
" "
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
; only setup an image if we specified one
|
||||
;; only setup an image if we specified one
|
||||
(if (and logopixmap (> (string-length logopixmap) 0))
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 0
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-img (make-file-url logopixmap))))))
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 0
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-img (make-file-url logopixmap))))))
|
||||
|
||||
(if (and headpixmap (> (string-length headpixmap) 0))
|
||||
(begin
|
||||
(begin
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text
|
||||
(string-append
|
||||
"<div align=\"" align "\">"
|
||||
"<img src=\"" (make-file-url headpixmap) "\">"
|
||||
"</div>")))
|
||||
)
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text
|
||||
(string-append
|
||||
"<div align=\"" align "\">"
|
||||
"<img src=\"" (make-file-url headpixmap) "\">"
|
||||
"</div>")))
|
||||
)
|
||||
(gnc:html-table-set-cell!
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text " ")))
|
||||
t 0 headcolumn
|
||||
(gnc:make-html-text " ")))
|
||||
|
||||
(apply
|
||||
gnc:html-table-set-cell!
|
||||
@@ -541,88 +541,88 @@
|
||||
(gnc:html-document-objects doc))
|
||||
(gnc:html-document-add-object! ssdoc t)
|
||||
|
||||
; I think this is the correct place to put the footer
|
||||
(gnc:html-table-set-cell!
|
||||
;; I think this is the correct place to put the footer
|
||||
(gnc:html-table-set-cell!
|
||||
t 3 headcolumn
|
||||
;;(gnc:make-html-text additional-comments)
|
||||
;; add separator line if any additional header info is printed
|
||||
(if (or
|
||||
(and show-preparer? show-preparer-at-bottom?)
|
||||
(and show-receiver? show-receiver-at-bottom?)
|
||||
(and show-date? show-date-time-at-bottom?)
|
||||
(and show-gnucash-version? show-gnucash-version-at-bottom?)
|
||||
show-comments-at-bottom?
|
||||
;; add separator line if any additional header info is printed
|
||||
(if (or
|
||||
(and show-preparer? show-preparer-at-bottom?)
|
||||
(and show-receiver? show-receiver-at-bottom?)
|
||||
(and show-date? show-date-time-at-bottom?)
|
||||
(and show-gnucash-version? show-gnucash-version-at-bottom?)
|
||||
show-comments-at-bottom?
|
||||
)
|
||||
(gnc:make-html-text
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-preparer? show-preparer-at-bottom?)
|
||||
;; print preparer info as additional header info
|
||||
(gnc:make-html-text
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-preparer? show-preparer-at-bottom?)
|
||||
;; print preparer info as additional header info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Prepared by: ")
|
||||
(gnc:html-markup-b preparer)
|
||||
)
|
||||
(_ "Prepared by: ")
|
||||
(gnc:html-markup-b preparer)
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-receiver? show-receiver-at-bottom?)
|
||||
;; print receiver info as additional header info
|
||||
(gnc:make-html-text
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-receiver? show-receiver-at-bottom?)
|
||||
;; print receiver info as additional header info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Prepared for: ")
|
||||
(gnc:html-markup-b prepared-for)
|
||||
)
|
||||
(_ "Prepared for: ")
|
||||
(gnc:html-markup-b prepared-for)
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-date? show-date-time-at-bottom?)
|
||||
;; print date/time info as additional header info
|
||||
(if show-time?
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Report Creation Date: ")
|
||||
(qof-print-date (gnc:get-today))
|
||||
" "
|
||||
(strftime "%X %Z" (localtime (current-time)))
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Report Creation Date: ")
|
||||
(qof-print-date (gnc:get-today))
|
||||
" "
|
||||
)
|
||||
(if (and show-date? show-date-time-at-bottom?)
|
||||
;; print date/time info as additional header info
|
||||
(if show-time?
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Report Creation Date: ")
|
||||
(qof-print-date (gnc:get-today))
|
||||
" "
|
||||
(strftime "%X %Z" (localtime (current-time)))
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-gnucash-version? show-gnucash-version-at-bottom?)
|
||||
;; print the GnuCash version string as additional header info
|
||||
(gnc:make-html-text
|
||||
)
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "Report Creation Date: ")
|
||||
(qof-print-date (gnc:get-today))
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if (and show-gnucash-version? show-gnucash-version-at-bottom?)
|
||||
;; print the GnuCash version string as additional header info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i
|
||||
(_ "GnuCash ")
|
||||
gnc:version
|
||||
(_ "GnuCash ")
|
||||
gnc:version
|
||||
)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if show-comments-at-bottom?
|
||||
;; print additional comments as additional header info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
" "
|
||||
)
|
||||
(if show-comments-at-bottom?
|
||||
;; print additional comments as additional header info
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-i additional-comments)
|
||||
(gnc:html-markup-br)
|
||||
(gnc:html-markup-i additional-comments)
|
||||
(gnc:html-markup-br)
|
||||
)
|
||||
" "
|
||||
)
|
||||
))
|
||||
)
|
||||
" "
|
||||
)
|
||||
))
|
||||
(gnc:html-document-add-object! ssdoc (gnc:make-html-text "</center>")) ;;TODO: make this a div instead of <center> (deprecated)
|
||||
ssdoc))
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
(define-module (gnucash report stylesheet-plain))
|
||||
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash core-utils))
|
||||
(use-modules (gnucash gettext))
|
||||
@@ -39,89 +39,82 @@
|
||||
;; it's supposed to be lightweight and unobtrusive.
|
||||
(define (plain-options)
|
||||
(let* ((options (gnc:new-options))
|
||||
(opt-register
|
||||
(lambda (opt)
|
||||
(gnc:register-option options opt))))
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
(N_ "General")
|
||||
(N_ "Background Color") "a" (N_ "Background color for reports.")
|
||||
(list #xff #xff #xff #xff)
|
||||
255 #f))
|
||||
(opt-register
|
||||
(gnc:make-pixmap-option
|
||||
(N_ "General")
|
||||
(N_ "Background Pixmap") "b" (N_ "Background tile for reports.")
|
||||
""))
|
||||
(opt-register
|
||||
(gnc:make-simple-boolean-option
|
||||
(N_ "General")
|
||||
(N_ "Enable Links") "c" (N_ "Enable hyperlinks in reports.")
|
||||
#t))
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
(N_ "Colors")
|
||||
(N_ "Alternate Table Cell Color") "a" (N_ "Background color for alternate lines.")
|
||||
(list #xff #xff #xff #xff)
|
||||
255 #f))
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table cell spacing") "a" (N_ "Space between table cells.")
|
||||
0 0 20 0 1))
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table cell padding") "b" (N_ "Space between table cell edge and content.")
|
||||
4 0 20 0 1))
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table border width") "c" (N_ "Bevel depth on tables.")
|
||||
0 0 20 0 1))
|
||||
(register-font-options options)
|
||||
(lambda (opt)
|
||||
(gnc:register-option options opt))))
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
(N_ "General")
|
||||
(N_ "Background Color") "a" (N_ "Background color for reports.")
|
||||
(list #xff #xff #xff #xff)
|
||||
255 #f))
|
||||
(opt-register
|
||||
(gnc:make-pixmap-option
|
||||
(N_ "General")
|
||||
(N_ "Background Pixmap") "b" (N_ "Background tile for reports.")
|
||||
""))
|
||||
(opt-register
|
||||
(gnc:make-simple-boolean-option
|
||||
(N_ "General")
|
||||
(N_ "Enable Links") "c" (N_ "Enable hyperlinks in reports.")
|
||||
#t))
|
||||
(opt-register
|
||||
(gnc:make-color-option
|
||||
(N_ "Colors")
|
||||
(N_ "Alternate Table Cell Color") "a" (N_ "Background color for alternate lines.")
|
||||
(list #xff #xff #xff #xff)
|
||||
255 #f))
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table cell spacing") "a" (N_ "Space between table cells.")
|
||||
0 0 20 0 1))
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table cell padding") "b" (N_ "Space between table cell edge and content.")
|
||||
4 0 20 0 1))
|
||||
(opt-register
|
||||
(gnc:make-number-range-option
|
||||
(N_ "Tables")
|
||||
(N_ "Table border width") "c" (N_ "Bevel depth on tables.")
|
||||
0 0 20 0 1))
|
||||
(register-font-options options)
|
||||
|
||||
options))
|
||||
options))
|
||||
|
||||
(define (plain-renderer options doc)
|
||||
(let*
|
||||
((ssdoc (gnc:make-html-document))
|
||||
(opt-val
|
||||
(lambda (section name)
|
||||
(gnc:option-value
|
||||
(gnc:lookup-option options section name))))
|
||||
(bgcolor
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options
|
||||
"General"
|
||||
"Background Color")))
|
||||
(bgpixmap (opt-val "General" "Background Pixmap"))
|
||||
(links? (opt-val "General" "Enable Links"))
|
||||
(alternate-row-color
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options
|
||||
"Colors"
|
||||
"Alternate Table Cell Color")))
|
||||
(spacing (opt-val "Tables" "Table cell spacing"))
|
||||
(padding (opt-val "Tables" "Table cell padding"))
|
||||
(border (opt-val "Tables" "Table border width"))
|
||||
)
|
||||
(define (opt-val section name)
|
||||
(gnc:option-value
|
||||
(gnc:lookup-option options section name)))
|
||||
(let* ((ssdoc (gnc:make-html-document))
|
||||
(bgcolor
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options "General" "Background Color")))
|
||||
(bgpixmap (opt-val "General" "Background Pixmap"))
|
||||
(links? (opt-val "General" "Enable Links"))
|
||||
(alternate-row-color
|
||||
(gnc:color-option->html
|
||||
(gnc:lookup-option options "Colors" "Alternate Table Cell Color")))
|
||||
(spacing (opt-val "Tables" "Table cell spacing"))
|
||||
(padding (opt-val "Tables" "Table cell padding"))
|
||||
(border (opt-val "Tables" "Table border width")))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "bgcolor" bgcolor))
|
||||
|
||||
(if (and bgpixmap
|
||||
(not (string=? bgpixmap "")))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "background" (make-file-url bgpixmap))))
|
||||
'attribute (list "bgcolor" bgcolor))
|
||||
|
||||
(if (and bgpixmap
|
||||
(not (string-null? bgpixmap)))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "body"
|
||||
'attribute (list "background" (make-file-url bgpixmap))))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "table"
|
||||
'attribute (list "border" border)
|
||||
'attribute (list "cellspacing" spacing)
|
||||
'attribute (list "cellpadding" padding))
|
||||
ssdoc "table"
|
||||
'attribute (list "border" border)
|
||||
'attribute (list "cellspacing" spacing)
|
||||
'attribute (list "cellpadding" padding))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "column-heading-left"
|
||||
@@ -189,13 +182,13 @@
|
||||
'attribute (list "class" "centered-label-cell"))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "normal-row"
|
||||
'tag "tr")
|
||||
ssdoc "normal-row"
|
||||
'tag "tr")
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "alternate-row"
|
||||
'tag "tr"
|
||||
'attribute (list "bgcolor" alternate-row-color))
|
||||
ssdoc "alternate-row"
|
||||
'tag "tr"
|
||||
'attribute (list "bgcolor" alternate-row-color))
|
||||
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "primary-subheading"
|
||||
@@ -212,24 +205,21 @@
|
||||
|
||||
;; don't surround marked-up links with <a> </a>
|
||||
(if (not links?)
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "a"
|
||||
'tag ""))
|
||||
(gnc:html-document-set-style!
|
||||
ssdoc "a"
|
||||
'tag ""))
|
||||
|
||||
(add-css-information-to-doc options ssdoc doc)
|
||||
|
||||
(let* ((title (gnc:html-document-title doc))
|
||||
(doc-headline (gnc:html-document-headline doc))
|
||||
(headline (if (eq? doc-headline #f)
|
||||
title doc-headline)))
|
||||
(let ((headline (or (gnc:html-document-headline doc)
|
||||
(gnc:html-document-title doc))))
|
||||
(if headline
|
||||
(gnc:html-document-add-object!
|
||||
ssdoc
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-h3 headline)))))
|
||||
(gnc:html-document-add-object!
|
||||
ssdoc
|
||||
(gnc:make-html-text
|
||||
(gnc:html-markup-h3 headline)))))
|
||||
|
||||
(gnc:html-document-append-objects! ssdoc
|
||||
(gnc:html-document-objects doc))
|
||||
(gnc:html-document-append-objects! ssdoc (gnc:html-document-objects doc))
|
||||
|
||||
ssdoc))
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
;; stylesheets.scm
|
||||
;; load the standard stylesheet definitions
|
||||
;;
|
||||
;; Copyright (c) 2001 Linux Developers Group, Inc.
|
||||
;; Copyright (c) 2001 Linux Developers Group, Inc.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; This program is free software; you can redistribute it and/or
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
(define-module (gnucash report stylesheets))
|
||||
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash report stylesheet-plain))
|
||||
(use-modules (gnucash report stylesheet-fancy))
|
||||
(use-modules (gnucash report stylesheet-footer))
|
||||
|
||||
@@ -809,7 +809,7 @@ static void gnc_gsettings_migrate_from_gconf (void)
|
||||
command = g_strconcat ("(use-modules (migrate-prefs))(migration-prepare \"",
|
||||
base_dir, "\")", NULL);
|
||||
DEBUG ("command = %s", command);
|
||||
migration_ok = scm_is_true (scm_c_eval_string (command));
|
||||
migration_ok = scm_is_true (scm_eval_string (scm_from_utf8_string (command)));
|
||||
g_free (command);
|
||||
if (!migration_ok)
|
||||
{
|
||||
@@ -867,7 +867,7 @@ static void gnc_gsettings_migrate_from_gconf (void)
|
||||
command = g_strconcat ("(use-modules (migrate-prefs))(migration-cleanup \"",
|
||||
base_dir, "\")", NULL);
|
||||
DEBUG ("command = %s", command);
|
||||
migration_ok = scm_is_true (scm_c_eval_string (command));
|
||||
migration_ok = scm_is_true (scm_eval_string (scm_from_utf8_string (command)));
|
||||
g_free (command);
|
||||
if (!migration_ok) /* Cleanup step failed, not critical */
|
||||
PWARN ("Cleanup step failed. You may need to delete %s/.gnc-migration-tmp manually.", base_dir);
|
||||
|
||||
@@ -202,11 +202,9 @@ the option '~a'."))
|
||||
|
||||
|
||||
(define (gnc:restore-form-generator value->string)
|
||||
(lambda () (string-append
|
||||
"(lambda (option) "
|
||||
"(if option ((gnc:option-setter option) "
|
||||
(value->string)
|
||||
")))")))
|
||||
(lambda ()
|
||||
(string-append "(lambda (o) (if o (gnc:option-set-value o "
|
||||
(value->string) ")))")))
|
||||
|
||||
(define (gnc:value->string value)
|
||||
(format #f "~s" value))
|
||||
|
||||
@@ -55,7 +55,7 @@ test_query (Query *q, SCM val2str)
|
||||
str2 = gnc_scm_to_utf8_string (str_q);
|
||||
if (str2)
|
||||
{
|
||||
res_q = scm_c_eval_string (str2);
|
||||
res_q = scm_eval_string (str_q);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -27,51 +27,48 @@ extern "C"
|
||||
#include <boost/locale.hpp>
|
||||
#include "gnc-locale-utils.hpp"
|
||||
|
||||
/* This function addresses two separate problems: First, if we set
|
||||
* std::locale::global then all streams automagically imbue
|
||||
* themselves with it and we have to re-imbue all of the backends and
|
||||
* logging streams with std::locale::classic() so that data and log
|
||||
* files aren't localized. Second, calling std::locale("") is slow,
|
||||
* so we want to do it only once. Worse, the standard C++ library in
|
||||
* Mingw64 chokes on at least some Microsoft-style locale strings
|
||||
* (e.g. "Spanish_Spain") but libc's setlocale(LC_ALL, NULL) emits
|
||||
* them even if originally fed a Unix-style locale ("es_ES").
|
||||
/** Cache the UI locale
|
||||
*
|
||||
* The solution is this function which caches the setlocale() locale
|
||||
* the first time it's called and which uses a boost::locale
|
||||
* generator, which does know what to do with (sometimes adjusted)
|
||||
* Microsoft locale strings.
|
||||
* We don't want to set the default locale because we need
|
||||
* std::locale::classic for consistency in stored data. We also don't
|
||||
* want to call std::locale("") more than once, it's slow... and we
|
||||
* don't want to call it on MinGW32 at all because that supports only
|
||||
* std::locale::classic and throws if you try to construct anything
|
||||
* else. Boost::locale doesn't support std::locale::facet required by
|
||||
* boost::datetime (go figure).
|
||||
*
|
||||
* @return a copy of std::locale::classic() on MinGW32 and a copy of
|
||||
* the cached result of std::locale("") otherwise.
|
||||
*/
|
||||
const std::locale&
|
||||
gnc_get_locale()
|
||||
{
|
||||
static std::locale cached;
|
||||
static bool tried_already = false;
|
||||
if (!tried_already)
|
||||
{
|
||||
boost::locale::generator gen;
|
||||
tried_already = true;
|
||||
try
|
||||
{
|
||||
cached = std::locale("");
|
||||
}
|
||||
catch (const std::runtime_error& err)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
char* locale = g_win32_getlocale();
|
||||
return std::locale::classic(); // Nothing else supported.
|
||||
#else
|
||||
char* locale = g_strdup(setlocale(LC_ALL, ""));
|
||||
#endif
|
||||
static std::locale cached;
|
||||
static bool tried_already = false;
|
||||
if (!tried_already)
|
||||
{
|
||||
tried_already = true;
|
||||
try
|
||||
{
|
||||
cached = std::locale("");
|
||||
}
|
||||
catch (const std::runtime_error& err)
|
||||
{
|
||||
char* locale = g_strdup(setlocale(LC_ALL, ""));
|
||||
|
||||
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
|
||||
"Failed to create C++ default locale from"
|
||||
"%s because %s. Using the 'C' locale for C++.",
|
||||
locale, err.what());
|
||||
g_free(locale);
|
||||
cached = std::locale::classic();
|
||||
}
|
||||
}
|
||||
return cached;
|
||||
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
|
||||
"Failed to create C++ default locale from"
|
||||
"%s because %s. Using the 'C' locale for C++.",
|
||||
locale, err.what());
|
||||
g_free(locale);
|
||||
cached = std::locale::classic();
|
||||
}
|
||||
}
|
||||
return cached;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ GncInt128::GncInt128 (int64_t upper, int64_t lower, uint8_t flags) :
|
||||
m_lo {static_cast<uint64_t>(lower < 0 ? -lower : lower)}
|
||||
{
|
||||
if ((upper < 0 && lower > 0) || (upper > 0 && lower < 0))
|
||||
m_lo = (m_hi << 63) - m_lo;
|
||||
m_lo = (m_hi << 63) - m_lo;
|
||||
else
|
||||
m_lo += (m_hi << 63);
|
||||
|
||||
@@ -142,7 +142,7 @@ GncInt128::operator int64_t() const
|
||||
GncInt128::operator uint64_t() const
|
||||
{
|
||||
auto flags = get_flags(m_hi);
|
||||
if (flags & neg)
|
||||
if ((flags & neg) && !isZero()) // exclude negative zero
|
||||
throw std::underflow_error ("Can't represent negative value as uint64_t");
|
||||
if ((flags & (overflow | NaN)) || (m_hi || m_lo > UINT64_MAX))
|
||||
throw std::overflow_error ("Value to large to represent as uint64_t");
|
||||
@@ -160,14 +160,15 @@ GncInt128::cmp (const GncInt128& b) const noexcept
|
||||
return 1;
|
||||
auto hi = get_num(m_hi);
|
||||
auto bhi = get_num(b.m_hi);
|
||||
if (isZero() && b.isZero()) return 0;
|
||||
if (flags & neg)
|
||||
{
|
||||
if (!b.isNeg()) return -1;
|
||||
if (hi > bhi) return -1;
|
||||
if (hi < bhi) return 1;
|
||||
if (m_lo > b.m_lo) return -1;
|
||||
if (m_lo < b.m_lo) return 1;
|
||||
return 0;
|
||||
if (!b.isNeg()) return -1;
|
||||
if (hi > bhi) return -1;
|
||||
if (hi < bhi) return 1;
|
||||
if (m_lo > b.m_lo) return -1;
|
||||
if (m_lo < b.m_lo) return 1;
|
||||
return 0;
|
||||
}
|
||||
if (b.isNeg()) return 1;
|
||||
if (hi < bhi) return -1;
|
||||
@@ -309,9 +310,9 @@ GncInt128::operator-() const noexcept
|
||||
auto retval = *this;
|
||||
auto flags = get_flags(retval.m_hi);
|
||||
if (isNeg())
|
||||
flags ^= neg;
|
||||
flags ^= neg;
|
||||
else
|
||||
flags |= neg;
|
||||
flags |= neg;
|
||||
retval.m_hi = set_flags(retval.m_hi, flags);
|
||||
return retval;
|
||||
}
|
||||
@@ -357,7 +358,7 @@ GncInt128::operator+= (const GncInt128& b) noexcept
|
||||
if (isOverflow() || isNan())
|
||||
return *this;
|
||||
if ((isNeg () && !b.isNeg ()) || (!isNeg () && b.isNeg ()))
|
||||
return this->operator-= (-b);
|
||||
return this->operator-= (-b);
|
||||
uint64_t result = m_lo + b.m_lo;
|
||||
uint64_t carry = static_cast<int64_t>(result < m_lo); //Wrapping
|
||||
m_lo = result;
|
||||
@@ -365,7 +366,7 @@ GncInt128::operator+= (const GncInt128& b) noexcept
|
||||
auto bhi = get_num(b.m_hi);
|
||||
result = hi + bhi + carry;
|
||||
if (result < hi || result & flagmask)
|
||||
flags |= overflow;
|
||||
flags |= overflow;
|
||||
m_hi = set_flags(result, flags);
|
||||
return *this;
|
||||
}
|
||||
@@ -439,7 +440,7 @@ GncInt128::operator-= (const GncInt128& b) noexcept
|
||||
return *this;
|
||||
|
||||
if ((!isNeg() && b.isNeg()) || (isNeg() && !b.isNeg()))
|
||||
return this->operator+= (-b);
|
||||
return this->operator+= (-b);
|
||||
bool operand_bigger {abs().cmp (b.abs()) < 0};
|
||||
auto hi = get_num(m_hi);
|
||||
auto far_hi = get_num(b.m_hi);
|
||||
@@ -478,6 +479,8 @@ GncInt128::operator*= (const GncInt128& b) noexcept
|
||||
{
|
||||
/* Test for 0 first */
|
||||
auto flags = get_flags(m_hi);
|
||||
/* Handle the sign; ^ flips if b is negative */
|
||||
flags ^= (get_flags(b.m_hi) & neg);
|
||||
if (isZero() || b.isZero())
|
||||
{
|
||||
m_lo = 0;
|
||||
@@ -514,8 +517,7 @@ GncInt128::operator*= (const GncInt128& b) noexcept
|
||||
m_hi = set_flags(m_hi, flags);
|
||||
return *this;
|
||||
}
|
||||
/* Handle the sign; ^ flips if b is negative */
|
||||
flags ^= (get_flags(b.m_hi) & neg);
|
||||
|
||||
/* The trivial case */
|
||||
if (abits + bbits <= legbits)
|
||||
{
|
||||
@@ -602,6 +604,7 @@ div_multi_leg (uint64_t* u, size_t m, uint64_t* v, size_t n,
|
||||
uint64_t d {(UINT64_C(1) << sublegbits)/(v[n - 1] + UINT64_C(1))};
|
||||
uint64_t carry {UINT64_C(0)};
|
||||
bool negative {q.isNeg()};
|
||||
bool rnegative {r.isNeg()};
|
||||
for (size_t i = 0; i < m; ++i)
|
||||
{
|
||||
u[i] = u[i] * d + carry;
|
||||
@@ -689,6 +692,7 @@ div_multi_leg (uint64_t* u, size_t m, uint64_t* v, size_t n,
|
||||
r = GncInt128 ((u[3] << sublegbits) + u[2], (u[1] << sublegbits) + u[0]);
|
||||
r /= d;
|
||||
if (negative) q = -q;
|
||||
if (rnegative) r = -r;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -698,6 +702,7 @@ div_single_leg (uint64_t* u, size_t m, uint64_t v,
|
||||
uint64_t qv[sublegs] {};
|
||||
uint64_t carry {};
|
||||
bool negative {q.isNeg()};
|
||||
bool rnegative {r.isNeg()};
|
||||
for (int i = m - 1; i >= 0; --i)
|
||||
{
|
||||
qv[i] = u[i] / v;
|
||||
@@ -713,13 +718,18 @@ div_single_leg (uint64_t* u, size_t m, uint64_t v,
|
||||
q = GncInt128 ((qv[3] << sublegbits) + qv[2], (qv[1] << sublegbits) + qv[0]);
|
||||
r = GncInt128 ((u[3] << sublegbits) + u[2], (u[1] << sublegbits) + u[0]);
|
||||
if (negative) q = -q;
|
||||
if (rnegative) r = -r;
|
||||
}
|
||||
|
||||
}// namespace
|
||||
|
||||
void
|
||||
void
|
||||
GncInt128::div (const GncInt128& b, GncInt128& q, GncInt128& r) const noexcept
|
||||
{
|
||||
// clear remainder and quotient
|
||||
r = GncInt128(0);
|
||||
q = GncInt128(0);
|
||||
|
||||
auto qflags = get_flags(q.m_hi);
|
||||
auto rflags = get_flags(r.m_hi);
|
||||
if (isOverflow() || b.isOverflow())
|
||||
@@ -745,6 +755,7 @@ GncInt128::div (const GncInt128& b, GncInt128& q, GncInt128& r) const noexcept
|
||||
assert (&r != &b);
|
||||
|
||||
q.zero(), r.zero();
|
||||
qflags = rflags = 0;
|
||||
if (b.isZero())
|
||||
{
|
||||
qflags |= NaN;
|
||||
@@ -755,11 +766,17 @@ GncInt128::div (const GncInt128& b, GncInt128& q, GncInt128& r) const noexcept
|
||||
}
|
||||
|
||||
if (isNeg())
|
||||
{
|
||||
qflags |= neg;
|
||||
rflags |= neg; // the remainder inherits the dividend's sign
|
||||
}
|
||||
|
||||
if (b.isNeg())
|
||||
qflags ^= neg;
|
||||
|
||||
q.m_hi = set_flags(q.m_hi, qflags);
|
||||
r.m_hi = set_flags(r.m_hi, rflags);
|
||||
|
||||
if (abs() < b.abs())
|
||||
{
|
||||
r = *this;
|
||||
@@ -767,7 +784,7 @@ GncInt128::div (const GncInt128& b, GncInt128& q, GncInt128& r) const noexcept
|
||||
}
|
||||
auto hi = get_num(m_hi);
|
||||
auto bhi = get_num(b.m_hi);
|
||||
q.m_hi = set_flags(hi, qflags);
|
||||
|
||||
if (hi == 0 && bhi == 0) //let the hardware do it
|
||||
{
|
||||
assert (b.m_lo != 0); // b.m_hi is 0 but b isn't or we didn't get here.
|
||||
@@ -914,6 +931,11 @@ GncInt128::asCharBufR(char* buf) const noexcept
|
||||
sprintf (buf, "%s", "NaN");
|
||||
return buf;
|
||||
}
|
||||
if (isZero())
|
||||
{
|
||||
sprintf (buf, "%d", 0);
|
||||
return buf;
|
||||
}
|
||||
uint64_t d[dec_array_size] {};
|
||||
decimal_from_binary(d, get_num(m_hi), m_lo);
|
||||
char* next = buf;
|
||||
|
||||
@@ -178,7 +178,7 @@ GncNumeric::GncNumeric(const std::string& str, bool autoround)
|
||||
GncInt128 high(stoll(m[1].str()));
|
||||
GncInt128 low(stoll(m[2].str()));
|
||||
int64_t d = powten(m[2].str().length());
|
||||
GncInt128 n = high * d + (high > 0 ? low : -low);
|
||||
GncInt128 n = high * d + (high >= 0 ? low : -low);
|
||||
if (!autoround && n.isBig())
|
||||
{
|
||||
std::ostringstream errmsg;
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
#include "gnc-numeric.h"
|
||||
#include "gnc-int128.hpp"
|
||||
|
||||
template <typename T> inline bool
|
||||
quotient_is_positive(T dividend, T divisor)
|
||||
{
|
||||
return (dividend > 0 && divisor > 0) || (dividend < 0 && divisor < 0);
|
||||
}
|
||||
|
||||
enum class RoundType
|
||||
{
|
||||
floor = GNC_HOW_RND_FLOOR,
|
||||
@@ -72,8 +78,23 @@ round(T num, T den, T rem, RT2T<RoundType::floor>)
|
||||
// << ", and rem " << rem << ".\n";
|
||||
if (rem == 0)
|
||||
return num;
|
||||
if (num < 0)
|
||||
return num + 1;
|
||||
// floor num==0 that is the quotient of two numbers with opposite signs
|
||||
if (num < 0 || (num == 0 && !quotient_is_positive(rem, den)))
|
||||
return num - 1;
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
template <> inline GncInt128
|
||||
round<GncInt128>(GncInt128 num, GncInt128 den, GncInt128 rem,
|
||||
RT2T<RoundType::floor>)
|
||||
{
|
||||
// std::cout << "Rounding to floor with num " << num << " den " << den
|
||||
// << ", and rem " << rem << ".\n";
|
||||
if (rem == 0)
|
||||
return num;
|
||||
if (num.isNeg())
|
||||
return num - 1;
|
||||
return num;
|
||||
}
|
||||
|
||||
@@ -82,7 +103,18 @@ round(T num, T den, T rem, RT2T<RoundType::ceiling>)
|
||||
{
|
||||
if (rem == 0)
|
||||
return num;
|
||||
if (num > 0)
|
||||
if (num > 0 || (num == 0 && quotient_is_positive(rem, den)))
|
||||
return num + 1;
|
||||
return num;
|
||||
}
|
||||
|
||||
template <> inline GncInt128
|
||||
round<GncInt128>(GncInt128 num, GncInt128 den, GncInt128 rem,
|
||||
RT2T<RoundType::ceiling>)
|
||||
{
|
||||
if (rem == 0)
|
||||
return num;
|
||||
if (!num.isNeg())
|
||||
return num + 1;
|
||||
return num;
|
||||
}
|
||||
@@ -98,16 +130,31 @@ round(T num, T den, T rem, RT2T<RoundType::promote>)
|
||||
{
|
||||
if (rem == 0)
|
||||
return num;
|
||||
if (num == 0)
|
||||
return (!quotient_is_positive(rem, den) ? -1 : 1);
|
||||
return num + (num < 0 ? -1 : 1);
|
||||
}
|
||||
|
||||
template <> inline GncInt128
|
||||
round<GncInt128>(GncInt128 num, GncInt128 den, GncInt128 rem,
|
||||
RT2T<RoundType::promote>)
|
||||
{
|
||||
if (rem == 0)
|
||||
return num;
|
||||
return num + (num.isNeg() ? -1 : 1);
|
||||
}
|
||||
|
||||
template <typename T> inline T
|
||||
round(T num, T den, T rem, RT2T<RoundType::half_down>)
|
||||
{
|
||||
if (rem == 0)
|
||||
return num;
|
||||
if (std::abs(rem * 2) > std::abs(den))
|
||||
{
|
||||
if (num == 0)
|
||||
return (!quotient_is_positive(rem, den) ? -1 : 1);
|
||||
return num + (num < 0 ? -1 : 1);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
@@ -118,7 +165,7 @@ round<GncInt128>(GncInt128 num, GncInt128 den, GncInt128 rem,
|
||||
if (rem == 0)
|
||||
return num;
|
||||
if (rem.abs() * 2 > den.abs())
|
||||
return num + (num < 0 ? -1 : 1);
|
||||
return num + (num.isNeg() ? -1 : 1);
|
||||
return num;
|
||||
}
|
||||
|
||||
@@ -128,7 +175,11 @@ round(T num, T den, T rem, RT2T<RoundType::half_up>)
|
||||
if (rem == 0)
|
||||
return num;
|
||||
if (std::abs(rem) * 2 >= std::abs(den))
|
||||
{
|
||||
if (num == 0)
|
||||
return (!quotient_is_positive(rem, den) ? -1 : 1);
|
||||
return num + (num < 0 ? -1 : 1);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
@@ -139,7 +190,7 @@ round<GncInt128>(GncInt128 num, GncInt128 den, GncInt128 rem,
|
||||
if (rem == 0)
|
||||
return num;
|
||||
if (rem.abs() * 2 >= den.abs())
|
||||
return num + (num < 0 ? -1 : 1);
|
||||
return num + (num.isNeg() ? -1 : 1);
|
||||
return num;
|
||||
}
|
||||
|
||||
@@ -150,11 +201,15 @@ round(T num, T den, T rem, RT2T<RoundType::bankers>)
|
||||
return num;
|
||||
if (std::abs(rem * 2) > std::abs(den) ||
|
||||
(std::abs(rem * 2) == std::abs(den) && num % 2))
|
||||
return num += (num < 0 ? -1 : 1);
|
||||
{
|
||||
if (num == 0)
|
||||
return (!quotient_is_positive(rem, den) ? -1 : 1);
|
||||
return num + (num < 0 ? -1 : 1);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
template<> inline GncInt128
|
||||
template <> inline GncInt128
|
||||
round<GncInt128>(GncInt128 num, GncInt128 den, GncInt128 rem,
|
||||
RT2T<RoundType::bankers>)
|
||||
{
|
||||
@@ -162,7 +217,7 @@ round<GncInt128>(GncInt128 num, GncInt128 den, GncInt128 rem,
|
||||
return num;
|
||||
if (rem.abs() * 2 > den.abs() ||
|
||||
(rem.abs() * 2 == den.abs() && num % 2))
|
||||
return num += (num < 0 ? -1 : 1);
|
||||
return num + (num.isNeg() ? -1 : 1);
|
||||
return num;
|
||||
}
|
||||
#endif //__GNC_RATIONAL_ROUNDING_HPP__
|
||||
@@ -432,7 +432,7 @@ TEST(GncInt128_functions, divide)
|
||||
GncInt128 big (sarg, barg);
|
||||
GncInt128 bigger (static_cast<uint64_t>(sarg), uarg);
|
||||
GncInt128 nsmall = -small;
|
||||
GncInt128 nbig = -bigger;
|
||||
GncInt128 nbigger = -bigger;
|
||||
|
||||
EXPECT_EQ (GncInt128(INT64_C(0)), zero /= smallest);
|
||||
EXPECT_EQ (GncInt128(INT64_C(0)), zero %= smallest);
|
||||
@@ -451,11 +451,20 @@ TEST(GncInt128_functions, divide)
|
||||
|
||||
nsmall.div (smaller, q, r);
|
||||
EXPECT_EQ (-two, q);
|
||||
EXPECT_EQ (GncInt128(INT64_C(3810195028972355394)), r);
|
||||
EXPECT_EQ (GncInt128(INT64_C(-3810195028972355394)), r);
|
||||
|
||||
nsmall.div (-smaller, q, r);
|
||||
EXPECT_EQ (two, q);
|
||||
EXPECT_EQ (GncInt128(INT64_C(3810195028972355394)), r);
|
||||
EXPECT_EQ (GncInt128(INT64_C(-3810195028972355394)), r);
|
||||
|
||||
smaller.div (small, q, r);
|
||||
EXPECT_EQ (zero, q);
|
||||
EXPECT_EQ (smaller, r);
|
||||
|
||||
smaller.div (nsmall, q, r);
|
||||
EXPECT_EQ (zero, q);
|
||||
EXPECT_TRUE (q.isNeg());
|
||||
EXPECT_EQ (smaller, r);
|
||||
|
||||
bigger.div (bigger, q, r);
|
||||
EXPECT_EQ (one, q);
|
||||
@@ -477,18 +486,23 @@ TEST(GncInt128_functions, divide)
|
||||
EXPECT_EQ (-two, q);
|
||||
EXPECT_EQ (GncInt128(UINT64_C(3810195028972355394)), r);
|
||||
|
||||
nbig.div (-big, q, r);
|
||||
nbigger.div (-big, q, r);
|
||||
EXPECT_EQ (two, q);
|
||||
EXPECT_EQ (GncInt128(UINT64_C(3810195028972355394)), r);
|
||||
EXPECT_EQ (GncInt128(0, UINT64_C(3810195028972355394), GncInt128::neg), r);
|
||||
|
||||
nbig.div (-big, q, r);
|
||||
nbigger.div (-big, q, r);
|
||||
EXPECT_EQ (two, q);
|
||||
EXPECT_EQ (GncInt128(UINT64_C(3810195028972355394)), r);
|
||||
EXPECT_EQ (GncInt128(0, UINT64_C(3810195028972355394), GncInt128::neg), r);
|
||||
|
||||
big.div (bigger, q, r);
|
||||
EXPECT_EQ (zero, q);
|
||||
EXPECT_EQ (big, r);
|
||||
|
||||
big.div (nbigger, q, r);
|
||||
EXPECT_EQ (zero, q);
|
||||
EXPECT_TRUE (q.isNeg());
|
||||
EXPECT_EQ (big, r);
|
||||
|
||||
big.div (big - 1, q, r);
|
||||
EXPECT_EQ(one, q);
|
||||
EXPECT_EQ(one, r);
|
||||
|
||||
@@ -411,7 +411,7 @@ TEST(gncnumeric_functions, test_convert)
|
||||
EXPECT_EQ(3465453, c.num());
|
||||
EXPECT_EQ(128, c.denom());
|
||||
ASSERT_NO_THROW(c = b.convert<RoundType::floor>(128));
|
||||
EXPECT_EQ(-3465452, c.num());
|
||||
EXPECT_EQ(-3465454, c.num());
|
||||
EXPECT_EQ(128, c.denom());
|
||||
ASSERT_NO_THROW(c = a.convert<RoundType::ceiling>(128));
|
||||
EXPECT_EQ(3465454, c.num());
|
||||
|
||||
@@ -1071,7 +1071,7 @@ gnc_pricedb_lookup_day_t64(GNCPriceDB *db,// C: 4 in 2 SCM: 2 in 1 Local: 1:0:0
|
||||
static void
|
||||
test_gnc_pricedb_lookup_day_t64 (PriceDBFixture *fixture, gconstpointer pData)
|
||||
{
|
||||
gchar *msg1 = "[gnc_dmy2timespec_internal()] Date computation error from Y-M-D 12-11-18: Year is out of valid range: 1400..10000";
|
||||
gchar *msg1 = "[gnc_dmy2time64_internal()] Date computation error from Y-M-D 12-11-18: Year is out of valid range: 1400..9999";
|
||||
gint loglevel = G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL;
|
||||
gchar *logdomain = "qof.engine";
|
||||
TestErrorStruct check = {loglevel, logdomain, msg1, 0};
|
||||
|
||||
@@ -186,7 +186,7 @@ sub schemify_num {
|
||||
if(!$numstr) { return "failed-conversion"; }
|
||||
|
||||
if($numstr =~ /^\s*(\d+(\.\d+)?([eE][+-]?\d+)?)$/o) {
|
||||
return $1;
|
||||
return "#e" . $1;
|
||||
} else {
|
||||
return "failed-conversion";
|
||||
}
|
||||
|
||||
@@ -404,13 +404,7 @@
|
||||
(else #f)))
|
||||
|
||||
(if price
|
||||
;; The second argument to inexact->exact is chosen to give reasonable values
|
||||
;; for prices between .12345e-9 and 12345678.87654
|
||||
|
||||
;; inexact->exact is probably not necessary but it can't hurt and is cheap.
|
||||
(set! price
|
||||
(gnc-scm-to-numeric
|
||||
(rationalize (inexact->exact price) 1/1000000000000000))))
|
||||
(set! price (gnc-scm-to-numeric price)))
|
||||
(if gnc-time
|
||||
(set! gnc-time (timestr->time64 gnc-time time-zone))
|
||||
(set! gnc-time (gnc:get-today)))
|
||||
|
||||
@@ -6,6 +6,7 @@ set(GUILE_DEPENDS
|
||||
scm-gnc-module
|
||||
scm-app-utils
|
||||
scm-scm scm-engine
|
||||
scm-srfi64-extras
|
||||
)
|
||||
|
||||
if (HAVE_SRFI64)
|
||||
|
||||
@@ -50,12 +50,6 @@
|
||||
(read-enable 'positions)
|
||||
(debug-set! stack 200000)
|
||||
|
||||
;; Initalialize localization, otherwise reports may output
|
||||
;; invalid characters
|
||||
(setlocale LC_ALL "")
|
||||
|
||||
;;;; Status output functions.
|
||||
|
||||
(define (strify items)
|
||||
(string-join (map (lambda (x) (format #f "~A" x)) items) ""))
|
||||
|
||||
|
||||
@@ -462,12 +462,14 @@ gnucash/report/report-system/report-collectors.scm
|
||||
gnucash/report/report-system/report.scm
|
||||
gnucash/report/report-system/report-system.scm
|
||||
gnucash/report/report-system/report-utilities.scm
|
||||
gnucash/report/report-system/trep-engine.scm
|
||||
gnucash/report/standard-reports/account-piecharts.scm
|
||||
gnucash/report/standard-reports/account-summary.scm
|
||||
gnucash/report/standard-reports/advanced-portfolio.scm
|
||||
gnucash/report/standard-reports/average-balance.scm
|
||||
gnucash/report/standard-reports/balance-forecast.scm
|
||||
gnucash/report/standard-reports/balance-sheet.scm
|
||||
gnucash/report/standard-reports/balsheet-pnl.scm
|
||||
gnucash/report/standard-reports/budget-balance-sheet.scm
|
||||
gnucash/report/standard-reports/budget-barchart.scm
|
||||
gnucash/report/standard-reports/budget-flow.scm
|
||||
@@ -485,6 +487,7 @@ gnucash/report/standard-reports/income-statement.scm
|
||||
gnucash/report/standard-reports/net-charts.scm
|
||||
gnucash/report/standard-reports/portfolio.scm
|
||||
gnucash/report/standard-reports/price-scatter.scm
|
||||
gnucash/report/standard-reports/reconcile-report.scm
|
||||
gnucash/report/standard-reports/register.scm
|
||||
gnucash/report/standard-reports/standard-reports.scm
|
||||
gnucash/report/standard-reports/sx-summary.scm
|
||||
|
||||
@@ -24,7 +24,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?"
|
||||
"product=GnuCash&component=Translations\n"
|
||||
"POT-Creation-Date: 2019-04-08 17:37+0200\n"
|
||||
"PO-Revision-Date: 2019-04-20 18:18+0200\n"
|
||||
"PO-Revision-Date: 2019-04-29 23:15+0200\n"
|
||||
"Last-Translator: Christian Stimming <christian@cstimming.de>\n"
|
||||
"Language-Team: GnuCash-de <gnucash-de@gnucash.org>\n"
|
||||
"Language: de\n"
|
||||
@@ -19121,7 +19121,6 @@ msgstr "Kontoumsätze online abfragen via HBCI/Onlinebanking"
|
||||
|
||||
#. Translators: https://en.wikipedia.org/wiki/Single_Euro_Payments_Area
|
||||
#: gnucash/import-export/aqb/gnc-plugin-aqbanking.c:113
|
||||
#, fuzzy
|
||||
msgid "Issue _SEPA Transaction..."
|
||||
msgstr "SE_PA Einzelüberweisung..."
|
||||
|
||||
@@ -20003,7 +20002,7 @@ msgstr ""
|
||||
|
||||
#: gnucash/import-export/csv-imp/gnc-import-tx.cpp:478
|
||||
msgid "Please select a description column."
|
||||
msgstr "Bitte wählen Sie eine Beschreibunsspalte."
|
||||
msgstr "Bitte wählen Sie eine Beschreibungsspalte."
|
||||
|
||||
#: gnucash/import-export/csv-imp/gnc-import-tx.cpp:484
|
||||
msgid "Please select a deposit or withdrawal column."
|
||||
|
||||
Reference in new issue
Block a user