2018-06-23 19:08:56 +00:00
|
|
|
# Generated by Django 2.0.6 on 2018-06-23 19:51
|
|
|
|
from decimal import Decimal
|
|
|
|
|
|
|
|
import django.db.models.deletion
|
|
|
|
import djmoney.models.fields
|
|
|
|
from django.conf import settings
|
|
|
|
from django.db import migrations
|
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
2019-08-31 22:27:36 +00:00
|
|
|
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
2018-06-23 19:08:56 +00:00
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2019-08-31 22:27:36 +00:00
|
|
|
name="Account",
|
2018-06-23 19:08:56 +00:00
|
|
|
fields=[
|
2019-08-31 22:27:36 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"modified",
|
|
|
|
models.DateTimeField(auto_now=True, verbose_name="modified"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"created",
|
|
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"owner",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
),
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
],
|
2019-08-31 22:27:36 +00:00
|
|
|
options={"abstract": False},
|
2018-06-23 19:08:56 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2019-08-31 22:27:36 +00:00
|
|
|
name="Order",
|
2018-06-23 19:08:56 +00:00
|
|
|
fields=[
|
2019-08-31 22:27:36 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"modified",
|
|
|
|
models.DateTimeField(auto_now=True, verbose_name="modified"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"created",
|
|
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"description",
|
|
|
|
models.CharField(max_length=1024, verbose_name="description"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"price_currency",
|
|
|
|
djmoney.models.fields.CurrencyField(
|
|
|
|
choices=[("DKK", "DKK")],
|
|
|
|
default="XYZ",
|
|
|
|
editable=False,
|
|
|
|
max_length=3,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"price",
|
|
|
|
djmoney.models.fields.MoneyField(
|
|
|
|
decimal_places=2,
|
|
|
|
default=Decimal("0.0"),
|
|
|
|
max_digits=16,
|
|
|
|
verbose_name="price (excl. VAT)",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"vat_currency",
|
|
|
|
djmoney.models.fields.CurrencyField(
|
|
|
|
choices=[("DKK", "DKK")],
|
|
|
|
default="XYZ",
|
|
|
|
editable=False,
|
|
|
|
max_length=3,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"vat",
|
|
|
|
djmoney.models.fields.MoneyField(
|
|
|
|
decimal_places=2,
|
|
|
|
default=Decimal("0.0"),
|
|
|
|
max_digits=16,
|
|
|
|
verbose_name="VAT",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("is_paid", models.BooleanField(default=False, verbose_name="is paid")),
|
|
|
|
(
|
|
|
|
"account",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
|
|
to="accounting.Account",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"user",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
),
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
],
|
2019-08-31 22:27:36 +00:00
|
|
|
options={"verbose_name": "Order", "verbose_name_plural": "Orders"},
|
2018-06-23 19:08:56 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2019-08-31 22:27:36 +00:00
|
|
|
name="Payment",
|
2018-06-23 19:08:56 +00:00
|
|
|
fields=[
|
2019-08-31 22:27:36 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"modified",
|
|
|
|
models.DateTimeField(auto_now=True, verbose_name="modified"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"created",
|
|
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"amount_currency",
|
|
|
|
djmoney.models.fields.CurrencyField(
|
|
|
|
choices=[("DKK", "DKK")],
|
|
|
|
default="XYZ",
|
|
|
|
editable=False,
|
|
|
|
max_length=3,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"amount",
|
|
|
|
djmoney.models.fields.MoneyField(
|
|
|
|
decimal_places=2, default=Decimal("0.0"), max_digits=16
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"description",
|
|
|
|
models.CharField(max_length=1024, verbose_name="description"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"stripe_charge_id",
|
|
|
|
models.CharField(blank=True, max_length=255, null=True),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"order",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
|
|
to="accounting.Order",
|
|
|
|
),
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
],
|
2019-08-31 22:27:36 +00:00
|
|
|
options={"verbose_name": "payment", "verbose_name_plural": "payments"},
|
2018-06-23 19:08:56 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2019-08-31 22:27:36 +00:00
|
|
|
name="Transaction",
|
2018-06-23 19:08:56 +00:00
|
|
|
fields=[
|
2019-08-31 22:27:36 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"modified",
|
|
|
|
models.DateTimeField(auto_now=True, verbose_name="modified"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"created",
|
|
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"amount_currency",
|
|
|
|
djmoney.models.fields.CurrencyField(
|
|
|
|
choices=[("DKK", "DKK")],
|
|
|
|
default="XYZ",
|
|
|
|
editable=False,
|
|
|
|
max_length=3,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"amount",
|
|
|
|
djmoney.models.fields.MoneyField(
|
|
|
|
decimal_places=2,
|
|
|
|
default=Decimal("0.0"),
|
|
|
|
help_text="This will include VAT",
|
|
|
|
max_digits=16,
|
|
|
|
verbose_name="amount",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"description",
|
|
|
|
models.CharField(max_length=1024, verbose_name="description"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"account",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
|
|
related_name="transactions",
|
|
|
|
to="accounting.Account",
|
|
|
|
),
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
],
|
2019-08-31 22:27:36 +00:00
|
|
|
options={"abstract": False},
|
2018-06-23 19:08:56 +00:00
|
|
|
),
|
|
|
|
]
|