mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Add first accounting implementation
This commit is contained in:
72
accounting/migrations/0001_initial.py
Normal file
72
accounting/migrations/0001_initial.py
Normal file
@ -0,0 +1,72 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.conf import settings
|
||||
import accounting.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0005_auto_20160128_0842'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Customer',
|
||||
fields=[
|
||||
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, primary_key=True, serialize=False)),
|
||||
('account_id', models.CharField(unique=True, verbose_name='account id', max_length=10)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'customer',
|
||||
'verbose_name_plural': 'customers',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='GeneralJournal',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)),
|
||||
('start_date', models.DateField(verbose_name='start date')),
|
||||
('end_date', models.DateField(null=True, verbose_name='end date', blank=True, default=None)),
|
||||
('name', models.CharField(verbose_name='name', max_length=30)),
|
||||
('closed', models.BooleanField(default=False, verbose_name='is closed')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='GenericInvoice',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(verbose_name='name', max_length=100)),
|
||||
('journal', models.ForeignKey(to='accounting.GeneralJournal', related_name='invoices')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Product',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(verbose_name='name', max_length=30)),
|
||||
('description', models.TextField(verbose_name='description')),
|
||||
('code', models.CharField(verbose_name='code', max_length=10)),
|
||||
('purchase_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='purchase price')),
|
||||
('selling_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='selling price')),
|
||||
('special_selling_price', accounting.models.CurrencyField(max_digits=12, decimal_places=2, verbose_name='special selling price')),
|
||||
('icon', models.ImageField(null=True, upload_to='products')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ProductType',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(verbose_name='name', max_length=30)),
|
||||
('description', models.TextField(verbose_name='description')),
|
||||
('icon', models.ImageField(null=True, upload_to='products')),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='product',
|
||||
name='product_type',
|
||||
field=models.ForeignKey(null=True, to='accounting.ProductType', related_name='products'),
|
||||
),
|
||||
]
|
39
accounting/migrations/0002_auto_20160128_1538.py
Normal file
39
accounting/migrations/0002_auto_20160128_1538.py
Normal file
@ -0,0 +1,39 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounting', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='product',
|
||||
name='description',
|
||||
field=models.TextField(verbose_name='description', blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='product',
|
||||
name='icon',
|
||||
field=models.ImageField(null=True, upload_to='products', blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='product',
|
||||
name='product_type',
|
||||
field=models.ForeignKey(to='accounting.ProductType', null=True, blank=True, related_name='products'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='producttype',
|
||||
name='description',
|
||||
field=models.TextField(verbose_name='description', null=True, blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='producttype',
|
||||
name='icon',
|
||||
field=models.ImageField(null=True, upload_to='products', blank=True),
|
||||
),
|
||||
]
|
0
accounting/migrations/__init__.py
Normal file
0
accounting/migrations/__init__.py
Normal file
Reference in New Issue
Block a user