mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-01 21:02:15 +00:00
Fix paperwork printing
This commit is contained in:
@@ -55,8 +55,8 @@ class InvoicePrint(generic.View):
|
|||||||
invoice = get_object_or_404(models.Invoice, pk=pk)
|
invoice = get_object_or_404(models.Invoice, pk=pk)
|
||||||
object = invoice.event
|
object = invoice.event
|
||||||
template = get_template('RIGS/event_print.xml')
|
template = get_template('RIGS/event_print.xml')
|
||||||
copies = ('TEC', 'Client')
|
|
||||||
context = RequestContext(request, {
|
context = {
|
||||||
'object': object,
|
'object': object,
|
||||||
'fonts': {
|
'fonts': {
|
||||||
'opensans': {
|
'opensans': {
|
||||||
@@ -66,7 +66,7 @@ class InvoicePrint(generic.View):
|
|||||||
},
|
},
|
||||||
'invoice': invoice,
|
'invoice': invoice,
|
||||||
'current_user': request.user,
|
'current_user': request.user,
|
||||||
})
|
}
|
||||||
|
|
||||||
rml = template.render(context)
|
rml = template.render(context)
|
||||||
buffer = StringIO.StringIO()
|
buffer = StringIO.StringIO()
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ class EventDuplicate(EventUpdate):
|
|||||||
context["duplicate"] = True
|
context["duplicate"] = True
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
class EventPrint(generic.View):
|
class EventPrint(generic.View):
|
||||||
def get(self, request, pk):
|
def get(self, request, pk):
|
||||||
object = get_object_or_404(models.Event, pk=pk)
|
object = get_object_or_404(models.Event, pk=pk)
|
||||||
@@ -144,9 +145,9 @@ class EventPrint(generic.View):
|
|||||||
|
|
||||||
merger = PdfFileMerger()
|
merger = PdfFileMerger()
|
||||||
|
|
||||||
for copy in copies:
|
for thisCopy in copies:
|
||||||
|
|
||||||
context = RequestContext(request, { # this should be outside the loop, but bug in 1.8.2 prevents this
|
context = { # this should be outside the loop, but bug in 1.8.2 prevents this
|
||||||
'object': object,
|
'object': object,
|
||||||
'fonts': {
|
'fonts': {
|
||||||
'opensans': {
|
'opensans': {
|
||||||
@@ -154,9 +155,9 @@ class EventPrint(generic.View):
|
|||||||
'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF',
|
'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'copy':copy,
|
'copy': thisCopy,
|
||||||
'current_user':request.user,
|
'current_user': request.user,
|
||||||
})
|
}
|
||||||
|
|
||||||
# context['copy'] = copy # this is the way to do it once we upgrade to Django 1.8.3
|
# context['copy'] = copy # this is the way to do it once we upgrade to Django 1.8.3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user