# Generated by Django 5.2.7 on 2026-02-02 09:25

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


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0006_purchase_balance_due_purchase_due_date_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='sale',
            name='balance_due',
            field=models.DecimalField(decimal_places=3, default=0, max_digits=15, verbose_name='Balance Due'),
        ),
        migrations.AddField(
            model_name='sale',
            name='due_date',
            field=models.DateField(blank=True, null=True, verbose_name='Due Date'),
        ),
        migrations.AddField(
            model_name='sale',
            name='invoice_number',
            field=models.CharField(blank=True, max_length=50, verbose_name='Invoice Number'),
        ),
        migrations.AddField(
            model_name='sale',
            name='notes',
            field=models.TextField(blank=True, verbose_name='Notes'),
        ),
        migrations.AddField(
            model_name='sale',
            name='paid_amount',
            field=models.DecimalField(decimal_places=3, default=0, max_digits=15, verbose_name='Paid Amount'),
        ),
        migrations.AddField(
            model_name='sale',
            name='payment_type',
            field=models.CharField(choices=[('cash', 'Cash'), ('credit', 'Credit'), ('partial', 'Partial')], default='cash', max_length=20, verbose_name='Payment Type'),
        ),
        migrations.AddField(
            model_name='sale',
            name='status',
            field=models.CharField(choices=[('paid', 'Paid'), ('partial', 'Partial'), ('unpaid', 'Unpaid')], default='paid', max_length=20, verbose_name='Status'),
        ),
        migrations.AlterField(
            model_name='sale',
            name='customer',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sales', to='core.customer'),
        ),
        migrations.AlterField(
            model_name='sale',
            name='discount',
            field=models.DecimalField(decimal_places=3, default=0, max_digits=15, verbose_name='Discount'),
        ),
        migrations.AlterField(
            model_name='sale',
            name='total_amount',
            field=models.DecimalField(decimal_places=3, max_digits=15, verbose_name='Total Amount'),
        ),
        migrations.AlterField(
            model_name='saleitem',
            name='line_total',
            field=models.DecimalField(decimal_places=3, max_digits=15, verbose_name='Line Total'),
        ),
        migrations.AlterField(
            model_name='saleitem',
            name='quantity',
            field=models.PositiveIntegerField(verbose_name='Quantity'),
        ),
        migrations.AlterField(
            model_name='saleitem',
            name='unit_price',
            field=models.DecimalField(decimal_places=3, max_digits=12, verbose_name='Unit Price'),
        ),
        migrations.CreateModel(
            name='SalePayment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=3, max_digits=15, verbose_name='Amount')),
                ('payment_date', models.DateField(default=django.utils.timezone.now, verbose_name='Payment Date')),
                ('payment_method', models.CharField(default='Cash', max_length=50, verbose_name='Payment Method')),
                ('notes', models.TextField(blank=True, verbose_name='Notes')),
                ('sale', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='core.sale')),
            ],
        ),
    ]
