234 lines
7.8 KiB
Python
234 lines
7.8 KiB
Python
# 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
|
|
|
|
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Account",
|
|
fields=[
|
|
(
|
|
"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,
|
|
),
|
|
),
|
|
],
|
|
options={"abstract": False},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Order",
|
|
fields=[
|
|
(
|
|
"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,
|
|
),
|
|
),
|
|
],
|
|
options={"verbose_name": "Order", "verbose_name_plural": "Orders"},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Payment",
|
|
fields=[
|
|
(
|
|
"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",
|
|
),
|
|
),
|
|
],
|
|
options={"verbose_name": "payment", "verbose_name_plural": "payments"},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Transaction",
|
|
fields=[
|
|
(
|
|
"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",
|
|
),
|
|
),
|
|
],
|
|
options={"abstract": False},
|
|
),
|
|
]
|