remove currency from amount fields in exported history
This commit is contained in:
@@ -148,7 +148,7 @@ class Satoshis(object):
|
|||||||
return 'Satoshis(%d)'%self.value
|
return 'Satoshis(%d)'%self.value
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return format_satoshis(self.value) + " BTC"
|
return format_satoshis(self.value)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return self.value == other.value
|
return self.value == other.value
|
||||||
@@ -174,7 +174,7 @@ class Fiat(object):
|
|||||||
if self.value is None or self.value.is_nan():
|
if self.value is None or self.value.is_nan():
|
||||||
return _('No Data')
|
return _('No Data')
|
||||||
else:
|
else:
|
||||||
return "{:.2f}".format(self.value) + ' ' + self.ccy
|
return "{:.2f}".format(self.value)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return self.ccy == other.ccy and self.value == other.value
|
return self.ccy == other.ccy and self.value == other.value
|
||||||
|
|||||||
@@ -508,19 +508,20 @@ class Abstract_Wallet(AddressSynchronizer):
|
|||||||
'to_height': to_height,
|
'to_height': to_height,
|
||||||
'start_balance': Satoshis(start_balance),
|
'start_balance': Satoshis(start_balance),
|
||||||
'end_balance': Satoshis(end_balance),
|
'end_balance': Satoshis(end_balance),
|
||||||
'income': Satoshis(income),
|
'incoming': Satoshis(income),
|
||||||
'expenditures': Satoshis(expenditures)
|
'outgoing': Satoshis(expenditures)
|
||||||
}
|
}
|
||||||
if fx and fx.is_enabled() and fx.get_history_config():
|
if fx and fx.is_enabled() and fx.get_history_config():
|
||||||
unrealized = self.unrealized_gains(domain, fx.timestamp_rate, fx.ccy)
|
unrealized = self.unrealized_gains(domain, fx.timestamp_rate, fx.ccy)
|
||||||
summary['capital_gains'] = Fiat(capital_gains, fx.ccy)
|
summary['fiat_currency'] = fx.ccy
|
||||||
summary['fiat_income'] = Fiat(fiat_income, fx.ccy)
|
summary['fiat_capital_gains'] = Fiat(capital_gains, fx.ccy)
|
||||||
summary['fiat_expenditures'] = Fiat(fiat_expenditures, fx.ccy)
|
summary['fiat_incoming'] = Fiat(fiat_income, fx.ccy)
|
||||||
summary['unrealized_gains'] = Fiat(unrealized, fx.ccy)
|
summary['fiat_outgoing'] = Fiat(fiat_expenditures, fx.ccy)
|
||||||
summary['start_fiat_balance'] = Fiat(fx.historical_value(start_balance, start_date), fx.ccy)
|
summary['fiat_unrealized_gains'] = Fiat(unrealized, fx.ccy)
|
||||||
summary['end_fiat_balance'] = Fiat(fx.historical_value(end_balance, end_date), fx.ccy)
|
summary['fiat_start_balance'] = Fiat(fx.historical_value(start_balance, start_date), fx.ccy)
|
||||||
summary['start_fiat_value'] = Fiat(fx.historical_value(COIN, start_date), fx.ccy)
|
summary['fiat_end_balance'] = Fiat(fx.historical_value(end_balance, end_date), fx.ccy)
|
||||||
summary['end_fiat_value'] = Fiat(fx.historical_value(COIN, end_date), fx.ccy)
|
summary['fiat_start_value'] = Fiat(fx.historical_value(COIN, start_date), fx.ccy)
|
||||||
|
summary['fiat_end_value'] = Fiat(fx.historical_value(COIN, end_date), fx.ccy)
|
||||||
else:
|
else:
|
||||||
summary = {}
|
summary = {}
|
||||||
return {
|
return {
|
||||||
@@ -538,6 +539,7 @@ class Abstract_Wallet(AddressSynchronizer):
|
|||||||
fiat_rate = self.price_at_timestamp(tx_hash, fx.timestamp_rate)
|
fiat_rate = self.price_at_timestamp(tx_hash, fx.timestamp_rate)
|
||||||
fiat_value = fiat_value if fiat_value is not None else self.default_fiat_value(tx_hash, fx, value)
|
fiat_value = fiat_value if fiat_value is not None else self.default_fiat_value(tx_hash, fx, value)
|
||||||
fiat_fee = tx_fee / Decimal(COIN) * fiat_rate if tx_fee is not None else None
|
fiat_fee = tx_fee / Decimal(COIN) * fiat_rate if tx_fee is not None else None
|
||||||
|
item['fiat_currency'] = fx.ccy
|
||||||
item['fiat_rate'] = Fiat(fiat_rate, fx.ccy)
|
item['fiat_rate'] = Fiat(fiat_rate, fx.ccy)
|
||||||
item['fiat_value'] = Fiat(fiat_value, fx.ccy)
|
item['fiat_value'] = Fiat(fiat_value, fx.ccy)
|
||||||
item['fiat_fee'] = Fiat(fiat_fee, fx.ccy) if fiat_fee else None
|
item['fiat_fee'] = Fiat(fiat_fee, fx.ccy) if fiat_fee else None
|
||||||
|
|||||||
Reference in New Issue
Block a user