[Untested] Fix balance deductions
This commit is contained in:
parent
2654b044b2
commit
4738a65dcc
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -603,6 +603,14 @@ public class DatabaseManager extends SQLiteOpenHelper{
|
||||
currencyList.add(new Currency(resultatList.getString(resultatList.getColumnIndex(KEY_TRANSACTION_SYMBOL))
|
||||
, resultatList.getDouble(resultatList.getColumnIndex(KEY_TRANSACTION_AMOUNT))));
|
||||
}
|
||||
|
||||
if(resultatList.getInt(resultatList.getColumnIndex(KEY_TRANSACTION_DEDUCT)) == 1)
|
||||
{
|
||||
currencyList.add(new Currency(resultatList.getString(resultatList.getColumnIndex(KEY_TRANSACTION_PAIR))
|
||||
, -(resultatList.getDouble(resultatList.getColumnIndex(KEY_TRANSACTION_PURCHASE_PRICE))
|
||||
* resultatList.getDouble(resultatList.getColumnIndex(KEY_TRANSACTION_AMOUNT))
|
||||
+ resultatList.getDouble(resultatList.getColumnIndex(KEY_TRANSACTION_FEES)))));
|
||||
}
|
||||
break;
|
||||
case "s":
|
||||
if(symbol.equals(feeSym))
|
||||
@ -615,6 +623,14 @@ public class DatabaseManager extends SQLiteOpenHelper{
|
||||
currencyList.add(new Currency(resultatList.getString(resultatList.getColumnIndex(KEY_TRANSACTION_SYMBOL))
|
||||
, -resultatList.getDouble(resultatList.getColumnIndex(KEY_TRANSACTION_AMOUNT))));
|
||||
}
|
||||
|
||||
if(resultatList.getInt(resultatList.getColumnIndex(KEY_TRANSACTION_DEDUCT)) == 1)
|
||||
{
|
||||
currencyList.add(new Currency(resultatList.getString(resultatList.getColumnIndex(KEY_TRANSACTION_PAIR))
|
||||
, resultatList.getDouble(resultatList.getColumnIndex(KEY_TRANSACTION_PURCHASE_PRICE))
|
||||
* resultatList.getDouble(resultatList.getColumnIndex(KEY_TRANSACTION_AMOUNT))
|
||||
- resultatList.getDouble(resultatList.getColumnIndex(KEY_TRANSACTION_FEES))));
|
||||
}
|
||||
break;
|
||||
case "t":
|
||||
if(isBalanceRelated(resultatList.getString(resultatList.getColumnIndex(KEY_TRANSACTION_SOURCE))) && isBalanceRelated(resultatList.getString(resultatList.getColumnIndex(KEY_TRANSACTION_DESTINATION))))
|
||||
|
Loading…
Reference in New Issue
Block a user