Sith/accounting/migrations/0001_initial.py

93 lines
4.5 KiB
Python
Raw Normal View History

2016-01-28 15:53:37 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import accounting.models
from django.conf import settings
2016-01-28 15:53:37 +00:00
class Migration(migrations.Migration):
dependencies = [
('club', '__first__'),
('core', '0001_initial'),
2016-01-28 15:53:37 +00:00
]
operations = [
migrations.CreateModel(
name='BankAccount',
fields=[
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
('name', models.CharField(verbose_name='name', max_length=30)),
('rib', models.CharField(verbose_name='rib', max_length=255)),
('number', models.CharField(verbose_name='account number', max_length=255)),
],
),
migrations.CreateModel(
name='ClubAccount',
fields=[
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
('name', models.CharField(verbose_name='name', max_length=30)),
('bank_account', models.ForeignKey(related_name='club_accounts', to='accounting.BankAccount')),
('club', models.OneToOneField(related_name='club_accounts', to='club.Club')),
],
),
2016-01-28 15:53:37 +00:00
migrations.CreateModel(
name='Customer',
fields=[
('user', models.OneToOneField(primary_key=True, to=settings.AUTH_USER_MODEL, serialize=False)),
('account_id', models.CharField(verbose_name='account id', unique=True, max_length=10)),
2016-01-28 15:53:37 +00:00
],
options={
2016-03-29 10:45:10 +00:00
'verbose_name_plural': 'customers',
'verbose_name': 'customer',
2016-01-28 15:53:37 +00:00
},
),
migrations.CreateModel(
name='GeneralJournal',
fields=[
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
2016-01-28 15:53:37 +00:00
('start_date', models.DateField(verbose_name='start date')),
('end_date', models.DateField(default=None, verbose_name='end date', null=True, blank=True)),
('name', models.CharField(verbose_name='name', max_length=30)),
2016-01-28 15:53:37 +00:00
('closed', models.BooleanField(default=False, verbose_name='is closed')),
('club_account', models.ForeignKey(related_name='journals', to='accounting.ClubAccount')),
2016-01-28 15:53:37 +00:00
],
),
migrations.CreateModel(
name='Operation',
2016-01-28 15:53:37 +00:00
fields=[
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
('name', models.CharField(verbose_name='name', max_length=100)),
('journal', models.ForeignKey(related_name='invoices', to='accounting.GeneralJournal')),
2016-01-28 15:53:37 +00:00
],
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
('name', models.CharField(verbose_name='name', max_length=30)),
('description', models.TextField(blank=True, verbose_name='description')),
('code', models.CharField(verbose_name='code', max_length=10)),
('purchase_price', accounting.models.CurrencyField(verbose_name='purchase price', decimal_places=2, max_digits=12)),
('selling_price', accounting.models.CurrencyField(verbose_name='selling price', decimal_places=2, max_digits=12)),
('special_selling_price', accounting.models.CurrencyField(verbose_name='special selling price', decimal_places=2, max_digits=12)),
('icon', models.ImageField(blank=True, null=True, upload_to='products')),
2016-01-28 15:53:37 +00:00
],
),
migrations.CreateModel(
name='ProductType',
fields=[
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
('name', models.CharField(verbose_name='name', max_length=30)),
('description', models.TextField(blank=True, verbose_name='description', null=True)),
('icon', models.ImageField(blank=True, null=True, upload_to='products')),
2016-01-28 15:53:37 +00:00
],
),
migrations.AddField(
model_name='product',
name='product_type',
field=models.ForeignKey(blank=True, related_name='products', null=True, to='accounting.ProductType'),
2016-01-28 15:53:37 +00:00
),
]