summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-07-11 01:37:12 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-07-11 01:37:12 +0200
commita25984d0634044013f8547f727c2dc6b625406a5 (patch)
treeb04d8589708f69d9fa3993bf36340107b50ed00e
parent9de7962bbbb45108bdfc9a1dc7a8a5bc25715cc4 (diff)
downloadIshtar-a25984d0634044013f8547f727c2dc6b625406a5.tar.bz2
Ishtar-a25984d0634044013f8547f727c2dc6b625406a5.zip
Preventive file: add some fields - better sheet - Administrativ act: add comment
-rw-r--r--archaeological_files/forms.py36
-rw-r--r--archaeological_files/migrations/0108_auto_20220711_0128.py70
-rw-r--r--archaeological_files/models.py6
-rw-r--r--archaeological_files/templates/ishtar/sheet_file.html48
-rw-r--r--archaeological_operations/forms.py2
-rw-r--r--archaeological_operations/migrations/0108_auto_20220711_0112.py27
-rw-r--r--archaeological_operations/models.py4
-rw-r--r--archaeological_operations/templates/ishtar/sheet_administrativeact.html1
8 files changed, 150 insertions, 44 deletions
diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py
index 1623e901f..defb7ba05 100644
--- a/archaeological_files/forms.py
+++ b/archaeological_files/forms.py
@@ -524,14 +524,14 @@ class FileFormPreventiveDetail(forms.ModelForm, CustomForm, ManageOldType):
class Meta:
model = models.File
fields = [
+ "intervention_period",
+ "study_period",
+ "report_due_period",
"start_date",
"end_date",
"ground_start_date",
"ground_end_date",
- "intervention_period",
- "study_period",
"execution_report_date",
- "report_due_date",
"type_of_agreement",
"operation_type_for_royalties",
"total_developed_surface",
@@ -540,6 +540,21 @@ class FileFormPreventiveDetail(forms.ModelForm, CustomForm, ManageOldType):
]
pk = forms.IntegerField(label="", required=False, widget=forms.HiddenInput)
+ intervention_period = forms.CharField(
+ label=_("Intervention period"),
+ max_length=200,
+ required=False,
+ )
+ study_period = forms.CharField(
+ label=_("Study period"),
+ max_length=200,
+ required=False,
+ )
+ report_due_period = forms.CharField(
+ label=_("Report due period"),
+ max_length=200,
+ required=False,
+ )
start_date = forms.DateField(
label=_("Start date"),
required=False,
@@ -560,26 +575,11 @@ class FileFormPreventiveDetail(forms.ModelForm, CustomForm, ManageOldType):
required=False,
widget=DatePicker(attrs={"bs_col_width": "col-6 col-lg-3"}),
)
- intervention_period = forms.CharField(
- label=_("Intervention period"),
- max_length=200,
- required=False,
- )
- study_period = forms.CharField(
- label=_("Study period"),
- max_length=200,
- required=False,
- )
execution_report_date = forms.DateField(
label=_("Execution report date"),
required=False,
widget=DatePicker(attrs={"bs_col_width": "col-6 col-lg-3"}),
)
- report_due_date = forms.DateField(
- label=_("Report due date"),
- required=False,
- widget=DatePicker(attrs={"bs_col_width": "col-6 col-lg-3"}),
- )
total_developed_surface = forms.FloatField(
widget=widgets.AreaWidget(attrs={"bs_col_width": "col-6 col-lg-3"}),
label=_("Total developed surface (m2)"),
diff --git a/archaeological_files/migrations/0108_auto_20220711_0128.py b/archaeological_files/migrations/0108_auto_20220711_0128.py
new file mode 100644
index 000000000..edda06d21
--- /dev/null
+++ b/archaeological_files/migrations/0108_auto_20220711_0128.py
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.28 on 2022-07-11 01:28
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('archaeological_files', '0107_auto_20220705_1612'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='priceagreement',
+ options={'ordering': ('order', 'start_date', 'end_date', 'label'), 'verbose_name': 'Price agreement', 'verbose_name_plural': 'Price agreement'},
+ ),
+ migrations.AddField(
+ model_name='file',
+ name='intervention_period',
+ field=models.CharField(blank=True, default='', max_length=200, verbose_name='Intervention period'),
+ ),
+ migrations.AddField(
+ model_name='file',
+ name='report_due_period',
+ field=models.CharField(blank=True, default='', max_length=200, verbose_name='Report due period'),
+ ),
+ migrations.AddField(
+ model_name='historicalfile',
+ name='intervention_period',
+ field=models.CharField(blank=True, default='', max_length=200, verbose_name='Intervention period'),
+ ),
+ migrations.AddField(
+ model_name='historicalfile',
+ name='report_due_period',
+ field=models.CharField(blank=True, default='', max_length=200, verbose_name='Report due period'),
+ ),
+ migrations.AlterField(
+ model_name='equipmentservicecost',
+ name='unit',
+ field=models.CharField(blank=True, choices=[('D', 'days'), ('W', 'weeks'), ('M', 'months'), ('L', 'linear m.')], max_length=1, null=True, verbose_name='Unit'),
+ ),
+ migrations.AlterField(
+ model_name='file',
+ name='permit_reference',
+ field=models.TextField(blank=True, default='', verbose_name='Permit/order reference'),
+ ),
+ migrations.AlterField(
+ model_name='historicalfile',
+ name='permit_reference',
+ field=models.TextField(blank=True, default='', verbose_name='Permit/order reference'),
+ ),
+ migrations.AlterField(
+ model_name='job',
+ name='default_daily_need',
+ field=models.FloatField(default=0, verbose_name='Def. daily number on study'),
+ ),
+ migrations.AlterField(
+ model_name='preventivefilegroundjob',
+ name='job',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='archaeological_files.Job', verbose_name='Job'),
+ ),
+ migrations.AlterField(
+ model_name='preventivefilejob',
+ name='job',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='archaeological_files.Job', verbose_name='Job'),
+ ),
+ ]
diff --git a/archaeological_files/models.py b/archaeological_files/models.py
index cc1ca7c2a..c8a328633 100644
--- a/archaeological_files/models.py
+++ b/archaeological_files/models.py
@@ -691,6 +691,9 @@ class File(
study_period = models.CharField(
_("Study period"), max_length=200, default="", blank=True
)
+ report_due_period = models.CharField(
+ _("Report due period"), max_length=200, default="", blank=True
+ )
start_date = models.DateField(_("Start date"), blank=True, null=True)
end_date = models.DateField(_("End date"), blank=True, null=True)
ground_start_date = models.DateField(_("Ground start date"), blank=True, null=True)
@@ -698,9 +701,6 @@ class File(
execution_report_date = models.DateField(
_("Execution report date"), blank=True, null=True
)
- report_due_date = models.DateField(
- _("Report due by"), blank=True, null=True
- )
linear_meter = models.IntegerField(_("Linear meter"), blank=True, null=True)
type_of_agreement = models.ForeignKey(
AgreementType, blank=True, null=True,
diff --git a/archaeological_files/templates/ishtar/sheet_file.html b/archaeological_files/templates/ishtar/sheet_file.html
index d54d29e7e..417977a11 100644
--- a/archaeological_files/templates/ishtar/sheet_file.html
+++ b/archaeological_files/templates/ishtar/sheet_file.html
@@ -243,11 +243,13 @@
<div class="tab-pane fade show active" id="{{window_id}}-costs"
role="tabpanel" aria-labelledby="{{window_id}}-costs-tab">
<div class="row">
+ {% field_flex "Intervention period" item.intervention_period %}
+ {% field_flex "Study period" item.study_period %}
+ {% field_flex "Report due period" item.report_due_period %}
{% field_flex "Start date" item.start_date|date:"DATE_FORMAT" %}
{% field_flex "End date" item.end_date|date:"DATE_FORMAT" %}
{% field_flex "Ground start date" item.ground_start_date|date:"DATE_FORMAT" %}
{% field_flex "Ground end date" item.ground_end_date|date:"DATE_FORMAT" %}
- {% field_flex "Study period" item.study_period %}
{% field_flex "Execution report date" item.execution_report_date|date:"DATE_FORMAT" %}
</div>
<div class="row">
@@ -276,17 +278,17 @@
<thead>
<tr>
<th>{% trans "Job" %}</th>
- <th colspan="3">{% trans "Planned" %}</th>
- <th colspan="3">{% trans "Effective" %}</th>
+ <th colspan="3" class="text-center">{% trans "Planned" %}</th>
+ <th colspan="3" class="text-center">{% trans "Effective" %}</th>
</tr>
<tr>
<td>&nbsp;</td>
- <th>{% trans "Man by day" %}</th>
- <th>{% trans "Days" %}</th>
- <th>{% trans "Cost" %}</th>
- <th>{% trans "Man by day" %}</th>
- <th>{% trans "Days" %}</th>
- <th>{% trans "Cost" %}</th>
+ <th class="text-center">{% trans "Man by day" %}</th>
+ <th class="text-center">{% trans "Days" %}</th>
+ <th class="text-center">{% trans "Cost" %}</th>
+ <th class="text-center">{% trans "Man by day" %}</th>
+ <th class="text-center">{% trans "Days" %}</th>
+ <th class="text-center">{% trans "Cost" %}</th>
</tr>
</thead>
{% for job in item.ground_jobs.all %}
@@ -328,17 +330,17 @@
<thead>
<tr>
<th>{% trans "Job" %}</th>
- <th colspan="3">{% trans "Planned" %}</th>
- <th colspan="3">{% trans "Effective" %}</th>
+ <th colspan="3" class="text-center">{% trans "Planned" %}</th>
+ <th colspan="3" class="text-center">{% trans "Effective" %}</th>
</tr>
<tr>
<td>&nbsp;</td>
- <th>{% trans "Man by day" %}</th>
- <th>{% trans "Days" %}</th>
- <th>{% trans "Cost" %}</th>
- <th>{% trans "Man by day" %}</th>
- <th>{% trans "Days" %}</th>
- <th>{% trans "Cost" %}</th>
+ <th class="text-center">{% trans "Man by day" %}</th>
+ <th class="text-center">{% trans "Days" %}</th>
+ <th class="text-center">{% trans "Cost" %}</th>
+ <th class="text-center">{% trans "Man by day" %}</th>
+ <th class="text-center">{% trans "Days" %}</th>
+ <th class="text-center">{% trans "Cost" %}</th>
</tr>
</thead>
{% for job in item.jobs.all %}
@@ -380,17 +382,17 @@
<thead>
<tr>
<th>{% trans "Equipment / service" %}</th>
- <th colspan="4">{% trans "Planned" %}</th>
- <th colspan="4">{% trans "Effective" %}</th>
+ <th colspan="4" class="text-center">{% trans "Planned" %}</th>
+ <th colspan="4" class="text-center">{% trans "Effective" %}</th>
</tr>
<tr>
<td>&nbsp;</td>
- <th>{% trans "Quantity" %}</th>
+ <th class="text-center">{% trans "Quantity" %}</th>
<th colspan="2">&nbsp;</th>
- <th>{% trans "Cost" %}</th>
- <th>{% trans "Quantity" %}</th>
+ <th class="text-center">{% trans "Cost" %}</th>
+ <th class="text-center">{% trans "Quantity" %}</th>
<th colspan="2">&nbsp;</th>
- <th>{% trans "Cost" %}</th>
+ <th class="text-center">{% trans "Cost" %}</th>
</tr>
</thead>
{% for equipment in equipments %}
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index bdc351c35..b092e91f7 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -1634,6 +1634,7 @@ class AdministrativeActOpeSelect(TableSelect):
label=_("Department"), choices=[])
act_object = forms.CharField(label=_("Object"),
max_length=300)
+ comment = forms.CharField(label=_("Comment"), max_length=500)
history_creator = forms.IntegerField(
label=_("Created by"),
widget=widgets.JQueryAutoComplete(
@@ -1695,6 +1696,7 @@ class AdministrativeActForm(CustomForm, ManageOldType):
act_object = forms.CharField(label=_("Object"), max_length=300,
widget=forms.Textarea, required=False)
signature_date = DateField(label=_("Signature date"), required=False)
+ comment = forms.CharField(label=_("Comment"), widget=forms.Textarea, required=False)
if settings.COUNTRY == 'fr':
ref_sra = forms.CharField(label="Autre référence", max_length=15,
required=False)
diff --git a/archaeological_operations/migrations/0108_auto_20220711_0112.py b/archaeological_operations/migrations/0108_auto_20220711_0112.py
new file mode 100644
index 000000000..db1359d7b
--- /dev/null
+++ b/archaeological_operations/migrations/0108_auto_20220711_0112.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.28 on 2022-07-11 01:12
+from __future__ import unicode_literals
+
+import datetime
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('archaeological_operations', '0107_auto_20210326_1434'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='administrativeact',
+ name='comment',
+ field=models.TextField(blank=True, default='', verbose_name='Comment'),
+ ),
+ migrations.AddField(
+ model_name='historicaladministrativeact',
+ name='comment',
+ field=models.TextField(blank=True, default='', verbose_name='Comment'),
+ ),
+ ]
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index a716bff8d..731d6cb34 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -2447,6 +2447,9 @@ class AdministrativeAct(DocumentItem, BaseHistorizedItem, OwnPerms, ValueGetter)
pgettext_lazy("key for text search", "treatment-file-type"),
"treatment_file__type__label__iexact",
),
+ "comment": SearchAltName(
+ pgettext_lazy("key for text search", "comment"), "comment__iexact"
+ ),
}
ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES)
ALT_NAMES.update(DocumentItem.ALT_NAMES)
@@ -2540,6 +2543,7 @@ class AdministrativeAct(DocumentItem, BaseHistorizedItem, OwnPerms, ValueGetter)
default="",
help_text=_("Cached values get from associated towns"),
)
+ comment = models.TextField(_("Comment"), blank=True, default="")
documents = models.ManyToManyField(
Document,
related_name="administrativeacts",
diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact.html b/archaeological_operations/templates/ishtar/sheet_administrativeact.html
index 843d5fc8d..a524ad04d 100644
--- a/archaeological_operations/templates/ishtar/sheet_administrativeact.html
+++ b/archaeological_operations/templates/ishtar/sheet_administrativeact.html
@@ -68,6 +68,7 @@
<span class='value'>{{ item.general_contractor.attached_to }}</span></p>{% endif %} <!-- Contractor's organisation displayed as concat of Name/Adress/postal_code/city -->
{% if item.general_contractor %}<p><label>{%trans "General contractor"%}</label> <span class='value'>{{ item.general_contractor.full_label }}</span></p>{% endif %}
{% endcomment %}
+ {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %}
</div>
</div>
{% if item.documents.count %}