django-orchestra/orchestra/contrib/bills/migrations/0001_initial.py

128 lines
12 KiB
Python
Raw Normal View History

2015-04-14 14:29:22 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.core.validators
2015-04-29 13:55:22 +00:00
import django.db.models.deletion
2015-04-14 14:29:22 +00:00
class Migration(migrations.Migration):
dependencies = [
2015-04-29 13:55:22 +00:00
('orders', '__first__'),
2015-04-14 14:29:22 +00:00
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Bill',
fields=[
2015-04-29 14:32:38 +00:00
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
('number', models.CharField(unique=True, verbose_name='number', blank=True, max_length=16)),
2015-04-14 14:29:22 +00:00
('type', models.CharField(verbose_name='type', choices=[('INVOICE', 'Invoice'), ('AMENDMENTINVOICE', 'Amendment invoice'), ('FEE', 'Fee'), ('AMENDMENTFEE', 'Amendment Fee'), ('PROFORMA', 'Pro forma')], max_length=16)),
2015-04-29 13:55:22 +00:00
('created_on', models.DateField(auto_now_add=True, verbose_name='created on')),
2015-04-29 14:32:38 +00:00
('closed_on', models.DateField(verbose_name='closed on', null=True, blank=True)),
('is_open', models.BooleanField(default=True, verbose_name='open')),
('is_sent', models.BooleanField(default=False, verbose_name='sent')),
('due_on', models.DateField(verbose_name='due on', null=True, blank=True)),
2015-04-14 14:29:22 +00:00
('updated_on', models.DateField(verbose_name='updated on', auto_now=True)),
2015-04-29 14:32:38 +00:00
('total', models.DecimalField(default=0, decimal_places=2, max_digits=12)),
2015-04-14 14:29:22 +00:00
('comments', models.TextField(verbose_name='comments', blank=True)),
('html', models.TextField(verbose_name='HTML', blank=True)),
2015-04-29 13:55:22 +00:00
('account', models.ForeignKey(related_name='bill', to=settings.AUTH_USER_MODEL, verbose_name='account')),
2015-04-14 14:29:22 +00:00
],
options={
'get_latest_by': 'id',
},
),
migrations.CreateModel(
name='BillContact',
fields=[
2015-04-29 14:32:38 +00:00
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
('name', models.CharField(verbose_name='name', blank=True, max_length=256, help_text='Account full name will be used when left blank.')),
2015-04-14 14:29:22 +00:00
('address', models.TextField(verbose_name='address')),
2015-04-29 14:32:38 +00:00
('city', models.CharField(default='Barcelona', verbose_name='city', max_length=128)),
('zipcode', models.CharField(verbose_name='zip code', validators=[django.core.validators.RegexValidator('^[0-9A-Z]{3,10}$', 'Enter a valid zipcode.')], max_length=10)),
('country', models.CharField(default='ES', verbose_name='country', choices=[('PR', 'Puerto Rico'), ('BV', 'Bouvet Island'), ('BT', 'Bhutan'), ('MY', 'Malaysia'), ('AQ', 'Antarctica'), ('MT', 'Malta'), ('BE', 'Belgium'), ('SM', 'San Marino'), ('AZ', 'Azerbaijan'), ('CA', 'Canada'), ('HR', 'Croatia'), ('GH', 'Ghana'), ('MZ', 'Mozambique'), ('PA', 'Panama'), ('GR', 'Greece'), ('AE', 'United Arab Emirates'), ('CK', 'Cook Islands'), ('SK', 'Slovakia'), ('PN', 'Pitcairn'), ('ZA', 'South Africa'), ('AU', 'Australia'), ('BF', 'Burkina Faso'), ('FI', 'Finland'), ('MC', 'Monaco'), ('RE', 'Réunion'), ('TV', 'Tuvalu'), ('HN', 'Honduras'), ('IL', 'Israel'), ('SV', 'El Salvador'), ('VN', 'Viet Nam'), ('MV', 'Maldives'), ('BA', 'Bosnia and Herzegovina'), ('UA', 'Ukraine'), ('BW', 'Botswana'), ('UZ', 'Uzbekistan'), ('ID', 'Indonesia'), ('LY', 'Libya'), ('MM', 'Myanmar'), ('TZ', 'Tanzania, United Republic of'), ('GL', 'Greenland'), ('LV', 'Latvia'), ('DZ', 'Algeria'), ('AO', 'Angola'), ('GE', 'Georgia'), ('SO', 'Somalia'), ('CX', 'Christmas Island'), ('NP', 'Nepal'), ('AI', 'Anguilla'), ('GP', 'Guadeloupe'), ('UY', 'Uruguay'), ('LC', 'Saint Lucia'), ('EH', 'Western Sahara'), ('IO', 'British Indian Ocean Territory'), ('TH', 'Thailand'), ('AR', 'Argentina'), ('PY', 'Paraguay'), ('AW', 'Aruba'), ('IE', 'Ireland'), ('CF', 'Central African Republic'), ('TW', 'Taiwan (Province of China)'), ('KZ', 'Kazakhstan'), ('TJ', 'Tajikistan'), ('RW', 'Rwanda'), ('SR', 'Suriname'), ('AT', 'Austria'), ('GN', 'Guinea'), ('SS', 'South Sudan'), ('IT', 'Italy'), ('BO', 'Bolivia (Plurinational State of)'), ('GD', 'Grenada'), ('KE', 'Kenya'), ('GS', 'South Georgia and the South Sandwich Islands'), ('TG', 'Togo'), ('CY', 'Cyprus'), ('TT', 'Trinidad and Tobago'), ('CM', 'Cameroon'), ('QA', 'Qatar'), ('GM', 'Gambia'), ('WS', 'Samoa'), ('DJ', 'Djibouti'), ('PL', 'Poland'), ('CV', 'Cabo Verde'), ('PE', 'Peru'), ('TN', 'Tunisia'), ('HT', 'Haiti'), ('AF', 'Afghanistan'), ('YT', 'Mayotte'), ('NR', 'Nauru'), ('LS', 'Lesotho'), ('LR', 'Liberia'), ('IR', 'Iran (Islamic Republic of)'), ('EE', 'Estonia'), ('ER', 'Eritrea'), ('RU', 'Russian Federation'), ('LB', 'Lebanon'), ('CU', 'Cuba'), ('CZ', 'Czech Republic'), ('AX', 'Åland Islands'), ('CD', 'Congo (the Democratic Republic of the)'), ('HK', 'Hong Kong'), ('PS', 'Palestine, State of'), ('FK', 'Falkland Islands [Malvinas]'), ('MR', 'Mauritania'), ('MG', 'Madagascar'), ('MH', 'Marshall Islands'), ('LK', 'Sri Lanka'), ('NA', 'Namibia'), ('SI', 'Slovenia'), ('BY', 'Belarus'), ('MX', 'Mexico'), ('ZW', 'Zimbabwe'), ('CI', "Côte d'Ivoire"), ('GU', 'Guam'), ('PW', 'Palau'), ('SC', 'Seychelles'), ('GT', 'Guatemala'), ('CL', 'Chile'), ('SH', 'Saint Helena, Ascension and Tristan da Cunha'), ('BH', 'Bahrain'), ('SB', 'Solomon Islands'), ('KM', 'Comoros'), ('MF', 'Saint Martin (French part)'), ('FO', 'Faroe Islands'), ('BD', 'Bangladesh'), ('AM', 'Armenia'), ('BJ', 'Benin'), ('SA', 'Saudi Arabia'), ('NU', 'Niue'), ('VI', 'Virgin Islands (U.S.)'), ('CN', 'China'), ('EC', 'Ecuador'), ('CC', 'Cocos (Keeling) Islands'), ('BS', 'Bahamas'), ('JM', 'Jamaica'), ('RO', 'Romania'), ('KI', 'Kiribati'), ('GY', 'Guyana'), ('TL', 'Timor-Leste'), ('AS', 'American Samoa'), ('VE', 'Venezuela (Bolivarian Republic of)'), ('BN', 'Brunei Darussalam'), ('ET', 'Ethiopia'), ('FJ', 'Fiji'), ('BG', 'Bulgaria'), ('VG', 'Virgin Islands (British)'), ('AD', 'Andorra'), ('KN', 'Saint Kitts and Nevis'), ('MA', 'Morocco'), ('MU', 'Mauritius'), ('DK', 'Denmark'), ('TO', 'Tonga'), ('CO', 'Colombia'), ('GA', 'Gabon'), ('MK', 'Macedonia (the former Yugoslav Republic of)'), ('MD', 'Moldova (the Republic of)'), ('VA', 'Holy See'), ('KY', 'Cayman Islands'), ('LU', 'Luxembourg'), ('AL', 'Albania'), ('LI', 'Liechtenstein'), ('KP', "Korea (the Democratic People's Republic of)"), ('BZ', 'Belize'), ('ME', 'Montenegro'), ('NC', 'New Caledonia'), ('VC', 'Saint Vincent and the Grenadines'), ('UM', 'United States Minor Outlying Islands'), ('IQ', 'Iraq'), ('GB', 'United Kingdom of Great Britain and Northern Ireland'), ('KW', 'Kuwait'), ('MS', 'Montserrat'), ('SD',
2015-04-14 14:29:22 +00:00
('vat', models.CharField(verbose_name='VAT number', max_length=64)),
2015-04-29 13:55:22 +00:00
('account', models.OneToOneField(related_name='billcontact', to=settings.AUTH_USER_MODEL, verbose_name='account')),
2015-04-14 14:29:22 +00:00
],
),
migrations.CreateModel(
name='BillLine',
fields=[
2015-04-29 14:32:38 +00:00
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
2015-04-14 14:29:22 +00:00
('description', models.CharField(verbose_name='description', max_length=256)),
2015-04-29 14:32:38 +00:00
('rate', models.DecimalField(decimal_places=2, verbose_name='rate', null=True, blank=True, max_digits=12)),
2015-04-14 14:29:22 +00:00
('quantity', models.DecimalField(verbose_name='quantity', decimal_places=2, max_digits=12)),
('verbose_quantity', models.CharField(verbose_name='Verbose quantity', max_length=16)),
('subtotal', models.DecimalField(verbose_name='subtotal', decimal_places=2, max_digits=12)),
2015-04-29 13:55:22 +00:00
('tax', models.DecimalField(verbose_name='tax', decimal_places=2, max_digits=4)),
('start_on', models.DateField(verbose_name='start')),
2015-04-29 14:32:38 +00:00
('end_on', models.DateField(verbose_name='end', null=True)),
('order_billed_on', models.DateField(verbose_name='order billed', null=True, blank=True)),
('order_billed_until', models.DateField(verbose_name='order billed until', null=True, blank=True)),
2015-04-29 13:55:22 +00:00
('created_on', models.DateField(auto_now_add=True, verbose_name='created')),
2015-04-29 14:32:38 +00:00
('amended_line', models.ForeignKey(blank=True, to='bills.BillLine', verbose_name='amended line', null=True, related_name='amendment_lines')),
2015-04-29 13:55:22 +00:00
('bill', models.ForeignKey(related_name='lines', to='bills.Bill', verbose_name='bill')),
2015-04-29 14:32:38 +00:00
('order', models.ForeignKey(blank=True, to='orders.Order', null=True, on_delete=django.db.models.deletion.SET_NULL, help_text='Informative link back to the order')),
2015-04-14 14:29:22 +00:00
],
),
migrations.CreateModel(
name='BillSubline',
fields=[
2015-04-29 14:32:38 +00:00
('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)),
2015-04-14 14:29:22 +00:00
('description', models.CharField(verbose_name='description', max_length=256)),
('total', models.DecimalField(decimal_places=2, max_digits=12)),
2015-04-29 14:32:38 +00:00
('type', models.CharField(default='OTHER', verbose_name='type', choices=[('VOLUME', 'Volume'), ('COMPENSATION', 'Compensation'), ('OTHER', 'Other')], max_length=16)),
2015-04-29 13:55:22 +00:00
('line', models.ForeignKey(related_name='sublines', to='bills.BillLine', verbose_name='bill line')),
2015-04-14 14:29:22 +00:00
],
),
migrations.CreateModel(
name='AmendmentFee',
fields=[
],
options={
'proxy': True,
},
bases=('bills.bill',),
),
migrations.CreateModel(
name='AmendmentInvoice',
fields=[
],
options={
'proxy': True,
},
bases=('bills.bill',),
),
migrations.CreateModel(
name='Fee',
fields=[
],
options={
'proxy': True,
},
bases=('bills.bill',),
),
migrations.CreateModel(
name='Invoice',
fields=[
],
options={
'proxy': True,
},
bases=('bills.bill',),
),
migrations.CreateModel(
name='ProForma',
fields=[
],
options={
'proxy': True,
},
bases=('bills.bill',),
),
]