mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
*** empty log message ***
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2190 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
dcb49a0b47
commit
50646f04a9
@ -560,6 +560,7 @@ Dave Freese <DFreese@osc.uscg.mil> for leap-year fix
|
|||||||
Bill Gribble <grib@billgribble.com> qif importation code
|
Bill Gribble <grib@billgribble.com> qif importation code
|
||||||
Otto Hammersmith <otto@bug.redhat.com> for RedHat RPM version
|
Otto Hammersmith <otto@bug.redhat.com> for RedHat RPM version
|
||||||
Alexandru Harsanyi <haral@codec.ro> for core dumps, lockups, gtk work
|
Alexandru Harsanyi <haral@codec.ro> for core dumps, lockups, gtk work
|
||||||
|
John Hasler <john@dhh.gt.org> engine patch
|
||||||
Jon K}re Hellan <jk@isdn-a33.itea.ntnu.no> misc core dump fixes
|
Jon K}re Hellan <jk@isdn-a33.itea.ntnu.no> misc core dump fixes
|
||||||
Prakash Kailasa <PrakashK@bigfoot.com> for gnome build fixes
|
Prakash Kailasa <PrakashK@bigfoot.com> for gnome build fixes
|
||||||
Ben Kelly <ben.kelly@ieee.org> for motif menu bug fix, core dump fixes
|
Ben Kelly <ben.kelly@ieee.org> for motif menu bug fix, core dump fixes
|
||||||
|
@ -322,6 +322,10 @@
|
|||||||
|
|
||||||
<dd>for fixing miscellaneous core dumps and lockups.</dd>
|
<dd>for fixing miscellaneous core dumps and lockups.</dd>
|
||||||
|
|
||||||
|
<dt> <a href="mailto:john@dhh.gt.org"> John Hasler</a></dt>
|
||||||
|
|
||||||
|
<dd>engine patch</dd>
|
||||||
|
|
||||||
<dt> <a href="mailto:jk@isdn-a33.itea.ntnu.no"> Jon K}re
|
<dt> <a href="mailto:jk@isdn-a33.itea.ntnu.no"> Jon K}re
|
||||||
Hellan</a></dt>
|
Hellan</a></dt>
|
||||||
|
|
||||||
|
@ -1386,8 +1386,8 @@ xaccSRSaveRegEntry (SplitRegister *reg, Transaction *new_trans)
|
|||||||
|
|
||||||
if ((new_acc != NULL) && (old_acc != new_acc))
|
if ((new_acc != NULL) && (old_acc != new_acc))
|
||||||
{
|
{
|
||||||
char *currency = NULL;
|
const char *currency = NULL;
|
||||||
char *security = NULL;
|
const char *security = NULL;
|
||||||
|
|
||||||
currency = xaccAccountGetCurrency(new_acc);
|
currency = xaccAccountGetCurrency(new_acc);
|
||||||
currency = xaccTransIsCommonCurrency(trans, currency);
|
currency = xaccTransIsCommonCurrency(trans, currency);
|
||||||
@ -1461,8 +1461,8 @@ xaccSRSaveRegEntry (SplitRegister *reg, Transaction *new_trans)
|
|||||||
|
|
||||||
if ((new_acc != NULL) && (old_acc != new_acc))
|
if ((new_acc != NULL) && (old_acc != new_acc))
|
||||||
{
|
{
|
||||||
char *currency = NULL;
|
const char *currency = NULL;
|
||||||
char *security = NULL;
|
const char *security = NULL;
|
||||||
|
|
||||||
currency = xaccAccountGetCurrency(new_acc);
|
currency = xaccAccountGetCurrency(new_acc);
|
||||||
currency = xaccTransIsCommonCurrency(trans, currency);
|
currency = xaccTransIsCommonCurrency(trans, currency);
|
||||||
|
@ -673,8 +673,10 @@ static int revorder[NUM_ACCOUNT_TYPES] = {
|
|||||||
int
|
int
|
||||||
xaccAccountOrder (Account **aa, Account **ab)
|
xaccAccountOrder (Account **aa, Account **ab)
|
||||||
{
|
{
|
||||||
char *da, *db;
|
char *da, *db;
|
||||||
|
char *endptr = NULL;
|
||||||
int ta, tb;
|
int ta, tb;
|
||||||
|
long la, lb;
|
||||||
|
|
||||||
if ( (*aa) && !(*ab) ) return -1;
|
if ( (*aa) && !(*ab) ) return -1;
|
||||||
if ( !(*aa) && (*ab) ) return +1;
|
if ( !(*aa) && (*ab) ) return +1;
|
||||||
@ -683,6 +685,18 @@ xaccAccountOrder (Account **aa, Account **ab)
|
|||||||
/* sort on accountCode strings */
|
/* sort on accountCode strings */
|
||||||
da = (*aa)->accountCode;
|
da = (*aa)->accountCode;
|
||||||
db = (*ab)->accountCode;
|
db = (*ab)->accountCode;
|
||||||
|
|
||||||
|
/* If accountCodes are both base 36 integers do an integer sort */
|
||||||
|
la = strtoul (da, &endptr, 36);
|
||||||
|
if((*da != '\0') && (*endptr == '\0')) {
|
||||||
|
lb = strtoul (db, &endptr, 36);
|
||||||
|
if((*db != '\0') && (*endptr == '\0')) {
|
||||||
|
if (la < lb) return -1;
|
||||||
|
if (la > lb) return +1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Otherwise do a string sort */
|
||||||
SAFE_STRCMP (da, db);
|
SAFE_STRCMP (da, db);
|
||||||
|
|
||||||
/* if acccount-type-order array not initialized, initialize it */
|
/* if acccount-type-order array not initialized, initialize it */
|
||||||
|
@ -520,7 +520,7 @@ xaccTransLookup (GUID *guid)
|
|||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccSplitSetBaseValue (Split *s, double value, char * base_currency)
|
xaccSplitSetBaseValue (Split *s, double value, const char * base_currency)
|
||||||
{
|
{
|
||||||
if (!s) return;
|
if (!s) return;
|
||||||
|
|
||||||
@ -606,7 +606,7 @@ xaccSplitGetBaseValue (Split *s, char * base_currency)
|
|||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
static double
|
static double
|
||||||
ComputeValue (Split **sarray, Split * skip_me, char * base_currency)
|
ComputeValue (Split **sarray, Split * skip_me, const char * base_currency)
|
||||||
{
|
{
|
||||||
Split *s;
|
Split *s;
|
||||||
int i=0;
|
int i=0;
|
||||||
@ -656,15 +656,16 @@ ComputeValue (Split **sarray, Split * skip_me, char * base_currency)
|
|||||||
double
|
double
|
||||||
xaccTransGetImbalance (Transaction * trans)
|
xaccTransGetImbalance (Transaction * trans)
|
||||||
{
|
{
|
||||||
char * currency = xaccTransFindCommonCurrency (trans);
|
const char * currency = xaccTransFindCommonCurrency (trans);
|
||||||
double imbal = ComputeValue (trans->splits, NULL, currency);
|
double imbal = ComputeValue (trans->splits, NULL, currency);
|
||||||
return imbal;
|
return imbal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************\
|
/********************************************************************\
|
||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
gncBoolean xaccIsCommonCurrency(char *currency_1, char *security_1,
|
gncBoolean
|
||||||
char *currency_2, char *security_2)
|
xaccIsCommonCurrency(const char *currency_1, const char *security_1,
|
||||||
|
const char *currency_2, const char *security_2)
|
||||||
{
|
{
|
||||||
int c1c2, c1s2, s1c2, s1s2;
|
int c1c2, c1s2, s1c2, s1s2;
|
||||||
|
|
||||||
@ -694,8 +695,8 @@ gncBoolean xaccIsCommonCurrency(char *currency_1, char *security_1,
|
|||||||
return (c1c2 == 0) || (c1s2 == 0) || (s1c2 == 0) || (s1s2 == 0);
|
return (c1c2 == 0) || (c1s2 == 0) || (s1c2 == 0) || (s1s2 == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static const char *
|
||||||
FindCommonCurrency (Split **slist, char * ra, char * rb)
|
FindCommonCurrency (Split **slist, const char * ra, const char * rb)
|
||||||
{
|
{
|
||||||
Split *s;
|
Split *s;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -756,7 +757,7 @@ FindCommonCurrency (Split **slist, char * ra, char * rb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
xaccTransFindCommonCurrency (Transaction *trans)
|
xaccTransFindCommonCurrency (Transaction *trans)
|
||||||
{
|
{
|
||||||
char *ra, *rb;
|
char *ra, *rb;
|
||||||
@ -771,8 +772,8 @@ xaccTransFindCommonCurrency (Transaction *trans)
|
|||||||
return FindCommonCurrency (trans->splits, ra, rb);
|
return FindCommonCurrency (trans->splits, ra, rb);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
xaccTransIsCommonCurrency (Transaction *trans, char * ra)
|
xaccTransIsCommonCurrency (Transaction *trans, const char * ra)
|
||||||
{
|
{
|
||||||
return FindCommonCurrency (trans->splits, ra, NULL);
|
return FindCommonCurrency (trans->splits, ra, NULL);
|
||||||
}
|
}
|
||||||
@ -799,7 +800,7 @@ xaccSplitRebalance (Split *split)
|
|||||||
Split *s;
|
Split *s;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
double value = 0.0;
|
double value = 0.0;
|
||||||
char *base_currency=0x0;
|
const char *base_currency = NULL;
|
||||||
|
|
||||||
trans = split->parent;
|
trans = split->parent;
|
||||||
|
|
||||||
|
@ -262,8 +262,8 @@ int xaccTransCountSplits (Transaction *trans);
|
|||||||
* xaccTransFindCommonCurrency. This method is useful for determining
|
* xaccTransFindCommonCurrency. This method is useful for determining
|
||||||
* whether two accounts can have transactions in common.
|
* whether two accounts can have transactions in common.
|
||||||
*/
|
*/
|
||||||
gncBoolean xaccIsCommonCurrency(char *currency_1, char *security_1,
|
gncBoolean xaccIsCommonCurrency(const char *currency_1, const char *security_1,
|
||||||
char *currency_2, char *security_2);
|
const char *currency_2, const char *security_2);
|
||||||
|
|
||||||
/* The xaccTransFindCommonCurrency () method returns a string value
|
/* The xaccTransFindCommonCurrency () method returns a string value
|
||||||
* indicating a currency denomination that all of the splits in this
|
* indicating a currency denomination that all of the splits in this
|
||||||
@ -276,7 +276,7 @@ gncBoolean xaccIsCommonCurrency(char *currency_1, char *security_1,
|
|||||||
* If all of the splits share both a common security and a common currency,
|
* If all of the splits share both a common security and a common currency,
|
||||||
* then the string name for the currency is returned.
|
* then the string name for the currency is returned.
|
||||||
*/
|
*/
|
||||||
char * xaccTransFindCommonCurrency (Transaction *trans);
|
const char * xaccTransFindCommonCurrency (Transaction *trans);
|
||||||
|
|
||||||
/* The xaccTransIsCommonCurrency () method compares the input string
|
/* The xaccTransIsCommonCurrency () method compares the input string
|
||||||
* to the currency/security denominations of all splits in the
|
* to the currency/security denominations of all splits in the
|
||||||
@ -294,7 +294,8 @@ char * xaccTransFindCommonCurrency (Transaction *trans);
|
|||||||
* transaction have in common. This routine is useful in dealing
|
* transaction have in common. This routine is useful in dealing
|
||||||
* securities of differing types are moved across accounts.
|
* securities of differing types are moved across accounts.
|
||||||
*/
|
*/
|
||||||
char * xaccTransIsCommonCurrency (Transaction *trans, char * currency);
|
const char * xaccTransIsCommonCurrency (Transaction *trans,
|
||||||
|
const char * currency);
|
||||||
|
|
||||||
/* The xaccTransGetImbalance() method returns the total value of the
|
/* The xaccTransGetImbalance() method returns the total value of the
|
||||||
* transaction. In a pure double-entry system, this imbalance
|
* transaction. In a pure double-entry system, this imbalance
|
||||||
@ -373,7 +374,8 @@ void xaccSplitSetSharePriceAndAmount (Split *, double price,
|
|||||||
void xaccSplitSetShareAmount (Split *, double);
|
void xaccSplitSetShareAmount (Split *, double);
|
||||||
void xaccSplitSetSharePrice (Split *, double);
|
void xaccSplitSetSharePrice (Split *, double);
|
||||||
void xaccSplitSetValue (Split *, double);
|
void xaccSplitSetValue (Split *, double);
|
||||||
void xaccSplitSetBaseValue (Split *s, double value, char * base_currency);
|
void xaccSplitSetBaseValue (Split *s, double value,
|
||||||
|
const char * base_currency);
|
||||||
|
|
||||||
|
|
||||||
/* The following four subroutines return the running balance up
|
/* The following four subroutines return the running balance up
|
||||||
|
Loading…
Reference in New Issue
Block a user