# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import coin.billing.models
import datetime


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Invoice',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('number', models.CharField(default=coin.billing.models.next_invoice_number, unique=True, max_length=25, verbose_name=b'Num\xc3\xa9ro')),
                ('status', models.CharField(default=b'open', max_length=50, verbose_name=b'Statut', choices=[(b'open', 'A payer'), (b'closed', 'Regl\xe9e'), (b'trouble', 'Litige')])),
                ('date', models.DateField(default=datetime.date.today, null=True)),
                ('date_due', models.DateField(default=datetime.date(2014, 9, 30), null=True, verbose_name="Date d'\xe9ch\xe9ance de paiement")),
            ],
            options={
                'verbose_name': 'facture',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='InvoiceDetail',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('label', models.CharField(max_length=100)),
                ('amount', models.DecimalField(verbose_name=b'Montant', max_digits=5, decimal_places=2)),
                ('quantity', models.DecimalField(default=1.0, null=True, verbose_name='Quantit\xe9', max_digits=4, decimal_places=2)),
                ('tax', models.DecimalField(decimal_places=2, default=0.0, max_digits=4, help_text=b'en %', null=True, verbose_name=b'TVA')),
                ('period_from', models.DateField(default=datetime.date(2014, 9, 1), help_text='Date de d\xe9but de p\xe9riode sur laquelle est factur\xe9 cet item', null=True, verbose_name='D\xe9but de p\xe9riode', blank=True)),
                ('period_to', models.DateField(default=datetime.date(2014, 9, 30), help_text='Date de fin de p\xe9riode sur laquelle est factur\xe9 cet item', null=True, verbose_name='Fin de p\xe9riode', blank=True)),
                ('invoice', models.ForeignKey(related_name=b'details', verbose_name=b'Facture', to='billing.Invoice')),
            ],
            options={
                'verbose_name': 'd\xe9tail de facture',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('payment_mean', models.CharField(default=b'transfer', max_length=100, null=True, verbose_name=b'Moyen de paiement', choices=[(b'cash', 'Esp\xe8ces'), (b'check', 'Ch\xe8que'), (b'transfer', 'Virement'), (b'other', 'Autre')])),
                ('amount', models.DecimalField(null=True, verbose_name=b'Montant', max_digits=5, decimal_places=2)),
                ('date', models.DateField(default=datetime.date.today)),
                ('invoice', models.ForeignKey(related_name=b'payments', verbose_name=b'Facture', to='billing.Invoice')),
            ],
            options={
                'verbose_name': 'paiement',
            },
            bases=(models.Model,),
        ),
    ]
