mirror of
https://github.com/nanoy42/coope
synced 2024-11-17 00:43:12 +00:00
165 lines
9.5 KiB
Python
165 lines
9.5 KiB
Python
# Generated by Django 2.1 on 2018-10-04 09:32
|
|
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import gestion.models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('preferences', '0001_initial'),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='ConsumptionHistory',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('quantity', models.PositiveIntegerField(default=0)),
|
|
('date', models.DateTimeField(auto_now_add=True)),
|
|
('amount', models.DecimalField(decimal_places=2, default=0, max_digits=7)),
|
|
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='consumption_selled', to=settings.AUTH_USER_MODEL)),
|
|
('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='consumption_taken', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Keg',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=20, unique=True, verbose_name='Nom')),
|
|
('stockHold', models.IntegerField(default=0, verbose_name='Stock en soute')),
|
|
('barcode', models.CharField(max_length=20, unique=True, verbose_name='Code barre')),
|
|
('amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Prix du fût')),
|
|
('capacity', models.IntegerField(default=30, verbose_name='Capacité (L)')),
|
|
('is_active', models.BooleanField(default=False, verbose_name='Actif')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='KegHistory',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('openingDate', models.DateTimeField(auto_now_add=True)),
|
|
('quantitySold', models.DecimalField(decimal_places=2, max_digits=5)),
|
|
('amountSold', models.DecimalField(decimal_places=2, max_digits=5)),
|
|
('closingDate', models.DateTimeField()),
|
|
('isCurrentKegHistory', models.BooleanField(default=True)),
|
|
('Keg', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gestion.Keg')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Menu',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=255, verbose_name='Nom')),
|
|
('amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Montant')),
|
|
('barcode', models.CharField(max_length=20, unique=True, verbose_name='Code barre')),
|
|
('is_active', models.BooleanField(default=False, verbose_name='Actif')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='MenuHistory',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('quantity', models.PositiveIntegerField(default=0)),
|
|
('date', models.DateTimeField(auto_now_add=True)),
|
|
('amount', models.DecimalField(decimal_places=2, default=0, max_digits=5)),
|
|
('PaymentMethod', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='preferences.PaymentMethod')),
|
|
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='menu_selled', to=settings.AUTH_USER_MODEL)),
|
|
('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='menu_taken', to=settings.AUTH_USER_MODEL)),
|
|
('menu', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gestion.Menu')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Product',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=40, unique=True, verbose_name='Nom')),
|
|
('amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Prix de vente')),
|
|
('stockHold', models.IntegerField(default=0, verbose_name='Stock en soute')),
|
|
('stockBar', models.IntegerField(default=0, verbose_name='Stock en bar')),
|
|
('barcode', models.CharField(max_length=20, unique=True, verbose_name='Code barre')),
|
|
('category', models.CharField(choices=[('PP', 'Pinte Pression'), ('DP', 'Demi Pression'), ('GP', 'Galopin pression'), ('BT', 'Bouteille'), ('SO', 'Soft'), ('FO', 'Bouffe autre que panini'), ('PA', 'Bouffe pour panini')], default='FO', max_length=2, verbose_name='Catégorie')),
|
|
('needQuantityButton', models.BooleanField(default=False, verbose_name='Bouton quantité')),
|
|
('is_active', models.BooleanField(default=True, verbose_name='Actif')),
|
|
('volume', models.IntegerField(default=0)),
|
|
('deg', models.DecimalField(decimal_places=2, default=0, max_digits=5, verbose_name='Degré')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Raming',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('date', models.DateTimeField(auto_now_add=True)),
|
|
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
|
|
('keg', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gestion.Keg')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Refund',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('date', models.DateTimeField(auto_now_add=True)),
|
|
('amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Montant')),
|
|
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='refund_realized', to=settings.AUTH_USER_MODEL)),
|
|
('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='refund_taken', to=settings.AUTH_USER_MODEL, verbose_name='Client')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Reload',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Montant')),
|
|
('date', models.DateTimeField(auto_now_add=True)),
|
|
('PaymentMethod', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='preferences.PaymentMethod', verbose_name='Moyen de paiement')),
|
|
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='reload_realized', to=settings.AUTH_USER_MODEL)),
|
|
('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='reload_taken', to=settings.AUTH_USER_MODEL, verbose_name='Client')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Stocking',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('date', models.DateTimeField(auto_now_add=True)),
|
|
],
|
|
),
|
|
migrations.AddField(
|
|
model_name='menu',
|
|
name='articles',
|
|
field=models.ManyToManyField(to='gestion.Product', verbose_name='Produits'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='keg',
|
|
name='demi',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='futd', to='gestion.Product', validators=[gestion.models.isDemi]),
|
|
),
|
|
migrations.AddField(
|
|
model_name='keg',
|
|
name='galopin',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='futg', to='gestion.Product', validators=[gestion.models.isGalopin]),
|
|
),
|
|
migrations.AddField(
|
|
model_name='keg',
|
|
name='pinte',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='futp', to='gestion.Product', validators=[gestion.models.isPinte]),
|
|
),
|
|
migrations.AddField(
|
|
model_name='consumptionhistory',
|
|
name='menu',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='gestion.MenuHistory'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='consumptionhistory',
|
|
name='paymentMethod',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='preferences.PaymentMethod'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='consumptionhistory',
|
|
name='product',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gestion.Product'),
|
|
),
|
|
]
|