Пример #1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='CustomerData',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('code',
                 models.CharField(default=customer.models.key_generator,
                                  editable=False,
                                  max_length=6,
                                  unique=True)),
                ('vehicle_number',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('entry_time', models.DateTimeField(blank=True, null=True)),
                ('exit_time', models.DateTimeField(blank=True, null=True)),
                ('amount', models.IntegerField(default=0)),
                ('customer',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_of_birth', models.DateField()),
                ('image',
                 models.ImageField(
                     blank=True, upload_to=customer.models.upload_image_path)),
                ('address', models.CharField(max_length=250)),
                ('is_active', models.BooleanField(default=False)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('last_update', models.DateTimeField(auto_now=True)),
                ('person',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='customer_user',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_of_birth',
                 models.DateField(
                     validators=[customer.models.validate_date_of_birth])),
                ('email', models.EmailField(max_length=254)),
                ('mobile_number', models.CharField(max_length=10)),
                ('name', models.CharField(max_length=100)),
                ('balance',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=30)),
                ('account_number',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('customer', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='customer',
            name='artist_type',
            field=multiselectfield.db.fields.MultiSelectField(
                blank=True,
                choices=[('TSHIRT DESIGNER', 'tshirt_designer'),
                         ('HOMEPRENEUR', 'homepreneur')],
                max_length=60,
                null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='dob',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='is_artist',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='customer',
            name='is_designer',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='customer',
            name='points',
            field=models.IntegerField(default=0, null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='unique_share_code',
            field=models.CharField(max_length=7, null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='user_photo',
            field=models.ImageField(
                blank=True,
                default='uploads/user_dummy.jpg',
                null=True,
                upload_to=customer.models.get_user_image_path),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Customer_Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('customer_name', models.CharField(max_length=55)),
                ('customer_number', models.BigIntegerField()),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=customer.models.upload_location)),
                ('product', models.CharField(max_length=20)),
                ('place', models.CharField(max_length=20)),
                ('date_published',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='date published')),
                ('date_updated',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='date updated')),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', customer.models.UserManager()),
            ],
        ),
    ]
Пример #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('userprofile', '0002_auto_20170126_1520'),
    ]

    operations = [
        migrations.CreateModel(
            name='Contract',
            fields=[
                ('contract_id', models.CharField(default=customer.models.generate_contract_id, max_length=20, primary_key=True, serialize=False)),
                ('total_contract_amount', models.IntegerField(default=0)),
                ('tax_percentage', models.IntegerField(default=0)),
                ('net_contract_amount', models.IntegerField(default=0)),
                ('date', models.DateField(auto_now_add=True)),
                ('contract_type', models.CharField(choices=[('amc', 'AMC'), ('s', 'Single'), ('st', 'Short Term')], max_length=5)),
                ('description', models.TextField()),
                ('is_tax_applicable', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=True)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('updated_time', models.DateTimeField(auto_now=True)),
                ('added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Contract_added_by', to='userprofile.UserProfile')),
                ('contract_employee', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='userprofile.Employee')),
            ],
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('customer_id', models.CharField(default=customer.models.generate_customer_id, max_length=20, primary_key=True, serialize=False)),
                ('customer_type', models.CharField(choices=[('res', 'Residential'), ('cmcl', 'Commercial')], db_index=True, max_length=5)),
                ('company_name', models.TextField()),
                ('contact_person', models.CharField(blank=True, max_length=100, null=True)),
                ('salutation', models.CharField(choices=[('mr', 'Mr'), ('mrs', 'Mrs'), ('ms', 'Ms')], max_length=4)),
                ('email', models.CharField(blank=True, max_length=100, null=True)),
                ('present_address', models.TextField(blank=True)),
                ('permanent_address', models.TextField(blank=True)),
                ('city', models.TextField()),
                ('mobile', models.CharField(blank=True, max_length=15, null=True)),
                ('landline', models.CharField(blank=True, max_length=15, null=True)),
                ('company_type', models.CharField(blank=True, choices=[('hotel', 'Hotels & Resorts'), ('it', 'IT Companies'), ('co', 'Corporate Offices'), ('fpu', 'Food Processing Units'), ('go', 'Government Offices')], max_length=5, null=True)),
                ('active', models.BooleanField(default=True)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('updated_time', models.DateTimeField(auto_now=True)),
                ('added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Customer_added_by', to='userprofile.UserProfile')),
                ('edited_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Customer_edited_by', to='userprofile.UserProfile')),
            ],
        ),
        migrations.CreateModel(
            name='Enquiry',
            fields=[
                ('enquiry_id', models.CharField(default=customer.models.generate_enquiry_id, max_length=20, primary_key=True, serialize=False)),
                ('created_date', models.DateField(auto_now_add=True)),
                ('status', models.CharField(choices=[('f', 'Followup'), ('c', 'Confirmed'), ('n', 'Not Interested'), ('i', 'Inspection')], max_length=5)),
                ('comments', models.TextField()),
                ('amount', models.IntegerField(blank=True, null=True)),
                ('active', models.BooleanField(default=True)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('updated_time', models.DateTimeField(auto_now=True)),
                ('added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Enquiry_added_by', to='userprofile.UserProfile')),
                ('customer', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='customer.Customer')),
                ('edited_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Enquiry_edited_by', to='userprofile.UserProfile')),
                ('reminder_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='userprofile.Employee')),
            ],
        ),
        migrations.CreateModel(
            name='EnquiryLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('f', 'Followup'), ('c', 'Confirmed'), ('n', 'Not Interested'), ('i', 'Inspection')], max_length=5)),
                ('date', models.DateField(auto_now_add=True)),
                ('active', models.BooleanField(default=True)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('updated_time', models.DateTimeField(auto_now=True)),
                ('added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='EnquiryLog_added_by', to='userprofile.UserProfile')),
                ('edited_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='EnquiryLog_edited_by', to='userprofile.UserProfile')),
                ('enquiry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='customer.Enquiry')),
            ],
        ),
        migrations.CreateModel(
            name='EnquiryService',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('service', models.CharField(max_length=30)),
            ],
        ),
        migrations.AddField(
            model_name='enquiry',
            name='service_required',
            field=models.ManyToManyField(to='customer.EnquiryService'),
        ),
        migrations.AddField(
            model_name='contract',
            name='customer',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='customer.Customer'),
        ),
        migrations.AddField(
            model_name='contract',
            name='edited_by',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Contract_edited_by', to='userprofile.UserProfile'),
        ),
        migrations.AddField(
            model_name='contract',
            name='enquiry',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='customer.Enquiry'),
        ),
    ]
Пример #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('product', '0011_auto_20190813_0644'),
        ('location', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('full_name',
                 models.CharField(max_length=255,
                                  primary_key=True,
                                  serialize=False)),
                ('phone_number', models.CharField(blank=True, max_length=50)),
                ('email', models.CharField(blank=True, max_length=255)),
                ('address', models.TextField()),
                ('description', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('is_status', models.BooleanField(default=True)),
                ('province',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='location.Location')),
            ],
            options={
                'ordering': ['created_at'],
            },
        ),
        migrations.CreateModel(
            name='SaleInvoice',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('invoice_number',
                 models.CharField(
                     blank=True,
                     default=customer.models.increment_invoice_number,
                     max_length=500,
                     null=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             code='Number is invalide',
                             message='Produce number must be Alphanumeric',
                             regex='^[a-zA-Z0-9]*$')
                     ])),
                ('description', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('is_status', models.BooleanField(default=True)),
                ('customer',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sale_invoice_customer',
                                   to='customer.Customer')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sale_invoice_user',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_at', '-updated_at'],
            },
        ),
        migrations.CreateModel(
            name='SaleInvoiceItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('unit', models.IntegerField(default=0)),
                ('unit_price', models.FloatField(blank=True, default=0.0)),
                ('description', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('is_status', models.BooleanField(default=True)),
                ('invoice',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sale_invoice',
                                   to='customer.SaleInvoice')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sale_invoice_item_product',
                                   to='product.Product')),
            ],
            options={
                'ordering': ['-created_at', '-updated_at'],
            },
        ),
        migrations.CreateModel(
            name='SaleInvoiceItemHistory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('unit', models.IntegerField(default=0)),
                ('unit_price', models.FloatField(default=0.0)),
                ('description', models.TextField(blank=True)),
                ('action',
                 models.CharField(blank=True, max_length=20, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('is_status', models.BooleanField(default=True)),
                ('invoice',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sale_invoice_history',
                                   to='customer.SaleInvoice')),
                ('product',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='sale_invoice_item_product_history',
                     to='product.Product')),
            ],
            options={
                'ordering': ['-created_at', '-updated_at'],
            },
        ),
    ]
Пример #9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('fax', models.IntegerField(blank=True, null=True)),
                ('postal_code', models.IntegerField(blank=True, null=True)),
                ('address',
                 models.TextField(blank=True, max_length=600, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code',
                 models.IntegerField(
                     blank=True,
                     default=customer.models.default_customer_code,
                     unique=True)),
                ('code_temp', models.IntegerField(blank=True, null=True)),
                ('name', models.CharField(max_length=100)),
                ('pub_date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('date2',
                 django_jalali.db.models.jDateField(
                     default=django.utils.timezone.now)),
                ('phone',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('fax', models.CharField(blank=True, max_length=15,
                                         null=True)),
                ('email',
                 models.EmailField(blank=True, max_length=254, null=True)),
                ('website',
                 models.URLField(blank=True, max_length=250, null=True)),
                ('postal_code',
                 models.CharField(blank=True, max_length=15, null=True)),
                ('addr', models.TextField(blank=True,
                                          max_length=600,
                                          null=True)),
                ('agent', models.BooleanField(default=False)),
                ('imported', models.BooleanField(default=False)),
                ('owner',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='owner',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'permissions':
                (('read_customer', 'Can read a customer details'),
                 ('index_customer', 'Can see list of customers'),
                 ('index_requests', 'customer can see list of requests')),
            },
        ),
        migrations.CreateModel(
            name='Phone',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('phone_number', models.CharField(max_length=15)),
                ('add',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='customer.Address')),
            ],
        ),
        migrations.CreateModel(
            name='Type',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
            ],
        ),
        migrations.AddField(
            model_name='customer',
            name='type',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='customer.Type'),
        ),
        migrations.AddField(
            model_name='customer',
            name='user',
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='address',
            name='customer',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='customer.Customer'),
        ),
    ]