mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-07 22:03:42 -06:00
HomeBudget: Fixed updating categories drop list after removing category, fixed clearing value in money grid after updating category (thanks porto!)
git-svn-id: svn://ultimatepp.org/upp/trunk@2781 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
6e8baec884
commit
9c2ff4b2da
1 changed files with 13 additions and 4 deletions
|
|
@ -295,6 +295,7 @@ void HomeBudget::RemoveGroup()
|
|||
if(categories.IsEmpty())
|
||||
{
|
||||
SQL & Delete(GROUPS).Where(ID == groups(ID));
|
||||
|
||||
if(groups.GetCount() == 1)
|
||||
categories.Disable();
|
||||
}
|
||||
|
|
@ -465,7 +466,10 @@ void HomeBudget::RemoveCategory()
|
|||
categories.CancelRemove();
|
||||
}
|
||||
else
|
||||
{
|
||||
SQL & Delete(CATEGORIES).Where(ID == categories(ID));
|
||||
UpdateCategories();
|
||||
}
|
||||
}
|
||||
catch(SqlExc &e)
|
||||
{
|
||||
|
|
@ -746,13 +750,18 @@ void HomeBudget::UpdateValue()
|
|||
{
|
||||
if(money.IsEmpty())
|
||||
return;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
SQL & Select(DEFVALUE).From(CATEGORIES).Where(ID == money.Get(CAT_ID));
|
||||
SQL & Select(DEFVALUE, PM).From(CATEGORIES).Where(ID == money.Get(CAT_ID));
|
||||
Value v = SQL.Fetch() ? SQL[0] : Value(0);
|
||||
money.Set(VALUE, v);
|
||||
money.Set(PM, GetCategorySign());
|
||||
Value s = SQL.Fetch() ? SQL[1] : -1;
|
||||
|
||||
if(IsNull(money.Get(VALUE)))
|
||||
money.Set(VALUE, v);
|
||||
|
||||
if(IsNull(money.Get(PM)))
|
||||
money.Set(PM, s);
|
||||
}
|
||||
catch(SqlExc &e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue