|
@@ -34,11 +34,30 @@ def detail_document(request, pk):
|
|
return render(
|
|
return render(
|
|
request, 'costs/document_detail.html', {
|
|
request, 'costs/document_detail.html', {
|
|
'document': doc,
|
|
'document': doc,
|
|
|
|
+ 'other_documents': Document.objects.exclude(pk=doc.pk),
|
|
'breadcrumbs': breadcrumbs,
|
|
'breadcrumbs': breadcrumbs,
|
|
'total_recuring_costs': doc.get_total_recuring_costs(),
|
|
'total_recuring_costs': doc.get_total_recuring_costs(),
|
|
'total_goods': doc.get_total_goods()
|
|
'total_goods': doc.get_total_goods()
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+@login_required
|
|
|
|
+def compare_document(request, pk, other_pk):
|
|
|
|
+ doc = Document.objects.get(pk=pk)
|
|
|
|
+ other_doc = Document.objects.get(pk=other_pk)
|
|
|
|
+
|
|
|
|
+ breadcrumbs = (
|
|
|
|
+ ('Documents', reverse('list-documents')),
|
|
|
|
+ (str(doc), doc.get_absolute_url()),
|
|
|
|
+ ('Variations depuis {}'.format(other_doc), request.path),
|
|
|
|
+ )
|
|
|
|
+ context = {
|
|
|
|
+ 'breadcrumbs': breadcrumbs,
|
|
|
|
+ 'document': doc,
|
|
|
|
+ 'other_document': other_doc,
|
|
|
|
+ 'deltas': doc.compare(other_doc),
|
|
|
|
+ }
|
|
|
|
+ return render(request, 'costs/document_compare.html', context)
|
|
|
|
+
|
|
|
|
|
|
@login_required
|
|
@login_required
|
|
def detail_service(request, pk):
|
|
def detail_service(request, pk):
|