Revert "Bug 797659 - Liabilities in budget report no longer calculate correctly"

This reverts commit 2329c1c508.

Reverted for snap release. Not tested thoroughly yet. Bug 797659 need
further betatesters.
This commit is contained in:
Christopher Lam 2020-04-10 08:51:23 +08:00
parent 9733b4c960
commit 642885a186

View File

@ -1202,9 +1202,10 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
switch (row_type)
{
case TOTALS_TYPE_ASSET_LIAB_EQ:
if ((acctype != ACCT_TYPE_ASSET) &&
(acctype != ACCT_TYPE_EQUITY) &&
(acctype != ACCT_TYPE_LIABILITY))
if ((acctype == ACCT_TYPE_LIABILITY) ||
(acctype == ACCT_TYPE_EQUITY))
neg = !neg;
else if (acctype != ACCT_TYPE_ASSET)
continue;
break;
case TOTALS_TYPE_EXPENSES:
@ -1217,6 +1218,9 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
neg = !neg;
break;
case TOTALS_TYPE_REMAINDER:
if ((acctype == ACCT_TYPE_ASSET) ||
(acctype == ACCT_TYPE_INCOME) ||
(acctype == ACCT_TYPE_EXPENSE))
neg = !neg;
break;
default:
@ -1231,7 +1235,6 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
switch (row_type)
{
case TOTALS_TYPE_ASSET_LIAB_EQ:
neg = (acctype == ACCT_TYPE_ASSET);
if ((acctype != ACCT_TYPE_ASSET) &&
(acctype != ACCT_TYPE_LIABILITY) &&
(acctype != ACCT_TYPE_EQUITY))
@ -1246,8 +1249,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
continue;
break;
case TOTALS_TYPE_REMAINDER:
neg = ((acctype == ACCT_TYPE_ASSET) ||
(acctype == ACCT_TYPE_EXPENSE));
neg = (acctype != ACCT_TYPE_INCOME);
break;
default:
continue; /* don't count if unexpected total row type is passed in... */