Add shared account management

This commit is contained in:
2010-10-24 16:04:56 +02:00
parent d800f23029
commit 28c92d3b28
17 changed files with 655 additions and 237 deletions

View File

@@ -352,13 +352,7 @@ void GridAccount::InsertOperation(User* user, Operation& op, int line, bool fix,
if (op.meta && !op.amount)
{
amount = 0;
for(it2=op.childs.begin(); it2!=op.childs.end(); it2++)
{
op2 = GetOperation(*it2);
if (op2.amount > 0)
amount += op2.amount;
}
amount = _kiss->MetaPositiveAmount(op.id);
SetCellValue(line, DEBIT, wxString::Format(wxT("%.2lf"), amount));
SetCellValue(line, CREDIT, wxString::Format(wxT("%.2lf"), amount));
@@ -979,13 +973,7 @@ void GridAccount::OnOperationModified(wxGridEvent& event)
if (!_displayedOperations[row].amount)
{
amount = 0;
for(it=new_op.childs.begin(); it!=new_op.childs.end(); it++)
{
op2 = GetOperation(*it);
if (op2.amount > 0)
amount += op2.amount;
}
amount = _kiss->MetaPositiveAmount(new_op.id);
SetCellValue(row, DEBIT, wxString::Format(wxT("%.2lf"), amount));
SetCellValue(row, CREDIT, wxString::Format(wxT("%.2lf"), amount));
@@ -1030,7 +1018,6 @@ void GridAccount::UpdateMeta(Operation& op)
op.month = op_.month;
op.day = op_.day;
}
op.amount += op_.amount;
op.checked &= op_.checked;
if (!op.description.Length() && op_.description.Length())
op.description = op_.description;
@@ -1053,6 +1040,8 @@ void GridAccount::UpdateMeta(Operation& op)
if (updateCat)
op.category = category;
op.amount = _kiss->MetaAmount(op.id);
UpdateOperation(op);
}