Auto fill operation amount if it was the same for the last 3 operations

This commit is contained in:
2018-10-03 09:05:21 +02:00
parent 10c534857d
commit 951793567a
3 changed files with 50 additions and 14 deletions

View File

@@ -1050,6 +1050,12 @@ void GridAccount::OnOperationModified(int row, int col)
new_op.fix_cost = (new_op.category == user->GetCategoryId("Fix"));
if (op_tmp.transfert != 0)
transfertCompleted = true;
/* Non null value --> set amount */
if (op_tmp.amount > 0)
setItem(row, CREDIT, new QTableWidgetItem(value.sprintf("%.2lf", (double)op_tmp.amount/100)));
else if (op_tmp.amount < 0)
setItem(row, DEBIT, new QTableWidgetItem(value.sprintf("%.2lf", (double)-op_tmp.amount/100)));
}
}