Fix a bug : Don't add operation if amount not set
This commit is contained in:
parent
f0e0aba4f3
commit
20be059f27
|
@ -1008,18 +1008,23 @@ void GridAccount::OnOperationModified(int row, int col)
|
|||
op_complete--;
|
||||
new_op.formula = _displayedOperations[row].formula;
|
||||
}
|
||||
|
||||
value = item(row, CREDIT)->text();
|
||||
if (value.length())
|
||||
else
|
||||
{
|
||||
new_op.amount = value.replace(".", "").toInt();
|
||||
if (new_op.amount < 0)
|
||||
{
|
||||
new_op.amount *= -1.0;
|
||||
setItem(row, DEBIT, new QTableWidgetItem(value.sprintf("%.2lf", (double)new_op.amount/100)));
|
||||
}
|
||||
op_complete--;
|
||||
new_op.formula = _displayedOperations[row].formula;
|
||||
value = item(row, CREDIT)->text();
|
||||
if (value.length())
|
||||
{
|
||||
new_op.amount = value.replace(".", "").toInt();
|
||||
if (new_op.amount < 0)
|
||||
{
|
||||
new_op.amount *= -1.0;
|
||||
setItem(row, DEBIT, new QTableWidgetItem(value.sprintf("%.2lf", (double)new_op.amount/100)));
|
||||
}
|
||||
op_complete--;
|
||||
new_op.formula = _displayedOperations[row].formula;
|
||||
}
|
||||
else
|
||||
// Don't add operation if amount not set
|
||||
op_complete += 100;
|
||||
}
|
||||
|
||||
value = item(row, CATEGORY)->text();
|
||||
|
|
Loading…
Reference in New Issue
Block a user