Merge branch 'maint'

This commit is contained in:
Christopher Lam 2021-10-14 09:34:28 +08:00
commit 9eaa3eb23a
24 changed files with 257 additions and 189 deletions

View File

@ -32,6 +32,7 @@
(use-modules (srfi srfi-26))
(use-modules (ice-9 match))
(use-modules (ice-9 i18n))
(use-modules (ice-9 regex))
(export N_)
(export G_)
@ -41,6 +42,7 @@
(export gnc:string-locale<?)
(export gnc:string-locale>?)
(export gnc:version)
(export gnc:format)
;; loads modules and re-exports all its public interface into the
;; current module
@ -107,3 +109,16 @@
(_ (default-printer))))
(set-exception-printer! 'unbound-variable print-unbound-variable-error)
;; format.
(define %regex (make-regexp "[$][{]([[:alnum:]]+)[}]"))
(define (gnc:format str . bindings)
(define hash (make-hash-table))
(define (substitute m)
(or (hashq-ref hash (string->symbol (match:substring m 1)))
(warn "invalid identifier" (match:substring m 0))))
(let lp ((bindings bindings))
(match bindings
(() (regexp-substitute/global #f %regex str 'pre substitute 'post))
(((? symbol? k) v . rest) (hashq-set! hash k (format #f "~a" v)) (lp rest))
(_ (error "gnc:format syntax error")))))

View File

@ -331,15 +331,10 @@ gnc_scm2guid_glist (SCM guids_scm)
return g_list_reverse (guids);
}
static void
static inline void
gnc_guid_glist_free (GList *guids)
{
GList *node;
for (node = guids; node; node = node->next)
guid_free (node->data);
g_list_free (guids);
g_list_free_full (guids, (GDestroyNotify)guid_free);
}
static SCM

View File

@ -25,7 +25,6 @@ gnc_add_test_with_guile(test-scm-query test-scm-query.cpp ENGINE_TEST_INCLUDE_DI
set(bindings_test_SCHEME
test-core-utils.scm
test-create-account.scm
)
@ -46,10 +45,13 @@ gnc_add_scheme_test_targets(scm-test-engine
OUTPUT_DIR "tests"
DEPENDS "${GUILE_DEPENDS};scm-test-engine-extras")
gnc_add_scheme_tests("${bindings_test_SCHEME}")
add_dependencies(check scm-test-engine)
gnc_add_scheme_tests("${engine_test_SCHEME}")
set (scm_tests_with_srfi64_SOURCES
test-core-utils.scm
test-business-core.scm
test-scm-engine.scm
)

View File

@ -1,17 +1,49 @@
(define exit-code 0)
(setenv "GNC_UNINSTALLED" "1")
(use-modules (srfi srfi-64))
(use-modules (tests srfi64-extras))
(use-modules (gnucash core-utils))
(if (macro? (module-ref (current-module) 'N_))
(display "Macro N_ defined\n")
(begin
(display "Failed - macro N_ not defined\n")
(set! exit-code -1)))
(define (N_-tests)
(if (string=? (N_ "foobar") "foobar")
(display "Macro N_ works properly\n")
(begin
(display "Failed - macro N_ doesn't work\n")
(set! exit-code -1)))
(test-assert "N_ defined"
(module-ref (current-module) 'N_))
(exit exit-code)
(test-equal "N_ works properly"
"foobar"
(N_ "foobar")))
(define (gnc-format-tests)
(test-equal "null"
""
(gnc:format ""))
(test-equal "basic"
"basic"
(gnc:format "basic"))
(test-equal "basic with unused symbols"
"basic"
(gnc:format "basic" 'task "testing"))
(test-equal "one substitution"
"basic test"
(gnc:format "basic ${job}" 'job "test"))
(test-equal "two substitutions out of order"
"basic test"
(gnc:format "${difficulty} ${job}" 'job "test" 'difficulty "basic"))
(test-equal "trying to reference invalid symbol"
"${symbol} does not exist"
(gnc:format "${symbol} does not exist" 'existence "none"))
(test-error "gnc:format syntax error"
(gnc:format "${symbol} does not exist" 'existence)))
(define (run-test)
(test-runner-factory gnc:test-runner)
(test-begin "test-core-utils")
(N_-tests)
(gnc-format-tests)
(test-end "test-core-utils"))

View File

@ -268,7 +268,7 @@ gnc_gnome_help_yelp_anchor_fix (GtkWindow *parent, const char *file_name, const
gchar *filename = g_build_filename (help_path, *langs, help_file, NULL);
if (g_file_test (filename, G_FILE_TEST_EXISTS))
{
full_path = g_strdup (filename);
full_path = filename;
break;
}
g_free (filename);

View File

@ -80,6 +80,7 @@ typedef struct _CustomReportDialog
} CustomReportDialog;
void custom_report_dialog_destroy_cb (GtkWidget* widget, gpointer data);
void custom_report_dialog_close_cb(GtkWidget* widget, gpointer data);
void custom_report_help_cb(GtkWidget* widget, gpointer data);
void close_custom_report_clicked_cb(GtkWidget* widget, gpointer data);
@ -94,6 +95,31 @@ gboolean custom_report_query_tooltip_cb (GtkTreeView *view,
GtkTooltip *tooltip,
gpointer data);
static gboolean
tree_model_free (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
gpointer data)
{
GncGUID *guid;
gtk_tree_model_get (model, iter, COL_NUM, &guid, -1);
guid_free (guid);
return FALSE;
}
static void
empty_tree_model (GtkTreeModel *model)
{
gtk_tree_model_foreach (model, (GtkTreeModelForeachFunc)tree_model_free, NULL);
gtk_list_store_clear (GTK_LIST_STORE (model));
}
void
custom_report_dialog_destroy_cb (GtkWidget* widget, gpointer data)
{
CustomReportDialog *crd = data;
empty_tree_model (gtk_tree_view_get_model (GTK_TREE_VIEW(crd->reportview)));
g_free (crd);
}
void
custom_report_dialog_close_cb(GtkWidget* widget, gpointer data)
{
@ -101,7 +127,6 @@ custom_report_dialog_close_cb(GtkWidget* widget, gpointer data)
gnc_save_window_size(GNC_PREFS_GROUP_REPORT_SAVED_CONFIGS, GTK_WINDOW(crd->dialog));
gtk_widget_destroy(crd->dialog);
g_free(crd);
}
void
@ -133,26 +158,13 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
int i;
GtkTreeIter iter;
GtkTreeModel *model = GTK_TREE_MODEL (store);
gboolean valid_iter;
gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), COL_NAME, GTK_SORT_ASCENDING);
crd->reportlist = scm_call_0(get_rpt_guids);
rpt_guids = crd->reportlist;
/* Empty current liststore */
valid_iter = gtk_tree_model_get_iter_first (model, &iter);
while (valid_iter)
{
GValue value = { 0, };
GncGUID *row_guid;
gtk_tree_model_get_value (model, &iter, COL_NUM, &value);
row_guid = (GncGUID *) g_value_get_pointer (&value);
guid_free (row_guid);
g_value_unset (&value);
valid_iter = gtk_tree_model_iter_next (model, &iter);
}
gtk_list_store_clear(store);
empty_tree_model (model);
if (scm_is_list(rpt_guids))
{
@ -343,25 +355,24 @@ get_custom_report_selection(CustomReportDialog *crd,
GtkTreeSelection *sel;
GtkTreeModel *model;
GtkTreeIter iter;
GncGUID *guid = guid_malloc ();
GncGUID *guid;
gchar *guid_str;
SCM scm_guid;
sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(crd->reportview));
if (gtk_tree_selection_get_selected(sel, &model, &iter))
{
gtk_tree_model_get(model, &iter, COL_NUM, &guid, -1);
guid_str = g_new0 (gchar, GUID_ENCODING_LENGTH+1 );
guid_to_string_buff (guid, guid_str);
}
else
if (!gtk_tree_selection_get_selected(sel, &model, &iter))
{
/* no selection, notify user */
gnc_error_dialog (GTK_WINDOW (crd->dialog), "%s", message);
return SCM_EOL;
}
return scm_from_utf8_string (guid_str);
gtk_tree_model_get (model, &iter, COL_NUM, &guid, -1);
guid_str = guid_to_string (guid);
scm_guid = scm_from_utf8_string (guid_str);
g_free (guid_str);
return scm_guid;
}
/**************************************************************
@ -385,7 +396,7 @@ custom_report_list_view_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
{
if (column == crd->namecol)
{
GncGUID *guid = guid_malloc ();
GncGUID *guid;
gchar *guid_str;
gtk_tree_model_get(model, &iter, COL_NUM, &guid, -1);
@ -393,6 +404,7 @@ custom_report_list_view_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
guid_to_string_buff (guid, guid_str);
custom_report_run_report(scm_from_utf8_string (guid_str), crd);
g_free (guid_str);
}
}
}
@ -503,6 +515,19 @@ custom_report_query_tooltip_cb (GtkTreeView *view,
return FALSE;
}
static gboolean
custom_report_event_cb (GtkWidget *widget, GdkEventKey *event,
gpointer user_data)
{
if (event->keyval == GDK_KEY_Escape)
{
custom_report_dialog_close_cb (widget, user_data);
return TRUE;
}
return FALSE;
}
/* Internal function that builds the dialog */
static CustomReportDialog *
gnc_ui_custom_report_internal(GncMainWindow * window)
@ -548,6 +573,10 @@ gnc_ui_custom_report_internal(GncMainWindow * window)
gtk_widget_show_all(crd->dialog);
// Use this event to capture the escape key being pressed
g_signal_connect (crd->dialog, "key_press_event",
G_CALLBACK(custom_report_event_cb), crd);
/* check if there are currently saved reports available
* by checking if there is a first element */
model = gtk_tree_view_get_model (GTK_TREE_VIEW (crd->reportview));
@ -611,10 +640,8 @@ gnc_ui_custom_report_edit_name (GncMainWindow * window, SCM scm_guid)
while (valid_iter)
{
GValue value = { 0, };
GncGUID *row_guid;
gtk_tree_model_get_value (model, &iter, COL_NUM, &value);
row_guid = (GncGUID *) g_value_get_pointer (&value);
gtk_tree_model_get (model, &iter, COL_NUM, &row_guid, -1);
if (guid_equal (guid, row_guid))
{
@ -630,13 +657,14 @@ gnc_ui_custom_report_edit_name (GncMainWindow * window, SCM scm_guid)
gtk_tree_view_set_cursor_on_cell (GTK_TREE_VIEW (crd->reportview),
path, crd->namecol,
crd->namerenderer, TRUE);
gtk_tree_path_free (path);
break;
}
g_value_unset (&value);
valid_iter = gtk_tree_model_iter_next (model, &iter);
}
cleanup:
guid_free (guid);
g_free (guid_str);
}

View File

@ -168,7 +168,7 @@ initialize_getters (void)
}
static void
destroy_tax_type_info (gpointer data, gpointer user_data)
destroy_tax_type_info (gpointer data)
{
TaxTypeInfo *tax_type = data;
@ -187,15 +187,14 @@ destroy_tax_type_info (gpointer data, gpointer user_data)
g_free (tax_type);
}
static void
static inline void
destroy_tax_type_infos (GList *types)
{
g_list_foreach (types, destroy_tax_type_info, NULL);
g_list_free (types);
g_list_free_full (types, destroy_tax_type_info);
}
static void
destroy_txf_info (gpointer data, gpointer user_data)
destroy_txf_info (gpointer data)
{
TXFInfo *txf_info = data;
@ -217,11 +216,10 @@ destroy_txf_info (gpointer data, gpointer user_data)
g_free (txf_info);
}
static void
static inline void
destroy_txf_infos (GList *infos)
{
g_list_foreach (infos, destroy_txf_info, NULL);
g_list_free (infos);
g_list_free_full (infos, destroy_txf_info);
}
static void

View File

@ -313,6 +313,7 @@ gnc_reconcile_view_new (Account *account, GNCReconcileViewType type,
GList *accounts = NULL;
GList *splits;
Query *query;
QofNumericMatch sign;
g_return_val_if_fail (account, NULL);
g_return_val_if_fail ((type == RECLIST_DEBIT) ||
@ -345,15 +346,11 @@ gnc_reconcile_view_new (Account *account, GNCReconcileViewType type,
g_list_free (accounts);
/* limit the matches to CREDITs and DEBITs only, depending on the type */
if (type == RECLIST_CREDIT)
xaccQueryAddValueMatch(query, gnc_numeric_zero (),
QOF_NUMERIC_MATCH_CREDIT,
QOF_COMPARE_GTE, QOF_QUERY_AND);
else
xaccQueryAddValueMatch(query, gnc_numeric_zero (),
QOF_NUMERIC_MATCH_DEBIT,
QOF_COMPARE_GTE, QOF_QUERY_AND);
sign = (type == RECLIST_CREDIT) ?
QOF_NUMERIC_MATCH_CREDIT : QOF_NUMERIC_MATCH_DEBIT;
xaccQueryAddNumericMatch (query, gnc_numeric_zero (), sign, QOF_COMPARE_GTE,
QOF_QUERY_AND, SPLIT_AMOUNT, NULL);
/* limit the matches only to Cleared and Non-reconciled splits */
xaccQueryAddClearedMatch (query, CLEARED_NO | CLEARED_CLEARED, QOF_QUERY_AND);

View File

@ -11,6 +11,7 @@
<property name="type_hint">dialog</property>
<property name="skip_taskbar_hint">True</property>
<property name="skip_pager_hint">True</property>
<signal name="destroy" handler="custom_report_dialog_destroy_cb" swapped="no"/>
<signal name="close" handler="custom_report_dialog_close_cb" swapped="no"/>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">

View File

@ -40,6 +40,7 @@
#include "import-main-matcher.h"
#include "dialog-utils.h"
#include "gnc-glib-utils.h"
#include "gnc-ui.h"
#include "gnc-ui-util.h"
#include "gnc-engine.h"
@ -1421,6 +1422,29 @@ update_child_row (GNCImportMatchInfo *sel_match, GtkTreeModel *model, GtkTreeIte
g_free (text);
}
static gchar *
get_peer_acct_names (Split *split)
{
GList *names = NULL, *accounts_seen = NULL;
gchar *retval, *name;
for (GList *n = xaccTransGetSplitList (xaccSplitGetParent (split)); n; n = n->next)
{
Account *account = xaccSplitGetAccount (n->data);
if ((n->data == split) ||
(xaccAccountGetType (account) == ACCT_TYPE_TRADING) ||
(g_list_find (accounts_seen, account)))
continue;
name = gnc_account_get_full_name (account);
names = g_list_prepend (names, g_strdup_printf ("\"%s\"", name));
accounts_seen = g_list_prepend (accounts_seen, account);
g_free (name);
}
retval = gnc_g_list_stringjoin (names, ", ");
g_list_free_full (names, g_free);
g_list_free (accounts_seen);
return retval;
}
static void
refresh_model_row (GNCImportMainMatcher *gui,
GtkTreeModel *model,
@ -1550,15 +1574,19 @@ refresh_model_row (GNCImportMainMatcher *gui,
if (sel_match)
{
gchar *full_names = get_peer_acct_names (sel_match->split);
color = get_required_color (int_not_required_class);
if (gnc_import_TransInfo_get_match_selected_manually (info))
{
ro_text = _("Reconcile (manual) match");
text = g_strdup_printf (_("Reconcile (manual) match to %s"),
full_names);
}
else
{
ro_text = _("Reconcile (auto) match");
text = g_strdup_printf (_("Reconcile (auto) match to %s"),
full_names);
}
g_free (full_names);
update_child_row (sel_match, model, iter);
}
else
@ -1576,15 +1604,19 @@ refresh_model_row (GNCImportMainMatcher *gui,
if (sel_match)
{
gchar *full_names = get_peer_acct_names (sel_match->split);
color = get_required_color (int_not_required_class);
if (gnc_import_TransInfo_get_match_selected_manually (info))
{
ro_text = _("Update and reconcile (manual) match");
text = g_strdup_printf (_("Update and reconcile (manual) match to %s"),
full_names);
}
else
{
ro_text = _("Update and reconcile (auto) match");
text = g_strdup_printf (_("Update and reconcile (auto) match to %s"),
full_names);
}
g_free (full_names);
update_child_row (sel_match, model, iter);
}
else

View File

@ -1130,7 +1130,11 @@ gnc_ofx_match_done (GtkDialog *dialog, gpointer user_data)
/* The the user did not click OK, don't process the rest of the
* transaction, don't go to the next of xfile.
*/
if (info->response != GTK_RESPONSE_OK) return;
if (info->response != GTK_RESPONSE_OK)
{
g_free (info);
return;
}
if (info->trans_list)
{
@ -1209,9 +1213,11 @@ runMatcher(ofx_info* info, char * selected_filename, gboolean go_to_next_file)
if (info->num_trans_processed)
{
gchar* acct_name = gnc_get_account_name_for_register (first_account);
gnc_info_dialog (parent, _("OFX file '%s', imported transactions for account '%s'\n%d transactions processed, no transactions to match"),
gnc_info_dialog (parent, _("While importing transactions from OFX file '%s' into account '%s', found %d previously imported transactions, no new transactions."),
selected_filename, acct_name, info->num_trans_processed);
g_free (acct_name);
// This is required to ensure we don't mistakenly assume the user canceled.
info->response = GTK_RESPONSE_OK;
gnc_ofx_match_done (NULL,info);
return;
}

View File

@ -32,6 +32,7 @@
#include "gnc-prefs.h"
#include "gnc-ui.h"
#include "gnc-uri-utils.h"
#include "gnc-glib-utils.h"
#include "gnc-filepath-utils.h"
#include "gnc-warnings.h"
#include "doclinkcell.h"
@ -89,7 +90,7 @@ gnc_split_register_get_rbaln (VirtualLocation virt_loc, gpointer user_data,
if (subaccounts)
{
children = gnc_account_get_descendants (account);
children = g_list_append (children, account);
children = g_list_prepend (children, account);
}
/* Get the row number we're on, then start with the first row. */
@ -1388,11 +1389,12 @@ gnc_split_register_get_price_entry (VirtualLocation virt_loc,
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
price = xaccSplitGetSharePrice (split);
curr = xaccTransGetCurrency (xaccSplitGetParent (split));
if (gnc_numeric_zero_p (price))
if (gnc_numeric_zero_p (xaccSplitGetAmount(split)) ||
gnc_numeric_zero_p (xaccSplitGetValue(split)))
return NULL;
price = xaccSplitGetSharePrice (split);
curr = xaccTransGetCurrency (xaccSplitGetParent (split));
return xaccPrintAmount (price, gnc_default_price_print_info (curr));
}
@ -1601,7 +1603,7 @@ get_trans_total_value_subaccounts (SplitRegister* reg, Transaction* trans)
return total;
children = gnc_account_get_descendants (parent);
children = g_list_append (children, parent);
children = g_list_prepend (children, parent);
for (child = children; child; child = child->next)
{
@ -2191,37 +2193,27 @@ gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
if (protected_trans_cell)
{
GList* node;
GList* acc_g_list = NULL;
gchar* acc_list = NULL;
gchar* message_format;
for (node = xaccTransGetSplitList (trans); node; node = node->next)
for (GList *node = xaccTransGetSplitList (trans); node; node = node->next)
{
Split* split = node->data;
if (xaccSplitGetReconcile (split) == YREC)
{
Account* acc = xaccSplitGetAccount (split);
gchar* name = gnc_account_get_full_name (acc);
if (acc_list == NULL)
acc_list = g_strconcat ("\n", name, NULL);
else
{
gchar* acc_list_copy = g_strdup (acc_list);
g_free (acc_list);
acc_list = g_strconcat (acc_list_copy, "\n", name, NULL);
g_free (acc_list_copy);
}
g_free (name);
gchar* name = gnc_account_get_full_name (xaccSplitGetAccount (split));
acc_g_list = g_list_prepend (acc_g_list, name);
}
}
acc_list = gnc_g_list_stringjoin (acc_g_list, "\n");
title = _ ("Change transaction containing a reconciled split?");
message_format =
_ ("The transaction you are about to change contains reconciled splits in the following accounts:\n%s"
"\n\nAre you sure you want to continue with this change?");
message = g_strdup_printf (message_format, acc_list);
g_list_free_full (acc_g_list, g_free);
g_free (acc_list);
}

View File

@ -194,11 +194,6 @@ commissions in cumulative average cost and gain/loss after commission")
(define cap-purch-costs? (opt-val gnc:pagename-general optname-cap-purch-costs))
(define document (gnc:make-html-document))
(define (elt->cell split)
(gnc:html-markup-anchor
(gnc:split-anchor-text split)
(amount->monetary (xaccSplitGetAmount split))))
(define large 10000000)
(define (get-fx db from to time)
(/ (gnc-pricedb-convert-balance-nearest-price-t64 db large from to time)
@ -232,7 +227,9 @@ commissions in cumulative average cost and gain/loss after commission")
(let ((query (qof-query-create-for-splits)))
(qof-query-set-book query (gnc-get-current-book))
(xaccQueryAddSingleAccountMatch query stock-acct QOF-QUERY-AND)
(xaccQueryGetSplitsUniqueTrans query))))
(let ((result (xaccQueryGetSplitsUniqueTrans query)))
(qof-query-destroy query)
result))))
(define (to-commodity amt)
(if format-cells

View File

@ -108,7 +108,9 @@
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
(xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
(xaccQueryAddDateMatchTT query #t from-date #t to-date QOF-QUERY-AND)
(filter desc-filter? (qof-query-run query))))
(let ((result (filter desc-filter? (qof-query-run query))))
(qof-query-destroy query)
result)))
(transactions
(sort-and-delete-duplicates
(map xaccSplitGetParent splits)

View File

@ -63,7 +63,8 @@
(qof-query-set-book query (gnc-get-current-book))
(xaccQueryAddAccountMatch query (list bank)
QOF-GUID-MATCH-ANY QOF-QUERY-AND)
(set-option options "__reg" "query" (gnc-query2scm query)))
(set-option options "__reg" "query" (gnc-query2scm query))
(qof-query-destroy query))
(let ((sxml (options->sxml options "basic")))
;; this is a simplistic test - counts the number of populated

View File

@ -378,19 +378,19 @@
(set! options (default-testing-options))
(set-option! options "General" "Start Date" (cons 'absolute (gnc-dmy2time64 01 01 1969)))
(set-option! options "General" "End Date" (cons 'absolute (gnc-dmy2time64 31 12 1970)))
(set-option! options "Filter" "Reconcile Status" 'unreconciled)
(set-option! options "Filter" "Reconciled Status" 'unreconciled)
(let ((sxml (options->sxml options "unreconciled")))
(test-equal "filter unreconciled only, sum = -$20.00"
'("-$20.00")
(get-row-col sxml -1 -1)))
(set-option! options "Filter" "Reconcile Status" 'cleared)
(set-option! options "Filter" "Reconciled Status" 'cleared)
(let ((sxml (options->sxml options "cleared")))
(test-equal "filter cleared only, sum = $29.00"
'("$29.00")
(get-row-col sxml -1 -1)))
(set-option! options "Filter" "Reconcile Status" 'reconciled)
(set-option! options "Filter" "Reconciled Status" 'reconciled)
(let ((sxml (options->sxml options "reconciled")))
(test-equal "filter reconciled only, sum = -$8.00"
'("-$8.00")

View File

@ -71,10 +71,10 @@ cashobjects_register(void)
{
g_return_val_if_fail(gnc_commodity_table_register(), FALSE);
g_return_val_if_fail(xaccAccountRegister(), FALSE);
g_return_val_if_fail ( xaccTransRegister(), FALSE);
g_return_val_if_fail ( xaccSplitRegister(), FALSE);
g_return_val_if_fail ( gnc_sxtt_register(), FALSE);
g_return_val_if_fail ( SXRegister (), FALSE);
g_return_val_if_fail ( xaccTransRegister(), FALSE);
g_return_val_if_fail ( xaccSplitRegister(), FALSE);
g_return_val_if_fail(gnc_pricedb_register(), FALSE);
g_return_val_if_fail (gnc_budget_register(), FALSE);
g_return_val_if_fail ( gnc_lot_register (), FALSE);

View File

@ -12,3 +12,6 @@ gnucash/import-export/qif/qif-parse.c
# These files are autogenerated, and hence not distributed
gnucash/gnome-utils/gnc-warnings.c
libgnucash/engine/iso-4217-currencies.c
# This file containing @PROJECT_NAME@ shouldn't be translated.
gnucash/gschemas/org.gnucash.GnuCash.deprecated.gschema.xml.in

View File

@ -52,10 +52,10 @@
msgid ""
msgstr ""
"Project-Id-Version: GnuCash 4.7-pre2\n"
"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?"
"product=GnuCash&component=Translations\n"
"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug."
"cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2021-09-20 22:29+0200\n"
"PO-Revision-Date: 2021-08-30 15:32+0000\n"
"PO-Revision-Date: 2021-10-02 06:36+0000\n"
"Last-Translator: Giuseppe Foti <foti.giuseppe@gmail.com>\n"
"Language-Team: Italian <https://hosted.weblate.org/projects/gnucash/gnucash/"
"it/>\n"
@ -64,7 +64,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.8.1-dev\n"
"X-Generator: Weblate 4.9-dev\n"
#: bindings/guile/commodity-table.scm:44
msgid "ALL NON-CURRENCY"
@ -4415,6 +4415,10 @@ msgid ""
"\n"
"Move the subaccounts or delete them before attempting to delete this account."
msgstr ""
"Il conto «%s» ha più di un sottoconto.\n"
"\n"
"Sposta i sottoconti o eliminali prima di tentare l'eliminazione di questo "
"conto."
#: gnucash/gnome/gnc-plugin-page-account-tree.c:1728
#, c-format
@ -10477,16 +10481,12 @@ msgid "To find the last stable version, please refer to {1}"
msgstr "Per ottenere l'ultima versione stabile, fare riferimento a {1}"
#: gnucash/gnucash-core-app.cpp:102
#, fuzzy
#| msgid "Load report configuration"
msgid "Loading system scm configuration..."
msgstr "Carica configurazione del resoconto"
msgstr "Sto caricando la configurazione scm di sistema..."
#: gnucash/gnucash-core-app.cpp:114
#, fuzzy
#| msgid "Load report configuration"
msgid "Loading user scm configuration..."
msgstr "Carica configurazione del resoconto"
msgstr "Sto caricando la configurazione scm dell'utente..."
#: gnucash/gnucash-core-app.cpp:223
msgid "- GnuCash, accounting for personal and small business finance"
@ -18706,22 +18706,16 @@ msgid "R_emind in advance"
msgstr "_Ricorda in anticipo di"
#: gnucash/gtkbuilder/dialog-sx.glade:724
#, fuzzy
#| msgid "_Review created transactions"
msgid "Re_view created transactions"
msgstr "_Controlla le transazioni create"
#: gnucash/gtkbuilder/dialog-sx.glade:728
#, fuzzy
#| msgid ""
#| "Set \"Review Created Transactions\" as the default for the \"since last "
#| "run\" dialog."
msgid ""
"Set 'Review created transactions' as the default in the \"since last run\" "
"dialog."
msgstr ""
"Imposta «Controlla le transazioni create» come impostazione predefinita per "
"la finestra «dall'ultimo avvio»."
"Imposta «Controlla le transazioni create» come impostazione predefinita "
"nella finestra «dall'ultimo avvio»."
#: gnucash/gtkbuilder/dialog-sx.glade:765
msgid "Edit Scheduled Transaction"
@ -19968,31 +19962,6 @@ msgstr ""
#. See https://wiki.gnucash.org/wiki/AqBanking for the used terminology and replace the link, if a localized version exists.
#: gnucash/import-export/aqb/assistant-ab-initial.glade:47
#, fuzzy
#| msgid ""
#| "The requirements for Online Banking vary between the different supported "
#| "AqBanking backends, but usually you will need:\n"
#| "* Your bank needs to grant you online access. See on their website or ask "
#| "their customer service for how to obtain it.\n"
#| "They should also tell you:\n"
#| "* Your user ID that identifies you to their server, often your base "
#| "account number;\n"
#| "* The URL of their Online Banking server;\n"
#| "* In some cases the routing number of your bank's branch is useful in "
#| "this assistant;\n"
#| "* Authentication methods vary by backend and choosen method:\n"
#| " * FinTS PIN/TAN: Some methods require a specific gadget like a card "
#| "reader or a mobile;\n"
#| " * FinTS HBCI: You have to exchange the public parts of asymmetric keys "
#| "with your bank (\"Ini-Letter\").\n"
#| " * PayPal: registered email address, password, API signature;\n"
#| "\n"
#| "See https://wiki.gnucash.org/wiki/AqBanking for more details.\n"
#| "\n"
#| "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."
msgid ""
"The requirements for Online Banking vary between the different supported "
"AqBanking backends, but usually you will need:\n"
@ -22393,16 +22362,13 @@ msgid "Unknown OFX investment account"
msgstr "Conto investimento OFX sconosciuto"
#: gnucash/import-export/ofx/gnc-ofx-import.c:1201
#, fuzzy, c-format
#| msgid ""
#| "OFX file '%s' imported, %d transactions processed, no transactions to "
#| "match"
#, c-format
msgid ""
"OFX file '%s', imported transactions for account '%s'\n"
"%d transactions processed, no transactions to match"
msgstr ""
"File OFX '%s' importato, processate %d transazioni, nessuna transazione da "
"incrociare"
"File OFX «%s», transazioni importate per il conto «%s», \n"
"processate %d transazioni, nessuna transazione da incrociare"
#: gnucash/import-export/ofx/gnc-ofx-import.c:1302
msgid "Open/Quicken Financial Exchange file (*.ofx, *.qfx)"
@ -28317,6 +28283,8 @@ msgstr "Totali periodo"
msgid ""
"* Amounts denoted thus are derived from, and do not match the transaction."
msgstr ""
"* Gli importi così indicati sono derivati e non corrispondono alla "
"transazione."
#: gnucash/report/reports/standard/new-owner-report.scm:868
#: gnucash/report/reports/standard/owner-report.scm:535

View File

@ -17,13 +17,14 @@
# TianXing_Yi <ytx.cash@gmail.com>, 2021.
# cjh <cjh@cjh0613.com>, 2021.
# Eric <spice2wolf@gmail.com>, 2021.
# J0kWang <lianjiefly@gmail.com>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: GnuCash 4.7-pre2\n"
"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug."
"cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2021-09-20 22:29+0200\n"
"PO-Revision-Date: 2021-09-28 05:36+0000\n"
"PO-Revision-Date: 2021-10-10 06:03+0000\n"
"Last-Translator: TianXing_Yi <ytx.cash@gmail.com>\n"
"Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/"
"gnucash/gnucash/zh_Hans/>\n"
@ -2716,7 +2717,7 @@ msgstr "预付"
msgid ""
"The transfer and post accounts are associated with different currencies. "
"Please specify the conversion rate."
msgstr "转出和入账的科目被指定了不同的币种。请指定转换汇率。"
msgstr "转出和入账科目币种不同,请设置汇率。"
#: gnucash/gnome/dialog-payment.c:1307 gnucash/gnome/search-owner.c:211
#: gnucash/gnome-search/dialog-search.c:1077
@ -2769,9 +2770,7 @@ msgid ""
"You have no valid \"Post To\" accounts. Please create an account of type \"%s"
"\" before you continue to process this payment. Perhaps you want to create "
"an Invoice or Bill first?"
msgstr ""
"您没有有效的“入账”科目。请在继续处理此付款前创建一个类型为“%s”的科目。也许您"
"希望先创建一个发票或账单?"
msgstr "尚无有效的“入账”科目,请先创建一个、类型为“%s”也许应先创建一个发票或账单"
#: gnucash/gnome/dialog-payment.c:1621
msgid ""
@ -4175,11 +4174,13 @@ msgid ""
"\n"
"Move the subaccounts or delete them before attempting to delete this account."
msgstr ""
"\"%s\"有一个或多个子科目。\n"
"删除该科目前请先删除所有的子科目。"
#: gnucash/gnome/gnc-plugin-page-account-tree.c:1728
#, c-format
msgid "The account %s will be deleted."
msgstr "将删除 %s"
msgstr "将删除 %s,"
#: gnucash/gnome/gnc-plugin-page-account-tree.c:1737
#, c-format
@ -4199,7 +4200,7 @@ msgstr "将它的所有子科目转移到科目 %s 中。"
#: gnucash/gnome/gnc-plugin-page-account-tree.c:1759
#, c-format
msgid "Its subaccount will be deleted."
msgstr "同时删除所有子科目,"
msgstr "删除所有子科目。"
#: gnucash/gnome/gnc-plugin-page-account-tree.c:1763
#, c-format
@ -5755,9 +5756,7 @@ msgstr "更新当前报表的已保存配置。报表配置将保存在文件%s
msgid ""
"Add the current report's configuration to the 'Reports->Saved Report "
"Configurations' menu. The report configuration will be saved in the file %s."
msgstr ""
"将当前报表的配置添加到'报表->已保存的自定义报表'菜单中。报表配置将被保存在文"
"件%s中。"
msgstr "添加当前报表配置到\"报表 -> 已保存模板\",配置将被保存在文件%s中。"
#: gnucash/gnome/gnc-plugin-page-report.c:1205
msgid "_Print Report..."
@ -5773,7 +5772,7 @@ msgstr "导出为 PDF(_D)..."
#: gnucash/gnome/gnc-plugin-page-report.c:1211
msgid "Export the current report as a PDF document"
msgstr "将当前报导出为 PDF 文档"
msgstr "将当前报导出为 PDF 文档"
#: gnucash/gnome/gnc-plugin-page-report.c:1236
msgid "Save _Report Configuration"
@ -7184,7 +7183,7 @@ msgstr "启动余额的算帐已以指定的货币存在。"
#: gnucash/gnome-utils/dialog-account.c:1329
msgid "Cannot change currency"
msgstr "无法更改币"
msgstr "无法更改币"
#: gnucash/gnome-utils/dialog-account.c:1418
msgid ""
@ -8310,7 +8309,7 @@ msgstr "GnuCash 无法找到帮助文件。"
msgid ""
"This is likely because the \"gnucash-docs\" package is not properly "
"installed."
msgstr "GnuCash 无法找到帮助文件。这很可能是因为没有安装“gnucash-docs”这个包。"
msgstr "这可能是因为 \"gnucash-docs \"软件包没有正确安装。"
#. Translators: URI of missing help files
#: gnucash/gnome-utils/gnc-gnome-utils.c:74
@ -8634,7 +8633,7 @@ msgstr ""
"Aron Xu <happyaron.xu@gmail.com>, 2010\n"
"Tao Wang <dancefire@gmail.com>, 2010\n"
"Boyuan Yang <073plan@gmail.com>, 2019\n"
"TianXing_Yi <ytx.cash@gmail.com>, 2021\n"
"YTX <ytx.cash@gmail.com>, 2021\n"
"CJH <c@cjh0613.com>, 2021"
#: gnucash/gnome-utils/gnc-main-window.c:4740
@ -10052,8 +10051,8 @@ msgid ""
"removed in GnuCash 5.0. Please use 'gnucash-cli --quotes get <datafile>' "
"instead."
msgstr ""
"gnucash的'--add-price-quotes'选项已被弃用并将在GnuCash 5.0中删除。请改"
"用'gnucash-cli --quotes get <datafile>'。"
"GnuCash 5.0 将删除已弃选项'--add-price-quotes',请改用'gnucash-cli --quotes get "
"<datafile>'。"
#: gnucash/gnucash.cpp:348
msgid "Run '{1} --help' to see a full list of available command line options."
@ -21639,7 +21638,7 @@ msgstr "sample:(x + 0.33 * y + (x+y) )"
msgid ""
"Could not determine the account currency. Using the default currency "
"provided by your system."
msgstr "无法确定帐户币种。将使用系统的默认货币。"
msgstr "无法确定科目币种,将使用系统默认的选项。"
#: gnucash/register/ledger-core/split-register-model.c:253
msgid "Ref"
@ -22090,7 +22089,7 @@ msgstr "按科目名称的字母顺序排列"
#: gnucash/report/options-utilities.scm:205
msgid "Numerical by descending amount"
msgstr ""
msgstr "按金额数字递减排列"
#: gnucash/report/options-utilities.scm:223
msgid "How to show the balances of parent accounts."
@ -24182,7 +24181,7 @@ msgstr "在左侧显示资产,右侧显示负债和所有者权益"
#: gnucash/report/reports/standard/balsheet-eg.scm:224
msgid "Sign: -$10.00"
msgstr ""
msgstr "符号: -$10.00"
#: gnucash/report/reports/standard/balsheet-eg.scm:225
msgid "Brackets: ($10.00)"
@ -26203,7 +26202,7 @@ msgstr "期间开始"
#: gnucash/report/reports/standard/new-owner-report.scm:510
msgid ""
"* Amounts denoted thus are derived from, and do not match the transaction."
msgstr ""
msgstr "这些金额所表示的是由推算得出,与交易不匹配。"
#: gnucash/report/reports/standard/new-owner-report.scm:868
#: gnucash/report/reports/standard/owner-report.scm:535
@ -26267,7 +26266,7 @@ msgstr "显示文件链接?"
#: gnucash/report/reports/standard/new-owner-report.scm:1068
msgid "No valid account found"
msgstr "找不到匹配的"
msgstr "没有有效的科目"
#: gnucash/report/reports/standard/new-owner-report.scm:1069
msgid "This report requires a valid AP/AR account to be available."
@ -26785,7 +26784,7 @@ msgstr "表格头边框颜色"
#: gnucash/report/reports/standard/taxinvoice.scm:92
msgid "table-cell-border-color"
msgstr "table-cell-border-color"
msgstr "单元格边框颜色"
#: gnucash/report/reports/standard/taxinvoice.scm:93
msgid "Embedded CSS"
@ -27888,7 +27887,7 @@ msgstr "指定详细显示事务的数量。"
#: gnucash/report/trep-engine.scm:978
msgid "One split per line"
msgstr ""
msgstr "每个子交易一行"
#: gnucash/report/trep-engine.scm:979
msgid "One transaction per line"