mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
All: Apply Black coding rules
This commit is contained in:
@ -10,140 +10,400 @@ from django.conf import settings
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('subscription', '0001_initial'),
|
||||
("subscription", "0001_initial"),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('core', '0001_initial'),
|
||||
('club', '0002_auto_20160824_2152'),
|
||||
("core", "0001_initial"),
|
||||
("club", "0002_auto_20160824_2152"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Counter',
|
||||
name="Counter",
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
||||
('name', models.CharField(max_length=30, verbose_name='name')),
|
||||
('type', models.CharField(choices=[('BAR', 'Bar'), ('OFFICE', 'Office'), ('EBOUTIC', 'Eboutic')], max_length=255, verbose_name='counter type')),
|
||||
('club', models.ForeignKey(to='club.Club', related_name='counters')),
|
||||
('edit_groups', models.ManyToManyField(to='core.Group', blank=True, related_name='editable_counters')),
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
auto_created=True,
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=30, verbose_name="name")),
|
||||
(
|
||||
"type",
|
||||
models.CharField(
|
||||
choices=[
|
||||
("BAR", "Bar"),
|
||||
("OFFICE", "Office"),
|
||||
("EBOUTIC", "Eboutic"),
|
||||
],
|
||||
max_length=255,
|
||||
verbose_name="counter type",
|
||||
),
|
||||
),
|
||||
("club", models.ForeignKey(to="club.Club", related_name="counters")),
|
||||
(
|
||||
"edit_groups",
|
||||
models.ManyToManyField(
|
||||
to="core.Group", blank=True, related_name="editable_counters"
|
||||
),
|
||||
),
|
||||
],
|
||||
options={"verbose_name": "counter"},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Customer",
|
||||
fields=[
|
||||
(
|
||||
"user",
|
||||
models.OneToOneField(
|
||||
primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL
|
||||
),
|
||||
),
|
||||
(
|
||||
"account_id",
|
||||
models.CharField(
|
||||
unique=True, max_length=10, verbose_name="account id"
|
||||
),
|
||||
),
|
||||
(
|
||||
"amount",
|
||||
accounting.models.CurrencyField(
|
||||
decimal_places=2, max_digits=12, verbose_name="amount"
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'counter',
|
||||
"verbose_name": "customer",
|
||||
"ordering": ["account_id"],
|
||||
"verbose_name_plural": "customers",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Customer',
|
||||
name="Permanency",
|
||||
fields=[
|
||||
('user', models.OneToOneField(primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
|
||||
('account_id', models.CharField(unique=True, max_length=10, verbose_name='account id')),
|
||||
('amount', accounting.models.CurrencyField(decimal_places=2, max_digits=12, verbose_name='amount')),
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
auto_created=True,
|
||||
),
|
||||
),
|
||||
("start", models.DateTimeField(verbose_name="start date")),
|
||||
("end", models.DateTimeField(verbose_name="end date")),
|
||||
(
|
||||
"counter",
|
||||
models.ForeignKey(
|
||||
to="counter.Counter", related_name="permanencies"
|
||||
),
|
||||
),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
to=settings.AUTH_USER_MODEL, related_name="permanencies"
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'customer',
|
||||
'ordering': ['account_id'],
|
||||
'verbose_name_plural': 'customers',
|
||||
},
|
||||
options={"verbose_name": "permanency"},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Permanency',
|
||||
name="Product",
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
||||
('start', models.DateTimeField(verbose_name='start date')),
|
||||
('end', models.DateTimeField(verbose_name='end date')),
|
||||
('counter', models.ForeignKey(to='counter.Counter', related_name='permanencies')),
|
||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='permanencies')),
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
auto_created=True,
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=64, verbose_name="name")),
|
||||
(
|
||||
"description",
|
||||
models.TextField(blank=True, verbose_name="description"),
|
||||
),
|
||||
(
|
||||
"code",
|
||||
models.CharField(max_length=16, blank=True, verbose_name="code"),
|
||||
),
|
||||
(
|
||||
"purchase_price",
|
||||
accounting.models.CurrencyField(
|
||||
decimal_places=2, max_digits=12, verbose_name="purchase price"
|
||||
),
|
||||
),
|
||||
(
|
||||
"selling_price",
|
||||
accounting.models.CurrencyField(
|
||||
decimal_places=2, max_digits=12, verbose_name="selling price"
|
||||
),
|
||||
),
|
||||
(
|
||||
"special_selling_price",
|
||||
accounting.models.CurrencyField(
|
||||
decimal_places=2,
|
||||
max_digits=12,
|
||||
verbose_name="special selling price",
|
||||
),
|
||||
),
|
||||
(
|
||||
"icon",
|
||||
models.ImageField(
|
||||
upload_to="products", null=True, verbose_name="icon", blank=True
|
||||
),
|
||||
),
|
||||
("limit_age", models.IntegerField(default=0, verbose_name="limit age")),
|
||||
("tray", models.BooleanField(verbose_name="tray price", default=False)),
|
||||
(
|
||||
"buying_groups",
|
||||
models.ManyToManyField(
|
||||
related_name="products",
|
||||
to="core.Group",
|
||||
verbose_name="buying groups",
|
||||
),
|
||||
),
|
||||
(
|
||||
"club",
|
||||
models.ForeignKey(
|
||||
verbose_name="club", to="club.Club", related_name="products"
|
||||
),
|
||||
),
|
||||
(
|
||||
"parent_product",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
null=True,
|
||||
related_name="children_products",
|
||||
verbose_name="parent product",
|
||||
to="counter.Product",
|
||||
blank=True,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'permanency',
|
||||
},
|
||||
options={"verbose_name": "product"},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Product',
|
||||
name="ProductType",
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
||||
('name', models.CharField(max_length=64, verbose_name='name')),
|
||||
('description', models.TextField(blank=True, verbose_name='description')),
|
||||
('code', models.CharField(max_length=16, blank=True, verbose_name='code')),
|
||||
('purchase_price', accounting.models.CurrencyField(decimal_places=2, max_digits=12, verbose_name='purchase price')),
|
||||
('selling_price', accounting.models.CurrencyField(decimal_places=2, max_digits=12, verbose_name='selling price')),
|
||||
('special_selling_price', accounting.models.CurrencyField(decimal_places=2, max_digits=12, verbose_name='special selling price')),
|
||||
('icon', models.ImageField(upload_to='products', null=True, verbose_name='icon', blank=True)),
|
||||
('limit_age', models.IntegerField(default=0, verbose_name='limit age')),
|
||||
('tray', models.BooleanField(verbose_name='tray price', default=False)),
|
||||
('buying_groups', models.ManyToManyField(related_name='products', to='core.Group', verbose_name='buying groups')),
|
||||
('club', models.ForeignKey(verbose_name='club', to='club.Club', related_name='products')),
|
||||
('parent_product', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, related_name='children_products', verbose_name='parent product', to='counter.Product', blank=True)),
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
auto_created=True,
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=30, verbose_name="name")),
|
||||
(
|
||||
"description",
|
||||
models.TextField(null=True, verbose_name="description", blank=True),
|
||||
),
|
||||
(
|
||||
"icon",
|
||||
models.ImageField(upload_to="products", null=True, blank=True),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'product',
|
||||
},
|
||||
options={"verbose_name": "product type"},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ProductType',
|
||||
name="Refilling",
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
||||
('name', models.CharField(max_length=30, verbose_name='name')),
|
||||
('description', models.TextField(null=True, verbose_name='description', blank=True)),
|
||||
('icon', models.ImageField(upload_to='products', null=True, blank=True)),
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
auto_created=True,
|
||||
),
|
||||
),
|
||||
(
|
||||
"amount",
|
||||
accounting.models.CurrencyField(
|
||||
decimal_places=2, max_digits=12, verbose_name="amount"
|
||||
),
|
||||
),
|
||||
("date", models.DateTimeField(verbose_name="date")),
|
||||
(
|
||||
"payment_method",
|
||||
models.CharField(
|
||||
choices=[
|
||||
("CHECK", "Check"),
|
||||
("CASH", "Cash"),
|
||||
("CARD", "Credit card"),
|
||||
],
|
||||
max_length=255,
|
||||
default="CASH",
|
||||
verbose_name="payment method",
|
||||
),
|
||||
),
|
||||
(
|
||||
"bank",
|
||||
models.CharField(
|
||||
choices=[
|
||||
("OTHER", "Autre"),
|
||||
("SOCIETE-GENERALE", "Société générale"),
|
||||
("BANQUE-POPULAIRE", "Banque populaire"),
|
||||
("BNP", "BNP"),
|
||||
("CAISSE-EPARGNE", "Caisse d'épargne"),
|
||||
("CIC", "CIC"),
|
||||
("CREDIT-AGRICOLE", "Crédit Agricole"),
|
||||
("CREDIT-MUTUEL", "Credit Mutuel"),
|
||||
("CREDIT-LYONNAIS", "Credit Lyonnais"),
|
||||
("LA-POSTE", "La Poste"),
|
||||
],
|
||||
max_length=255,
|
||||
default="OTHER",
|
||||
verbose_name="bank",
|
||||
),
|
||||
),
|
||||
(
|
||||
"is_validated",
|
||||
models.BooleanField(verbose_name="is validated", default=False),
|
||||
),
|
||||
(
|
||||
"counter",
|
||||
models.ForeignKey(to="counter.Counter", related_name="refillings"),
|
||||
),
|
||||
(
|
||||
"customer",
|
||||
models.ForeignKey(to="counter.Customer", related_name="refillings"),
|
||||
),
|
||||
(
|
||||
"operator",
|
||||
models.ForeignKey(
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
related_name="refillings_as_operator",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'product type',
|
||||
},
|
||||
options={"verbose_name": "refilling"},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Refilling',
|
||||
name="Selling",
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
||||
('amount', accounting.models.CurrencyField(decimal_places=2, max_digits=12, verbose_name='amount')),
|
||||
('date', models.DateTimeField(verbose_name='date')),
|
||||
('payment_method', models.CharField(choices=[('CHECK', 'Check'), ('CASH', 'Cash'), ('CARD', 'Credit card')], max_length=255, default='CASH', verbose_name='payment method')),
|
||||
('bank', models.CharField(choices=[('OTHER', 'Autre'), ('SOCIETE-GENERALE', 'Société générale'), ('BANQUE-POPULAIRE', 'Banque populaire'), ('BNP', 'BNP'), ('CAISSE-EPARGNE', "Caisse d'épargne"), ('CIC', 'CIC'), ('CREDIT-AGRICOLE', 'Crédit Agricole'), ('CREDIT-MUTUEL', 'Credit Mutuel'), ('CREDIT-LYONNAIS', 'Credit Lyonnais'), ('LA-POSTE', 'La Poste')], max_length=255, default='OTHER', verbose_name='bank')),
|
||||
('is_validated', models.BooleanField(verbose_name='is validated', default=False)),
|
||||
('counter', models.ForeignKey(to='counter.Counter', related_name='refillings')),
|
||||
('customer', models.ForeignKey(to='counter.Customer', related_name='refillings')),
|
||||
('operator', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='refillings_as_operator')),
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
auto_created=True,
|
||||
),
|
||||
),
|
||||
("label", models.CharField(max_length=64, verbose_name="label")),
|
||||
(
|
||||
"unit_price",
|
||||
accounting.models.CurrencyField(
|
||||
decimal_places=2, max_digits=12, verbose_name="unit price"
|
||||
),
|
||||
),
|
||||
("quantity", models.IntegerField(verbose_name="quantity")),
|
||||
("date", models.DateTimeField(verbose_name="date")),
|
||||
(
|
||||
"payment_method",
|
||||
models.CharField(
|
||||
choices=[
|
||||
("SITH_ACCOUNT", "Sith account"),
|
||||
("CARD", "Credit card"),
|
||||
],
|
||||
max_length=255,
|
||||
default="SITH_ACCOUNT",
|
||||
verbose_name="payment method",
|
||||
),
|
||||
),
|
||||
(
|
||||
"is_validated",
|
||||
models.BooleanField(verbose_name="is validated", default=False),
|
||||
),
|
||||
(
|
||||
"club",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
null=True,
|
||||
to="club.Club",
|
||||
related_name="sellings",
|
||||
),
|
||||
),
|
||||
(
|
||||
"counter",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
null=True,
|
||||
to="counter.Counter",
|
||||
related_name="sellings",
|
||||
),
|
||||
),
|
||||
(
|
||||
"customer",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
null=True,
|
||||
to="counter.Customer",
|
||||
related_name="buyings",
|
||||
),
|
||||
),
|
||||
(
|
||||
"product",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
null=True,
|
||||
to="counter.Product",
|
||||
related_name="sellings",
|
||||
blank=True,
|
||||
),
|
||||
),
|
||||
(
|
||||
"seller",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
null=True,
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
related_name="sellings_as_operator",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'refilling',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Selling',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
|
||||
('label', models.CharField(max_length=64, verbose_name='label')),
|
||||
('unit_price', accounting.models.CurrencyField(decimal_places=2, max_digits=12, verbose_name='unit price')),
|
||||
('quantity', models.IntegerField(verbose_name='quantity')),
|
||||
('date', models.DateTimeField(verbose_name='date')),
|
||||
('payment_method', models.CharField(choices=[('SITH_ACCOUNT', 'Sith account'), ('CARD', 'Credit card')], max_length=255, default='SITH_ACCOUNT', verbose_name='payment method')),
|
||||
('is_validated', models.BooleanField(verbose_name='is validated', default=False)),
|
||||
('club', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to='club.Club', related_name='sellings')),
|
||||
('counter', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to='counter.Counter', related_name='sellings')),
|
||||
('customer', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to='counter.Customer', related_name='buyings')),
|
||||
('product', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to='counter.Product', related_name='sellings', blank=True)),
|
||||
('seller', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to=settings.AUTH_USER_MODEL, related_name='sellings_as_operator')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'selling',
|
||||
},
|
||||
options={"verbose_name": "selling"},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='product',
|
||||
name='product_type',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, related_name='products', verbose_name='product type', to='counter.ProductType', blank=True),
|
||||
model_name="product",
|
||||
name="product_type",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
null=True,
|
||||
related_name="products",
|
||||
verbose_name="product type",
|
||||
to="counter.ProductType",
|
||||
blank=True,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='counter',
|
||||
name='products',
|
||||
field=models.ManyToManyField(to='counter.Product', blank=True, related_name='counters'),
|
||||
model_name="counter",
|
||||
name="products",
|
||||
field=models.ManyToManyField(
|
||||
to="counter.Product", blank=True, related_name="counters"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='counter',
|
||||
name='sellers',
|
||||
field=models.ManyToManyField(related_name='counters', to='core.User', blank=True, verbose_name='sellers'),
|
||||
model_name="counter",
|
||||
name="sellers",
|
||||
field=models.ManyToManyField(
|
||||
related_name="counters",
|
||||
to="core.User",
|
||||
blank=True,
|
||||
verbose_name="sellers",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='counter',
|
||||
name='view_groups',
|
||||
field=models.ManyToManyField(to='core.Group', blank=True, related_name='viewable_counters'),
|
||||
model_name="counter",
|
||||
name="view_groups",
|
||||
field=models.ManyToManyField(
|
||||
to="core.Group", blank=True, related_name="viewable_counters"
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -10,45 +10,94 @@ class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('counter', '0001_initial'),
|
||||
("counter", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CashRegisterSummary',
|
||||
name="CashRegisterSummary",
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||
('date', models.DateTimeField(verbose_name='date')),
|
||||
('comment', models.TextField(null=True, verbose_name='comment', blank=True)),
|
||||
('emptied', models.BooleanField(default=False, verbose_name='emptied')),
|
||||
('counter', models.ForeignKey(to='counter.Counter', related_name='cash_summaries', verbose_name='counter')),
|
||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='cash_summaries', verbose_name='user')),
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
verbose_name="ID",
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
auto_created=True,
|
||||
),
|
||||
),
|
||||
("date", models.DateTimeField(verbose_name="date")),
|
||||
(
|
||||
"comment",
|
||||
models.TextField(null=True, verbose_name="comment", blank=True),
|
||||
),
|
||||
("emptied", models.BooleanField(default=False, verbose_name="emptied")),
|
||||
(
|
||||
"counter",
|
||||
models.ForeignKey(
|
||||
to="counter.Counter",
|
||||
related_name="cash_summaries",
|
||||
verbose_name="counter",
|
||||
),
|
||||
),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
related_name="cash_summaries",
|
||||
verbose_name="user",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'cash register summary',
|
||||
},
|
||||
options={"verbose_name": "cash register summary"},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CashRegisterSummaryItem',
|
||||
name="CashRegisterSummaryItem",
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||
('value', accounting.models.CurrencyField(max_digits=12, verbose_name='value', decimal_places=2)),
|
||||
('quantity', models.IntegerField(default=0, verbose_name='quantity')),
|
||||
('check', models.BooleanField(default=False, verbose_name='check')),
|
||||
('cash_summary', models.ForeignKey(to='counter.CashRegisterSummary', related_name='items', verbose_name='cash summary')),
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
verbose_name="ID",
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
auto_created=True,
|
||||
),
|
||||
),
|
||||
(
|
||||
"value",
|
||||
accounting.models.CurrencyField(
|
||||
max_digits=12, verbose_name="value", decimal_places=2
|
||||
),
|
||||
),
|
||||
("quantity", models.IntegerField(default=0, verbose_name="quantity")),
|
||||
("check", models.BooleanField(default=False, verbose_name="check")),
|
||||
(
|
||||
"cash_summary",
|
||||
models.ForeignKey(
|
||||
to="counter.CashRegisterSummary",
|
||||
related_name="items",
|
||||
verbose_name="cash summary",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'cash register summary item',
|
||||
},
|
||||
options={"verbose_name": "cash register summary item"},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='permanency',
|
||||
name='counter',
|
||||
field=models.ForeignKey(to='counter.Counter', related_name='permanencies', verbose_name='counter'),
|
||||
model_name="permanency",
|
||||
name="counter",
|
||||
field=models.ForeignKey(
|
||||
to="counter.Counter",
|
||||
related_name="permanencies",
|
||||
verbose_name="counter",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='permanency',
|
||||
name='user',
|
||||
field=models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='permanencies', verbose_name='user'),
|
||||
model_name="permanency",
|
||||
name="user",
|
||||
field=models.ForeignKey(
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
related_name="permanencies",
|
||||
verbose_name="user",
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -8,15 +8,17 @@ from django.utils.timezone import utc
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0002_auto_20160826_1342'),
|
||||
]
|
||||
dependencies = [("counter", "0002_auto_20160826_1342")]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='permanency',
|
||||
name='activity',
|
||||
field=models.DateTimeField(verbose_name='activity time', auto_now=True, default=datetime.datetime(2016, 8, 26, 17, 5, 31, 202824, tzinfo=utc)),
|
||||
model_name="permanency",
|
||||
name="activity",
|
||||
field=models.DateTimeField(
|
||||
verbose_name="activity time",
|
||||
auto_now=True,
|
||||
default=datetime.datetime(2016, 8, 26, 17, 5, 31, 202824, tzinfo=utc),
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
)
|
||||
]
|
||||
|
@ -6,14 +6,12 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0003_permanency_activity'),
|
||||
]
|
||||
dependencies = [("counter", "0003_permanency_activity")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='permanency',
|
||||
name='end',
|
||||
field=models.DateTimeField(verbose_name='end date', null=True),
|
||||
),
|
||||
model_name="permanency",
|
||||
name="end",
|
||||
field=models.DateTimeField(verbose_name="end date", null=True),
|
||||
)
|
||||
]
|
||||
|
@ -6,24 +6,31 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0004_auto_20160826_1907'),
|
||||
]
|
||||
dependencies = [("counter", "0004_auto_20160826_1907")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='counter',
|
||||
name='club',
|
||||
field=models.ForeignKey(verbose_name='club', to='club.Club', related_name='counters'),
|
||||
model_name="counter",
|
||||
name="club",
|
||||
field=models.ForeignKey(
|
||||
verbose_name="club", to="club.Club", related_name="counters"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='counter',
|
||||
name='products',
|
||||
field=models.ManyToManyField(blank=True, related_name='counters', to='counter.Product', verbose_name='products'),
|
||||
model_name="counter",
|
||||
name="products",
|
||||
field=models.ManyToManyField(
|
||||
blank=True,
|
||||
related_name="counters",
|
||||
to="counter.Product",
|
||||
verbose_name="products",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='permanency',
|
||||
name='activity',
|
||||
field=models.DateTimeField(auto_now=True, verbose_name='last activity date'),
|
||||
model_name="permanency",
|
||||
name="activity",
|
||||
field=models.DateTimeField(
|
||||
auto_now=True, verbose_name="last activity date"
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -6,14 +6,17 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0005_auto_20160826_2330'),
|
||||
]
|
||||
dependencies = [("counter", "0005_auto_20160826_2330")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='product',
|
||||
name='buying_groups',
|
||||
field=models.ManyToManyField(related_name='products', verbose_name='buying groups', blank=True, to='core.Group'),
|
||||
),
|
||||
model_name="product",
|
||||
name="buying_groups",
|
||||
field=models.ManyToManyField(
|
||||
related_name="products",
|
||||
verbose_name="buying groups",
|
||||
blank=True,
|
||||
to="core.Group",
|
||||
),
|
||||
)
|
||||
]
|
||||
|
@ -6,14 +6,12 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0006_auto_20160831_1304'),
|
||||
]
|
||||
dependencies = [("counter", "0006_auto_20160831_1304")]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='product',
|
||||
name='archived',
|
||||
field=models.BooleanField(verbose_name='archived', default=False),
|
||||
),
|
||||
model_name="product",
|
||||
name="archived",
|
||||
field=models.BooleanField(verbose_name="archived", default=False),
|
||||
)
|
||||
]
|
||||
|
@ -6,14 +6,14 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0007_product_archived'),
|
||||
]
|
||||
dependencies = [("counter", "0007_product_archived")]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='counter',
|
||||
name='token',
|
||||
field=models.CharField(blank=True, max_length=30, verbose_name='token', null=True),
|
||||
),
|
||||
model_name="counter",
|
||||
name="token",
|
||||
field=models.CharField(
|
||||
blank=True, max_length=30, verbose_name="token", null=True
|
||||
),
|
||||
)
|
||||
]
|
||||
|
@ -6,18 +6,37 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0008_counter_token'),
|
||||
]
|
||||
dependencies = [("counter", "0008_counter_token")]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Eticket',
|
||||
name="Eticket",
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)),
|
||||
('banner', models.ImageField(null=True, upload_to='etickets', blank=True)),
|
||||
('secret', models.CharField(unique=True, verbose_name='secret', max_length=64)),
|
||||
('product', models.OneToOneField(verbose_name='product', related_name='eticket', to='counter.Product')),
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
verbose_name="ID",
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
),
|
||||
),
|
||||
(
|
||||
"banner",
|
||||
models.ImageField(null=True, upload_to="etickets", blank=True),
|
||||
),
|
||||
(
|
||||
"secret",
|
||||
models.CharField(unique=True, verbose_name="secret", max_length=64),
|
||||
),
|
||||
(
|
||||
"product",
|
||||
models.OneToOneField(
|
||||
verbose_name="product",
|
||||
related_name="eticket",
|
||||
to="counter.Product",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
]
|
||||
|
@ -6,19 +6,19 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0009_eticket'),
|
||||
]
|
||||
dependencies = [("counter", "0009_eticket")]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='eticket',
|
||||
name='event_date',
|
||||
field=models.DateField(blank=True, verbose_name='event date', null=True),
|
||||
model_name="eticket",
|
||||
name="event_date",
|
||||
field=models.DateField(blank=True, verbose_name="event date", null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='eticket',
|
||||
name='event_title',
|
||||
field=models.CharField(blank=True, max_length=64, verbose_name='event title', null=True),
|
||||
model_name="eticket",
|
||||
name="event_title",
|
||||
field=models.CharField(
|
||||
blank=True, max_length=64, verbose_name="event title", null=True
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -6,14 +6,14 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0010_auto_20161003_1900'),
|
||||
]
|
||||
dependencies = [("counter", "0010_auto_20161003_1900")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='eticket',
|
||||
name='banner',
|
||||
field=models.ImageField(null=True, verbose_name='banner', blank=True, upload_to='etickets'),
|
||||
),
|
||||
model_name="eticket",
|
||||
name="banner",
|
||||
field=models.ImageField(
|
||||
null=True, verbose_name="banner", blank=True, upload_to="etickets"
|
||||
),
|
||||
)
|
||||
]
|
||||
|
@ -6,14 +6,14 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0011_auto_20161004_2039'),
|
||||
]
|
||||
dependencies = [("counter", "0011_auto_20161004_2039")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='permanency',
|
||||
name='end',
|
||||
field=models.DateTimeField(db_index=True, verbose_name='end date', null=True),
|
||||
),
|
||||
model_name="permanency",
|
||||
name="end",
|
||||
field=models.DateTimeField(
|
||||
db_index=True, verbose_name="end date", null=True
|
||||
),
|
||||
)
|
||||
]
|
||||
|
@ -12,7 +12,9 @@ from counter.models import Customer, Product, Selling, Counter
|
||||
def balance_ecocups(apps, schema_editor):
|
||||
for customer in Customer.objects.all():
|
||||
customer.recorded_products = 0
|
||||
for selling in customer.buyings.filter(product__id__in=[settings.SITH_ECOCUP_CONS, settings.SITH_ECOCUP_DECO]).all():
|
||||
for selling in customer.buyings.filter(
|
||||
product__id__in=[settings.SITH_ECOCUP_CONS, settings.SITH_ECOCUP_DECO]
|
||||
).all():
|
||||
if selling.product.is_record_product:
|
||||
customer.recorded_products += selling.quantity
|
||||
elif selling.product.is_unrecord_product:
|
||||
@ -20,24 +22,29 @@ def balance_ecocups(apps, schema_editor):
|
||||
if customer.recorded_products < -settings.SITH_ECOCUP_LIMIT:
|
||||
qt = -(customer.recorded_products + settings.SITH_ECOCUP_LIMIT)
|
||||
cons = Product.objects.get(id=settings.SITH_ECOCUP_CONS)
|
||||
Selling(label=_("Ecocup regularization"), product=cons, unit_price=cons.selling_price,
|
||||
club=cons.club, counter=Counter.objects.filter(name='Foyer').first(),
|
||||
quantity=qt, seller=User.objects.get(id=0), customer=customer).save(allow_negative=True)
|
||||
Selling(
|
||||
label=_("Ecocup regularization"),
|
||||
product=cons,
|
||||
unit_price=cons.selling_price,
|
||||
club=cons.club,
|
||||
counter=Counter.objects.filter(name="Foyer").first(),
|
||||
quantity=qt,
|
||||
seller=User.objects.get(id=0),
|
||||
customer=customer,
|
||||
).save(allow_negative=True)
|
||||
customer.recorded_products += qt
|
||||
customer.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0012_auto_20170515_2202'),
|
||||
]
|
||||
dependencies = [("counter", "0012_auto_20170515_2202")]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='customer',
|
||||
name='recorded_products',
|
||||
field=models.IntegerField(verbose_name='recorded items', default=0),
|
||||
model_name="customer",
|
||||
name="recorded_products",
|
||||
field=models.IntegerField(verbose_name="recorded items", default=0),
|
||||
),
|
||||
migrations.RunPython(balance_ecocups),
|
||||
]
|
||||
|
@ -6,14 +6,12 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0013_customer_recorded_products'),
|
||||
]
|
||||
dependencies = [("counter", "0013_customer_recorded_products")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='customer',
|
||||
name='recorded_products',
|
||||
field=models.IntegerField(default=0, verbose_name='recorded product'),
|
||||
),
|
||||
model_name="customer",
|
||||
name="recorded_products",
|
||||
field=models.IntegerField(default=0, verbose_name="recorded product"),
|
||||
)
|
||||
]
|
||||
|
@ -6,14 +6,12 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0013_customer_recorded_products'),
|
||||
]
|
||||
dependencies = [("counter", "0013_customer_recorded_products")]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='customer',
|
||||
name='recorded_products',
|
||||
field=models.IntegerField(verbose_name='recorded product', default=0),
|
||||
),
|
||||
model_name="customer",
|
||||
name="recorded_products",
|
||||
field=models.IntegerField(verbose_name="recorded product", default=0),
|
||||
)
|
||||
]
|
||||
|
@ -7,9 +7,8 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0014_auto_20170817_1537'),
|
||||
('counter', '0014_auto_20170816_1521'),
|
||||
("counter", "0014_auto_20170817_1537"),
|
||||
("counter", "0014_auto_20170816_1521"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
operations = []
|
||||
|
@ -6,14 +6,12 @@ from django.db import migrations, models
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('counter', '0015_merge'),
|
||||
]
|
||||
dependencies = [("counter", "0015_merge")]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='producttype',
|
||||
name='comment',
|
||||
field=models.TextField(verbose_name='comment', blank=True, null=True),
|
||||
),
|
||||
model_name="producttype",
|
||||
name="comment",
|
||||
field=models.TextField(verbose_name="comment", blank=True, null=True),
|
||||
)
|
||||
]
|
||||
|
Reference in New Issue
Block a user