diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 1ab4b3e..aa20da2 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 05fa632..84a3bab 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/migrations/0006_fleetunit_contract_number_and_more.py b/core/migrations/0006_fleetunit_contract_number_and_more.py new file mode 100644 index 0000000..c9bd651 --- /dev/null +++ b/core/migrations/0006_fleetunit_contract_number_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 5.2.7 on 2026-01-27 20:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0005_supplier_fleetunit_insurance_policy_number_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='fleetunit', + name='contract_number', + field=models.CharField(blank=True, max_length=100, null=True, verbose_name='Номер договора'), + ), + migrations.AlterField( + model_name='supplier', + name='contract_number', + field=models.CharField(blank=True, max_length=100, null=True, verbose_name='Номер договора (общий)'), + ), + ] diff --git a/core/migrations/__pycache__/0006_fleetunit_contract_number_and_more.cpython-311.pyc b/core/migrations/__pycache__/0006_fleetunit_contract_number_and_more.cpython-311.pyc new file mode 100644 index 0000000..0e3e0fb Binary files /dev/null and b/core/migrations/__pycache__/0006_fleetunit_contract_number_and_more.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 6482c08..832c3f0 100644 --- a/core/models.py +++ b/core/models.py @@ -21,7 +21,7 @@ class Supplier(models.Model): representative_name = models.CharField(max_length=255, blank=True, null=True, verbose_name="ФИО представителя/менеджера") phone = models.CharField(max_length=50, blank=True, null=True, verbose_name="Телефон") email = models.EmailField(blank=True, null=True, verbose_name="Электронная почта") - contract_number = models.CharField(max_length=100, blank=True, null=True, verbose_name="Номер договора") + contract_number = models.CharField(max_length=100, blank=True, null=True, verbose_name="Номер договора (общий)") class Meta: verbose_name = "Поставщик / Контрагент" @@ -59,6 +59,7 @@ class FleetUnit(models.Model): # Supplier supplier = models.ForeignKey(Supplier, on_delete=models.SET_NULL, null=True, blank=True, verbose_name="Поставщик / Контрагент") + contract_number = models.CharField(max_length=100, blank=True, null=True, verbose_name="Номер договора") supplier_name = models.CharField(max_length=255, blank=True, null=True, verbose_name="Поставщик (старое)") supplier_contacts = models.TextField(blank=True, null=True, verbose_name="Контакты поставщика (старое)") vehicle_documents = models.FileField(upload_to="fleet_docs/", blank=True, null=True, verbose_name="Документы на авто") diff --git a/core/templates/core/fleet_detail.html b/core/templates/core/fleet_detail.html index 023dcd3..e5e831c 100644 --- a/core/templates/core/fleet_detail.html +++ b/core/templates/core/fleet_detail.html @@ -218,10 +218,14 @@
Номер договора (техника)
+{{ unit.contract_number|default:"-" }}
+Поставщик / Контрагент
{{ unit.supplier.name }}
-Договор №{{ unit.supplier.contract_number|default:"-" }}
Представитель
{{ unit.supplier.representative_name|default:"-" }}
@@ -292,4 +296,4 @@