mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
misc fixes
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@297 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
6d84011e0d
commit
81b59c3cd8
@ -108,6 +108,7 @@ xaccMainWindowAddAcct (Widget acctrix, AccountGroup *grp, int depth )
|
|||||||
|
|
||||||
int i, j, k, currow;
|
int i, j, k, currow;
|
||||||
char buf[BUFSIZE];
|
char buf[BUFSIZE];
|
||||||
|
char *amt;
|
||||||
|
|
||||||
/* Add all the top-level accounts to the list */
|
/* Add all the top-level accounts to the list */
|
||||||
for( i=0; i<grp->numAcc; i++ )
|
for( i=0; i<grp->numAcc; i++ )
|
||||||
@ -145,11 +146,8 @@ xaccMainWindowAddAcct (Widget acctrix, AccountGroup *grp, int depth )
|
|||||||
(INCOME == acc->type) ) {
|
(INCOME == acc->type) ) {
|
||||||
dbalance = -dbalance;
|
dbalance = -dbalance;
|
||||||
}
|
}
|
||||||
if( 0.0 > dbalance )
|
amt = xaccPrintAmount (dbalance, PRTSYM);
|
||||||
sprintf( buf,"-$%.2f", DABS(dbalance) );
|
cols[XACC_MAIN_ACC_BALN] = XtNewString(amt);
|
||||||
else
|
|
||||||
sprintf( buf,"$%.2f", DABS(dbalance) );
|
|
||||||
cols[XACC_MAIN_ACC_BALN] = XtNewString(buf);
|
|
||||||
|
|
||||||
XtVaGetValues (acctrix, XmNrows, &currow, NULL);
|
XtVaGetValues (acctrix, XmNrows, &currow, NULL);
|
||||||
XbaeMatrixAddRows( acctrix, currow, cols, NULL, NULL, 1 );
|
XbaeMatrixAddRows( acctrix, currow, cols, NULL, NULL, 1 );
|
||||||
@ -791,6 +789,7 @@ xaccMainWindowRedisplayBalance (void)
|
|||||||
double assets = 0.0;
|
double assets = 0.0;
|
||||||
double profits = 0.0;
|
double profits = 0.0;
|
||||||
char buf[BUFSIZE];
|
char buf[BUFSIZE];
|
||||||
|
char * amt;
|
||||||
AccountGroup *grp = topgroup;
|
AccountGroup *grp = topgroup;
|
||||||
Account *acc;
|
Account *acc;
|
||||||
|
|
||||||
@ -823,8 +822,12 @@ xaccMainWindowRedisplayBalance (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( buf, "$ %.2f\n$ %.2f", assets, profits);
|
amt = xaccPrintAmount (assets, PRTSYM);
|
||||||
|
strcpy (buf, amt);
|
||||||
|
strcat (buf, "\n");
|
||||||
|
amt = xaccPrintAmount (profits, PRTSYM);
|
||||||
|
strcat (buf, amt);
|
||||||
|
|
||||||
XmTextSetString( baln_widget, buf );
|
XmTextSetString( baln_widget, buf );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1107,8 +1107,12 @@ regRecalculateBalance( RegWindow *regData )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( NULL != regData->balance ) {
|
if( NULL != regData->balance ) {
|
||||||
sprintf( buf, "$ %.2f\n$ %.2f",
|
char * amt;
|
||||||
prt_balance, prt_clearedBalance );
|
amt = xaccPrintAmount (prt_balance, PRTSYM);
|
||||||
|
strcpy (buf, amt);
|
||||||
|
strcat (buf, "\n");
|
||||||
|
amt = xaccPrintAmount (prt_clearedBalance, PRTSYM);
|
||||||
|
strcat (buf, amt);
|
||||||
XmTextSetString( regData->balance, buf );
|
XmTextSetString( regData->balance, buf );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user