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
|
2016-04-20 00:07:01 +00:00
|
|
|
from django.conf import settings
|
2016-01-28 15:53:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
2016-04-20 00:07:01 +00:00
|
|
|
('club', '__first__'),
|
2016-01-29 14:20:00 +00:00
|
|
|
('core', '0001_initial'),
|
2016-01-28 15:53:37 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
2016-04-20 00:07:01 +00:00
|
|
|
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=[
|
2016-04-20 00:07:01 +00:00
|
|
|
('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',
|
2016-04-20 00:07:01 +00:00
|
|
|
'verbose_name': 'customer',
|
2016-01-28 15:53:37 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='GeneralJournal',
|
|
|
|
fields=[
|
2016-04-20 00:07:01 +00:00
|
|
|
('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')),
|
2016-04-20 00:07:01 +00:00
|
|
|
('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')),
|
2016-04-20 00:07:01 +00:00
|
|
|
('club_account', models.ForeignKey(related_name='journals', to='accounting.ClubAccount')),
|
2016-01-28 15:53:37 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2016-04-20 00:07:01 +00:00
|
|
|
name='Operation',
|
2016-01-28 15:53:37 +00:00
|
|
|
fields=[
|
2016-04-20 00:07:01 +00:00
|
|
|
('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=[
|
2016-04-20 00:07:01 +00:00
|
|
|
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
|
|
|
|
('name', models.CharField(verbose_name='name', max_length=30)),
|
2016-01-29 14:20:00 +00:00
|
|
|
('description', models.TextField(blank=True, verbose_name='description')),
|
2016-04-20 00:07:01 +00:00
|
|
|
('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=[
|
2016-04-20 00:07:01 +00:00
|
|
|
('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',
|
2016-04-20 00:07:01 +00:00
|
|
|
field=models.ForeignKey(blank=True, related_name='products', null=True, to='accounting.ProductType'),
|
2016-01-28 15:53:37 +00:00
|
|
|
),
|
|
|
|
]
|