netbox-contract 2.2.1__tar.gz → 2.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {netbox_contract-2.2.1/src/netbox_contract.egg-info → netbox_contract-2.2.2}/PKG-INFO +1 -1
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/pyproject.toml +1 -1
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/__init__.py +1 -1
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/api/serializers.py +25 -6
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/api/views.py +3 -1
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/filtersets.py +2 -4
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/forms.py +15 -6
- netbox_contract-2.2.2/src/netbox_contract/migrations/0035_accountingdimension_status_and_more.py +24 -0
- netbox_contract-2.2.2/src/netbox_contract/migrations/0036_alter_invoiceline_accounting_dimensions.py +19 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/models.py +25 -3
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/templates/netbox_contract/accountingdimension.html +4 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/urls.py +20 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2/src/netbox_contract.egg-info}/PKG-INFO +1 -1
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract.egg-info/SOURCES.txt +2 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/LICENSE +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/MANIFEST.in +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/README.md +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/setup.cfg +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/setup.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/api/__init__.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/api/urls.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/constants.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0001_initial.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0002_alter_contract_circuit_and_more.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0003_alter_contract_custom_field_data_and_more.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0004_contract_currency_invoice_currency.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0005_contract_accounting_dimensions_and_more.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0006_alter_contract_circuit.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0007_invoice_date.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0008_invoice_comments.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0009_contract_external_reference.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0010_invoice_contracts.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0011_auto_20230122_2112.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0012_remove_invoice_contract.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0013_contract_documents_invoice_documents.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0014_contract_end_date.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0015_contractassignement.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0016_contract_parent.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0017_alter_contract_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0018_contract_external_partie_object_id_and_more.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0019_auto_20230924_1813.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0020_alter_contract_external_partie.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0021_alter_contract_external_partie.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0022_alter_contract_internal_partie_alter_contract_parent.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0023_rename_contractassignement_contractassignment_and_more.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0024_remove_contract_external_partie.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0025_remove_contract_circuit_and_more.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0026_auto_20240421_1550.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0027_invoiceline.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0028_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0029_remove_invoiceline_accounting_dimensions_and_more.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0030_alter_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0031_contract_invoice_template_invoice_template.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0032_alter_invoice_period_end_alter_invoice_period_start_and_more.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0033_remove_contract_invoice_template.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0034_contract_yrc_alter_contract_mrc.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/__init__.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/navigation.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/search.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/tables.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/template_content.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/templates/contract_assignments_bottom.html +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/templates/contract_list_bottom.html +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/templates/netbox_contract/contract.html +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/templates/netbox_contract/contractassignment.html +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/templates/netbox_contract/invoice.html +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/templates/netbox_contract/invoiceline.html +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/templates/netbox_contract/serviceprovider.html +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/views.py +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract.egg-info/dependency_links.txt +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract.egg-info/not-zip-safe +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract.egg-info/requires.txt +0 -0
- {netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract.egg-info/top_level.txt +0 -0
|
@@ -5,7 +5,7 @@ class ContractsConfig(PluginConfig):
|
|
|
5
5
|
name = 'netbox_contract'
|
|
6
6
|
verbose_name = 'Netbox contract'
|
|
7
7
|
description = 'Contract management plugin for Netbox'
|
|
8
|
-
version = '2.2.
|
|
8
|
+
version = '2.2.2'
|
|
9
9
|
author = 'Marc Lebreuil'
|
|
10
10
|
author_email = 'marc@famillelebreuil.net'
|
|
11
11
|
base_url = 'contracts'
|
|
@@ -50,7 +50,7 @@ class NestedInvoiceSerializer(WritableNestedSerializer):
|
|
|
50
50
|
|
|
51
51
|
class NestedContractAssignmentSerializer(WritableNestedSerializer):
|
|
52
52
|
url = serializers.HyperlinkedIdentityField(
|
|
53
|
-
view_name='plugins-api:netbox_contract-api:
|
|
53
|
+
view_name='plugins-api:netbox_contract-api:contractassignment-detail'
|
|
54
54
|
)
|
|
55
55
|
|
|
56
56
|
class Meta:
|
|
@@ -61,18 +61,25 @@ class NestedContractAssignmentSerializer(WritableNestedSerializer):
|
|
|
61
61
|
|
|
62
62
|
class NestedInvoicelineSerializer(WritableNestedSerializer):
|
|
63
63
|
url = serializers.HyperlinkedIdentityField(
|
|
64
|
-
view_name='plugins-api:netbox_contract-api:
|
|
64
|
+
view_name='plugins-api:netbox_contract-api:invoiceline-detail'
|
|
65
65
|
)
|
|
66
66
|
|
|
67
67
|
class Meta:
|
|
68
68
|
model = InvoiceLine
|
|
69
|
-
fields = ('id', 'url', 'display', 'invoice', 'amount')
|
|
70
|
-
brief_fields = (
|
|
69
|
+
fields = ('id', 'url', 'display', 'invoice', 'accounting_dimensions', 'amount')
|
|
70
|
+
brief_fields = (
|
|
71
|
+
'id',
|
|
72
|
+
'url',
|
|
73
|
+
'display',
|
|
74
|
+
'invoice',
|
|
75
|
+
'accounting_dimensions',
|
|
76
|
+
'amount',
|
|
77
|
+
)
|
|
71
78
|
|
|
72
79
|
|
|
73
80
|
class NestedAccountingDimensionSerializer(WritableNestedSerializer):
|
|
74
81
|
url = serializers.HyperlinkedIdentityField(
|
|
75
|
-
view_name='plugins-api:netbox_contract-api:
|
|
82
|
+
view_name='plugins-api:netbox_contract-api:accountingdimension-detail'
|
|
76
83
|
)
|
|
77
84
|
|
|
78
85
|
class Meta:
|
|
@@ -227,6 +234,10 @@ class InvoiceLineSerializer(NetBoxModelSerializer):
|
|
|
227
234
|
url = serializers.HyperlinkedIdentityField(
|
|
228
235
|
view_name='plugins-api:netbox_contract-api:invoiceline-detail'
|
|
229
236
|
)
|
|
237
|
+
invoice = NestedInvoiceSerializer(many=False, required=False)
|
|
238
|
+
accounting_dimensions = NestedAccountingDimensionSerializer(
|
|
239
|
+
many=True, required=False
|
|
240
|
+
)
|
|
230
241
|
|
|
231
242
|
class Meta:
|
|
232
243
|
model = InvoiceLine
|
|
@@ -237,13 +248,21 @@ class InvoiceLineSerializer(NetBoxModelSerializer):
|
|
|
237
248
|
'invoice',
|
|
238
249
|
'amount',
|
|
239
250
|
'currency',
|
|
251
|
+
'accounting_dimensions',
|
|
240
252
|
'comments',
|
|
241
253
|
'tags',
|
|
242
254
|
'custom_fields',
|
|
243
255
|
'created',
|
|
244
256
|
'last_updated',
|
|
245
257
|
)
|
|
246
|
-
brief_fields = (
|
|
258
|
+
brief_fields = (
|
|
259
|
+
'invoice',
|
|
260
|
+
'accounting_dimensions',
|
|
261
|
+
'amount',
|
|
262
|
+
'url',
|
|
263
|
+
'display',
|
|
264
|
+
'name',
|
|
265
|
+
)
|
|
247
266
|
|
|
248
267
|
|
|
249
268
|
class AccountingDimensionSerializer(NetBoxModelSerializer):
|
|
@@ -40,7 +40,9 @@ class ContractAssignmentViewSet(NetBoxModelViewSet):
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
class InvoiceLineViewSet(NetBoxModelViewSet):
|
|
43
|
-
queryset = models.InvoiceLine.objects.prefetch_related(
|
|
43
|
+
queryset = models.InvoiceLine.objects.prefetch_related(
|
|
44
|
+
'invoice', 'accounting_dimensions', 'tags'
|
|
45
|
+
)
|
|
44
46
|
serializer_class = InvoiceLineSerializer
|
|
45
47
|
|
|
46
48
|
|
|
@@ -61,7 +61,7 @@ class InvoiceLineFilterSet(NetBoxModelFilterSet):
|
|
|
61
61
|
|
|
62
62
|
def search(self, queryset, name, value):
|
|
63
63
|
return queryset.filter(
|
|
64
|
-
Q(comments__icontains=value) | Q(
|
|
64
|
+
Q(comments__icontains=value) | Q(invoice__number__icontains=value)
|
|
65
65
|
)
|
|
66
66
|
|
|
67
67
|
|
|
@@ -71,6 +71,4 @@ class AccountingDimensionFilterSet(NetBoxModelFilterSet):
|
|
|
71
71
|
fields = ('name', 'value')
|
|
72
72
|
|
|
73
73
|
def search(self, queryset, name, value):
|
|
74
|
-
return queryset.filter(
|
|
75
|
-
Q(comments__icontains=value) | Q(invoice__name__icontains=value)
|
|
76
|
-
)
|
|
74
|
+
return queryset.filter(Q(comments__icontains=value) | Q(name__icontains=value))
|
|
@@ -26,6 +26,7 @@ from utilities.forms.widgets import DatePicker, HTMXSelect
|
|
|
26
26
|
from .constants import SERVICE_PROVIDER_MODELS
|
|
27
27
|
from .models import (
|
|
28
28
|
AccountingDimension,
|
|
29
|
+
AccountingDimensionStatusChoices,
|
|
29
30
|
Contract,
|
|
30
31
|
ContractAssignment,
|
|
31
32
|
InternalEntityChoices,
|
|
@@ -147,7 +148,7 @@ class ContractForm(NetBoxModelForm):
|
|
|
147
148
|
def clean(self):
|
|
148
149
|
super().clean()
|
|
149
150
|
|
|
150
|
-
if self.cleaned_data['mrc'] and self.cleaned_data['
|
|
151
|
+
if self.cleaned_data['mrc'] and self.cleaned_data['yrc']:
|
|
151
152
|
raise ValidationError(
|
|
152
153
|
'you should set monthly OR yearly recuring costs not both'
|
|
153
154
|
)
|
|
@@ -488,10 +489,7 @@ class InvoiceLineForm(NetBoxModelForm):
|
|
|
488
489
|
|
|
489
490
|
class InvoiceLineFilterSetForm(NetBoxModelFilterSetForm):
|
|
490
491
|
model = InvoiceLine
|
|
491
|
-
invoice = DynamicModelChoiceField(queryset=Invoice.objects.all())
|
|
492
|
-
accounting_dimensions = DynamicModelMultipleChoiceField(
|
|
493
|
-
queryset=AccountingDimension.objects.all()
|
|
494
|
-
)
|
|
492
|
+
invoice = DynamicModelChoiceField(queryset=Invoice.objects.all(), required=False)
|
|
495
493
|
|
|
496
494
|
|
|
497
495
|
class InvoiceLineImportForm(NetBoxModelImportForm):
|
|
@@ -502,7 +500,8 @@ class InvoiceLineImportForm(NetBoxModelImportForm):
|
|
|
502
500
|
)
|
|
503
501
|
accounting_dimensions = CSVModelChoiceField(
|
|
504
502
|
queryset=AccountingDimension.objects.all(),
|
|
505
|
-
|
|
503
|
+
to_field_name='id',
|
|
504
|
+
help_text='accounting dimension id',
|
|
506
505
|
)
|
|
507
506
|
|
|
508
507
|
class Meta:
|
|
@@ -534,6 +533,7 @@ class AccountingDimensionForm(NetBoxModelForm):
|
|
|
534
533
|
fields = [
|
|
535
534
|
'name',
|
|
536
535
|
'value',
|
|
536
|
+
'status',
|
|
537
537
|
'comments',
|
|
538
538
|
'tags',
|
|
539
539
|
]
|
|
@@ -542,17 +542,26 @@ class AccountingDimensionForm(NetBoxModelForm):
|
|
|
542
542
|
class AccountingDimensionFilterSetForm(NetBoxModelFilterSetForm):
|
|
543
543
|
model = AccountingDimension
|
|
544
544
|
|
|
545
|
+
name = forms.CharField(required=False)
|
|
546
|
+
value = forms.CharField(required=False)
|
|
547
|
+
status = forms.ChoiceField(choices=AccountingDimensionStatusChoices, required=False)
|
|
548
|
+
|
|
545
549
|
|
|
546
550
|
class AccountingDimensionImportForm(NetBoxModelImportForm):
|
|
551
|
+
status = CSVChoiceField(choices=StatusChoices, help_text='Contract status')
|
|
552
|
+
|
|
547
553
|
class Meta:
|
|
548
554
|
model = AccountingDimension
|
|
549
555
|
fields = [
|
|
550
556
|
'name',
|
|
551
557
|
'value',
|
|
558
|
+
'status',
|
|
552
559
|
'comments',
|
|
553
560
|
'tags',
|
|
554
561
|
]
|
|
555
562
|
|
|
556
563
|
|
|
557
564
|
class AccountingDimensionBulkEditForm(NetBoxModelBulkEditForm):
|
|
565
|
+
name = forms.CharField(max_length=20, required=False)
|
|
566
|
+
value = forms.CharField(max_length=20, required=False)
|
|
558
567
|
model = AccountingDimension
|
netbox_contract-2.2.2/src/netbox_contract/migrations/0035_accountingdimension_status_and_more.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated by Django 5.0.6 on 2024-08-18 10:03
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
('extras', '0115_convert_dashboard_widgets'),
|
|
9
|
+
('netbox_contract', '0034_contract_yrc_alter_contract_mrc'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddField(
|
|
14
|
+
model_name='accountingdimension',
|
|
15
|
+
name='status',
|
|
16
|
+
field=models.CharField(default='Active', max_length=50),
|
|
17
|
+
),
|
|
18
|
+
migrations.AddConstraint(
|
|
19
|
+
model_name='accountingdimension',
|
|
20
|
+
constraint=models.UniqueConstraint(
|
|
21
|
+
fields=('name', 'value'), name='unique_accounting_dimension'
|
|
22
|
+
),
|
|
23
|
+
),
|
|
24
|
+
]
|
netbox_contract-2.2.2/src/netbox_contract/migrations/0036_alter_invoiceline_accounting_dimensions.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Generated by Django 5.0.6 on 2024-08-18 19:37
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
('netbox_contract', '0035_accountingdimension_status_and_more'),
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
operations = [
|
|
12
|
+
migrations.AlterField(
|
|
13
|
+
model_name='invoiceline',
|
|
14
|
+
name='accounting_dimensions',
|
|
15
|
+
field=models.ManyToManyField(
|
|
16
|
+
blank=True, to='netbox_contract.accountingdimension'
|
|
17
|
+
),
|
|
18
|
+
),
|
|
19
|
+
]
|
|
@@ -20,6 +20,18 @@ class StatusChoices(ChoiceSet):
|
|
|
20
20
|
]
|
|
21
21
|
|
|
22
22
|
|
|
23
|
+
class AccountingDimensionStatusChoices(ChoiceSet):
|
|
24
|
+
key = 'AccountingDimension.status'
|
|
25
|
+
|
|
26
|
+
STATUS_ACTIVE = 'Active'
|
|
27
|
+
STATUS_INACTIVE = 'Inactive'
|
|
28
|
+
|
|
29
|
+
CHOICES = [
|
|
30
|
+
(STATUS_ACTIVE, 'Active', 'green'),
|
|
31
|
+
(STATUS_INACTIVE, 'Inactive', 'red'),
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
|
|
23
35
|
class InternalEntityChoices(ChoiceSet):
|
|
24
36
|
key = 'Contract.internal_partie'
|
|
25
37
|
|
|
@@ -44,6 +56,11 @@ class CurrencyChoices(ChoiceSet):
|
|
|
44
56
|
class AccountingDimension(NetBoxModel):
|
|
45
57
|
name = models.CharField(max_length=20)
|
|
46
58
|
value = models.CharField(max_length=20)
|
|
59
|
+
status = models.CharField(
|
|
60
|
+
max_length=50,
|
|
61
|
+
choices=AccountingDimensionStatusChoices,
|
|
62
|
+
default=StatusChoices.STATUS_ACTIVE,
|
|
63
|
+
)
|
|
47
64
|
comments = models.TextField(blank=True)
|
|
48
65
|
|
|
49
66
|
def get_absolute_url(self):
|
|
@@ -56,6 +73,13 @@ class AccountingDimension(NetBoxModel):
|
|
|
56
73
|
def __str__(self):
|
|
57
74
|
return self.dimension
|
|
58
75
|
|
|
76
|
+
class Meta:
|
|
77
|
+
constraints = [
|
|
78
|
+
models.UniqueConstraint(
|
|
79
|
+
fields=['name', 'value'], name='unique_accounting_dimension'
|
|
80
|
+
)
|
|
81
|
+
]
|
|
82
|
+
|
|
59
83
|
|
|
60
84
|
class ServiceProvider(ContactsMixin, NetBoxModel):
|
|
61
85
|
name = models.CharField(max_length=100)
|
|
@@ -215,9 +239,7 @@ class InvoiceLine(NetBoxModel):
|
|
|
215
239
|
max_length=3, choices=CurrencyChoices, default=CurrencyChoices.CURRENCY_USD
|
|
216
240
|
)
|
|
217
241
|
amount = models.DecimalField(max_digits=10, decimal_places=2)
|
|
218
|
-
accounting_dimensions = models.ManyToManyField(
|
|
219
|
-
AccountingDimension, related_name='invoicelines', blank=True
|
|
220
|
-
)
|
|
242
|
+
accounting_dimensions = models.ManyToManyField(AccountingDimension, blank=True)
|
|
221
243
|
comments = models.TextField(blank=True)
|
|
222
244
|
|
|
223
245
|
def get_absolute_url(self):
|
|
@@ -182,6 +182,16 @@ urlpatterns = (
|
|
|
182
182
|
views.InvoiceLineBulkImportView.as_view(),
|
|
183
183
|
name='invoiceline_import',
|
|
184
184
|
),
|
|
185
|
+
path(
|
|
186
|
+
'invoiceline/edit/',
|
|
187
|
+
views.InvoiceLineBulkEditView.as_view(),
|
|
188
|
+
name='invoiceline_bulk_edit',
|
|
189
|
+
),
|
|
190
|
+
path(
|
|
191
|
+
'invoiceline/delete/',
|
|
192
|
+
views.InvoiceLineBulkDeleteView.as_view(),
|
|
193
|
+
name='invoiceline_bulk_delete',
|
|
194
|
+
),
|
|
185
195
|
path(
|
|
186
196
|
'invoiceline/<int:pk>/',
|
|
187
197
|
views.InvoiceLineView.as_view(),
|
|
@@ -219,6 +229,16 @@ urlpatterns = (
|
|
|
219
229
|
views.AccountingDimensionBulkImportView.as_view(),
|
|
220
230
|
name='accountingdimension_import',
|
|
221
231
|
),
|
|
232
|
+
path(
|
|
233
|
+
'accountingdimension/edit/',
|
|
234
|
+
views.AccountingDimensionBulkEditView.as_view(),
|
|
235
|
+
name='accountingdimension_bulk_edit',
|
|
236
|
+
),
|
|
237
|
+
path(
|
|
238
|
+
'accountingdimension/delete/',
|
|
239
|
+
views.AccountingDimensionBulkDeleteView.as_view(),
|
|
240
|
+
name='accountingdimension_bulk_delete',
|
|
241
|
+
),
|
|
222
242
|
path(
|
|
223
243
|
'accountingdimension/<int:pk>/',
|
|
224
244
|
views.AccountingDimensionView.as_view(),
|
|
@@ -58,6 +58,8 @@ src/netbox_contract/migrations/0031_contract_invoice_template_invoice_template.p
|
|
|
58
58
|
src/netbox_contract/migrations/0032_alter_invoice_period_end_alter_invoice_period_start_and_more.py
|
|
59
59
|
src/netbox_contract/migrations/0033_remove_contract_invoice_template.py
|
|
60
60
|
src/netbox_contract/migrations/0034_contract_yrc_alter_contract_mrc.py
|
|
61
|
+
src/netbox_contract/migrations/0035_accountingdimension_status_and_more.py
|
|
62
|
+
src/netbox_contract/migrations/0036_alter_invoiceline_accounting_dimensions.py
|
|
61
63
|
src/netbox_contract/migrations/__init__.py
|
|
62
64
|
src/netbox_contract/templates/contract_assignments_bottom.html
|
|
63
65
|
src/netbox_contract/templates/contract_list_bottom.html
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0001_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0007_invoice_date.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract/migrations/0027_invoiceline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.2.1 → netbox_contract-2.2.2}/src/netbox_contract.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|