mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-22 17:06:36 -06:00
Herbert Thoma's patch to the main window currency handling plus
a message fix. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2773 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
0212b4b920
commit
837f57201c
@ -1,7 +1,7 @@
|
||||
How to install gnucash on SuSE
|
||||
==============================
|
||||
(written 2000-01-07 by Peter Pointner <peter@wuzel.m.isar.de>)
|
||||
(last changed 2000-07-12 by Herbert Thoma (tma@iis.fhg.de))
|
||||
(last changed 2000-09-04 by Herbert Thoma (tma@iis.fhg.de))
|
||||
|
||||
Notes:
|
||||
|
||||
@ -77,9 +77,8 @@ Let's go:
|
||||
cvs -d :pserver:cvs@cvs.gnucash.org:/home/cvs/cvsroot checkout gnucash
|
||||
(this will get you the latest development version)
|
||||
|
||||
* If you want to build the development version, first build gtkhtml
|
||||
as described in lib/README. This step will no longer be required
|
||||
when gtkhtml makes it into the official GNOME distribution.
|
||||
* The lib directory contains packages that are needed to build GnuCash
|
||||
but are not widely available yet. Read the file lib/README for details.
|
||||
|
||||
* Configure, build and install gnucash. Installation must probably be
|
||||
done as root, the files go to various places in /usr/local.
|
||||
|
@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2000-09-01 21:34-0700\n"
|
||||
"POT-Creation-Date: 2000-09-05 00:29-0700\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -307,7 +307,7 @@ msgid ""
|
||||
"You cannot transfer funds from the %s account.\n"
|
||||
"It does not have a matching currency.\n"
|
||||
"To transfer funds between accounts with different currencies\n"
|
||||
" youneed an intermediate currency account.\n"
|
||||
"you need an intermediate currency account.\n"
|
||||
"Please see the GnuCash online manual"
|
||||
msgstr ""
|
||||
|
||||
|
@ -257,26 +257,84 @@ gnc_ui_get_currency_item(GList **list, const char *currency, GtkWidget *holder)
|
||||
*/
|
||||
|
||||
static void
|
||||
gnc_ui_refresh_statusbar (void)
|
||||
gnc_ui_accounts_recurse (AccountGroup *group, GList **currency_list,
|
||||
gboolean euro)
|
||||
{
|
||||
GNCMainInfo *main_info;
|
||||
double amount;
|
||||
AccountGroup *group;
|
||||
AccountGroup *children;
|
||||
Account *account;
|
||||
char asset_string[256];
|
||||
char profit_string[256];
|
||||
int num_accounts;
|
||||
int account_type;
|
||||
const char *account_currency;
|
||||
const char *default_currency;
|
||||
GNCCurrencyAcc *currency_accum;
|
||||
GNCCurrencyAcc *euro_accum = NULL;
|
||||
int i;
|
||||
|
||||
if (euro)
|
||||
euro_accum = gnc_ui_get_currency_accumulator(currency_list,
|
||||
EURO_TOTAL_STR);
|
||||
|
||||
num_accounts = xaccGroupGetNumAccounts(group);
|
||||
for (i = 0; i < num_accounts; i++)
|
||||
{
|
||||
account = xaccGroupGetAccount(group, i);
|
||||
|
||||
account_type = xaccAccountGetType(account);
|
||||
account_currency = xaccAccountGetCurrency(account);
|
||||
children = xaccAccountGetChildren(account);
|
||||
currency_accum = gnc_ui_get_currency_accumulator(currency_list,
|
||||
account_currency);
|
||||
|
||||
switch (account_type)
|
||||
{
|
||||
case BANK:
|
||||
case CASH:
|
||||
case ASSET:
|
||||
case STOCK:
|
||||
case MUTUAL:
|
||||
case CREDIT:
|
||||
case LIABILITY:
|
||||
amount = xaccAccountGetBalance(account);
|
||||
currency_accum->assets += amount;
|
||||
if(euro)
|
||||
euro_accum->assets += gnc_convert_to_euro(account_currency, amount);
|
||||
|
||||
if (children != NULL)
|
||||
gnc_ui_accounts_recurse(children, currency_list, euro);
|
||||
break;
|
||||
case INCOME:
|
||||
case EXPENSE:
|
||||
amount = xaccAccountGetBalance(account);
|
||||
currency_accum->profits -= amount;
|
||||
if(euro)
|
||||
euro_accum->profits -= gnc_convert_to_euro(account_currency, amount);
|
||||
|
||||
if (children != NULL)
|
||||
gnc_ui_accounts_recurse(children, currency_list, euro);
|
||||
break;
|
||||
case EQUITY:
|
||||
/* no-op, see comments at top about summing assets */
|
||||
break;
|
||||
case CURRENCY:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_ui_refresh_statusbar (void)
|
||||
{
|
||||
GNCMainInfo *main_info;
|
||||
AccountGroup *group;
|
||||
char asset_string[256];
|
||||
char profit_string[256];
|
||||
const char *default_currency;
|
||||
GNCCurrencyAcc *currency_accum;
|
||||
GNCCurrencyItem *currency_item;
|
||||
GList *currency_list;
|
||||
GList *current;
|
||||
gboolean euro;
|
||||
int i;
|
||||
|
||||
default_currency = gnc_lookup_string_option("International",
|
||||
"Default Currency",
|
||||
@ -291,57 +349,9 @@ gnc_ui_refresh_statusbar (void)
|
||||
return;
|
||||
|
||||
currency_list = NULL;
|
||||
if (euro)
|
||||
euro_accum = gnc_ui_get_currency_accumulator(¤cy_list,
|
||||
EURO_TOTAL_STR);
|
||||
|
||||
group = gncGetCurrentGroup ();
|
||||
num_accounts = xaccGroupGetNumAccounts(group);
|
||||
for (i = 0; i < num_accounts; i++)
|
||||
{
|
||||
account = xaccGroupGetAccount(group, i);
|
||||
|
||||
account_type = xaccAccountGetType(account);
|
||||
account_currency = xaccAccountGetCurrency(account);
|
||||
children = xaccAccountGetChildren(account);
|
||||
currency_accum = gnc_ui_get_currency_accumulator(¤cy_list,
|
||||
account_currency);
|
||||
|
||||
switch (account_type)
|
||||
{
|
||||
case BANK:
|
||||
case CASH:
|
||||
case ASSET:
|
||||
case STOCK:
|
||||
case MUTUAL:
|
||||
case CREDIT:
|
||||
case LIABILITY:
|
||||
amount = xaccAccountGetBalance(account);
|
||||
if (children != NULL)
|
||||
amount += xaccGroupGetBalance(children);
|
||||
|
||||
currency_accum->assets += amount;
|
||||
if(euro)
|
||||
euro_accum->assets += gnc_convert_to_euro(account_currency, amount);
|
||||
break;
|
||||
case INCOME:
|
||||
case EXPENSE:
|
||||
amount = xaccAccountGetBalance(account);
|
||||
if (children != NULL)
|
||||
amount += xaccGroupGetBalance(children);
|
||||
|
||||
currency_accum->profits -= amount;
|
||||
if(euro)
|
||||
euro_accum->profits -= gnc_convert_to_euro(account_currency, amount);
|
||||
break;
|
||||
case EQUITY:
|
||||
/* no-op, see comments at top about summing assets */
|
||||
break;
|
||||
case CURRENCY:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
gnc_ui_accounts_recurse(group, ¤cy_list, euro);
|
||||
|
||||
for (current = g_list_first(main_info->totals_list); current;
|
||||
current = g_list_next(current))
|
||||
|
@ -149,8 +149,8 @@
|
||||
#define REG_CURR_MSG _("You cannot transfer funds from the %s " \
|
||||
"account.\nIt does not have a matching " \
|
||||
"currency.\nTo transfer funds between " \
|
||||
"accounts with different currencies\n you" \
|
||||
"need an intermediate currency account.\n" \
|
||||
"accounts with different currencies\n" \
|
||||
"you need an intermediate currency account.\n" \
|
||||
"Please see the GnuCash online manual")
|
||||
#define REPORT_ERR_MSG _("Error executing scheme report.")
|
||||
#define REPORT_NOPARM_MSG _("This report has no parameters.")
|
||||
|
Loading…
Reference in New Issue
Block a user