2016-01-28 15:53:37 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import migrations, models
|
2016-04-20 01:30:49 +00:00
|
|
|
import accounting.models
|
2016-01-28 15:53:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
2016-08-10 11:52:57 +00:00
|
|
|
('core', '0001_initial'),
|
|
|
|
('club', '0001_initial'),
|
2016-01-28 15:53:37 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
2016-04-20 01:30:49 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='AccountingType',
|
|
|
|
fields=[
|
2016-08-10 11:52:57 +00:00
|
|
|
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
|
|
|
|
('code', models.CharField(verbose_name='code', max_length=16)),
|
|
|
|
('label', models.CharField(verbose_name='label', max_length=60)),
|
|
|
|
('movement_type', models.CharField(verbose_name='movement type', choices=[('credit', 'Credit'), ('debit', 'Debit'), ('neutral', 'Neutral')], max_length=12)),
|
2016-04-20 01:30:49 +00:00
|
|
|
],
|
2016-08-10 11:52:57 +00:00
|
|
|
options={
|
|
|
|
'verbose_name': 'accounting type',
|
|
|
|
},
|
2016-04-20 01:30:49 +00:00
|
|
|
),
|
2016-04-20 00:07:01 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='BankAccount',
|
|
|
|
fields=[
|
2016-08-10 11:52:57 +00:00
|
|
|
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
|
|
|
|
('name', models.CharField(verbose_name='name', max_length=30)),
|
|
|
|
('iban', models.CharField(blank=True, verbose_name='iban', max_length=255)),
|
|
|
|
('number', models.CharField(blank=True, verbose_name='account number', max_length=255)),
|
|
|
|
('club', models.ForeignKey(related_name='bank_accounts', to='club.Club')),
|
2016-04-20 00:07:01 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='ClubAccount',
|
|
|
|
fields=[
|
2016-08-10 11:52:57 +00:00
|
|
|
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', 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_account', to='club.Club')),
|
2016-04-20 00:07:01 +00:00
|
|
|
],
|
|
|
|
),
|
2016-08-10 11:52:57 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='Company',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
|
|
|
|
('name', models.CharField(verbose_name='name', max_length=60)),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'verbose_name': 'company',
|
|
|
|
},
|
|
|
|
),
|
2016-01-28 15:53:37 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='GeneralJournal',
|
|
|
|
fields=[
|
2016-08-10 11:52:57 +00:00
|
|
|
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
|
2016-01-28 15:53:37 +00:00
|
|
|
('start_date', models.DateField(verbose_name='start date')),
|
2016-08-10 11:52:57 +00:00
|
|
|
('end_date', models.DateField(default=None, null=True, verbose_name='end date', blank=True)),
|
|
|
|
('name', models.CharField(verbose_name='name', max_length=30)),
|
|
|
|
('closed', models.BooleanField(default=False, verbose_name='is closed')),
|
|
|
|
('amount', accounting.models.CurrencyField(default=0, decimal_places=2, max_digits=12, verbose_name='amount')),
|
|
|
|
('effective_amount', accounting.models.CurrencyField(default=0, decimal_places=2, max_digits=12, verbose_name='effective_amount')),
|
|
|
|
('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-08-10 11:52:57 +00:00
|
|
|
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
|
|
|
|
('number', models.IntegerField(verbose_name='number')),
|
|
|
|
('amount', accounting.models.CurrencyField(decimal_places=2, max_digits=12, verbose_name='amount')),
|
2016-04-20 01:30:49 +00:00
|
|
|
('date', models.DateField(verbose_name='date')),
|
2016-08-10 11:52:57 +00:00
|
|
|
('label', models.CharField(verbose_name='label', max_length=50)),
|
|
|
|
('remark', models.TextField(verbose_name='remark', max_length=255)),
|
|
|
|
('mode', models.CharField(verbose_name='payment method', choices=[('CHEQUE', 'Check'), ('CASH', 'Cash'), ('TRANSFert', 'Transfert'), ('CARD', 'Credit card')], max_length=255)),
|
|
|
|
('cheque_number', models.IntegerField(default=-1, verbose_name='cheque number')),
|
|
|
|
('done', models.BooleanField(default=False, verbose_name='is done')),
|
|
|
|
('target_type', models.CharField(verbose_name='target type', choices=[('USER', 'User'), ('CLUB', 'Club'), ('ACCOUNT', 'Account'), ('COMPANY', 'Company'), ('OTHER', 'Other')], max_length=10)),
|
|
|
|
('target_id', models.IntegerField(null=True, verbose_name='target id', blank=True)),
|
|
|
|
('target_label', models.CharField(default='', blank=True, verbose_name='target label', max_length=32)),
|
|
|
|
('accounting_type', models.ForeignKey(verbose_name='accounting type', related_name='operations', to='accounting.AccountingType')),
|
|
|
|
('invoice', models.ForeignKey(verbose_name='invoice', related_name='operations', blank=True, null=True, to='core.SithFile')),
|
|
|
|
('journal', models.ForeignKey(related_name='operations', to='accounting.GeneralJournal')),
|
2016-01-28 15:53:37 +00:00
|
|
|
],
|
2016-08-10 11:52:57 +00:00
|
|
|
options={
|
|
|
|
'ordering': ['-number'],
|
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='operation',
|
|
|
|
unique_together=set([('number', 'journal')]),
|
2016-01-28 15:53:37 +00:00
|
|
|
),
|
|
|
|
]
|