fix for fees for selling.
fix for taxfree amount. add description to transactions.
This commit is contained in:
@@ -37,7 +37,7 @@ class ImportBtcDe:
|
||||
if trade['trading_pair'].upper().endswith(f):
|
||||
t.fiat_currency = f
|
||||
t.owner = Owner
|
||||
t.crypto_amount = Decimal(trade['amount_currency_to_trade'])
|
||||
t.crypto_amount = Decimal(trade['amount_currency_to_trade'])-Decimal(trade['amount_currency_to_trade'])
|
||||
t.crypto_fee = Decimal(trade['fee_currency_to_trade'])
|
||||
t.fiat_amount = Decimal(trade['volume_currency_to_pay'])
|
||||
t.fiat_fee = Decimal(trade['fee_currency_to_pay'])
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# Generated by Django 3.2.2 on 2021-05-11 20:30
|
||||
|
||||
import apps.transactions.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('transactions', '0005_auto_20210511_1638'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='transaction',
|
||||
name='description',
|
||||
field=models.CharField(blank=True, max_length=100, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='transaction',
|
||||
name='crypto_amount',
|
||||
field=apps.transactions.models.NonscientificDecimalField(blank=True, decimal_places=10, max_digits=24, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='transaction',
|
||||
name='crypto_fee',
|
||||
field=apps.transactions.models.NonscientificDecimalField(blank=True, decimal_places=10, max_digits=24, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='transaction',
|
||||
name='exchange_rate',
|
||||
field=apps.transactions.models.NonscientificDecimalField(decimal_places=10, max_digits=24),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='transaction',
|
||||
name='fiat_amount',
|
||||
field=apps.transactions.models.NonscientificDecimalField(blank=True, decimal_places=10, max_digits=24, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='transaction',
|
||||
name='fiat_fee',
|
||||
field=apps.transactions.models.NonscientificDecimalField(blank=True, decimal_places=10, max_digits=24, null=True),
|
||||
),
|
||||
]
|
||||
@@ -40,6 +40,7 @@ class Transaction(models.Model):
|
||||
fiat_fee = NonscientificDecimalField(max_digits=24, decimal_places=10, null=True, blank=True)
|
||||
date_valid = models.DateTimeField('date transfered')
|
||||
transaction_type = models.CharField(max_length=1, choices=TRANSACTION_TYPES, default='B')
|
||||
description = models.CharField(max_length=100, null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
db_table = "transaction"
|
||||
|
||||
@@ -98,6 +98,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">Description:</label>
|
||||
<div class="col-sm-4">
|
||||
{{ form.description }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-1 col-form-label"></label>
|
||||
<div class="col-sm-4">
|
||||
|
||||
@@ -92,6 +92,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">Description:</label>
|
||||
<div class="col-sm-4">
|
||||
{{ form.description }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-1 col-form-label"></label>
|
||||
<div class="col-sm-4">
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for transaction in transactions %}
|
||||
{% if transaction.description and transaction.description != '' %}
|
||||
<tr>
|
||||
<td colspan="5">{{ transaction.description }}:</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td>{{ transaction.date_valid }}</td>
|
||||
<td>{{ transaction.crypto_amount|floatformat:3 }}
|
||||
|
||||
Reference in New Issue
Block a user