From ba92000dc9b74b00ae92a28d6523995e1d743fac Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 17 Feb 2016 07:58:23 -0200 Subject: [PATCH] =?UTF-8?q?Adiciona=20c=C3=B3digo=20de=20autentica=C3=A7?= =?UTF-8?q?=C3=A3o=20ao=20comprovante?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocoloadm/views.py | 10 +++++++++- templates/protocoloadm/comprovante.html | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/protocoloadm/views.py b/protocoloadm/views.py index 9e20d93d7..34156ac95 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -327,8 +327,16 @@ class ComprovanteProtocoloView(TemplateView): base64_data = create_barcode(numero.zfill(6)) barcode = 'data:image/png;base64,{0}'.format(base64_data) + autenticacao = "** NULO **" + + if not protocolo.anulado: + autenticacao = str(protocolo.tipo_processo) + \ + protocolo.data.strftime("%y/%m/%d") + \ + str(protocolo.numero).zfill(6) + return self.render_to_response({"protocolo": protocolo, - "barcode": barcode}) + "barcode": barcode, + "autenticacao": autenticacao}) class ProtocoloMateriaView(FormMixin, GenericView): diff --git a/templates/protocoloadm/comprovante.html b/templates/protocoloadm/comprovante.html index d85823a66..43a2c02f2 100644 --- a/templates/protocoloadm/comprovante.html +++ b/templates/protocoloadm/comprovante.html @@ -43,7 +43,7 @@ {{ protocolo.numero|stringformat:'06d' }} - Autenticação ?? + Autenticação: {{ autenticacao }}