# Generated by Django 2.2 on 2021-08-05 07:26

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import ra.base.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('crm', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('hr', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Sale',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(blank=True, verbose_name='refer code')),
                ('doc_date', models.DateTimeField(db_index=True, verbose_name='date')),
                ('doc_type', models.CharField(db_index=True, max_length=30)),
                ('notes', models.TextField(blank=True, null=True, verbose_name='notes')),
                ('value', models.DecimalField(decimal_places=2, default=0, max_digits=19, verbose_name='value')),
                ('creation_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='creation date and time')),
                ('lastmod', models.DateTimeField(db_index=True, verbose_name='last modification')),
                ('status', models.CharField(blank=True, choices=[('order_submitted', 'order_submitted'), ('shipping', 'shipping'), ('completed', 'completed'), ('back', 'back'), ('order_cancel', 'order_cancel')], max_length=32)),
                ('customer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='forex_customer', to='crm.Customer')),
                ('lastmod_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='forex_sale_lastmod_related', to=settings.AUTH_USER_MODEL, verbose_name='last modification by')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='forex_sale_related', to=settings.AUTH_USER_MODEL, verbose_name='owner')),
                ('seller', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='forex_seller', to='hr.Employee')),
            ],
            options={
                'verbose_name': 'Sale',
                'verbose_name_plural': 'Sales',
            },
            bases=(ra.base.models.DiffingMixin, models.Model),
        ),
        migrations.CreateModel(
            name='SaleProducts',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('doc_date', models.DateTimeField(db_index=True, verbose_name='date')),
                ('doc_type', models.CharField(db_index=True, max_length=30)),
                ('notes', models.TextField(blank=True, null=True, verbose_name='notes')),
                ('value', models.DecimalField(decimal_places=2, default=0, max_digits=19, verbose_name='value')),
                ('creation_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='creation date and time')),
                ('lastmod', models.DateTimeField(db_index=True, verbose_name='last modification')),
                ('quantity', models.DecimalField(decimal_places=2, default=0, max_digits=19, verbose_name='quantity')),
                ('price', models.DecimalField(decimal_places=2, default=0, max_digits=19, verbose_name='price')),
                ('discount', models.DecimalField(decimal_places=2, default=0, max_digits=19, verbose_name='discount')),
                ('date_added', models.DateField(blank=True, null=True)),
                ('slug', models.CharField(blank=True, max_length=255, null=True)),
                ('lastmod_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='forex_saleproducts_lastmod_related', to=settings.AUTH_USER_MODEL, verbose_name='last modification by')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='forex_saleproducts_related', to=settings.AUTH_USER_MODEL, verbose_name='owner')),
                ('sale', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='forex_sale', to='forex.Sale')),
            ],
            options={
                'verbose_name': 'Total amount',
                'verbose_name_plural': 'total amount',
            },
            bases=(ra.base.models.DiffingMixin, models.Model),
        ),
    ]
