From fb86d2162373bfad0a7195bfa6e2bf666068f269 Mon Sep 17 00:00:00 2001 From: Guido Longoni Date: Sun, 14 May 2023 19:28:57 +0200 Subject: [PATCH] sa sa --- .../migrations/0001_initial.py | 264 ++++++++++++++ .../migrations/__init__.py | 0 .../contatti_app/migrations/0001_initial.py | 234 ++++++------- .../0002_personafisica_is_privato.py | 17 + django/contatti_app/modello_database.xml | 176 ++++++---- django/contatti_app/models.py | 31 +- .../migrations/0001_initial.py | 15 +- ...rename_sede_legale_soggettofiscale_sede.py | 17 + django/fattura_elettronica_app/models.py | 5 +- django/offerte_app/migrations/0001_initial.py | 4 +- django/sangue_app/migrations/0001_initial.py | 2 +- django/sangue_django/modello_dati.xml | 322 ++++++++++-------- 12 files changed, 727 insertions(+), 360 deletions(-) create mode 100644 django/business_model_canvas_app/migrations/0001_initial.py create mode 100644 django/business_model_canvas_app/migrations/__init__.py create mode 100644 django/contatti_app/migrations/0002_personafisica_is_privato.py create mode 100644 django/fattura_elettronica_app/migrations/0002_rename_sede_legale_soggettofiscale_sede.py diff --git a/django/business_model_canvas_app/migrations/0001_initial.py b/django/business_model_canvas_app/migrations/0001_initial.py new file mode 100644 index 0000000..5c800c3 --- /dev/null +++ b/django/business_model_canvas_app/migrations/0001_initial.py @@ -0,0 +1,264 @@ +# Generated by Django 4.1.7 on 2023-05-14 15:44 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + initial = True + + dependencies = [] + + operations = [ + migrations.CreateModel( + name="BMCModelloDiBusiness", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("descrizione", models.CharField(max_length=4096, null=True)), + ], + options={ + "verbose_name": "bmcmodellodibusiness", + "verbose_name_plural": "bmcmodellodibusiness", + }, + ), + migrations.CreateModel( + name="BMCSegmentiDiClientela", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("settore_cliente", models.IntegerField(blank=True, null=True)), + ( + "modello_di_business", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="BMCSegmentiDiClientela_da_BMCModelloDiBusiness_modello_di_business", + to="business_model_canvas_app.bmcmodellodibusiness", + ), + ), + ], + options={ + "verbose_name": "bmcsegmentidiclientela", + "verbose_name_plural": "bmcsegmentidiclientela", + }, + ), + migrations.CreateModel( + name="BMCRisorsaChiave", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("risorsa_chiave", models.IntegerField(blank=True, null=True)), + ( + "modello_di_business", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="BMCRisorsaChiave_da_BMCModelloDiBusiness_modello_di_business", + to="business_model_canvas_app.bmcmodellodibusiness", + ), + ), + ], + options={ + "verbose_name": "bmcrisorsachiave", + "verbose_name_plural": "bmcrisorsachiave", + }, + ), + migrations.CreateModel( + name="BMCRelazioneConCliente", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("relazione_cliente", models.IntegerField(blank=True, null=True)), + ( + "modello_di_business", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="BMCRelazioneConCliente_da_BMCModelloDiBusiness_modello_di_business", + to="business_model_canvas_app.bmcmodellodibusiness", + ), + ), + ], + options={ + "verbose_name": "bmcrelazioneconcliente", + "verbose_name_plural": "bmcrelazioneconcliente", + }, + ), + migrations.CreateModel( + name="BMCPropostaDiValore", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("proposta_di_valore", models.IntegerField(blank=True, null=True)), + ( + "modello_di_business", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="BMCPropostaDiValore_da_BMCModelloDiBusiness_modello_di_business", + to="business_model_canvas_app.bmcmodellodibusiness", + ), + ), + ], + options={ + "verbose_name": "bmcpropostadivalore", + "verbose_name_plural": "bmcpropostadivalore", + }, + ), + migrations.CreateModel( + name="BMCPartnerChiave", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("partnership_azienda", models.IntegerField(blank=True, null=True)), + ( + "modello_di_business", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="BMCPartnerChiave_da_BMCModelloDiBusiness_modello_di_business", + to="business_model_canvas_app.bmcmodellodibusiness", + ), + ), + ], + options={ + "verbose_name": "bmcpartnerchiave", + "verbose_name_plural": "bmcpartnerchiave", + }, + ), + migrations.CreateModel( + name="BMCFlussoDiRicavi", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("flusso_di_ricavi", models.IntegerField(blank=True, null=True)), + ( + "modello_di_business", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="BMCFlussoDiRicavi_da_BMCModelloDiBusiness_modello_di_business", + to="business_model_canvas_app.bmcmodellodibusiness", + ), + ), + ], + options={ + "verbose_name": "bmcflussodiricavi", + "verbose_name_plural": "bmcflussodiricavi", + }, + ), + migrations.CreateModel( + name="BMCCanaleDiDistribuzione", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("canale", models.IntegerField(blank=True, null=True)), + ( + "modello_di_business", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="BMCCanaleDiDistribuzione_da_BMCModelloDiBusiness_modello_di_business", + to="business_model_canvas_app.bmcmodellodibusiness", + ), + ), + ], + options={ + "verbose_name": "bmccanaledidistribuzione", + "verbose_name_plural": "bmccanaledidistribuzione", + }, + ), + migrations.CreateModel( + name="BMCAttivitaChiave", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("attivita_chiave", models.IntegerField(blank=True, null=True)), + ( + "modello_di_business", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="BMCAttivitaChiave_da_BMCModelloDiBusiness_modello_di_business", + to="business_model_canvas_app.bmcmodellodibusiness", + ), + ), + ], + options={ + "verbose_name": "bmcattivitachiave", + "verbose_name_plural": "bmcattivitachiave", + }, + ), + ] diff --git a/django/business_model_canvas_app/migrations/__init__.py b/django/business_model_canvas_app/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django/contatti_app/migrations/0001_initial.py b/django/contatti_app/migrations/0001_initial.py index 4842bf3..aa9b4f0 100644 --- a/django/contatti_app/migrations/0001_initial.py +++ b/django/contatti_app/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.7 on 2023-05-14 13:47 +# Generated by Django 4.1.7 on 2023-05-14 15:43 from django.db import migrations, models import django.db.models.deletion @@ -14,7 +14,36 @@ class Migration(migrations.Migration): operations = [ migrations.CreateModel( - name="ContattoRubrica", + name="SoggettoContattabile", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("rimosso", models.BooleanField(blank=True, null=True)), + ( + "polymorphic_ctype", + models.ForeignKey( + editable=False, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="polymorphic_%(app_label)s.%(class)s_set+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "verbose_name": "soggetto contattabile", + "verbose_name_plural": "soggetti contattabili", + }, + ), + migrations.CreateModel( + name="VoceContattoRubrica", fields=[ ( "id", @@ -35,22 +64,78 @@ class Migration(migrations.Migration): to="contenttypes.contenttype", ), ), + ( + "soggetto", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="contatti", + to="contatti_app.soggettocontattabile", + ), + ), ], options={ "verbose_name": "contatto di rubrica", "verbose_name_plural": "contatti di rubrica", }, ), + migrations.CreateModel( + name="Email", + fields=[ + ( + "vocecontattorubrica_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="contatti_app.vocecontattorubrica", + ), + ), + ("indirizzo_email", models.CharField(max_length=30)), + ("note", models.CharField(max_length=64, null=True)), + ], + options={ + "verbose_name": "email", + "verbose_name_plural": "email", + }, + bases=("contatti_app.vocecontattorubrica",), + ), + migrations.CreateModel( + name="Fax", + fields=[ + ( + "vocecontattorubrica_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="contatti_app.vocecontattorubrica", + ), + ), + ("numero", models.CharField(max_length=20, null=True)), + ("note", models.CharField(max_length=64, null=True)), + ], + options={ + "verbose_name": "fax", + "verbose_name_plural": "fax", + }, + bases=("contatti_app.vocecontattorubrica",), + ), migrations.CreateModel( name="Indirizzo", fields=[ ( - "id", - models.AutoField( + "vocecontattorubrica_ptr", + models.OneToOneField( auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, - verbose_name="ID", + to="contatti_app.vocecontattorubrica", ), ), ( @@ -102,97 +187,13 @@ class Migration(migrations.Migration): to="dati_geo_app.nazione", ), ), - ( - "polymorphic_ctype", - models.ForeignKey( - editable=False, - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="polymorphic_%(app_label)s.%(class)s_set+", - to="contenttypes.contenttype", - ), - ), ], options={ "verbose_name": "indirizzo", "verbose_name_plural": "indirizzi", "abstract": False, }, - ), - migrations.CreateModel( - name="SoggettoContattabile", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("rimosso", models.BooleanField(blank=True, null=True)), - ( - "polymorphic_ctype", - models.ForeignKey( - editable=False, - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="polymorphic_%(app_label)s.%(class)s_set+", - to="contenttypes.contenttype", - ), - ), - ], - options={ - "verbose_name": "soggetto contattabile", - "verbose_name_plural": "soggetti contattabili", - }, - ), - migrations.CreateModel( - name="Email", - fields=[ - ( - "contattorubrica_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="contatti_app.contattorubrica", - ), - ), - ("indirizzo", models.CharField(max_length=30)), - ("note", models.CharField(max_length=64, null=True)), - ], - options={ - "verbose_name": "email", - "verbose_name_plural": "email", - }, - bases=("contatti_app.contattorubrica",), - ), - migrations.CreateModel( - name="Fax", - fields=[ - ( - "contattorubrica_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="contatti_app.contattorubrica", - ), - ), - ("numero", models.CharField(max_length=20, null=True)), - ("note", models.CharField(max_length=64, null=True)), - ], - options={ - "verbose_name": "fax", - "verbose_name_plural": "fax", - }, - bases=("contatti_app.contattorubrica",), + bases=("contatti_app.vocecontattorubrica", models.Model), ), migrations.CreateModel( name="PersonaFisica", @@ -240,49 +241,18 @@ class Migration(migrations.Migration): }, bases=("contatti_app.soggettocontattabile",), ), - migrations.CreateModel( - name="Residenza", - fields=[ - ( - "indirizzo_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="contatti_app.indirizzo", - ), - ), - ( - "inquilino", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="residenze", - to="contatti_app.soggettocontattabile", - ), - ), - ], - options={ - "verbose_name": "residenza", - "verbose_name_plural": "residenze", - }, - bases=("contatti_app.indirizzo",), - ), migrations.CreateModel( name="Telefono", fields=[ ( - "contattorubrica_ptr", + "vocecontattorubrica_ptr", models.OneToOneField( auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, - to="contatti_app.contattorubrica", + to="contatti_app.vocecontattorubrica", ), ), ("numero", models.CharField(max_length=20)), @@ -293,7 +263,7 @@ class Migration(migrations.Migration): "verbose_name": "telefono", "verbose_name_plural": "telefono", }, - bases=("contatti_app.contattorubrica",), + bases=("contatti_app.vocecontattorubrica",), ), migrations.CreateModel( name="Societa", @@ -308,7 +278,6 @@ class Migration(migrations.Migration): ), ), ("ragione_sociale", models.CharField(max_length=1024)), - ("sede_legale", models.IntegerField()), ( "nazione", models.ForeignKey( @@ -333,15 +302,6 @@ class Migration(migrations.Migration): "verbose_name_plural": "societa", }, ), - migrations.AddField( - model_name="contattorubrica", - name="soggetto", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="contatti", - to="contatti_app.soggettocontattabile", - ), - ), migrations.CreateModel( name="Pec", fields=[ @@ -367,14 +327,14 @@ class Migration(migrations.Migration): name="Sede", fields=[ ( - "residenza_ptr", + "indirizzo_ptr", models.OneToOneField( auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, - to="contatti_app.residenza", + to="contatti_app.indirizzo", ), ), ("is_legale", models.BooleanField(blank=True, null=True)), @@ -393,7 +353,7 @@ class Migration(migrations.Migration): "verbose_name": "sede", "verbose_name_plural": "sedi", }, - bases=("contatti_app.residenza",), + bases=("contatti_app.indirizzo",), ), migrations.CreateModel( name="PersonaContattoAzienda", diff --git a/django/contatti_app/migrations/0002_personafisica_is_privato.py b/django/contatti_app/migrations/0002_personafisica_is_privato.py new file mode 100644 index 0000000..680d83b --- /dev/null +++ b/django/contatti_app/migrations/0002_personafisica_is_privato.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.7 on 2023-05-14 16:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("contatti_app", "0001_initial"), + ] + + operations = [ + migrations.AddField( + model_name="personafisica", + name="is_privato", + field=models.BooleanField(default=True), + ), + ] diff --git a/django/contatti_app/modello_database.xml b/django/contatti_app/modello_database.xml index ad482ba..605a295 100644 --- a/django/contatti_app/modello_database.xml +++ b/django/contatti_app/modello_database.xml @@ -37,78 +37,66 @@ - +
+ +INTEGER +NULL + INTEGER -NULL - - -INTEGER NULL -persona_ptr +personafisica_ptr
- - -INTEGER -NULL - - -INTEGER -NULL - -INTEGER -NULL - -INTEGER -NULL - +
INTEGER NULL - -INTEGER -NULL - - -bit + +CHAR(2) +'NULL' + +VARCHAR(250) NULL id
- +
INTEGER NULL - + INTEGER -NULL +NULL id
- - +
+ INTEGER -NULL +NULL VARCHAR(20) 'NULL' + +INTEGER +NULL VARCHAR(64) NULL -datodicontatto_ptr +contattorubrica_ptr
- - +
+ INTEGER -NULL +NULL VARCHAR(30) @@ -117,13 +105,13 @@ VARCHAR(64) NULL -datodicontatto_ptr +contattorubrica_ptr
- - +
+ INTEGER -NULL +NULL VARCHAR(10) @@ -134,41 +122,45 @@ VARCHAR(60) NULL + +bit +NULL -soggetto_fiscale_ptr +soggettocontattabile_ptr
- - +
+ INTEGER -NULL +NULL VARCHAR(80) NULL -soggetto_fiscale_ptr +soggettocontattabile_ptr
- - +
+ INTEGER -NULL - +NULL + + INTEGER -NULL +NULL bit NULL -id +indirizzo_ptr
- - +
+ INTEGER -NULL +NULL VARCHAR(20) @@ -177,16 +169,84 @@ VARCHAR(64) NULL -datodicontatto_ptr +contattorubrica_ptr
- +
INTEGER -NULL +NULL email_ptr
+ + +INTEGER +None + +VARCHAR(256) +'None' + +VARCHAR(256) +'None' + +VARCHAR(2048) +'None' + +VARCHAR(5) +'None' + +INTEGER +None + +VARCHAR(40) +'None' + +INTEGER +NULL + + +id + +
+ + +INTEGER +NULL + +id + +
+ + +INTEGER +NULL + + + +contattorubrica_ptr + +<AbstractIndirizzo> +
+ + +INTEGER +NULL + +INTEGER +NULL + + +INTEGER +NULL + + +VARCHAR(1024) +NULL + +id + +
diff --git a/django/contatti_app/models.py b/django/contatti_app/models.py index d44160c..4532bb3 100644 --- a/django/contatti_app/models.py +++ b/django/contatti_app/models.py @@ -11,7 +11,7 @@ class SoggettoContattabile(PolymorphicModel): rimosso = models.BooleanField(null=True, blank=True) -class ContattoRubrica(PolymorphicModel): +class VoceContattoRubrica(PolymorphicModel): class Meta: verbose_name = 'contatto di rubrica' verbose_name_plural = 'contatti di rubrica' @@ -42,7 +42,7 @@ class PersonaFisica(SoggettoContattabile): titolo = models.CharField(null=True, max_length=10) nome = models.CharField(null=True, max_length=60) cognome = models.CharField(null=True, max_length=60) - + is_privato = models.BooleanField(null=False, blank=False, default=True) class PersonaGiuridica(SoggettoContattabile): class Meta: @@ -61,7 +61,7 @@ class PersonaGiuridica(SoggettoContattabile): denominazione = models.CharField(null=True, max_length=80) -class Telefono(ContattoRubrica): +class Telefono(VoceContattoRubrica): class Meta: verbose_name = 'telefono' verbose_name_plural = 'telefono' @@ -80,18 +80,18 @@ class Telefono(ContattoRubrica): note = models.CharField(null=True, max_length=64) -class Email(ContattoRubrica): +class Email(VoceContattoRubrica): class Meta: verbose_name = 'email' verbose_name_plural = 'email' def __str__(self): - eml = self.indirizzo + eml = self.indirizzo_email if self.note: eml += ' (!)' return eml - indirizzo = models.CharField(max_length=30) + indirizzo_email = models.CharField(max_length=30) note = models.CharField(null=True, max_length=64) @@ -104,7 +104,7 @@ class Pec(Email): return f"Pec (id: {self.id})" -class Fax(ContattoRubrica): +class Fax(VoceContattoRubrica): class Meta: verbose_name = 'fax' verbose_name_plural = 'fax' @@ -118,23 +118,12 @@ class Fax(ContattoRubrica): numero = models.CharField(null=True, max_length=20) note = models.CharField(null=True, max_length=64) -class Indirizzo(PolymorphicModel, AbstractIndirizzo): +class Indirizzo(VoceContattoRubrica, AbstractIndirizzo): class Meta(AbstractIndirizzo.Meta): pass -class Residenza(Indirizzo): - class Meta: - verbose_name = 'residenza' - verbose_name_plural = 'residenze' - - def __str__(self): - return f"Residenza (id: {self.id})" - - inquilino = models.ForeignKey(SoggettoContattabile, on_delete=models.CASCADE, - null=True, blank=True, related_name="residenze") - -class Sede(Residenza): +class Sede(Indirizzo): class Meta: verbose_name = 'sede' verbose_name_plural = 'sedi' @@ -164,7 +153,7 @@ class Societa(models.Model): ragione_sociale = models.CharField(max_length=1024) nazione = models.ForeignKey('dati_geo_app.Nazione', on_delete=models.CASCADE, null=True, blank=True, related_name="societa") - sede_legale = models.IntegerField() + class PersonaContattoAzienda(PersonaFisica): class Meta: diff --git a/django/fattura_elettronica_app/migrations/0001_initial.py b/django/fattura_elettronica_app/migrations/0001_initial.py index 92bc83a..8c57fc2 100644 --- a/django/fattura_elettronica_app/migrations/0001_initial.py +++ b/django/fattura_elettronica_app/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.7 on 2023-05-14 13:48 +# Generated by Django 4.1.7 on 2023-05-14 15:43 from django.db import migrations, models import django.db.models.deletion @@ -9,8 +9,8 @@ class Migration(migrations.Migration): dependencies = [ ("dati_geo_app", "0007_delete_indirizzo"), - ("contenttypes", "0002_remove_content_type_name"), ("contatti_app", "0001_initial"), + ("contenttypes", "0002_remove_content_type_name"), ] operations = [ @@ -597,7 +597,6 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ("sede_legale", models.IntegerField()), ("cod_eori", models.CharField(max_length=17, null=True)), ("numero_licenza_guida", models.CharField(max_length=20, null=True)), ("rimosso", models.BooleanField(blank=True, null=True)), @@ -689,6 +688,14 @@ class Migration(migrations.Migration): to="fattura_elettronica_app.regimefiscale", ), ), + ( + "sede_legale", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="SoggettoFiscale_da_Indirizzo", + to="contatti_app.indirizzo", + ), + ), ( "stabile_organizzazione", models.ForeignKey( @@ -1015,7 +1022,7 @@ class Migration(migrations.Migration): null=True, on_delete=django.db.models.deletion.CASCADE, related_name="SoggettiFatturaElettronica_da_DatoDiContatto_contatto_cedente_prestatore", - to="contatti_app.contattorubrica", + to="contatti_app.vocecontattorubrica", ), ), migrations.AddField( diff --git a/django/fattura_elettronica_app/migrations/0002_rename_sede_legale_soggettofiscale_sede.py b/django/fattura_elettronica_app/migrations/0002_rename_sede_legale_soggettofiscale_sede.py new file mode 100644 index 0000000..48aeef9 --- /dev/null +++ b/django/fattura_elettronica_app/migrations/0002_rename_sede_legale_soggettofiscale_sede.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.7 on 2023-05-14 16:17 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("fattura_elettronica_app", "0001_initial"), + ] + + operations = [ + migrations.RenameField( + model_name="soggettofiscale", + old_name="sede_legale", + new_name="sede", + ), + ] diff --git a/django/fattura_elettronica_app/models.py b/django/fattura_elettronica_app/models.py index 6782dd3..6032ad7 100644 --- a/django/fattura_elettronica_app/models.py +++ b/django/fattura_elettronica_app/models.py @@ -137,7 +137,7 @@ class SoggettiFatturaElettronica(models.Model): formato_trasmissione = models.ForeignKey('FormatoTrasmissione', on_delete=models.CASCADE, null=True, blank=True, related_name="SoggettiFatturaElettronica_da_FormatoTrasmissione_formato_trasmissione") - contatto_cedente_prestatore = models.ForeignKey('contatti_app.ContattoRubrica', on_delete=models.CASCADE, null=True, + contatto_cedente_prestatore = models.ForeignKey('contatti_app.VoceContattoRubrica', on_delete=models.CASCADE, null=True, blank=True, related_name="SoggettiFatturaElettronica_da_DatoDiContatto_contatto_cedente_prestatore") riferimento_amministrazione = models.CharField(null=True, max_length=20) trasmittente = models.ForeignKey('SoggettoFiscale', on_delete=models.CASCADE, @@ -173,7 +173,8 @@ class SoggettoFiscale(PolymorphicModel): blank=True, related_name="SoggettoFiscale_da_PartitaIvaCF_partita_iva") codice_sdi = models.ForeignKey('CodiceDestinatario', on_delete=models.CASCADE, null=True, blank=True, related_name="SoggettoFiscale_da_CodiceDestinatario_codice_sdi") - sede_legale = models.IntegerField() + sede = models.ForeignKey('contatti_app.Indirizzo', on_delete=models.CASCADE, null=False, + blank=False, related_name="SoggettoFiscale_da_Indirizzo") stabile_organizzazione = models.ForeignKey('contatti_app.Indirizzo',null=True, blank=True,on_delete=models.SET_NULL,related_name='stabile_organizzazione') cod_eori = models.CharField(null=True, max_length=17) nazione = models.ForeignKey('dati_geo_app.Nazione', on_delete=models.CASCADE, null=True, diff --git a/django/offerte_app/migrations/0001_initial.py b/django/offerte_app/migrations/0001_initial.py index 8ea0c65..c153dac 100644 --- a/django/offerte_app/migrations/0001_initial.py +++ b/django/offerte_app/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.7 on 2023-05-14 13:48 +# Generated by Django 4.1.7 on 2023-05-14 15:43 from django.db import migrations, models import django.db.models.deletion @@ -8,8 +8,8 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ("contatti_app", "0001_initial"), ("fattura_elettronica_app", "0001_initial"), + ("contatti_app", "0001_initial"), ] operations = [ diff --git a/django/sangue_app/migrations/0001_initial.py b/django/sangue_app/migrations/0001_initial.py index bf3e95f..d7f5d08 100644 --- a/django/sangue_app/migrations/0001_initial.py +++ b/django/sangue_app/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.7 on 2023-05-14 13:48 +# Generated by Django 4.1.7 on 2023-05-14 15:43 from django.db import migrations, models import django.db.models.deletion diff --git a/django/sangue_django/modello_dati.xml b/django/sangue_django/modello_dati.xml index 68e72c5..71d164b 100644 --- a/django/sangue_django/modello_dati.xml +++ b/django/sangue_django/modello_dati.xml @@ -37,7 +37,7 @@ - +
INTEGER NULL @@ -47,13 +47,13 @@ NULL INTEGER -NULL +NULL id
- +
INTEGER NULL @@ -82,7 +82,7 @@ id
- +
INTEGER NULL @@ -109,7 +109,7 @@ id
- +
INTEGER NULL @@ -120,7 +120,7 @@ persona_ptr
- +
INTEGER NULL @@ -137,7 +137,7 @@ Serve solo per fatturazioni trasversali
- +
INTEGER NULL @@ -152,7 +152,7 @@ id
- +
INTEGER NULL @@ -212,19 +212,19 @@ id
- - +
+ INTEGER -NULL +NULL - + INTEGER NULL -persona_ptr +personafisica_ptr
- +
INTEGER NULL @@ -712,7 +712,7 @@ canaledidistribuzione_ptr
- +
INTEGER NULL @@ -774,7 +774,7 @@ id
- +
INTEGER NULL @@ -788,7 +788,7 @@ id
- +
INTEGER NULL @@ -802,7 +802,7 @@ id
- +
INTEGER NULL @@ -816,7 +816,7 @@ id
- +
INTEGER NULL @@ -830,7 +830,7 @@ id
- +
INTEGER NULL @@ -844,7 +844,7 @@ id
- +
INTEGER NULL @@ -858,7 +858,7 @@ id
- +
INTEGER NULL @@ -876,7 +876,7 @@ id
- +
INTEGER NULL @@ -886,7 +886,7 @@ INTEGER -NULL +NULL VARCHAR(20) @@ -919,15 +919,10 @@ id
- - +
+ INTEGER -NULL - - -INTEGER -NULL - +NULL INTEGER NULL @@ -940,41 +935,49 @@ INTEGER NULL - + INTEGER -NULL - -INTEGER -NULL - -VARCHAR(17) -NULL - -INTEGER -NULL +NULL +one2one + + +INTEGER +NULL - -VARCHAR(20) -NULL INTEGER NULL - + INTEGER -NULL - -INTEGER -NULL +NULL + +INTEGER +NULL + + +INTEGER +NULL + + +VARCHAR(17) +NULL + +VARCHAR(20) +NULL bit NULL + +INTEGER +NULL + id
- +
INTEGER NULL @@ -985,7 +988,7 @@ id
- +
INTEGER NULL @@ -999,7 +1002,7 @@ id
- +
INTEGER NULL @@ -1013,7 +1016,7 @@ id
- +
INTEGER NULL @@ -1027,37 +1030,40 @@ id
- +
INTEGER NULL - + INTEGER -NULL +NULL id
- - +
+ INTEGER -NULL +NULL VARCHAR(20) 'NULL' + +INTEGER +NULL VARCHAR(64) NULL -datodicontatto_ptr +contattorubrica_ptr
- - +
+ INTEGER -NULL +NULL VARCHAR(30) @@ -1066,10 +1072,10 @@ VARCHAR(64) NULL -datodicontatto_ptr +contattorubrica_ptr
- +
INTEGER NULL @@ -1085,13 +1091,13 @@ NULL INTEGER -NULL +NULL id
- +
INTEGER NULL @@ -1117,7 +1123,7 @@ id
- +
INTEGER NULL @@ -1131,7 +1137,7 @@ id
- +
INTEGER NULL @@ -1145,7 +1151,7 @@ id
- +
INTEGER NULL @@ -1161,7 +1167,7 @@ id
- +
INTEGER NULL @@ -1175,10 +1181,10 @@ id
- - +
+ INTEGER -NULL +NULL VARCHAR(10) @@ -1189,22 +1195,26 @@ VARCHAR(60) NULL + +bit +NULL -soggetto_fiscale_ptr +soggettocontattabile_ptr
- - +
+ INTEGER -NULL +NULL VARCHAR(80) NULL +soggettocontattabile_ptr
- +
INTEGER NULL @@ -1219,7 +1229,7 @@ id
- +
INTEGER NULL @@ -1246,7 +1256,7 @@ id
- +
INTEGER NULL @@ -1296,7 +1306,7 @@ id
- +
INTEGER NULL @@ -1310,7 +1320,7 @@ id
- +
INTEGER NULL @@ -1340,7 +1350,7 @@ DatiOrdineAcquisto, DatiContratto, DatiConvenzione, DatiRicezione
- +
INTEGER NULL @@ -1356,7 +1366,7 @@ id
- +
INTEGER NULL @@ -1371,7 +1381,7 @@ id
- +
INTEGER NULL @@ -1389,14 +1399,14 @@ id
- +
INTEGER NULL INTEGER -NULL +NULL INTEGER @@ -1441,7 +1451,7 @@ id
- +
INTEGER NULL @@ -1455,7 +1465,7 @@ id
- +
INTEGER NULL @@ -1477,7 +1487,7 @@ id
- +
INTEGER NULL @@ -1491,7 +1501,7 @@ id
- +
INTEGER NULL @@ -1502,7 +1512,7 @@ id
- +
INTEGER NULL @@ -1533,7 +1543,7 @@ id
- +
INTEGER NULL @@ -1551,7 +1561,7 @@ id
- +
INTEGER NULL @@ -1565,7 +1575,7 @@ id
- +
INTEGER NULL @@ -1583,7 +1593,7 @@ id
- +
INTEGER NULL @@ -1605,7 +1615,7 @@ id
- +
INTEGER NULL @@ -1625,7 +1635,7 @@ id
- +
INTEGER NULL @@ -1641,7 +1651,7 @@ id
- +
INTEGER NULL @@ -1655,7 +1665,7 @@ id
- +
INTEGER NULL @@ -1689,7 +1699,7 @@ id
- +
INTEGER NULL @@ -1713,7 +1723,7 @@ id
- +
INTEGER NULL @@ -1727,7 +1737,7 @@ id
- +
INTEGER NULL @@ -1742,7 +1752,7 @@ id
- +
INTEGER NULL @@ -1756,7 +1766,7 @@ id
- +
INTEGER NULL @@ -1772,7 +1782,7 @@ id
- +
INTEGER NULL @@ -1786,7 +1796,7 @@ id
- +
INTEGER NULL @@ -1800,7 +1810,7 @@ id
- +
INTEGER NULL @@ -1816,7 +1826,7 @@ id
- +
INTEGER NULL @@ -1832,7 +1842,7 @@ id
- +
INTEGER NULL @@ -1849,7 +1859,7 @@ id
- +
INTEGER NULL @@ -1863,7 +1873,7 @@ id
- +
INTEGER NULL @@ -1890,14 +1900,14 @@ id
- - -INTEGER -NULL - +
INTEGER -NULL +NULL + + +INTEGER +NULL bit @@ -1906,10 +1916,10 @@ indirizzo_ptr
- - +
+ INTEGER -NULL +NULL VARCHAR(20) @@ -1918,19 +1928,19 @@ VARCHAR(64) NULL -datodicontatto_ptr +contattorubrica_ptr
- +
INTEGER -NULL +NULL email_ptr
- +
VARCHAR(5) 'None' @@ -1938,7 +1948,7 @@ codice
- +
INTEGER None @@ -1959,7 +1969,7 @@ id
- +
INTEGER None @@ -1975,7 +1985,7 @@ id
- +
VARCHAR(40) 'None' @@ -1983,7 +1993,7 @@ nome
- +
INTEGER None @@ -2008,11 +2018,15 @@ VARCHAR(40)'None' + +INTEGER +NULL + id
- +
VARCHAR(2) 'None' @@ -2027,7 +2041,7 @@ sigla
- +
VARCHAR(32) 'None' @@ -2035,7 +2049,7 @@ nome
- +
INTEGER NULL @@ -2051,4 +2065,42 @@ id
+ + +INTEGER +NULL + +id + +
+ + +INTEGER +NULL + + + +contattorubrica_ptr + +<AbstractIndirizzo> +
+ + +INTEGER +NULL + +INTEGER +NULL + + +INTEGER +NULL + + +VARCHAR(1024) +NULL + +id + +