# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-11 06:23
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('Teorema', '0002_um'),
        ('categorie', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='DDTVendita',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codice', models.CharField(max_length=20)),
                ('nome', models.CharField(max_length=40)),
                ('note', models.TextField(max_length=800)),
                ('data', models.DateField()),
                ('consegna', models.DateField()),
                ('costo_netto', models.DecimalField(decimal_places=2, max_digits=12)),
                ('costo_iva', models.DecimalField(decimal_places=2, max_digits=12)),
                ('costo_totale', models.DecimalField(decimal_places=2, max_digits=12)),
                ('categoria_vendita', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='categorie.CategoriaVendita')),
                ('centro_cr', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.CentroCR')),
                ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.Cliente')),
            ],
        ),
        migrations.CreateModel(
            name='FatturaAttiva',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codice', models.CharField(max_length=20)),
                ('nome', models.CharField(max_length=40)),
                ('note', models.TextField(max_length=800)),
                ('data', models.DateField()),
                ('costo_netto', models.DecimalField(decimal_places=2, max_digits=12)),
                ('costo_iva', models.DecimalField(decimal_places=2, max_digits=12)),
                ('costo_totale', models.DecimalField(decimal_places=2, max_digits=12)),
                ('categoria_acquisto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='categorie.CategoriaVendita')),
                ('centro_cr', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.CentroCR')),
                ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.Cliente')),
                ('ddt', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.DDTVendita')),
            ],
        ),
        migrations.CreateModel(
            name='OrdineVendita',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codice', models.CharField(max_length=20)),
                ('nome', models.CharField(max_length=40)),
                ('note', models.TextField(max_length=800)),
                ('data', models.DateField()),
                ('scadenza', models.DateField()),
                ('costo_netto', models.DecimalField(decimal_places=2, max_digits=12)),
                ('costo_iva', models.DecimalField(decimal_places=2, max_digits=12)),
                ('costo_totale', models.DecimalField(decimal_places=2, max_digits=12)),
                ('categoria_acquisto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='categorie.CategoriaVendita')),
                ('centro_cr', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.CentroCR')),
                ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.Cliente')),
            ],
        ),
        migrations.CreateModel(
            name='PreventivoVendita',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codice', models.CharField(max_length=20)),
                ('nome', models.CharField(max_length=40)),
                ('note', models.TextField(max_length=800)),
                ('data', models.DateField()),
                ('scadenza', models.DateField()),
                ('budget_netto', models.DecimalField(decimal_places=2, max_digits=12)),
                ('budget_iva', models.DecimalField(decimal_places=2, max_digits=12)),
                ('budget_totale', models.DecimalField(decimal_places=2, max_digits=12)),
                ('categoria_vendita', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='categorie.CategoriaVendita')),
                ('centro_cr', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.CentroCR')),
                ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.Cliente')),
                ('valuta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.Valuta')),
            ],
        ),
        migrations.CreateModel(
            name='RecordDDTVendita',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codice', models.CharField(max_length=20)),
                ('nome', models.CharField(max_length=60)),
                ('descrizione', models.CharField(max_length=240)),
                ('note', models.TextField(max_length=800)),
                ('quantita', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_cad', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_netto', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_iva', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_totale', models.DecimalField(decimal_places=2, max_digits=10)),
                ('articolo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='Teorema.Articolo')),
                ('ddt', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.DDTVendita')),
                ('um', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.UM')),
            ],
        ),
        migrations.CreateModel(
            name='RecordFatturaAttiva',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codice', models.CharField(max_length=20)),
                ('nome', models.CharField(max_length=60)),
                ('descrizione', models.CharField(max_length=240)),
                ('note', models.TextField(max_length=800)),
                ('quantita', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_cad', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_netto', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_iva', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_totale', models.DecimalField(decimal_places=2, max_digits=10)),
                ('articolo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='Teorema.Articolo')),
                ('fattura', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.FatturaAttiva')),
                ('um', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.UM')),
            ],
        ),
        migrations.CreateModel(
            name='RecordOrdineVendita',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codice', models.CharField(max_length=20)),
                ('nome', models.CharField(max_length=60)),
                ('descrizione', models.CharField(max_length=240)),
                ('note', models.TextField(max_length=800)),
                ('quantita', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_cad', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_netto', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_iva', models.DecimalField(decimal_places=2, max_digits=10)),
                ('costo_totale', models.DecimalField(decimal_places=2, max_digits=10)),
                ('articolo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='Teorema.Articolo')),
                ('ordine', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.OrdineVendita')),
                ('um', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.UM')),
            ],
        ),
        migrations.CreateModel(
            name='RecordPreventivoVendita',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codice', models.CharField(max_length=20)),
                ('nome', models.CharField(max_length=60)),
                ('descrizione', models.CharField(max_length=240)),
                ('note', models.TextField(max_length=800)),
                ('quantita', models.DecimalField(decimal_places=2, max_digits=10)),
                ('budget_cad', models.DecimalField(decimal_places=2, max_digits=10)),
                ('budget_netto', models.DecimalField(decimal_places=2, max_digits=10)),
                ('budget_iva', models.DecimalField(decimal_places=2, max_digits=10)),
                ('budget_totale', models.DecimalField(decimal_places=2, max_digits=10)),
                ('articolo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='Teorema.Articolo')),
                ('preventivo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.PreventivoVendita')),
                ('um', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.UM')),
            ],
        ),
        migrations.CreateModel(
            name='RecordVendita',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codice', models.CharField(max_length=20)),
                ('nome', models.CharField(max_length=60)),
                ('descrizione', models.CharField(max_length=240)),
                ('note', models.TextField(max_length=800)),
                ('quantita', models.DecimalField(decimal_places=2, max_digits=10)),
                ('budget_cad', models.DecimalField(decimal_places=2, max_digits=10)),
                ('budget_netto', models.DecimalField(decimal_places=2, max_digits=10)),
                ('budget_iva', models.DecimalField(decimal_places=2, max_digits=10)),
                ('budget_totale', models.DecimalField(decimal_places=2, max_digits=10)),
                ('articolo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='Teorema.Articolo')),
                ('um', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.UM')),
            ],
        ),
        migrations.CreateModel(
            name='Vendita',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codice', models.CharField(max_length=20)),
                ('nome', models.CharField(max_length=40)),
                ('note', models.TextField(max_length=800)),
                ('data', models.DateField()),
                ('scadenza', models.DateField()),
                ('budget_netto', models.DecimalField(decimal_places=2, max_digits=12)),
                ('budget_iva', models.DecimalField(decimal_places=2, max_digits=12)),
                ('budget_totale', models.DecimalField(decimal_places=2, max_digits=12)),
                ('categoria_vendita', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='categorie.CategoriaVendita')),
                ('centro_cr', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.CentroCR')),
                ('valuta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.Valuta')),
            ],
        ),
        migrations.AddField(
            model_name='recordvendita',
            name='vendita',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.Vendita'),
        ),
        migrations.AddField(
            model_name='preventivovendita',
            name='vendita',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.Vendita'),
        ),
        migrations.AddField(
            model_name='ordinevendita',
            name='preventivo',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='vendite.PreventivoVendita'),
        ),
        migrations.AddField(
            model_name='ordinevendita',
            name='valuta',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.Valuta'),
        ),
        migrations.AddField(
            model_name='ordinevendita',
            name='vendita',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.Vendita'),
        ),
        migrations.AddField(
            model_name='fatturaattiva',
            name='ordine',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.OrdineVendita'),
        ),
        migrations.AddField(
            model_name='fatturaattiva',
            name='preventivo',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='vendite.PreventivoVendita'),
        ),
        migrations.AddField(
            model_name='fatturaattiva',
            name='valuta',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.Valuta'),
        ),
        migrations.AddField(
            model_name='fatturaattiva',
            name='vendita',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.Vendita'),
        ),
        migrations.AddField(
            model_name='ddtvendita',
            name='ordine',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.OrdineVendita'),
        ),
        migrations.AddField(
            model_name='ddtvendita',
            name='preventivo',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='vendite.PreventivoVendita'),
        ),
        migrations.AddField(
            model_name='ddtvendita',
            name='valuta',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Teorema.Valuta'),
        ),
        migrations.AddField(
            model_name='ddtvendita',
            name='vendita',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vendite.Vendita'),
        ),
    ]
