diff --git a/RIGS/finance.py b/RIGS/finance.py index 2ae0fc47..73552f2e 100644 --- a/RIGS/finance.py +++ b/RIGS/finance.py @@ -55,6 +55,7 @@ class InvoicePrint(generic.View): } }, 'invoice':invoice, + 'current_user':request.user, }) rml = template.render(context) diff --git a/RIGS/models.py b/RIGS/models.py index 49963a6f..636c7dca 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -71,6 +71,15 @@ class RevisionMixin(object): else: return None + @property + def current_version_id(self): + versions = reversion.get_for_object(self) + if versions: + version = reversion.get_for_object(self)[0] + return "V{0} | R{1}".format(version.pk,version.revision.pk) + else: + return None + @reversion.register @python_2_unicode_compatible class Person(models.Model, RevisionMixin): diff --git a/RIGS/rigboard.py b/RIGS/rigboard.py index 27f00307..b13a19c8 100644 --- a/RIGS/rigboard.py +++ b/RIGS/rigboard.py @@ -104,7 +104,8 @@ class EventPrint(generic.View): 'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF', } }, - 'copy':copy + 'copy':copy, + 'current_user':request.user, }) # context['copy'] = copy # this is the way to do it once we upgrade to Django 1.8.3 diff --git a/RIGS/templates/RIGS/event_print.xml b/RIGS/templates/RIGS/event_print.xml index 152886e0..6d693117 100644 --- a/RIGS/templates/RIGS/event_print.xml +++ b/RIGS/templates/RIGS/event_print.xml @@ -102,6 +102,8 @@ {% if not invoice %}[{{ copy }} Copy]{% endif %} [Page of ] + + [Paperwork generated by {{current_user.name}} | {% now "d/m/Y H:i" %} | {{object.current_version_id}}] @@ -115,6 +117,8 @@ {% if not invoice %}[{{ copy }} Copy]{% endif %} [Page of ] + + [Paperwork generated by {{current_user.name}} | {% now "d/m/Y H:i" %} | {{object.current_version_id}}]